CRM-14490 - Fix batch entry table
authorColeman Watts <coleman@civicrm.org>
Mon, 28 Apr 2014 20:22:41 +0000 (13:22 -0700)
committerColeman Watts <coleman@civicrm.org>
Mon, 28 Apr 2014 20:22:41 +0000 (13:22 -0700)
CRM/Batch/BAO/Batch.php
CRM/Batch/Page/AJAX.php

index bc690a37f69aa8fc29cd19ded06844af8b2fb6b8..4650a83a1a324b7ed9ab37b2217c82ea3842937b 100644 (file)
@@ -217,9 +217,10 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch {
         $batch['check'] = $value['check'];
       }
       $batch['batch_name'] = $value['title'];
-      $batch['total'] = $batch['item_count'] = '';
+      $batch['total'] = '';
       $batch['payment_instrument'] = $value['payment_instrument'];
       $batch['item_count'] = CRM_Utils_Array::value('item_count', $value);
+      $batch['type'] = $value['batch_type'];
       if (!empty($value['total'])) {
         $batch['total'] = CRM_Utils_Money::format($value['total']);
       }
index a2dcf1a8ece0bade8665b248c59b705fa5805fe1..d5ea30b6ae6b756fe3fd22319a77528106f83920 100644 (file)
@@ -97,18 +97,29 @@ class CRM_Batch_Page_AJAX {
     $batches = CRM_Batch_BAO_Batch::getBatchListSelector($params);
 
     $iFilteredTotal = $iTotal = $params['total'];
-    $selectorElements = array(
-      'batch_name',
-      'payment_instrument',
-      'item_count',
-      'total',
-      'status',
-      'created_by',
-      'links',
-    );
 
     if ($context == 'financialBatch') {
-      $selectorElements = array_merge(array('check'), $selectorElements);
+      $selectorElements = array(
+        'check',
+        'batch_name',
+        'payment_instrument',
+        'item_count',
+        'total',
+        'status',
+        'created_by',
+        'links',
+      );
+    }
+    else {
+      $selectorElements = array(
+        'batch_name',
+        'type',
+        'item_count',
+        'total',
+        'status',
+        'created_by',
+        'links',
+      );
     }
     echo CRM_Utils_JSON::encodeDataTableSelector($batches, $sEcho, $iTotal, $iFilteredTotal, $selectorElements);
     CRM_Utils_System::civiExit();