Index: openacs-4/contrib/packages/project-manager/www/tasks-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/tasks-postgresql.xql,v diff -u -r1.5.2.7 -r1.5.2.8 --- openacs-4/contrib/packages/project-manager/www/tasks-postgresql.xql 14 Feb 2005 15:23:37 -0000 1.5.2.7 +++ openacs-4/contrib/packages/project-manager/www/tasks-postgresql.xql 10 Mar 2005 14:02:13 -0000 1.5.2.8 @@ -5,11 +5,12 @@ SELECT - ts.task_id as task_item_id, + ts.task_id, ts.task_number, t.task_revision_id, t.title, - t.description, + t.description, + tst.description as status, t.parent_id as project_item_id, proj_rev.logger_project, proj_rev.title as project_name, @@ -32,6 +33,7 @@ r.one_line as role FROM pm_tasks_active ts, + pm_task_status tst, cr_items i, pm_tasks_revisionsx t LEFT JOIN pm_task_assignment ta @@ -45,15 +47,46 @@ pm_projectsx proj_rev WHERE ts.task_id = t.item_id and + tst.status_id = status and i.item_id = t.item_id and t.task_revision_id = i.live_revision and t.parent_id = proj.item_id and proj.live_revision = proj_rev.revision_id and proj.parent_id = f.folder_id and f.package_id = :package_id + [template::list::page_where_clause -and -name "tasks"] [template::list::filter_where_clauses -and -name tasks] [template::list::orderby_clause -orderby -name tasks] + + + SELECT + distinct ts.task_id + FROM + pm_tasks_active ts, + cr_items i, + pm_tasks_revisionsx t + LEFT JOIN pm_task_assignment ta + ON t.item_id = ta.task_id + LEFT JOIN persons p + ON ta.party_id = p.person_id + LEFT JOIN pm_roles r + ON ta.role_id = r.role_id, + cr_items proj, + cr_folders f, + pm_projectsx proj_rev + WHERE + ts.task_id = t.item_id and + i.item_id = t.item_id and + t.task_revision_id = i.live_revision and + t.parent_id = proj.item_id and + proj.live_revision = proj_rev.revision_id + and proj.parent_id = f.folder_id + and f.package_id = :package_id + [template::list::filter_where_clauses -and -name tasks] + + + Index: openacs-4/contrib/packages/project-manager/www/tasks.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/tasks.tcl,v diff -u -r1.5.2.16 -r1.5.2.17 --- openacs-4/contrib/packages/project-manager/www/tasks.tcl 22 Dec 2004 22:10:59 -0000 1.5.2.16 +++ openacs-4/contrib/packages/project-manager/www/tasks.tcl 10 Mar 2005 14:02:13 -0000 1.5.2.17 @@ -23,6 +23,8 @@ {searchterm ""} {mine_p "t"} {status_id ""} + {page ""} + {page_size 25} role_id:optional } -properties { task_term:onevalue @@ -55,6 +57,9 @@ # set up context bar set context [list "Tasks"] +# Get the currently available Status +set status_list [db_list_of_lists get_status_values "select description, status_id from pm_task_status order by status_type desc, description"] + # the unique identifier for this package set package_id [ad_conn package_id] set user_id [ad_maybe_redirect_for_registration] @@ -66,7 +71,10 @@ # status defaults to open if {![exists_and_not_null status_id]} { - set status_id [pm::task::default_status_open] + set status_where_clause "" +# set status_id [pm::task::default_status_open] +} else { + set status_where_clause {ts.status = :status_id} } # permissions @@ -110,7 +118,7 @@ label "\#" link_url_col item_url link_html { title "View this project version" } - display_template {@tasks.task_item_id@} + display_template {@tasks.task_id@} } title { label "Subject" @@ -131,6 +139,9 @@ @tasks.latest_finish_pretty@ } } + status { + label "Status" + } } if {[string is true $use_days_p]} { @@ -164,14 +175,14 @@ display_template {L} } percent_complete { - display_template "" + display_template "" } } template::list::create \ -name tasks \ -multirow tasks \ - -key task_item_id \ + -key ts.task_id \ -elements $elements \ -actions [list "Add task" [export_vars -base task-select-project {return_url}] "Add a task"] \ -bulk_actions { @@ -189,6 +200,11 @@ label "Search" where_clause {$search_term_where} } + status_id { + label "Status" + values {$status_list} + where_clause "$status_where_clause" + } role_id { label "Roles" values {[pm::role::select_list_filter]} @@ -203,11 +219,6 @@ ta.party_id = :party_id } } - status_id { - label "Status" - values {[db_list_of_lists get_status_values "select description, status_id from pm_task_status order by status_type desc, description"]} - where_clause {ts.status = :status_id} - } mine_p { label "Show others' tasks" } @@ -256,7 +267,16 @@ orderby_asc "t.latest_finish, ts.task_id, p.first_names, p.last_name" default_direction asc } + status { + label "Status" + orderby_desc "status desc, t.latest_finish desc, ts.task_id, p.first_names, p.last_name" + orderby_asc "status asc, t.latest_finish desc, ts.task_id, p.first_names, p.last_name" + default_direction asc + } } \ + -page_size $page_size \ + -page_flush_p 0 \ + -page_query_name tasks_pagination \ -orderby_name orderby \ -html { width 100% @@ -267,9 +287,9 @@ db_multirow -extend { item_url latest_start_pretty latest_finish_pretty slack_time log_url hours_remaining days_remaining} tasks tasks { } { - set item_url [export_vars -base "task-one" {{task_id $task_item_id}}] + set item_url [export_vars -base "task-one" {{task_id $task_id}}] - set log_url [export_vars -base "${logger_url}log" {{project_id $logger_project} {pm_task_id $task_item_id} {pm_project_id $project_item_id} {return_url $return_url}}] + set log_url [export_vars -base "${logger_url}log" {{project_id $logger_project} {pm_task_id $task_id} {pm_project_id $project_item_id} {return_url $return_url}}] set latest_start_pretty [lc_time_fmt $latest_start "%x"] set latest_finish_pretty [lc_time_fmt $latest_finish "%x"]