From 27a4d216424df4fe368fb2bdb5e22e10ad84ebb1 Mon Sep 17 00:00:00 2001 From: "deb.monish" Date: Sat, 2 Jun 2018 00:04:30 +0530 Subject: [PATCH] dev/mail#12 Incorrect Total Count on mail summary report --- CRM/Report/Form/Mailing/Summary.php | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/CRM/Report/Form/Mailing/Summary.php b/CRM/Report/Form/Mailing/Summary.php index 7ff12e70db..5e73d3c0e8 100644 --- a/CRM/Report/Form/Mailing/Summary.php +++ b/CRM/Report/Form/Mailing/Summary.php @@ -665,15 +665,19 @@ class CRM_Report_Form_Mailing_Summary extends CRM_Report_Form { $entryFound = FALSE; foreach ($rows as $rowNum => $row) { // CRM-16506 - if (array_key_exists('civicrm_mailing_name', $row) && - array_key_exists('civicrm_mailing_id', $row) - ) { - $rows[$rowNum]['civicrm_mailing_name_link'] = CRM_Report_Utils_Report::getNextUrl('mailing/detail', - 'reset=1&force=1&mailing_id_op=eq&mailing_id_value=' . $row['civicrm_mailing_id'], - $this->_absoluteUrl, $this->_id, $this->_drilldownReport - ); - $rows[$rowNum]['civicrm_mailing_name_hover'] = ts('View Mailing details for this mailing'); - $entryFound = TRUE; + if (array_key_exists('civicrm_mailing_id', $row)) { + if (array_key_exists('civicrm_mailing_name', $row)) { + $rows[$rowNum]['civicrm_mailing_name_link'] = CRM_Report_Utils_Report::getNextUrl('mailing/detail', + 'reset=1&force=1&mailing_id_op=eq&mailing_id_value=' . $row['civicrm_mailing_id'], + $this->_absoluteUrl, $this->_id, $this->_drilldownReport + ); + $rows[$rowNum]['civicrm_mailing_name_hover'] = ts('View Mailing details for this mailing'); + $entryFound = TRUE; + } + if (array_key_exists('civicrm_mailing_event_opened_open_count', $row)) { + $rows[$rowNum]['civicrm_mailing_event_opened_open_count'] = CRM_Mailing_Event_BAO_Opened::getTotalCount($row['civicrm_mailing_id']); + $entryFound = TRUE; + } } // skip looking further in rows, if first row itself doesn't // have the column we need -- 2.25.1