Index: openacs-4/contrib/packages/project-manager/project-manager.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/Attic/project-manager.info,v diff -u -r1.14 -r1.15 --- openacs-4/contrib/packages/project-manager/project-manager.info 26 Jan 2004 15:39:40 -0000 1.14 +++ openacs-4/contrib/packages/project-manager/project-manager.info 26 Feb 2004 15:15:39 -0000 1.15 @@ -6,23 +6,25 @@ Project Managers f f - - + project-manager + + Jade Rubick Project management tool for OpenACS - 2003-10-08 - Track tasks, estimates and actual progress for a project. See the <a href="http://openacs.org/projects/dotwrk/project_management/">project page</a> for more information. + 2004-02-04 + Track tasks, estimates and actual progress for a project. See the <a href="http://openacs.org/projects/dotwrk/project_management/">project page</a> for more information. - + + - + 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 -r1.2 -r1.3 --- openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-custom-create.sql 26 Jan 2004 15:39:40 -0000 1.2 +++ openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-custom-create.sql 26 Feb 2004 15:15:40 -0000 1.3 @@ -15,17 +15,23 @@ -- you should use the content_type__create_attribute procedure to add -- in columns so that the views are correctly recreated. +-- PROJECTS --- add in extra columns +-- 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 -r1.2 -r1.3 --- openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-custom-drop.sql 26 Jan 2004 15:39:40 -0000 1.2 +++ openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-custom-drop.sql 26 Feb 2004 15:15:40 -0000 1.3 @@ -8,6 +8,4 @@ -- drop any custom tables here. --- select content_type__drop_attribute ('pm_project', 'customer_id', 't'); - - +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 -r1.12 -r1.13 --- openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-drop.sql 26 Jan 2004 15:39:40 -0000 1.12 +++ openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-drop.sql 26 Feb 2004 15:15:40 -0000 1.13 @@ -10,12 +10,26 @@ -- TASKS -------- +\i project-manager-custom-drop.sql +\i project-manager-notifications-drop.sql + -- task dependency types drop table pm_task_dependency_types cascade; drop table pm_task_dependency cascade; 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 ------------- @@ -84,7 +98,7 @@ create function inline_0 () returns integer as ' declare - v_folder_id cr_folders.folder_id%TYPE; + v_folder_id cr_folders.folder_id%TYPE; v_item_id cr_items.item_id%TYPE; v_item_cursor RECORD; begin @@ -98,16 +112,16 @@ where content_type = ''pm_project'' LOOP - PERFORM pm_project__delete_project_item(v_item_cursor.item_id); + PERFORM pm_project__delete_project_item(v_item_cursor.item_id); END LOOP; select content_item__get_id(''projects'', null, ''f'') into v_folder_id from dual; -- unregister_content_types PERFORM content_folder__unregister_content_type ( - v_folder_id, -- folder_id - ''pm_project'', -- content_type - ''t'' -- include_subtypes + v_folder_id, -- folder_id + ''pm_project'', -- content_type + ''t'' -- include_subtypes ); -- this table must not hold reference to ''pm_project'' type @@ -124,7 +138,7 @@ where f.folder_id = i.item_id and description = ''Project Repository'' LOOP - PERFORM content_item__delete(v_item_cursor.folder_id); + PERFORM content_item__delete(v_item_cursor.folder_id); END LOOP; return 0; @@ -143,16 +157,58 @@ drop sequence pm_project_status_seq; drop table pm_project_status; -drop table pm_project_category_map; +-- unregister content_types from folder +create function inline_0 () +returns integer as ' +declare + v_folder_id cr_folders.folder_id%TYPE; + v_item_id cr_items.item_id%TYPE; + v_item_cursor RECORD; +begin -drop sequence pm_project_category_seq; -drop table pm_project_category; + -- delete all contents of projects folder + FOR v_item_cursor IN + select + item_id + from + cr_items + where + content_type = ''pm_task'' + LOOP + PERFORM pm_project__delete_task_item(v_item_cursor.item_id); + END LOOP; -select content_type__drop_type('pm_task', 't', 'f'); + --select content_item__get_id(''tasks'', null, ''f'') into v_folder_id from dual; + -- unregister_content_types + --PERFORM content_folder__unregister_content_type ( + -- v_folder_id, -- folder_id + -- ''pm_tasks'', -- content_type + -- ''t'' -- include_subtypes + --); + + -- this table must not hold reference to ''pm_project'' type + delete from cr_folder_type_map where content_type = ''pm_tasks''; + + -- delete projects folder + --PERFORM content_folder__delete(v_folder_id); + + return 0; +end; +' language 'plpgsql'; + +select inline_0(); +drop function inline_0(); + + +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'); -- note that the Project Repository folder is not deleted 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 -r1.11 -r1.12 --- openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-functions-create.sql 26 Jan 2004 15:39:40 -0000 1.11 +++ openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-functions-create.sql 26 Feb 2004 15:15:40 -0000 1.12 @@ -21,9 +21,9 @@ p_pm_project_id alias for $1; v_pm_project_name varchar; begin - select project_code || ''_'' || p_pm_project_id into v_pm_project_name - from pm_projects - where project_id = p_pm_project_id; + select project_name || ''_'' || p_pm_project_id into v_pm_project_name + from pm_projectsx + where item_id = p_pm_project_id; return v_pm_project_name; end; ' language 'plpgsql'; @@ -130,10 +130,9 @@ -- is null. Otherwise a project folder will be created as a sub-folder -- of an existing project folder. -select define_function_args('pm_project__new_project_item', 'project_id, project_name, project_code, parent_id, goal, description, planned_start_date, planned_end_date, actual_start_date, actual_end_date, ongoing_p, status_id, creation_date, creation_user, creation_ip, package_id'); +select define_function_args('pm_project__new_project_item', 'project_name, project_code, parent_id, goal, description, planned_start_date, planned_end_date, actual_start_date, actual_end_date, ongoing_p, status_id, customer_id, creation_date, creation_user, creation_ip, package_id'); create function pm_project__new_project_item ( - integer, -- project_id varchar, -- project_name varchar, -- project_code integer, -- parent_id @@ -145,25 +144,26 @@ timestamptz, -- actual_end_date char(1), -- ongoing_p integer, -- status_id + integer, -- customer_id (organization_id) timestamptz, -- creation_date integer, -- creation_user varchar, -- creation_ip integer -- package_id ) returns integer as ' declare - p_project_id alias for $1; - p_project_name alias for $2; - p_project_code alias for $3; - p_parent_id alias for $4; - p_goal alias for $5; - p_description alias for $6; - p_planned_start_date alias for $7; - p_planned_end_date alias for $8; - p_actual_start_date alias for $9; - p_actual_end_date alias for $10; - p_ongoing_p alias for $11; - p_status_id alias for $12; + p_project_name alias for $1; + p_project_code alias for $2; + p_parent_id alias for $3; + p_goal alias for $4; + p_description alias for $5; + p_planned_start_date alias for $6; + p_planned_end_date alias for $7; + p_actual_start_date alias for $8; + p_actual_end_date alias for $9; + p_ongoing_p alias for $10; + p_status_id alias for $11; + p_customer_id alias for $12; p_creation_date alias for $13; p_creation_user alias for $14; p_creation_ip alias for $15; @@ -228,14 +228,14 @@ ongoing_p, estimated_finish_date, earliest_finish_date, latest_finish_date, actual_hours_completed, - estimated_hours_total, status_id) + estimated_hours_total, status_id, customer_id) values ( v_revision_id, p_project_code, p_goal, p_planned_start_date, p_planned_end_date, p_actual_start_date, p_actual_end_date, p_ongoing_p, p_planned_end_date, p_planned_end_date, p_planned_end_date, ''0'', - ''0'', p_status_id + ''0'', p_status_id, p_customer_id ); PERFORM acs_permission__grant_permission( @@ -260,9 +260,6 @@ begin raise NOTICE ''Deleting pm_project...''; - delete from acs_permissions - where object_id = p_project_id; - for v_child in select item_id from @@ -274,17 +271,16 @@ PERFORM pm_project__delete_project_item(v_child.item_id); end loop; - delete from pm_projects - where project_id = p_project_id; + delete from pm_projects where project_id in (select revision_id from pm_projectsx where item_id = p_project_id); PERFORM content_item__delete(p_project_id); return 0; end;' language 'plpgsql'; -select define_function_args('pm_project__new_project_revision', 'item_id, project_name, project_code, parent_id, goal, description, planned_start_date, planned_end_date, actual_start_date, actual_end_date, ongoing_p, status_id, creation_date, creation_user, creation_ip, package_id'); +select define_function_args('pm_project__new_project_revision', 'item_id, project_name, project_code, parent_id, goal, description, planned_start_date, planned_end_date, actual_start_date, actual_end_date, ongoing_p, status_id, organization_id, creation_date, creation_user, creation_ip, package_id'); -create function pm_project__new_project_revision ( +create or replace function pm_project__new_project_revision ( integer, -- item_id varchar, -- project_name varchar, -- project_code @@ -297,6 +293,7 @@ timestamptz, -- actual_end_date char(1), -- ongoing_p integer, -- status_id + integer, -- organization_id (customer) timestamptz, -- creation_date integer, -- creation_user varchar, -- creation_ip @@ -316,10 +313,11 @@ p_actual_end_date alias for $10; p_ongoing_p alias for $11; p_status_id alias for $12; - p_creation_date alias for $13; - p_creation_user alias for $14; - p_creation_ip alias for $15; - p_package_id alias for $16; + p_organization_id alias for $13; + p_creation_date alias for $14; + p_creation_user alias for $15; + p_creation_ip alias for $16; + p_package_id alias for $17; v_revision_id cr_revisions.revision_id%TYPE; begin @@ -346,13 +344,15 @@ project_id, project_code, goal, planned_start_date, planned_end_date, actual_start_date, actual_end_date, - ongoing_p, status_id) + ongoing_p, status_id, customer_id) values ( v_revision_id, p_project_code, p_goal, p_planned_start_date, p_planned_end_date, p_actual_start_date, - p_actual_end_date, p_ongoing_p, p_status_id); + p_actual_end_date, p_ongoing_p, p_status_id, p_organization_id); + -- make sure organizations are in as well + PERFORM acs_permission__grant_permission( v_revision_id, p_creation_user, @@ -422,10 +422,9 @@ -- 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', 'task_id, 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, -- task_id integer, -- project_id varchar, -- title varchar, -- description @@ -434,22 +433,23 @@ 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 integer -- package_id ) returns integer as ' declare - p_task_id alias for $1; - p_project_id alias for $2; - p_title alias for $3; - p_description alias for $4; - p_end_date alias for $5; - p_percent_complete alias for $6; - p_estimated_hours_work alias for $7; - p_estimated_hours_work_min alias for $8; - p_estimated_hours_work_max alias for $9; + p_project_id alias for $1; + p_title alias for $2; + p_description alias for $3; + p_end_date alias for $4; + p_percent_complete alias for $5; + p_estimated_hours_work alias for $6; + p_estimated_hours_work_min alias for $7; + p_estimated_hours_work_max alias for $8; + p_status_id alias for $9; p_creation_date alias for $10; p_creation_user alias for $11; p_creation_ip alias for $12; @@ -501,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) @@ -533,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 @@ -550,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; @@ -583,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, @@ -602,11 +606,6 @@ declare p_task_id alias for $1; begin - -- will not work because permissions are on revision_id not - -- item_id - -- delete from acs_permissions - -- where object_id = p_task_id; - delete from pm_tasks_revisions where task_revision_id in (select revision_id from pm_tasks_revisionsx where item_id = p_task_id); 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 -r1.17 -r1.18 --- openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-table-create.sql 26 Jan 2004 15:39:40 -0000 1.17 +++ openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-table-create.sql 26 Feb 2004 15:15:40 -0000 1.18 @@ -1,7 +1,6 @@ -- TODO: -- -- need to add in workflow (for status among other things) --- add categories to projects -- -- packages/project-manager/sql/postgresql/project-manager-table-create.sql @@ -23,8 +22,8 @@ description varchar(100), -- closed or open status_type char(1) default 'c' - constraint pm_projects_status_type_ck - check (status_type in ('c','o')) + constraint pm_projects_status_type_ck + check (status_type in ('c','o')) ); insert into pm_project_status (status_id, description, status_type) values @@ -33,27 +32,29 @@ (2, 'Closed', 'c'); +-- project revisions, items are kept in cr_items + create table pm_projects ( - project_id integer - constraint project_manager_id_fk - references cr_revisions on delete cascade - constraint pm_projects_id_pk - primary key, - -- a user-specified project code - project_code varchar(255), - goal varchar(4000), - planned_start_date timestamptz, - planned_end_date timestamptz, - actual_start_date timestamptz, - actual_end_date timestamptz, + project_id integer + constraint pm_proj_rev_fk + references cr_revisions on delete cascade + constraint pm_proj_rev_pk + primary key, + -- a user-specified project code + project_code varchar(255), + goal varchar(4000), + planned_start_date timestamptz, + planned_end_date timestamptz, + actual_start_date timestamptz, + actual_end_date timestamptz, status_id integer constraint pm_projects_status_id_nn not null constraint pm_projects_status_id_fk references pm_project_status, - ongoing_p char(1) default 'f' - constraint pm_projects_ongoing_p_ck - check (ongoing_p in ('t','f')), + ongoing_p char(1) default 'f' + constraint pm_projects_ongoing_p_ck + check (ongoing_p in ('t','f')), -- denormalized, computed values -- these are computed but stored in projects table for efficient -- access. @@ -67,16 +68,19 @@ -- create the content type select content_type__create_type ( - 'pm_project', -- content_type - 'content_revision', -- supertype - 'Project', -- pretty_name - 'Projects', -- pretty_plural - 'pm_projects', -- table_name - 'project_id', -- id_column - 'pm_project__name' -- name_method + 'pm_project', -- content_type + 'content_revision', -- supertype + 'Project', -- pretty_name + 'Projects', -- pretty_plural + 'pm_projects', -- table_name + 'project_id', -- id_column + 'pm_project__name' -- name_method ); +-- other fields are added in too. See the -custom script. + + -- ROLES create sequence pm_role_seq start 4; @@ -106,7 +110,6 @@ insert into pm_roles (role_id, one_line, description, sort_order) values ('1','Lead','Team members who are responsible for the completion of the project','10'); insert into pm_roles (role_id, one_line, description, sort_order) values ('2','Player','A person on the team responsible for completion of the project','20'); - insert into pm_roles (role_id, one_line, description, sort_order, is_observer_p) values ('3','Watcher','A person interested in developments, possibly helping out on it.','30','t'); @@ -131,7 +134,7 @@ create table pm_project_assignment ( project_id integer - constraint pm_project_role_map_project_fk + constraint pm_proj_role_map_project_fk references pm_projects on delete cascade, role_id integer @@ -157,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 ( @@ -166,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 ); @@ -206,7 +231,7 @@ -- create the content type select content_type__create_type ( 'pm_task', -- content_type - 'content_revision', -- supertype + 'content_revision', -- supertype 'Task', -- pretty_name 'Tasks', -- pretty_plural 'pm_tasks_revisions', -- table_name (should this be pm_task?) @@ -428,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 check (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 -r1.2 -r1.3 --- openacs-4/contrib/packages/project-manager/tcl/project-procs-postgresql.xql 4 Sep 2003 22:45:22 -0000 1.2 +++ openacs-4/contrib/packages/project-manager/tcl/project-procs-postgresql.xql 26 Feb 2004 15:15:41 -0000 1.3 @@ -1,8 +1,49 @@ - 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 ( + :project_name, + :project_code, + :parent_id, + :goal, + :description, + to_timestamp(:planned_start_date,'YYYY MM DD HH24 MI SS'), + to_timestamp(:planned_end_date,'YYYY MM DD HH24 MI SS'), + null, + null, + :ongoing_p, + :status_id, + :organization_id, + current_timestamp, + :creation_user, + :creation_ip, + :package_id + ); + + + select 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 -r1.4 -r1.5 --- openacs-4/contrib/packages/project-manager/tcl/project-procs.tcl 26 Jan 2004 15:39:40 -0000 1.4 +++ openacs-4/contrib/packages/project-manager/tcl/project-procs.tcl 26 Feb 2004 15:15:41 -0000 1.5 @@ -12,6 +12,48 @@ 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 ""} + {-parent_id ""} + {-goal ""} + {-description ""} + {-planned_start_date ""} + {-planned_end_date ""} + {-actual_start_date ""} + {-actual_end_date ""} + {-ongoing_p "f"} + -status_id:required + -organization_id:required + {-creation_date ""} + -creation_user:required + -creation_ip:required + -package_id:required +} { + + set return_val [db_exec_plsql new_project_item { *SQL }] + + return $return_val +} + ad_proc -public project_manager::project::latest_start { end_date_j hours_to_complete 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 -r1.2 -r1.3 --- openacs-4/contrib/packages/project-manager/tcl/task-procs-postgresql.xql 26 Jan 2004 15:39:40 -0000 1.2 +++ openacs-4/contrib/packages/project-manager/tcl/task-procs-postgresql.xql 26 Feb 2004 15:15:41 -0000 1.3 @@ -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, + coalesce (:creation_date,current_timestamp), + :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 -r1.2 -r1.3 --- openacs-4/contrib/packages/project-manager/tcl/task-procs.tcl 26 Jan 2004 15:39:40 -0000 1.2 +++ openacs-4/contrib/packages/project-manager/tcl/task-procs.tcl 26 Feb 2004 15:15:41 -0000 1.3 @@ -12,6 +12,47 @@ 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_manager::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/add-edit-2-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/add-edit-2-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/contrib/packages/project-manager/www/add-edit-2-postgresql.xql 26 Jan 2004 15:39:40 -0000 1.2 +++ openacs-4/contrib/packages/project-manager/www/add-edit-2-postgresql.xql 26 Feb 2004 15:15:41 -0000 1.3 @@ -6,8 +6,7 @@ p.item_id as project_item_id, p.project_id, p.title as project_name, - p.description, - p.customer_id + p.description FROM pm_projectsx p WHERE @@ -19,7 +18,7 @@ UPDATE pm_projects set - customer_id = :customer_id + WHERE project_id = :project_id Index: openacs-4/contrib/packages/project-manager/www/add-edit-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/add-edit-2.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/contrib/packages/project-manager/www/add-edit-2.tcl 26 Jan 2004 15:39:40 -0000 1.2 +++ openacs-4/contrib/packages/project-manager/www/add-edit-2.tcl 26 Feb 2004 15:15:41 -0000 1.3 @@ -68,11 +68,6 @@ {value $description} } - {customer_id:text(select),optional - {label "Customer"} - {options {{"--- TBD ---" ""} [db_list_of_lists get_customer "select o.name, o.organization_id from organizations o order by o.name"]}} - } - } \ -select_query_name project_query \ -on_submit { Index: openacs-4/contrib/packages/project-manager/www/add-edit-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/add-edit-postgresql.xql,v diff -u -r1.10 -r1.11 --- openacs-4/contrib/packages/project-manager/www/add-edit-postgresql.xql 11 Dec 2003 21:39:44 -0000 1.10 +++ openacs-4/contrib/packages/project-manager/www/add-edit-postgresql.xql 26 Feb 2004 15:15:41 -0000 1.11 @@ -2,23 +2,23 @@ - SELECT - p.item_id as project_item_id, - p.parent_id, - p.project_id, - p.title as project_name, - p.project_code, - p.goal, - p.description, - p.status_id, - to_char(p.planned_start_date,'YYYY MM DD') as planned_start_date, - to_char(p.planned_end_date,'YYYY MM DD') as planned_end_date, - p.ongoing_p - FROM - pm_projectsx p - WHERE - p.item_id = :project_item_id and - p.project_id = :project_id + SELECT + p.item_id as project_item_id, + p.parent_id, + p.project_id, + p.title as project_name, + p.project_code, + p.goal, + p.description, + p.status_id, + to_char(p.planned_start_date,'YYYY MM DD') as planned_start_date, + to_char(p.planned_end_date,'YYYY MM DD') as planned_end_date, + p.ongoing_p + FROM + pm_projectsx p + WHERE + p.item_id = :project_item_id and + p.project_id = :project_id @@ -34,7 +34,6 @@ select pm_project__new_project_item ( - :project_id, :project_name, :project_code, :parent_id, @@ -69,6 +68,7 @@ null, :ongoing_p, :status_id, + :customer_id, now(), :user_id, :peeraddr, Index: openacs-4/contrib/packages/project-manager/www/add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/add-edit.tcl,v diff -u -r1.14 -r1.15 --- openacs-4/contrib/packages/project-manager/www/add-edit.tcl 26 Jan 2004 15:39:40 -0000 1.14 +++ openacs-4/contrib/packages/project-manager/www/add-edit.tcl 26 Feb 2004 15:15:41 -0000 1.15 @@ -10,7 +10,6 @@ @return title Page title. } { - project_id:integer,optional {project_revision_id ""} {project_item_id ""} @@ -19,6 +18,7 @@ {parent_id ""} {goal ""} {description ""} + {customer_id ""} {planned_start_date ""} {planned_end_date ""} {deadline_scheduling ""} @@ -68,11 +68,11 @@ {parent_id:text(hidden) {value $parent_id} } - + {project_item_id:text(hidden) {value $project_item_id} } - + {project_name:text {label "[set project_term] name"} {value $project_name} @@ -84,6 +84,11 @@ {value $description} {html { rows 5 cols 40 wrap soft}}} + {customer_id:text(select),optional + {label "Customer"} + {options {{"--- TBD ---" ""} [db_list_of_lists get_customer "select o.name, o.organization_id from organizations o order by o.name"]}} + } + {planned_start_date:date,to_sql(linear_date) {label "Starts"} {format "MONTH DD YYYY"} @@ -154,18 +159,43 @@ } + + ad_form -extend -name add_edit \ -select_query_name project_query \ -on_submit { + set user_id [ad_conn user_id] set peeraddr [ad_conn peeraddr] } -new_data { - set project_id [db_exec_plsql new_project_item { *SQL* }] + + + set project_id [project_manager::project::new \ + -project_name $project_name \ + -project_code $project_code \ + -parent_id $parent_id \ + -goal $goal \ + -description $description \ + -planned_start_date $planned_start_date \ + -planned_end_date $planned_end_date \ + -actual_start_date "" \ + -actual_end_date "" \ + -ongoing_p $ongoing_p \ + -status_id $status_id \ + -organization_id $customer_id \ + -creation_date "" \ + -creation_user $user_id \ + -creation_ip $peeraddr \ + -package_id $package_id + ] + set project_item_id [db_string get_item_id { }] - category::map_object -remove_old -object_id $project_item_id $category_ids + if {[exists_and_not_null category_ids]} { + category::map_object -remove_old -object_id $project_item_id $category_ids + } if {$use_project_customizations_p} { ad_returnredirect "add-edit-2?[export_url_vars project_item_id project_id]" @@ -177,18 +207,22 @@ } -edit_data { +ns_log Notice "edit" set project_id [db_exec_plsql new_project_revision { *SQL* }] project_manager::project::compute_parent_status $project_item_id category::map_object -remove_old -object_id $project_item_id $category_ids } -after_submit { - + +ns_log Notice "after_submit" if {$use_project_customizations_p} { ad_returnredirect "add-edit-2?[export_url_vars project_id]" ad_script_abort } else { ad_returnredirect "one?[export_url_vars project_id]" ad_script_abort } - } +} + +ns_log Notice "end of it all" 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 -r1.10 -r1.11 --- openacs-4/contrib/packages/project-manager/www/index-postgresql.xql 26 Jan 2004 15:39:40 -0000 1.10 +++ openacs-4/contrib/packages/project-manager/www/index-postgresql.xql 26 Feb 2004 15:15:41 -0000 1.11 @@ -5,7 +5,7 @@ SELECT - p.item_id, + p.item_id as project_item_id, p.project_id, p.parent_id as folder_id, p.object_type as content_type, @@ -16,17 +16,36 @@ 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, to_char(p.earliest_finish_date, 'MM/DD/YY') as earliest_finish_date, to_char(p.latest_finish_date, 'MM/DD/YY') as latest_finish_date, - o.name as customer_name - FROM pm_projectsx p LEFT JOIN organizations o ON p.customer_id = o.organization_id LEFT JOIN (select om.category_id, om.object_id, t.name as category_name from category_object_map om, category_translations t, categories ctg where om.category_id = t.category_id and ctg.category_id = t.category_id and ctg.deprecated_p = 'f') c ON p.item_id = c.object_id, + case when o.name is null then '--no customer--' else o.name end as customer_name, + o.organization_id + FROM pm_projectsx p + LEFT JOIN organizations o ON p.customer_id = o.organization_id + LEFT JOIN ( + select + om.category_id, + om.object_id, + t.name as category_name + from + category_object_map om, + category_translations t, + categories ctg + where + om.category_id = t.category_id and + ctg.category_id = t.category_id and + ctg.deprecated_p = 'f') + c ON p.item_id = c.object_id, cr_items i, pm_project_status s - WHERE p.project_id = i.live_revision and - s.status_id = p.status_id + WHERE + p.project_id = i.live_revision and + s.status_id = p.status_id [template::list::filter_where_clauses -and -name projects] [template::list::orderby_clause -orderby -name projects] 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}] } 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 -r1.21 -r1.22 --- openacs-4/contrib/packages/project-manager/www/one-postgresql.xql 26 Jan 2004 15:39:40 -0000 1.21 +++ openacs-4/contrib/packages/project-manager/www/one-postgresql.xql 26 Feb 2004 15:15:41 -0000 1.22 @@ -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, @@ -102,7 +106,7 @@ t.estimated_hours_work_max, t.actual_hours_worked FROM - (select * from pm_tasks_revisionsx LEFT JOIN pm_task_assignment ON item_id = task_id) t LEFT JOIN all_users u ON t.party_id = u.party_id, cr_items i LEFT JOIN pm_task_dependency d ON i.item_id = d.task_id + (select * from pm_tasks_revisionsx LEFT JOIN pm_task_assignment ON item_id = task_id) t LEFT JOIN persons u ON t.party_id = u.person_id, cr_items i LEFT JOIN pm_task_dependency d ON i.item_id = d.task_id WHERE t.parent_id = :project_item_id and t.revision_id = i.live_revision @@ -150,6 +154,13 @@ + SELECT + p.customer_id + FROM + pm_projectsx p + LEFT JOIN organizations c ON p.customer_id = c.organization_id + WHERE + p.project_id = :original_project_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 -r1.29 -r1.30 --- openacs-4/contrib/packages/project-manager/www/one.adp 26 Jan 2004 15:39:40 -0000 1.29 +++ openacs-4/contrib/packages/project-manager/www/one.adp 26 Feb 2004 15:15:41 -0000 1.30 @@ -2,7 +2,7 @@ -@project_term@ #@project_item_id@: @project.project_name@ +@project_term@ #@project_item_id@: @project.project_name;noquote@ @context_bar;noquote@ @@ -76,17 +76,32 @@ Earliest finish - @project.earliest_finish_date@ + + @project.earliest_finish_date@ + + + Ongoing + Deadline - @project.planned_end_date@ + + @project.planned_end_date@ + + + Ongoing + Latest finish - @project.latest_finish_date@ + + @project.latest_finish_date@ + + + Ongoing + @@ -97,10 +112,31 @@ +

    + +

    + + + + +
    Project information
    + + + + + +
    Customer@custom.customer_name@
    +
    + + +

    + + + @@ -123,26 +159,15 @@
    Categories
    -

    - - - - - -
    Project information
    - - - -

    Add subproject

    Subprojects: - People: - + 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 -r1.28 -r1.29 --- openacs-4/contrib/packages/project-manager/www/one.tcl 26 Jan 2004 15:39:40 -0000 1.28 +++ openacs-4/contrib/packages/project-manager/www/one.tcl 26 Feb 2004 15:15:41 -0000 1.29 @@ -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" @@ -360,6 +358,8 @@ db_1row custom_query { } -column_array custom + + # end of customizations 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 -r1.2 -r1.3 --- openacs-4/contrib/packages/project-manager/www/process-add-edit.tcl 26 Jan 2004 15:39:40 -0000 1.2 +++ openacs-4/contrib/packages/project-manager/www/process-add-edit.tcl 26 Feb 2004 15:15:41 -0000 1.3 @@ -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-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-add-edit-postgresql.xql,v diff -u -r1.13 -r1.14 --- openacs-4/contrib/packages/project-manager/www/task-add-edit-postgresql.xql 26 Jan 2004 15:39:40 -0000 1.13 +++ openacs-4/contrib/packages/project-manager/www/task-add-edit-postgresql.xql 26 Feb 2004 15:15:41 -0000 1.14 @@ -19,26 +19,6 @@ - - - select pm_task__new_task_item ( - null, - :project_item_id, - :p_task_title, - :p_description, - [project_manager::project::util::datenvl -value [set end_date_$i] -value_if_null "null," -value_if_not_null "to_timestamp('[set end_date_$i]','YYYY MM DD HH24 MI SS'),"] - '0', - :p_work, - :p_work_min, - :p_work_max, - current_timestamp, - :user_id, - :peeraddr, - :package_id - ); - - - select pm_task__new_task_revision ( 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 -r1.25 -r1.26 --- openacs-4/contrib/packages/project-manager/www/task-add-edit.tcl 26 Jan 2004 15:39:40 -0000 1.25 +++ openacs-4/contrib/packages/project-manager/www/task-add-edit.tcl 26 Feb 2004 15:15:41 -0000 1.26 @@ -1,4 +1,4 @@ -set debug 1 +set debug 0 if {[string equal $debug 1]} { ns_log notice task add edit page @@ -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 ""} @@ -519,7 +519,20 @@ ns_log Notice "adding task: pii: $project_item_id tt:$p_task_title d:$p_description ed: end_date($i) w:$p_work m:$p_work_min mx:$p_work_max dep_type:$p_dep_type dep_id:$p_dep_id" # add in the new task - set this_revision_id [db_exec_plsql new_task_item { *SQL* }] + set this_revision_id [project_manager::task::new \ + -project_id $project_item_id \ + -title $p_task_title \ + -description $p_description \ + -end_date [project_manager::project::util::datenvl -value [set end_date_$i] -value_if_null "" -value_if_not_null "to_timestamp('[set end_date_$i]','YYYY MM DD HH24 MI SS')"] \ + -percent_complete "0" \ + -estimated_hours_work $p_work \ + -estimated_hours_work_min $p_work_min \ + -estimated_hours_work_max $p_work_max \ + -creation_user $user_id \ + -creation_ip $peeraddr \ + -package_id $package_id + ] + set this_task_id [db_string get_task_item_id {}] set dep_task_id($i) $this_task_id Index: openacs-4/contrib/packages/project-manager/www/task-one-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-one-postgresql.xql,v diff -u -r1.17 -r1.18 --- openacs-4/contrib/packages/project-manager/www/task-one-postgresql.xql 26 Jan 2004 15:39:40 -0000 1.17 +++ openacs-4/contrib/packages/project-manager/www/task-one-postgresql.xql 26 Feb 2004 15:15:41 -0000 1.18 @@ -53,13 +53,17 @@ t.estimated_hours_work_min, t.estimated_hours_work_max, t.percent_complete, - i.live_revision + i.live_revision, + p.first_names || ' ' || p.last_name as creation_user FROM - pm_tasks_revisionsx t, cr_items i + pm_tasks_revisionsx t, + cr_items i, + persons p WHERE t.item_id = :task_id and t.revision_id = :task_revision_id and - t.item_id = i.item_id + t.item_id = i.item_id and + t.creation_user = p.person_id @@ -70,17 +74,18 @@ t.revision_id, i.live_revision, t.title as task_title, - t.description, + t.description || ' -- ' || p.first_names || ' ' || p.last_name as description, to_char(t.end_date,'MM/DD/YYYY') as end_date, t.percent_complete, t.estimated_hours_work_min, t.estimated_hours_work_max, t.actual_hours_worked FROM - pm_tasks_revisionsx t, cr_items i + pm_tasks_revisionsx t, cr_items i, persons p WHERE t.item_id = :task_id and - t.item_id = i.item_id + t.item_id = i.item_id and + t.creation_user = p.person_id [template::list::orderby_clause -name revisions -orderby] Index: openacs-4/contrib/packages/project-manager/www/task-one.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-one.adp,v diff -u -r1.21 -r1.22 --- openacs-4/contrib/packages/project-manager/www/task-one.adp 26 Jan 2004 15:39:40 -0000 1.21 +++ openacs-4/contrib/packages/project-manager/www/task-one.adp 26 Feb 2004 15:15:41 -0000 1.22 @@ -28,6 +28,8 @@ Description @task_info.description;noquote@ + +-- @task_info.creation_user@