Index: openacs-4/packages/dotlrn/tcl/community-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/community-procs.tcl,v diff -u -r1.139 -r1.140 --- openacs-4/packages/dotlrn/tcl/community-procs.tcl 31 May 2002 21:31:18 -0000 1.139 +++ openacs-4/packages/dotlrn/tcl/community-procs.tcl 31 May 2002 21:56:49 -0000 1.140 @@ -1275,23 +1275,23 @@ } { returns 1 if the community's join policy is not closed } { - return [db_0or1row check_community_not_closed {}] + return [db_string check_community_not_closed {} -default 0] } ad_proc -public open_p { {-community_id:required} } { returns 1 if the community's join policy is 'open' } { - return [db_0or1row check_community_open {}] + return [db_string check_community_open {} -default 0] } ad_proc -public needs_approval_p { {-community_id:required} } { returns 1 if the community's join policy is 'needs approval' aka "request approval" } { - return [db_0or1row check_community_needs_approval {}] + return [db_string check_community_needs_approval {} -default 0] } ad_proc -public get_portal_id { Index: openacs-4/packages/dotlrn/tcl/community-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/community-procs.xql,v diff -u -r1.66 -r1.67 --- openacs-4/packages/dotlrn/tcl/community-procs.xql 31 May 2002 21:38:59 -0000 1.66 +++ openacs-4/packages/dotlrn/tcl/community-procs.xql 31 May 2002 21:56:49 -0000 1.67 @@ -363,7 +363,7 @@ - + select 1 from dotlrn_active_comms_not_closed Index: openacs-4/packages/dotlrn/www/subcommunity-new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/subcommunity-new.tcl,v diff -u -r1.17 -r1.18 --- openacs-4/packages/dotlrn/www/subcommunity-new.tcl 24 May 2002 17:44:00 -0000 1.17 +++ openacs-4/packages/dotlrn/www/subcommunity-new.tcl 31 May 2002 21:56:49 -0000 1.18 @@ -31,6 +31,16 @@ set title "New [parameter::get -parameter subcommunity_pretty_name]" set portal_id [dotlrn_community::get_portal_id -community_id $parent_community_id] +# set the join policy widget to default to +# the same as it's parent +if {[dotlrn_community::open_p -community_id $parent_community_id]} { + set join_policy_list {{Open open} {Closed closed} {{Needs Approval} {needs approval}}} +} elseif {[dotlrn_community::needs_approval_p -community_id $parent_community_id]} { + set join_policy_list {{{Needs Approval} {needs approval}} {Open open} {Closed closed}} +} else { + set join_policy_list {{Closed closed} {{Needs Approval} {needs approval}} {Open open}} +} + form create add_subcomm element create add_subcomm pretty_name \ @@ -50,7 +60,7 @@ -label "Join Policy" \ -datatype text \ -widget select \ - -options {{Closed closed} {{Needs Approval} {needs approval}} {Open open}} + -options $join_policy_list element create add_subcomm referer \ -label Referer \