Index: openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-custom-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/sql/postgresql/Attic/project-manager-custom-create.sql,v diff -u -N -r1.1.2.2 -r1.1.2.3 --- openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-custom-create.sql 4 Feb 2004 20:17:19 -0000 1.1.2.2 +++ openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-custom-create.sql 5 Feb 2004 23:57:49 -0000 1.1.2.3 @@ -20,14 +20,18 @@ -- example, using customer -- this is actually done in the table-create script ---select content_type__create_attribute( --- 'pm_project', --- 'customer_id', --- 'integer', --- 'Customer', --- 'Customers', --- null, --- null, --- 'integer constraint pm_project_customer_fk references organizations' ---); +-- this adds in the customer column. This is an example of how +-- the custom columns are added in. I put this here as a reminder +-- that other columns can be added in as well. These custom items +-- are in the custom-create.sql script +select content_type__create_attribute( + 'pm_project', + 'customer_id', + 'integer', + 'Customer', + 'Customers', + null, + null, + 'integer constraint pm_project_customer_fk references organizations' +); Index: openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-custom-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/sql/postgresql/Attic/project-manager-custom-drop.sql,v diff -u -N -r1.1.2.2 -r1.1.2.3 --- openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-custom-drop.sql 4 Feb 2004 20:17:19 -0000 1.1.2.2 +++ openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-custom-drop.sql 5 Feb 2004 23:57:49 -0000 1.1.2.3 @@ -6,6 +6,6 @@ -- @cvs-id $Id$ -- -select content_type__drop_attribute ('pm_project', 'customer_id', 't'); - -- drop any custom tables here. + +select content_type__drop_attribute ('pm_project', 'customer_id', 't'); Index: openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/sql/postgresql/Attic/project-manager-drop.sql,v diff -u -N -r1.10.2.5 -r1.10.2.6 --- openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-drop.sql 4 Feb 2004 20:17:19 -0000 1.10.2.5 +++ openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-drop.sql 5 Feb 2004 23:57:49 -0000 1.10.2.6 @@ -19,6 +19,17 @@ drop sequence pm_task_dependency_seq; drop sequence pm_tasks_number_seq; +select content_type__drop_attribute ('pm_task', 'end_date', 't'); +select content_type__drop_attribute ('pm_task', 'percent_complete', 't'); +select content_type__drop_attribute ('pm_task', 'estimated_hours_work', 't'); +select content_type__drop_attribute ('pm_task', 'estimated_hours_work_min', 't'); +select content_type__drop_attribute ('pm_task', 'estimated_hours_work_max', 't'); +select content_type__drop_attribute ('pm_task', 'actual_hours_worked', 't'); +select content_type__drop_attribute ('pm_task', 'earliest_start', 't'); +select content_type__drop_attribute ('pm_task', 'earliest_finish', 't'); +select content_type__drop_attribute ('pm_task', 'latest_start', 't'); +select content_type__drop_attribute ('pm_task', 'latest_finish', 't'); + ------------- -- WORKGROUPS ------------- @@ -190,11 +201,13 @@ drop function inline_0(); -select content_type__drop_type('pm_task', 't', 'f'); +drop sequence pm_task_status_seq; +drop table pm_task_status; drop table pm_tasks cascade; drop table pm_tasks_revisions cascade; +select content_type__drop_type('pm_task', 't', 'f'); select content_type__drop_type('pm_project', 't', 'f'); Index: openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-functions-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/sql/postgresql/Attic/project-manager-functions-create.sql,v diff -u -N -r1.8.2.5 -r1.8.2.6 --- openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-functions-create.sql 4 Feb 2004 20:17:19 -0000 1.8.2.5 +++ openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-functions-create.sql 5 Feb 2004 23:57:49 -0000 1.8.2.6 @@ -422,7 +422,7 @@ -- If it is not associated with a project, then it is placed in the root -- project repository folder. -select define_function_args('pm_task__new_task_item', 'project_id, title, description, end_date, percent_complete, estimated_hours_work, estimated_hours_work_min, estimated_hours_work_max, creation_date, creation_user, creation_ip, package_id'); +select define_function_args('pm_task__new_task_item', 'project_id, title, description, end_date, percent_complete, estimated_hours_work, estimated_hours_work_min, estimated_hours_work_max, status_id, creation_date, creation_user, creation_ip, package_id'); create function pm_task__new_task_item ( integer, -- project_id @@ -433,6 +433,7 @@ numeric, -- estimated_hours_work numeric, -- estimated_hours_work_min numeric, -- estimated_hours_work_max, + integer, -- status_id timestamptz, -- creation_date integer, -- creation_user varchar, -- creation_ip @@ -448,10 +449,11 @@ p_estimated_hours_work alias for $6; p_estimated_hours_work_min alias for $7; p_estimated_hours_work_max alias for $8; - p_creation_date alias for $9; - p_creation_user alias for $10; - p_creation_ip alias for $11; - p_package_id alias for $12; + p_status_id alias for $9; + p_creation_date alias for $10; + p_creation_user alias for $11; + p_creation_ip alias for $12; + p_package_id alias for $13; v_item_id cr_items.item_id%TYPE; v_revision_id cr_revisions.revision_id%TYPE; @@ -499,9 +501,9 @@ PERFORM content_item__set_live_revision (v_revision_id); insert into pm_tasks ( - task_id, task_number) + task_id, task_number, status) values ( - v_item_id, v_task_number); + v_item_id, v_task_number, p_status_id); insert into pm_tasks_revisions ( task_revision_id, end_date, percent_complete, estimated_hours_work, estimated_hours_work_min, estimated_hours_work_max, actual_hours_worked) @@ -531,6 +533,7 @@ numeric, -- estimated_hours_work_min numeric, -- estimated_hours_work_max numeric, -- actual_hours_worked + integer, -- status_id timestamptz, -- creation_date integer, -- creation_user varchar, -- creation_ip @@ -548,10 +551,11 @@ p_estimated_hours_work_min alias for $8; p_estimated_hours_work_max alias for $9; p_actual_hours_worked alias for $10; - p_creation_date alias for $11; - p_creation_user alias for $12; - p_creation_ip alias for $13; - p_package_id alias for $14; + p_status_id alias for $11; + p_creation_date alias for $12; + p_creation_user alias for $13 + p_creation_ip alias for $14; + p_package_id alias for $15; v_revision_id cr_revisions.revision_id%TYPE; v_id cr_items.item_id%TYPE; @@ -581,6 +585,8 @@ values ( v_revision_id, p_end_date, p_percent_complete, p_estimated_hours_work, p_estimated_hours_work_min, p_estimated_hours_work_max, p_actual_hours_worked); + update pm_tasks set status = p_status_id where task_id = p_task_id; + PERFORM acs_permission__grant_permission( v_revision_id, p_creation_user, Index: openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-table-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/sql/postgresql/Attic/project-manager-table-create.sql,v diff -u -N -r1.15.2.5 -r1.15.2.6 --- openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-table-create.sql 4 Feb 2004 20:17:19 -0000 1.15.2.5 +++ openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-table-create.sql 5 Feb 2004 23:57:49 -0000 1.15.2.6 @@ -77,22 +77,10 @@ 'pm_project__name' -- name_method ); --- this adds in the customer column. This is an example of how --- the custom columns are added in. I put this here as a reminder --- that other columns can be added in as well. These custom items --- are in the custom-create.sql script -select content_type__create_attribute( - 'pm_project', - 'customer_id', - 'integer', - 'Customer', - 'Customers', - null, - null, - 'integer constraint pm_project_customer_fk references organizations' -); +-- other fields are added in too. See the -custom script. + -- ROLES create sequence pm_role_seq start 4; @@ -172,6 +160,25 @@ -- the information that we keep revisions on is in the -- pm_task_revisions table, the rest is in pm_task +create sequence pm_task_status_seq start 3; + +create table pm_task_status ( + status_id integer + constraint pm_task_status_pk + primary key, + description varchar(100), + -- closed or open + status_type char(1) default 'c' + constraint pm_task_status_type_ck + check (status_type in ('c','o')) +); + +insert into pm_task_status (status_id, description, status_type) values +(1, 'Open', 'o'); +insert into pm_task_status (status_id, description, status_type) values +(2, 'Closed', 'c'); + + create sequence pm_tasks_number_seq; create table pm_tasks ( @@ -181,7 +188,10 @@ on delete cascade constraint pm_task_task_id_pk primary key, - task_number integer + task_number integer, + status integer + constraint pm_tasks_task_status_fk + references pm_task_status ); @@ -443,11 +453,31 @@ ); -comment on table pm_project_assignment is ' - Maps who is a part of what project, and in what capacity +comment on table pm_task_assignment is ' + Maps who is a part of what task, and in what capacity '; +create table pm_task_xref ( + task_id_1 integer + constraint pm_task_xref_task1_nn + not null + constraint pm_task_xref_task1_fk + references pm_tasks(task_id) + on delete cascade, + task_id_2 integer + constraint pm_task_xref_task2_nn + not null + constraint pm_task_xref_task2_fk + references pm_tasks(task_id) + on delete cascade, + constraint pm_task_xref_lt (task_id_1 < task_id_2) +); +comment on table pm_task_xref is ' + Maps related tasks. +'; + + -- PROCESSES create sequence pm_process_seq; Index: openacs-4/contrib/packages/project-manager/tcl/project-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/tcl/Attic/project-procs-postgresql.xql,v diff -u -N -r1.2.2.1 -r1.2.2.2 --- openacs-4/contrib/packages/project-manager/tcl/project-procs-postgresql.xql 4 Feb 2004 20:17:19 -0000 1.2.2.1 +++ openacs-4/contrib/packages/project-manager/tcl/project-procs-postgresql.xql 5 Feb 2004 23:57:49 -0000 1.2.2.2 @@ -1,8 +1,26 @@ - postgresql7.1 + postgresql7.3 + + + + select status_id + from pm_project_status + where status_type = 'o' + limit 1 + + + + + select status_id + from pm_project_status + where status_type = 'c' + limit 1 + + + select pm_project__new_project_item ( Index: openacs-4/contrib/packages/project-manager/tcl/project-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/tcl/Attic/project-procs.tcl,v diff -u -N -r1.3.2.2 -r1.3.2.3 --- openacs-4/contrib/packages/project-manager/tcl/project-procs.tcl 4 Feb 2004 20:17:19 -0000 1.3.2.2 +++ openacs-4/contrib/packages/project-manager/tcl/project-procs.tcl 5 Feb 2004 23:57:49 -0000 1.3.2.3 @@ -12,6 +12,24 @@ namespace eval project_manager::project {} +ad_proc -public project_manager::project::default_status_open { +} { + Returns the default status value for open projects +} { + set return_val [db_string get_default_status_open { }] + + return $return_val +} + +ad_proc -public project_manager::project::default_status_closed { +} { + Returns the default status value for closed projects +} { + set return_val [db_string get_default_status_closed { }] + + return $return_val +} + ad_proc -public project_manager::project::new { -project_name:required {-project_code ""} Index: openacs-4/contrib/packages/project-manager/tcl/task-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/tcl/Attic/task-procs-postgresql.xql,v diff -u -N -r1.1.2.1 -r1.1.2.2 --- openacs-4/contrib/packages/project-manager/tcl/task-procs-postgresql.xql 10 Jan 2004 01:04:02 -0000 1.1.2.1 +++ openacs-4/contrib/packages/project-manager/tcl/task-procs-postgresql.xql 5 Feb 2004 23:57:49 -0000 1.1.2.2 @@ -1,11 +1,50 @@ - - - obviously broken - select package_id from surveys - where survey_id=:object_id - - + postgresql7.3 + + + + select status_id + from pm_task_status + where status_type = 'o' + limit 1 + + + + + + select status_id + from pm_task_status + where status_type = 'c' + limit 1 + + + + + + obviously broken + select package_id from surveys + where survey_id=:object_id + + + + + + select pm_task__new_task_item ( + :project_id, + :title, + :description, + :end_date, + :percent_complete, + :estimated_hours_work, + :estimated_hours_work_min, + :estimated_hours_work_max, + :status_id, + :creation_date, + :creation_user, + :creation_ip, + :package_id) + + Index: openacs-4/contrib/packages/project-manager/tcl/task-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/tcl/Attic/task-procs.tcl,v diff -u -N -r1.1.2.2 -r1.1.2.3 --- openacs-4/contrib/packages/project-manager/tcl/task-procs.tcl 4 Feb 2004 20:17:19 -0000 1.1.2.2 +++ openacs-4/contrib/packages/project-manager/tcl/task-procs.tcl 5 Feb 2004 23:57:49 -0000 1.1.2.3 @@ -12,6 +12,49 @@ namespace eval project_manager::task {} +ad_proc -public project_manager::task::default_status_open { +} { + Returns the default status value for open tasks +} { + set return_val [db_string get_default_status_open { }] + + return $return_val +} + +ad_proc -public project_manager::task::default_status_closed { +} { + Returns the default status value for closed tasks +} { + set return_val [db_string get_default_status_closed { }] + + return $return_val +} + +ad_proc -public project_manager::task::new { + -project_id:required + -title:required + {-description ""} + {-end_date ""} + {-percent_complete "0"} + {-estimated_hours_work "0"} + {-estimated_hours_work_min "0"} + {-estimated_hours_work_max "0"} + {-creation_date ""} + {-status_id ""} + -creation_user:required + -creation_ip:required + -package_id:required +} { + if {![exists_and_not_null status_id]} { + set status_id [project_manger::task::default_status_open] + } + + set return_val [db_exec_plsql new_task_item { *SQL }] + + return $return_val +} + + ad_proc -public project_manager::task::get_url { object_id } { Index: openacs-4/contrib/packages/project-manager/www/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/index-postgresql.xql,v diff -u -N -r1.8.2.5 -r1.8.2.6 --- openacs-4/contrib/packages/project-manager/www/index-postgresql.xql 4 Feb 2004 20:17:19 -0000 1.8.2.5 +++ openacs-4/contrib/packages/project-manager/www/index-postgresql.xql 5 Feb 2004 23:57:49 -0000 1.8.2.6 @@ -16,6 +16,8 @@ p.ongoing_p, c.category_id, c.category_name, + p.earliest_finish_date - current_date as days_to_earliest_finish, + p.latest_finish_date - current_date as days_to_latest_finish, p.actual_hours_completed, p.estimated_hours_total, to_char(p.estimated_finish_date, 'MM/DD/YY') as estimated_finish_date, 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 -N -r1.9.2.6 -r1.9.2.7 --- openacs-4/contrib/packages/project-manager/www/index.tcl 4 Feb 2004 20:17:19 -0000 1.9.2.6 +++ openacs-4/contrib/packages/project-manager/www/index.tcl 5 Feb 2004 23:57:49 -0000 1.9.2.7 @@ -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$ @@ -60,7 +61,7 @@ # 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'"] + set status_id [project_manager::project::default_status_open] } # Categories are arranges into category trees. @@ -148,9 +149,11 @@ } 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" @@ -201,6 +204,24 @@ 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 { Index: openacs-4/contrib/packages/project-manager/www/one-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/one-postgresql.xql,v diff -u -N -r1.19.2.4 -r1.19.2.5 --- openacs-4/contrib/packages/project-manager/www/one-postgresql.xql 4 Feb 2004 20:17:19 -0000 1.19.2.4 +++ openacs-4/contrib/packages/project-manager/www/one-postgresql.xql 5 Feb 2004 23:57:49 -0000 1.19.2.5 @@ -86,12 +86,16 @@ t.title, to_char(t.end_date,'YYYY-MM-DD HH24:MI') as end_date, to_char(t.earliest_start,'YYYY-MM-DD HH24:MI') as earliest_start, + t.earliest_start - current_date as days_to_earliest_start, to_char(t.earliest_start,'J') as earliest_start_j, to_char(t.earliest_finish,'YYYY-MM-DD HH24:MI') as earliest_finish, + t.earliest_finish - current_date as days_to_earliest_finish, to_char(t.latest_start,'YYYY-MM-DD HH24:MI') as latest_start, + t.latest_start - current_date as days_to_latest_start, to_char(t.latest_start,'J') as latest_start_j, to_char(current_date,'J') as today_j, to_char(t.latest_finish,'YYYY-MM-DD HH24:MI') as latest_finish, + t.latest_finish - current_date as days_to_latest_finish, u.first_names, u.last_name, t.percent_complete, @@ -151,7 +155,7 @@ SELECT - p.customer_id, + p.customer_id FROM pm_projectsx p LEFT JOIN organizations c ON p.customer_id = c.organization_id Index: openacs-4/contrib/packages/project-manager/www/one.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/one.adp,v diff -u -N -r1.27.2.5 -r1.27.2.6 --- openacs-4/contrib/packages/project-manager/www/one.adp 4 Feb 2004 20:17:19 -0000 1.27.2.5 +++ openacs-4/contrib/packages/project-manager/www/one.adp 5 Feb 2004 23:57:49 -0000 1.27.2.6 @@ -129,7 +129,6 @@ Customer @custom.customer_name@ - Index: openacs-4/contrib/packages/project-manager/www/one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/one.tcl,v diff -u -N -r1.26.2.5 -r1.26.2.6 --- openacs-4/contrib/packages/project-manager/www/one.tcl 4 Feb 2004 20:17:19 -0000 1.26.2.5 +++ openacs-4/contrib/packages/project-manager/www/one.tcl 5 Feb 2004 23:57:49 -0000 1.26.2.6 @@ -143,21 +143,19 @@ } earliest_start { label "Earliest Start" - display_template "@tasks.earliest_start_pretty@" + display_template "@tasks.earliest_start_pretty@@tasks.earliest_start_pretty@" } earliest_finish { label "Earliest Finish" - display_template "@tasks.earliest_finish_pretty@" + display_template "@tasks.earliest_finish_pretty@@tasks.earliest_finish_pretty@" } latest_start { label "Latest Start" - display_template "@tasks.latest_start_pretty@" + display_template "@tasks.latest_start_pretty@@tasks.latest_start_pretty@" } latest_finish { label "Latest Finish" - display_template { - @tasks.latest_finish_pretty@ - } + display_template "@tasks.latest_finish_pretty@@tasks.latest_finish_pretty@" } last_name { label "Who" Index: openacs-4/contrib/packages/project-manager/www/process-add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/process-add-edit.tcl,v diff -u -N -r1.1.2.4 -r1.1.2.5 --- openacs-4/contrib/packages/project-manager/www/process-add-edit.tcl 4 Feb 2004 20:17:19 -0000 1.1.2.4 +++ openacs-4/contrib/packages/project-manager/www/process-add-edit.tcl 5 Feb 2004 23:57:49 -0000 1.1.2.5 @@ -23,16 +23,7 @@ } -ns_log notice it's my page! -set mypage [ns_getform] -if {[string equal "" $mypage]} { - ns_log notice no form was submitted on my page -} else { - ns_log notice the following form was submitted on my page - ns_set print $mypage -} - # --------------------------------------------------------------- # # the unique identifier for this package set package_id [ad_conn package_id] @@ -63,6 +54,7 @@ {one_line:text {label "Subject"} {value $one_line} + {html {size 40}} } {description:text(textarea),optional @@ -73,6 +65,7 @@ {number_of_tasks:text {label "Number of new tasks"} {value "1"} + {html {size 5}} } } -select_query_name process_query -on_submit { Index: openacs-4/contrib/packages/project-manager/www/task-add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-add-edit.tcl,v diff -u -N -r1.23.2.5 -r1.23.2.6 --- openacs-4/contrib/packages/project-manager/www/task-add-edit.tcl 4 Feb 2004 20:17:19 -0000 1.23.2.5 +++ openacs-4/contrib/packages/project-manager/www/task-add-edit.tcl 5 Feb 2004 23:57:49 -0000 1.23.2.6 @@ -43,7 +43,7 @@ project_id:integer,optional {number:integer "1"} task_revision_id:integer,optional - {task_id ""} + {task_id:multiple ""} task_item_id:array,optional task_title:array,optional {process_id:integer ""} 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 -N -r1.1.2.4 -r1.1.2.5 --- openacs-4/contrib/packages/project-manager/www/tasks-postgresql.xql 4 Feb 2004 20:17:19 -0000 1.1.2.4 +++ openacs-4/contrib/packages/project-manager/www/tasks-postgresql.xql 5 Feb 2004 23:57:49 -0000 1.1.2.5 @@ -25,18 +25,16 @@ to_char(t.latest_start,'YYYY-MM-DD HH24:MI') as latest_start, to_char(t.latest_finish,'YYYY-MM-DD HH24:MI') as latest_finish, p.first_names || ' ' || p.last_name as full_name, - r.one_line as role + (select one_line from pm_roles r where ta.role_id = r.role_id) as role FROM pm_tasks ts, 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, - pm_roles r + ON ta.party_id = p.person_id WHERE - ts.task_id = t.item_id and - ta.role_id = r.role_id + ts.task_id = t.item_id [template::list::filter_where_clauses -and -name tasks] [template::list::orderby_clause -orderby -name tasks] Index: openacs-4/contrib/packages/project-manager/www/tasks.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/tasks.adp,v diff -u -N -r1.1.2.3 -r1.1.2.4 --- openacs-4/contrib/packages/project-manager/www/tasks.adp 13 Dec 2003 01:19:54 -0000 1.1.2.3 +++ openacs-4/contrib/packages/project-manager/www/tasks.adp 5 Feb 2004 23:57:49 -0000 1.1.2.4 @@ -5,6 +5,19 @@ @task_term@s @context_bar;noquote@ + + 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 -N -r1.1.2.5 -r1.1.2.6 --- openacs-4/contrib/packages/project-manager/www/tasks.tcl 4 Feb 2004 20:17:19 -0000 1.1.2.5 +++ openacs-4/contrib/packages/project-manager/www/tasks.tcl 5 Feb 2004 23:57:49 -0000 1.1.2.6 @@ -18,6 +18,8 @@ orderby:optional party_id:optional {searchterm ""} + {mine_p "t"} + {status_id ""} } -properties { task_term:onevalue context_bar:onevalue @@ -39,11 +41,16 @@ set package_id [ad_conn package_id] set user_id [ad_maybe_redirect_for_registration] -# by default, show this user's tasks -#if {![exists_and_not_null party_id]} { -# set party_id $user_id -#} +# if mine_p is true, show only my tasks +if {[string equal $mine_p t]} { + set party_id $user_id +} +# status defaults to open +if {![exists_and_not_null status_id]} { + set status_id [project_manager::task::status_default_open] +} + # permissions permission::require_permission -party_id $user_id -object_id $package_id -privilege read @@ -69,13 +76,14 @@ } full_name { label "Who" - display_template "@tasks.full_name@ (@tasks.role@)" + display_template "unassigned@tasks.full_name@ (@tasks.role@)" } description { label "Description" } slack_time { label "Slack time" + display_template "@tasks.slack_time@@tasks.slack_time@" } latest_start_pretty { label "Latest Start" @@ -105,9 +113,14 @@ label "People" values {[db_list_of_lists get_people "select distinct(first_names || ' ' || last_name) as fullname, u.person_id from persons u, pm_task_assignment a where u.person_id = a.party_id order by fullname"]} where_clause { - t.party_id = :party_id + 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} + } } \ -orderby { default_value task_number,asc @@ -123,6 +136,42 @@ orderby_asc "t.title asc" default_direction asc } + full_name { + label "Who" + orderby_desc "p.first_names desc,p.last_name desc" + orderby_asc "p.first_names, p.last_name" + default_direction asc + } + description { + label "Description" + orderby_desc "t.description desc" + orderby_asc "t.description" + default_direction asc + } + slack_time { + label "Slack" + orderby_desc "(latest_start - earliest_start) desc" + orderby_asc "(latest_start - earliest_start)" + default_direction asc + } + latest_start_pretty { + label "Latest start" + orderby_desc "t.latest_start desc" + orderby_asc "t.latest_start" + default_direction asc + } + latest_finish_pretty { + label "Latest finish" + orderby_desc "t.latest_finish desc" + orderby_asc "t.latest_finish" + default_direction asc + } + actual_hours_worked { + label "Hours completed" + orderby_desc "t.actual_hours_worked desc" + orderby_asc "t.actual_hours_worked" + default_direction asc + } } \ -orderby_name orderby \ -html {