* The desired address format.
* @param bool $microformat
* If true indicates, the address to be built in hcard-microformat standard.
- * @param bool $mailing
+ * @param bool $unused
* Should ALWAYS be false.
* @param string[] $tokenFields
*
$fields,
$format = NULL,
$microformat = FALSE,
- $mailing = FALSE,
+ $unused = FALSE,
$tokenFields = NULL
) {
- $mailing = FALSE;
if (!$format) {
$format = Civi::settings()->get('address_format');
}
-
- if ($mailing) {
- $format = Civi::settings()->get('mailing_format');
- }
-
$formatted = $format;
$fullPostalCode = $fields['postal_code'] ?? NULL;
}
}
- //CRM-16876 Display countries in all caps when in mailing mode.
- if ($mailing && !empty($fields['country'])) {
- if (Civi::settings()->get('hideCountryMailingLabels')) {
- $domain = CRM_Core_BAO_Domain::getDomain();
- $domainLocation = CRM_Core_BAO_Location::getValues(['contact_id' => $domain->contact_id]);
- $domainAddress = $domainLocation['address'][1];
- $domainCountryId = $domainAddress['country_id'];
- if ($fields['country'] == CRM_Core_PseudoConstant::country($domainCountryId)) {
- $fields['country'] = NULL;
- }
- else {
- //Capitalization display on uppercase to contries with special characters
- $fields['country'] = mb_convert_case($fields['country'], MB_CASE_UPPER, "UTF-8");
- }
- }
- else {
- $fields['country'] = mb_convert_case($fields['country'], MB_CASE_UPPER, "UTF-8");
- }
- }
-
if (!$microformat) {
// replacements in case of Individual Name Format
$replacements = [