From b4dfc663519f61accca530a1a5da0bac2da18623 Mon Sep 17 00:00:00 2001 From: Jamie McClelland Date: Fri, 29 Aug 2014 14:55:57 -0400 Subject: [PATCH] CRM-15202 - allow filtering by group assigned to the mailing. ---------------------------------------- * 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 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CRM/Report/Form/Mailing/Summary.php b/CRM/Report/Form/Mailing/Summary.php index 2b11ca592c..3ac88d4a7c 100644 --- a/CRM/Report/Form/Mailing/Summary.php +++ b/CRM/Report/Form/Mailing/Summary.php @@ -258,6 +258,17 @@ class CRM_Report_Form_Mailing_Summary extends CRM_Report_Form { ), ), ); + $this->_columns['civicrm_mailing_group'] = array( + 'dao' => 'CRM_Mailing_DAO_MailingGroup', + 'filters' => array( + 'entity_id' => array( + 'title' => ts('Groups Included in Mailing'), + 'operatorType' => CRM_Report_Form::OP_MULTISELECT, + 'type' => CRM_Utils_Type::T_INT, + 'options' => CRM_Core_PseudoConstant::group(), + ), + ), + ); $config = CRM_Core_Config::singleton(); $this->campaignEnabled = in_array("CiviCampaign", $config->enableComponents); if ($this->campaignEnabled) { @@ -372,6 +383,8 @@ 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 -- 2.25.1