X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FUtils%2FToken.php;h=d879d6f697bb4aebaae1243eda95cae331773538;hb=0e4e45435dc33f16b49a4093ac25158728251213;hp=c2cbd5fbfc8eb6c499f3ccbfe73d9a41cd5e5c88;hpb=b94eea5170f9b25e817067941198129b5de3224c;p=civicrm-core.git diff --git a/CRM/Utils/Token.php b/CRM/Utils/Token.php index c2cbd5fbfc..d879d6f697 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; }