From ad9fe938f3feffd936323a8a44bcfe43b6da403c Mon Sep 17 00:00:00 2001 From: thomasb Date: Wed, 8 Dec 2010 19:57:31 +0000 Subject: Filter empty values before saving; also set 'phone-TYPE' fields since they seem to have priority over 'phone' array git-svn-id: https://svn.roundcube.net/trunk@4323 208e9e7b-5314-0410-a742-e7e81cd9613c --- plugins/kolab_addressbook/rcube_kolab_contacts.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'plugins') diff --git a/plugins/kolab_addressbook/rcube_kolab_contacts.php b/plugins/kolab_addressbook/rcube_kolab_contacts.php index a2400d05f..941632cba 100644 --- a/plugins/kolab_addressbook/rcube_kolab_contacts.php +++ b/plugins/kolab_addressbook/rcube_kolab_contacts.php @@ -787,13 +787,17 @@ class rcube_kolab_contacts extends rcube_addressbook $object['gender'] = $gendermap[$contact['gender']]; $emails = $this->get_col_values('email', $contact, true); - $object['emails'] = join(', ', $emails); + $object['emails'] = join(', ', array_filter($emails)); foreach ($this->get_col_values('phone', $contact) as $type => $values) { if ($this->phonetypemap[$type]) $type = $this->phonetypemap[$type]; - foreach ((array)$values as $phone) - $object['phone'][] = array('number' => $phone, 'type' => $type); + foreach ((array)$values as $phone) { + if (!empty($phone)) { + $object['phone-' . $type] = $phone; + $object['phone'][] = array('number' => $phone, 'type' => $type); + } + } } foreach ($this->get_col_values('address', $contact) as $type => $values) { -- cgit v1.2.3