mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-24 00:43:20 +01:00
Take field translations from wizard, if available, otherwise leave them alone
This commit is contained in:
parent
97c45ff7c8
commit
fd57cd738c
@ -153,9 +153,23 @@ class importexport_export_csv implements importexport_iface_export_record
|
||||
// Load translations for app
|
||||
list($appname, $part2) = explode('_', get_class($_record));
|
||||
if(!$GLOBALS['egw_info']['apps'][$appname]) $appname .= $part2; // Handle apps with _ in the name
|
||||
translation::add_app($appname);
|
||||
foreach($this->mapping as $field => &$label) {
|
||||
$label = lang($label);
|
||||
|
||||
// Get translations from wizard, if possible
|
||||
$backtrace = debug_backtrace();
|
||||
$plugin = $backtrace[1]['class'];
|
||||
$wizard_name = $appname . '_wizard_' . str_replace($appname . '_', '', $plugin);
|
||||
try {
|
||||
$wizard = new $wizard_name;
|
||||
$fields = $wizard->get_export_fields();
|
||||
foreach($this->mapping as $field => &$label)
|
||||
{
|
||||
if($fields[$field]) $label = $fields[$field];
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
translation::add_app($appname);
|
||||
foreach($this->mapping as $field => &$label) {
|
||||
$label = lang($label);
|
||||
}
|
||||
}
|
||||
}
|
||||
$mapping = ! empty( $this->mapping ) ? $this->mapping : array_keys ( $this->record );
|
||||
|
Loading…
Reference in New Issue
Block a user