Index: openacs-4/packages/forums/tcl/forum-reply-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/tcl/forum-reply-procs-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/forums/tcl/forum-reply-procs-oracle.xql 20 Sep 2002 21:31:26 -0000 1.1 @@ -0,0 +1,26 @@ + + + oracle8.1.6 + + + + select site_node.url(node_id) + from site_nodes + where object_id = (select package_id + from forums_forums + where forums_forums.forum_id = :forum_id) + + + + + + + + + + + + + + + Index: openacs-4/packages/forums/tcl/forum-reply-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/tcl/forum-reply-procs-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/forums/tcl/forum-reply-procs-postgresql.xql 20 Sep 2002 21:31:26 -0000 1.1 @@ -0,0 +1,18 @@ + + + postgresql7.1 + + + + select site_node__url(node_id) + from site_nodes + where object_id = (select package_id + from forums_forums + where forums_forums.forum_id = :forum_id) + + + + + + + Index: openacs-4/packages/forums/tcl/forum-reply-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/tcl/forum-reply-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/forums/tcl/forum-reply-procs.tcl 29 Jun 2002 00:21:46 -0000 1.1 +++ openacs-4/packages/forums/tcl/forum-reply-procs.tcl 20 Sep 2002 21:31:26 -0000 1.2 @@ -13,7 +13,29 @@ ad_proc -public get_url { object_id } { + returns a full url to the object_id. + handles messages and forums. + } { + set object_type [db_string select_object_type {}] + + if {[string compare $object_type "forums_message"] == 0} { + + # object is a message + set message_id $object_id + forum::message::get -message_id $message_id -array message + set forum_id $message(forum_id) + set forum_url "[ad_url][db_string select_forums_package_url {}]" + return ${forum_url}message-view?message_id=$message(root_message_id) + + } else { + + # object_type is a forum + set forum_id $object_id + set forum_url "[ad_url][db_string select_forums_package_url {}]" + return ${forum_url}forum-view?forum_id=$forum_id + + } } ad_proc -public process_reply { Index: openacs-4/packages/forums/tcl/forum-reply-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/tcl/forum-reply-procs.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/forums/tcl/forum-reply-procs.xql 20 Sep 2002 21:31:26 -0000 1.1 @@ -0,0 +1,22 @@ + + + + + + select object_type + from acs_objects + where object_id = :object_id + + + + + + + + + + + + + + Index: openacs-4/packages/forums/tcl/messages-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/tcl/messages-procs.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/forums/tcl/messages-procs.tcl 20 Aug 2002 21:39:42 -0000 1.10 +++ openacs-4/packages/forums/tcl/messages-procs.tcl 20 Sep 2002 21:31:26 -0000 1.11 @@ -27,6 +27,7 @@ set user_id [ad_conn user_id] } + set original_message_id $message_id # 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} @@ -38,6 +39,26 @@ if {[info exists message(state)] && [string equal $message(state) approved]} { do_notifications -message_id $message_id } + } on_error { + + db_abort_transaction + + # Check to see if the message with a message_id matching the + # message_id arguement was in the database before calling + # this procedure. If so, the error is due to a double click + # and we should continue without returning an error. + + if {![empty_string_p $original_message_id]} { + # The was a non-null message_id arguement + if {[db_string message_exists_p " + select count(message_id) + from forums_messages + where message_id = :message_id"]} { + + return $message_id + + } + } } return $message_id @@ -59,10 +80,34 @@ append new_content "Posted: $message(posting_date)
" append new_content "\n
\n" append new_content $message(content) + append new_content "

-------------------
" # send text for now. set new_content [ad_html_to_text $new_content] + set html_version $new_content + set text_version "" + append text_version " +Forum: $message(forum_name) +Thread: $message(root_message_id) +Author: $message(user_name) ($message(user_email)) +Posted: $message(posting_date) +---------------------------------- +[ad_html_to_text $message(content)] +--------------------------------- +To post a reply to this email or view this message go to: +${url}message-view?message_id=$message(root_message_id) + +To view Forum $message(forum_name) go to: +${url}forum-view?forum_id=$message(forum_id) + +To email the author($message(user_name)) privately: +mailto:$message(user_email) +" + set new_content $text_version + ns_log notice "requesting a notification with subject $message(forum_name) $message(subject)" + + # Do the notification for the forum notification::new \ -type_id [notification::type::get_type_id \ Index: openacs-4/packages/forums/tcl/messages-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/tcl/messages-procs.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/forums/tcl/messages-procs.xql 22 Jun 2002 20:58:04 -0000 1.2 +++ openacs-4/packages/forums/tcl/messages-procs.xql 20 Sep 2002 21:31:26 -0000 1.3 @@ -27,4 +27,12 @@ + + + select count(message_id) + from forums_messages + where message_id = :message_id + + + Index: openacs-4/packages/forums/www/forum-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/forum-view.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/forums/www/forum-view.tcl 10 Sep 2002 22:22:56 -0000 1.7 +++ openacs-4/packages/forums/www/forum-view.tcl 20 Sep 2002 21:31:27 -0000 1.8 @@ -50,6 +50,11 @@ # Get forum data forum::get -forum_id $forum_id -array forum +#it is confusing to provide a moderate link for non-moderated forums. +if { $forum(posting_policy) != "moderated" } { + set moderate_p 0 +} + # If disabled! if {$forum(enabled_p) != "t"} { ad_returnredirect "./" Index: openacs-4/packages/forums/www/message-chunk.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/Attic/message-chunk.adp,v diff -u -r1.10 -r1.11 --- openacs-4/packages/forums/www/message-chunk.adp 4 Sep 2002 13:54:58 -0000 1.10 +++ openacs-4/packages/forums/www/message-chunk.adp 20 Sep 2002 21:31:27 -0000 1.11 @@ -49,11 +49,13 @@ - + +

<%= [ad_text_to_html -- "$message(content)"] %> +
@message.content@ Index: openacs-4/packages/forums/www/message-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/message-view.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/forums/www/message-view.tcl 10 Sep 2002 22:22:56 -0000 1.10 +++ openacs-4/packages/forums/www/message-view.tcl 20 Sep 2002 21:31:27 -0000 1.11 @@ -105,8 +105,10 @@ set context [list [list "./forum-view?forum_id=$message(forum_id)" "$message(forum_name)"]] if {![empty_string_p $message(parent_id)]} { lappend context [list "./message-view?message_id=$message(root_message_id)" "Entire Thread"] + lappend context {One Message} +} else { + lappend context {One Thread} } -lappend context {One Message} if {[string equal $forum(presentation_type) flat]} { ad_return_template "message-view-flat" Index: openacs-4/packages/forums/www/admin/forum-new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/admin/forum-new.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/forums/www/admin/forum-new.tcl 10 Sep 2002 22:22:57 -0000 1.7 +++ openacs-4/packages/forums/www/admin/forum-new.tcl 20 Sep 2002 21:31:28 -0000 1.8 @@ -48,7 +48,8 @@ -label "Users Can Create New Threads" \ -datatype integer \ -widget radio \ - -options {{yes 1} {no 0}} + -options {{yes 1} {no 0}} \ + -default 1 if {[form is_valid forum]} { template::form get_values forum \