do NOT instanciate tracking class by default: it is only used for (seldome) updates and stalls updates in setup sometimes (1.6 update)

This commit is contained in:
Ralf Becker 2012-06-17 10:03:28 +00:00
parent 87f0fcd292
commit f48b6c244f

View File

@ -308,8 +308,6 @@ class addressbook_bo extends addressbook_so
} }
$this->categories = new categories($this->user,'addressbook'); $this->categories = new categories($this->user,'addressbook');
$this->tracking = new addressbook_tracking($this);
$this->delete_history = $GLOBALS['egw_info']['server']['history']; $this->delete_history = $GLOBALS['egw_info']['server']['history'];
} }
@ -766,6 +764,7 @@ class addressbook_bo extends addressbook_so
if ($ok && $old['tid'] != addressbook_so::DELETED_TYPE) if ($ok && $old['tid'] != addressbook_so::DELETED_TYPE)
{ {
$GLOBALS['egw']->contenthistory->updateTimeStamp('contacts', $id, 'delete', time()); $GLOBALS['egw']->contenthistory->updateTimeStamp('contacts', $id, 'delete', time());
if (!isset($this->tracking)) $this->tracking = new addressbook_tracking($this);
$this->tracking->track(array('id' => $id), array('id' => $id), null, true); $this->tracking->track(array('id' => $id), array('id' => $id), null, true);
} }
} }
@ -927,8 +926,10 @@ class addressbook_bo extends addressbook_so
} }
// Record change history for sql - doesn't work for LDAP accounts // Record change history for sql - doesn't work for LDAP accounts
if(!$contact['account_id'] || $contact['account_id'] && $this->account_repository == 'sql') { if(!$contact['account_id'] || $contact['account_id'] && $this->account_repository == 'sql')
{
$deleted = ($old['tid'] == addressbook_so::DELETED_TYPE || $contact['tid'] == addressbook_so::DELETED_TYPE); $deleted = ($old['tid'] == addressbook_so::DELETED_TYPE || $contact['tid'] == addressbook_so::DELETED_TYPE);
if (!isset($this->tracking)) $this->tracking = new addressbook_tracking($this);
$this->tracking->track($to_write, $old ? $old : null, null, $deleted); $this->tracking->track($to_write, $old ? $old : null, null, $deleted);
} }
} }