CRM-15926 - encodeDataTableSelector - Output JSON header
authorTim Otten <totten@civicrm.org>
Mon, 9 Feb 2015 23:46:39 +0000 (15:46 -0800)
committerTim Otten <totten@civicrm.org>
Tue, 10 Feb 2015 13:22:02 +0000 (05:22 -0800)
CRM/Activity/Page/AJAX.php
CRM/Batch/Page/AJAX.php
CRM/Campaign/Page/AJAX.php
CRM/Contact/Page/AJAX.php
CRM/Financial/Page/AJAX.php
CRM/Group/Page/AJAX.php
CRM/Mailing/Page/AJAX.php

index 842d447a5624c3c85edc0e5b6d956de399a809f5..3ef11f8ac7837a0448526c8425c193aeb5c4758e 100644 (file)
@@ -67,6 +67,7 @@ class CRM_Activity_Page_AJAX {
     $iFilteredTotal = $iTotal = $params['total'];
     $selectorElements = array('display_date', 'subject', 'type', 'with_contacts', 'reporter', 'status', 'links', 'class');
 
+    header('Content-Type: application/json');
     echo CRM_Utils_JSON::encodeDataTableSelector($activities, $sEcho, $iTotal, $iFilteredTotal, $selectorElements);
     CRM_Utils_System::civiExit();
   }
@@ -100,6 +101,7 @@ class CRM_Activity_Page_AJAX {
     $iFilteredTotal = $iTotal = $relGlobalTotalCount;
     $selectorElements = array('sort_name', 'phone', 'email');
 
+    header('Content-Type: application/json');
     echo CRM_Utils_JSON::encodeDataTableSelector($relGlobal, $sEcho, $iTotal, $iFilteredTotal, $selectorElements);
     CRM_Utils_System::civiExit();
   }
@@ -160,6 +162,7 @@ class CRM_Activity_Page_AJAX {
     $iFilteredTotal = $iTotal = $params['total'] = count($allClientRelationships);
     $selectorElements = array('relation', 'name', 'phone', 'email');
 
+    header('Content-Type: application/json');
     echo CRM_Utils_JSON::encodeDataTableSelector($clientRelationships, $sEcho, $iTotal, $iFilteredTotal, $selectorElements);
     CRM_Utils_System::civiExit();
   }
@@ -292,6 +295,7 @@ class CRM_Activity_Page_AJAX {
     $iFilteredTotal = $iTotal = $params['total'] = count($allCaseRelationships);
     $selectorElements = array('relation', 'name', 'phone', 'email', 'actions');
 
+    header('Content-Type: application/json');
     echo CRM_Utils_JSON::encodeDataTableSelector($caseRelationships, $sEcho, $iTotal, $iFilteredTotal, $selectorElements);
     CRM_Utils_System::civiExit();
   }
@@ -502,6 +506,7 @@ class CRM_Activity_Page_AJAX {
       'activity_date', 'status','links', 'class',
     );
 
+    header('Content-Type: application/json');
     echo CRM_Utils_JSON::encodeDataTableSelector($activities, $sEcho, $iTotal, $iFilteredTotal, $selectorElements);
     CRM_Utils_System::civiExit();
   }
index d5ea30b6ae6b756fe3fd22319a77528106f83920..238a0514d6ec007b78f764ec12ee761b67665de9 100644 (file)
@@ -121,6 +121,7 @@ class CRM_Batch_Page_AJAX {
         'links',
       );
     }
+    header('Content-Type: application/json');
     echo CRM_Utils_JSON::encodeDataTableSelector($batches, $sEcho, $iTotal, $iFilteredTotal, $selectorElements);
     CRM_Utils_System::civiExit();
   }
index 3512bc1c4d74316d11bb60aec81a9600cf8440c9..1387b2f3ccfc6c49125461e856208d71c9fcfc20 100644 (file)
@@ -347,6 +347,7 @@ class CRM_Campaign_Page_AJAX {
 
     $iFilteredTotal = $iTotal;
 
+    header('Content-Type: application/json');
     echo CRM_Utils_JSON::encodeDataTableSelector($searchRows, $sEcho, $iTotal, $iFilteredTotal, $selectorElements);
     CRM_Utils_System::civiExit();
   }
@@ -637,6 +638,7 @@ class CRM_Campaign_Page_AJAX {
 
     $iFilteredTotal = $iTotal;
 
+    header('Content-Type: application/json');
     echo CRM_Utils_JSON::encodeDataTableSelector($searchRows, $sEcho, $iTotal, $iFilteredTotal, $selectorElements);
     CRM_Utils_System::civiExit();
   }
@@ -735,6 +737,7 @@ class CRM_Campaign_Page_AJAX {
 
     $iFilteredTotal = $iTotal;
 
+    header('Content-Type: application/json');
     echo CRM_Utils_JSON::encodeDataTableSelector($searchRows, $sEcho, $iTotal, $iFilteredTotal, $selectorElements);
     CRM_Utils_System::civiExit();
   }
@@ -828,6 +831,7 @@ class CRM_Campaign_Page_AJAX {
 
     $iFilteredTotal = $iTotal;
 
+    header('Content-Type: application/json');
     echo CRM_Utils_JSON::encodeDataTableSelector($searchRows, $sEcho, $iTotal, $iFilteredTotal, $selectorElements);
     CRM_Utils_System::civiExit();
   }
index d8b194c29112339fc3b12c497919ae6d14f79bfb..96a9e6fa587a9241f4e0bd47938c6ce26f1eb7bc 100644 (file)
@@ -979,6 +979,7 @@ LIMIT {$offset}, {$rowCount}
       }
     }
 
+    header('Content-Type: application/json');
     echo CRM_Utils_JSON::encodeDataTableSelector($searchRows, $sEcho, $iTotal, $iFilteredTotal, $selectorElements);
 
     CRM_Utils_System::civiExit();
@@ -1129,6 +1130,7 @@ LIMIT {$offset}, {$rowCount}
       'is_active',
     );
 
+    header('Content-Type: application/json');
     echo CRM_Utils_JSON::encodeDataTableSelector($relationships, $sEcho, $iTotal, $iFilteredTotal, $selectorElements);
     CRM_Utils_System::civiExit();
   }
index eea4ff4bc4c25bf089a4586442f44cab6ae187be..a069036e9f2d4535438a84cb2af3f3cb1c10230a 100644 (file)
@@ -446,6 +446,7 @@ class CRM_Financial_Page_AJAX {
         'amount', 'trxn_id', 'transaction_date', 'payment_method', 'status', 'name', 'action',
       );
 
+    header('Content-Type: application/json');
     echo CRM_Utils_JSON::encodeDataTableSelector($financialitems, $sEcho, $iTotal, $iFilteredTotal, $selectorElements);
     CRM_Utils_System::civiExit();
   }
index 8f6887e4d623888f894864bcf2382caa67ebb1f3..4b2aa2029b29f06135e37088fcf1b122ee9c558a 100644 (file)
@@ -96,6 +96,7 @@ class CRM_Group_Page_AJAX {
       if(!empty($params['is_unit_test'])) {
         return array($groups, $iFilteredTotal);
       }
+      header('Content-Type: application/json');
       echo CRM_Utils_JSON::encodeDataTableSelector($groups, $sEcho, $iTotal, $iFilteredTotal, $selectorElements);
       CRM_Utils_System::civiExit();
     }
index 44b45a30dd2e78addfb566c6f999d9cc9d2dccbc..b3f76c13c3b8a7fa50e76d09801c18c83a1ac9a7 100644 (file)
@@ -95,6 +95,7 @@ class CRM_Mailing_Page_AJAX {
       'start_date', 'openstats', 'links',
     );
 
+    header('Content-Type: application/json');
     echo CRM_Utils_JSON::encodeDataTableSelector($mailings, $sEcho, $iTotal, $iFilteredTotal, $selectorElements);
     CRM_Utils_System::civiExit();
   }