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.5 -r1.9.2.6 --- openacs-4/contrib/packages/project-manager/www/index.tcl 15 Jan 2004 01:20:04 -0000 1.9.2.5 +++ openacs-4/contrib/packages/project-manager/www/index.tcl 4 Feb 2004 20:17:19 -0000 1.9.2.6 @@ -16,9 +16,8 @@ } { orderby_project:optional - status_id:optional + {status_id:integer,optional} category_id:multiple,optional - {subprojects_p ""} } -properties { context:onevalue @@ -57,29 +56,51 @@ # 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 --------------------------------- +# set default values +if {![exists_and_not_null status_id]} { + set status_id [db_string get_def_status "select status_id from pm_project_status where description = 'Open'"] +} # Categories are arranges into category trees. # Set up an array for each tree. The array contains the category for each tree -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" { +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 and +c.deprecated_p = 'f' +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 export_vars [export_vars -form {status_id 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"] { +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] @@ -112,16 +133,19 @@ template::list::create \ -name projects \ -multirow projects \ - -key item_id \ + -key project_item_id \ -elements { + customer_name { + label "Customer" + display_template " + @projects.customer_name@@projects.customer_name@ + " + } project_name { label "Project name" link_url_col item_url link_html { title "View this project version" } } - customer_name { - label "Customer" - } earliest_finish_date { label "Earliest finish" } @@ -134,7 +158,7 @@ } category_id { label "Categories" - display_template "
  • @projects.category_name@" + display_template "
  • @projects.category_name@" } } \ -actions { @@ -152,26 +176,25 @@ 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} } - 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 Categories where_clause {c.category_id = [join [value_if_exists category_id] ","]} } } \ -orderby { - default_value project_name,asc + default_value customer_name,asc project_name { label "Project name" orderby_desc "upper(p.title) desc" orderby_asc "upper(p.title) asc" default_direction asc } + customer_name { + label "Customer Name" + orderby_desc "upper(o.name) desc, earliest_finish_date desc" + orderby_asc "upper(o.name) asc, earliest_finish_date asc" + default_direction asc + } category_id { label "Categories" orderby_desc "c.category_name desc" @@ -187,7 +210,7 @@ db_multirow -extend { item_url } projects project_folders { } { - set item_url [export_vars -base "one" -override {{project_item_id $item_id}} {project_item_id}] + set item_url [export_vars -base "one" {project_item_id}] }