Index: openacs-4/packages/project-manager/tcl/project-manager-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/tcl/project-manager-procs.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/project-manager/tcl/project-manager-procs.tcl 14 Sep 2005 22:18:32 -0000 1.6 +++ openacs-4/packages/project-manager/tcl/project-manager-procs.tcl 17 Oct 2005 21:25:24 -0000 1.7 @@ -324,6 +324,7 @@ {-user_id ""} {-peeraddr ""} {-type "task"} + {-to ""} {-send_email_p "f"} } { Adds a general comment to a task or project @@ -346,6 +347,8 @@ If empty, set to the ad_conn peeraddr @param type Either task or project. + + @param to Emails of users to send the message. @param send_email_p Whether or not to send out an email notification t or f @@ -435,9 +438,13 @@ # task if {[string equal $type task]} { + + if { [exists_and_not_null $to]} { + set assignees $to + } else { + set assignees [pm::task::assignee_email_list -task_item_id $object_id] + } - set assignees [pm::task::assignee_email_list -task_item_id $object_id] - if {[llength $assignees] > 0} { set to_address $assignees @@ -453,13 +460,16 @@ set comment_html [template::util::richtext::get_property html_value $richtext_list] set content "$title
$comment_html" - + + set project_item_id [pm::task::project_item_id -task_item_id $object_id] + pm::util::email \ -to_addr $to_address \ -from_addr $from_address \ -subject $subject \ -body $content \ - -mime_type "text/html" + -mime_type "text/html" \ + -object_id "$project_item_id" } } @@ -468,7 +478,11 @@ if {[string equal $type project]} { - set assignees [pm::project::assignee_email_list -project_item_id $object_id] + if { [exists_and_not_null $to]} { + set assignees $to + } else { + set assignees [pm::project::assignee_email_list -project_item_id $object_id] + } if {[llength $assignees] > 0} { @@ -493,10 +507,10 @@ -from_addr $from_address \ -subject $subject \ -body $content \ - -mime_type "text/html" + -mime_type "text/html" \ + -object_id "$object_id" } - } } @@ -511,6 +525,7 @@ {-subject:required} {-body ""} {-mime_type "text/plain"} + {-object_id ""} } { Wrapper to send out email, also converts body to text/plain format @@ -560,13 +575,15 @@ 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 $content \ - -extraheaders $extra_headers + if { ![empty_string_p $to] } { + acs_mail_lite::complex_send \ + -send_immediately \ + -to_addr "$to" \ + -from_addr "$from_addr" \ + -subject "$subject" \ + -body $content \ + -object_id $object_id + } } }