* eMail: regard addressbook preference to hide accounts or not in ajax search for emailadresses while composing messages

This commit is contained in:
Klaus Leithoff 2011-06-21 13:09:39 +00:00
parent 6c258d1395
commit a6fc9eb4d9

View File

@ -30,8 +30,11 @@
'email_home' => $_searchString, 'email_home' => $_searchString,
),array('n_fn','email','email_home'),'n_fn','','%',false,'OR',array(0,20)); ),array('n_fn','email','email_home'),'n_fn','','%',false,'OR',array(0,20));
$showAccounts = true;
if ($GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts']) $showAccounts=false;
// additionally search the accounts, if the contact storage is not the account storage // additionally search the accounts, if the contact storage is not the account storage
if ($GLOBALS['egw_info']['server']['account_repository'] == 'ldap' && if ($showAccounts &&
$GLOBALS['egw_info']['server']['account_repository'] == 'ldap' &&
$GLOBALS['egw_info']['server']['contact_repository'] == 'sql') $GLOBALS['egw_info']['server']['contact_repository'] == 'sql')
{ {
$accounts = $GLOBALS['egw']->contacts->search(array( $accounts = $GLOBALS['egw']->contacts->search(array(