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.4.2.4 -r1.4.2.5 --- openacs-4/contrib/packages/project-manager/tcl/task-procs-postgresql.xql 23 Sep 2004 21:46:41 -0000 1.4.2.4 +++ openacs-4/contrib/packages/project-manager/tcl/task-procs-postgresql.xql 26 Oct 2004 01:22:27 -0000 1.4.2.5 @@ -3,6 +3,20 @@ postgresql7.3 + + + SELECT + r.title + FROM + cr_items i, + cr_revisions r + WHERE + i.item_id = r.item_id and + i.item_id = :task_item_id and + i.live_revision = r.revision_id + + + SELECT @@ -66,9 +80,59 @@ - + + DELETE FROM + pm_task_dependency + WHERE + task_id = :task_item_id + + + + + SELECT + task.item_id as t_item_id + FROM + cr_items task, + cr_items project + WHERE + task.parent_id = project.item_id and + project.item_id = :project_item_id + + + + + + SElECT + d.task_id as dep_task, + d.parent_task_id as dep_task_parent + FROM + pm_task_dependency d + WHERE + d.task_id in ([join $project_tasks ", "]) + + + + + + INSERT INTO + pm_task_dependency + (dependency_id, + task_id, + parent_task_id, + dependency_type) + values + (:dependency_id, + :task_item_id, + :parent_id, + 'finish_before_start') + + + + + + SELECT r.item_id, r.title as task_title FROM @@ -110,6 +174,23 @@ + + + UPDATE + logger_entries + SET + project_id = :logger_project + WHERE + entry_id in + (select + logger_entry + from + pm_task_logger_proj_map + where + task_item_id = :task_item_id) + + + select pm_task__new_task_item ( @@ -123,31 +204,157 @@ :estimated_hours_work_min, :estimated_hours_work_max, :status_id, + :process_instance_id, coalesce (:creation_date,current_timestamp), :creation_user, :creation_ip, :package_id) - + + - SELECT - t.process_task_id as process_tid, - t.one_line, - t.description, - t.estimated_hours_work, - t.estimated_hours_work_min, - t.estimated_hours_work_max, - d.dependency_id, - d.parent_task_id as process_parent_task - FROM - pm_process_task t LEFT JOIN pm_process_task_dependency d ON t.process_task_id = d.process_task_id + SELECT + p.email as from_address, + p2.first_names || ' ' || p2.last_name as mod_username + FROM + parties p, + persons p2 WHERE - t.process_id = :process_id - ORDER BY - t.ordering, - t.process_task_id + p.party_id = :user_id and + p.party_id = p2.person_id + + + + SELECT + t.title as subject, + t.description, + t.mime_type as description_mime_type, + to_char(t.earliest_start,'MM-DD-YYYY') as earliest_start, + to_char(t.earliest_finish,'MM-DD-YYYY') as earliest_finish, + to_char(t.latest_start,'MM-DD-YYYY') as latest_start, + to_char(t.latest_finish,'MM-DD-YYYY') as latest_finish, + t.estimated_hours_work as work, + t.estimated_hours_work_min as work_min, + t.estimated_hours_work_max as work_max, + t.percent_complete, + p.title as project_name, + t.parent_id as project_item_id, + a.process_instance + FROM + pm_tasks_revisionsx t, + pm_tasks_active a, + cr_items i, + cr_items project, + pm_projectsx p + WHERE + t.item_id = :task_item_id and + t.item_id = a.task_id and + t.revision_id = i.live_revision and + t.item_id = i.item_id and + t.parent_id = project.item_id and + project.item_id = p.item_id and + project.live_revision = p.revision_id + + + + + + SELECT + p.email as to_address, + r.one_line as role, + r.is_lead_p + FROM + pm_task_assignment a, + parties p, + pm_roles r + WHERE + task_id = :task_item_id and + a.party_id = p.party_id and + a.role_id = r.role_id + + + + + + + SELECT + t.title as one_line, + t.description, + t.mime_type as description_mime_type, + t.estimated_hours_work as estimated_hours_work, + t.estimated_hours_work_min as estimated_hours_work_min, + t.estimated_hours_work_max as estimated_hours_work_max, + t.percent_complete, + to_char(t.end_date, 'DD') as end_date_day, + to_char(t.end_date, 'MM') as end_date_month, + to_char(t.end_date, 'YYYY') as end_date_year, + d.parent_task_id, + i.item_id as tid, + t.parent_id as project + FROM + pm_tasks_revisionsx t, + cr_items i + LEFT JOIN + pm_task_dependency d + ON i.item_id = d.task_id + WHERE + t.revision_id = i.live_revision and + t.item_id = i.item_id + $task_where_clause + + + + + + + SELECT + party_id, + role_id + FROM + pm_task_assignment + WHERE + task_id = :task_item_id + + + + + + + UPDATE + pm_tasks + SET + status = :status_code + WHERE + task_id = :task_item_id + + + + + + UPDATE + pm_tasks + SET + status = :status_code + WHERE + task_id = :task_item_id + + + + + + SELECT + p.first_names || ' ' || p.last_name + FROM + pm_task_assignment a, + persons p + WHERE + task_id = :task_item_id and + a.party_id = p.person_id + + +