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.15 -r1.4.2.16 --- openacs-4/contrib/packages/project-manager/tcl/task-procs.tcl 9 Sep 2004 18:46:57 -0000 1.4.2.15 +++ openacs-4/contrib/packages/project-manager/tcl/task-procs.tcl 9 Sep 2004 23:58:21 -0000 1.4.2.16 @@ -939,41 +939,51 @@ set from_address [db_string get_from_email "select email from parties where party_id = :user_id" -default "nobody@nowhere.com"] + # I think this ad_conn package_url is incorrect. If called + # from logger, it will return where logger is mounted. set task_url "[parameter::get_from_package_key -package_key acs-kernel -parameter SystemURL][ad_conn package_url]task-one?task_id=$task_item_id" set subject "Task Reopened (was $status_description): $task_title" set notification_text "Task reopened, was $status_description\n\n" - set task_description [ad_html_text_convert -from $mime_type -to "text/plain" -- $task_description] + set task_description [ad_html_text_convert -from $mime_type -to "text/html" -- $task_description] append notification_text " -------------- -Subject: $task_title (\#$task_item_id) -Project: $project_name +
+ + + + + + + + + +
Subject:$task_title (\#$task_item_id)
Project:$project_name
-Link: $task_url - ------------ -Description ------------ +

Description

$task_description ------- -Dates: ------- -Latest start: $latest_start -Latest finish $latest_finish +

Dates:

+ + + + + + + + + +
Latest start:$latest_start
Latest finish$latest_finish
" - - append notification_text "\n" - pm::util::email \ -to_addr $to_address \ -from_addr $from_address \ -subject $subject \ - -body $notification_text + -body $notification_text \ + -mime_type "text/html" } return @@ -1068,7 +1078,7 @@ set from_address [db_string get_from_email "select email from parties where party_id = :user_id" -default "nobody@nowhere.com"] set last_time_stamp "" - set work_log "----------------------\nWork done on this task\n----------------------\n\n" + set work_log "

Work done on this task

" db_foreach get_logged_time " SELECT @@ -1095,64 +1105,72 @@ ao.creation_user = submitter.user_id ORDER BY le.time_stamp desc" { + append work_log "" + if {![string equal $time_stamp_pretty $last_time_stamp]} { - append work_log "* $time_stamp_pretty\n\n" + append work_log "\n" set last_time_stamp $time_stamp_pretty + + append work_log "" } set task_url "[parameter::get_from_package_key -package_key acs-kernel -parameter SystemURL][ad_conn package_url]task-one?task_id=$task_item_id" set subject "Task Closed (was $status_description) $task_title" - if {[string is true [parameter::get_from_package_key -package_key project-manager -parameter UseUncertainCompletionTimesP]]} { - set estimated_work "\nHrs work (min): $estimated_hours_work_min\nHrs work (max): $estimated_hours_work_max" - } else { - set estimated_work "\nHrs work: $estimated_hours_work" - - } - set notification_text "Task closed, was $status_description\n\n" - set task_description [ad_html_text_convert -from $mime_type -to "text/plain" -- $task_description] + set task_description [ad_html_text_convert -from $mime_type -to "text/html" -- $task_description] - set comment [ad_html_text_convert -from $comment_type -to "text/plain" -- $comment] + set comment [ad_html_text_convert -from $comment_type -to "text/html" -- $comment] append notification_text " +

Comment:

$comment -------------- -Subject: $task_title (\#$task_item_id) -Project: $project_name -Link: $task_url +
+
$time_stamp_pretty" + } else { + append work_log " " } - append work_log "[pm::util::string_truncate_and_pad -length 15 -string "$user_name:"] $description ($value hrs)\n" + append work_log "$user_name$description$value hrs
+ + + + + + + + +
Subject:$task_title (\#$task_item_id)
Project:$project_name
" - append notification_text "\n\n$work_log" + append notification_text "$work_log" append notification_text " ---------------- -Estimated work: ----------------$estimated_work - ------------ -Description ------------ +

Description

$task_description ------- -Dates: ------- -Latest start: $latest_start -Latest finish $latest_finish +

Dates:

+ + + + + + + + + +
Latest start:$latest_start
Latest finish$latest_finish
" pm::util::email \ -to_addr $to_address \ -from_addr $from_address \ -subject $subject \ - -body $notification_text + -body $notification_text \ + -mime_format "text/html" } return @@ -1396,6 +1414,7 @@ {-assignee_role_name ""} {-edit_p "t"} {-comment ""} + {-comment_mime_type "text/plain"} {-description ""} {-description_mime_type "text/plain"} {-old_description ""} @@ -1550,7 +1569,7 @@ if {[empty_string_p $comment]} { set comment_text "" } else { - set comment_text "--------\nCOMMENT:\n--------\n$comment\n\n" + set comment_text "

Comment:

$comment

" } if {[exists_and_not_null url]} { @@ -1559,39 +1578,53 @@ set task_url "unavailable" } + set description [ad_html_text_convert -from $description_mime_type -to "text/html" -- $description] + set old_description [ad_html_text_convert -from $old_description_mime_type -to "text/html" -- $old_description] - set description [ad_html_text_convert -from $description_mime_type -to "text/plain" -- $description] - set old_description [ad_html_text_convert -from $old_description_mime_type -to "text/plain" -- $old_description] - if {![string equal $description $old_description] && [string is true $edit_p]} { - set description_out "$description \n\n-------\nOld description:\n-------\n\n$old_description" + set description_out "$description

Old description:

$old_description" - append intro_text "\nSee below to see the changes in the description" - } else { set description_out $description } - set notification_text "$intro_text\n\n$comment_text-------------" - append notification_text "\nTask overview\n-------------" - append notification_text "\nSubject: $subject (\#$task_item_id)" - append notification_text "\nProject: $project_name" - append notification_text "\nYour role: $assignee_role_name" - append notification_text "\nLink: $task_url" - append notification_text "\n\n-----------\nDescription\n-----------" - append notification_text "\n$description_out" - append notification_text "\n\n------\nDates:" - append notification_text "\n------" - append notification_text "\nLatest start: $latest_start" - append notification_text "\nLatest finish *$latest_finish" + set notification_text "${intro_text}${comment_text} +

Task overview

+ + + + + + + + + + + + + +
Subject:$subject (\#$task_item_id)
Project:$project_name
Your role:$assignee_role_name
+

Description

+$description_out +

Dates:

+ + + + + + + + + +
Latest start:$latest_start
Latest finish$latest_finish
" pm::util::email \ -to_addr $to_address \ -from_addr $from_address \ -subject $subject_out \ - -body $notification_text + -body $notification_text \ + -mime_type "text/html" - }