* Array of supported links, currenly null
*
* @var array
- * @static
*/
static $_links = NULL;
* If the event type is a click-through, do we want only those from a specific url?.
*
* @return \CRM_Mailing_Selector_Event
- * @access public
*/
public function __construct($event, $distinct, $mailing, $job = NULL, $url = NULL) {
$this->_event_type = $event;
* This method returns the links that are given for each search row.
*
* @return array
- * @static
*/
public static function &links() {
return self::$_links;
switch ($this->_event_type) {
case 'queue':
$event = new CRM_Mailing_Event_BAO_Queue();
- return $event->getTotalCount($this->_mailing_id,
+ $result = $event->getTotalCount($this->_mailing_id,
$this->_job_id
);
+ return $result;
case 'delivered':
$event = new CRM_Mailing_Event_BAO_Delivered();
- return $event->getTotalCount($this->_mailing_id,
+ $result = $event->getTotalCount($this->_mailing_id,
$this->_job_id,
$this->_is_distinct
);
+ return $result;
case 'opened':
$event = new CRM_Mailing_Event_BAO_Opened();
- return $event->getTotalCount($this->_mailing_id,
+ $result = $event->getTotalCount($this->_mailing_id,
$this->_job_id,
$this->_is_distinct
);
+ return $result;
case 'bounce':
$event = new CRM_Mailing_Event_BAO_Bounce();
- return $event->getTotalCount($this->_mailing_id,
+ $result = $event->getTotalCount($this->_mailing_id,
$this->_job_id,
$this->_is_distinct
);
+ return $result;
case 'forward':
$event = new CRM_Mailing_Event_BAO_Forward();
- return $event->getTotalCount($this->_mailing_id,
+ $result = $event->getTotalCount($this->_mailing_id,
$this->_job_id,
$this->_is_distinct
);
+ return $result;
case 'reply':
$event = new CRM_Mailing_Event_BAO_Reply();
- return $event->getTotalCount($this->_mailing_id,
+ $result = $event->getTotalCount($this->_mailing_id,
$this->_job_id,
$this->_is_distinct
);
+ return $result;
case 'unsubscribe':
$event = new CRM_Mailing_Event_BAO_Unsubscribe();
- return $event->getTotalCount($this->_mailing_id,
+ $result = $event->getTotalCount($this->_mailing_id,
$this->_job_id,
$this->_is_distinct
);
+ return $result;
case 'optout':
$event = new CRM_Mailing_Event_BAO_Unsubscribe();
- return $event->getTotalCount($this->_mailing_id,
+ $result = $event->getTotalCount($this->_mailing_id,
$this->_job_id,
$this->_is_distinct,
FALSE
);
+ return $result;
case 'click':
$event = new CRM_Mailing_Event_BAO_TrackableURLOpen();
- return $event->getTotalCount($this->_mailing_id,
+ $result = $event->getTotalCount($this->_mailing_id,
$this->_job_id,
$this->_is_distinct,
$this->_url_id
);
+ return $result;
default:
return 0;
public function &getRows($action, $offset, $rowCount, $sort, $output = NULL) {
switch ($this->_event_type) {
case 'queue':
- return CRM_Mailing_Event_BAO_Queue::getRows($this->_mailing_id,
+ $rows = CRM_Mailing_Event_BAO_Queue::getRows($this->_mailing_id,
$this->_job_id, $offset, $rowCount, $sort
);
- break;
+ return $rows;
case 'delivered':
- return CRM_Mailing_Event_BAO_Delivered::getRows($this->_mailing_id,
+ $rows = CRM_Mailing_Event_BAO_Delivered::getRows($this->_mailing_id,
$this->_job_id, $this->_is_distinct,
$offset, $rowCount, $sort
);
+ return $rows;
case 'opened':
- return CRM_Mailing_Event_BAO_Opened::getRows($this->_mailing_id,
+ $rows = CRM_Mailing_Event_BAO_Opened::getRows($this->_mailing_id,
$this->_job_id, $this->_is_distinct,
$offset, $rowCount, $sort
);
+ return $rows;
case 'bounce':
- return CRM_Mailing_Event_BAO_Bounce::getRows($this->_mailing_id,
+ $rows = CRM_Mailing_Event_BAO_Bounce::getRows($this->_mailing_id,
$this->_job_id, $this->_is_distinct,
$offset, $rowCount, $sort
);
+ return $rows;
case 'forward':
- return CRM_Mailing_Event_BAO_Forward::getRows($this->_mailing_id,
+ $rows = CRM_Mailing_Event_BAO_Forward::getRows($this->_mailing_id,
$this->_job_id, $this->_is_distinct,
$offset, $rowCount, $sort
);
+ return $rows;
case 'reply':
- return CRM_Mailing_Event_BAO_Reply::getRows($this->_mailing_id,
+ $rows = CRM_Mailing_Event_BAO_Reply::getRows($this->_mailing_id,
$this->_job_id, $this->_is_distinct,
$offset, $rowCount, $sort
);
+ return $rows;
case 'unsubscribe':
- return CRM_Mailing_Event_BAO_Unsubscribe::getRows($this->_mailing_id,
+ $rows = CRM_Mailing_Event_BAO_Unsubscribe::getRows($this->_mailing_id,
$this->_job_id, $this->_is_distinct,
$offset, $rowCount, $sort, TRUE
);
+ return $rows;
case 'optout':
- return CRM_Mailing_Event_BAO_Unsubscribe::getRows($this->_mailing_id,
+ $rows = CRM_Mailing_Event_BAO_Unsubscribe::getRows($this->_mailing_id,
$this->_job_id, $this->_is_distinct,
$offset, $rowCount, $sort, FALSE
);
+ return $rows;
case 'click':
- return CRM_Mailing_Event_BAO_TrackableURLOpen::getRows(
+ $rows = CRM_Mailing_Event_BAO_TrackableURLOpen::getRows(
$this->_mailing_id, $this->_job_id,
$this->_is_distinct, $this->_url_id,
$offset, $rowCount, $sort
);
+ return $rows;
default:
return NULL;
* @param string $output
* Type of output.
*
- * @return string
+ * @return string|NULL
* name of the file
*/
public function getExportFileName($output = 'csv') {
+ return NULL;
}
public function eventToTitle() {
'delivered' => ts('Successful Deliveries'),
'bounce' => ts('Bounces'),
'forward' => ts('Forwards'),
- 'reply' => $this->_is_distinct
- ? ts('Unique Replies')
- : ts('Replies'),
+ 'reply' => $this->_is_distinct ? ts('Unique Replies') : ts('Replies'),
'unsubscribe' => ts('Unsubscribe Requests'),
'optout' => ts('Opt-out Requests'),
- 'click' => $this->_is_distinct
- ? ts('Unique Click-throughs')
- : ts('Click-throughs'),
- 'opened' => $this->_is_distinct
- ? ts('Unique Tracked Opens')
- : ts('Tracked Opens'),
+ 'click' => $this->_is_distinct ? ts('Unique Click-throughs') : ts('Click-throughs'),
+ 'opened' => $this->_is_distinct ? ts('Unique Tracked Opens') : ts('Tracked Opens'),
);
}
return $events[$this->_event_type];