bugfix: if accounts were switched off in the addressbook prefs, they were also missing from the account-selection and accounts::search, now they get only switched off on UI level of the addressbook

This commit is contained in:
Ralf Becker 2007-04-30 15:18:29 +00:00
parent 7fab1b3b64
commit ecb0667898
6 changed files with 14 additions and 6 deletions

View File

@ -416,6 +416,11 @@
} }
if(!$_POST['debug'] && !$empty) // dont import empty contacts 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); $GLOBALS['egw']->contacts->save($values);
//echo "<p>adding: ".print_r($values,true)."</p>\n"; //echo "<p>adding: ".print_r($values,true)."</p>\n";
} }

View File

@ -212,7 +212,7 @@ class contacts_admin_prefs
'type' => 'check', 'type' => 'check',
'label' => 'Hide accounts from addressbook', 'label' => 'Hide accounts from addressbook',
'name' => 'hide_accounts', 'name' => 'hide_accounts',
'help' => 'Hides accounts completly from the adressbook for non administrators!', 'help' => 'Hides accounts completly from the adressbook.',
'xmlrpc' => True, 'xmlrpc' => True,
'admin' => false, 'admin' => false,
); );

View File

@ -236,8 +236,7 @@ class socontacts
// add grants for accounts: if account_selection not in ('none','groupmembers'): everyone has read access, // add grants for accounts: if account_selection not in ('none','groupmembers'): everyone has read access,
// if he has not set the hide_accounts preference // if he has not set the hide_accounts preference
// ToDo: be more specific for 'groupmembers', they should be able to see the groupmembers // 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')) && if (!in_array($GLOBALS['egw_info']['user']['preferences']['common']['account_selection'],array('none','groupmembers')))
!$GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts'])
{ {
$this->grants[0] = EGW_ACL_READ; $this->grants[0] = EGW_ACL_READ;
} }

View File

@ -700,6 +700,10 @@ class uicontacts extends bocontacts
{ {
unset($query['col_filter']['list']); 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 if (isset($this->org_views[(string) $query['org_view']])) // we have an org view
{ {
unset($query['col_filter']['list']); // does not work together 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)); $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'); $addressbooks[0] = lang('Accounts');
} }

View File

@ -156,7 +156,7 @@ global categories addressbook de Globale Kategorien
grant addressbook access common de Berechtigungen grant addressbook access common de Berechtigungen
group %1 addressbook de Gruppe %1 group %1 addressbook de Gruppe %1
hide accounts from addressbook addressbook de Benutzer im Adressbuch ausblenden 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 addressbook de Privatadresse
home address, birthday, ... addressbook de Privatadresse, Geburtstag, ... home address, birthday, ... addressbook de Privatadresse, Geburtstag, ...
home city addressbook de Stadt privat home city addressbook de Stadt privat

View File

@ -156,7 +156,7 @@ global categories addressbook en Global Categories
grant addressbook access common en Grant Addressbook Access grant addressbook access common en Grant Addressbook Access
group %1 addressbook en Group %1 group %1 addressbook en Group %1
hide accounts from addressbook addressbook en Hide accounts from addressbook 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 addressbook en Home address
home address, birthday, ... addressbook en Home address, Birthday, ... home address, birthday, ... addressbook en Home address, Birthday, ...
home city addressbook en Home City home city addressbook en Home City