From 06ab2ffcdc95b8c4f5ced9a03171b47b9637d9bd Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 29 Apr 2013 15:32:09 +0000 Subject: [PATCH] Implement delete import action --- ...ss.addressbook_import_contacts_csv.inc.php | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/addressbook/inc/class.addressbook_import_contacts_csv.inc.php b/addressbook/inc/class.addressbook_import_contacts_csv.inc.php index 575ea299e8..31a1611fcc 100644 --- a/addressbook/inc/class.addressbook_import_contacts_csv.inc.php +++ b/addressbook/inc/class.addressbook_import_contacts_csv.inc.php @@ -212,6 +212,26 @@ class addressbook_import_contacts_csv extends importexport_basic_import_csv { switch ($_action) { case 'none' : return true; + case 'delete': + if($_data['id']) + { + if ( $this->dry_run ) { + //print_r($_data); + $this->results[$_action]++; + return true; + } + $result = $this->bocontacts->delete($_data); + if($result && $result === true) + { + $this->results[$_action]++; + } + else + { + // Failure of some kind - unknown cause + $this->errors[$record_num] = lang('unable to delete'); + } + } + break; case 'update' : // Only update if there are changes $old = $this->bocontacts->read($_data['id']);