diff --git a/importexport/inc/class.importexport_import_csv.inc.php b/importexport/inc/class.importexport_import_csv.inc.php index 99494a5628..e1af4a89ff 100755 --- a/importexport/inc/class.importexport_import_csv.inc.php +++ b/importexport/inc/class.importexport_import_csv.inc.php @@ -342,13 +342,15 @@ class importexport_import_csv implements importexport_iface_import_record { //, try { $formatted = new egw_time($record[$name]); } catch (Exception $e) { - $warnings[] = $name.': ' . $e->getMessage(); + $warnings[] = $name.': ' . $e->getMessage() . "\n" . + 'Format: '.'!'.egw_time::$user_dateformat . ' ' .egw_time::$user_timeformat; continue; } $errors = egw_time::getLastErrors(); foreach($errors['errors'] as $char => $msg) { - $warnings[] = "$name: [$char] $msg"; + $warnings[] = "$name: [$char] $msg\n". + 'Format: '.'!'.egw_time::$user_dateformat . ' ' .egw_time::$user_timeformat; } } } diff --git a/infolog/inc/class.infolog_import_infologs_csv.inc.php b/infolog/inc/class.infolog_import_infologs_csv.inc.php index 312e1a294a..c2f21ee8a7 100644 --- a/infolog/inc/class.infolog_import_infologs_csv.inc.php +++ b/infolog/inc/class.infolog_import_infologs_csv.inc.php @@ -176,6 +176,13 @@ 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']); 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->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 if(!$record['info_status'] && $record['info_type']) { @@ -264,6 +271,12 @@ class infolog_import_infologs_csv implements importexport_iface_import_plugin { $success = $this->action( 'insert', $record, $import_csv->get_current_position() ); } if($success) $count++; + if($this->warnings[$import_csv->get_current_position()]) { + $this->warnings[$import_csv->get_current_position()] .= "\nRecord:\n" .array2string($record); + } + if($this->errors[$import_csv->get_current_position()]) { + $this->errors[$import_csv->get_current_position()] .= "\nRecord:\n" .array2string($record); + } } return $count; }