2 commits - plugins/kolab_addressbook

Aleksander Machniak machniak at kolabsys.com
Thu Sep 20 09:41:44 CEST 2012


 plugins/kolab_addressbook/lib/rcube_kolab_contacts.php |   16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

New commits:
commit ba214ecba8415800d849acd05f369e16ee54cf7a
Merge: 1c57ac4 cf6a99b
Author: Aleksander Machniak <machniak at kolabsys.com>
Date:   Thu Sep 20 09:41:35 2012 +0200

    Merge branch 'master' of ssh://git.kolab.org/git/roundcube



commit 1c57ac425d40e0db16529fa081c7b85d256cd7fb
Author: Aleksander Machniak <alec at alec.pl>
Date:   Thu Sep 20 09:39:15 2012 +0200

    Partial fix for #1030

diff --git a/plugins/kolab_addressbook/lib/rcube_kolab_contacts.php b/plugins/kolab_addressbook/lib/rcube_kolab_contacts.php
index d2d0aad..f04a1c2 100644
--- a/plugins/kolab_addressbook/lib/rcube_kolab_contacts.php
+++ b/plugins/kolab_addressbook/lib/rcube_kolab_contacts.php
@@ -1105,12 +1105,16 @@ class rcube_kolab_contacts extends rcube_addressbook
             $contact['uid'] = $old['uid'];
 
         $contact['email'] = array_filter($this->get_col_values('email', $contact, true));
-        $contact['im'] = array_filter($this->get_col_values('im', $contact, true));
-        
+        $contact['im']    = array_filter($this->get_col_values('im', $contact, true));
+
+        $websites  = array();
+        $phones    = array();
+        $addresses = array();
+
         foreach ($this->get_col_values('website', $contact) as $type => $values) {
             foreach ((array)$values as $url) {
                 if (!empty($url)) {
-                    $contact['website'][] = array('url' => $url, 'type' => $type);
+                    $websites[] = array('url' => $url, 'type' => $type);
                 }
             }
             unset($contact['website:'.$type]);
@@ -1119,13 +1123,12 @@ class rcube_kolab_contacts extends rcube_addressbook
         foreach ($this->get_col_values('phone', $contact) as $type => $values) {
             foreach ((array)$values as $phone) {
                 if (!empty($phone)) {
-                    $contact['phone'][] = array('number' => $phone, 'type' => $type);
+                    $phones[] = array('number' => $phone, 'type' => $type);
                 }
             }
             unset($contact['phone:'.$type]);
         }
 
-        $addresses = array();
         foreach ($this->get_col_values('address', $contact) as $type => $values) {
             foreach ((array)$values as $adr) {
                 // skip empty address
@@ -1145,6 +1148,9 @@ class rcube_kolab_contacts extends rcube_addressbook
 
             unset($contact['address:'.$type]);
         }
+
+        $contact['website'] = $websites;
+        $contact['phone']   = $phones;
         $contact['address'] = $addresses;
 
         // copy meta data (starting with _) from old object





More information about the commits mailing list