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.11 -r1.12 --- openacs-4/contrib/packages/project-manager/www/index.tcl 26 Jan 2004 15:39:40 -0000 1.11 +++ openacs-4/contrib/packages/project-manager/www/index.tcl 26 Feb 2004 15:15:41 -0000 1.12 @@ -2,7 +2,8 @@ Main view page for projects. - @author jader@bread.com, ncarroll@ee.usyd.edu.au + @author jader@bread.com + @author ncarroll@ee.usyd.edu.au (on first version that used CR) @creation-date 2003-05-15 @cvs-id $Id$ @@ -16,9 +17,8 @@ } { orderby_project:optional - status_id:optional + {status_id:integer,optional} category_id:multiple,optional - {subprojects_p ""} } -properties { context:onevalue @@ -57,29 +57,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 [project_manager::project::default_status_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,35 +134,41 @@ 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" + display_template "@projects.earliest_finish_date@@projects.earliest_finish_date@" } latest_finish_date { label "Latest Finish" + display_template "@projects.latest_finish_date@@projects.latest_finish_date@" } actual_hours_completed { label "Hours completed" display_template "@projects.actual_hours_completed@/@projects.estimated_hours_total@" } category_id { label "Categories" - display_template "
  • @projects.category_name@" + display_template "
  • @projects.category_name@" } } \ -actions { "Tasks" "tasks" "View list of tasks" "Processes" "processes" "View and use processes" "Add project" "add-edit" "Add project" + "Customers" "/organization" "View customers" "Admin" "admin/" "Administration pages" } \ -main_class { @@ -152,32 +180,49 @@ 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" orderby_asc "c.category_name asc" default_direction asc } + earliest_finish_date { + label "Earliest finish" + orderby_desc "p.earliest_finish_date desc" + orderby_asc "p.earliest_finish_date asc" + default_direction asc + } + latest_finish_date { + label "Latest finish" + orderby_desc "p.latest_finish_date desc" + orderby_asc "p.latest_finish_date asc" + default_direction asc + } + actual_hours_completed { + label "Hours completed" + orderby_desc "p.actual_hours_completed desc" + orderby_asc "p.actual_hours_completed asc" + default_direction asc + } } \ -orderby_name orderby_project \ -html { @@ -187,7 +232,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}] }