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.25 -r1.4.2.26
--- openacs-4/contrib/packages/project-manager/tcl/task-procs.tcl 26 Oct 2004 01:22:27 -0000 1.4.2.25
+++ openacs-4/contrib/packages/project-manager/tcl/task-procs.tcl 4 Nov 2004 01:04:17 -0000 1.4.2.26
@@ -1795,6 +1795,7 @@
{-end_date_month_array:required}
{-end_date_year_array:required}
{-project_item_id_array:required}
+ {-set_client_properties_p "f"}
} {
Stuff information about tasks into several arrays
@@ -1854,6 +1855,77 @@
set estimated_hours_work_max_arr($tid) 0
}
+ if {[string is true $set_client_properties_p]} {
+
+ ad_set_client_property -persistent f -- \
+ project-manager \
+ old_one_line($tid) \
+ $one_line
+
+ ad_set_client_property -persistent f -- \
+ project-manager \
+ old_description($tid) \
+ $description
+
+ ad_set_client_property -persistent f -- \
+ project-manager \
+ old_description_mime_type($tid) \
+ $description_mime_type
+
+ ad_set_client_property -persistent f -- \
+ project-manager \
+ old_estimated_hours_work($tid) \
+ $estimated_hours_work
+
+ ad_set_client_property -persistent f -- \
+ project-manager \
+ old_estimated_hours_work_min($tid) \
+ $estimated_hours_work_min
+
+ ad_set_client_property -persistent f -- \
+ project-manager \
+ old_estimated_hours_work_max($tid) \
+ $estimated_hours_work_max
+
+ ad_set_client_property -persistent f -- \
+ project-manager \
+ old_dependency($tid) \
+ $parent_task_id
+
+ ad_set_client_property -persistent f -- \
+ project-manager \
+ old_percent_complete($tid) \
+ $percent_complete
+
+ ad_set_client_property -persistent f -- \
+ project-manager \
+ old_end_date_day($tid) \
+ $end_date_day
+
+ ad_set_client_property -persistent f -- \
+ project-manager \
+ old_end_date_month($tid) \
+ $end_date_month
+
+ ad_set_client_property -persistent f -- \
+ project-manager \
+ old_end_date_year($tid) \
+ $end_date_year
+
+ ad_set_client_property -persistent f -- \
+ project-manager \
+ old_project_item_id($tid) \
+ $project
+
+ ad_set_client_property -persistent f -- \
+ project-manager \
+ old_assignees($tid) \
+ [pm::task::get_assignee_names \
+ -task_item_id $tid]
+
+ }
+
+
}
}
@@ -1974,22 +2046,10 @@
{-comments_mime_type_array:required}
{-task_item_id_array:required}
{-number:required}
- {-old_one_line_array:required}
- {-old_description_array:required}
- {-old_description_mime_type_array:required}
- {-old_estimated_hours_work_array:required}
- {-old_estimated_hours_work_min_array:required}
- {-old_estimated_hours_work_max_array:required}
- {-old_dependency_array:required}
- {-old_percent_complete_array:required}
- {-old_end_date_day_array:required}
- {-old_end_date_month_array:required}
- {-old_end_date_year_array:required}
- {-old_project_item_id_array:required}
- {-old_assignees_array:required}
} {
Compares how a task was and how it currently is, and
- adds to the comments array a list of changes.
+ adds to the comments array a list of changes. Uses properties
+ last set in the task::get proc.
@author Jade Rubick (jader@bread.com)
@creation-date 2004-10-20
@@ -2003,24 +2063,6 @@
@param number the keys to the task_item_id array, a list of integers
- @param old_one_line_array
-
- @param old_description_array
-
- @param old_description_mime_type_array
-
- @param old_estimated_hours_work_array
-
- @param old_estimated_hours_work_min_array
-
- @param old_estimated_hours_work_max_array
-
- @param old_dependency_array
-
- @param old_percent_complete_array
-
- @param old_assignees_array
-
@return
@error
@@ -2030,22 +2072,8 @@
# text/html format
upvar 1 $comments_array comments_arr
upvar 1 $comments_mime_type_array comments_mime_type_arr
+ upvar 1 $task_item_id_array task_item_id
- upvar 1 $task_item_id_array task_item_id
- upvar 1 $old_one_line_array old_one_line_arr
- upvar 1 $old_description_array old_description_arr
- upvar 1 $old_description_mime_type_array old_description_mime_type_arr
- upvar 1 $old_estimated_hours_work_array old_estimated_hours_work_arr
- upvar 1 $old_estimated_hours_work_min_array old_estimated_hours_work_min_arr
- upvar 1 $old_estimated_hours_work_max_array old_estimated_hours_work_max_arr
- upvar 1 $old_percent_complete_array old_percent_complete_arr
- upvar 1 $old_end_date_day_array old_end_date_day_arr
- upvar 1 $old_end_date_month_array old_end_date_month_arr
- upvar 1 $old_end_date_year_array old_end_date_year_arr
- upvar 1 $old_project_item_id_array old_project_item_id_arr
- upvar 1 $old_assignees_array old_assignees_arr
- upvar 1 $old_dependency_array old_dependency_arr
-
set use_uncertain_completion_times_p [parameter::get -parameter "UseUncertainCompletionTimesP" -default "1"]
# get the new task values
@@ -2076,7 +2104,8 @@
set tid $task_item_id($num)
- set old $old_percent_complete_arr($tid)
+ set old [ad_get_client_property -- project-manager old_percent_complete($tid)]
+
set new $percent_complete_array($tid)
if {![string equal $old $new]} {
@@ -2094,15 +2123,19 @@
}
}
+
+ set old_end_date_day [ad_get_client_property -- project-manager old_end_date_day($tid)]
+ set old_end_date_month [ad_get_client_property -- project-manager old_end_date_month($tid)]
+ set old_end_date_year [ad_get_client_property -- project-manager old_end_date_year($tid)]
# end date
if { \
- ![string equal $old_end_date_day_arr($tid) $end_date_day_array($tid)] || \
- ![string equal $old_end_date_month_arr($tid) $end_date_month_array($tid)] || \
- ![string equal $old_end_date_year_arr($tid) $end_date_year_array($tid)]} {
+ ![string equal $old_end_date_day $end_date_day_array($tid)] || \
+ ![string equal $old_end_date_month $end_date_month_array($tid)] || \
+ ![string equal $old_end_date_year $end_date_year_array($tid)]} {
# internationalize the dates
- set iso_date_old "$old_end_date_year_arr($tid)-$old_end_date_month_arr($tid)-$old_end_date_day_arr($tid) 00:00:00"
+ set iso_date_old "$old_end_date_year-$old_end_date_month-$old_end_date_day 00:00:00"
set iso_date_new "$end_date_year_array($tid)-$end_date_month_array($tid)-$end_date_day_array($tid) 00:00:00"
if {[string equal $iso_date_old "-- 00:00:00"]} {
@@ -2120,78 +2153,95 @@
lappend changes "Hard deadline changed from $date_old to $date_new"
}
+ set old_one_line [ad_get_client_property -- project-manager old_one_line($tid)]
+
# one_line
- if {![string equal $old_one_line_arr($tid) $one_line_array($tid)]} {
- lappend changes "Subject changed from $old_one_line_arr($tid) to $one_line_array($tid)"
+ if {![string equal $old_one_line $one_line_array($tid)]} {
+ lappend changes "Subject changed from $old_one_line to $one_line_array($tid)"
}
+ set old_description [ad_get_client_property -- project-manager old_description($tid)]
+ set old_description_mime_type [ad_get_client_property -- project-manager old_description_mime_type($tid)]
+
# description
if { \
- ![string equal $old_description_arr($tid) $description_array($tid)] || \
- ![string equal $old_description_mime_type_arr($tid) $description_mime_type_array($tid)]} {
+ ![string equal $old_description $description_array($tid)] || \
+ ![string equal $old_description_mime_type $description_mime_type_array($tid)]} {
- set richtext_list [list $old_description_arr($tid) $old_description_mime_type_arr($tid)]
+ set richtext_list [list $old_description $old_description_mime_type]
set old_description_html [template::util::richtext::get_property html_value $richtext_list]
set richtext_list [list $description_array($tid) $description_mime_type_array($tid)]
set new_description_html [template::util::richtext::get_property html_value $richtext_list]
lappend changes "Description changed from
$old_description_html (see below for new description)"
}
+ set old_estimated_hours_work [ad_get_client_property -- project-manager old_estimated_hours_work($tid)]
+ set old_estimated_hours_work_min [ad_get_client_property -- project-manager old_estimated_hours_work_min($tid)]
+ 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_arr($tid) $estimated_hours_work_min_array($tid)]} {
- lappend changes "Work estimate (min) changed from $old_estimated_hours_work_min_arr($tid) to $estimated_hours_work_min_array($tid) hrs"
+ 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_arr($tid) $estimated_hours_work_max_array($tid)]} {
- lappend changes "Work estimate (max) changed from $old_estimated_hours_work_max_arr($tid) to $estimated_hours_work_max_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_arr($tid) $estimated_hours_work_array($tid)]} {
- lappend changes "Work estimate (min) changed from $old_estimated_hours_work_arr($tid) to $estimated_hours_work_array($tid) hrs"
+ 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"
}
}
+ set old_assignees [ad_get_client_property -- \
+ project-manager \
+ old_assignees($tid)]
+
set new_assignees [pm::task::get_assignee_names \
-task_item_id $task_item_id($num)]
# check for assignees that have been added
foreach new $new_assignees {
- if { [lsearch $old_assignees_arr($tid) $new] == -1} {
+ if { [lsearch $old_assignees $new] == -1} {
lappend changes "Added: $new"
}
}
# check for assignees that have been removed
- foreach old $old_assignees_arr($tid) {
+ foreach old $old_assignees {
if { [lsearch $new_assignees $old] == -1} {
lappend changes "Removed: $old"
}
}
+ set old_project_item_id [ad_get_client_property -- project-manager old_project_item_id($tid)]
+
# project
- if {![string equal $old_project_item_id_arr($tid) $project_item_id_array($tid)]} {
+ if {![string equal $old_project_item_id $project_item_id_array($tid)]} {
- set old [pm::project::name -project_item_id $old_project_item_id_arr($tid)]
+ set old [pm::project::name -project_item_id $old_project_item_id]
lappend changes "Project changed from $old"
}
+ set old_dependency [ad_get_client_property -- project-manager old_dependency($tid)]
+
# dependency
- if {![string equal $old_dependency_arr($tid) $dependency_array($tid)]} {
+ if {![string equal $old_dependency $dependency_array($tid)]} {
- if {[empty_string_p $old_dependency_arr($tid)]} {
+ if {[empty_string_p $old_dependency]} {
set old "Nothing"
} else {
set old [pm::task::name \
- -task_item_id $old_dependency_arr($tid)]
+ -task_item_id $old_dependency]
}
if {[empty_string_p $dependency_array($tid)]} {
@@ -2201,7 +2251,7 @@
-task_item_id $dependency_array($tid)]
}
- lappend changes "Dependency changed from $old ($old_dependency_arr($tid)) to $new ($dependency_array($tid))"
+ lappend changes "Dependency changed from $old ($old_dependency) to $new ($dependency_array($tid))"
}
@@ -2223,3 +2273,91 @@
}
+
+
+ad_proc -public pm::task::clear_client_properties {
+ {-task_item_id:required}
+} {
+ Clears all the client properties for a given task_item_id
+
+ @author (ibr@test)
+ @creation-date 2004-11-03
+
+ @param task_item_id
+
+ @return
+
+ @error
+} {
+
+ ad_set_client_property -persistent f -- \
+ project-manager \
+ old_one_line($task_item_id) \
+ ""
+
+ ad_set_client_property -persistent f -- \
+ project-manager \
+ old_description($task_item_id) \
+ ""
+
+ ad_set_client_property -persistent f -- \
+ project-manager \
+ old_description_mime_type($task_item_id) \
+ ""
+
+ ad_set_client_property -persistent f -- \
+ project-manager \
+ old_estimated_hours_work($task_item_id) \
+ ""
+
+ ad_set_client_property -persistent f -- \
+ project-manager \
+ old_estimated_hours_work_min($task_item_id) \
+ ""
+
+ ad_set_client_property -persistent f -- \
+ project-manager \
+ old_estimated_hours_work_max($task_item_id) \
+ ""
+
+ ad_set_client_property -persistent f -- \
+ project-manager \
+ old_dependency($task_item_id) \
+ ""
+
+ ad_set_client_property -persistent f -- \
+ project-manager \
+ old_percent_complete($task_item_id) \
+ ""
+
+ ad_set_client_property -persistent f -- \
+ project-manager \
+ old_end_date_day($task_item_id) \
+ ""
+
+ ad_set_client_property -persistent f -- \
+ project-manager \
+ old_end_date_month($task_item_id) \
+ ""
+
+ ad_set_client_property -persistent f -- \
+ project-manager \
+ old_end_date_year($task_item_id) \
+ ""
+
+ ad_set_client_property -persistent f -- \
+ project-manager \
+ old_project_item_id($task_item_id) \
+ ""
+
+ ad_set_client_property -persistent f -- \
+ project-manager \
+ old_assignees($task_item_id) \
+ ""
+
+ ad_set_client_property -persistent f -- \
+ project-manager \
+ old_assignees($task_item_id) \
+ ""
+
+}