From 3f4016ef38c0ae126a7fadd81fc20566217230b9 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 23 Jan 2012 16:16:50 +0000 Subject: [PATCH] Add a warning if the only delegated is unknown --- .../inc/class.infolog_import_infologs_csv.inc.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/infolog/inc/class.infolog_import_infologs_csv.inc.php b/infolog/inc/class.infolog_import_infologs_csv.inc.php index 3568d253ef..619b079641 100644 --- a/infolog/inc/class.infolog_import_infologs_csv.inc.php +++ b/infolog/inc/class.infolog_import_infologs_csv.inc.php @@ -202,6 +202,18 @@ class infolog_import_infologs_csv implements importexport_iface_import_plugin { // Responsible has to be an array $record['info_responsible'] = $record['info_responsible'] ? explode(',',$record['info_responsible']) : 0; + // Check for unknown people / groups left by convert() - happens when there's only 1 assigned, and it's unknown. + foreach($record['info_responsible'] as $key => $responsible) + { + if(!is_numeric($responsible)) + { + unset($record['info_responsible'][$key]); + $this->warnings[$import_csv->get_current_position()].= + ($this->warnings[$import_csv->get_current_position()] ? "\n" : '') . + lang('%1 is not a known user or group', $responsible); + } + } + // Special values if ($record['addressbook'] && !is_numeric($record['addressbook'])) {