|
|
@ -51,7 +51,7 @@ class rcube_vcard
|
|
|
|
'edit' => 'X-AB-EDIT',
|
|
|
|
'edit' => 'X-AB-EDIT',
|
|
|
|
);
|
|
|
|
);
|
|
|
|
private $typemap = array('iPhone' => 'mobile', 'CELL' => 'mobile', 'WORK,FAX' => 'workfax');
|
|
|
|
private $typemap = array('iPhone' => 'mobile', 'CELL' => 'mobile', 'WORK,FAX' => 'workfax');
|
|
|
|
private $phonetypemap = array('HOME1' => 'HOME', 'BUSINESS1' => 'WORK', 'BUSINESS2' => 'WORK2', 'BUSINESSFAX' => 'WORK,FAX', 'WORKFAX' => 'WORK,FAX');
|
|
|
|
private $phonetypemap = array('HOME1' => 'HOME', 'BUSINESS1' => 'WORK', 'BUSINESS2' => 'WORK2', 'BUSINESSFAX' => 'WORK,FAX');
|
|
|
|
private $addresstypemap = array('BUSINESS' => 'WORK');
|
|
|
|
private $addresstypemap = array('BUSINESS' => 'WORK');
|
|
|
|
private $immap = array('X-JABBER' => 'jabber', 'X-ICQ' => 'icq', 'X-MSN' => 'msn', 'X-AIM' => 'aim', 'X-YAHOO' => 'yahoo', 'X-SKYPE' => 'skype', 'X-SKYPE-USERNAME' => 'skype');
|
|
|
|
private $immap = array('X-JABBER' => 'jabber', 'X-ICQ' => 'icq', 'X-MSN' => 'msn', 'X-AIM' => 'aim', 'X-YAHOO' => 'yahoo', 'X-SKYPE' => 'skype', 'X-SKYPE-USERNAME' => 'skype');
|
|
|
|
|
|
|
|
|
|
|
@ -252,7 +252,7 @@ class rcube_vcard
|
|
|
|
public function set($field, $value, $type = 'HOME')
|
|
|
|
public function set($field, $value, $type = 'HOME')
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$field = strtolower($field);
|
|
|
|
$field = strtolower($field);
|
|
|
|
$type = strtoupper($type);
|
|
|
|
$type_uc = strtoupper($type);
|
|
|
|
$typemap = array_flip($this->typemap);
|
|
|
|
$typemap = array_flip($this->typemap);
|
|
|
|
|
|
|
|
|
|
|
|
switch ($field) {
|
|
|
|
switch ($field) {
|
|
|
@ -301,7 +301,7 @@ class rcube_vcard
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case 'email':
|
|
|
|
case 'email':
|
|
|
|
$this->raw['EMAIL'][] = array(0 => $value, 'type' => array_filter(array('INTERNET', $type)));
|
|
|
|
$this->raw['EMAIL'][] = array(0 => $value, 'type' => array_filter(array('INTERNET', $type_uc)));
|
|
|
|
$this->email[] = $value;
|
|
|
|
$this->email[] = $value;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
@ -318,8 +318,8 @@ class rcube_vcard
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case 'address':
|
|
|
|
case 'address':
|
|
|
|
if ($this->addresstypemap[$type])
|
|
|
|
if ($this->addresstypemap[$type_uc])
|
|
|
|
$type = $this->addresstypemap[$type];
|
|
|
|
$type = $this->addresstypemap[$type_uc];
|
|
|
|
|
|
|
|
|
|
|
|
$value = $value[0] ? $value : array('', '', $value['street'], $value['locality'], $value['region'], $value['zipcode'], $value['country']);
|
|
|
|
$value = $value[0] ? $value : array('', '', $value['street'], $value['locality'], $value['region'], $value['zipcode'], $value['country']);
|
|
|
|
|
|
|
|
|
|
|
@ -328,8 +328,8 @@ class rcube_vcard
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
if ($field == 'phone' && $this->phonetypemap[$type])
|
|
|
|
if ($field == 'phone' && $this->phonetypemap[$type_uc])
|
|
|
|
$type = $this->phonetypemap[$type];
|
|
|
|
$type = $this->phonetypemap[$type_uc];
|
|
|
|
|
|
|
|
|
|
|
|
if (($tag = self::$fieldmap[$field]) && (is_array($value) || strlen($value))) {
|
|
|
|
if (($tag = self::$fieldmap[$field]) && (is_array($value) || strlen($value))) {
|
|
|
|
$index = count($this->raw[$tag]);
|
|
|
|
$index = count($this->raw[$tag]);
|
|
|
|