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.36 -r1.37 --- openacs-4/contrib/packages/project-manager/www/task-add-edit.tcl 4 Jun 2004 16:19:45 -0000 1.36 +++ openacs-4/contrib/packages/project-manager/www/task-add-edit.tcl 10 Jun 2004 20:23:12 -0000 1.37 @@ -1016,9 +1016,6 @@ SELECT to_char(current_date, 'YYYY-MM-DD')"] - # insert the comment into the database - set is_live [ad_parameter AutoApproveCommentsP {general-comments} {t}] - # -------------------------------------------------------------- # each task we edit returns a task_revision_id # -------------------------------------------------------------- @@ -1124,68 +1121,16 @@ # add in general comments for the task if {![empty_string_p $p_comment]} { + + pm::util::general_comment_add \ + -object_id $p_task_item_id \ + -title "$p_task_title" \ + -comment "$p_comment" \ + -mime_type "$p_comment_type" \ + -user_id $user_id \ + -peeraddr $peeraddr \ + -send_email_p "f" - set comment_id [db_nextval acs_object_id_seq] - - db_transaction { - db_exec_plsql insert_comment { - select acs_message__new ( - :comment_id, -- 1 p_message_id - NULL, -- 2 p_reply_to - current_timestamp, -- 3 p_sent_date - NULL, -- 4 p_sender - NULL, -- 5 p_rfc822_id - :p_task_title, -- 6 p_title - NULL, -- 7 p_description - :p_comment_type, -- 8 p_mime_type - NULL, -- 9 p_text - NULL, -- empty_blob(), -- 10 p_data - 0, -- 11 p_parent_id - :p_task_item_id, -- 12 p_context_id - :user_id, -- 13 p_creation_user - :peeraddr, -- 14 p_creation_ip - 'acs_message', -- 15 p_object_type - :is_live -- 16 p_is_live - ) - } - - db_dml add_entry { - insert into general_comments - (comment_id, - object_id, - category) - values - (:comment_id, - :p_task_item_id, - null) - } - - db_1row get_revision { - select content_item__get_latest_revision(:comment_id) as revision_id - } - - db_dml set_content { - update cr_revisions - set content = :p_comment - 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' - ); - perform acs_permission__grant_permission ( - /* object_id => */ :comment_id, - /* grantee_id => */ :user_id, - /* privilege => */ 'write' - ); - return 0; - end; - } - } } }