Give a warning if imported type is not valid

This commit is contained in:
Nathan Gray 2012-02-29 00:39:09 +00:00
parent b126ccf8c3
commit a0128663ed

View File

@ -176,6 +176,12 @@ class infolog_import_infologs_csv implements importexport_iface_import_plugin {
$result = importexport_import_csv::convert($record, infolog_egw_record::$types, 'infolog', $lookups, $_definition->plugin_options['convert']); $result = importexport_import_csv::convert($record, infolog_egw_record::$types, 'infolog', $lookups, $_definition->plugin_options['convert']);
if($result) $this->warnings[$import_csv->get_current_position()] = $result; if($result) $this->warnings[$import_csv->get_current_position()] = $result;
// Make sure type is valid
if(!$record['info_type'] || $record['info_type'] && !$this->boinfolog->enums['type'][$record['info_type']])
{
$this->warnings[$import_csv->get_current_position()] .= lang('Unknown type: %1', $record['info_type']);
}
// Set default status for type, if not specified // Set default status for type, if not specified
if(!$record['info_status'] && $record['info_type']) if(!$record['info_status'] && $record['info_type'])
{ {