Index: openacs-4/packages/ecommerce/www/address-international.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/address-international.tcl,v
diff -u -r1.6.4.1 -r1.6.4.2
--- openacs-4/packages/ecommerce/www/address-international.tcl 14 Nov 2004 13:08:40 -0000 1.6.4.1
+++ openacs-4/packages/ecommerce/www/address-international.tcl 23 Dec 2004 13:18:23 -0000 1.6.4.2
@@ -42,12 +42,40 @@
} else {
set country_widget [ec_country_widget]
- set attn [ad_quotehtml [db_string get_full_name "
- select first_names || ' ' || last_name as name
- from cc_users
- where user_id=:user_id"]]
+ # Retrieve the default name.
+
+ # get the separate fields for card processing
+ db_0or1row get_names "
+ select first_names, last_name
+ from cc_users
+ where user_id=:user_id"
+ # we could use a single name field for shipping
+ # but shipping address becomes default for billing!
+ # attn has a 3 space delimiter for parsing last/first names
+
+ # set attn just in case it gets used
+ # avoid using it for single field name entry.
+ set attn "$first_names $last_name"
+
}
+# set the defaults for name fields if they are empty
+if {[info exists last_name] != 1} {
+ if {[info exists attn]} {
+ # delimiter is triple space (for parsing).
+ set name_delim [string first " " $attn]
+ if {$name_delim < 0 } {
+ set name_delim 0
+ }
+ set first_names [string trim [string range $attn 0 $name_delim]]
+ set last_name [string range $attn [expr $name_delim + 3 ] end]
+ }
+}
+set user_last_name_with_quotes_escaped [ad_quotehtml $last_name]
+set user_first_names_with_quotes_escaped [ad_quotehtml $first_names]
+
+set user_name_with_quotes_escaped [ad_quotehtml $attn]
+
# Get the form vars that were passed on delete-address so that they
# can be passed back to the calling url. gift-certificate-billing has
# a bunch of form vars that should not be lost.
Index: openacs-4/packages/ecommerce/www/address.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/address.tcl,v
diff -u -r1.8.2.2 -r1.8.2.3
--- openacs-4/packages/ecommerce/www/address.tcl 23 Dec 2004 11:48:48 -0000 1.8.2.2
+++ openacs-4/packages/ecommerce/www/address.tcl 23 Dec 2004 13:18:23 -0000 1.8.2.3
@@ -72,12 +72,8 @@
# set attn just in case it gets used
# avoid using it for single field name entry.
+ set attn "$first_names $last_name"
- set attn [db_string get_full_name "
- select first_names || ' ' || last_name as name
- from cc_users
- where user_id=:user_id"]
-
}
if { ![info exists state_widget] } {
set state_widget [state_widget]
Index: openacs-4/packages/ecommerce/www/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/index.tcl,v
diff -u -r1.6.2.1 -r1.6.2.2
--- openacs-4/packages/ecommerce/www/index.tcl 23 Dec 2004 06:39:05 -0000 1.6.2.1
+++ openacs-4/packages/ecommerce/www/index.tcl 23 Dec 2004 13:18:23 -0000 1.6.2.2
@@ -50,7 +50,7 @@
# the base url allows us to switch connections to http from https if currently an https connection
# for saving computing SSL resources only when necessary
-set baseurl "[ec_insecurelink [ad_conn url]]"
+set base_url "[ec_insecurelink [ad_conn url]]"
set recommendations_if_there_are_any "