From 9d94c1613d86107f52d85bc79b5e0be369956a16 Mon Sep 17 00:00:00 2001 From: nathangray Date: Mon, 28 Sep 2020 09:14:45 -0600 Subject: [PATCH] Addressbook: Export listed accounts as being in the addressbook of the exporter. They now are 'Accounts' --- .../inc/class.addressbook_export_contacts_csv.inc.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/addressbook/inc/class.addressbook_export_contacts_csv.inc.php b/addressbook/inc/class.addressbook_export_contacts_csv.inc.php index 23bd595506..603de90f00 100644 --- a/addressbook/inc/class.addressbook_export_contacts_csv.inc.php +++ b/addressbook/inc/class.addressbook_export_contacts_csv.inc.php @@ -31,6 +31,11 @@ class addressbook_export_contacts_csv implements importexport_iface_export_plugi { $this->ui= new addressbook_ui(); $this->get_selects(); + + // Override types so we can specify owner 0 = 'Accounts' + $this->types = addressbook_egw_record::$types; + $this->types['select-account'] = array_diff($this->types['select-account'], ['owner']); + $this->types['select'][] = 'owner'; } /** @@ -287,7 +292,7 @@ class addressbook_export_contacts_csv implements importexport_iface_export_plugi // Some conversion $this->convert($contact, $options); if($options['convert']) { - importexport_export_csv::convert($contact, addressbook_egw_record::$types, 'addressbook',$this->selects); + importexport_export_csv::convert($contact, $this->types, 'addressbook',$this->selects); } else { // Implode arrays, so they don't say 'Array' foreach($contact->get_record_array() as $key => $value) { @@ -425,7 +430,8 @@ class addressbook_export_contacts_csv implements importexport_iface_export_plugi protected function get_selects() { $this->selects = array( - 'tid' => array('n' => 'Contact') + 'tid' => array('n' => 'Contact'), + 'owner' => $this->ui->get_addressbooks(Api\Acl::READ) ); foreach($this->ui->content_types as $tid => $data) {