Index: openacs-4/packages/dotlrn/www/manage-memberships.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/manage-memberships.tcl,v diff -u -r1.22.2.1 -r1.22.2.2 --- openacs-4/packages/dotlrn/www/manage-memberships.tcl 11 Sep 2015 11:40:44 -0000 1.22.2.1 +++ openacs-4/packages/dotlrn/www/manage-memberships.tcl 8 Nov 2016 13:56:02 -0000 1.22.2.2 @@ -84,23 +84,25 @@ }] set terms [linsert $terms 0 [list [_ dotlrn.All] -1]] -form create member_form +form create member_form \ + -has_submit 1 element create member_form member_department_key \ -label "[_ dotlrn.Department]" \ -datatype text \ -widget select \ -options $departments \ - -html {onChange document.member_form.submit()} \ + -html {class auto-member-form-submit} \ -value $member_department_key element create member_form member_term_id \ -label "[_ dotlrn.Term]" \ -datatype integer \ -widget select \ -options $terms \ - -html {onChange document.member_form.submit()} \ + -html {class auto-member-form-submit} \ -value $member_term_id +template::add_event_listener -CSSclass auto-member-form-submit -event change -script {document.member_form.submit();} element create member_form non_member_department_key \ -label "[_ dotlrn.Department]" \ @@ -114,6 +116,8 @@ -widget hidden \ -value $non_member_term_id + + if {[form is_valid member_form]} { form get_values member_form \ member_department_key member_term_id \ @@ -132,7 +136,12 @@ set n_member_classes [db_string select_n_member_classes {}] -template::list::create -name member_classes -multirow member_classes -pass_properties { show_drop_button_p referer } -html {width 100%} -elements { +template::list::create \ + -name member_classes \ + -multirow member_classes \ + -pass_properties { show_drop_button_p referer } \ + -html {width 100%} \ + -elements { name { html {align left style "width:55%"} label "[_ dotlrn.class_instances_pretty_name]" @@ -209,23 +218,25 @@ set role [dotlrn_community::get_role_pretty_name -community_id $club_id -rel_type $rel_type] } -form create non_member_form +form create non_member_form \ + -has_submit 1 element create non_member_form non_member_department_key \ -label "[_ dotlrn.Department]" \ -datatype text \ -widget select \ -options $departments \ - -html {onChange document.non_member_form.submit()} \ + -html {class auto-non_member-form-submit} \ -value $non_member_department_key element create non_member_form non_member_term_id \ -label "[_ dotlrn.Term]" \ -datatype integer \ -widget select \ -options $terms \ - -html {onChange document.non_member_form.submit()} \ + -html {class auto-non_member-form-submit} \ -value $non_member_term_id +template::add_event_listener -CSSclass auto-non_member-form-submit -event change -script {document.non_member_form.submit();} element create non_member_form member_department_key \ -label "[_ dotlrn.Department]" \ Index: openacs-4/packages/dotlrn/www/admin/class.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/class.tcl,v diff -u -r1.21.4.2 -r1.21.4.3 --- openacs-4/packages/dotlrn/www/admin/class.tcl 18 Sep 2015 08:05:10 -0000 1.21.4.2 +++ openacs-4/packages/dotlrn/www/admin/class.tcl 8 Nov 2016 13:56:02 -0000 1.21.4.3 @@ -47,14 +47,15 @@ set terms [db_list_of_lists select_terms_for_select_widget {}] set terms [linsert $terms 0 {All -1}] -form create term_form +form create term_form \ + -has_submit 1 element create term_form term_id \ -label [_ dotlrn.Term] \ -datatype integer \ -widget select \ -options $terms \ - -html {onChange document.term_form.submit()} \ + -html {class auto-term-form-submit} \ -value $term_id element create term_form class_key \ @@ -63,6 +64,8 @@ -widget hidden \ -value $class_key +template::add_event_listener -CSSclass auto-term-form-submit -event change -script {document.term_form.submit();} + if {[form is_valid term_form]} { form get_values term_form term_id class_key } Index: openacs-4/packages/dotlrn/www/admin/classes-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/classes-chunk.tcl,v diff -u -r1.13.4.2 -r1.13.4.3 --- openacs-4/packages/dotlrn/www/admin/classes-chunk.tcl 29 Jul 2016 13:16:01 -0000 1.13.4.2 +++ openacs-4/packages/dotlrn/www/admin/classes-chunk.tcl 8 Nov 2016 13:56:02 -0000 1.13.4.3 @@ -27,7 +27,7 @@ } -if {(![info exists department_key] || $department_key eq "")} { +if {![info exists department_key] || $department_key eq ""} { set department_key "" } @@ -47,17 +47,21 @@ -datatype text \ -widget select \ -options $departments \ - -html {onChange document.department_form.submit()} \ + -html {id department_form-department_key} \ -value $department_key +template::add_event_listener -id "department_form-department_key" -event change -script {document.department_form.submit();} + if {[form is_valid department_form]} { form get_values department_form department_key } -if {(![info exists referer] || $referer eq "")} { +if {![info exists referer] || $referer eq ""} { set referer "classes" } + + set query select_classes set page_query select_classes_paginator if {$department_key ne ""} { Index: openacs-4/packages/dotlrn/www/admin/term.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/term.tcl,v diff -u -r1.19.2.3 -r1.19.2.4 --- openacs-4/packages/dotlrn/www/admin/term.tcl 29 Jul 2016 13:16:01 -0000 1.19.2.3 +++ openacs-4/packages/dotlrn/www/admin/term.tcl 8 Nov 2016 13:56:02 -0000 1.19.2.4 @@ -26,6 +26,7 @@ {orderby "department_name,asc"} page:naturalnum,optional {keyword ""} + {referer "terms"} } -properties { classes:multirow } @@ -49,7 +50,7 @@ -datatype text \ -widget select \ -options $departments \ - -html {onChange document.department_form.submit()} \ + -html {id department_form-department_key} \ -value $department_key element create department_form term_id \ @@ -78,7 +79,7 @@ -datatype integer \ -widget select \ -options $terms \ - -html {onChange document.term_form.submit()} \ + -html {id term_form-term_id} \ -value $term_id element create term_form department_key \ @@ -92,12 +93,12 @@ if {$term_id != -1} { ad_returnredirect [export_vars -base term {term_id department_key}] + ad_script_abort } } -if {(![info exists referer] || $referer eq "")} { - set referer "terms" -} +template::add_event_listener -id "term_form-term_id" -event change -script {document.term_form.submit();} +template::add_event_listener -id "department_form-department_key" -event change -script {document.department_form.submit();} set query "select_classes" set paginator_query "select_classes_paginator"