+--------------------------------------------------------------------+
| CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2015 |
+ | Copyright CiviCRM LLC (c) 2004-2016 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2015
+ * @copyright CiviCRM LLC (c) 2004-2016
* $Id$
*
*/
),
'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'),
),
'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'));
}
unset($select['joinDate']);
unset($this->_columnHeaders["civicrm_membership_member_join_date"]);
}
+ $this->_selectClauses = $select;
$this->_select = "SELECT " . implode(', ', $select) . " ";
}
}
$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}";
}
}