X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FReport%2FForm%2FMember%2FSummary.php;h=de2cba8947c4c2d4d08c784cb3e4763b0ffc6413;hb=d1641c514cc7490923db5111f24c7f98da6fa91e;hp=56279ecb2830de420d0bdef72fb0152f205d8c01;hpb=4c68b3ac2f3b9539f5d8918632bfd7a460633f04;p=civicrm-core.git diff --git a/CRM/Report/Form/Member/Summary.php b/CRM/Report/Form/Member/Summary.php index 56279ecb28..de2cba8947 100644 --- a/CRM/Report/Form/Member/Summary.php +++ b/CRM/Report/Form/Member/Summary.php @@ -3,7 +3,7 @@ +--------------------------------------------------------------------+ | CiviCRM version 4.7 | +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2015 | + | Copyright CiviCRM LLC (c) 2004-2016 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | @@ -28,7 +28,7 @@ /** * * @package CRM - * @copyright CiviCRM LLC (c) 2004-2015 + * @copyright CiviCRM LLC (c) 2004-2016 * $Id$ * */ @@ -100,11 +100,13 @@ class CRM_Report_Form_Member_Summary extends CRM_Report_Form { ), 'membership_type_id' => 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')); } @@ -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}"; } }