protected $_customGroupExtends = array('Contribution');
/**
- *
*/
/**
- *
*/
- function __construct() {
+ public function __construct() {
// Check if CiviCampaign is a) enabled and b) has active campaigns
$config = CRM_Core_Config::singleton();
'title' => ts('Last Name, First Name'),
'default' => '1',
'default_weight' => '0',
- 'default_order' => 'ASC'
+ 'default_order' => 'ASC',
),
),
'grouping' => 'contact-fields',
'net_amount' => NULL,
'contribution_or_soft' => array(
'title' => ts('Contribution OR Soft Credit?'),
- 'dbAlias' => "'Contribution'"
+ 'dbAlias' => "'Contribution'",
),
'soft_credits' => array(
'title' => ts('Soft Credits'),
- 'dbAlias' => "NULL"
+ 'dbAlias' => "NULL",
),
'soft_credit_for' => array(
'title' => ts('Soft Credit For'),
- 'dbAlias' => "NULL"
+ 'dbAlias' => "NULL",
),
),
'filters' => array(
parent::__construct();
}
- function preProcess() {
+ public function preProcess() {
parent::preProcess();
}
- function select() {
+ public function select() {
$this->_columnHeaders = array();
parent::select();
$this->_select = str_replace("sum({$this->_aliases['civicrm_contribution']}.total_amount)", "{$this->_aliases['civicrm_contribution']}.total_amount", $this->_select);
}
- function orderBy() {
+ public function orderBy() {
parent::orderBy();
// please note this will just add the order-by columns to select query, and not display in column-headers.
/**
* @param bool $softcredit
*/
- function from($softcredit = FALSE) {
+ public function from($softcredit = FALSE) {
$this->_from = "
FROM civicrm_contact {$this->_aliases['civicrm_contact']} {$this->_aclFrom}
INNER JOIN civicrm_contribution {$this->_aliases['civicrm_contribution']}
}
- function groupBy() {
+ public function groupBy() {
$this->_groupBy = " GROUP BY {$this->_aliases['civicrm_contact']}.id, {$this->_aliases['civicrm_contribution']}.id ";
}
*
* @return array
*/
- function statistics(&$rows) {
+ public function statistics(&$rows) {
$statistics = parent::statistics($rows);
$totalAmount = $average = array();
return $statistics;
}
- function postProcess() {
+ public function postProcess() {
// get the acl clauses built before we assemble the query
$this->buildACLClause($this->_aliases['civicrm_contact']);
) {
$tempQuery = "(SELECT * FROM civireport_contribution_detail_temp1)";
}
- else if (CRM_Utils_Array::value('contribution_or_soft_value', $this->_params) ==
+ elseif (CRM_Utils_Array::value('contribution_or_soft_value', $this->_params) ==
'soft_credits_only'
) {
$tempQuery = "(SELECT * FROM civireport_contribution_detail_temp2)";
list($alias, $rest) = explode('.', $clause);
$orderClause[] = $aliases[$alias] . "_" . $rest;
}
- $orderBy = (!empty($orderClause)) ?
- "ORDER BY " . implode(', ', $orderClause) : '';
+ $orderBy = (!empty($orderClause)) ? "ORDER BY " . implode(', ', $orderClause) : '';
}
// 6. show result set from temp table 3
/**
* @param $rows
*/
- function alterDisplay(&$rows) {
+ public function alterDisplay(&$rows) {
// custom code to alter rows
$checkList = array();
$entryFound = FALSE;
}
}
- function sectionTotals() {
+ public function sectionTotals() {
// Reports using order_bys with sections must populate $this->_selectAliases in select() method.
if (empty($this->_selectAliases)) {
}
else {
// other aliases are higher level; roll count into their total
- $totals[$key] = (array_key_exists($key, $totals)) ?
- $totals[$key] + $dao->ct : $dao->ct;
+ $totals[$key] = (array_key_exists($key, $totals)) ? $totals[$key] + $dao->ct : $dao->ct;
if ($showsumcontribs) {
- $sumcontribs[$key] = array_key_exists($key, $sumcontribs) ?
- $sumcontribs[$key] + $dao->sumcontribs : $dao->sumcontribs;
+ $sumcontribs[$key] = array_key_exists($key, $sumcontribs) ? $sumcontribs[$key] + $dao->sumcontribs : $dao->sumcontribs;
}
}
}
) {
$title = '%1 contributions: %2';
}
- else if (CRM_Utils_Array::value('contribution_or_soft_value', $this->_params) ==
+ elseif (CRM_Utils_Array::value('contribution_or_soft_value', $this->_params) ==
'soft_credits_only'
) {
$title = '%1 soft-credits: %2';
foreach ($totals as $key => $total) {
$totalandsum[$key] = ts($title, array(
1 => $total,
- 2 => CRM_Utils_Money::format($sumcontribs[$key])
+ 2 => CRM_Utils_Money::format($sumcontribs[$key]),
));
}
$this->assign('sectionTotals', $totalandsum);
}
}
}
-