X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FReport%2FForm%2FMember%2FSummary.php;h=de2cba8947c4c2d4d08c784cb3e4763b0ffc6413;hb=d1641c514cc7490923db5111f24c7f98da6fa91e;hp=2f71ef4127eec68785cfdb65dacb38a8cfaa21f9;hpb=479f5c33d690136bf878e5a2ecaa9714a6c46ef2;p=civicrm-core.git diff --git a/CRM/Report/Form/Member/Summary.php b/CRM/Report/Form/Member/Summary.php index 2f71ef4127..de2cba8947 100644 --- a/CRM/Report/Form/Member/Summary.php +++ b/CRM/Report/Form/Member/Summary.php @@ -1,9 +1,9 @@ array( 'title' => ts('Membership Type'), + 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Member_PseudoConstant::membershipType(), ), 'status_id' => array( 'title' => ts('Membership Status'), + 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Member_PseudoConstant::membershipStatus(NULL, NULL, 'label'), ), @@ -184,6 +186,7 @@ class CRM_Report_Form_Member_Summary extends CRM_Report_Form { 'title' => ts('Campaign'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->activeCampaigns, + 'type' => CRM_Utils_Type::T_INT, ); $this->_columns['civicrm_membership']['group_bys']['campaign_id'] = array('title' => ts('Campaign')); } @@ -244,7 +247,7 @@ class CRM_Report_Form_Member_Summary extends CRM_Report_Form { $this->_columnHeaders["{$tableName}_{$fieldName}_start"]['type'] = $field['type']; $this->_columnHeaders["{$tableName}_{$fieldName}_start"]['group_by'] = $this->_params['group_bys_freq'][$fieldName]; - // just to make sure these values are transfered to rows. + // just to make sure these values are transferred to rows. // since we need that for calculation purpose, // e.g making subtotals look nicer or graphs $this->_columnHeaders["{$tableName}_{$fieldName}_interval"] = array('no_display' => TRUE); @@ -320,6 +323,7 @@ class CRM_Report_Form_Member_Summary extends CRM_Report_Form { unset($select['joinDate']); unset($this->_columnHeaders["civicrm_membership_member_join_date"]); } + $this->_selectClauses = $select; $this->_select = "SELECT " . implode(', ', $select) . " "; } @@ -377,11 +381,13 @@ class CRM_Report_Form_Member_Summary extends CRM_Report_Form { } $this->_rollup = ' WITH ROLLUP'; - $this->_groupBy = 'GROUP BY ' . implode(', ', $this->_groupBy) . + $groupFromSelect = CRM_Contact_BAO_Query::getGroupByFromSelectColumns($this->_selectClauses, $this->_groupBy); + $this->_groupBy = 'GROUP BY ' . implode(', ', $this->_groupBy) . $groupFromSelect . " {$this->_rollup} "; } else { - $this->_groupBy = "GROUP BY {$this->_aliases['civicrm_membership']}.join_date"; + $groupFromSelect = CRM_Contact_BAO_Query::getGroupByFromSelectColumns($this->_selectClauses, "{$this->_aliases['civicrm_membership']}.join_date"); + $this->_groupBy = "GROUP BY {$this->_aliases['civicrm_membership']}.join_date {$groupFromSelect}"; } }