From 6c624a9a45f30ff46674dc35fbf633223998f125 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 5 May 2022 12:26:15 +0200 Subject: [PATCH] Fix name of sql file --- htdocs/core/lib/functions.lib.php | 9 +++++---- .../tables/{llx_website.sql => llx_website-website.sql} | 0 2 files changed, 5 insertions(+), 4 deletions(-) rename htdocs/install/mysql/tables/{llx_website.sql => llx_website-website.sql} (100%) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 28ec44e5f83..036ed896a04 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2223,7 +2223,7 @@ function dol_format_address($object, $withcountry = 0, $sep = "\n", $outputlangs $ret = ''; $countriesusingstate = array('AU', 'CA', 'US', 'IN', 'GB', 'ES', 'UK', 'TR', 'CN'); // See also MAIN_FORCE_STATE_INTO_ADDRESS - + $sep = "\n"; // See format of addresses on https://en.wikipedia.org/wiki/Address // Address if (empty($mode)) { @@ -2233,12 +2233,13 @@ function dol_format_address($object, $withcountry = 0, $sep = "\n", $outputlangs if (isset($object->country_code) && in_array($object->country_code, array('AU', 'CA', 'US', 'CN')) || !empty($conf->global->MAIN_FORCE_STATE_INTO_ADDRESS)) { // US: title firstname name \n address lines \n town, state, zip \n country $town = ($extralangcode ? $object->array_languages['town'][$extralangcode] : (empty($object->town) ? '' : $object->town)); - $ret .= ($ret ? $sep : '').$town; + $ret .= (($ret && $town) ? $sep : '').$town; + if (!empty($object->state)) { - $ret .= ($ret ? ", " : '').$object->state; + $ret .= ($ret ? ($town ? ", " : $sep) : '').$object->state; } if (!empty($object->zip)) { - $ret .= ($ret ? ", " : '').$object->zip; + $ret .= ($ret ? (($town || $object->state) ? ", " : $sep) : '').$object->zip; } } elseif (isset($object->country_code) && in_array($object->country_code, array('GB', 'UK'))) { // UK: title firstname name \n address lines \n town state \n zip \n country diff --git a/htdocs/install/mysql/tables/llx_website.sql b/htdocs/install/mysql/tables/llx_website-website.sql similarity index 100% rename from htdocs/install/mysql/tables/llx_website.sql rename to htdocs/install/mysql/tables/llx_website-website.sql