From: eileenmcnaugton Date: Fri, 31 Jul 2015 18:46:51 +0000 (+1200) Subject: remove some unused variables X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=0c6ecdd4120c8022399b44d2ba6de1e244a9985e;p=civicrm-core.git remove some unused variables --- diff --git a/CRM/Mailing/BAO/Mailing.php b/CRM/Mailing/BAO/Mailing.php index 18c7fd3f07..b7ebdc163c 100644 --- a/CRM/Mailing/BAO/Mailing.php +++ b/CRM/Mailing/BAO/Mailing.php @@ -96,13 +96,14 @@ class CRM_Mailing_BAO_Mailing extends CRM_Mailing_DAO_Mailing { } /** + * @deprecated + * * @param int $job_id * @param int $mailing_id - * @param null $mode * * @return int */ - public static function &getRecipientsCount($job_id, $mailing_id = NULL, $mode = NULL) { + public static function getRecipientsCount($job_id, $mailing_id = NULL) { // need this for backward compatibility, so we can get count for old mailings // please do not use this function if possible $eq = self::getRecipients($job_id, $mailing_id); @@ -115,19 +116,15 @@ class CRM_Mailing_BAO_Mailing extends CRM_Mailing_DAO_Mailing { * @param int $job_id * (misnomer) a nonce value used to name temporary tables. * @param int $mailing_id - * @param null $offset - * @param null $limit * @param bool $storeRecipients * @param bool $dedupeEmail * @param null $mode * * @return CRM_Mailing_Event_BAO_Queue|string */ - public static function &getRecipients( + public static function getRecipients( $job_id, $mailing_id = NULL, - $offset = NULL, - $limit = NULL, $storeRecipients = FALSE, $dedupeEmail = FALSE, $mode = NULL) { @@ -137,8 +134,6 @@ class CRM_Mailing_BAO_Mailing extends CRM_Mailing_DAO_Mailing { $job = CRM_Mailing_BAO_MailingJob::getTableName(); $mg = CRM_Mailing_DAO_MailingGroup::getTableName(); $eq = CRM_Mailing_Event_DAO_Queue::getTableName(); - $ed = CRM_Mailing_Event_DAO_Delivered::getTableName(); - $eb = CRM_Mailing_Event_DAO_Bounce::getTableName(); $email = CRM_Core_DAO_Email::getTableName(); if ($mode == 'sms') { @@ -530,19 +525,10 @@ AND $mg.mailing_id = {$mailing_id} } $mailingGroup->query($query); - $results = array(); - $eq = new CRM_Mailing_Event_BAO_Queue(); list($aclFrom, $aclWhere) = CRM_Contact_BAO_Contact_Permission::cacheClause(); $aclWhere = $aclWhere ? "WHERE {$aclWhere}" : ''; - $limitString = NULL; - if ($limit && $offset !== NULL) { - $offset = CRM_Utils_Type::escape($offset, 'Int'); - $limit = CRM_Utils_Type::escape($limit, 'Int'); - - $limitString = "LIMIT $offset, $limit"; - } if ($storeRecipients && $mailing_id) { $sql = " @@ -625,7 +611,7 @@ ORDER BY i.contact_id, i.{$tempColumn} /** * Returns the regex patterns that are used for preparing the text and html templates. */ - private function &getPatterns($onlyHrefs = FALSE) { + private function getPatterns($onlyHrefs = FALSE) { $patterns = array(); @@ -1171,14 +1157,14 @@ ORDER BY civicrm_email.is_bulkmail DESC * * @return Mail_mime The mail object */ - public function &compose( + public function compose( $job_id, $event_queue_id, $hash, $contactId, $email, &$recipient, $test, $contactDetails, &$attachments, $isForward = FALSE, $fromEmail = NULL, $replyToEmail = NULL ) { $config = CRM_Core_Config::singleton(); - $knownTokens = $this->getTokens(); + $this->getTokens(); if ($this->_domain == NULL) { $this->_domain = CRM_Core_BAO_Domain::getDomain(); @@ -1212,7 +1198,7 @@ ORDER BY civicrm_email.is_bulkmail DESC } else { $params = array(array('contact_id', '=', $contactId, 0, 0)); - list($contact, $_) = CRM_Contact_BAO_Query::apiQuery($params); + list($contact) = CRM_Contact_BAO_Query::apiQuery($params); //CRM-4524 $contact = reset($contact); @@ -1752,7 +1738,7 @@ ORDER BY civicrm_email.is_bulkmail DESC // Populate the recipients. if (empty($params['_skip_evil_bao_auto_recipients_'])) { - self::getRecipients($job->id, $mailing->id, NULL, NULL, TRUE, $mailing->dedupe_email); + self::getRecipients($job->id, $mailing->id, TRUE, $mailing->dedupe_email); } } @@ -2836,7 +2822,7 @@ WHERE civicrm_mailing_job.id = %1 * @throws Exception */ public static function processQueue($mode = NULL) { - $config = &CRM_Core_Config::singleton(); + $config = CRM_Core_Config::singleton(); if ($mode == NULL && CRM_Core_BAO_MailSettings::defaultDomain() == "EXAMPLE.ORG") { throw new CRM_Core_Exception(ts('The default mailbox has not been configured. You will find more info in the online user and administrator guide', array( diff --git a/CRM/Mailing/BAO/MailingAB.php b/CRM/Mailing/BAO/MailingAB.php index 247de4ad7a..4728b203b8 100644 --- a/CRM/Mailing/BAO/MailingAB.php +++ b/CRM/Mailing/BAO/MailingAB.php @@ -151,7 +151,7 @@ class CRM_Mailing_BAO_MailingAB extends CRM_Mailing_DAO_MailingAB { * @param CRM_Mailing_DAO_MailingAB $dao */ public static function distributeRecipients(CRM_Mailing_DAO_MailingAB $dao) { - CRM_Mailing_BAO_Mailing::getRecipients($dao->mailing_id_a, $dao->mailing_id_a, NULL, NULL, TRUE); + CRM_Mailing_BAO_Mailing::getRecipients($dao->mailing_id_a, $dao->mailing_id_a, TRUE); //calculate total number of random recipients for mail C from group_percentage selected $totalCount = CRM_Mailing_BAO_Recipients::mailingSize($dao->mailing_id_a); diff --git a/CRM/Mailing/BAO/MailingJob.php b/CRM/Mailing/BAO/MailingJob.php index bfb63f20d1..035f88a593 100644 --- a/CRM/Mailing/BAO/MailingJob.php +++ b/CRM/Mailing/BAO/MailingJob.php @@ -71,7 +71,7 @@ class CRM_Mailing_BAO_MailingJob extends CRM_Mailing_DAO_MailingJob { $mailing = new CRM_Mailing_BAO_Mailing(); $mailing->id = $params['mailing_id']; if ($mailing->id && $mailing->find(TRUE)) { - $mailing->getRecipients($job->id, $params['mailing_id'], NULL, NULL, TRUE, $mailing->dedupe_email); + $mailing->getRecipients($job->id, $params['mailing_id'], TRUE, $mailing->dedupe_email); return $job; } else { diff --git a/CRM/Mailing/Form/Group.php b/CRM/Mailing/Form/Group.php index 9ff03260a1..e6e18ecad6 100644 --- a/CRM/Mailing/Form/Group.php +++ b/CRM/Mailing/Form/Group.php @@ -483,8 +483,6 @@ class CRM_Mailing_Form_Group extends CRM_Contact_Form_Task { CRM_Mailing_BAO_Mailing::getRecipients( $mailing->id, $mailing->id, - NULL, - NULL, TRUE, $dedupeEmail ); diff --git a/CRM/SMS/Form/Group.php b/CRM/SMS/Form/Group.php index 315e7beea0..2d546d9558 100644 --- a/CRM/SMS/Form/Group.php +++ b/CRM/SMS/Form/Group.php @@ -278,8 +278,6 @@ class CRM_SMS_Form_Group extends CRM_Contact_Form_Task { // also compute the recipients and store them in the mailing recipients table CRM_Mailing_BAO_Mailing::getRecipients($mailing->id, $mailing->id, - NULL, - NULL, TRUE, FALSE, 'sms'