diff --git a/phpgwapi/inc/class.sbox.inc.php b/phpgwapi/inc/class.sbox.inc.php index e1a5ae8654..a7327b54de 100644 --- a/phpgwapi/inc/class.sbox.inc.php +++ b/phpgwapi/inc/class.sbox.inc.php @@ -624,4 +624,78 @@ { return($this->country_array[$selected]); } + + function formatted_address($country = '',$id = '',$fields = '',$business = True) + { + global $phpgw,$phpgw_info,$d; + + $font = $phpgw_info['theme']['font']; + + $d = CreateObject('phpgwapi.contacts'); + + $address = $d->read_single_entry($id,$fields); + + $a = '
' . $address[0]['n_given'] . ' ' . $address[0]['n_family'] . ' | ' . "\n"; + $a .= '|
' . $address[0]['org_name'] . ' | ' . "\n"; + $a .= '|
' . $address[0]['org_unit'] . ' | ' . "\n"; + $a .= '|
' . $street . ' | ' . "\n"; + $a .= '|
' . $city . ' | ' . "\n"; + $a .= '|
' . $zip . ' | ' . "\n"; + } + + if ($country == 'US') + { + $a .= '' . $city . ', ' . $state . '&bbsp;' . $zip . ' | ' . "\n"; + } + + $a .= '
' . lang($country) . ' | ' . "\n"; + $a .= '