Index: openacs.org-dev/packages/forums/tcl/messages-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs.org-dev/packages/forums/tcl/messages-procs.tcl,v
diff -u -r1.8 -r1.9
--- openacs.org-dev/packages/forums/tcl/messages-procs.tcl 31 Oct 2002 18:32:36 -0000 1.8
+++ openacs.org-dev/packages/forums/tcl/messages-procs.tcl 17 Apr 2003 14:30:35 -0000 1.9
@@ -18,6 +18,7 @@
{-content:required}
{-html_p "f"}
{-user_id ""}
+ {-posting_date ""}
} {
create a new message
} {
@@ -29,7 +30,7 @@
# Prepare the variables for instantiation
set extra_vars [ns_set create]
- oacs_util::vars_to_ns_set -ns_set $extra_vars -var_list {forum_id message_id parent_id subject content html_p user_id}
+ oacs_util::vars_to_ns_set -ns_set $extra_vars -var_list {forum_id message_id parent_id subject content html_p user_id posting_date}
db_transaction {
set message_id [package_instantiate_object -extra_vars $extra_vars forums_message]
@@ -52,28 +53,44 @@
set forum_id $message(forum_id)
set url "[ad_url][db_string select_forums_package_url {}]"
- set new_content ""
- append new_content "Forum: $message(forum_name)
\n"
- append new_content "Thread: $message(root_subject)
\n"
- append new_content "Author: $message(user_name)
\n"
- append new_content "Posted: $message(posting_date)
"
- append new_content "\n
\n"
- append new_content $message(content)
+ ## JCD: new_content not used for now.
+ #set new_content ""
+ #append new_content "Forum: $message(forum_name)
\n"
+ #append new_content "Thread: $message(root_subject)
\n"
+ #append new_content "Author: $message(user_name)
\n"
+ #append new_content "\n
\n"
+ #append new_content $message(content)
+ #append new_content "
-------------------
"
+ ## send text for now.
+ ## only convert if it is not already text
+ #set new_content [ad_html_to_text $new_content]
- # send text for now.
- if { $message(html_p) == "t" } {
- set body_text [ad_html_to_text $message(content)]
- } else {
- set body_text [wrap_string $message(content) 72]
- }
+ set new_content ""
+ append new_content "Forum: $message(forum_name)
+Thread: $message(root_subject)
+Author: $message(user_name) <$message(user_email)>
+
+"
+ if { $message(html_p) } {
+ append new_content "[ad_html_to_text $message(content)]"
+ } else {
+ append new_content "[wrap_string $message(content)]"
+ }
+ append new_content "
+
+--
+To post a reply to this email or view this message go to:
+${url}message-view?message_id=$message(root_message_id)"
+
+
# Do the notification for the forum
notification::new \
-type_id [notification::type::get_type_id \
-short_name forums_forum_notif] \
-object_id $message(forum_id) \
-response_id $message(message_id) \
- -notif_subject $message(subject) \
+ -notif_subject "\[$message(forum_name)\] $message(subject)" \
-notif_text $new_content
# Eventually we need notification for the root message too
@@ -82,7 +99,7 @@
-short_name forums_message_notif] \
-object_id $message(root_message_id) \
-response_id $message(message_id) \
- -notif_subject $message(subject) \
+ -notif_subject "\[$message(forum_name)\] $message(subject)" \
-notif_text $new_content
}
@@ -169,6 +186,15 @@
db_foreach get_notifications_for_delete {} {
db_exec_plsql delete_notification {}
}
+
+
+ #delete all rows in notifications table also -DaveB
+ db_foreach get_notifications_for_delete {} {
+ db_exec_plsql delete_notification {}
+ }
+
+
+
# Remove the message
db_exec_plsql delete_message {}
}