X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FUtils%2FToken.php;h=e3bdcc102b9b02525450be95701a771271490733;hb=f1195cae6d39dfe0dfa53a424add819afa0dca52;hp=c2cbd5fbfc8eb6c499f3ccbfe73d9a41cd5e5c88;hpb=00e18848bae4a42a67f0bf07002760ab35f9dd40;p=civicrm-core.git diff --git a/CRM/Utils/Token.php b/CRM/Utils/Token.php index c2cbd5fbfc..e3bdcc102b 100644 --- a/CRM/Utils/Token.php +++ b/CRM/Utils/Token.php @@ -1,7 +1,7 @@ $contactID) { + foreach ($contactIDs as $contactID) { $params[] = array( CRM_Core_Form::CB_PREFIX . $contactID, '=', @@ -1215,7 +1215,7 @@ class CRM_Utils_Token { $fields = array_merge(array_keys(CRM_Contact_BAO_Contact::exportableFields()), array('display_name', 'checksum', 'contact_id') ); - foreach ($fields as $key => $val) { + foreach ($fields as $val) { // The unavailable fields are not available as tokens, do not have a one-2-one relationship // with contacts and are expensive to resolve. // @todo see CRM-17253 - there are some other fields (e.g note) that should be excluded @@ -1239,12 +1239,12 @@ class CRM_Utils_Token { $contactDetails = &$details[0]; - foreach ($contactIDs as $key => $contactID) { + foreach ($contactIDs as $contactID) { if (array_key_exists($contactID, $contactDetails)) { if (!empty($contactDetails[$contactID]['preferred_communication_method']) ) { $communicationPreferences = array(); - foreach ($contactDetails[$contactID]['preferred_communication_method'] as $key => $val) { + foreach ($contactDetails[$contactID]['preferred_communication_method'] as $val) { if ($val) { $communicationPreferences[$val] = CRM_Core_PseudoConstant::getLabel('CRM_Contact_DAO_Contact', 'preferred_communication_method', $val); } @@ -1404,8 +1404,8 @@ class CRM_Utils_Token { $greetingTokens = $remainingTokens; reset($greetingTokens); $greetingsReturnProperties = array(); - while (list($key) = each($greetingTokens)) { - $props = array_flip(CRM_Utils_Array::value($key, $greetingTokens)); + foreach ($greetingTokens as $value) { + $props = array_flip($value); $props = array_fill_keys(array_keys($props), 1); $greetingsReturnProperties = $greetingsReturnProperties + $props; } @@ -1762,6 +1762,7 @@ class CRM_Utils_Token { 'id' => $membership['membership_type_id'], 'return' => 'minimum_fee', )); + $value = CRM_Utils_Money::format($value, NULL, NULL, TRUE); } catch (CiviCRM_API3_Exception $e) { // we can anticipate we will get an error if the minimum fee is set to 'NULL' because of the way the