forked from extern/egroupware
"some fixes for syncml:
- if no owner/addressbook set on update load owner AND private from the existing contact - if no owner/addressbook set for new entries, use the add_default prefs if set and the personal adb of the user if not"
This commit is contained in:
parent
4b80391b71
commit
1602ebc69d
@ -442,6 +442,7 @@ class bocontacts extends socontacts
|
|||||||
if (($old = $this->read($contact['id']))) // --> try reading the old entry and set it from there
|
if (($old = $this->read($contact['id']))) // --> try reading the old entry and set it from there
|
||||||
{
|
{
|
||||||
$contact['owner'] = $old['owner'];
|
$contact['owner'] = $old['owner'];
|
||||||
|
$contact['private'] = $old['private'];
|
||||||
}
|
}
|
||||||
else // entry not found --> create a new one
|
else // entry not found --> create a new one
|
||||||
{
|
{
|
||||||
@ -449,8 +450,11 @@ class bocontacts extends socontacts
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!$isUpdate) {
|
if (!$isUpdate)
|
||||||
if (!isset($contact['owner'])) $contact['owner'] = $this->user; // write to users personal addressbook
|
{
|
||||||
|
// if no owner/addressbook set use the setting of the add_default prefs (if set, otherwise the users personal addressbook)
|
||||||
|
if (!isset($contact['owner'])) $contact['owner'] = (int)$this->prefs['add_default'] ? (int)$this->prefs['add_default'] : $this->user;
|
||||||
|
if (!isset($contact['private'])) $contact['private'] = (int)(substr($this->prefs['add_default'],-1) == 'p');
|
||||||
$contact['creator'] = $this->user;
|
$contact['creator'] = $this->user;
|
||||||
$contact['created'] = $this->now_su;
|
$contact['created'] = $this->now_su;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user