From dd66ebd3f65bda41588e88bba070646391827093 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Sep 2012 17:39:02 +0200 Subject: [PATCH] New: Use GB address format --- htdocs/core/lib/functions.lib.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 91c4ea4b088..160970b3aae 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -723,12 +723,12 @@ function dol_get_fiche_end($notab=0) function dol_format_address($object) { $ret=''; - $countriesusingstate=array('US','IN'); + $countriesusingstate=array('US','IN','GB'); // Address $ret .= $object->address; // Zip/Town/State - if (in_array($object->country_code,array('US'))) // US: town, state, zip + if (in_array($object->country_code,array('US'))) // US: title firstname name \n address lines \n town, state, zip \n country { $ret .= ($ret ? "\n" : '' ).$object->town; if ($object->state && in_array($object->country_code,$countriesusingstate)) @@ -737,7 +737,16 @@ function dol_format_address($object) } if ($object->zip) $ret .= ', '.$object->zip; } - else // Other: zip town, state + else if (in_array($object->country_code,array('GB'))) // UK: title firstname name \n address lines \n town state \n zip \n country + { + $ret .= ($ret ? "\n" : '' ).$object->town; + if ($object->state && in_array($object->country_code,$countriesusingstate)) + { + $ret.=", ".$object->departement; + } + if ($object->zip) $ret .= ($ret ? "\n" : '' ).$object->zip; + } + else // Other: title firstname name \n address lines \n zip town \n country { $ret .= ($ret ? "\n" : '' ).$object->zip; $ret .= ' '.$object->town;