forked from extern/egroupware
* CardDAV/Addressbook: storing Apple AB type company (X-ABShowAs:COMPANY) as EGroupware fileAs company
This commit is contained in:
parent
2b39a7a059
commit
7badca95da
@ -724,6 +724,7 @@ class addressbook_groupdav extends groupdav_handler
|
||||
unset($supportedFields['TEL;CELL;WORK']);
|
||||
$supportedFields['TEL;IPHONE'] = array('tel_cell_private');
|
||||
unset($supportedFields['TEL;CELL;HOME']);
|
||||
$supportedFields['X-ABSHOWAS'] = array('fileas_type'); // Horde vCard class uses uppercase prop-names!
|
||||
// Apple Addressbook pre Lion (OS X 10.7) messes up CLASS and CATEGORIES (Lion cant set them but leaves them alone)
|
||||
if (preg_match('|CFNetwork/([0-9]+)|i', $_SERVER['HTTP_USER_AGENT'],$matches) && $matches[1] < 520)
|
||||
{
|
||||
|
@ -73,6 +73,7 @@ class addressbook_vcal extends addressbook_bo
|
||||
'X-ASSISTANT-TEL' => array('tel_assistent'),
|
||||
'UID' => array('uid'),
|
||||
'REV' => array('modified'),
|
||||
//set for Apple: 'X-ABSHOWAS' => array('fileas_type'), // Horde vCard class uses uppercase prop-names!
|
||||
);
|
||||
|
||||
/**
|
||||
@ -379,6 +380,18 @@ class addressbook_vcal extends addressbook_bo
|
||||
}
|
||||
break;
|
||||
|
||||
case 'n_fn':
|
||||
case 'fileas_type':
|
||||
// mark entries with fileas_type == 'org_name' as X-ABSHOWAS:COMPANY (Apple AB specific)
|
||||
if (isset($this->supportedFields['X-ABSHOWAS']) &&
|
||||
$entry['org_name'] == $entry['n_fileas'] && $entry['fileas_type'] == 'org_name')
|
||||
{
|
||||
if ($vcardField == 'X-ABSHOWAS') $value = 'COMPANY';
|
||||
if ($databaseField == 'n_fn') $value = $entry['org_name'];
|
||||
}
|
||||
//error_log("vcardField='$vcardField', databaseField='$databaseField', this->supportedFields['X-ABSHOWAS']=".array2string($this->supportedFields['X-ABSHOWAS'])." --> value='$value'");
|
||||
// fall-through
|
||||
|
||||
default:
|
||||
if (($size > 0) && strlen(implode(',', $values) . $value) > $size)
|
||||
{
|
||||
@ -928,6 +941,14 @@ class addressbook_vcal extends addressbook_bo
|
||||
$contact[$fieldName] = str_replace("\r\n", "\n", $vcardValues[$vcardKey]['value']);
|
||||
break;
|
||||
|
||||
case 'fileas_type':
|
||||
// store Apple's X-ABSHOWAS:COMPANY as fileas_type == 'org_name'
|
||||
if ($vcardValues[$vcardKey]['value'] == 'COMPANY')
|
||||
{
|
||||
$contact[$fieldName] = 'org_name';
|
||||
}
|
||||
break;
|
||||
|
||||
case 'uid':
|
||||
if (strlen($value) < $minimum_uid_length) {
|
||||
// we don't use it
|
||||
|
Loading…
Reference in New Issue
Block a user