forked from extern/egroupware
Fix vCard field mapping during import (cummunity bug #3208)
This commit is contained in:
parent
acd70575c6
commit
3bce17e854
@ -795,18 +795,18 @@ class addressbook_groupdav extends groupdav_handler
|
|||||||
private function _get_handler()
|
private function _get_handler()
|
||||||
{
|
{
|
||||||
$handler = new addressbook_vcal('addressbook','text/vcard');
|
$handler = new addressbook_vcal('addressbook','text/vcard');
|
||||||
|
$supportedFields = $handler->supportedFields;
|
||||||
// Apple iOS or OS X addressbook
|
// Apple iOS or OS X addressbook
|
||||||
if ($this->agent == 'cfnetwork' || $this->agent == 'dataaccess')
|
if ($this->agent == 'cfnetwork' || $this->agent == 'dataaccess')
|
||||||
{
|
{
|
||||||
$supportedFields = $handler->supportedFields;
|
|
||||||
$databaseFields = $handler->databaseFields;
|
$databaseFields = $handler->databaseFields;
|
||||||
// use just CELL and IPHONE, CELL;WORK and CELL;HOME are NOT understood
|
// use just CELL and IPHONE, CELL;WORK and CELL;HOME are NOT understood
|
||||||
//'TEL;CELL;WORK' => array('tel_cell'),
|
//'TEL;CELL;WORK' => array('tel_cell'),
|
||||||
//'TEL;CELL;HOME' => array('tel_cell_private'),
|
//'TEL;CELL;HOME' => array('tel_cell_private'),
|
||||||
$supportedFields['TEL;CELL'] = $databaseFields['TEL;CELL'] = array('tel_cell');
|
$supportedFields['TEL;CELL'] = array('tel_cell');
|
||||||
unset($supportedFields['TEL;CELL;WORK']); unset($databaseFields['TEL;CELL;WORK']);
|
unset($supportedFields['TEL;CELL;WORK']);
|
||||||
$supportedFields['TEL;IPHONE'] = $databaseFields['TEL;IPHONE'] = array('tel_cell_private');
|
$supportedFields['TEL;IPHONE'] = array('tel_cell_private');
|
||||||
unset($supportedFields['TEL;CELL;HOME']); unset($databaseFields['TEL;CELL;HOME']);
|
unset($supportedFields['TEL;CELL;HOME']);
|
||||||
$databaseFields['X-ABSHOWAS'] = $supportedFields['X-ABSHOWAS'] = array('fileas_type'); // Horde vCard class uses uppercase prop-names!
|
$databaseFields['X-ABSHOWAS'] = $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)
|
// Apple Addressbook pre Lion (OS X 10.7) messes up CLASS and CATEGORIES (Lion cant set them but leaves them alone)
|
||||||
@ -832,9 +832,7 @@ class addressbook_groupdav extends groupdav_handler
|
|||||||
}
|
}
|
||||||
$handler->setDatabaseFields($databaseFields);
|
$handler->setDatabaseFields($databaseFields);
|
||||||
}
|
}
|
||||||
$handler->setSupportedFields('GroupDAV',$this->agent, isset($supportedFields) ?
|
$handler->setSupportedFields('GroupDAV',$this->agent,$supportedFields);
|
||||||
$supportedFields : $handler->supportedFields);
|
|
||||||
|
|
||||||
return $handler;
|
return $handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,22 +45,22 @@ class addressbook_vcal extends addressbook_bo
|
|||||||
'adr_two_postalcode','adr_two_countryname'),
|
'adr_two_postalcode','adr_two_countryname'),
|
||||||
'BDAY' => array('bday'),
|
'BDAY' => array('bday'),
|
||||||
'CLASS' => array('private'),
|
'CLASS' => array('private'),
|
||||||
'CATEGORIES' => array('cat_id'),
|
'CATEGORIES' => array('cat_id'),
|
||||||
'EMAIL;WORK' => array('email'),
|
'EMAIL;WORK' => array('email'),
|
||||||
'EMAIL;HOME' => array('email_home'),
|
'EMAIL;HOME' => array('email_home'),
|
||||||
'N' => array('n_family','n_given','n_middle',
|
'N' => array('n_family','n_given','n_middle',
|
||||||
'n_prefix','n_suffix'),
|
'n_prefix','n_suffix'),
|
||||||
'FN' => array('n_fn'),
|
'FN' => array('n_fn'),
|
||||||
'NOTE' => array('note'),
|
'NOTE' => array('note'),
|
||||||
'ORG' => array('org_name','org_unit','room'),
|
'ORG' => array('org_name','org_unit','room'),
|
||||||
'TEL;CELL;WORK' => array('tel_cell'),
|
'TEL;CELL;WORK' => array('tel_cell'),
|
||||||
'TEL;CELL;HOME' => array('tel_cell_private'),
|
'TEL;CELL;HOME' => array('tel_cell_private'),
|
||||||
'TEL;CAR' => array('tel_car'),
|
'TEL;CAR' => array('tel_car'),
|
||||||
'TEL;OTHER' => array('tel_other'),
|
'TEL;OTHER' => array('tel_other'),
|
||||||
'TEL;VOICE;WORK' => array('tel_work'),
|
'TEL;VOICE;WORK' => array('tel_work'),
|
||||||
'TEL;FAX;WORK' => array('tel_fax'),
|
'TEL;FAX;WORK' => array('tel_fax'),
|
||||||
'TEL;HOME;VOICE' => array('tel_home'),
|
'TEL;HOME;VOICE' => array('tel_home'),
|
||||||
'TEL;FAX;HOME' => array('tel_fax_home'),
|
'TEL;FAX;HOME' => array('tel_fax_home'),
|
||||||
'TEL;PAGER' => array('tel_pager'),
|
'TEL;PAGER' => array('tel_pager'),
|
||||||
'TITLE' => array('title'),
|
'TITLE' => array('title'),
|
||||||
'URL;WORK' => array('url'),
|
'URL;WORK' => array('url'),
|
||||||
@ -69,11 +69,11 @@ class addressbook_vcal extends addressbook_bo
|
|||||||
'NICKNAME' => array('label'),
|
'NICKNAME' => array('label'),
|
||||||
'FBURL' => array('freebusy_uri'),
|
'FBURL' => array('freebusy_uri'),
|
||||||
'PHOTO' => array('jpegphoto'),
|
'PHOTO' => array('jpegphoto'),
|
||||||
'X-ASSISTANT' => array('assistent'),
|
'X-ASSISTANT' => array('assistent'),
|
||||||
'X-ASSISTANT-TEL' => array('tel_assistent'),
|
'X-ASSISTANT-TEL' => array('tel_assistent'),
|
||||||
'UID' => array('uid'),
|
'UID' => array('uid'),
|
||||||
'REV' => array('modified'),
|
'REV' => array('modified'),
|
||||||
//set for Apple: 'X-ABSHOWAS' => array('fileas_type'), // Horde vCard class uses uppercase prop-names!
|
//set for Apple: 'X-ABSHOWAS' => array('fileas_type'), // Horde vCard class uses uppercase prop-names!
|
||||||
);
|
);
|
||||||
|
|
||||||
var $supportedFields;
|
var $supportedFields;
|
||||||
@ -692,7 +692,7 @@ class addressbook_vcal extends addressbook_bo
|
|||||||
case 'IPHONE':
|
case 'IPHONE':
|
||||||
if ($rowName == 'TEL' || $rowName == 'TEL;CELL')
|
if ($rowName == 'TEL' || $rowName == 'TEL;CELL')
|
||||||
{
|
{
|
||||||
$rowName = 'TEL;IPHONE';
|
$rowName = 'TEL;CELL;HOME';
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -841,17 +841,17 @@ class addressbook_vcal extends addressbook_bo
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'TEL;CELL;X-egw-Ref1':
|
case 'TEL;CELL;X-egw-Ref1':
|
||||||
$supported = isset($this->supportedFields['TEL;CELL']) ? 'TEL;CELL' : 'TEL;CELL;WORK';
|
if (!in_array('TEL;CELL;WORK', $rowNames)
|
||||||
if (!in_array($supported, $rowNames) && !isset($finalRowNames[$supported]))
|
&& !isset($finalRowNames['TEL;CELL;WORK']))
|
||||||
{
|
{
|
||||||
$finalRowNames[$supported] = $vcardKey;
|
$finalRowNames['TEL;CELL;WORK'] = $vcardKey;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'TEL;CELL;X-egw-Ref2':
|
case 'TEL;CELL;X-egw-Ref2':
|
||||||
$supported = isset($this->supportedFields['TEL;IPHONE']) ? 'TEL;IPHONE' : 'TEL;CELL;HOME';
|
if (!in_array('TEL;CELL;HOME', $rowNames)
|
||||||
if (!in_array($supported, $rowNames) && !isset($finalRowNames[$supported]))
|
&& !isset($finalRowNames['TEL;CELL;HOME']))
|
||||||
{
|
{
|
||||||
$finalRowNames[$supported] = $vcardKey;
|
$finalRowNames['TEL;CELL;HOME'] = $vcardKey;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'TEL;CELL;X-egw-Ref3':
|
case 'TEL;CELL;X-egw-Ref3':
|
||||||
|
Loading…
Reference in New Issue
Block a user