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.6 -r1.2.2.7 --- openacs-4/contrib/packages/project-manager/tcl/project-manager-procs.tcl 16 Sep 2004 18:25:36 -0000 1.2.2.6 +++ openacs-4/contrib/packages/project-manager/tcl/project-manager-procs.tcl 20 Sep 2004 18:32:32 -0000 1.2.2.7 @@ -302,22 +302,18 @@ where revision_id = :revision_id } - db_exec_plsql grant_permission { - begin - perform acs_permission__grant_permission ( - /* object_id => */ :comment_id, - /* grantee_id => */ :user_id, - /* privilege => */ 'read' - ); + if {![empty_string_p $user_id]} { + permission::grant \ + -object_id $comment_id \ + -party_id $user_id \ + -privilege "read" - perform acs_permission__grant_permission ( - /* object_id => */ :comment_id, - /* grantee_id => */ :user_id, - /* privilege => */ 'write' - ); - return 0; - end; + permission::grant \ + -object_id $comment_id \ + -party_id $user_id \ + -privilege "write" } + } # now send out email @@ -336,18 +332,22 @@ set from_address [db_string get_from_email "select email from parties where party_id = :user_id" -default "nobody@nowhere.com"] - set task_url "[parameter::get_from_package_key -package_key acs-kernel -parameter SystemURL][ad_conn package_url]task-one?task_id=$object_id" + set task_url [pm::task::get_url $object_id] set subject "Task comment: $title" - set content "$task_url\n\n$comment" + # convert to HTML + set richtext_list [list $comment $mime_type] + set comment_html [template::util::richtext::get_property html_value $richtext_list] + + set content "$title

$comment_html" pm::util::email \ -to_addr $to_address \ -from_addr $from_address \ -subject $subject \ -body $content \ - -mime_type $mime_type + -mime_type "text/html" } } @@ -364,18 +364,24 @@ set from_address [db_string get_from_email "select email from parties where party_id = :user_id" -default "nobody@nowhere.com"] - set project_url "[parameter::get_from_package_key -package_key acs-kernel -parameter SystemURL][ad_conn package_url]one?project_item_id=$object_id" + set project_url [pm::project::url \ + -project_item_id $object_id] set subject "Project comment: $title" + + # convert to HTML + set richtext_list [list $comment $mime_type] + set comment_html [template::util::richtext::get_property html_value $richtext_list] + + set content "$title

$comment_html" + - set content "$project_url\n\n$comment" - pm::util::email \ -to_addr $to_address \ -from_addr $from_address \ -subject $subject \ -body $content \ - -mime_type $mime_type + -mime_type "text/html" }