diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-12-08 19:57:31 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-12-08 19:57:31 +0000 |
| commit | ad9fe938f3feffd936323a8a44bcfe43b6da403c (patch) | |
| tree | e89a82f51086f656b8c5a83b03b425c4600125e0 | |
| parent | f7b2458bfafe7cb2b919dae88886dd36509e5601 (diff) | |
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
| -rw-r--r-- | plugins/kolab_addressbook/rcube_kolab_contacts.php | 10 |
1 files changed, 7 insertions, 3 deletions
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) { |
