Index: openacs-4/contrib/packages/project-manager/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/index.tcl,v diff -u -r1.9.2.2 -r1.9.2.3 --- openacs-4/contrib/packages/project-manager/www/index.tcl 5 Dec 2003 01:09:19 -0000 1.9.2.2 +++ openacs-4/contrib/packages/project-manager/www/index.tcl 13 Dec 2003 01:19:54 -0000 1.9.2.3 @@ -17,7 +17,8 @@ } { orderby_project:optional status_id:optional - category_id:optional + category_id:multiple,optional + {subprojects_p "f"} } -properties { context:onevalue @@ -59,11 +60,49 @@ # Projects, using list-builder --------------------------------- +# Categories are arranges into category trees. +# Set up an array for each tree. The array contains the category for each tree -set category_choices [db_list_of_lists gg "select t.name, t.category_id from category_tree_map tm, categories c, category_translations t where c.tree_id = tm.tree_id and c.category_id = t.category_id and tm.object_id = :package_id"] +db_foreach get_choices "select t.name as cat_name, t.category_id as cat_id, tm.tree_id from category_tree_map tm, categories c, category_translations t where c.tree_id = tm.tree_id and c.category_id = t.category_id and tm.object_id = :package_id order by t.name" { + lappend category_choices($tree_id) [list $cat_name $cat_id] +} +# We want to set up a filter for each category tree. +set export_vars [export_vars -form {status_id subprojects_p orderby}] +set category_select "" + +foreach tree_list [db_list_of_lists get_category_trees "select tt.name as tree_name, tt.tree_id from category_tree_map tm, category_tree_translations tt where tm.object_id = :package_id and tm.tree_id = tt.tree_id"] { + + set tree_name [lindex $tree_list 0] + set tree_id [lindex $tree_list 1] + + if {![exists_and_not_null category_choices($tree_id)]} { + set category_choices($tree_id) [list] + } + + + + append category_select "
$export_vars $tree_name:
" +} + + template::list::create \ -name projects \ -multirow projects \ @@ -100,22 +139,22 @@ } \ -filters { status_id { - label "Status" + label "Status" values {[db_list_of_lists get_status "select description, status_id from pm_project_status order by status_type desc, description"]} - where_clause { - s.status_id = :status_id - } + where_clause {s.status_id = :status_id} } + subprojects_p { + label Subprojects + values {{"No" "f"} {"Yes" "t"}} + where_clause {p.parent_id = :root_folder} + } category_id { - label "Category" - values {$category_choices} - where_clause { - om.category_id = :category_id - } + label Categories + where_clause {c.category_id = [join [value_if_exists category_id] ","]} } } \ -orderby { - default_value category_id,asc + default_value project_name,asc project_name { label "Project name" orderby_desc "upper(p.title) desc"