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.10 -r1.10.2.1 --- openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-drop.sql 15 Sep 2003 23:09:56 -0000 1.10 +++ openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-drop.sql 4 Dec 2003 21:00:13 -0000 1.10.2.1 @@ -1,151 +1,159 @@ --- packages/project-manager/sql/project-manager-drop.sql --- drop script --- --- @author jade@bread.com --- @creation-date 2003-05-15 --- @cvs-id $Id$ --- - --------- --- TASKS --------- - --- 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; - -------------- --- WORKGROUPS -------------- - -drop sequence pm_workgroup_seq; -drop table pm_workgroup_parties; -drop table pm_workgroup; - ------------- --- PROCESSES ------------- - -drop sequence pm_process_seq; -drop sequence pm_process_task_seq; -drop sequence pm_process_task_dependency_seq; - -drop table pm_process_task_assignment; -drop table pm_process_task_dependency; -drop table pm_process_task; -drop table pm_process; - ---------- --- OTHERS ---------- -drop table pm_default_roles; -drop table pm_project_assignment; -drop table pm_task_assignment; -drop table pm_roles; -drop sequence pm_role_seq; - - -create function inline_0 () -returns integer as ' -declare - v_item RECORD; - -begin - for v_item in select - item_id - from - cr_items - where - content_type = ''pm_task'' - LOOP - PERFORM pm_task__delete_task_item(v_item.item_id); - end loop; - - return 0; -end; -' language 'plpgsql'; - -select inline_0(); -drop function inline_0(); - -select drop_package('pm_task'); - - ------------ --- PROJECTS ------------ - ---drop permissions -delete from acs_permissions where object_id in (select project_id from pm_projects); - --- 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 - - -- delete all contents of projects folder - FOR v_item_cursor IN - select - item_id - from - cr_items - where - content_type = ''pm_project'' - LOOP - 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 - ); - - -- this table must not hold reference to ''pm_project'' type - delete from cr_folder_type_map where content_type = ''pm_project''; - - -- delete projects folder - PERFORM content_folder__delete(v_folder_id); - - -- delete the content folders - FOR v_item_cursor IN - select f.folder_id - from cr_folders f, - cr_items i - where f.folder_id = i.item_id and - description = ''Project Repository'' - LOOP - PERFORM content_item__delete(v_item_cursor.folder_id); - END LOOP; - - return 0; -end; -' language 'plpgsql'; - -select inline_0(); -drop function inline_0(); - --- drop package, which drops all functions created with define_function_args -select drop_package('pm_project'); - ---drop table -drop table pm_projects cascade; - -select content_type__drop_type('pm_task', 't', 'f'); - -drop table pm_tasks cascade; -drop table pm_tasks_revisions cascade; - -select content_type__drop_type('pm_project', 't', 'f'); - --- note that the Project Repository folder is not deleted - +-- packages/project-manager/sql/project-manager-drop.sql +-- drop script +-- +-- @author jade@bread.com +-- @creation-date 2003-05-15 +-- @cvs-id $Id$ +-- + +-------- +-- TASKS +-------- + +-- 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; + +------------- +-- WORKGROUPS +------------- + +drop sequence pm_workgroup_seq; +drop table pm_workgroup_parties; +drop table pm_workgroup; + +------------ +-- PROCESSES +------------ + +drop sequence pm_process_seq; +drop sequence pm_process_task_seq; +drop sequence pm_process_task_dependency_seq; + +drop table pm_process_task_assignment; +drop table pm_process_task_dependency; +drop table pm_process_task; +drop table pm_process; + +--------- +-- OTHERS +--------- +drop table pm_default_roles; +drop table pm_project_assignment; +drop table pm_task_assignment; +drop table pm_roles; +drop sequence pm_role_seq; + + +create function inline_0 () +returns integer as ' +declare + v_item RECORD; + +begin + for v_item in select + item_id + from + cr_items + where + content_type = ''pm_task'' + LOOP + PERFORM pm_task__delete_task_item(v_item.item_id); + end loop; + + return 0; +end; +' language 'plpgsql'; + +select inline_0(); +drop function inline_0(); + +select drop_package('pm_task'); + + +----------- +-- PROJECTS +----------- + +--drop permissions +delete from acs_permissions where object_id in (select project_id from pm_projects); + +-- 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 + + -- delete all contents of projects folder + FOR v_item_cursor IN + select + item_id + from + cr_items + where + content_type = ''pm_project'' + LOOP + 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 + ); + + -- this table must not hold reference to ''pm_project'' type + delete from cr_folder_type_map where content_type = ''pm_project''; + + -- delete projects folder + PERFORM content_folder__delete(v_folder_id); + + -- delete the content folders + FOR v_item_cursor IN + select f.folder_id + from cr_folders f, + cr_items i + where f.folder_id = i.item_id and + description = ''Project Repository'' + LOOP + PERFORM content_item__delete(v_item_cursor.folder_id); + END LOOP; + + return 0; +end; +' language 'plpgsql'; + +select inline_0(); +drop function inline_0(); + +-- drop package, which drops all functions created with define_function_args +select drop_package('pm_project'); + +--drop table +drop table pm_projects cascade; + +drop sequence pm_project_status_seq; +drop table pm_project_status; + +drop table pm_project_category_map; + +drop sequence pm_project_category_seq; +drop table pm_project_category; + +select content_type__drop_type('pm_task', 't', 'f'); + +drop table pm_tasks cascade; +drop table pm_tasks_revisions cascade; + +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.8 -r1.8.2.1 --- openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-functions-create.sql 29 Aug 2003 00:35:35 -0000 1.8 +++ openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-functions-create.sql 4 Dec 2003 21:00:13 -0000 1.8.2.1 @@ -36,30 +36,30 @@ create function pm_project__new_root_folder (integer) returns integer as ' declare - p_package_id alias for $1; + p_package_id alias for $1; - v_folder_id cr_folders.folder_id%TYPE; - v_folder_name cr_items.name%TYPE; + v_folder_id cr_folders.folder_id%TYPE; + v_folder_name cr_items.name%TYPE; begin -- raise notice ''in new root folder''; - -- Set the folder name - v_folder_name := pm_project__new_unique_name (p_package_id); + -- Set the folder name + v_folder_name := pm_project__new_unique_name (p_package_id); - v_folder_id := content_folder__new ( - v_folder_name, -- name - ''Projects'', -- label - ''Project Repository'', -- description - null -- parent_id - ); + v_folder_id := content_folder__new ( + v_folder_name, -- name + ''Projects'', -- label + ''Project Repository'', -- description + null -- parent_id + ); - -- Register the standard content types + -- Register the standard content types PERFORM content_folder__register_content_type ( v_folder_id, -- folder_id ''pm_project'', -- content_type ''f'' -- include_subtypes - ); + ); -- there is no facility in the API for adding in the package_id, -- so we have to do it ourselves @@ -68,9 +68,9 @@ set package_id = p_package_id where folder_id = v_folder_id; - -- TODO: Handle Permissions here for this folder. + -- TODO: Handle Permissions here for this folder. - return v_folder_id; + return v_folder_id; end;' language 'plpgsql'; @@ -83,32 +83,32 @@ create function pm_project__get_root_folder (integer, boolean) returns integer as ' declare - p_package_id alias for $1; + p_package_id alias for $1; p_create_if_not_present_p alias for $2; - v_folder_id cr_folders.folder_id%TYPE; - v_count integer; + v_folder_id cr_folders.folder_id%TYPE; + v_count integer; begin -- raise notice ''in get root folder p_create_if_not_present_p = %'',p_create_if_not_present_p; - select count(*) into v_count - from cr_folders - where package_id = p_package_id; + select count(*) into v_count + from cr_folders + where package_id = p_package_id; -- raise notice ''count is % for package_id %'', v_count, p_package_id; - if v_count > 1 then + if v_count > 1 then raise exception ''More than one project repository for this application instance''; - elsif v_count = 1 then + elsif v_count = 1 then select folder_id into v_folder_id from cr_folders where package_id = p_package_id; - else + else if p_create_if_not_present_p = true then - -- Must be a new instance. Create a new root folder. + -- Must be a new instance. Create a new root folder. raise notice ''creating a new root repository folder''; - v_folder_id := pm_project__new_root_folder(p_package_id); + v_folder_id := pm_project__new_root_folder(p_package_id); else -- raise notice ''setting to null''; v_folder_id := null; @@ -117,7 +117,7 @@ -- raise notice ''v_folder_id is %'', v_folder_id; - return v_folder_id; + return v_folder_id; end; ' language 'plpgsql'; @@ -130,49 +130,51 @@ -- 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, creation_date, creation_user, creation_ip, package_id'); +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'); create function pm_project__new_project_item ( - integer, -- project_id - varchar, -- project_name - varchar, -- project_code - integer, -- parent_id - varchar, -- goal - varchar, -- description - timestamptz, -- planned_start_date - timestamptz, -- planned_end_date - timestamptz, -- actual_start_date - timestamptz, -- actual_end_date - char(1), -- ongoing_p - timestamptz, -- creation_date - integer, -- creation_user - varchar, -- creation_ip - integer -- package_id + integer, -- project_id + varchar, -- project_name + varchar, -- project_code + integer, -- parent_id + varchar, -- goal + varchar, -- description + timestamptz, -- planned_start_date + timestamptz, -- planned_end_date + timestamptz, -- actual_start_date + timestamptz, -- actual_end_date + char(1), -- ongoing_p + integer, -- status_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_creation_date alias for $12; - p_creation_user alias for $13; - p_creation_ip alias for $14; - p_package_id alias for $15; + 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_creation_date alias for $13; + p_creation_user alias for $14; + p_creation_ip alias for $15; + p_package_id alias for $16; - v_item_id cr_items.item_id%TYPE; - v_revision_id cr_revisions.revision_id%TYPE; - v_id cr_items.item_id%TYPE; - v_parent_id cr_items.parent_id%TYPE; + v_item_id cr_items.item_id%TYPE; + v_revision_id cr_revisions.revision_id%TYPE; + v_id cr_items.item_id%TYPE; + v_parent_id cr_items.parent_id%TYPE; begin - select acs_object_id_seq.nextval into v_id from dual; + select acs_object_id_seq.nextval into v_id from dual; v_parent_id := pm_project__get_root_folder (p_package_id, ''t''); @@ -185,64 +187,64 @@ -- raise notice ''v_parent_id (%) p_parent_id (%)'', v_parent_id, p_parent_id; - v_item_id := content_item__new ( - v_id::varchar, -- name - v_parent_id, -- parent_id - v_id, -- item_id - null, -- locale - now(), -- creation_date - p_creation_user, -- creation_user - p_parent_id, -- context_id - p_creation_ip, -- creation_ip - ''content_item'', -- item_subtype - ''pm_project'', -- content_type - p_project_name, -- title - p_description, -- description - ''text/plain'', -- mime_type - null, -- nls_language - null -- data - ); + v_item_id := content_item__new ( + v_id::varchar, -- name + v_parent_id, -- parent_id + v_id, -- item_id + null, -- locale + now(), -- creation_date + p_creation_user, -- creation_user + p_parent_id, -- context_id + p_creation_ip, -- creation_ip + ''content_item'', -- item_subtype + ''pm_project'', -- content_type + p_project_name, -- title + p_description, -- description + ''text/plain'', -- mime_type + null, -- nls_language + null -- data + ); - v_revision_id := content_revision__new ( - p_project_name, -- title - p_description, -- description - now(), -- publish_date - ''text/plain'', -- mime_type - NULL, -- nls_language - NULL, -- data - v_item_id, -- item_id - NULL, -- revision_id - now(), -- creation_date - p_creation_user, -- creation_user - p_creation_ip -- creation_ip - ); + v_revision_id := content_revision__new ( + p_project_name, -- title + p_description, -- description + now(), -- publish_date + ''text/plain'', -- mime_type + NULL, -- nls_language + NULL, -- data + v_item_id, -- item_id + NULL, -- revision_id + now(), -- creation_date + p_creation_user, -- creation_user + p_creation_ip -- creation_ip + ); - PERFORM content_item__set_live_revision (v_revision_id); + PERFORM content_item__set_live_revision (v_revision_id); - insert into pm_projects ( - project_id, project_code, - goal, planned_start_date, - planned_end_date, actual_start_date, actual_end_date, - ongoing_p, estimated_finish_date, + insert into pm_projects ( + project_id, project_code, + goal, planned_start_date, + planned_end_date, actual_start_date, actual_end_date, + ongoing_p, estimated_finish_date, earliest_finish_date, latest_finish_date, actual_hours_completed, - estimated_hours_total) - 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, + estimated_hours_total, status_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'' + ''0'', p_status_id ); - PERFORM acs_permission__grant_permission( - v_revision_id, - p_creation_user, - ''admin'' - ); + PERFORM acs_permission__grant_permission( + v_revision_id, + p_creation_user, + ''admin'' + ); - return v_revision_id; + return v_revision_id; end;' language 'plpgsql'; @@ -253,13 +255,13 @@ create or replace function pm_project__delete_project_item (integer) returns integer as ' declare - p_project_id alias for $1; + p_project_id alias for $1; v_child cr_items%ROWTYPE; begin raise NOTICE ''Deleting pm_project...''; - delete from acs_permissions - where object_id = p_project_id; + delete from acs_permissions + where object_id = p_project_id; for v_child in select item_id @@ -272,90 +274,92 @@ 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 = 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, 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, creation_date, creation_user, creation_ip, package_id'); create function pm_project__new_project_revision ( - integer, -- item_id - varchar, -- project_name - varchar, -- project_code - integer, -- parent_id - varchar, -- goal - varchar, -- description - timestamptz, -- planned_start_date - timestamptz, -- planned_end_date - timestamptz, -- actual_start_date - timestamptz, -- actual_end_date - char(1), -- ongoing_p - timestamptz, -- creation_date - integer, -- creation_user - varchar, -- creation_ip + integer, -- item_id + varchar, -- project_name + varchar, -- project_code + integer, -- parent_id + varchar, -- goal + varchar, -- description + timestamptz, -- planned_start_date + timestamptz, -- planned_end_date + timestamptz, -- actual_start_date + timestamptz, -- actual_end_date + char(1), -- ongoing_p + integer, -- status_id + timestamptz, -- creation_date + integer, -- creation_user + varchar, -- creation_ip integer -- package_id ) returns integer as ' declare - p_item_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_creation_date alias for $12; - p_creation_user alias for $13; - p_creation_ip alias for $14; - p_package_id alias for $15; + p_item_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_creation_date alias for $13; + p_creation_user alias for $14; + p_creation_ip alias for $15; + p_package_id alias for $16; - v_revision_id cr_revisions.revision_id%TYPE; + v_revision_id cr_revisions.revision_id%TYPE; begin -- the item_id is the project_id - v_revision_id := content_revision__new ( - p_project_name, -- title - p_description, -- description - now(), -- publish_date - ''text/plain'', -- mime_type - NULL, -- nls_language - NULL, -- data - p_item_id, -- item_id - NULL, -- revision_id - now(), -- creation_date - p_creation_user, -- creation_user - p_creation_ip -- creation_ip - ); + v_revision_id := content_revision__new ( + p_project_name, -- title + p_description, -- description + now(), -- publish_date + ''text/plain'', -- mime_type + NULL, -- nls_language + NULL, -- data + p_item_id, -- item_id + NULL, -- revision_id + now(), -- creation_date + p_creation_user, -- creation_user + p_creation_ip -- creation_ip + ); - PERFORM content_item__set_live_revision (v_revision_id); + PERFORM content_item__set_live_revision (v_revision_id); - insert into pm_projects ( - project_id, project_code, - goal, planned_start_date, - planned_end_date, actual_start_date, actual_end_date, - ongoing_p) - 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); + insert into pm_projects ( + project_id, project_code, + goal, planned_start_date, + planned_end_date, actual_start_date, actual_end_date, + ongoing_p, status_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); - PERFORM acs_permission__grant_permission( - v_revision_id, - p_creation_user, - ''admin'' - ); + PERFORM acs_permission__grant_permission( + v_revision_id, + p_creation_user, + ''admin'' + ); - return v_revision_id; + return v_revision_id; end;' language 'plpgsql'; @@ -367,23 +371,23 @@ create function pm_project__new_unique_name (integer) returns text as ' declare - p_package_id alias for $1; + p_package_id alias for $1; - v_name cr_items.name%TYPE; - v_package_key apm_packages.package_key%TYPE; - v_id integer; + v_name cr_items.name%TYPE; + v_package_key apm_packages.package_key%TYPE; + v_id integer; begin - select package_key into v_package_key from apm_packages - where package_id = p_package_id; + select package_key into v_package_key from apm_packages + where package_id = p_package_id; - select acs_object_id_seq.nextval into v_id from dual; + select acs_object_id_seq.nextval into v_id from dual; - -- Set the name - select v_package_key || ''_'' || - to_char(current_timestamp, ''YYYYMMDD'') || ''_'' || - v_id into v_name; + -- Set the name + select v_package_key || ''_'' || + to_char(current_timestamp, ''YYYYMMDD'') || ''_'' || + v_id into v_name; - return v_name; + return v_name; end;' language 'plpgsql'; ---------------------------------- @@ -421,171 +425,171 @@ 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'); create function pm_task__new_task_item ( - integer, -- task_id + integer, -- task_id integer, -- project_id varchar, -- title - varchar, -- description - timestamptz, -- end_date + varchar, -- description + timestamptz, -- end_date numeric, -- percent_complete numeric, -- estimated_hours_work numeric, -- estimated_hours_work_min numeric, -- estimated_hours_work_max, - timestamptz, -- creation_date - integer, -- creation_user - varchar, -- creation_ip - integer -- package_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_project_id alias for $2; p_title alias for $3; - p_description alias for $4; - p_end_date alias for $5; + 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_creation_date alias for $10; - p_creation_user alias for $11; - p_creation_ip alias for $12; - p_package_id alias for $13; + 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; - v_id cr_items.item_id%TYPE; + v_item_id cr_items.item_id%TYPE; + v_revision_id cr_revisions.revision_id%TYPE; + v_id cr_items.item_id%TYPE; v_task_number integer; begin - select acs_object_id_seq.nextval into v_id from dual; + select acs_object_id_seq.nextval into v_id from dual; -- We want to put the task under the project item -- create the task_number - v_item_id := content_item__new ( - v_id::varchar, -- name - p_project_id, -- parent_id - v_id, -- item_id - null, -- locale - now(), -- creation_date - p_creation_user, -- creation_user + v_item_id := content_item__new ( + v_id::varchar, -- name + p_project_id, -- parent_id + v_id, -- item_id + null, -- locale + now(), -- creation_date + p_creation_user, -- creation_user p_package_id, -- context_id - p_creation_ip, -- creation_ip - ''content_item'', -- item_subtype - ''pm_task'', -- content_type - p_title, -- title - p_description, -- description - ''text/plain'', -- mime_type - null, -- nls_language - null -- data - ); + p_creation_ip, -- creation_ip + ''content_item'', -- item_subtype + ''pm_task'', -- content_type + p_title, -- title + p_description, -- description + ''text/plain'', -- mime_type + null, -- nls_language + null -- data + ); - v_revision_id := content_revision__new ( - p_title, -- title - p_description, -- description - now(), -- publish_date - ''text/plain'', -- mime_type - NULL, -- nls_language - NULL, -- data - v_item_id, -- item_id - NULL, -- revision_id - now(), -- creation_date - p_creation_user, -- creation_user - p_creation_ip -- creation_ip - ); + v_revision_id := content_revision__new ( + p_title, -- title + p_description, -- description + now(), -- publish_date + ''text/plain'', -- mime_type + NULL, -- nls_language + NULL, -- data + v_item_id, -- item_id + NULL, -- revision_id + now(), -- creation_date + p_creation_user, -- creation_user + p_creation_ip -- creation_ip + ); - PERFORM content_item__set_live_revision (v_revision_id); + PERFORM content_item__set_live_revision (v_revision_id); - insert into pm_tasks ( + insert into pm_tasks ( task_id, task_number) - values ( + values ( v_item_id, v_task_number); 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) values ( v_revision_id, p_end_date, p_percent_complete, p_estimated_hours_work, p_estimated_hours_work_min, p_estimated_hours_work_max, ''0''); - PERFORM acs_permission__grant_permission( - v_revision_id, - p_creation_user, - ''admin'' - ); + PERFORM acs_permission__grant_permission( + v_revision_id, + p_creation_user, + ''admin'' + ); - return v_revision_id; + return v_revision_id; end;' language 'plpgsql'; select define_function_args('pm_task__new_task_revision', 'task_id, project_id, title, description, end_date, percent_complete, estimated_hours_work, estimated_hours_work_min, estimated_hours_work_max, actual_hours_worked, creation_date, creation_user, creation_ip, package_id'); create function pm_task__new_task_revision ( - integer, -- task_id (the item_id) + integer, -- task_id (the item_id) integer, -- project_id varchar, -- title - varchar, -- description - timestamptz, -- end_date + varchar, -- description + timestamptz, -- end_date numeric, -- percent_complete numeric, -- estimated_hours_work numeric, -- estimated_hours_work_min numeric, -- estimated_hours_work_max numeric, -- actual_hours_worked - timestamptz, -- creation_date - integer, -- creation_user - varchar, -- creation_ip - integer -- package_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_project_id alias for $2; p_title alias for $3; - p_description alias for $4; - p_end_date alias for $5; + 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_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_creation_date alias for $11; + p_creation_user alias for $12; + p_creation_ip alias for $13; + p_package_id alias for $14; - v_revision_id cr_revisions.revision_id%TYPE; - v_id cr_items.item_id%TYPE; + v_revision_id cr_revisions.revision_id%TYPE; + v_id cr_items.item_id%TYPE; begin - select acs_object_id_seq.nextval into v_id from dual; + select acs_object_id_seq.nextval into v_id from dual; -- We want to put the task under the project item - v_revision_id := content_revision__new ( - p_title, -- title - p_description, -- description - now(), -- publish_date - ''text/plain'', -- mime_type - NULL, -- nls_language - NULL, -- data - p_task_id, -- item_id - NULL, -- revision_id - now(), -- creation_date - p_creation_user, -- creation_user - p_creation_ip -- creation_ip - ); + v_revision_id := content_revision__new ( + p_title, -- title + p_description, -- description + now(), -- publish_date + ''text/plain'', -- mime_type + NULL, -- nls_language + NULL, -- data + p_task_id, -- item_id + NULL, -- revision_id + now(), -- creation_date + p_creation_user, -- creation_user + p_creation_ip -- creation_ip + ); - PERFORM content_item__set_live_revision (v_revision_id); + PERFORM content_item__set_live_revision (v_revision_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) 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); - PERFORM acs_permission__grant_permission( - v_revision_id, - p_creation_user, - ''admin'' - ); + PERFORM acs_permission__grant_permission( + v_revision_id, + p_creation_user, + ''admin'' + ); - return v_revision_id; + return v_revision_id; end;' language 'plpgsql'; @@ -596,15 +600,15 @@ create or replace function pm_task__delete_task_item (integer) returns integer as ' declare - p_task_id alias for $1; + 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 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); + delete from pm_tasks_revisions + where task_revision_id in (select revision_id from pm_tasks_revisionsx where item_id = p_task_id); delete from pm_tasks where task_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.15 -r1.15.2.1 --- openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-table-create.sql 3 Oct 2003 22:21:45 -0000 1.15 +++ openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-table-create.sql 4 Dec 2003 21:00:13 -0000 1.15.2.1 @@ -14,6 +14,45 @@ -- PROJECTS +create sequence pm_project_status_seq start 3; + +create table pm_project_status ( + status_id integer + constraint pm_project_status_pk + primary key, + description varchar(100), + -- closed or open + status_type char(1) default 'c' + constraint pm_projects_status_type_ck + check (status_type in ('c','o')) +); + +insert into pm_project_status (status_id, description, status_type) values +(1, 'Open', 'o'); +insert into pm_project_status (status_id, description, status_type) values +(2, 'Closed', 'c'); + +-- categories + +create sequence pm_project_category_seq start 5; + +create table pm_project_category ( + category_id integer + constraint pm_project_category_pk + primary key, + description varchar(100) +); + +insert into pm_project_category (category_id, description) values +(1, 'On the market'); +insert into pm_project_category (category_id, description) values +(2, 'Trials'); +insert into pm_project_category (category_id, description) values +(3, 'Upcoming'); +insert into pm_project_category (category_id, description) values +(4, 'R & D'); + + create table pm_projects ( project_id integer constraint project_manager_id_fk @@ -27,6 +66,11 @@ 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')), @@ -53,10 +97,20 @@ ); +create table pm_project_category_map ( + project_id integer + constraint pm_project_cm_fk + references pm_projects, + category_id integer + constraint pm_project_cm_fk + references pm_project_category +); + + -- ROLES -create sequence pm_role_seq start 3; +create sequence pm_role_seq start 4; create table pm_roles ( role_id integer @@ -78,15 +132,15 @@ or task. For example, they could be a manager, or client, or participant.. The sort order determines what order it is displayed in. The is_observer_p specifies whether they are directly - responsible for the task. People not directly responsible will not - get email notifications reminding them that tasks are overdue, for - example. + responsible for the task, or are just observers on it. '; -insert into pm_roles (role_id, one_line, description, sort_order) values ('1','Participant','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','Manager','Manages the team to complete the project or task on time and on budget.','20'); +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'); + create table pm_default_roles ( role_id integer constraint pm_default_role_fk 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.9 -r1.9.2.1 --- openacs-4/contrib/packages/project-manager/www/add-edit-postgresql.xql 18 Sep 2003 23:33:54 -0000 1.9 +++ openacs-4/contrib/packages/project-manager/www/add-edit-postgresql.xql 4 Dec 2003 21:00:13 -0000 1.9.2.1 @@ -1,5 +1,36 @@ + + + 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 + current_timestamp + FROM + pm_projects + + + select pm_project__new_project_item ( @@ -14,6 +45,7 @@ null, null, :ongoing_p, + :status_id, now(), :user_id, :peeraddr, @@ -36,6 +68,7 @@ null, null, :ongoing_p, + :status_id, now(), :user_id, :peeraddr, @@ -44,27 +77,6 @@ - - - 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, - 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 @@ -76,4 +88,15 @@ + + + SELECT + description, status_id + FROM + pm_project_status + ORDER BY + status_type desc, description asc + + + 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.12 -r1.12.2.1 --- openacs-4/contrib/packages/project-manager/www/add-edit.tcl 18 Sep 2003 23:33:54 -0000 1.12 +++ openacs-4/contrib/packages/project-manager/www/add-edit.tcl 4 Dec 2003 21:00:13 -0000 1.12.2.1 @@ -23,6 +23,7 @@ {planned_end_date ""} {deadline_scheduling ""} {ongoing_p ""} + {status_id ""} } -properties { @@ -58,87 +59,101 @@ } -ad_form -name add_edit -form { - project_id:key - - {parent_id:text(hidden) - {value $parent_id} +ad_form -name add_edit \ + -form { + project_id:key + + {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} + } + + {description:text(textarea),optional + {label "Description"} + {value $description} + {html { rows 5 cols 40 wrap soft}}} + + {planned_start_date:date,to_sql(linear_date) + {label "Starts"} + {format "MONTH DD YYYY"} + {value {[util::date acquire clock [clock scan $planned_start_date]]}} + {today} + {help} + } + + {planned_end_date:date,to_sql(linear_date) + {label "Deadline"} + {format "MONTH DD YYYY"} + {value {[util::date acquire clock [clock scan $planned_end_date]]}} + {today} + {help} + } + + {ongoing_p:text(select) + {label "Project is ongoing?"} + {options {{"No" "f"} {"Yes" "t"}} {value $ongoing_p}} + {help_text "If yes, then this project has no deadline"} + } + + {status_id:text(select) + {label "Status"} + {options {[db_list_of_lists get_status_codes { }]}} + } + } - {project_item_id:text(hidden) - {value $project_item_id} - } - {project_name:text - {label "[set project_term] name"} - {value $project_name} - } - - {description:text(textarea),optional - {label "Description"} - {value $description} - {html { rows 5 cols 40 wrap soft}}} - - {planned_start_date:date,to_sql(linear_date) - {label "Starts"} - {format "MONTH DD YYYY"} - {value {[util::date acquire clock [clock scan $planned_start_date]]}} - {today} - {help} - } - - {planned_end_date:date,to_sql(linear_date) - {label "Deadline"} - {format "MONTH DD YYYY"} - {value {[util::date acquire clock [clock scan $planned_end_date]]}} - {today} - {help} - } - - {ongoing_p:text(select) - {label "Project is ongoing?"} - {options {{"No" "f"} {"Yes" "t"}} {value $ongoing_p}} - {help_text "If yes, then this project has no deadline"} - } - -} -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_item_id [db_string get_item_id { }] - - ad_returnredirect "one?[export_url_vars project_item_id project_id]" - ad_script_abort - -} -edit_data { - - set project_id [db_exec_plsql new_project_revision { *SQL* }] - project_manager::project::compute_parent_status $project_item_id - -} -after_submit { - - ad_returnredirect "one?[export_url_vars project_id]" - ad_script_abort -} - if {$use_goal_p} { - ad_form -extend -name add_edit -form { - {goal:text(textarea),optional - {label "[set project_term] goal"} - {value $goal} - {html { rows 5 cols 40 wrap soft}}} - } + ad_form -extend -name add_edit \ + -form { + {goal:text(textarea),optional + {label "[set project_term] goal"} + {value $goal} + {html { rows 5 cols 40 wrap soft}}} + } } if {$use_project_code_p} { - ad_form -extend -name add_edit -form { - {project_code:text,optional - {label "[set project_term] code"} - {value $project_code} - } - } + ad_form -extend -name add_edit \ + -form { + {project_code:text,optional + {label "[set project_term] code"} + {value $project_code} + } + } } + + +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_item_id [db_string get_item_id { }] + + ad_returnredirect "one?[export_url_vars project_item_id project_id]" + ad_script_abort + + } -edit_data { + + set project_id [db_exec_plsql new_project_revision { *SQL* }] + project_manager::project::compute_parent_status $project_item_id + + } -after_submit { + + ad_returnredirect "one?[export_url_vars project_id]" + ad_script_abort + } 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.8 -r1.8.2.1 --- openacs-4/contrib/packages/project-manager/www/index-postgresql.xql 18 Sep 2003 01:09:14 -0000 1.8 +++ openacs-4/contrib/packages/project-manager/www/index-postgresql.xql 4 Dec 2003 21:00:13 -0000 1.8.2.1 @@ -19,10 +19,12 @@ 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 - FROM pm_projectsx p, cr_items i + FROM pm_projectsx p, cr_items i, pm_project_status s WHERE p.project_id = i.live_revision and - p.parent_id = :root_folder - ORDER BY p.title + p.parent_id = :root_folder 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.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/index.adp,v diff -u -r1.17 -r1.17.2.1 --- openacs-4/contrib/packages/project-manager/www/index.adp 8 Oct 2003 23:29:16 -0000 1.17 +++ openacs-4/contrib/packages/project-manager/www/index.adp 4 Dec 2003 21:00:13 -0000 1.17.2.1 @@ -3,33 +3,27 @@ @project_term@s -@context@ +@context;noquote@ - +
+ - - + + - - + - + - -
Processes - -  Admin pages
-
Add Project -
+ + -

+ - + + 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 -r1.9.2.1 --- openacs-4/contrib/packages/project-manager/www/index.tcl 12 Sep 2003 21:36:32 -0000 1.9 +++ openacs-4/contrib/packages/project-manager/www/index.tcl 4 Dec 2003 21:00:13 -0000 1.9.2.1 @@ -14,6 +14,9 @@ @return project_term Terminology for projects @return project_term_lower Terminology for projects (lower case) +} { + orderby_project:optional + status_id:optional } -properties { context:onevalue @@ -60,7 +63,7 @@ -key item_id \ -elements { project_name { - label "Subject" + label "Project name" link_url_col item_url link_html { title "View this project version" } } @@ -75,15 +78,38 @@ display_template "@projects.actual_hours_completed@/@projects.estimated_hours_total@" } } \ + -actions { + "Tasks" "tasks" "View list of tasks" + "Processes" "processes" "View and use processes" + "Add project" "add-edit" "Add project" + "Admin" "admin/" "Administration pages" + } \ -main_class { narrow } \ -filters { - orderby_project {} + status_id { + label "Status" + 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 + } + } + category_id { + label "Category" + values {[db_list_of_lists get_category "select description, category_id from pm_project_category order by category_id"]} + where_clause { + } + } } \ -orderby { - project_name {orderby project_name} - default_value project_name,desc + default_value project_name,asc + project_name { + label "Project name" + orderby_desc "upper(p.title) desc" + orderby_asc "upper(p.title) 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 -r1.19 -r1.19.2.1 --- openacs-4/contrib/packages/project-manager/www/one-postgresql.xql 3 Oct 2003 23:52:17 -0000 1.19 +++ openacs-4/contrib/packages/project-manager/www/one-postgresql.xql 4 Dec 2003 21:00:13 -0000 1.19.2.1 @@ -33,13 +33,13 @@ p.project_code, p.goal, p.description, - to_char(p.planned_start_date,'Mon DD') as planned_start_date, - to_char(p.planned_end_date,'Mon DD') as planned_end_date, + to_char(p.planned_start_date,'YYYY-MM-DD HH24:MI') as planned_start_date, + to_char(p.planned_end_date,'YYYY-MM-DD HH24:MI') as planned_end_date, p.ongoing_p, i.live_revision, - to_char(p.estimated_finish_date,'Mon DD') as estimated_finish_date, - to_char(p.earliest_finish_date,'Mon DD') as earliest_finish_date, - to_char(p.latest_finish_date,'Mon DD') as latest_finish_date, + to_char(p.estimated_finish_date,'YYYY-MM-DD HH24:MI') as estimated_finish_date, + to_char(p.earliest_finish_date,'YYYY-MM-DD HH24:MI') as earliest_finish_date, + to_char(p.latest_finish_date,'YYYY-MM-DD HH24:MI') as latest_finish_date, p.actual_hours_completed, p.estimated_hours_total, p.parent_id @@ -84,12 +84,12 @@ SELECT t.item_id as task_id, t.title, - to_char(t.end_date,'Mon DD') as end_date, - to_char(t.earliest_start,'Mon DD') as earliest_start, - to_char(t.earliest_finish,'Mon DD') as earliest_finish, - to_char(t.latest_start,'Mon DD') as latest_start, - to_char(t.latest_finish,'Mon DD') as latest_finish, - to_char(t.latest_start-t.earliest_start,'FMDD') || ' days' as slack_time, + 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, + to_char(t.earliest_finish,'YYYY-MM-DD HH24:MI') as earliest_finish, + 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, + to_char(t.latest_start-t.earliest_start,'DD') || ' days' as slack_time, u.first_names, u.last_name, t.percent_complete, @@ -100,11 +100,11 @@ t.estimated_hours_work_max, t.actual_hours_worked FROM - pm_tasks_revisionsx t LEFT JOIN pm_task_assignment a ON t.item_id = a.task_id, cr_items i LEFT JOIN pm_task_dependency d ON i.item_id = d.task_id, cc_users u + (select * from pm_tasks_revisionsx LEFT JOIN pm_task_assignment ON item_id = task_id) t, cr_items i LEFT JOIN pm_task_dependency d ON i.item_id = d.task_id, all_users u WHERE t.parent_id = :project_item_id and t.revision_id = i.live_revision and - a.party_id = u.party_id + t.party_id = u.party_id [template::list::orderby_clause -name tasks -orderby] 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.27 -r1.27.2.1 --- openacs-4/contrib/packages/project-manager/www/one.adp 10 Nov 2003 19:34:54 -0000 1.27 +++ openacs-4/contrib/packages/project-manager/www/one.adp 4 Dec 2003 21:00:13 -0000 1.27.2.1 @@ -103,7 +103,7 @@

- Breakdown + Add subproject

Subprojects: @@ -154,5 +154,5 @@ - + 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.26 -r1.26.2.1 --- openacs-4/contrib/packages/project-manager/www/one.tcl 10 Oct 2003 22:51:04 -0000 1.26 +++ openacs-4/contrib/packages/project-manager/www/one.tcl 4 Dec 2003 21:00:13 -0000 1.26.2.1 @@ -77,6 +77,12 @@ db_1row project_query { } -column_array project set project_root [db_exec_plsql get_root_folder { }] +set project(planned_start_date) [lc_time_fmt $project(planned_start_date) "%x"] +set project(planned_end_date) [lc_time_fmt $project(planned_end_date) "%x"] +set project(estimated_finish_date) [lc_time_fmt $project(estimated_finish_date) "%x"] +set project(earliest_finish_date) [lc_time_fmt $project(earliest_finish_date) "%x"] +set project(latest_finish_date) [lc_time_fmt $project(latest_finish_date) "%x"] + # set up context bar, needs parent_id if {[string equal $project(parent_id) $project_root]} { @@ -127,20 +133,20 @@ } earliest_start { label "Earliest Start" - display_template "@tasks.earliest_start@" + display_template "@tasks.earliest_start_pretty@" } earliest_finish { label "Earliest Finish" - display_template "@tasks.earliest_finish@" + display_template "@tasks.earliest_finish_pretty@" } latest_start { label "Latest Start" - display_template "@tasks.latest_start@" + display_template "@tasks.latest_start_pretty@" } latest_finish { label "Latest Finish" display_template { - @tasks.latest_finish@ + @tasks.latest_finish_pretty@ } } last_name { @@ -176,16 +182,21 @@ latest_start {orderby latest_start} slack_time {orderby slack_time} latest_finish {orderby latest_finish} - default_value slack_time,asc + default_value latest_start,asc } \ -orderby_name orderby_tasks \ -html { } -db_multirow -extend { item_url } tasks project_tasks_query { +db_multirow -extend { item_url earliest_start_pretty earliest_finish_pretty latest_start_pretty latest_finish_pretty} tasks project_tasks_query { } { set item_url [export_vars -base "task-one" { revision_id task_id}] + + set earliest_start_pretty [lc_time_fmt $earliest_start "%x"] + set earliest_finish_pretty [lc_time_fmt $earliest_finish "%x"] + set latest_start_pretty [lc_time_fmt $latest_start "%x"] + set latest_finish_pretty [lc_time_fmt $latest_finish "%x"] } @@ -318,6 +329,8 @@ db_multirow -extend { item_url } versions project_versions { } { set item_url [export_vars -base "one" -override {{project_item_id $item_id}} {project_item_id}] + + } Index: openacs-4/contrib/packages/project-manager/www/process-dependency-add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/process-dependency-add-edit.tcl,v diff -u -r1.3 -r1.3.2.1 --- openacs-4/contrib/packages/project-manager/www/process-dependency-add-edit.tcl 10 Oct 2003 22:51:04 -0000 1.3 +++ openacs-4/contrib/packages/project-manager/www/process-dependency-add-edit.tcl 4 Dec 2003 21:00:13 -0000 1.3.2.1 @@ -62,6 +62,7 @@ if {![exists_and_not_null use_dependency]} { ns_log Notice "Redirecting" ad_returnredirect "process-one?[export_url_vars process_id]" + ad_script_abort } # terminology Index: openacs-4/contrib/packages/project-manager/www/process-one-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/process-one-postgresql.xql,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/contrib/packages/project-manager/www/process-one-postgresql.xql 10 Oct 2003 22:51:04 -0000 1.2 +++ openacs-4/contrib/packages/project-manager/www/process-one-postgresql.xql 4 Dec 2003 21:00:13 -0000 1.2.2.1 @@ -7,7 +7,6 @@ t.process_task_id, t.one_line, t.description, - t.end_date, t.estimated_hours_work, t.estimated_hours_work_min, t.estimated_hours_work_max, Index: openacs-4/contrib/packages/project-manager/www/process-one.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/process-one.adp,v diff -u -r1.3 -r1.3.2.1 --- openacs-4/contrib/packages/project-manager/www/process-one.adp 10 Nov 2003 19:34:54 -0000 1.3 +++ openacs-4/contrib/packages/project-manager/www/process-one.adp 4 Dec 2003 21:00:13 -0000 1.3.2.1 @@ -8,7 +8,7 @@ Process tasks: