projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #4493 from eileenmcnaughton/CRM-15555
[civicrm-core.git]
/
CRM
/
Utils
/
Token.php
diff --git
a/CRM/Utils/Token.php
b/CRM/Utils/Token.php
index 12e21758e27056f244eb86d934f8d5b72117b5e7..dd81e288723afc3513440e0d6b94c18edf0920a2 100644
(file)
--- a/
CRM/Utils/Token.php
+++ b/
CRM/Utils/Token.php
@@
-1364,12
+1364,14
@@
class CRM_Utils_Token {
$escapeSmarty
);
}
$escapeSmarty
);
}
+
// check if there are still any unevaluated tokens
// check if there are still any unevaluated tokens
- $
greet
ingTokens = self::getTokens($tokenString);
+ $
remain
ingTokens = self::getTokens($tokenString);
- //
$greetingTokens not empty, there are hook tokens to replace
- if (!empty($
greetingTokens
) ) {
+ //
contact related $greetingTokens not empty, there are customized or hook tokens to replace
+ if (!empty($
remainingTokens['contact']
) ) {
// Fill the return properties array
// Fill the return properties array
+ $greetingTokens = $remainingTokens['contact'];
reset($greetingTokens);
$greetingsReturnProperties = array();
while(list($key) = each($greetingTokens)) {
reset($greetingTokens);
$greetingsReturnProperties = array();
while(list($key) = each($greetingTokens)) {
@@
-1720,7
+1722,12
@@
class CRM_Utils_Token {
// Group by entity
else {
$split = explode('.', trim($k, '{}'));
// Group by entity
else {
$split = explode('.', trim($k, '{}'));
- $entity = isset($split[1]) ? ucfirst($split[0]) : 'Contact';
+ if (isset($split[1])) {
+ $entity = array_key_exists($split[1], CRM_Core_DAO_Address::export()) ? 'Address' : ucfirst($split[0]);
+ }
+ else {
+ $entity = 'Contact';
+ }
$sorted[ts($entity)][] = array('id' => $k, 'text' => $v);
}
}
$sorted[ts($entity)][] = array('id' => $k, 'text' => $v);
}
}