From a582d9f25e010775df9f2adec3d5ff54a80abefc Mon Sep 17 00:00:00 2001 From: Kurund Jalmi Date: Tue, 30 Apr 2013 18:58:33 -0700 Subject: [PATCH] add more columns and links to selector, CRM-12357 --- CRM/Mailing/BAO/Mailing.php | 24 +++++++++++++++++++----- CRM/Mailing/Page/AJAX.php | 4 ++-- templates/CRM/Mailing/Page/Tab.tpl | 6 ++++-- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/CRM/Mailing/BAO/Mailing.php b/CRM/Mailing/BAO/Mailing.php index d55ff5c9e6..a942cb02f4 100644 --- a/CRM/Mailing/BAO/Mailing.php +++ b/CRM/Mailing/BAO/Mailing.php @@ -2756,16 +2756,30 @@ AND m.id = %1 foreach ($mailings as $mailingId => $values) { $contactMailings[$mailingId]['subject'] = $values['subject']; $contactMailings[$mailingId]['start_date'] = CRM_Utils_Date::customFormat($values['start_date']); - + $contactMailings[$mailingId]['recipients'] = CRM_Utils_System::href(ts('(recipients)'), 'civicrm/mailing/report', + "mid={$values['mailing_id']}&reset=1&cid={$values['creator_id']}&context=mailing"); $contactMailings[$mailingId]['mailing_creator'] = CRM_Utils_System::href( $values['creator_name'], 'civicrm/contact/view', "reset=1&cid={$values['creator_id']}"); - $contactMailings[$mailingId]['links'] = CRM_Utils_System::href( - ts('View Mailing'), - 'civicrm/mailing/view', - "reset=1&id={$values['mailing_id']}"); + $actionLinks = array( + CRM_Core_Action::VIEW => array( + 'name' => ts('View'), + 'url' => 'civicrm/mailing/view', + 'qs' => "reset=1&id={$values['mailing_id']}", + 'title' => ts('View Mailing'), + 'class' => 'crm-mailing-view', + ), + CRM_Core_Action::BROWSE => array( + 'name' => ts('Mailing Report'), + 'url' => 'civicrm/mailing/report', + 'qs' => "mid={$values['mailing_id']}&reset=1&cid={$values['creator_id']}&context=mailing", + 'title' => ts('View Mailing Report'), + ) + ); + + $contactMailings[$mailingId]['links'] = CRM_Core_Action::formLink($actionLinks); } return $contactMailings; diff --git a/CRM/Mailing/Page/AJAX.php b/CRM/Mailing/Page/AJAX.php index 8d19c6eade..2c9d84c01c 100644 --- a/CRM/Mailing/Page/AJAX.php +++ b/CRM/Mailing/Page/AJAX.php @@ -68,7 +68,7 @@ class CRM_Mailing_Page_AJAX { //$context = CRM_Utils_Type::escape(CRM_Utils_Array::value('context', $_GET), 'String'); $sortMapper = array( - 0 => 'subject', 1 => 'creator_name', 2 => 'start_date', 3 => 'links', + 0 => 'subject', 1 => 'creator_name', 2 => 'recipients', 3 => 'start_date', 4 => 'links', ); $sEcho = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer'); @@ -93,7 +93,7 @@ class CRM_Mailing_Page_AJAX { $iFilteredTotal = $iTotal = $params['total']; $selectorElements = array( - 'subject', 'mailing_creator', + 'subject', 'mailing_creator', 'recipients', 'start_date', 'links', ); diff --git a/templates/CRM/Mailing/Page/Tab.tpl b/templates/CRM/Mailing/Page/Tab.tpl index bf60765b41..9b20cd788e 100644 --- a/templates/CRM/Mailing/Page/Tab.tpl +++ b/templates/CRM/Mailing/Page/Tab.tpl @@ -29,7 +29,8 @@ {ts}Subject{/ts} - {ts}Created By{/ts} + {ts}Added By{/ts} + {ts}With{/ts} {ts}Date{/ts}   @@ -58,7 +59,8 @@ function buildMailingContact() { "aoColumns" : [ {sClass:'crm-mailing-contact-subject'}, {sClass:'crm-mailing-contact_created'}, - {sClass:'crm-mailing-contact-date'}, + {sClass: 'crm-contact-activity_contact'}, + {sClass: 'crm-mailing-contact-date'}, {sClass:'crm-mailing-contact-links', bSortable:false} ], "bProcessing": true, -- 2.25.1