mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-18 03:48:55 +01:00
Fix invalid type when importing - typo, and also check translated type too
This commit is contained in:
parent
a0a3cfb4fc
commit
074cab0f67
@ -151,7 +151,7 @@ class infolog_import_infologs_csv implements importexport_iface_import_plugin {
|
|||||||
$_definition->plugin_options['record_owner'] = $this->user;
|
$_definition->plugin_options['record_owner'] = $this->user;
|
||||||
|
|
||||||
$_lookups = array(
|
$_lookups = array(
|
||||||
'info_type' => $this->boinfolog->enums['types'],
|
'info_type' => $this->boinfolog->enums['type'],
|
||||||
'info_status' => $this->boinfolog->status['task']
|
'info_status' => $this->boinfolog->status['task']
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -181,8 +181,17 @@ class infolog_import_infologs_csv implements importexport_iface_import_plugin {
|
|||||||
// Make sure type is valid
|
// Make sure type is valid
|
||||||
if(!$record['info_type'] || $record['info_type'] && !$this->boinfolog->enums['type'][$record['info_type']])
|
if(!$record['info_type'] || $record['info_type'] && !$this->boinfolog->enums['type'][$record['info_type']])
|
||||||
{
|
{
|
||||||
$this->errors[$import_csv->get_current_position()] .= ($this->errors[$import_csv->get_current_position()] ? "\n":'').
|
// Check for translated type
|
||||||
lang('Unknown type: %1', $record['info_type']);
|
$un_trans = translation::get_message_id($record['info_type'],'infolog');
|
||||||
|
if($record['info_type'] && $this->boinfolog->enums['type'][$un_trans])
|
||||||
|
{
|
||||||
|
$record['info_type'] = $un_trans;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->errors[$import_csv->get_current_position()] .= ($this->errors[$import_csv->get_current_position()] ? "\n":'').
|
||||||
|
lang('Unknown type: %1', $record['info_type']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set default status for type, if not specified
|
// Set default status for type, if not specified
|
||||||
|
Loading…
Reference in New Issue
Block a user