+--------------------------------------------------------------------+
| CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2015 |
+ | Copyright CiviCRM LLC (c) 2004-2016 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2015
+ * @copyright CiviCRM LLC (c) 2004-2016
*/
class CRM_Report_Form_Mailing_Bounce extends CRM_Report_Form {
'filters' => array(
'bounce_reason' => array(
'title' => ts('Bounce Reason'),
+ 'type' => CRM_Utils_Type::T_STRING,
),
'time_stamp' => array(
'title' => ts('Bounce Date'),
'email' => array(
'title' => ts('Email'),
'no_repeat' => TRUE,
- 'required' => TRUE,
),
'on_hold' => array(
'title' => ts('On hold'),
$this->_columnHeaders["civicrm_mailing_bounce_count"]['title'] = ts('Bounce Count');
}
+ $this->_selectClauses = $select;
$this->_select = "SELECT " . implode(', ', $select) . " ";
}
$this->_from .= "
INNER JOIN civicrm_mailing_event_queue
ON civicrm_mailing_event_queue.contact_id = {$this->_aliases['civicrm_contact']}.id
- INNER JOIN civicrm_email {$this->_aliases['civicrm_email']}
+ LEFT JOIN civicrm_email {$this->_aliases['civicrm_email']}
ON civicrm_mailing_event_queue.email_id = {$this->_aliases['civicrm_email']}.id
INNER JOIN civicrm_mailing_event_bounce {$this->_aliases['civicrm_mailing_event_bounce']}
ON {$this->_aliases['civicrm_mailing_event_bounce']}.event_queue_id = civicrm_mailing_event_queue.id
public function groupBy() {
if (!empty($this->_params['charts'])) {
- $this->_groupBy = " GROUP BY {$this->_aliases['civicrm_mailing']}.id";
+ $groupBy = "{$this->_aliases['civicrm_mailing']}.id";
}
else {
- $this->_groupBy = " GROUP BY {$this->_aliases['civicrm_mailing_event_bounce']}.id";
+ $groupBy = "{$this->_aliases['civicrm_mailing_event_bounce']}.id";
}
+ $this->_groupBy = " GROUP BY {$groupBy}";
+ $this->_groupBy .= CRM_Contact_BAO_Query::getGroupByFromSelectColumns($this->_selectClauses, $groupBy);
}
public function postProcess() {
$entryFound = FALSE;
foreach ($rows as $rowNum => $row) {
+
+ // If the email address has been deleted
+ if (array_key_exists('civicrm_email_email', $row)) {
+ if (empty($rows[$rowNum]['civicrm_email_email'])) {
+ $rows[$rowNum]['civicrm_email_email'] = '<del>Email address deleted</del>';
+ }
+ $entryFound = TRUE;
+ }
+
// make count columns point to detail report
// convert display name to links
if (array_key_exists('civicrm_contact_sort_name', $row) &&