formating fixes
[civicrm-core.git] / CRM / Mailing / Selector / Event.php
index eefd5ede4bf10680002c4e5e705d17359084a269..b9678bc9063b8a4c76bdcb079382d5e3fb4102da 100644 (file)
@@ -23,7 +23,7 @@
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
@@ -81,7 +81,7 @@ class CRM_Mailing_Selector_Event extends CRM_Core_Selector_Base implements CRM_C
   public $_columnHeaders;
 
   /**
-   * Class constructor
+   * Class constructor.
    *
    * @param string $event
    *   The event type (queue/delivered/open...).
@@ -150,12 +150,12 @@ class CRM_Mailing_Selector_Event extends CRM_Core_Selector_Base implements CRM_C
     if (!isset($this->_columnHeaders)) {
 
       $this->_columnHeaders = array(
-        array(
+        'sort_name' => array(
           'name' => ts('Contact'),
           'sort' => $contact . '.sort_name',
           'direction' => CRM_Utils_Sort::ASCENDING,
         ),
-        array(
+        'email' => array(
           'name' => ts('Email Address'),
           'sort' => $email . '.email',
           'direction' => CRM_Utils_Sort::DONTCARE,
@@ -168,6 +168,13 @@ class CRM_Mailing_Selector_Event extends CRM_Core_Selector_Base implements CRM_C
           break;
 
         case 'delivered':
+          $this->_columnHeaders = array(
+            'contact_id' => array(
+              'name' => ts('Internal Contact ID'),
+              'sort' => $contact . '.id',
+              'direction' => CRM_Utils_Sort::ASCENDING,
+            ),
+          ) + $this->_columnHeaders;
           $dateSort = CRM_Mailing_Event_BAO_Delivered::getTableName() . '.time_stamp';
           break;
 
@@ -236,15 +243,13 @@ class CRM_Mailing_Selector_Event extends CRM_Core_Selector_Base implements CRM_C
           return 0;
       }
 
-      $this->_columnHeaders = array_merge($this->_columnHeaders,
-        array(
-          array(
-            'name' => ts('Date'),
-            'sort' => $dateSort,
-            'direction' => CRM_Utils_Sort::DESCENDING,
+      $this->_columnHeaders = array_merge($this->_columnHeaders, array(
+        'date' => array(
+          'name' => ts('Date'),
+          'sort' => $dateSort,
+          'direction' => CRM_Utils_Sort::DESCENDING,
           ),
-        )
-      );
+        ));
     }
     return $this->_columnHeaders;
   }
@@ -338,7 +343,7 @@ class CRM_Mailing_Selector_Event extends CRM_Core_Selector_Base implements CRM_C
   }
 
   /**
-   * Returns all the rows in the given offset and rowCount
+   * Returns all the rows in the given offset and rowCount.
    *
    * @param string $action
    *   The action being performed.
@@ -459,4 +464,5 @@ class CRM_Mailing_Selector_Event extends CRM_Core_Selector_Base implements CRM_C
   public function getTitle() {
     return $this->eventToTitle();
   }
+
 }