diff --git a/addressbook/inc/class.addressbook_bo.inc.php b/addressbook/inc/class.addressbook_bo.inc.php index 861c831b16..43cf42ed23 100755 --- a/addressbook/inc/class.addressbook_bo.inc.php +++ b/addressbook/inc/class.addressbook_bo.inc.php @@ -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']; diff --git a/addressbook/inc/class.addressbook_tracking.inc.php b/addressbook/inc/class.addressbook_tracking.inc.php index b649412825..d25d3fdda4 100644 --- a/addressbook/inc/class.addressbook_tracking.inc.php +++ b/addressbook/inc/class.addressbook_tracking.inc.php @@ -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']); diff --git a/addressbook/inc/class.addressbook_ui.inc.php b/addressbook/inc/class.addressbook_ui.inc.php index 18bb165c0c..557f40d7e8 100644 --- a/addressbook/inc/class.addressbook_ui.inc.php +++ b/addressbook/inc/class.addressbook_ui.inc.php @@ -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;