Index: openacs-4/contrib/packages/project-manager/tcl/task-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/tcl/Attic/task-procs.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/contrib/packages/project-manager/tcl/task-procs.tcl 14 May 2004 23:08:56 -0000 1.8 +++ openacs-4/contrib/packages/project-manager/tcl/task-procs.tcl 3 Jun 2004 21:32:02 -0000 1.9 @@ -14,7 +14,7 @@ -ad_proc -public pm::task::dependency_options { +ad_proc -public pm::task::options_list { {-edit_p "f"} -project_item_id {-task_item_id ""} @@ -24,7 +24,8 @@ } { Returns a list of lists suitable for use in a select list for ad_form. Contains a list of possible tasks that this task can - depend upon. + depend upon, or selected. These tasks are limited to just the + one project.

@@ -1571,3 +1572,78 @@ } +ad_proc -public pm::task::update_percent { + -task_item_id:required + -percent_complete:required +} { + Updates the task's percent complete + + @author Jade Rubick (jader@bread.com) + @creation-date 2004-05-24 + + @param task_item_id + + @param percent_complete + + @return + + @error +} { + + db_dml update_percent { + UPDATE + pm_tasks_revisions + SET + percent_complete = :percent_complete + WHERE + task_revision_id = (select + live_revision + from + cr_items + where + item_id = :task_item_id) + } + + if {$percent_complete >= 100} { + + pm::task::close -task_item_id $task_item_id + + } else { + + pm::task::open -task_item_id $task_item_id + + } + +} + + +ad_proc -public pm::task::estimated_hours_work { + -estimated_hours_work + -estimated_hours_work_min + -estimated_hours_work_max +} { + Displays the estimated hours work in a consistent format + + @author Jade Rubick (jader@bread.com) + @creation-date 2004-06-02 + + @param estimated_hours_work + + @param estimated_hours_work_min + + @param estimated_hours_work_max + + @return + + @error +} { + set use_uncertain_completion_times_p [parameter::get -parameter "UseUncertainCompletionTimesP" -default "1"] + + if {[string equal $use_uncertain_completion_times_p 1]} { + set display_value "$estimated_hours_work_min - $estimated_hours_work_max" + } else { + set display_value "$estimated_hours_work" + } + + return $display_value +}