Index: openacs-4/packages/dotlrn-ecommerce/lib/user-info.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/lib/user-info.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/dotlrn-ecommerce/lib/user-info.tcl 16 Jul 2005 12:51:06 -0000 1.5 +++ openacs-4/packages/dotlrn-ecommerce/lib/user-info.tcl 23 Jul 2005 13:30:02 -0000 1.6 @@ -32,7 +32,7 @@ set authority_name [auth::authority::get_element -authority_id $user(authority_id) -element pretty_name] -set form_elms { authority_id username first_names last_name email screen_name url bio } +set form_elms { authority_id username first_names last_name email bio } foreach elm $form_elms { set elm_mode($elm) {} } @@ -112,28 +112,29 @@ } } -if { ![string equal [acs_user::ScreenName] "none"] } { - ad_form -extend -name user_info -form \ - [list \ - [list screen_name:text[ad_decode [acs_user::ScreenName] "solicit" ",optional" ""] \ - {label "[_ acs-subsite.Screen_name]"} \ - {html {size 50}} \ - {mode $elm_mode(screen_name)} \ - ]] -} +# if { ![string equal [acs_user::ScreenName] "none"] } { +# ad_form -extend -name user_info -form \ +# [list \ +# [list screen_name:text[ad_decode [acs_user::ScreenName] "solicit" ",optional" ""] \ +# {label "[_ acs-subsite.Screen_name]"} \ +# {html {size 50}} \ +# {mode $elm_mode(screen_name)} \ +# ]] +# } set tree_id [parameter::get -package_id [ad_conn package_id] -parameter GradeCategoryTree -default 0] set grade_options [list {}] foreach tree [category_tree::get_tree $tree_id] { lappend grade_options [list [lindex $tree 1] [lindex $tree 0]] } +# {url:text,optional +# {label "[_ acs-subsite.Home_page]"} +# {html {size 50}} +# {mode $elm_mode(url)} +# } + ad_form -extend -name user_info -export { section_id add_url } -form { - {url:text,optional - {label "[_ acs-subsite.Home_page]"} - {html {size 50}} - {mode $elm_mode(url)} - } {bio:text(textarea),optional {label "[_ acs-subsite.About_You]"} {html {rows 8 cols 60}} @@ -159,7 +160,7 @@ {add:text(submit) {label "[_ dotlrn-ecommerce.Proceed]"}} {cancel:text(submit) {label "[_ dotlrn-ecommerce.Cancel]"}} } -on_request { - foreach var { authority_id first_names last_name email username screen_name url bio } { + foreach var { authority_id first_names last_name email username bio } { set $var $user($var) } db_0or1row person_info { @@ -245,11 +246,11 @@ # LARS HACK: Make the URL and email elements real links if { ![form is_valid user_info] } { element set_properties user_info email -display_value "[element get_value user_info email]" - if {![string match -nocase "http://*" [element get_value user_info url]]} { - element set_properties user_info url -display_value \ - "[element get_value user_info url]" - } else { - element set_properties user_info url -display_value \ - "[element get_value user_info url]" - } +# if {![string match -nocase "http://*" [element get_value user_info url]]} { +# element set_properties user_info url -display_value \ +# "[element get_value user_info url]" +# } else { +# element set_properties user_info url -display_value \ +# "[element get_value user_info url]" +# } } Index: openacs-4/packages/dotlrn-ecommerce/lib/user-new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/lib/user-new.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/dotlrn-ecommerce/lib/user-new.tcl 16 Jul 2005 12:51:06 -0000 1.6 +++ openacs-4/packages/dotlrn-ecommerce/lib/user-new.tcl 23 Jul 2005 13:30:02 -0000 1.7 @@ -50,8 +50,11 @@ # Pre-generate user_id for double-click protection set user_id [db_nextval acs_object_id_seq] -ad_form -name register -export {next_url user_id return_url add_url addpatron_url} -form [auth::get_registration_form_elements] +set form [auth::get_registration_form_elements] +set form [lrange $form 0 3] +ad_form -name register -export {next_url user_id return_url add_url addpatron_url {password ""} {password_confirm ""} {screen_name ""} {url ""} {secret_question ""} {secret_answer ""} } -form $form + if { [exists_and_not_null rel_group_id] } { ad_form -extend -name register -form { {rel_group_id:integer(hidden),optional} @@ -80,12 +83,22 @@ lappend grade_options [list [lindex $tree 1] [lindex $tree 0]] } -ad_form -extend -name register -form { - {grade:text(select),optional - {label "[_ dotlrn-ecommerce.Grade]"} - {options {$grade_options}} +if { [llength $grade_options] > 0 } { + ad_form -extend -name register -form { + {grade:text(select) + {label "[_ dotlrn-ecommerce.Grade]"} + {options {$grade_options}} + } } - +} else { + ad_form -extend -name register -form { + {grade:text(select),optional + {label "[_ dotlrn-ecommerce.Grade]"} + {options {$grade_options}} + } + } +} +ad_form -extend -name register -form { {allergies:text,optional {label "[_ dotlrn-ecommerce.Medical_Issues]"} {html {size 60}} @@ -102,6 +115,16 @@ ad_form -extend -name register -on_request { # Populate elements from local variables + # Try to default to Adult, this may not exist + set locale [ad_conn locale] + db_0or1row default_grade { + select c.category_id as grade + from category_translations t, categories c + where t.category_id = c.category_id + and t.name = 'Adult' + and t.locale = :locale + and c.tree_id = :tree_id + } } -on_submit { db_transaction {