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.13.2.4 -r1.13.2.5
--- openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-functions-create.sql	26 Oct 2004 01:22:27 -0000	1.13.2.4
+++ openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-functions-create.sql	5 Jan 2005 16:08:14 -0000	1.13.2.5
@@ -434,7 +434,7 @@
 -- If it is not associated with a project, then it is placed in the root
 -- project repository folder.
 
-select define_function_args('pm_task__new_task_item', 'project_id, title, description, html_p, end_date, percent_complete, estimated_hours_work, estimated_hours_work_min, estimated_hours_work_max, status_id, process_instance_id, creation_date, creation_user, creation_ip, package_id');
+select define_function_args('pm_task__new_task_item', 'project_id, title, description, html_p, end_date, percent_complete, estimated_hours_work, estimated_hours_work_min, estimated_hours_work_max, status_id, process_instance_id, creation_date, creation_user, creation_ip, package_id, priority');
 
 create or replace function pm_task__new_task_item (
         integer,        -- project_id
@@ -451,7 +451,8 @@
         timestamptz,    -- creation_date
         integer,        -- creation_user
         varchar,        -- creation_ip
-        integer         -- package_id
+        integer,        -- package_id
+	integer		-- priority
 ) returns integer 
 as '
 declare
@@ -470,6 +471,7 @@
         p_creation_user                         alias for $13;
         p_creation_ip                           alias for $14;
         p_package_id                            alias for $15;
+        p_priority                              alias for $16;
 
         v_item_id               cr_items.item_id%TYPE;
         v_revision_id           cr_revisions.revision_id%TYPE;
@@ -522,9 +524,9 @@
                 v_item_id, v_task_number, p_status_id, p_process_instance_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)
+                task_revision_id, end_date, percent_complete, estimated_hours_work, estimated_hours_work_min, estimated_hours_work_max, actual_hours_worked, priority)
         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'');
+                v_revision_id, p_end_date, p_percent_complete, p_estimated_hours_work, p_estimated_hours_work_min, p_estimated_hours_work_max, ''0'', p_priority);
 
         PERFORM acs_permission__grant_permission(
                 v_revision_id,
@@ -536,7 +538,7 @@
 end;' language 'plpgsql';
 
 
-select define_function_args('pm_task__new_task_revision', 'task_id, project_id, title, description, mime_type, 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');
+select define_function_args('pm_task__new_task_revision', 'task_id, project_id, title, description, mime_type, 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, priority');
 
 create or replace function pm_task__new_task_revision (
         integer,        -- task_id (the item_id)
@@ -554,7 +556,8 @@
         timestamptz,    -- creation_date
         integer,        -- creation_user
         varchar,        -- creation_ip
-        integer         -- package_id
+        integer,         -- package_id
+	integer		-- priority
 ) returns integer 
 as '
 declare
@@ -574,6 +577,7 @@
         p_creation_user                         alias for $14;
         p_creation_ip                           alias for $15;
         p_package_id                            alias for $16;
+        p_priority                              alias for $17;
         v_revision_id           cr_revisions.revision_id%TYPE;
         v_id                    cr_items.item_id%TYPE;
 begin
@@ -599,9 +603,9 @@
         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)
+                task_revision_id, end_date, percent_complete, estimated_hours_work, estimated_hours_work_min, estimated_hours_work_max, actual_hours_worked, priority)
         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);
+                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, p_priority);
 
         update pm_tasks set status = p_status_id where task_id = p_task_id;
 
