Index: openacs-4/packages/dotlrn/sql/oracle/dotlrn-communities-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/Attic/dotlrn-communities-create.sql,v
diff -u -r1.19 -r1.20
--- openacs-4/packages/dotlrn/sql/oracle/dotlrn-communities-create.sql 10 Jan 2002 19:30:17 -0000 1.19
+++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-communities-create.sql 11 Jan 2002 21:51:50 -0000 1.20
@@ -53,9 +53,18 @@
references apm_packages (package_id)
);
+create or replace view dotlrn_communities_not_closed
+as
+ select dotlrn_communities.*,
+ groups.join_policy
+ from dotlrn_communities,
+ groups
+ where dotlrn_communities.community_id = groups.group_id
+ and groups.join_policy <> 'closed';
+
create or replace view dotlrn_active_communities
as
- select dotlrn_communities.*
+ select *
from dotlrn_communities
where (active_start_date is null or active_start_date < sysdate)
and (active_end_date is null or active_end_date > sysdate);
Index: openacs-4/packages/dotlrn/tcl/dotlrn-main-portlet-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-main-portlet-procs.tcl,v
diff -u -r1.12 -r1.13
--- openacs-4/packages/dotlrn/tcl/dotlrn-main-portlet-procs.tcl 11 Jan 2002 18:38:27 -0000 1.12
+++ openacs-4/packages/dotlrn/tcl/dotlrn-main-portlet-procs.tcl 11 Jan 2002 21:51:50 -0000 1.13
@@ -1,4 +1,5 @@
-# /packages/dotlrn/tcl/dotlrn-main-portlet-procs.tcl
+# dotlrn/tcl/dotlrn-main-portlet-procs.tcl
+
ad_library {
Procedures to supports dotlrn main portlet
@@ -76,9 +77,9 @@
}
if {[dotlrn::user_can_browse_p $user_id]} {
- append return_html "
|
\n"
- append return_html "\[Subscribe to a new class\] |
\n"
- append return_html "\[Subscribe to a new club\] |
\n"
+ append return_html " |
\n"
+ append return_html "\[Subscribe to a new class\] "
+ append return_html "\[Subscribe to a new club\] |
\n"
}
append return_html ""
Index: openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl,v
diff -u -r1.11 -r1.12
--- openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl 10 Jan 2002 00:11:38 -0000 1.11
+++ openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl 11 Jan 2002 21:51:50 -0000 1.12
@@ -14,6 +14,7 @@
@author ben@openforce.net
@creation-date 2001-10-30
+ @version $Id$
}
Index: openacs-4/packages/dotlrn/www/communities-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/communities-oracle.xql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/dotlrn/www/communities-oracle.xql 17 Dec 2001 23:02:56 -0000 1.2
+++ openacs-4/packages/dotlrn/www/communities-oracle.xql 11 Jan 2002 21:51:51 -0000 1.3
@@ -3,6 +3,14 @@
oracle8.1.6
+
+
+ select count(*)
+ from dotlrn_communities_not_closed dotlrn_communities
+ where dotlrn_communities.community_type = :community_type
+
+
+
select dotlrn_communities.community_id,
@@ -11,13 +19,37 @@
dotlrn_communities.description,
dotlrn_communities.package_id,
dotlrn_community.url(dotlrn_communities.community_id) as url,
- (select decode(count(*), 0, 'f', 't')
- from dotlrn_member_rels_full
- where dotlrn_member_rels_full.user_id = :user_id
- and dotlrn_member_rels_full.community_id = dotlrn_communities.community_id) as member_p,
- acs_permission.permission_p(:user_id, dotlrn_communities.community_id, 'admin') as admin_p
+ (select count(*)
+ from dual
+ where exists (select 1
+ from dotlrn_member_rels_full
+ where dotlrn_member_rels_full.user_id = :user_id
+ and dotlrn_member_rels_full.community_id = dotlrn_communities.community_id)) as member_p,
+ decode(acs_permission.permission_p(:user_id, dotlrn_communities.community_id, 'admin'),'f',0,1) as admin_p
+ from dotlrn_communities_not_closed dotlrn_communities
+ where dotlrn_communities.community_type = :community_type
+ order by dotlrn_communities.pretty_name
+
+
+
+
+
+ select dotlrn_communities.community_id,
+ dotlrn_communities.community_type,
+ dotlrn_communities.pretty_name,
+ dotlrn_communities.description,
+ dotlrn_communities.package_id,
+ dotlrn_community.url(dotlrn_communities.community_id) as url,
+ (select count(*)
+ from dual
+ where exists (select 1
+ from dotlrn_member_rels_full
+ where dotlrn_member_rels_full.user_id = :user_id
+ and dotlrn_member_rels_full.community_id = dotlrn_communities.community_id)) as member_p,
+ decode(acs_permission.permission_p(:user_id, dotlrn_communities.community_id, 'admin'),'f',0,1) as admin_p
from dotlrn_active_comms_not_closed dotlrn_communities
where dotlrn_communities.community_type = :community_type
+ order by dotlrn_communities.pretty_name
Index: openacs-4/packages/dotlrn/www/communities.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/communities.adp,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/dotlrn/www/communities.adp 10 Jan 2002 19:30:18 -0000 1.3
+++ openacs-4/packages/dotlrn/www/communities.adp 11 Jan 2002 21:51:51 -0000 1.4
@@ -1,23 +1,28 @@
-
+
Communities@title@
+
+ @filter_bar@
+
+
+
Index: openacs-4/packages/dotlrn/www/communities.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/communities.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/dotlrn/www/communities.tcl 10 Jan 2002 19:30:18 -0000 1.3
+++ openacs-4/packages/dotlrn/www/communities.tcl 11 Jan 2002 21:51:51 -0000 1.4
@@ -5,14 +5,27 @@
@creation-date Dec 07, 2001
@version $Id$
} -query {
+ {filter "select_active_communities"}
{referer "./"}
} -properties {
+ n_communities:onevalue
communities:multirow
}
set user_id [ad_conn user_id]
set community_type [dotlrn_community::get_community_type]
-db_multirow communities select_communities {}
+set n_communities [db_string select_all_communities_count {}]
+set filter_bar [ad_dimensional {
+ {filter "Status:" select_active_communities
+ {
+ {select_active_communities active {}}
+ {select_communities "+inactive" {}}
+ }
+ }
+}]
+
+db_multirow communities $filter {}
+
ad_return_template
Index: openacs-4/packages/dotlrn/www/community-deregister.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/community-deregister.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/dotlrn/www/community-deregister.tcl 10 Jan 2002 19:30:18 -0000 1.2
+++ openacs-4/packages/dotlrn/www/community-deregister.tcl 11 Jan 2002 21:51:51 -0000 1.3
@@ -7,17 +7,22 @@
@version $Id$
} -query {
{referer "./"}
+ {user_id ""}
{community_id ""}
}
ad_maybe_redirect_for_registration
-set user_id [ad_conn user_id]
-
if {[empty_string_p $community_id]} {
set community_id [dotlrn_community::get_community_id]
}
+if {[empty_string_p $user_id]} {
+ set user_id [ad_conn user_id]
+} else {
+ dotlrn::require_user_admin_community $community_id
+}
+
dotlrn_community::remove_user $community_id $user_id
ns_returnredirect $referer
Index: openacs-4/packages/dotlrn/www/community.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/community.adp,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/dotlrn/www/community.adp 10 Jan 2002 19:30:18 -0000 1.2
+++ openacs-4/packages/dotlrn/www/community.adp 11 Jan 2002 21:51:51 -0000 1.3
@@ -1,11 +1,17 @@
@context_bar@
-dotLRN Community: @pretty_name@
+@pretty_name@
-You are registered! You may drop membership if you'd like.
-
-Configure this page.
-Admin this community.
-
+[
+
+
+ |
+ customize
+
+ |
+ admin
+
+
+]
@rendered_page@
Index: openacs-4/packages/dotlrn/www/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/index.tcl,v
diff -u -r1.18 -r1.19
--- openacs-4/packages/dotlrn/www/index.tcl 11 Dec 2001 06:25:15 -0000 1.18
+++ openacs-4/packages/dotlrn/www/index.tcl 11 Jan 2002 21:51:51 -0000 1.19
@@ -40,18 +40,17 @@
# For now, we assume only ONE community (FIXME: ben)
set the_community [lindex $communities 0]
- ad_returnredirect [dotlrn_community::get_url_from_package_id -package_id [lindex $the_community 4]]
+ ad_returnredirect [dotlrn_community::get_url_from_package_id -package_id [lindex $the_community 4]]
ad_script_abort
- return
}
# Get the page
set portal_id [dotlrn::get_workspace_portal_id $user_id]
if {[empty_string_p $portal_id]} {
ad_returnredirect index-not-a-user
- return
+ ad_script_abort
}
set rendered_page [dotlrn::render_page $portal_id]
Index: openacs-4/packages/dotlrn/www/not-allowed.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/not-allowed.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn/www/not-allowed.adp 11 Jan 2002 21:51:51 -0000 1.1
@@ -0,0 +1 @@
+
not allowed
Index: openacs-4/packages/dotlrn/www/one-community-not-member.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/one-community-not-member.adp,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/dotlrn/www/one-community-not-member.adp 10 Jan 2002 19:30:18 -0000 1.4
+++ openacs-4/packages/dotlrn/www/one-community-not-member.adp 11 Jan 2002 21:51:51 -0000 1.5
@@ -5,6 +5,10 @@
[
+
+ |
+ admin
+
]
Index: openacs-4/packages/dotlrn/www/one-community.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/one-community.tcl,v
diff -u -r1.12 -r1.13
--- openacs-4/packages/dotlrn/www/one-community.tcl 10 Jan 2002 19:30:18 -0000 1.12
+++ openacs-4/packages/dotlrn/www/one-community.tcl 11 Jan 2002 21:51:51 -0000 1.13
@@ -23,13 +23,15 @@
# Get basic information
db_1row select_community_info {}
+set admin_p [dotlrn::user_can_admin_community_p $community_id]
+
# Check that this user is a member
if {![dotlrn_community::member_p $community_id $user_id]} {
set context_bar [list "Not a member"]
if {[dotlrn_community::member_pending_p -community_id $community_id -user_id $user_id]} {
set member_pending_p "t"
- set context_bar [list "Pending approbal"]
+ set context_bar [list "Pending approval"]
}
set portal_id [dotlrn_community::get_community_non_members_portal_id $community_id]
@@ -51,7 +53,5 @@
set context_bar {View}
- set admin_p [dotlrn::user_can_admin_community_p $community_id]
-
ad_return_template
}