| with this program; if not, contact CiviCRM LLC |
| at info[AT]civicrm[DOT]org. If you have questions about the |
| GNU Affero General Public License or the licensing of CiviCRM, |
- | see the CiviCRM license FAQ at http://civicrm.org/licensing |
+ | see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
*/
$this->_done = FALSE;
$this->defaults = array();
- /*
- * we allow the controller to set force/reset externally, useful when we are being
- * driven by the wizard framework
+ /*
+ * we allow the controller to set force/reset externally, useful when we are being
+ * driven by the wizard framework
*/
$this->_reset = CRM_Utils_Request::retrieve('reset', 'Boolean', CRM_Core_DAO::$_nullObject);
$this->_force = CRM_Utils_Request::retrieve('force', 'Boolean', $this, FALSE);
CRM_Event_BAO_Query::buildSearchForm($this);
- /*
- * add form checkboxes for each row. This is needed out here to conform to QF protocol
- * of all elements being declared in builQuickForm
+ /*
+ * add form checkboxes for each row. This is needed out here to conform to QF protocol
+ * of all elements being declared in builQuickForm
*/
$rows = $this->get('rows');
if (is_array($rows)) {
// check actionName and if next, then do not repeat a search, since we are going to the next page
// hack, make sure we reset the task values
- $stateMachine = &$this->controller->getStateMachine();
+ $stateMachine = $this->controller->getStateMachine();
$formName = $stateMachine->getTaskFormName();
$this->controller->resetPage($formName);
return;
);
$controller->setEmbedded(TRUE);
- $query = &$selector->getQuery();
+ $query = $selector->getQuery();
if ($this->_context == 'user') {
$query->setSkipPermission(TRUE);
}
protected $_summary = NULL;
protected $_noFields = TRUE;
-
- protected $_add2groupSupported = FALSE;
+
+ protected $_add2groupSupported = FALSE;
+
function __construct() {
$this->_columns = array(
),
),
);
-
+
parent::__construct();
}
$sql = "
SELECT civicrm_event.id as event_id,
civicrm_event.title as event_title,
- civicrm_event.max_participants as max_participants,
+ civicrm_event.max_participants as max_participants,
civicrm_event.start_date as start_date,
- civicrm_event.end_date as end_date,
- civicrm_option_value.label as event_type,
+ civicrm_event.end_date as end_date,
+ civicrm_option_value.label as event_type,
SUM(civicrm_participant.fee_amount) as total,
COUNT(civicrm_participant.id) as participant
FROM civicrm_event
- LEFT JOIN civicrm_option_value
+ LEFT JOIN civicrm_option_value
ON ( civicrm_event.event_type_id = civicrm_option_value.value AND
civicrm_option_value.option_group_id = {$optionGroupId} )
- LEFT JOIN civicrm_participant ON ( civicrm_event.id = civicrm_participant.event_id
+ LEFT JOIN civicrm_participant ON ( civicrm_event.id = civicrm_participant.event_id
{$activeParticipantClause} AND civicrm_participant.is_test = 0 )
- WHERE civicrm_event.id IN( {$eventID})
-
+ WHERE civicrm_event.id IN( {$eventID})
+
GROUP BY civicrm_event.id
";
$eventDAO = CRM_Core_DAO::executeQuery($sql);
FROM civicrm_participant
- WHERE civicrm_participant.event_id IN( {$eventID}) AND
- civicrm_participant.is_test = 0
+ WHERE civicrm_participant.event_id IN( {$eventID}) AND
+ civicrm_participant.is_test = 0
{$activeParticipantClause}
GROUP BY civicrm_participant.event_id
";
//Count the Participant by Role ID for Event
$role = "
- SELECT civicrm_participant.role_id as ROLEID,
- COUNT( civicrm_participant.id ) as participant,
+ SELECT civicrm_participant.role_id as ROLEID,
+ COUNT( civicrm_participant.id ) as participant,
SUM(civicrm_participant.fee_amount) as amount,
civicrm_participant.event_id as event_id
FROM civicrm_participant
WHERE civicrm_participant.event_id IN ( {$eventID}) AND
- civicrm_participant.is_test = 0
+ civicrm_participant.is_test = 0
{$activeParticipantClause}
GROUP BY civicrm_participant.role_id, civicrm_participant.event_id
";
//Count the Participant by status ID for Event
$status = "
- SELECT civicrm_participant.status_id as STATUSID,
- COUNT( civicrm_participant.id ) as participant,
+ SELECT civicrm_participant.status_id as STATUSID,
+ COUNT( civicrm_participant.id ) as participant,
SUM(civicrm_participant.fee_amount) as amount,
civicrm_participant.event_id as event_id
FROM civicrm_participant
WHERE civicrm_participant.event_id IN ({$eventID}) AND
- civicrm_participant.is_test = 0
+ civicrm_participant.is_test = 0
{$activeParticipantClause}
GROUP BY civicrm_participant.status_id, civicrm_participant.event_id
";
//Count the Participant by payment instrument ID for Event
//e.g. Credit Card, Check,Cash etc
$paymentInstrument = "
- SELECT c.payment_instrument_id as INSTRUMENT,
- COUNT( c.id ) as participant,
+ SELECT c.payment_instrument_id as INSTRUMENT,
+ COUNT( c.id ) as participant,
SUM(civicrm_participant.fee_amount) as amount,
civicrm_participant.event_id as event_id
$this->_limit = ($pageId - 1) * self::ROW_COUNT_LIMIT;
}
- function setPager() {
+ function setPager($rowCount = self::ROW_COUNT_LIMIT) {
$params = array(
'total' => $this->_rowsFound,
'rowCount' => self::ROW_COUNT_LIMIT,
$this->_params['id_value'][] = $key;
}
$noSelection = TRUE;
- }
-
+ }
+
$this->_rowsFound = count($this->_params['id_value']);
//set pager and limit if output mode is html
if ($this->_outputMode == 'html') {
$this->limit();
$this->setPager();
-
+
$showEvents = array();
$count = 0;
$numRows = $this->_limit;
if (!isset($this->_params['id_value'][$numRows])) {
break;
}
-
+
$showEvents[] = $this->_params['id_value'][$numRows];
$count++;
$numRows++;
$events = CRM_Event_PseudoConstant::event(NULL, NULL,
"is_template IS NULL OR is_template = 0"
);
-
+
$showEvents = array_diff(array_keys($events), $this->_params['id_value']);
}
$this->buildEventReport($showEvents);
-
+
}
else {
$this->buildEventReport($this->_params['id_value']);