From f410c8fffeff63c530616e2efe33859feb99cd9b Mon Sep 17 00:00:00 2001 From: nathangray Date: Mon, 8 Mar 2021 14:59:21 -0700 Subject: [PATCH] Addressbook: Fix CRM view action for organisation was missing if user had no tracker access --- addressbook/inc/class.addressbook_ui.inc.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/addressbook/inc/class.addressbook_ui.inc.php b/addressbook/inc/class.addressbook_ui.inc.php index 3f1693ecd9..c2a2ff40be 100644 --- a/addressbook/inc/class.addressbook_ui.inc.php +++ b/addressbook/inc/class.addressbook_ui.inc.php @@ -415,17 +415,19 @@ class addressbook_ui extends addressbook_bo ), ); // CRM view options - $crm_count = 0; $crm_apps = array('infolog','tracker'); - foreach($crm_apps as $app) + foreach($crm_apps as $crm_index => $app) { - if ($GLOBALS['egw_info']['user']['apps'][$app]) $crm_count++; + if (!$GLOBALS['egw_info']['user']['apps'][$app]) + { + unset($crm_apps[$crm_index]); + } } if($GLOBALS['egw_info']['user']['apps']['infolog']) { array_splice($crm_apps, 1, 0, 'infolog-organisation'); } - if($crm_count > 1) + if(count($crm_apps) > 1) { foreach($crm_apps as $app) {