Use the orderByArray and groupByArray variables
authorSeamus Lee <seamuslee001@gmail.com>
Sat, 29 Jul 2017 05:26:42 +0000 (15:26 +1000)
committerSeamus Lee <seamuslee001@gmail.com>
Sat, 29 Jul 2017 23:41:36 +0000 (09:41 +1000)
CRM/Report/Form/Member/Summary.php
CRM/Report/Form/Pledge/Summary.php
CRM/Report/Form/Walklist/Walklist.php

index e5f47e822d8963094fdb9a9cc428c721bfb2c15d..a8dfc322e4a9dbfc142adcbe85ee22d116ee2f96 100644 (file)
@@ -358,7 +358,7 @@ class CRM_Report_Form_Member_Summary extends CRM_Report_Form {
   }
 
   public function groupBy() {
-    $this->_groupBy = array();
+    $this->_groupBy = "";
     if (is_array($this->_params['group_bys']) &&
       !empty($this->_params['group_bys'])
     ) {
index d957331a2f83038aa444374b2e58c6eb06053361..610681ec6d831145dca6abba749c5f36677cdd6c 100644 (file)
@@ -244,7 +244,7 @@ class CRM_Report_Form_Pledge_Summary extends CRM_Report_Form {
   }
 
   public function groupBy() {
-    $this->_groupBy = array();
+    $this->_groupBy = "";
     $append = FALSE;
 
     if (is_array($this->_params['group_bys']) &&
@@ -268,11 +268,11 @@ class CRM_Report_Form_Pledge_Summary extends CRM_Report_Form {
                 )) {
                   $append = '';
                 }
-                $this->_groupBy[] = "$append {$this->_params['group_bys_freq'][$fieldName]}({$field['dbAlias']})";
+                $this->_groupByArray[] = "$append {$this->_params['group_bys_freq'][$fieldName]}({$field['dbAlias']})";
                 $append = TRUE;
               }
               else {
-                $this->_groupBy[] = $field['dbAlias'];
+                $this->_groupByArray[] = $field['dbAlias'];
               }
             }
           }
@@ -280,13 +280,13 @@ class CRM_Report_Form_Pledge_Summary extends CRM_Report_Form {
       }
 
       if (!empty($this->_statFields) &&
-        (($append && count($this->_groupBy) <= 1) || (!$append)) &&
+        (($append && count($this->_groupByArray) <= 1) || (!$append)) &&
         !$this->_having
       ) {
         $this->_rollup = " WITH ROLLUP";
       }
-      $groupBy = $this->_groupBy;
-      $this->_groupBy = "GROUP BY " . implode(', ', $this->_groupBy);
+      $groupBy = $this->_groupByArray;
+      $this->_groupBy = "GROUP BY " . implode(', ', $this->_groupByArray);
     }
     else {
       $groupBy = "{$this->_aliases['civicrm_contact']}.id";
index a539ee000477f635020ea2ac2973726deac7a72d..9bef123b90eefe427cfe949bf65f6660b3806b7c 100644 (file)
@@ -223,15 +223,15 @@ FROM       civicrm_contact {$this->_aliases['civicrm_contact']} {$this->_aclFrom
   }
 
   public function orderBy() {
-    $this->_orderBy = array();
+    $this->_orderBy = "";
     foreach ($this->_columns as $tableName => $table) {
       if (array_key_exists('order_bys', $table)) {
         foreach ($table['order_bys'] as $fieldName => $field) {
-          $this->_orderBy[] = $field['dbAlias'];
+          $this->_orderByArray[] = $field['dbAlias'];
         }
       }
     }
-    $this->_orderBy = "ORDER BY " . implode(', ', $this->_orderBy) . " ";
+    $this->_orderBy = "ORDER BY " . implode(', ', $this->_orderByArray) . " ";
   }
 
   public function postProcess() {