From 47c0ee09b62cf996ec4684aafb3782cb3c56767f Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Sat, 29 Jul 2017 15:26:42 +1000 Subject: [PATCH] Use the orderByArray and groupByArray variables --- CRM/Report/Form/Member/Summary.php | 2 +- CRM/Report/Form/Pledge/Summary.php | 12 ++++++------ CRM/Report/Form/Walklist/Walklist.php | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CRM/Report/Form/Member/Summary.php b/CRM/Report/Form/Member/Summary.php index e5f47e822d..a8dfc322e4 100644 --- a/CRM/Report/Form/Member/Summary.php +++ b/CRM/Report/Form/Member/Summary.php @@ -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']) ) { diff --git a/CRM/Report/Form/Pledge/Summary.php b/CRM/Report/Form/Pledge/Summary.php index d957331a2f..610681ec6d 100644 --- a/CRM/Report/Form/Pledge/Summary.php +++ b/CRM/Report/Form/Pledge/Summary.php @@ -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"; diff --git a/CRM/Report/Form/Walklist/Walklist.php b/CRM/Report/Form/Walklist/Walklist.php index a539ee0004..9bef123b90 100644 --- a/CRM/Report/Form/Walklist/Walklist.php +++ b/CRM/Report/Form/Walklist/Walklist.php @@ -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() { -- 2.25.1