From: Donald A. Lobo Date: Mon, 8 Apr 2013 23:49:13 +0000 (-0700) Subject: formatting and cleanup X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=21bb6c7be66478689976857a8d24fd8ee692ec1d;p=civicrm-core.git formatting and cleanup --- diff --git a/CRM/Mailing/BAO/Mailing.php b/CRM/Mailing/BAO/Mailing.php index 84ff78f343..b3b406ea3c 100644 --- a/CRM/Mailing/BAO/Mailing.php +++ b/CRM/Mailing/BAO/Mailing.php @@ -1086,12 +1086,14 @@ ORDER BY civicrm_email.is_bulkmail DESC $this->_domain = CRM_Core_BAO_Domain::getDomain(); } - list($verp, $urls, $headers) = $this->getVerpAndUrlsAndHeaders($job_id, + list($verp, $urls, $headers) = $this->getVerpAndUrlsAndHeaders( + $job_id, $event_queue_id, $hash, $email, $isForward ); + //set from email who is forwarding it and not original one. if ($fromEmail) { unset($headers['From']); diff --git a/CRM/Utils/Token.php b/CRM/Utils/Token.php index 9de20c9380..c5349cc071 100644 --- a/CRM/Utils/Token.php +++ b/CRM/Utils/Token.php @@ -219,15 +219,26 @@ class CRM_Utils_Token { * @access public * @static */ - public static function &replaceDomainTokens($str, &$domain, $html = FALSE, $knownTokens = NULL, $escapeSmarty = FALSE) { + public static function &replaceDomainTokens( + $str, + &$domain, + $html = FALSE, + $knownTokens = NULL, + $escapeSmarty = FALSE + ) { $key = 'domain'; - if (!$knownTokens || + if ( + !$knownTokens || !CRM_Utils_Array::value($key, $knownTokens) ) { return $str; } - $str = preg_replace(self::tokenRegex($key), 'self::getDomainTokenReplacement(\'\\1\',$domain,$html)', $str); + $str = preg_replace( + self::tokenRegex($key), + 'self::getDomainTokenReplacement(\'\\1\',$domain,$html)', + $str + ); return $str; } @@ -297,9 +308,11 @@ class CRM_Utils_Token { * @static */ public static function &replaceOrgTokens($str, &$org, $html = FALSE, $escapeSmarty = FALSE) { - self::$_tokens['org'] = array_merge(array_keys(CRM_Contact_BAO_Contact::importableFields('Organization')), - array('address', 'display_name', 'checksum', 'contact_id') - ); + self::$_tokens['org'] = + array_merge( + array_keys(CRM_Contact_BAO_Contact::importableFields('Organization')), + array('address', 'display_name', 'checksum', 'contact_id') + ); $cv = NULL; foreach (self::$_tokens['org'] as $token) { @@ -372,7 +385,13 @@ class CRM_Utils_Token { * @access public * @static */ - public static function &replaceMailingTokens($str, &$mailing, $html = FALSE, $knownTokens = NULL, $escapeSmarty = FALSE) { + public static function &replaceMailingTokens( + $str, + &$mailing, + $html = FALSE, + $knownTokens = NULL, + $escapeSmarty = FALSE + ) { $key = 'mailing'; if (!$knownTokens || !isset($knownTokens[$key])) { return $str; @@ -505,7 +524,13 @@ class CRM_Utils_Token { return $str; } - public static function getActionTokenReplacement($token, &$addresses, &$urls, $html = FALSE, $escapeSmarty = FALSE) { + public static function getActionTokenReplacement( + $token, + &$addresses, + &$urls, + $html = FALSE, + $escapeSmarty = FALSE + ) { /* If the token is an email action, use it. Otherwise, find the * appropriate URL */ @@ -550,16 +575,23 @@ class CRM_Utils_Token { * @access public * @static */ - public static function &replaceContactTokens($str, &$contact, $html = FALSE, $knownTokens = NULL, - $returnBlankToken = FALSE, $escapeSmarty = FALSE + public static function &replaceContactTokens( + $str, + &$contact, + $html = FALSE, + $knownTokens = NULL, + $returnBlankToken = FALSE, + $escapeSmarty = FALSE ) { $key = 'contact'; if (self::$_tokens[$key] == NULL) { /* This should come from UF */ - self::$_tokens[$key] = array_merge(array_keys(CRM_Contact_BAO_Contact::exportableFields('All')), - array('checksum', 'contact_id') - ); + self::$_tokens[$key] = + array_merge( + array_keys(CRM_Contact_BAO_Contact::exportableFields('All')), + array('checksum', 'contact_id') + ); } // here we intersect with the list of pre-configured valid tokens @@ -570,7 +602,8 @@ class CRM_Utils_Token { return $str; } - $str = preg_replace(self::tokenRegex($key), + $str = preg_replace( + self::tokenRegex($key), 'self::getContactTokenReplacement(\'\\1\', $contact, $html, $returnBlankToken, $escapeSmarty)', $str ); @@ -579,15 +612,21 @@ class CRM_Utils_Token { return $str; } - public static function getContactTokenReplacement($token, &$contact, $html = FALSE, - $returnBlankToken = FALSE, $escapeSmarty = FALSE + public static function getContactTokenReplacement( + $token, + &$contact, + $html = FALSE, + $returnBlankToken = FALSE, + $escapeSmarty = FALSE ) { if (self::$_tokens['contact'] == NULL) { /* This should come from UF */ - self::$_tokens['contact'] = array_merge(array_keys(CRM_Contact_BAO_Contact::exportableFields('All')), - array('checksum', 'contact_id') - ); + self::$_tokens['contact'] = + array_merge( + array_keys(CRM_Contact_BAO_Contact::exportableFields('All')), + array('checksum', 'contact_id') + ); } /* Construct value from $token and $contact */ @@ -643,10 +682,16 @@ class CRM_Utils_Token { * @access public * @static */ - public static function &replaceHookTokens($str, &$contact, &$categories, $html = FALSE, $escapeSmarty = FALSE) { - + public static function &replaceHookTokens( + $str, + &$contact, + &$categories, + $html = FALSE, + $escapeSmarty = FALSE + ) { foreach ($categories as $key) { - $str = preg_replace(self::tokenRegex($key), + $str = preg_replace( + self::tokenRegex($key), 'self::getHookTokenReplacement(\'\\1\', $contact, $key, $html, $escapeSmarty)', $str ); @@ -654,12 +699,16 @@ class CRM_Utils_Token { return $str; } - public static function getHookTokenReplacement($token, &$contact, $category, $html = FALSE, $escapeSmarty = FALSE) { + public static function getHookTokenReplacement( + $token, + &$contact, + $category, + $html = FALSE, + $escapeSmarty = FALSE + ) { $value = CRM_Utils_Array::value("{$category}.{$token}", $contact); - if ($value && - !$html - ) { + if ($value && !$html) { $value = str_replace('&', '&', $value); }