Fix SyncML addressbook handling

This commit is contained in:
Jörg Lehrke 2010-12-19 22:25:30 +00:00
parent de8e93cfe9
commit 66e60ff200
2 changed files with 4 additions and 36 deletions

View File

@ -247,22 +247,6 @@ class addressbook_sif extends addressbook_bo
{ {
$contact['cat_id'] = implode(',',$this->find_or_add_categories($contact['cat_id'], -1)); $contact['cat_id'] = implode(',',$this->find_or_add_categories($contact['cat_id'], -1));
} }
if (isset($GLOBALS['egw_info']['user']['preferences']['syncml']['filter_addressbook']))
{
$owner = $GLOBALS['egw_info']['user']['preferences']['syncml']['filter_addressbook'];
switch ($owner)
{
case 'G':
$contact['owner'] = $GLOBALS['egw_info']['user']['account_primary_group'];
break;
case 'P':
case 0:
$contact['owner'] = $this->user;
break;
default:
$contact['owner'] = (int)$owner;
}
}
} }
return $this->save($contact); return $this->save($contact);
} }

View File

@ -175,23 +175,6 @@ class addressbook_vcal extends addressbook_bo
{ {
$contact['cat_id'] = implode(',',$this->find_or_add_categories($contact['cat_id'], -1)); $contact['cat_id'] = implode(',',$this->find_or_add_categories($contact['cat_id'], -1));
} }
if (isset($GLOBALS['egw_info']['user']['preferences']['syncml']['filter_addressbook']))
{
$owner = $GLOBALS['egw_info']['user']['preferences']['syncml']['filter_addressbook'];
switch ($owner)
{
case 'G':
$contact['owner'] = $GLOBALS['egw_info']['user']['account_primary_group'];
break;
case 'P':
case 'N':
case 0:
$contact['owner'] = $this->user;
break;
default:
$contact['owner'] = (int)$owner;
}
}
} }
if (isset($contact['owner']) && $contact['owner'] != $this->user) if (isset($contact['owner']) && $contact['owner'] != $this->user)
{ {
@ -612,11 +595,13 @@ class addressbook_vcal extends addressbook_bo
foreach($vcardValues as $key => $vcardRow) foreach($vcardValues as $key => $vcardRow)
{ {
$rowName = strtoupper($vcardRow['name']); $rowName = strtoupper($vcardRow['name']);
/*
if ($vcardRow['value'] == '' && implode('', $vcardRow['values']) == '') if ($vcardRow['value'] == '' && implode('', $vcardRow['values']) == '')
{ {
unset($vcardRow); unset($vcardRow);
continue; continue;
} }
*/
$rowTypes = array(); $rowTypes = array();
$vcardRow['uparams'] = array(); $vcardRow['uparams'] = array();
@ -626,7 +611,6 @@ class addressbook_vcal extends addressbook_bo
$vcardRow['uparams'][$pname] = $params; $vcardRow['uparams'][$pname] = $params;
} }
// expand 3.0 TYPE paramters to 2.1 qualifiers // expand 3.0 TYPE paramters to 2.1 qualifiers
$vcardRow['tparams'] = array(); $vcardRow['tparams'] = array();
foreach ($vcardRow['uparams'] as $pname => $params) foreach ($vcardRow['uparams'] as $pname => $params)