Disable history logging for accounts when the backend is LDAP because it was showing changes for all entries instead of the current entry

This commit is contained in:
Nathan Gray 2010-04-16 16:06:37 +00:00
parent 7920304f13
commit c87e751c76
3 changed files with 7 additions and 4 deletions

View File

@ -815,9 +815,11 @@ class addressbook_bo extends addressbook_so
// Notify linked apps about changes in the contact data
egw_link::notify_update('addressbook', $contact['id'], $contact);
// Record change history
$deleted = ($old['tid'] == addressbook_so::DELETED_TYPE || $contact['tid'] == addressbook_so::DELETED_TYPE);
$this->tracking->track($to_write, $old, null, $deleted);
// Record change history for sql - doesn't work for LDAP accounts
if(!$contact['account_id'] || $contact['account_id'] && $this->account_repository == 'sql') {
$deleted = ($old['tid'] == addressbook_so::DELETED_TYPE || $contact['tid'] == addressbook_so::DELETED_TYPE);
$this->tracking->track($to_write, $old, null, $deleted);
}
}
return $this->error ? false : $contact['id'];

View File

@ -80,7 +80,7 @@ class addressbook_tracking extends bo_tracking
$this->contacts =& $bocontacts;
if (is_object($bocontacts->somain))
if (is_object($bocontacts->somain) && is_array($bocontacts->somain->db_cols))
{
$this->field2history = array_combine($bocontacts->somain->db_cols, $bocontacts->somain->db_cols);
unset($this->field2history['modified']);

View File

@ -1443,6 +1443,7 @@ class addressbook_ui extends addressbook_bo
$readonlys['tabs']['custom'] = !$this->customfields;
$readonlys['tabs']['custom_private'] = !$this->customfields || !$this->config['private_cf_tab'];
$readonlys['tabs']['distribution_list'] = !$content['distrib_lists'];#false;
$readonlys['tabs']['history'] = $this->account_repository == 'ldap' && $content['account_id'];
$readonlys['button[delete]'] = !$content['id'];
if ($this->config['private_cf_tab']) $content['no_private_cfs'] = 0;