Index: openacs-4/packages/bug-tracker/www/prefs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/prefs.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/bug-tracker/www/prefs.tcl 13 Jan 2003 18:32:42 -0000 1.7 +++ openacs-4/packages/bug-tracker/www/prefs.tcl 5 Mar 2003 17:41:04 -0000 1.8 @@ -25,38 +25,22 @@ set user_id [ad_conn user_id] - - -form create bt_user_prefs -cancel_url $return_url - -element create bt_user_prefs user_version \ - -label "Your version" \ - -widget select \ - -datatype integer \ - -options [concat { { "None" "" } } \ - [db_list_of_lists versions { select version_name, version_id from bt_versions where project_id = :package_id order by anticipated_freeze_date, version_name }]] \ - -optional - -element create bt_user_prefs return_url \ - -datatype text \ - -widget hidden \ - -value $return_url - -if { [form is_request bt_user_prefs] } { - db_1row get_current_values { - select user_version - from bt_user_prefs - where user_id = :user_id - and project_id = :package_id +ad_form -name prefs -cancel_url $return_url -form { + {user_version:integer(select) + {label "Your version"} + {options {[bug_tracker::version_get_options -include_unknown]}} + optional } - element set_properties bt_user_prefs user_version -value $user_version -} - -if { [form is_valid bt_user_prefs] } { - # valid form submission - - set user_version [element get_value bt_user_prefs user_version] - + {return_url:text(hidden) + {value $return_url} + } +} -select_query { + select user_version + from prefs + where user_id = :user_id + and project_id = :package_id +} -after_submit { + set user_version [element get_value prefs user_version] db_dml update_row { update bt_user_prefs set user_version = :user_version