Fixed PHP warning on 'gender' field handling
Added vCard fieldmap definition for Kolab-specific attributes (#254)
This commit is contained in:
parent
1ff51a5500
commit
ae4b2d6b51
1 changed files with 15 additions and 2 deletions
|
@ -56,6 +56,18 @@ class rcube_kolab_contacts extends rcube_addressbook
|
||||||
// TODO: define more Kolab-specific fields such as: language, latitude, longitude
|
// TODO: define more Kolab-specific fields such as: language, latitude, longitude
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* vCard additional fields mapping
|
||||||
|
*/
|
||||||
|
public $vcard_map = array(
|
||||||
|
'profession' => 'X-PROFESSION',
|
||||||
|
'officelocation' => 'X-OFFICE-LOCATION',
|
||||||
|
'initials' => 'X-INITIALS',
|
||||||
|
'children' => 'X-CHILDREN',
|
||||||
|
'freebusyurl' => 'X-FREEBUSY-URL',
|
||||||
|
'pgppublickey' => 'KEY',
|
||||||
|
);
|
||||||
|
|
||||||
private $gid;
|
private $gid;
|
||||||
private $storagefolder;
|
private $storagefolder;
|
||||||
private $contactstorage;
|
private $contactstorage;
|
||||||
|
@ -97,6 +109,7 @@ class rcube_kolab_contacts extends rcube_addressbook
|
||||||
'body' => 'notes',
|
'body' => 'notes',
|
||||||
'pgp-publickey' => 'pgppublickey',
|
'pgp-publickey' => 'pgppublickey',
|
||||||
'free-busy-url' => 'freebusyurl',
|
'free-busy-url' => 'freebusyurl',
|
||||||
|
'gender' => 'gender',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
@ -1105,8 +1118,8 @@ class rcube_kolab_contacts extends rcube_addressbook
|
||||||
$object['anniversary'] = date('Y-m-d', $date);
|
$object['anniversary'] = date('Y-m-d', $date);
|
||||||
|
|
||||||
$gendermap = array_flip($this->gender_map);
|
$gendermap = array_flip($this->gender_map);
|
||||||
if (isset($contact['gender']))
|
if (isset($object['gender']))
|
||||||
$object['gender'] = $gendermap[$contact['gender']];
|
$object['gender'] = $gendermap[$object['gender']];
|
||||||
|
|
||||||
$emails = $this->get_col_values('email', $contact, true);
|
$emails = $this->get_col_values('email', $contact, true);
|
||||||
$object['emails'] = join(', ', array_filter($emails));
|
$object['emails'] = join(', ', array_filter($emails));
|
||||||
|
|
Loading…
Add table
Reference in a new issue