Add warnings to import plugin

This commit is contained in:
Nathan Gray 2011-12-15 16:24:47 +00:00
parent b44fd70d07
commit f6a443a917
9 changed files with 147 additions and 1 deletions

View File

@ -82,6 +82,11 @@ class addressbook_import_contacts_csv implements importexport_iface_import_plugi
*/
private $user = null;
/**
* List of import warnings
*/
protected $warnings = array();
/**
* List of import errors
*/
@ -383,6 +388,18 @@ class addressbook_import_contacts_csv implements importexport_iface_import_plugi
// 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

View File

@ -58,6 +58,11 @@ class admin_import_groups_csv implements importexport_iface_import_plugin {
*/
private $dry_run = false;
/**
* List of import warnings
*/
protected $warnings = array();
/**
* List of import errors
*/
@ -240,6 +245,18 @@ class admin_import_groups_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 concatenate them 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

View File

@ -68,6 +68,11 @@ class admin_import_users_csv implements importexport_iface_import_plugin {
*/
private $user = null;
/**
* List of import warnings
*/
protected $warnings = array();
/**
* List of import errors
*/
@ -258,6 +263,18 @@ class admin_import_users_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 concatenate them 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

View File

@ -86,6 +86,11 @@ class calendar_import_csv implements importexport_iface_import_plugin {
*/
private $user = null;
/**
* List of import warnings
*/
protected $warnings = array();
/**
* List of import errors
*/
@ -363,6 +368,18 @@ class calendar_import_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

View File

@ -83,6 +83,11 @@ class calendar_import_ical implements importexport_iface_import_plugin {
*/
private $user = null;
/**
* List of import warnings
*/
protected $warnings = array();
/**
* List of import errors
*/
@ -185,6 +190,18 @@ class calendar_import_ical 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

View File

@ -87,6 +87,16 @@ interface importexport_iface_import_plugin {
*/
public function get_errors();
/**
* Returns warnings that were encountered during importing
* Maximum of one warning message per record, but you can concatenate them if you need to
*
* @return Array (
* record_# => warning message
* )
*/
public function get_warnings();
/**
* Returns a list of actions taken, and the number of records for that action.
* Actions are things like 'insert', 'update', 'delete', and may be different for each plugin.

View File

@ -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

View File

@ -78,6 +78,11 @@ class resources_import_csv implements importexport_iface_import_plugin {
*/
private $user = null;
/**
* List of import warnings
*/
protected $warnings = array();
/**
* List of import errors
*/
@ -309,6 +314,18 @@ class resources_import_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

View File

@ -84,6 +84,11 @@ class timesheet_import_csv implements importexport_iface_import_plugin {
*/
private $user = null;
/**
* List of import warnings
*/
protected $warnings = array();
/**
* List of import errors
*/
@ -147,7 +152,7 @@ class timesheet_import_csv implements importexport_iface_import_plugin {
$categories = new categories('timesheet');
$lookups = array(
'ts_status' => $this->bo->status_labels,
'cat_id' => $categories->return_sorted_array(0,False,'','','',true)
// 'cat_id' => $categories->return_sorted_array(0,False,'','','',true)
);
// Status need leading spaces removed
@ -449,6 +454,18 @@ class timesheet_import_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