mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-30 11:53:57 +01:00
if contact is an account and account-relevant data got updated, handle it like account got updated
This commit is contained in:
parent
0e7604281e
commit
becc8c3bca
@ -907,9 +907,17 @@ class addressbook_bo extends addressbook_so
|
|||||||
$contact['etag'] = $to_write['etag'];
|
$contact['etag'] = $to_write['etag'];
|
||||||
$GLOBALS['egw']->contenthistory->updateTimeStamp('contacts', $contact['id'],$isUpdate ? 'modify' : 'add', time());
|
$GLOBALS['egw']->contenthistory->updateTimeStamp('contacts', $contact['id'],$isUpdate ? 'modify' : 'add', time());
|
||||||
|
|
||||||
if ($contact['account_id']) // invalidate the cache of the accounts class
|
// if contact is an account and account-relevant data got updated, handle it like account got updated
|
||||||
|
if ($contact['account_id'] &&
|
||||||
|
($old['email'] != $contact['email'] || $old['n_family'] != $contact['n_family'] || $old['n_given'] != $contact['n_given']))
|
||||||
{
|
{
|
||||||
|
// invalidate the cache of the accounts class
|
||||||
$GLOBALS['egw']->accounts->cache_invalidate($contact['account_id']);
|
$GLOBALS['egw']->accounts->cache_invalidate($contact['account_id']);
|
||||||
|
// call edit-accout hook, to let other apps know about changed account (names or email)
|
||||||
|
$GLOBALS['hook_values'] = $GLOBALS['egw']->accounts->read($contact['account_id']);
|
||||||
|
$GLOBALS['egw']->hooks->process($GLOBALS['hook_values']+array(
|
||||||
|
'location' => 'editaccount',
|
||||||
|
),False,True); // called for every app now, not only enabled ones)
|
||||||
}
|
}
|
||||||
// notify interested apps about changes in the account-contact data
|
// notify interested apps about changes in the account-contact data
|
||||||
if (!$to_write['owner'] && $to_write['account_id'])
|
if (!$to_write['owner'] && $to_write['account_id'])
|
||||||
|
Loading…
Reference in New Issue
Block a user