'sid' => array(
'name' => 'status_id',
'title' => ts('Participant Status'),
+ 'type' => CRM_Utils_Type::T_INT,
'operatorType' => CRM_Report_Form::OP_MULTISELECT,
'options' => CRM_Event_PseudoConstant::participantStatus(NULL, NULL, 'label'),
),
'name' => 'role_id',
'title' => ts('Participant Role'),
'operatorType' => CRM_Report_Form::OP_MULTISELECT_SEPARATOR,
+ 'type' => CRM_Utils_Type::T_INT,
'options' => CRM_Event_PseudoConstant::participantRole(),
),
'participant_register_date' => array(
'eid' => array(
'name' => 'event_type_id',
'title' => ts('Event Type'),
+ 'type' => CRM_Utils_Type::T_INT,
'operatorType' => CRM_Report_Form::OP_MULTISELECT,
'options' => CRM_Core_OptionGroup::values('event_type'),
),
}
public function groupBy() {
- $this->_groupBy = "";
- if (!empty($this->_params['group_bys']) &&
- is_array($this->_params['group_bys']) &&
- !empty($this->_params['group_bys'])
- ) {
- foreach ($this->_columns as $tableName => $table) {
- if (array_key_exists('group_bys', $table)) {
- foreach ($table['group_bys'] as $fieldName => $field) {
- if (!empty($this->_params['group_bys'][$fieldName])) {
- $this->_groupBy[] = $field['dbAlias'];
- }
- }
- }
- }
- }
-
- if (!empty($this->_groupBy)) {
- $this->_groupBy = "ORDER BY " . implode(', ', $this->_groupBy) .
- ", {$this->_aliases['civicrm_contact']}.sort_name";
+ // We override this function because we use GROUP functions in the
+ // SELECT clause, therefore we have to group by *something*. If the
+ // user doesn't select a column to group by, we should group by participant id.
+ parent::groupBy();
+ if (empty($this->_groupBy)) {
+ $this->_groupBy = "GROUP BY {$this->_aliases['civicrm_participant']}.id";
}
- $this->_groupBy = "GROUP BY {$this->_aliases['civicrm_participant']}.id " .
- $this->_groupBy;
}
public function postProcess() {