Index: openacs-4/packages/dotlrn/www/join-policy-toggle.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/join-policy-toggle.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/join-policy-toggle.tcl 20 Jan 2002 06:11:04 -0000 1.1 @@ -0,0 +1,31 @@ +ad_page_contract { + Change the join policy of a dotLRN community. + + @author yon (yon@openforce.net) + @creation-date 2002-01-18 + @version $Id: join-policy-toggle.tcl,v 1.1 2002/01/20 06:11:04 yon Exp $ +} -query { + {community_id ""} + policy:notnull + {referer "one-community-admin"} +} -validate { + policy_ck -requires {policy:notnull} { + if {!( + [string equal $policy "open"] == 1 || + [string equal $policy "needs approval"] == 1 || + [string equal $policy "closed"] == 1 + )} { + ad_complain {policy must be one of: open, needs approval, or closed} + } + } +} + +if {[empty_string_p $community_id]} { + set community_id [dotlrn_community::get_community_id] +} + +dotlrn::require_user_admin_community $community_id + +db_dml update_join_policy {} + +ad_returnredirect $referer Index: openacs-4/packages/dotlrn/www/join-policy-toggle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/join-policy-toggle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/join-policy-toggle.xql 20 Jan 2002 06:11:04 -0000 1.1 @@ -0,0 +1,11 @@ + + + + + + update groups + set join_policy = :policy + where group_id = :community_id + + + Index: openacs-4/packages/dotlrn/www/my-communities.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/my-communities.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/www/my-communities.adp 19 Jan 2002 17:26:07 -0000 1.1 +++ openacs-4/packages/dotlrn/www/my-communities.adp 20 Jan 2002 06:11:04 -0000 1.2 @@ -6,7 +6,7 @@ @communities.pretty_name@ - @communities.role@ - - [Email Members] + - [ Email Members ] - [] Index: openacs-4/packages/dotlrn/www/one-community-admin.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/one-community-admin.adp,v diff -u -r1.9 -r1.10 --- openacs-4/packages/dotlrn/www/one-community-admin.adp 19 Jan 2002 22:54:20 -0000 1.9 +++ openacs-4/packages/dotlrn/www/one-community-admin.adp 20 Jan 2002 06:11:04 -0000 1.10 @@ -18,10 +18,14 @@ Membership - +

  • Index: openacs-4/packages/dotlrn/www/one-community-admin.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/one-community-admin.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/dotlrn/www/one-community-admin.tcl 19 Jan 2002 22:54:20 -0000 1.10 +++ openacs-4/packages/dotlrn/www/one-community-admin.tcl 20 Jan 2002 06:11:04 -0000 1.11 @@ -13,7 +13,8 @@ community_type:onevalue pretty_name:onevalue description:onevalue - subgroups:multirow + join_policy:onevalue + n_subgroups:onevalue } set community_id [dotlrn_community::get_community_id] @@ -25,9 +26,9 @@ db_1row select_community_info {} -db_multirow subgroups select_subgroups_count { +set n_subgroups [db_string select_subgroups_count { select 1 from dual where 1 = 0 -} +} -default 0] set context_bar {Admin} Index: openacs-4/packages/dotlrn/www/one-community-admin.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/one-community-admin.xql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/dotlrn/www/one-community-admin.xql 19 Jan 2002 22:54:20 -0000 1.5 +++ openacs-4/packages/dotlrn/www/one-community-admin.xql 20 Jan 2002 06:11:04 -0000 1.6 @@ -3,11 +3,14 @@ - select community_type, - pretty_name, - description - from dotlrn_communities - where community_id = :community_id + select dotlrn_communities.community_type, + dotlrn_communities.pretty_name, + dotlrn_communities.description, + groups.join_policy + from dotlrn_communities, + groups + where dotlrn_communities.community_id = :community_id + and groups.group_id = :community_id