Index: openacs-4/packages/project-manager/sql/postgresql/project-manager-functions-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/sql/postgresql/project-manager-functions-create.sql,v diff -u -r1.9 -r1.10 --- openacs-4/packages/project-manager/sql/postgresql/project-manager-functions-create.sql 19 Jul 2005 06:26:55 -0000 1.9 +++ openacs-4/packages/project-manager/sql/postgresql/project-manager-functions-create.sql 12 Sep 2005 21:30:17 -0000 1.10 @@ -195,8 +195,7 @@ p_description, -- description p_mime_type, -- mime_type null, -- nls_language - null, -- data - p_package_id -- package_id + null -- data ); v_revision_id := content_revision__new ( @@ -210,8 +209,7 @@ NULL, -- revision_id now(), -- creation_date p_creation_user, -- creation_user - p_creation_ip, -- creation_ip - p_package_id -- package_id + p_creation_ip -- creation_ip ); PERFORM content_item__set_live_revision (v_revision_id); @@ -243,7 +241,6 @@ return v_revision_id; end;' language 'plpgsql'; - -- The delete function deletes a record and all related overhead. select define_function_args('pm_project__delete_project_item', 'project_id'); @@ -273,7 +270,6 @@ 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, organization_id, dform, creation_date, creation_user, creation_ip, package_id'); create or replace function pm_project__new_project_revision ( @@ -333,8 +329,7 @@ NULL, -- revision_id now(), -- creation_date p_creation_user, -- creation_user - p_creation_ip, -- creation_ip - p_package_id -- package_id + p_creation_ip -- creation_ip ); PERFORM content_item__set_live_revision (v_revision_id); @@ -464,17 +459,23 @@ p_task_id alias for $18; v_item_id cr_items.item_id%TYPE; + v_id cr_items.item_id%TYPE; v_revision_id cr_revisions.revision_id%TYPE; v_task_number integer; begin -- We want to put the task under the project item -- create the task_number + if p_task_id is null then + select + else + v_id := p_task_id; + end if; v_item_id := content_item__new ( - p_task_id::varchar, -- name + v_id::varchar, -- name p_project_id, -- parent_id - p_task_id, -- item_id + v_id, -- item_id null, -- locale now(), -- creation_date p_creation_user, -- creation_user @@ -613,6 +614,7 @@ end;' language 'plpgsql'; + -- The delete function deletes a record and all related overhead. select define_function_args('pm_task__delete_task_item', 'task_id'); Index: openacs-4/packages/project-manager/tcl/project-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/tcl/project-procs.tcl,v diff -u -r1.17 -r1.18 --- openacs-4/packages/project-manager/tcl/project-procs.tcl 8 Sep 2005 09:34:31 -0000 1.17 +++ openacs-4/packages/project-manager/tcl/project-procs.tcl 12 Sep 2005 21:30:17 -0000 1.18 @@ -2246,15 +2246,17 @@ - while { $mins_to_complete > [expr $hours_day * 60]} { + while { $t_total_mins > [expr $hours_day * 60]} { - set [expr $today_j - 1] + set t_today [expr $today_j - 1] # if it is a holiday, don't subtract from total time if {[is_workday_p $t_today]} { set t_total_mins [expr $t_total_mins - [expr $hours_day * 60]] - } + } else { + set t_total_mins 0 + } } @@ -2347,7 +2349,7 @@ set t_total_mins $mins_to_complete - while { $mins_to_complete > [expr $hours_day * 60]} { + while { $t_total_mins > [expr $hours_day * 60]} { set today_j [expr $today_j + 1] @@ -2357,7 +2359,9 @@ set t_total_mins [expr $t_total_mins + [expr $hours_day * 60]] - } + } else { + set t_total_mins 0 + } } @@ -2622,15 +2626,17 @@ - while { $mins_to_complete > [expr $hours_day * 60]} { + while { $t_total_mins > [expr $hours_day * 60]} { - set [expr $today_j - 1] + set t_today [expr $today_j - 1] # if it is a holiday, don't subtract from total time if {[is_workday_p $t_today]} { set t_total_mins [expr $t_total_mins - [expr $hours_day * 60]] - } + } else { + set t_total_mins 0 + } }