From 8f6cf9838cbfcdab6081f4ebc84e4f4e272b0f9a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 30 Apr 2011 01:55:22 +0000 Subject: [PATCH] Enhance function getFullAddress --- htdocs/societe/class/societe.class.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 516981889a4..69a9f9a493b 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1398,14 +1398,17 @@ class Societe extends CommonObject /** * Return full address of a third party (TODO in format of its country) - * @return string Full address string + * @param withcountry Add country + * @param nobr Do not use br + * @return string Full address string */ - function getFullAddress() + function getFullAddress($withcountry=0,$nobr=0) { $ret=''; - $ret.=($this->address?$this->address."\n":''); + $ret.=($this->address?$this->address.($nobr?" ":"\n"):''); $ret.=trim($this->zip.' '.$this->town); - return $ret; + if ($withcountry) $ret.=' '.$this->pays; + return trim($ret); }