<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.3 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
* @access public
* @static
*/
- public static function getTotalCount($mailing_id, $job_id = NULL,
- $is_distinct = FALSE
- ) {
+ public static function getTotalCount($mailing_id, $job_id = NULL, $is_distinct = FALSE, $toDate = NULL) {
$dao = new CRM_Core_DAO();
$bounce = self::getTableName();
ON $job.mailing_id = $mailing.id
WHERE $mailing.id = " . CRM_Utils_Type::escape($mailing_id, 'Integer');
+ if (!empty($toDate)) {
+ $query .= " AND $bounce.time_stamp <= $toDate";
+ }
+
if (!empty($job_id)) {
$query .= " AND $job.id = " . CRM_Utils_Type::escape($job_id, 'Integer');
}
$orderBy = "sort_name ASC, {$bounce}.time_stamp DESC";
if ($sort) {
if (is_string($sort)) {
+ $sort = CRM_Utils_Type::escape($sort, 'String');
$orderBy = $sort;
}
else {
return $results;
}
}
-