summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-10-23 14:21:49 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2014-10-23 14:21:49 (GMT)
commit3639055e92674942795f6780eef4d4242d83ee19 (patch)
tree6ce6c3b0571e97d167a3cf73f298e1eb79f2d6dc
parentc210cfd1ff14e666cc7c59014a97c8b891215ff6 (diff)
downloadroundcubemail-plugins-kolab-roundcubemail-plugins-kolab-format2-horde5.tar.gz
Fix import of vcard contacts (array -> string conversion) as reposted in OTRS #1007441 + export photosroundcubemail-plugins-kolab-format2-horde5
-rw-r--r--plugins/kolab_addressbook/lib/rcube_kolab_contacts.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/plugins/kolab_addressbook/lib/rcube_kolab_contacts.php b/plugins/kolab_addressbook/lib/rcube_kolab_contacts.php
index 16a8811..17a29a5 100644
--- a/plugins/kolab_addressbook/lib/rcube_kolab_contacts.php
+++ b/plugins/kolab_addressbook/lib/rcube_kolab_contacts.php
@@ -65,7 +65,7 @@ class rcube_kolab_contacts extends rcube_addressbook
'label' => 'kolab_addressbook.pgppublickey'),
'pkcs7publickey' => array('type' => 'textarea', 'size' => 70, 'rows' => 10, 'limit' => 1,
'label' => 'kolab_addressbook.pkcs7publickey'),
- 'notes' => array(),
+ 'notes' => array('limit' => 1),
'photo' => array(),
// TODO: define more Kolab-specific fields such as: language, latitude, longitude, crypto settings
);
@@ -1086,7 +1086,7 @@ class rcube_kolab_contacts extends rcube_addressbook
// photo is stored as separate attachment
if ($record['photo'] && strlen($record['photo']) < 255 && ($att = $record['_attachments'][$record['photo']])) {
// only fetch photo content if requested
- if ($this->action == 'photo')
+ if ($this->action == 'photo' || $this->action == 'export')
$record['photo'] = $att['content'] ? $att['content'] : $this->storagefolder->get_attachment($record['uid'], $att['id']);
}
@@ -1158,6 +1158,13 @@ class rcube_kolab_contacts extends rcube_addressbook
unset($contact['address:'.$type]);
}
+ // convert array values into single strings (OTRS #1007441)
+ foreach ($this->coltypes as $col => $props) {
+ if ($props['limit'] === 1 && is_array($contact[$col])) {
+ $contact[$col] = $contact[$col][0];
+ }
+ }
+
$contact['website'] = $websites;
$contact['phone'] = $phones;
$contact['address'] = $addresses;