add more columns and links to selector, CRM-12357
authorKurund Jalmi <kurund@civicrm.org>
Wed, 1 May 2013 01:58:33 +0000 (18:58 -0700)
committerKurund Jalmi <kurund@civicrm.org>
Wed, 1 May 2013 01:58:33 +0000 (18:58 -0700)
CRM/Mailing/BAO/Mailing.php
CRM/Mailing/Page/AJAX.php
templates/CRM/Mailing/Page/Tab.tpl

index d55ff5c9e6b63e1e1bf1b8959fe8a90cc5c5f139..a942cb02f40f3bf7234666b12f37be9ea03cff23 100644 (file)
@@ -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;
index 8d19c6eadeb2161e92368a428dd80cb0d05a93c4..2c9d84c01c7535963f1814947c6d06a6ab9a1c96 100644 (file)
@@ -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',
     );
 
index bf60765b417a5020e425030fbf87955cdc9e148d..9b20cd788ec4a852ede8add72c407c752f109413 100644 (file)
@@ -29,7 +29,8 @@
     <thead>
     <tr>
       <th class='crm-mailing-contact-subject'>{ts}Subject{/ts}</th>
-      <th class='crm-mailing-contact_created'>{ts}Created By{/ts}</th>
+      <th class='crm-mailing-contact_created'>{ts}Added By{/ts}</th>
+      <th class='crm-contact-activity_contact nosort'>{ts}With{/ts}</th>
       <th class='crm-mailing-contact-date'>{ts}Date{/ts}</th>
       <th class='crm-mailing-contact-links nosort'>&nbsp;</th>
     </tr>
@@ -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,