* Addressbook - move photo change flag from import into vcal so it's always set if needed

This commit is contained in:
nathangray 2018-10-29 11:07:35 -06:00
parent 8339ddd962
commit 18625abce8
2 changed files with 3 additions and 6 deletions

View File

@ -163,12 +163,6 @@ class addressbook_import_vcard implements importexport_iface_import_plugin {
$record['owner'] = $owner; $record['owner'] = $owner;
// If photo is set, we want to update it
if($record['jpegphoto'])
{
$record['photo_unchanged'] = false;
}
// Check that owner (addressbook) is allowed // Check that owner (addressbook) is allowed
if(!array_key_exists($record['owner'], $this->bocontacts->get_addressbooks())) if(!array_key_exists($record['owner'], $this->bocontacts->get_addressbooks()))
{ {

View File

@ -145,6 +145,7 @@ class addressbook_vcal extends addressbook_bo
{ {
if (($old_contact = $this->read($_abID))) if (($old_contact = $this->read($_abID)))
{ {
$contact['photo_unchanged'] = $old_contact['jpegphoto'] === $contact['jpegphoto'];
if ($merge) if ($merge)
{ {
foreach (array_keys($contact) as $key) foreach (array_keys($contact) as $key)
@ -177,6 +178,8 @@ class addressbook_vcal extends addressbook_bo
} }
else else
{ {
// If photo is set, we want to update it
$contact['photo_unchanged'] = false;
if (is_array($contact['cat_id'])) if (is_array($contact['cat_id']))
{ {
$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));