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()
|
||||
{
|
||||
$handler = new addressbook_vcal('addressbook','text/vcard');
|
||||
$supportedFields = $handler->supportedFields;
|
||||
// Apple iOS or OS X addressbook
|
||||
if ($this->agent == 'cfnetwork' || $this->agent == 'dataaccess')
|
||||
{
|
||||
$supportedFields = $handler->supportedFields;
|
||||
$databaseFields = $handler->databaseFields;
|
||||
// use just CELL and IPHONE, CELL;WORK and CELL;HOME are NOT understood
|
||||
//'TEL;CELL;WORK' => array('tel_cell'),
|
||||
//'TEL;CELL;HOME' => array('tel_cell_private'),
|
||||
$supportedFields['TEL;CELL'] = $databaseFields['TEL;CELL'] = array('tel_cell');
|
||||
unset($supportedFields['TEL;CELL;WORK']); unset($databaseFields['TEL;CELL;WORK']);
|
||||
$supportedFields['TEL;IPHONE'] = $databaseFields['TEL;IPHONE'] = array('tel_cell_private');
|
||||
unset($supportedFields['TEL;CELL;HOME']); unset($databaseFields['TEL;CELL;HOME']);
|
||||
$supportedFields['TEL;CELL'] = array('tel_cell');
|
||||
unset($supportedFields['TEL;CELL;WORK']);
|
||||
$supportedFields['TEL;IPHONE'] = array('tel_cell_private');
|
||||
unset($supportedFields['TEL;CELL;HOME']);
|
||||
$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)
|
||||
@ -832,9 +832,7 @@ class addressbook_groupdav extends groupdav_handler
|
||||
}
|
||||
$handler->setDatabaseFields($databaseFields);
|
||||
}
|
||||
$handler->setSupportedFields('GroupDAV',$this->agent, isset($supportedFields) ?
|
||||
$supportedFields : $handler->supportedFields);
|
||||
|
||||
$handler->setSupportedFields('GroupDAV',$this->agent,$supportedFields);
|
||||
return $handler;
|
||||
}
|
||||
|
||||
|
@ -692,7 +692,7 @@ class addressbook_vcal extends addressbook_bo
|
||||
case 'IPHONE':
|
||||
if ($rowName == 'TEL' || $rowName == 'TEL;CELL')
|
||||
{
|
||||
$rowName = 'TEL;IPHONE';
|
||||
$rowName = 'TEL;CELL;HOME';
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@ -841,17 +841,17 @@ class addressbook_vcal extends addressbook_bo
|
||||
}
|
||||
break;
|
||||
case 'TEL;CELL;X-egw-Ref1':
|
||||
$supported = isset($this->supportedFields['TEL;CELL']) ? 'TEL;CELL' : 'TEL;CELL;WORK';
|
||||
if (!in_array($supported, $rowNames) && !isset($finalRowNames[$supported]))
|
||||
if (!in_array('TEL;CELL;WORK', $rowNames)
|
||||
&& !isset($finalRowNames['TEL;CELL;WORK']))
|
||||
{
|
||||
$finalRowNames[$supported] = $vcardKey;
|
||||
$finalRowNames['TEL;CELL;WORK'] = $vcardKey;
|
||||
break;
|
||||
}
|
||||
case 'TEL;CELL;X-egw-Ref2':
|
||||
$supported = isset($this->supportedFields['TEL;IPHONE']) ? 'TEL;IPHONE' : 'TEL;CELL;HOME';
|
||||
if (!in_array($supported, $rowNames) && !isset($finalRowNames[$supported]))
|
||||
if (!in_array('TEL;CELL;HOME', $rowNames)
|
||||
&& !isset($finalRowNames['TEL;CELL;HOME']))
|
||||
{
|
||||
$finalRowNames[$supported] = $vcardKey;
|
||||
$finalRowNames['TEL;CELL;HOME'] = $vcardKey;
|
||||
break;
|
||||
}
|
||||
case 'TEL;CELL;X-egw-Ref3':
|
||||
|
Loading…
Reference in New Issue
Block a user