Hide count in tab for single-value custom groups
authorColeman Watts <coleman@civicrm.org>
Thu, 21 Aug 2014 21:19:47 +0000 (22:19 +0100)
committerColeman Watts <coleman@civicrm.org>
Thu, 21 Aug 2014 21:19:47 +0000 (22:19 +0100)
CRM/Contact/Page/View/Summary.php
CRM/Core/BAO/CustomGroup.php
templates/CRM/Contact/Page/View/Summary.tpl

index 9db5155104e80a06e68a799335384076752ac3ad..e4efbcfa0fb1170c82e307494a409b07b8034fa8 100644 (file)
@@ -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;
index 29a091598a43cc8a6a58ddd444a34d674c00f4ff..8cc623a92f1acb7d099852b4121083821e80625f 100644 (file)
@@ -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;
     }
 
index 9d802e73b1773c6d16bc31ed0b17805fec27e201..ad812c53eda97e1ecf8c269441492567b4a8b7de 100644 (file)
         {foreach from=$allTabs key=tabName item=tabValue}
           <li id="tab_{$tabValue.id}" class="crm-tab-button ui-corner-all crm-count-{$tabValue.count}{if isset($tabValue.class)} {$tabValue.class}{/if}">
             <a href="{$tabValue.url}" title="{$tabValue.title}">
-              <span> </span> {$tabValue.title}
-              <em>{$tabValue.count}</em>
+              {$tabValue.title}
+              {if empty($tabValue.hideCount)}<em>{$tabValue.count}</em>{/if}
             </a>
           </li>
         {/foreach}