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.7 -r1.8
--- openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-functions-create.sql	21 Aug 2003 22:34:43 -0000	1.7
+++ openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-functions-create.sql	29 Aug 2003 00:35:35 -0000	1.8
@@ -130,7 +130,7 @@
 -- 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, deadline_scheduling, 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, creation_date, creation_user, creation_ip, package_id');
 
 create function pm_project__new_project_item (
 	integer,        -- project_id
@@ -139,7 +139,6 @@
 	integer,        -- parent_id
 	varchar,        -- goal
 	varchar,        -- description
-	char(1),        -- deadline_scheduling
 	timestamptz,    -- planned_start_date
 	timestamptz,    -- planned_end_date
 	timestamptz,    -- actual_start_date
@@ -158,16 +157,15 @@
 	p_parent_id				alias for $4;
 	p_goal					alias for $5;
 	p_description				alias for $6;
-	p_deadline_scheduling			alias for $7;
-	p_planned_start_date			alias for $8;
-	p_planned_end_date			alias for $9;
-	p_actual_start_date			alias for $10;
-	p_actual_end_date			alias for $11;
-	p_ongoing_p				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_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;
 
 	v_item_id		cr_items.item_id%TYPE;
 	v_revision_id		cr_revisions.revision_id%TYPE;
@@ -223,14 +221,20 @@
 
 	insert into pm_projects (
 		project_id, project_code, 
-		goal, deadline_scheduling, planned_start_date, 
+		goal, planned_start_date, 
 		planned_end_date, actual_start_date, actual_end_date, 
-		ongoing_p) 
+		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_deadline_scheduling, p_planned_start_date, 
+		p_goal, p_planned_start_date, 
 		p_planned_end_date, p_actual_start_date, 
-		p_actual_end_date, p_ongoing_p);
+		p_actual_end_date, p_ongoing_p, p_planned_end_date,
+                p_planned_end_date, p_planned_end_date, ''0'',
+                ''0''
+                );
 
 	PERFORM acs_permission__grant_permission(
 		v_revision_id,
@@ -276,7 +280,7 @@
 end;' language 'plpgsql';
 
 
-select define_function_args('pm_project__new_project_revision', 'item_id, project_name, project_code, parent_id, goal, description, deadline_scheduling, 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, creation_date, creation_user, creation_ip, package_id');
 
 create function pm_project__new_project_revision (
 	integer,        -- item_id
@@ -285,7 +289,6 @@
 	integer,        -- parent_id
 	varchar,        -- goal
 	varchar,        -- description
-	char(1),        -- deadline_scheduling
 	timestamptz,    -- planned_start_date
 	timestamptz,    -- planned_end_date
 	timestamptz,    -- actual_start_date
@@ -304,16 +307,15 @@
 	p_parent_id				alias for $4;
 	p_goal					alias for $5;
 	p_description				alias for $6;
-	p_deadline_scheduling			alias for $7;
-	p_planned_start_date			alias for $8;
-	p_planned_end_date			alias for $9;
-	p_actual_start_date			alias for $10;
-	p_actual_end_date			alias for $11;
-	p_ongoing_p				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_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;
 
 	v_revision_id		cr_revisions.revision_id%TYPE;
 begin
@@ -338,12 +340,12 @@
 
 	insert into pm_projects (
 		project_id, project_code, 
-		goal, deadline_scheduling, planned_start_date, 
+		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_deadline_scheduling, p_planned_start_date, 
+		p_goal, p_planned_start_date, 
 		p_planned_end_date, p_actual_start_date, 
 		p_actual_end_date, p_ongoing_p);
 
@@ -416,7 +418,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', 'task_id, project_id, title, description, end_date, percent_complete, 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', '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
@@ -425,6 +427,7 @@
 	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
@@ -440,12 +443,13 @@
 	p_description				alias for $4;
 	p_end_date                              alias for $5;
         p_percent_complete                      alias for $6;
-        p_estimated_hours_work_min              alias for $7;
-        p_estimated_hours_work_max              alias for $8;
-	p_creation_date				alias for $9;
-	p_creation_user				alias for $10;
-	p_creation_ip				alias for $11;
-	p_package_id				alias for $12;
+        p_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;
 
 	v_item_id		cr_items.item_id%TYPE;
 	v_revision_id		cr_revisions.revision_id%TYPE;
@@ -498,9 +502,9 @@
                 v_item_id, v_task_number);
 
         insert into pm_tasks_revisions (
-                task_revision_id, end_date, percent_complete, 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)
         values (
-                v_revision_id, p_end_date, p_percent_complete, 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'');
 
 	PERFORM acs_permission__grant_permission(
 		v_revision_id,
@@ -512,7 +516,7 @@
 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_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, 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)
@@ -521,6 +525,7 @@
 	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
@@ -537,13 +542,14 @@
 	p_description				alias for $4;
 	p_end_date                              alias for $5;
         p_percent_complete                      alias for $6;
-        p_estimated_hours_work_min              alias for $7;
-        p_estimated_hours_work_max              alias for $8;
-        p_actual_hours_worked                   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_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;
 
 	v_revision_id		cr_revisions.revision_id%TYPE;
 	v_id			cr_items.item_id%TYPE;
@@ -569,9 +575,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_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)
         values (
-                v_revision_id, p_end_date, p_percent_complete, 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);
 
 	PERFORM acs_permission__grant_permission(
 		v_revision_id,
