Fix saving birthday date in XML after import from vCard

This commit is contained in:
Aleksander Machniak 2012-12-31 17:41:30 +01:00
parent fdf9b884e7
commit 892d91af3e

View file

@ -1163,6 +1163,14 @@ class rcube_kolab_contacts extends rcube_addressbook
$contact[$key] = $val;
}
// convert one-item-array elements into string element
// this is needed e.g. to properly import birthday field
foreach ($this->coltypes as $type => $col_def) {
if ($col_def['limit'] == 1 && is_array($contact[$type])) {
$contact[$type] = array_shift(array_filter($contact[$type]));
}
}
// add empty values for some fields which can be removed in the UI
return array_filter($contact) + array('nickname' => '', 'birthday' => '', 'anniversary' => '', 'freebusyurl' => '', 'photo' => $contact['photo']);
}