Unverified Commit a0741dc6 authored by Eileen McNaughton's avatar Eileen McNaughton Committed by GitHub

Merge pull request #14249 from yashodha/959_dev

(#959) Expose contribution page in Contribution Summary report
parents cd4c8c24 1c46a84c
......@@ -133,6 +133,9 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form {
'required' => TRUE,
'no_display' => TRUE,
),
'contribution_page_id' => array(
'title' => ts('Contribution Page'),
),
'total_amount' => array(
'title' => ts('Contribution Amount Stats'),
'default' => TRUE,
......@@ -157,6 +160,12 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form {
'default' => array(1),
'type' => CRM_Utils_Type::T_INT,
),
'contribution_page_id' => array(
'title' => ts('Contribution Page'),
'operatorType' => CRM_Report_Form::OP_MULTISELECT,
'options' => CRM_Contribute_PseudoConstant::contributionPage(),
'type' => CRM_Utils_Type::T_INT,
),
'currency' => array(
'title' => ts('Currency'),
'operatorType' => CRM_Report_Form::OP_MULTISELECT,
......@@ -215,6 +224,12 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form {
'default' => array(1),
'type' => CRM_Utils_Type::T_INT,
),
'contribution_page_id' => array(
'title' => ts('Contribution Page'),
'operatorType' => CRM_Report_Form::OP_MULTISELECT,
'options' => CRM_Contribute_PseudoConstant::contributionPage(),
'type' => CRM_Utils_Type::T_INT,
),
),
),
'civicrm_financial_trxn' => array(
......@@ -850,6 +865,7 @@ ROUND(AVG({$this->_aliases['civicrm_contribution_soft']}.amount), 2) as civicrm_
public function alterDisplay(&$rows) {
$entryFound = FALSE;
$contributionStatus = CRM_Contribute_PseudoConstant::contributionStatus();
$contributionPages = CRM_Contribute_PseudoConstant::contributionPage();
foreach ($rows as $rowNum => $row) {
// make count columns point to detail report
......@@ -939,6 +955,11 @@ ROUND(AVG({$this->_aliases['civicrm_contribution_soft']}.amount), 2) as civicrm_
$entryFound = TRUE;
}
if ($value = CRM_Utils_Array::value('civicrm_contribution_contribution_page_id', $row)) {
$rows[$rowNum]['civicrm_contribution_contribution_page_id'] = $contributionPages[$value];
$entryFound = TRUE;
}
// If using campaigns, convert campaign_id to campaign title
if (array_key_exists('civicrm_contribution_campaign_id', $row)) {
if ($value = $row['civicrm_contribution_campaign_id']) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment