+--------------------------------------------------------------------+
| CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2016 |
+ | Copyright CiviCRM LLC (c) 2004-2017 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2016
+ * @copyright CiviCRM LLC (c) 2004-2017
*/
/**
$value = CRM_Core_PseudoConstant::getLabel('CRM_Contact_BAO_Contact', $token, $value);
}
}
+ elseif ($value && CRM_Utils_String::endsWith($token, '_date')) {
+ $value = CRM_Utils_Date::customFormat($value);
+ }
}
if (!$html) {
* @return array
* contactDetails with hooks swapped out
*/
- public function getAnonymousTokenDetails($contactIDs = array(
+ public static function getAnonymousTokenDetails($contactIDs = array(
0,
),
$returnProperties = NULL,
*/
public static function getMembershipTokenDetails($membershipIDs) {
$memberships = civicrm_api3('membership', 'get', array(
- 'options' => array('limit' => 200000),
- 'membership_id' => array('IN' => (array) $membershipIDs),
- ));
+ 'options' => array('limit' => 0),
+ 'membership_id' => array('IN' => (array) $membershipIDs),
+ ));
return $memberships['values'];
}
/**
* Replace existing greeting tokens in message/subject.
*
+ * This function operates by reference, modifying the first parameter. Other
+ * methods for token replacement in this class return the modified string.
+ * This leads to inconsistency in how these methods must be applied.
+ *
+ * @TODO Remove that inconsistency in usage.
+ *
+ * ::replaceContactTokens() may need to be called after this method, to
+ * replace tokens supplied from this method.
+ *
* @param string $tokenString
* @param array $contactDetails
* @param int $contactId
default:
if (in_array($token, self::$_tokens[$entity])) {
$value = $membership[$token];
+ if (CRM_Utils_String::endsWith($token, '_date')) {
+ $value = CRM_Utils_Date::customFormat($value);
+ }
}
else {
// ie unchanged