<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.7 |
+ | CiviCRM version 5 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2018 |
+--------------------------------------------------------------------+
* Gives required details of contacts in an indexed array format so we
* can iterate in a nice loop and do token evaluation
*
- * @param $contactIDs
+ * @param array $contactIDs
* @param array $returnProperties
* Of required properties.
* @param bool $skipOnHold Don't return on_hold contact info also.
) {
$params = array();
- foreach ($contactIDs as $key => $contactID) {
+ foreach ($contactIDs as $contactID) {
$params[] = array(
CRM_Core_Form::CB_PREFIX . $contactID,
'=',
$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
$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);
}
$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;
}
'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