From 2d7cb8b5129314a8b1f4705f6447c1bf5b424e16 Mon Sep 17 00:00:00 2001 From: bettina Date: Fri, 22 Jun 2001 02:19:54 +0000 Subject: [PATCH] added new function to format addresses in country specific style --- phpgwapi/inc/class.sbox.inc.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/phpgwapi/inc/class.sbox.inc.php b/phpgwapi/inc/class.sbox.inc.php index a7327b54de..f8dcc2e1ae 100644 --- a/phpgwapi/inc/class.sbox.inc.php +++ b/phpgwapi/inc/class.sbox.inc.php @@ -625,9 +625,9 @@ return($this->country_array[$selected]); } - function formatted_address($country = '',$id = '',$fields = '',$business = True) + function formatted_address($id = '',$fields = '',$business = True) { - global $phpgw,$phpgw_info,$d; + global $phpgw,$phpgw_info; $font = $phpgw_info['theme']['font']; @@ -656,7 +656,7 @@ $city = $address[0]['adr_one_locality']; $zip = $address[0]['adr_one_postalcode']; $state = $address[0]['adr_one_region']; - $newcountry = $address[0]['address_one_countryname']; + $country = $address[0]['adr_one_countryname']; } else { @@ -664,16 +664,16 @@ $city = $address[0]['adr_two_locality']; $zip = $address[0]['adr_two_postalcode']; $state = $address[0]['adr_two_region']; - $newcountry = $address[0]['address_two_countryname']; + $country = $address[0]['adr_two_countryname']; } $a .= '' . $street . '' . "\n"; $a .= '' . "\n"; $a .= '' . "\n"; - if ($newcountry) + if (! $country) { - $country = $newcountry; + $country = $phpgw_info['user']['preferences']['common']['country']; } if ($country == 'DE') @@ -686,7 +686,7 @@ if ($country == 'US') { - $a .= '' . $city . ', ' . $state . '&bbsp;' . $zip . '' . "\n"; + $a .= '' . $city . ', ' . $state . ' ' . $zip . '' . "\n"; } $a .= '' . "\n";