Add warnings, use warning instead of error on link problem

This commit is contained in:
Nathan Gray 2011-12-20 15:51:44 +00:00
parent 0054184aaf
commit 90328bf9cd

View File

@ -86,6 +86,11 @@ class infolog_import_infologs_csv implements importexport_iface_import_plugin {
*/ */
private $user = null; private $user = null;
/**
* List of import warnings
*/
protected $warnings = array();
/** /**
* List of import errors * List of import errors
*/ */
@ -398,6 +403,18 @@ class infolog_import_infologs_csv implements importexport_iface_import_plugin {
// lets do it! // 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 * Returns errors that were encountered during importing
* Maximum of one error message per record, but you can append if you need to * 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 // Only one allowed
if(count($result) != 1) 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)); $custom_field, count($result), lang($app));
return false; return false;
} }