From 1610a7523e5b7fd5f53b11f42b1f22cb26f724af Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Thu, 20 Sep 2012 16:28:42 +0000 Subject: [PATCH] Report conversion warnings --- addressbook/inc/class.addressbook_import_contacts_csv.inc.php | 4 +++- timesheet/inc/class.timesheet_import_csv.inc.php | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/addressbook/inc/class.addressbook_import_contacts_csv.inc.php b/addressbook/inc/class.addressbook_import_contacts_csv.inc.php index 2cefc616e2..821276d1b2 100644 --- a/addressbook/inc/class.addressbook_import_contacts_csv.inc.php +++ b/addressbook/inc/class.addressbook_import_contacts_csv.inc.php @@ -166,7 +166,9 @@ class addressbook_import_contacts_csv implements importexport_iface_import_plugi // don't import empty contacts if( count( array_unique( $record ) ) < 2 ) continue; - importexport_import_csv::convert($record, addressbook_egw_record::$types, 'addressbook', $_lookups, $_definition->plugin_options['convert']); + $warning = importexport_import_csv::convert($record, addressbook_egw_record::$types, 'addressbook', $_lookups, $_definition->plugin_options['convert']); + if($warning) $this->warnings[$import_csv->get_current_position()] = $warning; + // Set owner, unless it's supposed to come from CSV file if($_definition->plugin_options['owner_from_csv'] && $record['owner']) { if(!is_numeric($record['owner'])) { diff --git a/timesheet/inc/class.timesheet_import_csv.inc.php b/timesheet/inc/class.timesheet_import_csv.inc.php index b66213670e..423465c97a 100644 --- a/timesheet/inc/class.timesheet_import_csv.inc.php +++ b/timesheet/inc/class.timesheet_import_csv.inc.php @@ -174,7 +174,8 @@ class timesheet_import_csv implements importexport_iface_import_plugin { // don't import empty records if( count( array_unique( $record ) ) < 2 ) continue; - importexport_import_csv::convert($record, timesheet_egw_record::$types, 'timesheet', $lookups); + $result = importexport_import_csv::convert($record, timesheet_egw_record::$types, 'timesheet', $lookups); + if($result) $this->warnings[$import_csv->get_current_position()] = $result; // Automatically handle text categories without explicit translation foreach(array('ts_status','cat_id') as $field) {