+ @creation-date 2001-04-12
+ @cvs-id $Id: forum-move.tcl,v 1.1 2001/06/29 20:37:18 lukep Exp $
+
+} {
+ forum_id:integer,notnull,bboard_forum_id
+} -properties {
+ forum_id:onevalue
+ forum_name:onevalue
+ charter:onevalue
+ forums:multirow
+}
+
+ad_require_permission $forum_id admin
+
+set user_id [ad_conn user_id]
+
+db_1row forum_info {
+ select short_name as forum_name, charter, moderated_p from bboard_forums
+ where forum_id = :forum_id
+}
+
+db_multirow forums allowed_target_forums {
+ select forum_id, short_name
+ from bboard_forums
+ where not forum_id = :forum_id
+ and exists (select 1 from acs_object_party_privilege_map
+ where object_id = forum_id
+ and party_id in (:user_id, -1)
+ and privilege = 'admin')
+
+}
+
+set form_data [export_form_vars forum_id]
+
+ad_return_template
Index: openacs-4/contrib/obsolete-packages/bboard/www/forum-move.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/bboard/www/forum-move.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/obsolete-packages/bboard/www/forum-move.xql 29 Jun 2001 20:37:18 -0000 1.1
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+ select short_name as forum_name, charter, moderated_p from bboard_forums
+ where forum_id = :forum_id
+
+
+
+
+
+
+
+
+ select forum_id, short_name
+ from bboard_forums
+ where not forum_id = :forum_id
+ and exists (select 1 from acs_object_party_privilege_map
+ where object_id = forum_id
+ and party_id in (:user_id, -1)
+ and privilege = 'admin')
+
+
+
+
+
+
+
Index: openacs-4/contrib/obsolete-packages/bboard/www/forum-new-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/bboard/www/forum-new-2.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/contrib/obsolete-packages/bboard/www/forum-new-2.tcl 20 Apr 2001 20:51:09 -0000 1.1
+++ openacs-4/contrib/obsolete-packages/bboard/www/forum-new-2.tcl 29 Jun 2001 20:37:18 -0000 1.2
@@ -17,7 +17,7 @@
{moderated_p:optional ""}
}
-ad_require_permission [ad_conn package_id] bboard_create_forum
+ad_require_permission [ad_conn package_id] admin
if [empty_string_p $moderated_p] {
set moderated_p "f"
Index: openacs-4/contrib/obsolete-packages/bboard/www/forum-new.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/bboard/www/forum-new.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/contrib/obsolete-packages/bboard/www/forum-new.tcl 20 Apr 2001 20:51:09 -0000 1.1
+++ openacs-4/contrib/obsolete-packages/bboard/www/forum-new.tcl 29 Jun 2001 20:37:18 -0000 1.2
@@ -16,7 +16,7 @@
charter:onevalue
}
-ad_require_permission [ad_conn package_id] bboard_create_forum
+ad_require_permission [ad_conn package_id] admin
set context_bar {"Create a Forum"}
set title "Create a Forum"
Index: openacs-4/contrib/obsolete-packages/bboard/www/forum-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/bboard/www/forum-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/obsolete-packages/bboard/www/forum-oracle.xql 29 Jun 2001 20:37:18 -0000 1.1
@@ -0,0 +1,115 @@
+
+
+
+ oracle8.1.6
+
+
+
+
+ select short_name as forum_name, moderated_p,
+ acs_permission.permission_p(:forum_id, :user_id, 'admin') as admin_p,
+ acs_permission.permission_p(:forum_id, :user_id, 'bboard_create_category')
+ as category_create_p
+ from bboard_forums
+ where forum_id = :forum_id
+
+
+
+
+
+
+
+
+ select message_id, title, num_replies,
+ first_names||' '||last_name as full_name,
+ to_char(last_reply_date,'MM/DD/YY hh12:Mi am') as last_updated
+ from bboard_messages_all b, persons
+ where forum_id = :forum_id
+ and sent_date > case when :last_n_days = 0 then '1976-01-01' else sysdate - :last_n_days end
+ and person_id = sender
+ and reply_to is null
+ order by sent_date desc
+
+
+
+
+
+
+
+
+ select c.category_id, short_name, count(m.message_id) as message_count
+ from bboard_categories c,
+ bboard_category_message_map m
+ where c.forum_id = :forum_id
+ and m.category_id(+) = c.category_id
+ and (m.message_id is null
+ or m.message_id in (select f.message_id
+ from bboard_forum_message_map f
+ where f.forum_id = :forum_id))
+ group by c.category_id, short_name
+
+
+
+
+
+
+
+
+ select message_id, title, num_replies,
+ first_names||' '||last_name as full_name,
+ to_char(last_reply_date,'MM/DD/YY hh12:Mi am') as last_updated
+ from bboard_messages_all b, persons
+ where forum_id = :forum_id
+ and sent_date > case when :last_n_days = 0 then '1976-01-01' else sysdate - :last_n_days end
+ and person_id = sender
+ and reply_to is null
+ and status = 'approved'
+ order by sent_date desc
+
+
+
+
+
+
+
+
+ select c.category_id, c.short_name,
+ count(m.message_id) as message_count
+ from bboard_categories c,
+ (select c.category_id, c.message_id
+ from bboard_category_message_map c,
+ bboard_forum_message_map f
+ where c.message_id = f.message_id
+ and f.status = 'approved'
+ and f.forum_id = :forum_id) m
+ where c.forum_id = :forum_id
+ and m.category_id(+) = c.category_id
+ and (m.message_id is null
+ or m.message_id in (select f.message_id
+ from bboard_forum_message_map f
+ where f.forum_id = :forum_id))
+ group by c.category_id, short_name
+
+
+
+
+
+
+
+
+ select 1 from dual where 1 = 0
+
+
+
+
+
+
+
+
+ select 1 from dual where 1 = 0
+
+
+
+
+
+
Index: openacs-4/contrib/obsolete-packages/bboard/www/forum-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/bboard/www/forum-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/obsolete-packages/bboard/www/forum-postgresql.xql 29 Jun 2001 20:37:18 -0000 1.1
@@ -0,0 +1,121 @@
+
+
+
+ postgresql7.1
+
+
+
+
+ select short_name as forum_name, moderated_p,
+ acs_permission__permission_p(:forum_id, :user_id, 'admin') as admin_p,
+ acs_permission__permission_p(:forum_id, :user_id, 'bboard_create_category')
+ as category_create_p
+ from bboard_forums
+ where forum_id = :forum_id
+
+
+
+
+
+
+
+
+ select message_id, title, num_replies,
+ first_names||' '||last_name as full_name,
+ to_char(last_reply_date,'MM/DD/YY hh12:MI am') as last_updated
+ from bboard_messages_all b, persons
+ where forum_id = :forum_id
+ and age(sent_date) < case when :last_n_days = 0
+ then interval '99 years'
+ else interval '$last_n_days days'
+ end
+ and person_id = sender
+ and reply_to is null
+ order by sent_date desc
+
+
+
+
+
+
+
+
+ select c.category_id, short_name, count(m.message_id) as message_count
+ from bboard_categories c left outer join
+ bboard_category_message_map m
+ on c.category_id = m.category_id
+ where c.forum_id = :forum_id
+ and (m.message_id is null
+ or m.message_id in (select f.message_id
+ from bboard_forum_message_map f
+ where f.forum_id = :forum_id))
+ group by c.category_id, short_name
+
+
+
+
+
+
+
+
+ select message_id, title, num_replies,
+ first_names||' '||last_name as full_name,
+ to_char(last_reply_date,'MM/DD/YY hh12:MI am') as last_updated
+ from bboard_messages_all b, persons
+ where forum_id = :forum_id
+ and age(sent_date) < case when :last_n_days = 0
+ then interval '99 years'
+ else interval '$last_n_days days'
+ end
+ and person_id = sender
+ and reply_to is null
+ and status = 'approved'
+ order by sent_date desc
+
+
+
+
+
+
+
+
+ select c.category_id, c.short_name,
+ count(m.message_id) as message_count
+ from bboard_categories c left outer join
+ (select c.category_id, c.message_id
+ from bboard_category_message_map c,
+ bboard_forum_message_map f
+ where c.message_id = f.message_id
+ and f.status = 'approved'
+ and f.forum_id = :forum_id) m
+ on c.category_id = m.category_id
+ where c.forum_id = :forum_id
+ and (m.message_id is null
+ or m.message_id in (select f.message_id
+ from bboard_forum_message_map f
+ where f.forum_id = :forum_id))
+ group by c.category_id, short_name
+
+
+
+
+
+
+
+
+ select 1 where 1 = 0
+
+
+
+
+
+
+
+
+ select 1 where 1 = 0
+
+
+
+
+
+
Index: openacs-4/contrib/obsolete-packages/bboard/www/forum-unsubscribe.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/bboard/www/forum-unsubscribe.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/contrib/obsolete-packages/bboard/www/forum-unsubscribe.tcl 20 Apr 2001 20:51:09 -0000 1.1
+++ openacs-4/contrib/obsolete-packages/bboard/www/forum-unsubscribe.tcl 29 Jun 2001 20:37:18 -0000 1.2
@@ -8,11 +8,16 @@
} {
forum_id:integer,notnull,bboard_forum_id
+ {sub_page ""}
}
catch {
bboard_unsubscribe_forum \
-forum_id $forum_id -subscriber_id [ad_verify_and_get_user_id]
}
-ad_returnredirect "forum?forum_id=$forum_id"
\ No newline at end of file
+if [empty_string_p $sub_page] {
+ ad_returnredirect "forum?forum_id=$forum_id"
+} else {
+ ad_returnredirect "subscriptions"
+}
Index: openacs-4/contrib/obsolete-packages/bboard/www/forum-view.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/bboard/www/forum-view.adp,v
diff -u -r1.1 -r1.2
--- openacs-4/contrib/obsolete-packages/bboard/www/forum-view.adp 20 Apr 2001 20:51:09 -0000 1.1
+++ openacs-4/contrib/obsolete-packages/bboard/www/forum-view.adp 29 Jun 2001 20:37:18 -0000 1.2
@@ -3,53 +3,44 @@
@title@
+
+
-Messages
-
Not Yet Approved
@@ -66,7 +57,7 @@
-
+
@@ -81,16 +72,16 @@
+
+ By Category
+
- Categories
+
+ [Create a category]
+
+
Search
+
+
+
+ Admin
+ [Move messages to other forum]
+ [Set Permissions]
+
\ No newline at end of file
Index: openacs-4/contrib/obsolete-packages/bboard/www/forum.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/bboard/www/forum.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/contrib/obsolete-packages/bboard/www/forum.tcl 20 Apr 2001 20:51:09 -0000 1.1
+++ openacs-4/contrib/obsolete-packages/bboard/www/forum.tcl 29 Jun 2001 20:37:18 -0000 1.2
@@ -6,7 +6,7 @@
@creation-date 2000-08-29
@cvs-id $Id$
} {
- forum_id:integer,notnull,bboard_forum_id
+ forum_id:integer,notnull
{last_n_days:integer,optional ""}
} -properties {
forum_write_p:onevalue
@@ -21,34 +21,34 @@
unapproved:multirow
rejected:multirow
subscribed_p:onevalue
- subscribe_p:onevalue
last_n_days:onevalue
uncategorized_count:onevalue
}
+set user_id [ad_verify_and_get_user_id]
+
ad_require_permission $forum_id bboard_read_forum
db_1row forum_info {
- select short_name as forum_name, moderated_p from bboard_forums
- where forum_id = :forum_id
+ select short_name as forum_name, moderated_p,
+ acs_permission.permission_p(:forum_id, :user_id, 'admin') as admin_p,
+ acs_permission.permission_p(:forum_id, :user_id, 'bboard_create_category')
+ as category_create_p
+ from bboard_forums
+ where forum_id = :forum_id
}
-# subscribe_p is whether or not this page allows subscriptions
-set subscribed_p 0
+set moderator_p 0
-# subscribed_p is whether or not this particular user is scribed
-set subscribe_p 0
+if [string equal $moderated_p "t"] {
+ set moderator_p [ad_permission_p $forum_id bboard_moderate_forum]
+}
-set user_id [ad_verify_and_get_user_id]
-if [ad_permission_p $forum_id bboard_create_message] {
- set subscribe_p 1
-
- if [string equal [bboard_forum_subscribed_p $user_id $forum_id] "t"] {
- set subscribed_p 1
- } else {
- set subscribed_p 0
- }
+if [string equal [bboard_forum_subscribed_p $user_id $forum_id] "t"] {
+ set subscribed_p 1
+} else {
+ set subscribed_p 0
}
if [string equal $last_n_days ""] {
@@ -59,15 +59,6 @@
}
}
-set moderator_p 0
-
-if [string equal $moderated_p "t"] {
- set moderator_p [ad_permission_p $forum_id bboard_moderate_forum]
-}
-
-set message_create_p [ad_permission_p $forum_id bboard_create_message]
-set category_create_p [ad_permission_p $forum_id bboard_create_category]
-
set context_bar [list $forum_name]
set title $forum_name
@@ -84,19 +75,11 @@
and sent_date > decode(:last_n_days, 0, '1976-01-01', sysdate - :last_n_days)
and person_id = sender
and reply_to is null
- and exists (select 1 from acs_object_party_privilege_map
- where object_id = message_id
- and party_id in (:user_id, -1)
- and privilege = 'bboard_read_message')
order by sent_date desc
}
db_multirow categories categories_select {
- select c.category_id, short_name, count(m.message_id) as message_count,
- acs_permission.permission_p(c.category_id, :user_id,
- 'bboard_write_category') as write_p,
- acs_permission.permission_p(c.category_id, :user_id,
- 'bboard_delete_category') as delete_p
+ select c.category_id, short_name, count(m.message_id) as message_count
from bboard_categories c,
bboard_category_message_map m
where c.forum_id = :forum_id
@@ -113,10 +96,6 @@
from bboard_messages_by_category b
where category_id is null
and forum_id = :forum_id
- and exists (select 1 from acs_object_party_privilege_map
- where object_id = message_id
- and party_id in (:user_id, -1)
- and privilege = 'bboard_read_message')
}
@@ -132,20 +111,12 @@
and person_id = sender
and reply_to is null
and status = 'approved'
- and exists (select 1 from acs_object_party_privilege_map
- where object_id = message_id
- and party_id in (:user_id, -1)
- and privilege = 'bboard_read_message')
order by sent_date desc
}
db_multirow categories categories_select_approved {
select c.category_id, c.short_name,
- count(m.message_id) as message_count,
- acs_permission.permission_p(c.category_id, :user_id,
- 'bboard_write_category') as write_p,
- acs_permission.permission_p(c.category_id, :user_id,
- 'bboard_delete_category') as delete_p
+ count(m.message_id) as message_count
from bboard_categories c,
(select c.category_id, c.message_id
from bboard_category_message_map c,
@@ -167,10 +138,6 @@
from bboard_messages_by_category b
where category_id is null
and forum_id = :forum_id
- and exists (select 1 from acs_object_party_privilege_map
- where object_id = message_id
- and party_id in (:user_id, -1)
- and privilege = 'bboard_read_message')
}
}
@@ -195,10 +162,6 @@
and person_id = sender
and reply_to is null
and status = 'unmoderated'
- and exists (select 1 from acs_object_party_privilege_map
- where object_id = message_id
- and party_id in (:user_id, -1)
- and privilege = 'bboard_read_message')
}
db_multirow rejected rejected_messages_select {
@@ -209,10 +172,6 @@
and person_id = sender
and reply_to is null
and status = 'rejected'
- and exists (select 1 from acs_object_party_privilege_map
- where object_id = message_id
- and party_id in (:user_id, -1)
- and privilege = 'bboard_read_message')
}
}
Index: openacs-4/contrib/obsolete-packages/bboard/www/forum.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/bboard/www/forum.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/obsolete-packages/bboard/www/forum.xql 29 Jun 2001 20:37:18 -0000 1.1
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+ select count(*) as uncategorized_count
+ from bboard_messages_by_category b
+ where category_id is null
+ and forum_id = :forum_id
+
+
+
+
+
+
+
+
+ select count(*) as uncategorized_count
+ from bboard_messages_by_category b
+ where category_id is null
+ and forum_id = :forum_id
+
+
+
+
+
+
+
+
+ select message_id, title, num_replies,
+ first_names||' '||last_name as full_name
+ from bboard_messages_all, persons
+ where forum_id = :forum_id
+ and person_id = sender
+ and reply_to is null
+ and status = 'unmoderated'
+
+
+
+
+
+
+
+
+ select message_id, title, num_replies,
+ first_names||' '||last_name as full_name
+ from bboard_messages_all, persons
+ where forum_id = :forum_id
+ and person_id = sender
+ and reply_to is null
+ and status = 'rejected'
+
+
+
+
+
+
Index: openacs-4/contrib/obsolete-packages/bboard/www/index-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/bboard/www/index-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/obsolete-packages/bboard/www/index-oracle.xql 29 Jun 2001 20:37:18 -0000 1.1
@@ -0,0 +1,19 @@
+
+
+
+ oracle8.1.6
+
+
+
+
+ select forum_id, short_name, moderated_p, charter
+ from bboard_forums f
+ where bboard_id = :package_id
+ and acs_permission.permission_p(forum_id,:user_id,'bboard_read_forum') = 't'
+ order by short_name
+
+
+
+
+
+
Index: openacs-4/contrib/obsolete-packages/bboard/www/index-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/bboard/www/index-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/obsolete-packages/bboard/www/index-postgresql.xql 29 Jun 2001 20:37:18 -0000 1.1
@@ -0,0 +1,19 @@
+
+
+
+ postgresql7.1
+
+
+
+
+ select forum_id, short_name, moderated_p, charter
+ from bboard_forums f
+ where bboard_id = :package_id
+ and acs_permission__permission_p(forum_id,:user_id,'bboard_read_forum') = 't'
+ order by short_name
+
+
+
+
+
+
Index: openacs-4/contrib/obsolete-packages/bboard/www/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/bboard/www/index.adp,v
diff -u -r1.1 -r1.2
--- openacs-4/contrib/obsolete-packages/bboard/www/index.adp 20 Apr 2001 20:51:09 -0000 1.1
+++ openacs-4/contrib/obsolete-packages/bboard/www/index.adp 29 Jun 2001 20:37:18 -0000 1.2
@@ -2,9 +2,7 @@
@context_bar@
Forums
-
- [Create a forum]
-
+[Manage Subscriptions]
There are no forums available.
@@ -17,10 +15,8 @@
(moderated)
-
+
[edit]
-
-
[delete]
@@ -31,3 +27,11 @@
+
+
+
+ [Create a forum]
+ [Set Parameters]
+ [Admin Permissions]
+
+
Index: openacs-4/contrib/obsolete-packages/bboard/www/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/bboard/www/index.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/contrib/obsolete-packages/bboard/www/index.tcl 20 Apr 2001 20:51:09 -0000 1.1
+++ openacs-4/contrib/obsolete-packages/bboard/www/index.tcl 29 Jun 2001 20:37:18 -0000 1.2
@@ -10,7 +10,7 @@
context_bar:onevalue
package_id:onevalue
user_id:onevalue
- forum:multirow
+ forums:multirow
}
set package_id [ad_conn package_id]
@@ -19,15 +19,10 @@
set user_id [ad_verify_and_get_user_id]
-set forum_create_p [ad_permission_p $package_id bboard_create_forum]
+set admin_p [ad_permission_p $package_id admin]
db_multirow forums forums_select {
- select forum_id, short_name, moderated_p, charter,
- acs_permission.permission_p(forum_id, :user_id,
- 'bboard_write_forum') as write_p,
- acs_permission.permission_p(forum_id, :user_id,
- 'bboard_delete_forum') as delete_p
-
+ select forum_id, short_name, moderated_p, charter
from bboard_forums f
where bboard_id = :package_id
and acs_permission.permission_p(forum_id,:user_id,'bboard_read_forum') = 't'
Index: openacs-4/contrib/obsolete-packages/bboard/www/message-approve.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/bboard/www/message-approve.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/obsolete-packages/bboard/www/message-approve.xql 29 Jun 2001 20:37:18 -0000 1.1
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+ select sender from acs_messages where message_id = :message_id
+
+
+
+
+
+
Index: openacs-4/contrib/obsolete-packages/bboard/www/message-attach.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/bboard/www/message-attach.adp,v
diff -u -r1.1 -r1.2
--- openacs-4/contrib/obsolete-packages/bboard/www/message-attach.adp 20 Apr 2001 20:51:09 -0000 1.1
+++ openacs-4/contrib/obsolete-packages/bboard/www/message-attach.adp 29 Jun 2001 20:37:18 -0000 1.2
@@ -2,7 +2,7 @@
@title@
@context_bar@
-