Index: openacs-4/contrib/packages/project-manager/project-manager.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/Attic/project-manager.info,v diff -u -r1.16.2.27 -r1.16.2.28 --- openacs-4/contrib/packages/project-manager/project-manager.info 18 Nov 2004 22:45:37 -0000 1.16.2.27 +++ openacs-4/contrib/packages/project-manager/project-manager.info 25 Nov 2004 01:16:06 -0000 1.16.2.28 @@ -7,14 +7,14 @@ f f - + Jade Rubick Project management tool for OpenACS - 2004-11-18 + 2004-11-24 Integrated Bakery Resources Track tasks, estimates and actual progress for a project. See the <a href="http://openacs.org/projects/dotwrk/project_management/">project page</a> for more information. - + @@ -25,8 +25,8 @@ - + + Index: openacs-4/contrib/packages/project-manager/tcl/project-manager-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/tcl/Attic/project-manager-procs.tcl,v diff -u -r1.2.2.11 -r1.2.2.12 --- openacs-4/contrib/packages/project-manager/tcl/project-manager-procs.tcl 10 Nov 2004 18:19:52 -0000 1.2.2.11 +++ openacs-4/contrib/packages/project-manager/tcl/project-manager-procs.tcl 25 Nov 2004 01:16:07 -0000 1.2.2.12 @@ -13,6 +13,93 @@ namespace eval pm::util {} +ad_proc -public pm::util::hours_day { +} { + Returns the number of hours in the workday + + @author (jader-ibr@bread.com) + @creation-date 2004-11-24 + + @return + + @error +} { + return [util_memoize [list pm::util::hours_day_not_cached]] +} + + +ad_proc -public pm::util::hours_day_not_cached { +} { + Returns the number of hours in the workday + + @author (jader-ibr@bread.com) + @creation-date 2004-11-24 + + @return + + @error +} { + return 8 +} + + +ad_proc -public pm::util::days_work { + {-hours_work:required} + {-pretty_p "f"} +} { + Returns the number of days work + + @author (jader-ibr@bread.com) + @creation-date 2004-11-24 + + @param hours_work + + @return + + @error +} { + set hours_day [pm::util::hours_day] + + if {![string equal $hours_day 0]} { + set number [expr double($hours_work) / $hours_day] + } + + set return_val [pm::util::trim_number -number $number] + + if {[string is true $pretty_p]} { + if {$return_val < 1} { + return "less than 1" + } + } + + return $return_val +} + + +ad_proc -public pm::util::trim_number { + {-number:required} + {-precision "4"} +} { + Trims zeros off the end of a number + + @author (jader-ibr@bread.com) + @creation-date 2004-11-24 + + @param precision + + @return + + @error +} { + set return_val [format "%0.${precision}f" $number] + set return_val [string trimright $return_val 0] + set return_val [string trimright $return_val .] + + return $return_val +} + + + ad_proc -public pm::util::datenvl { -value -value_if_null Index: openacs-4/contrib/packages/project-manager/tcl/project-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/tcl/Attic/project-procs.tcl,v diff -u -r1.6.2.13 -r1.6.2.14 --- openacs-4/contrib/packages/project-manager/tcl/project-procs.tcl 5 Nov 2004 21:41:42 -0000 1.6.2.13 +++ openacs-4/contrib/packages/project-manager/tcl/project-procs.tcl 25 Nov 2004 01:16:07 -0000 1.6.2.14 @@ -684,7 +684,7 @@ # for now, hardcode in a day is 8 hours. Later, we want to set this by # person. # -------------------------------------------------------------------- - set hours_day 8 + set hours_day [pm::util::hours_day] # ------------------------- 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.4.2.32 -r1.4.2.33 --- openacs-4/contrib/packages/project-manager/tcl/task-procs.tcl 19 Nov 2004 22:43:19 -0000 1.4.2.32 +++ openacs-4/contrib/packages/project-manager/tcl/task-procs.tcl 25 Nov 2004 01:16:07 -0000 1.4.2.33 @@ -1616,6 +1616,65 @@ } +ad_proc -public pm::task::days_remaining { + -estimated_hours_work:required + -estimated_hours_work_min:required + -estimated_hours_work_max:required + -percent_complete:required +} { + Displays the estimated days work remaining in a consistent format + + @author Jade Rubick (jader@bread.com) + @creation-date 2004-11-24 + + @param hours_work + + @param hours_work_min + + @param hours_work_max + + @param percent_complete + + @return + + @error +} { + set use_uncertain_completion_times_p [parameter::get -parameter "UseUncertainCompletionTimesP" -default "1"] + set hours_day [pm::util::hours_day] + + if {[string equal $percent_complete 100]} { + return 0 + } + + if {[string equal $percent_complete 0]} { + return [pm::task::estimated_days_work \ + -estimated_hours_work $estimated_hours_work \ + -estimated_hours_work_min $estimated_hours_work_min \ + -estimated_hours_work_max $estimated_hours_work_max] + } + + if {[string is true $use_uncertain_completion_times_p]} { + + set display_value1 [expr $estimated_hours_work_min * $hours_day * [expr 100 - $percent_complete] / double(100)] + set display_value1 [pm::util::trim_number -number $display_value1] + set display_value2 [expr $estimated_hours_work_max * $hours_day * [expr 100 - $percent_complete] / double(100)] + set display_value2 [pm::util::trim_number -number $display_value2] + # set display_value2 [expr round($estimated_hours_work_max * [expr 100 - $percent_complete] / double(100))] + + if {[string equal $display_value1 $display_value2]} { + set display_value "$display_value1" + } else { + set display_value "$display_value1 - $display_value2" + } + } else { + set display_value [expr $estimated_hours_work * [expr 100 - $percent_complete] / double(100)] + set display_value [pm::util::trim_number -number $display_value] + } + + return $display_value +} + + ad_proc -public pm::task::estimated_hours_work { -estimated_hours_work:required -estimated_hours_work_min:required @@ -1652,6 +1711,49 @@ } +ad_proc -public pm::task::estimated_days_work { + -estimated_hours_work:required + -estimated_hours_work_min:required + -estimated_hours_work_max:required +} { + Displays the total estimated days 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]} { + if {[string equal $estimated_hours_work_min $estimated_hours_work_max]} { + set display_value [pm::util::days_work -hours_work $estimated_hours_work_min -pretty_p t] + } else { + set v1 [pm::util::days_work -hours_work $estimated_hours_work_min -pretty_p t] + set v2 [pm::util::days_work -hours_work $estimated_hours_work_max -pretty_p t] + + if {[string equal $v1 $v2]} { + set display_value $v1 + } else { + set display_value "$v1 - $v2" + } + } + } else { + set display_value [pm::util::days_work -hours_work $estimated_hours_work -pretty_p t] + } + + return $display_value +} + + ad_proc -public pm::task::assignee_email_list { -task_item_id:required } { @@ -2128,7 +2230,10 @@ upvar 1 $task_item_id_array task_item_id set use_uncertain_completion_times_p [parameter::get -parameter "UseUncertainCompletionTimesP" -default "1"] + set use_days_p [parameter::get -parameter "UseDayInsteadOfHour" -default "t"] + set hours_day [pm::util::hours_day] + # get the new task values set tasks_item_id [list] foreach num $number { @@ -2234,21 +2339,49 @@ set old_estimated_hours_work_max [ad_get_client_property -- project-manager old_estimated_hours_work_max($tid)] # estimated_hours_work - if {[string is true $use_uncertain_completion_times_p]} { - - if {![string equal $old_estimated_hours_work_min $estimated_hours_work_min_array($tid)]} { - lappend changes "Work estimate (min) changed from $old_estimated_hours_work_min to $estimated_hours_work_min_array($tid) hrs" + if {[string is true $use_days_p]} { + if {[string is true $use_uncertain_completion_times_p]} { + + if {![string equal $old_estimated_hours_work_min $estimated_hours_work_min_array($tid)]} { + set old [pm::util::days_work -hours_work $old_estimated_hours_work_min] + set new [pm::util::days_work -hours_work $estimated_hours_work_min_array($tid)] + lappend changes "Work estimate (min) changed from $old to $new days" + } + + if {![string equal $old_estimated_hours_work_max $estimated_hours_work_max_array($tid)]} { + set old [pm::util::days_work -hours_work $old_estimated_hours_work_max] + set new [pm::util::days_work -hours_work $estimated_hours_work_max_array($tid)] + lappend changes "Work estimate (max) changed from $old to $new days" + } + } else { + + if {![string equal $old_estimated_hours_work $estimated_hours_work_array($tid)]} { + set old [pm::util::days_work -hours_work $old_estimated_hours_work] + set new [pm::util::days_work -hours_work $estimated_hours_work_array($tid)] + lappend changes "Work estimate changed from $old to $new days" + } + } - if {![string equal $old_estimated_hours_work_max $estimated_hours_work_max_array($tid)]} { - lappend changes "Work estimate (max) changed from $old_estimated_hours_work_max to $estimated_hours_work_max_array($tid) hrs" - } } else { - if {![string equal $old_estimated_hours_work $estimated_hours_work_array($tid)]} { - lappend changes "Work estimate (min) changed from $old_estimated_hours_work to $estimated_hours_work_array($tid) hrs" + # estimated_hours_work - hours + if {[string is true $use_uncertain_completion_times_p]} { + + if {![string equal $old_estimated_hours_work_min $estimated_hours_work_min_array($tid)]} { + lappend changes "Work estimate (min) changed from $old_estimated_hours_work_min to $estimated_hours_work_min_array($tid) hrs" + } + + if {![string equal $old_estimated_hours_work_max $estimated_hours_work_max_array($tid)]} { + lappend changes "Work estimate (max) changed from $old_estimated_hours_work_max to $estimated_hours_work_max_array($tid) hrs" + } + } else { + + if {![string equal $old_estimated_hours_work $estimated_hours_work_array($tid)]} { + lappend changes "Work estimate changed from $old_estimated_hours_work to $estimated_hours_work_array($tid) hrs" + } + } - } set old_assignees [ad_get_client_property -- \ Index: openacs-4/contrib/packages/project-manager/www/process-add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/process-add-edit.tcl,v diff -u -r1.4.2.2 -r1.4.2.3 --- openacs-4/contrib/packages/project-manager/www/process-add-edit.tcl 2 Jul 2004 23:13:49 -0000 1.4.2.2 +++ openacs-4/contrib/packages/project-manager/www/process-add-edit.tcl 25 Nov 2004 01:16:07 -0000 1.4.2.3 @@ -29,7 +29,7 @@ set package_id [ad_conn package_id] set user_id [ad_maybe_redirect_for_registration] -# terminology +# terminology and parameters set project_term [parameter::get -parameter "ProjectName" -default "Project"] set project_term_lower [parameter::get -parameter "projectname" -default "project"] Index: openacs-4/contrib/packages/project-manager/www/process-task-add-edit-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/process-task-add-edit-2.tcl,v diff -u -r1.6.2.2 -r1.6.2.3 --- openacs-4/contrib/packages/project-manager/www/process-task-add-edit-2.tcl 2 Jul 2004 23:13:49 -0000 1.6.2.2 +++ openacs-4/contrib/packages/project-manager/www/process-task-add-edit-2.tcl 25 Nov 2004 01:16:07 -0000 1.6.2.3 @@ -22,41 +22,15 @@ {estimated_hours_work:array ""} {estimated_hours_work_min:array ""} {estimated_hours_work_max:array ""} + {estimated_days_work:array ""} + {estimated_days_work_min:array ""} + {estimated_days_work_max:array ""} {ordering:array ""} {assignee:multiple ""} process_task_id:integer,multiple {use_dependency:array ""} } -validate { - no_estimated_hours { - - set flag1 0 - set flag2 0 - - foreach {index value} [array get estimated_hours_work] { - if {[empty_string_p $value]} { - set flag1 1 - } - } - - foreach {index value} [array get estimated_hours_work_min] { - if {[empty_string_p $value]} { - set flag2 1 - } - } - - foreach {index value} [array get estimated_hours_work_max] { - if {[empty_string_p $value]} { - set flag2 1 - } - } - - if {[string is true $flag1] && [string is false $flag2]} { - ad_complain - } elseif {[string is false $flag1] && [string is true $flag2]} { - ad_complain - } - } process_id_missing { if {![exists_and_not_null process_id]} { ad_complain @@ -98,7 +72,6 @@ } } } -errors { - no_estimated_hours {You must enter estimated hours. If nothing else, enter 0 for the estimated hours} process_id_missing {I don't know which process these tasks are for!} task_title_too_long {A task subject is too long. It must be 198 characters or less} description_too_long {A description subject is too long. It must be 3998 characters or less} @@ -115,6 +88,8 @@ set use_uncertain_completion_times_p [parameter::get -parameter "UseUncertainCompletionTimesP" -default "1"] +set use_days_p [parameter::get -parameter "UseDayInsteadOfHour" -default "t"] +set hours_day [pm::util::hours_day] # ------------------------------------------------------------ # we need to determine if these tasks are new or being edited. @@ -144,15 +119,27 @@ set one_line $task_title($array_index) set desc $description($array_index) set order $ordering($array_index) - - if {[string equal $use_uncertain_completion_times_p "1"]} { - set work_min $estimated_hours_work_min($array_index) - set work_max $estimated_hours_work_max($array_index) - set work [expr .5 * [expr $work_max - $work_min] + $work_min] + + if {[string is true $use_days_p]} { + if {[string is true $use_uncertain_completion_times_p]} { + set work_min [expr $estimated_days_work_min($array_index) * $hours_day] + set work_max [expr $estimated_days_work_max($array_index) * $hours_day] + set work [expr .5 * [expr $work_max - $work_min] + $work_min] + } else { + set work [expr $estimated_hours_work($array_index) * $hours_day] + set work_min $work + set work_max $work + } } else { - set work $estimated_hours_work($array_index) - set work_min $work - set work_max $work + if {[string is true $use_uncertain_completion_times_p]} { + set work_min $estimated_hours_work_min($array_index) + set work_max $estimated_hours_work_max($array_index) + set work [expr .5 * [expr $work_max - $work_min] + $work_min] + } else { + set work $estimated_hours_work($array_index) + set work_min $work + set work_max $work + } } db_dml new_task { *SQL* } @@ -182,14 +169,26 @@ set desc $description($array_index) set order $ordering($array_index) - if {[string equal $use_uncertain_completion_times_p "1"]} { - set work_min $estimated_hours_work_min($array_index) - set work_max $estimated_hours_work_max($array_index) - set work [expr .5 * [expr $work_max - $work_min] + $work_min] + if {[string is true $use_days_p]} { + if {[string is true $use_uncertain_completion_times_p]} { + set work_min [expr $estimated_days_work_min($array_index) * $hours_day] + set work_max [expr $estimated_days_work_max($array_index) * $hours_day] + set work [expr .5 * [expr $work_max - $work_min] + $work_min] + } else { + set work [expr $estimated_hours_work($array_index) * $hours_day] + set work_min $work + set work_max $work + } } else { - set work $estimated_hours_work($array_index) - set work_min $work - set work_max $work + if {[string is true $use_uncertain_completion_times_p]} { + set work_min $estimated_hours_work_min($array_index) + set work_max $estimated_hours_work_max($array_index) + set work [expr .5 * [expr $work_max - $work_min] + $work_min] + } else { + set work $estimated_hours_work($array_index) + set work_min $work + set work_max $work + } } db_dml edit_task { *SQL* } Index: openacs-4/contrib/packages/project-manager/www/process-task-add-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/process-task-add-edit.adp,v diff -u -r1.7.4.2 -r1.7.4.3 --- openacs-4/contrib/packages/project-manager/www/process-task-add-edit.adp 26 Oct 2004 01:21:11 -0000 1.7.4.2 +++ openacs-4/contrib/packages/project-manager/www/process-task-add-edit.adp 25 Nov 2004 01:16:07 -0000 1.7.4.3 @@ -31,17 +31,35 @@ Work required:* - - Min: - hrs - - - Max: - hrs - + + + Min: + days + + + Max: + days + + + + days + + - hrs + + Min: + hrs + + + Max: + hrs + + + + hrs + + Index: openacs-4/contrib/packages/project-manager/www/process-task-add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/process-task-add-edit.tcl,v diff -u -r1.8.2.3 -r1.8.2.4 --- openacs-4/contrib/packages/project-manager/www/process-task-add-edit.tcl 26 Oct 2004 01:21:11 -0000 1.8.2.3 +++ openacs-4/contrib/packages/project-manager/www/process-task-add-edit.tcl 25 Nov 2004 01:16:07 -0000 1.8.2.4 @@ -44,13 +44,14 @@ # --------------------------------------------------------------- # -# ----------- -# terminology -# ----------- +# -------------------------- +# terminology and parameters +# -------------------------- set task_term [parameter::get -parameter "TaskName" -default "Task"] set task_term_lower [parameter::get -parameter "taskname" -default "task"] set use_uncertain_completion_times_p [parameter::get -parameter "UseUncertainCompletionTimesP" -default "1"] +set use_day_p [parameter::get -parameter "UseDayInsteadOfHour" -default "t"] set DEFAULT_ORDERING_GAP 5 @@ -83,6 +84,13 @@ set estimated_hours_work_min_v($i) $estimated_hours_work_min set estimated_hours_work_max_v($i) $estimated_hours_work_max set ordering_v($i) $ordering + + set estimated_days_work_v($i) [pm::util::days_work \ + -hours_work $estimated_hours_work] + set estimated_days_work_min_v($i) [pm::util::days_work \ + -hours_work $estimated_hours_work_min] + set estimated_days_work_max_v($i) [pm::util::days_work \ + -hours_work $estimated_hours_work_max] if {[empty_string_p $ordering_v($i)]} { set ordering_v($i) [expr $i * $DEFAULT_ORDERING_GAP] @@ -112,6 +120,9 @@ set estimated_hours_work_v($i) "" set estimated_hours_work_min_v($i) "" set estimated_hours_work_max_v($i) "" + set estimated_days_work_v($i) "" + set estimated_days_work_min_v($i) "" + set estimated_days_work_max_v($i) "" set ordering_v($i) [expr $i * $DEFAULT_ORDERING_GAP] set checked_v($i) "" } @@ -125,7 +136,7 @@ set assignee_list_of_lists [pm::util::subsite_assignees_list_of_lists] -template::multirow create num process_task_id one_line description work work_min work_max ordering checked assignee_html +template::multirow create num process_task_id one_line description work work_min work_max work_days work_days_min work_days_max ordering checked assignee_html for {set i 1} {$i <= $number} {incr i} { @@ -187,7 +198,7 @@ append html "" - template::multirow append num $process_task_id_tmp $one_line_v($i) $description_v($i) $estimated_hours_work_v($i) $estimated_hours_work_min_v($i) $estimated_hours_work_max_v($i) $ordering_v($i) $checked_v($i) $html + template::multirow append num $process_task_id_tmp $one_line_v($i) $description_v($i) $estimated_hours_work_v($i) $estimated_hours_work_min_v($i) $estimated_hours_work_max_v($i) $estimated_days_work_v($i) $estimated_days_work_min_v($i) $estimated_days_work_max_v($i) $ordering_v($i) $checked_v($i) $html } Index: openacs-4/contrib/packages/project-manager/www/task-add-edit-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-add-edit-2.tcl,v diff -u -r1.1.2.4 -r1.1.2.5 --- openacs-4/contrib/packages/project-manager/www/task-add-edit-2.tcl 19 Nov 2004 22:43:22 -0000 1.1.2.4 +++ openacs-4/contrib/packages/project-manager/www/task-add-edit-2.tcl 25 Nov 2004 01:16:07 -0000 1.1.2.5 @@ -22,6 +22,9 @@ {estimated_hours_work:array ""} {estimated_hours_work_min:array ""} {estimated_hours_work_max:array ""} + {estimated_days_work:array ""} + {estimated_days_work_min:array ""} + {estimated_days_work_max:array ""} {process_task_id:integer,multiple ""} {percent_complete:array ""} {dependency:array ""} @@ -45,7 +48,6 @@ } -errors { } - # --------------------------------------------------------------- # Set up # --------------------------------------------------------------- @@ -55,8 +57,12 @@ set use_uncertain_completion_times_p [parameter::get -parameter "UseUncertainCompletionTimesP" -default "1"] +set hours_day [pm::util::hours_day] +set use_days_p [parameter::get -parameter "UseDayInsteadOfHour" -default "t"] foreach i $number { + + # set the dates correctly set end_date_${i}(day) [lindex $end_date_day [expr $i -1]] set end_date_${i}(month) [lindex $end_date_month [expr $i -1]] set end_date_${i}(year) [lindex $end_date_year [expr $i - 1]] @@ -70,8 +76,27 @@ set log_date_${i}(format) "" ad_page_contract_filter_proc_date log_date_$i log_date_$i + + if {[string is true $use_days_p]} { + + # set the hours work + if {[string is true $use_uncertain_completion_times_p]} { + + set estimated_hours_work_min($i) \ + [expr $estimated_days_work_min($i) * $hours_day] + set estimated_hours_work_max($i) \ + [expr $estimated_days_work_max($i) * $hours_day] + + } else { + + set estimated_hours_work($i) \ + [expr $estimated_days_work($i) * $hours_day] + + } + } } + if {[string is true $edit_p]} { # ------- Index: openacs-4/contrib/packages/project-manager/www/task-add-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-add-edit.adp,v diff -u -r1.12.2.8 -r1.12.2.9 --- openacs-4/contrib/packages/project-manager/www/task-add-edit.adp 19 Nov 2004 22:43:22 -0000 1.12.2.8 +++ openacs-4/contrib/packages/project-manager/www/task-add-edit.adp 25 Nov 2004 01:16:07 -0000 1.12.2.9 @@ -124,21 +124,37 @@ Work required:* - - Min: - hrs - + + + Min: + @work_units;noquote@ + + + Max: + @work_units;noquote@ + + - Max: - hrs - + + @work_units;noquote@ + - hrs + + Min: + @work_units;noquote@ + + + Max: + @work_units;noquote@ + + + + @work_units;noquote@ + - - +

Index: openacs-4/contrib/packages/project-manager/www/task-add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-add-edit.tcl,v diff -u -r1.27.2.16 -r1.27.2.17 --- openacs-4/contrib/packages/project-manager/www/task-add-edit.tcl 19 Nov 2004 22:43:22 -0000 1.27.2.16 +++ openacs-4/contrib/packages/project-manager/www/task-add-edit.tcl 25 Nov 2004 01:16:07 -0000 1.27.2.17 @@ -41,6 +41,16 @@ set user_id [ad_maybe_redirect_for_registration] set package_id [ad_conn package_id] +# use hour units or day units +set use_day_p [parameter::get -parameter "UseDayInsteadOfHour" -default "t"] +set hours_day [pm::util::hours_day] + +if {[string is true $use_day_p]} { + set work_units "days" +} else { + set work_units "hrs" +} + # --------------------------------------------------------------- # terminology # --------------------------------------------------------------- @@ -132,9 +142,12 @@ one_line \ description \ description_mime_type \ - work \ - work_min \ - work_max \ + work_hrs \ + work_min_hrs \ + work_max_hrs \ + work_days \ + work_min_days \ + work_max_days \ percent_complete \ end_date_html \ depends \ @@ -206,7 +219,20 @@ " - + + set task_estimated_days_work($task) \ + [pm::util::days_work \ + -hours_work $task_estimated_hours_work($task)] + + set task_estimated_days_work_min($task) \ + [pm::util::days_work \ + -hours_work $task_estimated_hours_work_min($task)] + + set task_estimated_days_work_max($task) \ + [pm::util::days_work \ + -hours_work $task_estimated_hours_work_max($task)] + + template::multirow append tasks \ $task \ "" \ @@ -216,6 +242,9 @@ $task_estimated_hours_work($task) \ $task_estimated_hours_work_min($task) \ $task_estimated_hours_work_max($task) \ + $task_estimated_days_work($task) \ + $task_estimated_days_work_min($task) \ + $task_estimated_days_work_max($task) \ $task_percent_complete($task) \ $end_date_html \ $task_dependency($task) \ @@ -294,6 +323,19 @@ set project_html "" + set process_estimated_days_work($pt) \ + [pm::util::days_work \ + -hours_work $process_estimated_hours_work($pt)] + + set process_estimated_days_work_min($pt) \ + [pm::util::days_work \ + -hours_work $process_estimated_hours_work_min($pt)] + + set process_estimated_days_work_max($pt) \ + [pm::util::days_work \ + -hours_work $process_estimated_hours_work_max($pt)] + + # make sure deps are working. template::multirow append tasks \ @@ -305,6 +347,9 @@ $process_estimated_hours_work($pt) \ $process_estimated_hours_work_min($pt) \ $process_estimated_hours_work_max($pt) \ + $process_estimated_days_work($pt) \ + $process_estimated_days_work_min($pt) \ + $process_estimated_days_work_max($pt) \ "0" \ $end_date_html \ $process_dependency($pt) \ @@ -351,6 +396,9 @@ 0 \ 0 \ 0 \ + 0 \ + 0 \ + 0 \ $end_date_html \ "" \ $assignee_html \ Index: openacs-4/contrib/packages/project-manager/www/task-one.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-one.adp,v diff -u -r1.23.2.10 -r1.23.2.11 --- openacs-4/contrib/packages/project-manager/www/task-one.adp 19 Nov 2004 22:43:22 -0000 1.23.2.10 +++ openacs-4/contrib/packages/project-manager/www/task-one.adp 25 Nov 2004 01:16:08 -0000 1.23.2.11 @@ -221,8 +221,12 @@ - Hours remaining: @task_info.hours_remaining@
- + + Days remaining: @task_info.days_remaining@
+
+ + Hours remaining: @task_info.hours_remaining@
+
Slack: n/a Index: openacs-4/contrib/packages/project-manager/www/task-one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-one.tcl,v diff -u -r1.24.2.11 -r1.24.2.12 --- openacs-4/contrib/packages/project-manager/www/task-one.tcl 19 Nov 2004 22:43:22 -0000 1.24.2.11 +++ openacs-4/contrib/packages/project-manager/www/task-one.tcl 25 Nov 2004 01:16:08 -0000 1.24.2.12 @@ -79,16 +79,16 @@ # --------------------------------------------------------------- # -# terminology +# terminology and other parameters set task_term [parameter::get -parameter "TaskName" -default "Task"] set task_term_lower [parameter::get -parameter "taskname" -default "task"] set assignee_term [parameter::get -parameter "AssigneeName" -default "Assignee"] set watcher_term [parameter::get -parameter "WatcherName" -default "Watcher"] set project_term [parameter::get -parameter "ProjectName" -default "Project"] set use_uncertain_completion_times_p [parameter::get -parameter "UseUncertainCompletionTimesP" -default "1"] +set use_days_p [parameter::get -parameter "UseDayInsteadOfHour" -default "t"] - # the unique identifier for this package set package_id [ad_conn package_id] set package_url [ad_conn package_url] @@ -116,6 +116,13 @@ -estimated_hours_work_max $task_info(estimated_hours_work_max) \ -percent_complete $task_info(percent_complete)] +set task_info(days_remaining) \ + [pm::task::days_remaining \ + -estimated_hours_work $task_info(estimated_hours_work) \ + -estimated_hours_work_min $task_info(estimated_hours_work_min) \ + -estimated_hours_work_max $task_info(estimated_hours_work_max) \ + -percent_complete $task_info(percent_complete)] + # format the dates according to the local settings set task_info(earliest_start) [lc_time_fmt $task_info(earliest_start) "%x"] set task_info(earliest_finish) [lc_time_fmt $task_info(earliest_finish) "%x"] Index: openacs-4/contrib/packages/project-manager/www/tasks.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/tasks.tcl,v diff -u -r1.5.2.12 -r1.5.2.13 --- openacs-4/contrib/packages/project-manager/www/tasks.tcl 5 Nov 2004 23:04:40 -0000 1.5.2.12 +++ openacs-4/contrib/packages/project-manager/www/tasks.tcl 25 Nov 2004 01:16:08 -0000 1.5.2.13 @@ -38,12 +38,13 @@ # --------------------------------------------------------------- # -# terminology +# terminology and parameters set task_term [parameter::get -parameter "TaskName" -default "Task"] set task_term_lower [parameter::get -parameter "taskname" -default "task"] set project_term [parameter::get -parameter "ProjectName" -default "Project"] set project_term_lower [parameter::get -parameter "projectname" -default "project"] +set use_days_p [parameter::get -parameter "UseDayInsteadOfHour" -default "t"] set exporting_vars { status_id party_id orderby mine_p } set hidden_vars [export_vars -form $exporting_vars] @@ -104,49 +105,68 @@ } -template::list::create \ - -name tasks \ - -multirow tasks \ - -key task_id \ - -elements { +set elements { task_number { label "\#" link_url_col item_url link_html { title "View this project version" } display_template {@tasks.task_id@} - } + } title { label "Subject" - } + } slack_time { label "Slack" display_template "@tasks.slack_time@@tasks.slack_time@" - } + } latest_start_pretty { label "Latest Start" - } + } latest_finish_pretty { label "Latest Finish" display_template { @tasks.latest_finish_pretty@ } - } + } +} + +if {[string is true $use_days_p]} { + append elements { + days_remaining { + label "Days remaining" + html { + align right + } + } + } +} else { + append elements { hours_remaining { label "Hours remaining" html { align right } - } + } + } +} + +append elements { project_item_id { label "Project" display_col project_name link_url_eval {[export_vars -base one {project_item_id $tasks(project_item_id)}]} - } + } log_url { label "Log" display_template {L} - } - } \ + } +} + +template::list::create \ + -name tasks \ + -multirow tasks \ + -key task_id \ + -elements $elements \ -actions [list "Add task" [export_vars -base task-select-project {return_url}] "Add a task"] \ -bulk_actions { "Log hours" "log-bulk" "Log hours for several tasks" @@ -239,7 +259,7 @@ -db_multirow -extend { item_url latest_start_pretty latest_finish_pretty slack_time log_url hours_remaining} tasks tasks { +db_multirow -extend { item_url latest_start_pretty latest_finish_pretty slack_time log_url hours_remaining days_remaining} tasks tasks { } { set item_url [export_vars -base "task-one" {task_id}] @@ -264,6 +284,13 @@ -estimated_hours_work_max $estimated_hours_work_max \ -percent_complete $percent_complete] + set days_remaining \ + [pm::task::days_remaining \ + -estimated_hours_work $estimated_hours_work \ + -estimated_hours_work_min $estimated_hours_work_min \ + -estimated_hours_work_max $estimated_hours_work_max \ + -percent_complete $percent_complete] + }