if (count($eventIds) == 1) {
//convert form values to clause.
$seatClause = array();
- $clauseParams = array('participant_status_id', 'participant_role_id');
+ // Filter on is_test if specified in search form
+ if (CRM_Utils_Array::value('participant_test', $this->_formValues) == '1' || CRM_Utils_Array::value('participant_test', $this->_formValues) == '0' ) {
+ $seatClause[] = "( participant.is_test = {$this->_formValues['participant_test']} )";
+ }
if (CRM_Utils_Array::value('participant_status_id', $this->_formValues)) {
$statuses = array_keys($this->_formValues['participant_status_id']);
-
$seatClause[] = '( participant.status_id IN ( ' . implode(' , ', $statuses) . ' ) )';
}
if (CRM_Utils_Array::value('participant_role_id', $this->_formValues)) {
$roles = array_keys($this->_formValues['participant_role_id']);
- $seatClause[] = '( participant.status_id IN ( ' . implode(' , ', $roles) . ' ) )';
+ $seatClause[] = '( participant.role_id IN ( ' . implode(' , ', $roles) . ' ) )';
}
$clause = NULL;
if (!empty($seatClause)) {
$clause = implode(' AND ', $seatClause);
}
+
$participantCount = CRM_Event_BAO_Event::eventTotalSeats(array_pop($eventIds), $clause);
}
$this->assign('participantCount', $participantCount);