From a97040f5aa9c72d2b1bba8b16313bc1f6c0d137c Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Thu, 21 Aug 2014 22:19:47 +0100 Subject: [PATCH] Hide count in tab for single-value custom groups --- CRM/Contact/Page/View/Summary.php | 1 + CRM/Core/BAO/CustomGroup.php | 1 + templates/CRM/Contact/Page/View/Summary.tpl | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CRM/Contact/Page/View/Summary.php b/CRM/Contact/Page/View/Summary.php index 9db5155104..e4efbcfa0f 100644 --- a/CRM/Contact/Page/View/Summary.php +++ b/CRM/Contact/Page/View/Summary.php @@ -394,6 +394,7 @@ class CRM_Contact_Page_View_Summary extends CRM_Contact_Page_View { 'title' => $group['title'], 'weight' => $weight, 'count' => CRM_Contact_BAO_Contact::getCountComponent($id, $this->_contactId, $group['table_name']), + 'hideCount' => !$group['is_multiple'], 'class' => 'livePage' ); $weight += 10; diff --git a/CRM/Core/BAO/CustomGroup.php b/CRM/Core/BAO/CustomGroup.php index 29a091598a..8cc623a92f 100644 --- a/CRM/Core/BAO/CustomGroup.php +++ b/CRM/Core/BAO/CustomGroup.php @@ -1037,6 +1037,7 @@ ORDER BY civicrm_custom_group.weight, $group['query'] = "reset=1&gid={$customGroupDAO->id}&cid={$cidToken}"; $group['extra'] = array('gid' => $customGroupDAO->id); $group['table_name'] = $customGroupDAO->table_name; + $group['is_multiple'] = $customGroupDAO->is_multiple; $groups[] = $group; } diff --git a/templates/CRM/Contact/Page/View/Summary.tpl b/templates/CRM/Contact/Page/View/Summary.tpl index 9d802e73b1..ad812c53ed 100644 --- a/templates/CRM/Contact/Page/View/Summary.tpl +++ b/templates/CRM/Contact/Page/View/Summary.tpl @@ -139,8 +139,8 @@ {foreach from=$allTabs key=tabName item=tabValue}
  • - {$tabValue.title} - {$tabValue.count} + {$tabValue.title} + {if empty($tabValue.hideCount)}{$tabValue.count}{/if}
  • {/foreach} -- 2.25.1