Index: openacs-4/packages/forums/sql/oracle/forums-forums-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/sql/oracle/forums-forums-create.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/forums/sql/oracle/forums-forums-create.sql 29 May 2002 21:40:10 -0000 1.1 +++ openacs-4/packages/forums/sql/oracle/forums-forums-create.sql 30 May 2002 06:25:52 -0000 1.2 @@ -83,7 +83,8 @@ pretty_plural => 'Forums Forums', table_name => 'forums_forums', id_column => 'forum_id', - package_name => 'forums_forum' + package_name => 'forums_forum', + name_method => 'forums_forum.name' ); end; / Index: openacs-4/packages/forums/tcl/forums-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/tcl/forums-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/forums/tcl/forums-procs.tcl 29 May 2002 21:40:10 -0000 1.1 +++ openacs-4/packages/forums/tcl/forums-procs.tcl 30 May 2002 06:25:52 -0000 1.2 @@ -43,6 +43,14 @@ db_dml update_forum {} } + ad_proc -public list_forums { + {-package_id:required} + } { + List all forums in a package + } { + return [db_list_of_ns_sets select_forums {}] + } + ad_proc -public get { {-forum_id:required} {-array:required} Index: openacs-4/packages/forums/tcl/forums-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/tcl/forums-procs.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/forums/tcl/forums-procs.xql 29 May 2002 21:40:10 -0000 1.1 +++ openacs-4/packages/forums/tcl/forums-procs.xql 30 May 2002 06:25:52 -0000 1.2 @@ -13,6 +13,15 @@ + + +select forum_id, name, posting_policy, presentation_type +from forums_forums +where package_id= :package_id +order by name + + + 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.1 -r1.2 --- openacs-4/packages/forums/tcl/messages-procs.tcl 29 May 2002 21:40:10 -0000 1.1 +++ openacs-4/packages/forums/tcl/messages-procs.tcl 30 May 2002 06:25:52 -0000 1.2 @@ -47,16 +47,20 @@ # Select all the important information get -message_id $message_id -array message - set new_content "$message(user_name) ($message(user_email)) posted on [util_AnsiDatetoPrettyDate $message(posting_date)]:" + set new_content "$message(forum_name) - $message(root_subject)\n" + append new_content "$message(user_name) ($message(user_email)) posted on [util_AnsiDatetoPrettyDate $message(posting_date)]:" append new_content "\n\n" append new_content $message(content) # Do the notification for the forum - notification::new -type_id [notification::type::get_type_id -short_name forums_forum_notif] \ + 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_text $new_content # Eventually we need notification for the root message too - # FIXME + notification::new \ + -type_id [notification::type::get_type_id -short_name forums_message_notif] \ + -object_id $message(root_message_id) -response_id $message(message_id) -notif_subject $message(subject) -notif_text $new_content } ad_proc -public edit { Index: openacs-4/packages/forums/www/master.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/Attic/master.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/forums/www/master.adp 29 May 2002 21:40:10 -0000 1.1 +++ openacs-4/packages/forums/www/master.adp 30 May 2002 06:25:52 -0000 1.2 @@ -1,6 +1,6 @@ @title@ -@context_bar@ +@context_bar@

@title@


Index: openacs-4/packages/forums/www/message-post-confirm.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/message-post-confirm.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/forums/www/message-post-confirm.adp 30 May 2002 06:25:52 -0000 1.1 @@ -0,0 +1,27 @@ + +Confirm Post to Forum: @forum.name@ + + +Please confirm the following post: +

+Subject: @subject@

+Body:
+

+@content@ +
+

+

+ +@exported_vars@ +

+ +Would you like to subscribe to responses? + No + Yes + +
+(Note that you are already subscribed to the forum as a whole. You may get duplicate notifications.) +
+
+ +

Index: openacs-4/packages/forums/www/message-post.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/message-post.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/forums/www/message-post.tcl 29 May 2002 21:40:10 -0000 1.1 +++ openacs-4/packages/forums/www/message-post.tcl 30 May 2002 06:25:52 -0000 1.2 @@ -38,17 +38,57 @@ element create message html_p \ -label "Format" -datatype text -widget select -options {{text f} {html t}} +element create message confirm_p \ + -label "Confirm?" -datatype text -widget hidden + +element create message subscribe_p \ + -label "Subscribe?" -datatype text -widget hidden + if {[form is_valid message]} { - template::form get_values message message_id forum_id parent_id subject content html_p + template::form get_values message message_id forum_id parent_id subject content html_p confirm_p subscribe_p + if {!$confirm_p} { + forum::get -forum_id $forum_id -array forum + + set confirm_p 1 + set exported_vars [export_form_vars message_id forum_id parent_id subject content html_p confirm_p] + + # Let's check if this person is subscribed to the forum + # in case we might want to subscribe them to the thread + if {[empty_string_p $parent_id]} { + if {![empty_string_p [notification::request::get_request_id \ + -type_id [notification::type::get_type_id -short_name forums_forum_notif] \ + -object_id $forum_id \ + -user_id [ad_conn user_id]]]} { + set forum_notification_p 1 + } else { + set forum_notification_p 0 + } + } + + ad_return_template message-post-confirm + return + } + forum::message::new -forum_id $forum_id \ -message_id $message_id \ -parent_id $parent_id \ -subject $subject \ -content $content \ -html_p $html_p - ad_returnredirect "message-view?message_id=$message_id" + set message_view_url "[ad_conn package_url]message-view?message_id=$message_id" + + if {$subscribe_p && [empty_string_p $parent_id]} { + set notification_url [notification::display::subscribe_url -type forums_message_notif -object_id $message_id -url $message_view_url -user_id [ad_conn user_id]] + + # redirect to notification stuff + ad_returnredirect $notification_url + } else { + # redirect to viewing the message + ad_returnredirect $message_view_url + } + ad_script_abort } @@ -66,5 +106,7 @@ element set_properties message forum_id -value $forum_id element set_properties message parent_id -value $parent_id element set_properties message message_id -value $message_id +element set_properties message confirm_p -value 0 +element set_properties message subscribe_p -value 0 ad_return_template Index: openacs-4/packages/forums/www/test.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/Attic/test.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/forums/www/test.tcl 29 May 2002 21:40:10 -0000 1.1 +++ openacs-4/packages/forums/www/test.tcl 30 May 2002 06:25:52 -0000 1.2 @@ -1,9 +1,2 @@ -db_transaction { - # create the forum - set forum_id [forum::new -name "test" -charter "test chrater" -presentation_type "flat" -posting_policy "open" -package_id [ad_conn package_id]] - set msg_id [forum::message::new -forum_id $forum_id -subject "Test" -content "this is rocking content" -user_id [ad_conn user_id]] -} - -doc_body_append $msg_id Index: openacs-4/packages/forums/www/user-history.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/user-history.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/forums/www/user-history.adp 29 May 2002 21:40:11 -0000 1.1 +++ openacs-4/packages/forums/www/user-history.adp 30 May 2002 06:25:52 -0000 1.2 @@ -2,6 +2,8 @@ Forums: Posting History for @user.full_name@ @context_bar@ +You are viewing Forums posting information for <%= [acs_community_member_link -user_id $user(user_id)] %>. +
@dimensional_chunk@
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.1 -r1.2 --- openacs-4/packages/forums/www/admin/forum-new.tcl 29 May 2002 21:40:11 -0000 1.1 +++ openacs-4/packages/forums/www/admin/forum-new.tcl 30 May 2002 06:25:52 -0000 1.2 @@ -7,6 +7,7 @@ @creation-date 2002-05-25 @cvs-id $id: Exp $ } { + {name ""} } # scoping @@ -56,6 +57,7 @@ # Pre-fetch the forum_id set forum_id [db_nextval acs_object_id_seq] element set_properties forum forum_id -value $forum_id +element set_properties forum name -value $name element set_properties forum new_threads_p -value 1 ad_return_template