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.4 -r1.2.2.5
--- openacs-4/contrib/packages/project-manager/tcl/project-manager-procs.tcl 9 Jul 2004 17:38:28 -0000 1.2.2.4
+++ openacs-4/contrib/packages/project-manager/tcl/project-manager-procs.tcl 9 Sep 2004 23:58:21 -0000 1.2.2.5
@@ -414,15 +414,41 @@
@error
} {
- set nice_text [ad_html_text_convert -from $mime_type -to "text/plain" -- $body]
+ # HTML portions of this copied from notification::email::send
+ if {[string equal $mime_type "text/plain"]} {
+ set body_text $body
+ set body_html [ad_html_text_convert -from $mime_type -to "text/html" -- $body]
+ } elseif {[string equal $mime_type "text/html"]} {
+ set body_text [ad_html_text_convert -from $mime_type -to "text/plain" -- $body]
+ set body_html $body
+
+ } else {
+ set body_text [ad_html_text_convert -from $mime_type -to "text/plain" -- $body]
+ set body_html [ad_html_text_convert -from $mime_type -to "text/html" -- $body]
+
+ }
+
+ # Use this to build up extra mail headers
+ set extra_headers [ns_set new]
+
+ # This should disable most auto-replies
+ ns_set put $extra_headers Precedence list
+
+ set message_data [build_mime_message $body_text $body_html]
+ ns_set put $extra_headers MIME-Version [ns_set get $message_data MIME-Version]
+ ns_set put $extra_headers Content-ID [ns_set get $message_data Content-ID]
+ ns_set put $extra_headers Content-Type [ns_set get $message_data Content-Type]
+ set content [ns_set get $message_data body]
+
foreach to $to_addr {
acs_mail_lite::send \
-to_addr "$to" \
-from_addr "$from_addr" \
-subject "$subject" \
- -body "$nice_text"
+ -body $content \
+ -extraheaders $extra_headers
}
}
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 "$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 | \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
+
+
+
+ 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"
-
}
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.8 -r1.27.2.9
--- openacs-4/contrib/packages/project-manager/www/task-add-edit.tcl 19 Aug 2004 00:01:27 -0000 1.27.2.8
+++ openacs-4/contrib/packages/project-manager/www/task-add-edit.tcl 9 Sep 2004 23:58:22 -0000 1.27.2.9
@@ -384,7 +384,8 @@
set format $comment_format($i)
set richtext_list [list [set comment_$i] $format]
- lappend comment_list [ad_html_to_text [template::util::richtext::get_property html_value $richtext_list]]
+ lappend comment_list [template::util::richtext::get_property html_value $richtext_list]
+ lappend comment_formats $format
}
@@ -1163,7 +1164,7 @@
} -after_submit {
- ad_returnredirect -message "Task(s) saved. Now choose assignees" "task-assign-add-edit?[export_vars -url {comment_list edit_p return_url process_task_id:multiple revisions:multiple task_id:multiple old_description send_email_p}]"
+ ad_returnredirect -message "Task(s) saved. Now choose assignees" "task-assign-add-edit?[export_vars -url {comment_list comment_formats edit_p return_url process_task_id:multiple revisions:multiple task_id:multiple old_description send_email_p}]"
# compile a list of which projects the tasks are assigned to
# there is a bug here, because we don't update a project when a
Index: openacs-4/contrib/packages/project-manager/www/task-assign-add-edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-assign-add-edit.tcl,v
diff -u -r1.8.2.5 -r1.8.2.6
--- openacs-4/contrib/packages/project-manager/www/task-assign-add-edit.tcl 13 Aug 2004 18:57:34 -0000 1.8.2.5
+++ openacs-4/contrib/packages/project-manager/www/task-assign-add-edit.tcl 9 Sep 2004 23:58:22 -0000 1.8.2.6
@@ -24,7 +24,8 @@
party_id:array,optional
{return_url ""}
{edit_p "t"}
- {comment_list ""}
+ {comment_list:html ""}
+ {comment_formats ""}
{old_description:html ""}
{send_email_p "t"}
@@ -45,6 +46,7 @@
set old_description [string map {"-" " "} $old_description]
set comment_list [string map {"-" " "} $comment_list]
+set comment_formats [string map {"-" " "} $comment_formats]
set process_task_id [string map {"-" " "} $process_task_id]
set revisions [string map {"-" " "} $revisions]
set task_id [string map {"-" " "} $task_id]
@@ -56,6 +58,7 @@
set index 0
foreach t_id $task_id {
set comment_value($t_id) [lindex $comment_list $index]
+ set comment_format($t_id) [lindex $comment_formats $index]
set old_description_value($t_id) [lindex $old_description $index]
incr index
}
@@ -143,6 +146,7 @@
set process_task_id_pass [string map {" " "-"} $process_task_id]
set revisions_pass [string map {" " "-"} $revisions]
set comment_pass [string map {" " "-"} $comment_list]
+set comment_format_pass [string map {" " "-"} $comment_formats]
set old_description_pass [string map {" " "-"} $old_description]
set task_id_pass [string map {" " "-"} $task_id]
@@ -170,6 +174,9 @@
{comment_list:text(hidden)
{value $comment_pass}}
+ {comment_formats:text(hidden)
+ {value $comment_format_pass}}
+
{old_description:text(hidden)
{value $old_description_pass}}
@@ -285,6 +292,8 @@
# If there is a comment for this task, then display it
# prominently in the email
set my_comment $comment_value($t_id)
+ set my_comment_format $comment_format($t_id)
+
set my_old_description $old_description_value($t_id)
if {[string is true $send_email_p]} {
@@ -295,6 +304,7 @@
-assignee_role_name $role_oneline($r_id) \
-edit_p $edit_p \
-comment $my_comment \
+ -comment_mime_type $my_comment_format \
-description $descriptions($t_id) \
-old_description $my_old_description \
-subject $one_lines($t_id) \