Skip to content
Snippets Groups Projects
Commit 1c46a84c authored by yashodha's avatar yashodha
Browse files

(#959) Expose contribution page in Contribution Summary report

parent f3171f18
No related branches found
No related tags found
No related merge requests found
......@@ -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(
......@@ -847,6 +862,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
......@@ -936,6 +952,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']) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment