From edb42dbfd2e923648d8270531fb76171e21f70b3 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 8 Feb 2012 15:12:37 +0000 Subject: [PATCH] * eSync/Addressbook: for all-in-one addressbook only use add-default, if it is contained in addressbooks selected, otherwise use personal addressbook --- addressbook/inc/class.addressbook_activesync.inc.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/addressbook/inc/class.addressbook_activesync.inc.php b/addressbook/inc/class.addressbook_activesync.inc.php index d5c82545d3..6aa1b5ffb3 100644 --- a/addressbook/inc/class.addressbook_activesync.inc.php +++ b/addressbook/inc/class.addressbook_activesync.inc.php @@ -589,6 +589,13 @@ class addressbook_activesync implements activesync_plugin_write, activesync_plug $contact['owner'] = $account; $contact['private'] = (int)$is_private; } + // if default addressbook for new contacts is NOT synced --> use personal addressbook + elseif($GLOBALS['egw_info']['user']['preferences']['addressbook']['add_default'] && + !in_array($GLOBALS['egw_info']['user']['preferences']['addressbook']['add_default'], + array_keys($this->get_addressbooks(null,false)))) + { + $contact['owner'] = $GLOBALS['egw_info']['user']['account_id']; + } if (!empty($id)) $contact['id'] = $id; $this->addressbook->fixup_contact($contact); $newid = $this->addressbook->save($contact);