Index: openacs-4/packages/contacts/tcl/attribute-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/tcl/attribute-procs.tcl,v diff -u -N -r1.11 -r1.12 --- openacs-4/packages/contacts/tcl/attribute-procs.tcl 26 Dec 2005 20:33:46 -0000 1.11 +++ openacs-4/packages/contacts/tcl/attribute-procs.tcl 1 Apr 2006 07:07:16 -0000 1.12 @@ -1,6 +1,6 @@ ad_library { - Support procs for attributes in the contacts package + Support procs for attributes in the contacts package @author Matthew Geddert openacs@geddert.com @creation-date 2004-07-28 @@ -144,67 +144,12 @@ } else { set mailing_address_list [ams::widget \ -widget postal_address \ - -request "value_list" \ + -request "value_list_text" \ -value $value \ ] - # This sets the address, muncipality,region, postal_code, country_code - template::util::list_of_lists_to_array $mailing_address_list row - - # Now define the locale. This should not be set (usually), as you should always rely on the - # locale of the session, (as the country name should be in the language of the user), - # but who knows. - if {$locale eq ""} { - if { [ad_conn isconnected] } { - # We are in an HTTP connection (request) so use that locale - set locale [ad_conn locale] - } else { - # There is no HTTP connection - resort to system locale - set locale [lang::system::locale] - } - } - - # Set the country right. - set key "ams.country_$row(country_code)" - - if { [string is true [lang::message::message_exists_p $locale $key]] } { - set country [lang::message::lookup $locale $key] - } else { - # cache the country codes - template::util::address::country_options_not_cached -locale $locale - - if { [string is true [lang::message::message_exists_p $locale $key]] } { - set country [lang::message::lookup $locale $key] - } else { - # we get the default en_US key which was created with the - # template::util::address::country_options_not_cached proc - set country [lang::message::lookup "en_US" $key] - } - } - set row(country) $country - - # Set the townline - # Different formats depending on the country - switch $row(country_code) { - "US" { - set row(town_line) "$row(municipality), $row(region) $row(postal_code)" - } - "DE" { - set row(town_line) "$row(postal_code) $row(municipality)" - } - "UK" { - set row(town_line) "$row(municipality), $row(region) $row(postal_code)" - } - "CH" { - set row(town_line) "$row(postal_code) $row(municipality)" - } - default { - if { [parameter::get_from_package_key -package_key "ams" -parameter "DefaultAdressLayoutP" -default 1] } { - set row(town_line) "$row(municipality) $row(region) $row(postal_code)" - } else { - set row(town_line) "$row(postal_code) $row(municipality) $row(region)" - } - } - } + # This sets the address, muncipality, region, postal_code, country_code, country + array set row $mailing_address_list + set row(town_line) [template::util::address::town_line -municipality $row(municipality) -region $row(region) -postal_code $row(postal_code) -country_code $row(country_code)] return 1 } }