From 90328bf9cde769deddcf65e35f502bc2111b5984 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 20 Dec 2011 15:51:44 +0000 Subject: [PATCH] Add warnings, use warning instead of error on link problem --- .../class.infolog_import_infologs_csv.inc.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/infolog/inc/class.infolog_import_infologs_csv.inc.php b/infolog/inc/class.infolog_import_infologs_csv.inc.php index 5634a9f384..67c643fdf4 100644 --- a/infolog/inc/class.infolog_import_infologs_csv.inc.php +++ b/infolog/inc/class.infolog_import_infologs_csv.inc.php @@ -86,6 +86,11 @@ class infolog_import_infologs_csv implements importexport_iface_import_plugin { */ private $user = null; + /** + * List of import warnings + */ + protected $warnings = array(); + /** * List of import errors */ @@ -398,6 +403,18 @@ class infolog_import_infologs_csv implements importexport_iface_import_plugin { // lets do it! } + /** + * Returns warnings that were encountered during importing + * Maximum of one warning message per record, but you can append if you need to + * + * @return Array ( + * record_# => warning message + * ) + */ + public function get_warnings() { + return $this->warnings; + } + /** * Returns errors that were encountered during importing * Maximum of one error message per record, but you can append if you need to @@ -517,7 +534,7 @@ class infolog_import_infologs_csv implements importexport_iface_import_plugin { // Only one allowed if(count($result) != 1) { - $this->errors[$record_num] .= lang('Unable to link to %3 by custom field "%1". %2 matches.', + $this->warnings[$record_num] .= lang('Unable to link to %3 by custom field "%1". %2 matches.', $custom_field, count($result), lang($app)); return false; }