diff --git a/addressbook/csv_import.php b/addressbook/csv_import.php index 02ddfaa97c..e8cec3d1f3 100644 --- a/addressbook/csv_import.php +++ b/addressbook/csv_import.php @@ -416,6 +416,11 @@ } if(!$_POST['debug'] && !$empty) // dont import empty contacts { + if ($values['email'] && ($existing = $GLOBALS['egw']->contacts->search(array('email'=>$values['email']),false)) && + count($existing) == 1) + { + $values = array_merge($existing[0],$values); + } $GLOBALS['egw']->contacts->save($values); //echo "

adding: ".print_r($values,true)."

\n"; } diff --git a/addressbook/inc/class.contacts_admin_prefs.inc.php b/addressbook/inc/class.contacts_admin_prefs.inc.php index 86460c4687..98ce9d11c1 100644 --- a/addressbook/inc/class.contacts_admin_prefs.inc.php +++ b/addressbook/inc/class.contacts_admin_prefs.inc.php @@ -212,7 +212,7 @@ class contacts_admin_prefs 'type' => 'check', 'label' => 'Hide accounts from addressbook', 'name' => 'hide_accounts', - 'help' => 'Hides accounts completly from the adressbook for non administrators!', + 'help' => 'Hides accounts completly from the adressbook.', 'xmlrpc' => True, 'admin' => false, ); diff --git a/addressbook/inc/class.socontacts.inc.php b/addressbook/inc/class.socontacts.inc.php index 34d6399e2c..dc3c0f11e2 100755 --- a/addressbook/inc/class.socontacts.inc.php +++ b/addressbook/inc/class.socontacts.inc.php @@ -236,8 +236,7 @@ class socontacts // add grants for accounts: if account_selection not in ('none','groupmembers'): everyone has read access, // if he has not set the hide_accounts preference // ToDo: be more specific for 'groupmembers', they should be able to see the groupmembers - if (!in_array($GLOBALS['egw_info']['user']['preferences']['common']['account_selection'],array('none','groupmembers')) && - !$GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts']) + if (!in_array($GLOBALS['egw_info']['user']['preferences']['common']['account_selection'],array('none','groupmembers'))) { $this->grants[0] = EGW_ACL_READ; } diff --git a/addressbook/inc/class.uicontacts.inc.php b/addressbook/inc/class.uicontacts.inc.php index f8132d742b..320a8c1f72 100644 --- a/addressbook/inc/class.uicontacts.inc.php +++ b/addressbook/inc/class.uicontacts.inc.php @@ -700,6 +700,10 @@ class uicontacts extends bocontacts { unset($query['col_filter']['list']); } + if ($GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts']) + { + $query['col_filter']['account_id'] = null; + } if (isset($this->org_views[(string) $query['org_view']])) // we have an org view { unset($query['col_filter']['list']); // does not work together @@ -992,7 +996,7 @@ class uicontacts extends bocontacts $addressbooks[$uid] = lang('Group %1',$GLOBALS['egw']->accounts->id2name($uid)); } } - if ($this->grants[0] & $required) + if (($this->grants[0] & $required) && !$GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts']) { $addressbooks[0] = lang('Accounts'); } diff --git a/addressbook/setup/phpgw_de.lang b/addressbook/setup/phpgw_de.lang index 3cba6386c4..27509879c0 100644 --- a/addressbook/setup/phpgw_de.lang +++ b/addressbook/setup/phpgw_de.lang @@ -156,7 +156,7 @@ global categories addressbook de Globale Kategorien grant addressbook access common de Berechtigungen group %1 addressbook de Gruppe %1 hide accounts from addressbook addressbook de Benutzer im Adressbuch ausblenden -hides accounts completly from the adressbook for non administrators! addressbook de Entfernt die Benutzer komplett aus dem Adressbuch für nicht Administratoren! +hides accounts completly from the adressbook. addressbook de Entfernt die Benutzer komplett aus dem Adressbuch. home address addressbook de Privatadresse home address, birthday, ... addressbook de Privatadresse, Geburtstag, ... home city addressbook de Stadt privat diff --git a/addressbook/setup/phpgw_en.lang b/addressbook/setup/phpgw_en.lang index cac436ec23..885262aaf9 100644 --- a/addressbook/setup/phpgw_en.lang +++ b/addressbook/setup/phpgw_en.lang @@ -156,7 +156,7 @@ global categories addressbook en Global Categories grant addressbook access common en Grant Addressbook Access group %1 addressbook en Group %1 hide accounts from addressbook addressbook en Hide accounts from addressbook -hides accounts completly from the adressbook for non administrators! addressbook en Hides accounts completly from the adressbook for non administrators! +hides accounts completly from the adressbook. addressbook en Hides accounts completly from the adressbook. home address addressbook en Home address home address, birthday, ... addressbook en Home address, Birthday, ... home city addressbook en Home City