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.10 -r1.11 --- openacs-4/contrib/packages/project-manager/www/index.tcl 11 Dec 2003 21:39:44 -0000 1.10 +++ openacs-4/contrib/packages/project-manager/www/index.tcl 26 Jan 2004 15:39:40 -0000 1.11 @@ -17,7 +17,8 @@ } { orderby_project:optional status_id:optional - category_id:optional + category_id:multiple,optional + {subprojects_p ""} } -properties { context:onevalue @@ -56,14 +57,58 @@ # root CR folder set root_folder [db_string get_root "select pm_project__get_root_folder (:package_id, 'f')"] +# hack to make the subprojects filter work +#if {[string equal $subprojects_p "t"]} { +# set subprojects_p "" +#} + + # 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 \ @@ -74,11 +119,14 @@ link_url_col item_url link_html { title "View this project version" } } + customer_name { + label "Customer" + } earliest_finish_date { label "Earliest finish" } - estimated_finish_date { - label "Estimated Finish" + latest_finish_date { + label "Latest Finish" } actual_hours_completed { label "Hours completed" @@ -100,22 +148,24 @@ } \ -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" ""}} + default_value {f} + has_default_p 0 + 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"