From 5e89cfbabf7cf2c3f7c9bbc19f1b48d6b348cd67 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 16 Jun 2010 14:09:52 +0000 Subject: [PATCH] Apply 'hide_accounts' preference to link searching --- addressbook/inc/class.addressbook_bo.inc.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addressbook/inc/class.addressbook_bo.inc.php b/addressbook/inc/class.addressbook_bo.inc.php index 206299b6d4..f924b0313c 100755 --- a/addressbook/inc/class.addressbook_bo.inc.php +++ b/addressbook/inc/class.addressbook_bo.inc.php @@ -1177,7 +1177,7 @@ class addressbook_bo extends addressbook_so */ function link_query($pattern, Array &$options = array()) { - $result = $criteria = array(); + $filter = $result = $criteria = array(); $limit = false; if ($pattern) { @@ -1186,7 +1186,8 @@ class addressbook_bo extends addressbook_so if($options['start'] || $options['num_rows']) { $limit = array($options['start'], $options['num_rows']); } - if (($contacts = parent::search($criteria,false,'org_name,n_family,n_given,cat_id','','%',false,'OR', $limit))) + if ($GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts']) $filter['account_id'] = null; + if (($contacts = parent::search($criteria,false,'org_name,n_family,n_given,cat_id','','%',false,'OR', $limit, $filter))) { foreach($contacts as $contact) {