CRM-16930 - Use custom group label instead of generic 'Case Custom Data'
authorColeman Watts <coleman@civicrm.org>
Wed, 29 Jul 2015 17:54:23 +0000 (13:54 -0400)
committerColeman Watts <coleman@civicrm.org>
Wed, 29 Jul 2015 17:54:23 +0000 (13:54 -0400)
CRM/Case/XMLProcessor/Report.php
templates/CRM/Case/Audit/Report.tpl

index d3396432d698a7bca9ef2330536b783607ea0fdd..45356fde6dc04af391c0ccbc96830fac79761be4 100644 (file)
@@ -979,10 +979,11 @@ LIMIT  1
     $extends = array('case');
     $groupTree = CRM_Core_BAO_CustomGroup::getGroupDetail(NULL, NULL, $extends);
     $caseCustomFields = array();
-    while(list($id, $group_values) = each($groupTree)) {
-      while(list($id, $field_values) = each($group_values['fields'])) {
-        if(array_key_exists($id, $customValues)) {
-          $caseCustomFields[$id] = array(
+    while (list($gid, $group_values) = each($groupTree)) {
+      while (list($id, $field_values) = each($group_values['fields'])) {
+        if (array_key_exists($id, $customValues)) {
+          $caseCustomFields[$gid]['title'] = $group_values['title'];
+          $caseCustomFields[$gid]['values'][$id] = array(
             'label' => $field_values['label'],
             'value' => $customValues[$id],
           );
index 5dd29686c4e127efe8b83280e6f47371a9187a02..609a690bc46637e47cb781625777a3259f7086c4 100644 (file)
 {/if}
 
 {if $caseCustomFields}
-<h2>{ts}Case Custom Fields{/ts}</h2>
-    <table class ="report-layout">
-      {foreach from=$caseCustomFields item=row}
-        <tr>
-          <th class="label">{$row.label}</td>
-          <td class="crm-case-report-custom-field">{$row.value}</td>
-        </tr>
-      {/foreach}
+  {foreach from=$caseCustomFields item=group}
+    <h2>{$group.title}</h2>
+      <table class ="report-layout">
+        {foreach from=$group.values item=row}
+          <tr>
+            <th class="label">{$row.label}</td>
+            <td class="crm-case-report-custom-field">{$row.value}</td>
+          </tr>
+        {/foreach}
     </table>
+  {/foreach}
 {/if}
 
 <h2>{ts}Case Activities{/ts}</h2>