Index: openacs-4/packages/bug-tracker/www/patch-list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/patch-list.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/bug-tracker/www/patch-list.tcl 20 Sep 2002 15:22:53 -0000 1.2 +++ openacs-4/packages/bug-tracker/www/patch-list.tcl 16 Jan 2003 13:43:58 -0000 1.3 @@ -8,6 +8,7 @@ } { {component_id:integer ""} {version_id:integer ""} + {status:trim ""} } set package_id [ad_conn package_id] @@ -21,7 +22,7 @@ multirow create components url label selected_p -multirow append components "patch-list?[export_vars { version_id }]" "All Components" [empty_string_p $component_id] +multirow append components "patch-list?[export_vars { version_id status }]" "All Components" [empty_string_p $component_id] multirow extend components loop_component_id @@ -33,7 +34,7 @@ where p.component_id = c.component_id) } { set selected_p [string equal $component_id $loop_component_id] - set url "patch-list?[export_vars { version_id { component_id $loop_component_id} }]" + set url "patch-list?[export_vars { version_id status { component_id $loop_component_id} }]" } if { ![empty_string_p $component_id] } { @@ -48,7 +49,7 @@ if { [empty_string_p $version_id] } { lappend version_filter_list "All Versions" } else { - lappend version_filter_list "All Versions" + lappend version_filter_list "All Versions" } db_foreach versions_for_patches { select version_id as loop_version_id, @@ -61,21 +62,47 @@ if { $version_id == $loop_version_id } { lappend version_filter_list "$version_name" } else { - lappend version_filter_list "$version_name" + lappend version_filter_list "$version_name" } } set version_filter [join $version_filter_list " | "] + + +foreach statusi {{} open accepted refused} { + if {[string equal $status $statusi]} { + if {[empty_string_p $status]} { + lappend status_list "All States" + } else { + lappend status_list "$status" + } + } else { + if {[empty_string_p $statusi]} { + lappend status_list "All states" + } { + lappend status_list "$statusi" + } + } +} +set state_filter [join $status_list " | "] + if { ![empty_string_p $version_id] } { set version_where_clause " and bt_patches.apply_to_version = :version_id" } else { set version_where_clause "" } +if {![empty_string_p $status] } { + set status_where_clause " and bt_patches.status = :status" +} else { + set status_where_clause "" +} # Create the pagination filter set where_clause "bt_patches.project_id = :package_id $component_where_clause - $version_where_clause" + $version_where_clause + $status_where_clause" + set patch_count [db_string patch_count "select count(*) from bt_patches where $where_clause"]