From 07ac16aae73af5e726dddafd1253b0d1f0792f94 Mon Sep 17 00:00:00 2001 From: yashodha Date: Thu, 12 May 2016 13:41:10 +0530 Subject: [PATCH] CRM-15202: mailing summary report should have option to filter by groups included ---------------------------------------- * CRM-15202: mailing summary report should have option to filter by groups included https://issues.civicrm.org/jira/browse/CRM-15202 --- CRM/Report/Form/Mailing/Summary.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CRM/Report/Form/Mailing/Summary.php b/CRM/Report/Form/Mailing/Summary.php index 8ebf14b9c9..2706d4721d 100644 --- a/CRM/Report/Form/Mailing/Summary.php +++ b/CRM/Report/Form/Mailing/Summary.php @@ -383,13 +383,16 @@ class CRM_Report_Form_Mailing_Summary extends CRM_Report_Form { ON {$this->_aliases['civicrm_mailing_event_opened']}.event_queue_id = {$this->_aliases['civicrm_mailing_event_queue']}.id LEFT JOIN civicrm_mailing_event_trackable_url_open {$this->_aliases['civicrm_mailing_event_trackable_url_open']} ON {$this->_aliases['civicrm_mailing_event_trackable_url_open']}.event_queue_id = {$this->_aliases['civicrm_mailing_event_queue']}.id - LEFT JOIN civicrm_mailing_group {$this->_aliases['civicrm_mailing_group']} - ON {$this->_aliases['civicrm_mailing_group']}.mailing_id = {$this->_aliases['civicrm_mailing']}.id LEFT JOIN civicrm_mailing_event_unsubscribe {$this->_aliases['civicrm_mailing_event_unsubscribe']} ON {$this->_aliases['civicrm_mailing_event_unsubscribe']}.event_queue_id = {$this->_aliases['civicrm_mailing_event_queue']}.id AND {$this->_aliases['civicrm_mailing_event_unsubscribe']}.org_unsubscribe = 0 LEFT JOIN civicrm_mailing_event_unsubscribe mailing_event_optout_civireport ON mailing_event_optout_civireport.event_queue_id = {$this->_aliases['civicrm_mailing_event_queue']}.id AND mailing_event_optout_civireport.org_unsubscribe = 1"; + if ($this->isTableSelected('civicrm_mailing_group')) { + $this->_from .= " + LEFT JOIN civicrm_mailing_group {$this->_aliases['civicrm_mailing_group']} + ON {$this->_aliases['civicrm_mailing_group']}.mailing_id = {$this->_aliases['civicrm_mailing']}.id"; + } if ($this->campaignEnabled) { $this->_from .= " LEFT JOIN civicrm_campaign {$this->_aliases['civicrm_campaign']} -- 2.25.1