Index: openacs-4/packages/sloan-bboard/sql/oracle/bboard-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/sloan-bboard/sql/oracle/bboard-create.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/sloan-bboard/sql/oracle/bboard-create.sql 18 Feb 2002 20:56:18 -0000 1.2 +++ openacs-4/packages/sloan-bboard/sql/oracle/bboard-create.sql 23 Feb 2002 16:23:51 -0000 1.3 @@ -138,10 +138,13 @@ not null constraint bboard_forums_moderated_p_ck check (moderated_p in ('t','f')), - format varchar(200) default 'q-and-a' - constraint bboard_forums_format_nn not null - constraint bboard_forums_format_ck - check (format in ('q-and-a','thread')), + forum_type varchar(200) default 'q-and-a' + constraint bboard_forums_forum_type_nn not null + constraint bboard_forums_forum_type_ck + check (forum_type in ('q-and-a','thread')), + track_new_postings_p char(1) default 'f' + constraint bboard_forums_track_new_ck + check (track_new_postings_p in ('t','f')), bboard_id integer constraint bboard_forums_bboard_id_nn not null @@ -177,6 +180,24 @@ create index bboard_fmm_status_idx on bboard_forum_message_map (status); +-- +-- For tracking individual views on messages +-- (This is a client request, but I still think this will be problematic - ben) +-- +create table bboard_message_user_map ( + message_id integer + constraint bboard_mum_message_id_fk + references acs_messages (message_id) + on delete cascade, + user_id integer + constraint bboard_mum_user_id_fk + references users (user_id) + on delete cascade, + view_date date default sysdate + constraint bboard_mum_view_date_nn + not null +); + -- bboard categories -- -- these are for intra-forum categorization Index: openacs-4/packages/sloan-bboard/sql/oracle/bboard-packages.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/sloan-bboard/sql/oracle/bboard-packages.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/sloan-bboard/sql/oracle/bboard-packages.sql 18 Feb 2002 20:56:18 -0000 1.2 +++ openacs-4/packages/sloan-bboard/sql/oracle/bboard-packages.sql 23 Feb 2002 16:23:51 -0000 1.3 @@ -19,7 +19,7 @@ short_name in bboard_forums.short_name%TYPE, charter in bboard_forums.charter%TYPE default null, moderated_p in bboard_forums.moderated_p%TYPE default 'f', - format in bboard_forums.format%TYPE default 'q-and-a', + forum_type in bboard_forums.forum_type%TYPE default 'q-and-a', bboard_id in bboard_forums.bboard_id%TYPE, context_id in acs_objects.context_id%TYPE default null, creation_date in acs_objects.creation_date%TYPE default sysdate, @@ -202,7 +202,7 @@ short_name in bboard_forums.short_name%TYPE, charter in bboard_forums.charter%TYPE default null, moderated_p in bboard_forums.moderated_p%TYPE default 'f', - format in bboard_forums.format%TYPE default 'q-and-a', + forum_type in bboard_forums.forum_type%TYPE default 'q-and-a', bboard_id in bboard_forums.bboard_id%TYPE, context_id in acs_objects.context_id%TYPE default null, creation_date in acs_objects.creation_date%TYPE default sysdate, @@ -224,8 +224,8 @@ object_type => object_type ); insert into bboard_forums - (forum_id, short_name, charter, moderated_p, format, bboard_id) - values (v_forum_id, short_name, charter, moderated_p, format, bboard_id); + (forum_id, short_name, charter, moderated_p, forum_type, bboard_id) + values (v_forum_id, short_name, charter, moderated_p, forum_type, bboard_id); return v_forum_id; end new; Index: openacs-4/packages/sloan-bboard/sql/postgresql/bboard-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/sloan-bboard/sql/postgresql/bboard-create.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/sloan-bboard/sql/postgresql/bboard-create.sql 15 Feb 2002 21:27:06 -0000 1.1 +++ openacs-4/packages/sloan-bboard/sql/postgresql/bboard-create.sql 23 Feb 2002 16:23:51 -0000 1.2 @@ -154,6 +154,13 @@ not null constraint bboard_forums_moderated_p_ck check (moderated_p in ('t','f')), + forum_type varchar(200) default 'q-and-a' + constraint bboard_forums_forum_type_nn not null + constraint bboard_forums_forum_type_ck + check (forum_type in ('q-and-a','thread')), + track_new_postings_p char(1) default 'f' + constraint bboard_forums_track_new_ck + check (track_new_postings_p in ('t','f')), bboard_id integer constraint bboard_forums_bboard_id_nn not null @@ -191,6 +198,24 @@ create index bboard_fmm_status_idx on bboard_forum_message_map (status); +-- +-- For tracking individual views on messages +-- (This is a client request, but I still think this will be problematic - ben) +-- +create table bboard_message_user_map ( + message_id integer + constraint bboard_mum_message_id_fk + references acs_messages (message_id) + on delete cascade, + user_id integer + constraint bboard_mum_user_id_fk + references users (user_id) + on delete cascade, + view_date date default now() + constraint bboard_mum_view_date_nn + not null +); + -- bboard categories -- -- these are for intra-forum categorization Index: openacs-4/packages/sloan-bboard/sql/postgresql/bboard-packages.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/sloan-bboard/sql/postgresql/bboard-packages.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/sloan-bboard/sql/postgresql/bboard-packages.sql 15 Feb 2002 21:27:06 -0000 1.1 +++ openacs-4/packages/sloan-bboard/sql/postgresql/bboard-packages.sql 23 Feb 2002 16:23:51 -0000 1.2 @@ -27,20 +27,21 @@ ' language 'plpgsql'; -create function bboard_forum__new (integer, varchar, varchar, char, integer, - integer, timestamp, integer, varchar, varchar) +create function bboard_forum__new (integer, varchar, varchar, char, varchar, + integer, integer, timestamp, integer, varchar, varchar) returns integer as ' declare p_forum_id alias for $1; -- default null p_short_name alias for $2; p_charter alias for $3; -- default null p_moderated_p alias for $4; -- default ''f'' - p_bboard_id alias for $5; - p_context_id alias for $6; -- default null - p_creation_date alias for $7; -- default now() - p_creation_user alias for $8; -- default null - p_creation_ip alias for $9; -- default null - p_object_type alias for $10; -- default ''bboard_forum'' + p_forum_type alias for $5; + p_bboard_id alias for $6; + p_context_id alias for $7; -- default null + p_creation_date alias for $8; -- default now() + p_creation_user alias for $9; -- default null + p_creation_ip alias for $10; -- default null + p_object_type alias for $11; -- default ''bboard_forum'' v_context_id integer; v_forum_id integer; begin @@ -55,8 +56,8 @@ ); insert into bboard_forums - (forum_id, short_name, charter, moderated_p, bboard_id) - values (v_forum_id, p_short_name, p_charter, p_moderated_p, p_bboard_id); + (forum_id, short_name, charter, moderated_p, forum_type, bboard_id) + values (v_forum_id, p_short_name, p_charter, p_moderated_p, p_forum_type, p_bboard_id); return v_forum_id; end; ' language 'plpgsql'; Index: openacs-4/packages/sloan-bboard/tcl/bboard-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/sloan-bboard/tcl/bboard-procs-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/sloan-bboard/tcl/bboard-procs-oracle.xql 15 Feb 2002 21:27:06 -0000 1.1 +++ openacs-4/packages/sloan-bboard/tcl/bboard-procs-oracle.xql 23 Feb 2002 16:23:51 -0000 1.2 @@ -23,6 +23,7 @@ short_name => :short_name, charter => :charter, moderated_p => :moderated_p, + forum_type => :forum_type, bboard_id => :bboard_id, context_id => :context_id, creation_user => :creation_user, Index: openacs-4/packages/sloan-bboard/tcl/bboard-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/sloan-bboard/tcl/bboard-procs-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/sloan-bboard/tcl/bboard-procs-postgresql.xql 15 Feb 2002 21:27:06 -0000 1.1 +++ openacs-4/packages/sloan-bboard/tcl/bboard-procs-postgresql.xql 23 Feb 2002 16:23:51 -0000 1.2 @@ -17,6 +17,7 @@ :short_name, :charter, :moderated_p, + :forum_type, :bboard_id, :context_id, now(), Index: openacs-4/packages/sloan-bboard/tcl/bboard-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/sloan-bboard/tcl/bboard-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/sloan-bboard/tcl/bboard-procs.tcl 15 Feb 2002 21:27:06 -0000 1.1 +++ openacs-4/packages/sloan-bboard/tcl/bboard-procs.tcl 23 Feb 2002 16:23:51 -0000 1.2 @@ -40,6 +40,7 @@ ad_proc -public bboard_forum_new { {-forum_id ""} {-short_name:required} + {-forum_type "q-and-a"} {-charter ""} {-moderated_p f} {-bboard_id:required} @@ -56,6 +57,7 @@ short_name => :short_name, charter => :charter, moderated_p => :moderated_p, + forum_type => :forum_type, bboard_id => :bboard_id, context_id => :context_id, creation_user => :creation_user, @@ -90,7 +92,7 @@ ad_proc -public bboard_forum_get { {-forum_id:required} {-column_array:required} -} { + } { Get the columns for a given forum into an array variable. } { upvar $rowvar row @@ -885,6 +887,23 @@ } } +# A new proc to figure out how a user wishes to see things +ad_proc -public bboard_user_view_pref { + {-user_id ""} +} { + Check what viewing preference a user has. + Implemented for dotLRN. + + @author ben@openforce.biz +} { + if {[empty_string_p $user_id]} { + set user_id [ad_conn user_id] + } + + # FIXME: fix this when we have real user preference tracking + return "summary" +} + ad_proc -public bboard_alert_from_address { } { Returns an appropriate from address for bboard alerts. Index: openacs-4/packages/sloan-bboard/www/forum-entry.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/sloan-bboard/www/forum-entry.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/sloan-bboard/www/forum-entry.adp 15 Feb 2002 21:27:07 -0000 1.1 +++ openacs-4/packages/sloan-bboard/www/forum-entry.adp 23 Feb 2002 16:23:52 -0000 1.2 @@ -10,6 +10,13 @@ Short Name: + + Forum Type: + +
Charter (optional): Index: openacs-4/packages/sloan-bboard/www/forum-new-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/sloan-bboard/www/forum-new-2.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/sloan-bboard/www/forum-new-2.tcl 15 Feb 2002 21:27:07 -0000 1.1 +++ openacs-4/packages/sloan-bboard/www/forum-new-2.tcl 23 Feb 2002 16:23:52 -0000 1.2 @@ -14,6 +14,7 @@ forum_id:integer,notnull short_name:notnull,trim charter:trim + forum_type:notnull,trim {moderated_p:optional ""} } @@ -30,6 +31,7 @@ db_transaction { bboard_forum_new -forum_id $forum_id -short_name $short_name \ -charter $charter -moderated_p $moderated_p \ + -forum_type $forum_type \ -bboard_id $package_id -creation_user [ad_verify_and_get_user_id] \ -creation_ip [ad_conn peeraddr] -context_id $package_id } Index: openacs-4/packages/sloan-bboard/www/message-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/sloan-bboard/www/message-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/sloan-bboard/www/message-oracle.xql 15 Feb 2002 21:27:07 -0000 1.1 +++ openacs-4/packages/sloan-bboard/www/message-oracle.xql 23 Feb 2002 16:23:52 -0000 1.2 @@ -9,7 +9,8 @@ select short_name as forum_name, acs_permission.permission_p(:forum_id, :user_id, 'admin') as admin_p, acs_permission.permission_p(:forum_id, :user_id, 'bboard_moderate_forum') - as moderate_p + as moderate_p, + forum_type from bboard_forums where forum_id = :forum_id Index: openacs-4/packages/sloan-bboard/www/message-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/sloan-bboard/www/message-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/sloan-bboard/www/message-postgresql.xql 15 Feb 2002 21:27:07 -0000 1.1 +++ openacs-4/packages/sloan-bboard/www/message-postgresql.xql 23 Feb 2002 16:23:52 -0000 1.2 @@ -9,7 +9,8 @@ select short_name as forum_name, acs_permission__permission_p(:forum_id, :user_id, 'admin') as admin_p, acs_permission__permission_p(:forum_id, :user_id, 'bboard_moderate_forum') - as moderate_p + as moderate_p, + forum_type from bboard_forums where forum_id = :forum_id Index: openacs-4/packages/sloan-bboard/www/message.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/sloan-bboard/www/message.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/sloan-bboard/www/message.adp 15 Feb 2002 21:27:07 -0000 1.1 +++ openacs-4/packages/sloan-bboard/www/message.adp 23 Feb 2002 16:23:52 -0000 1.2 @@ -21,7 +21,7 @@

Message:

-" } if {$replies(thread_depth) < $prev_depth} { - template::adp_puts "
" + for {set i $prev_depth} {$i > $replies(thread_depth)} {incr i -1} { + template::adp_puts "" + } } set prev_depth $replies(thread_depth) %> -
- -
+ forum_id="@forum_id@" user_id=@replies.user_id@ reply_p=@replies_p@> -
+
+<% +# We have to close the blockquotes (ben) +for {set i $prev_depth} {$i > 0} {incr i -1} { + template::adp_puts "" +} +%>
Index: openacs-4/packages/sloan-bboard/www/message.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/sloan-bboard/www/message.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/sloan-bboard/www/message.tcl 15 Feb 2002 21:27:07 -0000 1.1 +++ openacs-4/packages/sloan-bboard/www/message.tcl 23 Feb 2002 16:23:52 -0000 1.2 @@ -33,7 +33,8 @@ select short_name as forum_name, acs_permission.permission_p(:forum_id, :user_id, 'admin') as admin_p, acs_permission.permission_p(:forum_id, :user_id, 'bboard_moderate_forum') - as moderate_p + as moderate_p, + forum_type from bboard_forums where forum_id = :forum_id } @@ -73,4 +74,14 @@ order by mt.seqnum } +# How does a user want this presented +set presentation [bboard_user_view_pref] + +# Should we allow replies to replies? +if {$forum_type == "thread"} { + set replies_p 1 +} else { + set replies_p 0 +} + ad_return_template Index: openacs-4/packages/sloan-bboard/www/simple-message-full.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/sloan-bboard/www/simple-message-full.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/sloan-bboard/www/simple-message-full.adp 23 Feb 2002 16:23:52 -0000 1.1 @@ -0,0 +1,75 @@ +<% # A simple single message + # This should, in the future, use a row variable rather than many + # single values, but row variables are not yet supported. %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Subject: + + @title@ + + + @title@ + +   + + + [edit] + + [attach file] + + + + [delete] + + + [email] + + + [reply] + +
Message:
<%= @formatted_content@ %>
 
+ + -- @author@, @date@ + + + -- @author@, @date@ + +
Attachment: + + @attachments.name@ - @attachments.title@ + + [delete] +
+
Index: openacs-4/packages/sloan-bboard/www/simple-message-full.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/sloan-bboard/www/simple-message-full.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/sloan-bboard/www/simple-message-full.tcl 23 Feb 2002 16:23:52 -0000 1.1 @@ -0,0 +1,43 @@ +ad_page_contract { + Display a single message in a reasonable way. + + @author John Prevost + @author Anukul Kapoor + @creation-date 2000-11-30 + @cvs-id $Id: simple-message-full.tcl,v 1.1 2002/02/23 16:23:52 ben Exp $ +} { +} -properties { + mail_friend_p:onevalue + attachments_p:onevalue + attachments:multirow + formatted_content:onevalue +} + +set mail_friend_p [ad_parameter "MailFriendEnabledP"] +set attachments_p [ad_parameter "AttachmentsEnabledP"] + +if {[ad_parameter "UserPostsDeletableP"] == "t"} { + if [info exists write_p] { + set delete_p $write_p + } +} else { + if [info exists admin_p] { + set delete_p $admin_p + } +} + +set formatted_content [acs_messaging_format_as_html $mime_type $content] + +# we don't want to stomp on the +set current_user_id [ad_conn user_id] + +if {[string equal $attachments_p "t"] && [info exists id]} { + db_multirow attachments get_attachments { + select object_id as file_id, cr.title, ci.name + from acs_objects ao, cr_items ci, cr_revisions cr + where object_id = ci.item_id and + live_revision = revision_id and + object_type = 'content_item' and + context_id = :id + } +} Index: openacs-4/packages/sloan-bboard/www/simple-message-separator-full.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/sloan-bboard/www/simple-message-separator-full.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/sloan-bboard/www/simple-message-separator-full.adp 23 Feb 2002 16:23:52 -0000 1.1 @@ -0,0 +1 @@ +

Index: openacs-4/packages/sloan-bboard/www/simple-message-separator-summary.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/sloan-bboard/www/simple-message-separator-summary.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/sloan-bboard/www/simple-message-separator-summary.adp 23 Feb 2002 16:23:52 -0000 1.1 @@ -0,0 +1 @@ +
Index: openacs-4/packages/sloan-bboard/www/simple-message-summary.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/sloan-bboard/www/simple-message-summary.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/sloan-bboard/www/simple-message-summary.adp 15 Feb 2002 21:27:07 -0000 1.1 +++ openacs-4/packages/sloan-bboard/www/simple-message-summary.adp 23 Feb 2002 16:23:52 -0000 1.2 @@ -2,4 +2,4 @@ # This should, in the future, use a row variable rather than many # single values, but row variables are not yet supported. %> -
@title@ by @author@ on @date@ +@title@ by @author@ on @date@ Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/sloan-bboard/www/simple-message.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/sloan-bboard/www/simple-message.tcl'. Fisheye: No comparison available. Pass `N' to diff?