<?php
-
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
'Participant',
'Contact',
'Individual',
- 'Event'
+ 'Event',
);
public $_drilldownReport = array('event/income' => 'Link to Detail Report');
/**
- *
*/
/**
- *
*/
- function __construct() {
+ public function __construct() {
$this->_autoIncludeIndexedFieldsAsOrderBys = 1;
// Check if CiviCampaign is a) enabled and b) has active campaigns
'birth_date' => array(
'title' => 'Birth Date',
'operatorType' => CRM_Report_Form::OP_DATE,
- 'type' => CRM_Utils_Type::T_DATE
+ 'type' => CRM_Utils_Type::T_DATE,
),
),
),
'type' => CRM_Utils_Type::T_INT,
'attributes' => array(
'entity' => 'event',
- 'select' => array('minimumInputLength' => 0)
+ 'select' => array('minimumInputLength' => 0),
),
),
'sid' => array(
'event_id' => array(
'title' => ts('Event'),
'default_weight' => '1',
- 'default_order' => 'ASC'
+ 'default_order' => 'ASC',
),
),
),
'event_type_id' => array(
'title' => ts('Event Type'),
'default_weight' => '2',
- 'default_order' => 'ASC'
+ 'default_order' => 'ASC',
),
),
),
),
'currency' => array(
'required' => TRUE,
- 'no_display' => TRUE
+ 'no_display' => TRUE,
),
'trxn_id' => NULL,
'fee_amount' => array('title' => ts('Transaction Fee')),
- 'net_amount' => NULL
+ 'net_amount' => NULL,
),
'grouping' => 'contrib-fields',
'filters' => array(
'title' => ts('Contribution Status'),
'operatorType' => CRM_Report_Form::OP_MULTISELECT,
'options' => CRM_Contribute_PseudoConstant::contributionStatus(),
- 'default' => NULL
+ 'default' => NULL,
),
),
),
),
);
-
$this->_options = array(
'blank_column_begin' => array(
'title' => ts('Blank column at the Begining'),
// If we have active campaigns add those elements to both the fields and filters
if ($campaignEnabled && !empty($this->activeCampaigns)) {
- $this->_columns['civicrm_participant']['fields']['campaign_id'] =
- array(
- 'title' => ts('Campaign'),
- 'default' => 'false',
- );
- $this->_columns['civicrm_participant']['filters']['campaign_id'] =
- array(
- 'title' => ts('Campaign'),
- 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
- 'options' => $this->activeCampaigns,
- );
- $this->_columns['civicrm_participant']['order_bys']['campaign_id'] =
- array('title' => ts('Campaign'));
-
+ $this->_columns['civicrm_participant']['fields']['campaign_id'] = array(
+ 'title' => ts('Campaign'),
+ 'default' => 'false',
+ );
+ $this->_columns['civicrm_participant']['filters']['campaign_id'] = array(
+ 'title' => ts('Campaign'),
+ 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+ 'options' => $this->activeCampaigns,
+ );
+ $this->_columns['civicrm_participant']['order_bys']['campaign_id'] = array(
+ 'title' => ts('Campaign'),
+ );
}
$this->_currencyColumn = 'civicrm_participant_fee_currency';
}
/**
+ * Searches database for priceset values.
+ *
* @return array
*/
- function getPriceLevels() {
+ public function getPriceLevels() {
$query = "
-SELECT DISTINCT cv.label, cv.id
-FROM civicrm_price_field_value cv
-LEFT JOIN civicrm_price_field cf ON cv.price_field_id = cf.id
-LEFT JOIN civicrm_price_set_entity ce ON ce.price_set_id = cf.price_set_id
-WHERE ce.entity_table = 'civicrm_event'
-GROUP BY cv.label
+SELECT CONCAT(cv.label, ' (', ps.title, ')') label, cv.id
+FROM civicrm_price_field_value cv
+LEFT JOIN civicrm_price_field cf
+ ON cv.price_field_id = cf.id
+LEFT JOIN civicrm_price_set_entity ce
+ ON ce.price_set_id = cf.price_set_id
+LEFT JOIN civicrm_price_set ps
+ ON ce.price_set_id = ps.id
+WHERE ce.entity_table = 'civicrm_event'
+ORDER BY cv.label
";
$dao = CRM_Core_DAO::executeQuery($query);
$elements = array();
}
return $elements;
- } //searches database for priceset values
-
+ }
- function preProcess() {
+ public function preProcess() {
parent::preProcess();
}
- function select() {
+ public function select() {
$select = array();
$this->_columnHeaders = array();
*
* @return array
*/
- static function formRule($fields, $files, $self) {
+ public static function formRule($fields, $files, $self) {
$errors = $grouping = array();
return $errors;
}
- function from() {
+ public function from() {
$this->_from = "
FROM civicrm_participant {$this->_aliases['civicrm_participant']}
LEFT JOIN civicrm_event {$this->_aliases['civicrm_event']}
}
}
- function where() {
+ public function where() {
$clauses = array();
foreach ($this->_columns as $tableName => $table) {
if (array_key_exists('filters', $table)) {
$this->_where = "WHERE {$this->_aliases['civicrm_participant']}.is_test = 0 ";
}
else {
- $this->_where =
- "WHERE {$this->_aliases['civicrm_participant']}.is_test = 0 AND " .
+ $this->_where = "WHERE {$this->_aliases['civicrm_participant']}.is_test = 0 AND " .
implode(' AND ', $clauses);
}
if ($this->_aclWhere) {
}
}
- function groupBy() {
+ public function groupBy() {
$this->_groupBy = "GROUP BY {$this->_aliases['civicrm_participant']}.id";
}
- function postProcess() {
+ public function postProcess() {
// get ready with post process params
$this->beginPostProcess();
// build query
$sql = $this->buildQuery(TRUE);
-
// build array of result based on column headers. This method also allows
// modifying column headers before using it to build result set i.e $rows.
$rows = array();
/**
* @param $rows
*/
- function alterDisplay(&$rows) {
+ public function alterDisplay(&$rows) {
// custom code to alter rows
$entryFound = FALSE;
}
}
}
+
}