Index: openacs-4/contrib/packages/project-manager/www/task-revisions.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-revisions.tcl,v
diff -u -r1.1.2.1 -r1.1.2.2
--- openacs-4/contrib/packages/project-manager/www/task-revisions.tcl 20 May 2004 17:30:05 -0000 1.1.2.1
+++ openacs-4/contrib/packages/project-manager/www/task-revisions.tcl 2 Jul 2004 23:13:49 -0000 1.1.2.2
@@ -21,7 +21,7 @@
}
-set task_term [parameter::get -parameter "TaskName" -default "Task"]
+set task_term [parameter::get -parameter "TaskName" -default "Task Revisions"]
set title "$task_term Changes"
@@ -64,34 +64,49 @@
label "Deadline"
}
} \
- -orderby {
- revision_id {orderby revision_id}
- percent_complete {orderby percent_complete}
- end_date {orderby end_date}
- default_value revision_id,desc
- } \
- -orderby_name orderby_revisions \
-sub_class {
narrow
- } \
- -filters {
- task_revision_id {}
- orderby_dependency {}
- orderby_dependency2 {}
- } \
- -html {
- width 100%
- }
+ }
+set descriptions [list]
-db_multirow -extend { item_url description_rich } revisions task_revisions_query {
+db_multirow -extend { item_url description_rich old_revision_id } revisions task_revisions_query {
} {
set item_url [export_vars -base "task-one" -override {{task_revision_id $revision_id}} -exclude {revision_id} { revision_id task_id}]
set richtext_list [list $description $mime_type]
set description_rich [template::util::richtext::get_property html_value $richtext_list]
+ set descriptions_length [llength $descriptions]
+
+ # if there isn't any previous items, then we don't have to do a
+ # word diff. All the content is new.
+ if {$descriptions_length < 1} {
+ set description_rich $description_rich
+ lappend descriptions "$description_rich"
+
+ } else {
+
+ set old_description [lindex $descriptions [expr [llength $descriptions] - 1]]
+ set old_description [ad_html_to_text $old_description]
+ lappend descriptions "$description_rich"
+
+ set description_rich [pm::util::word_diff \
+ -split_by " " \
+ -old "$old_description" \
+ -start_old "" \
+ -end_old "" \
+ -start_new "" \
+ -end_new "" \
+ -new "[ad_html_to_text $description_rich]" \
+ -filter_proc ""]
+
+ # set description_rich [ad_html_to_text $description_rich]
+ set description_rich [ad_text_to_html -no_quote -includes_html -- $description_rich]
+
+ }
+
}