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.97 -r1.98 --- openacs-4/packages/dotlrn/tcl/community-procs.tcl 4 Apr 2002 05:55:45 -0000 1.97 +++ openacs-4/packages/dotlrn/tcl/community-procs.tcl 4 Apr 2002 14:55:50 -0000 1.98 @@ -14,7 +14,6 @@ # details. # - ad_library { Procs to manage DOTLRN Communities @@ -716,11 +715,7 @@ } { returns all communities for a user } { - set return_list [db_list_of_lists select_communities_by_user {}] - - # ns_log Notice "return list: $return_list" - - return $return_list + return [db_list_of_lists select_communities_by_user {}] } ad_proc -public get_communities_by_user { @@ -1022,53 +1017,24 @@ set user_id [ad_get_user_id] } - db_foreach select_subcomm_info {} { + set referer [ad_conn url] - # the lazy man's decode - if {[string equal $has_subcomm_p t]} { - set has_subcomm_p 1 - } else { - set has_subcomm_p 0 - } - - set m_s $member_p - - if {[string equal $member_p t]} { - set member_p 1 - } else { - set member_p 0 - } - - set a_s $admin_p - - if {[string equal $admin_p t]} { - set admin_p 1 - } else { - set admin_p 0 - } - - - + db_foreach select_subcomm_info {} { +ns_log notice "XXX select dotlrn_community.member_p($sc_id, 2384) from dual;" if {$has_subcomm_p && $member_p} { # Shows the subcomms of this subcomm ONLY IF I'm a # member of the current comm - append chunk \ - "$pretext $name\n" - - append chunk "

debug: $has_subcomm_p / $m_s = $member_p / $a_s = $admin_p " + append chunk "$pretext $name\n" if {$admin_p} { - append chunk \ - "\[admin\]" + append chunk "\[admin\]" } - append chunk \ - "

\n" + append chunk "\n" } elseif { $member_p || $admin_p || [not_closed_p -community_id $sc_id]} { # Shows the subcomm if: # 1. I'm a member of this subcomm OR # 2. I'm have admin rights over the subcomm OR - # 3. The subcomm has an "open" OR "request" join policy # but if the only_member_p flag is true, the user must be # a member of the subcomm to see it. @@ -1078,30 +1044,23 @@ append chunk "$pretext $name\n" - append chunk "

debug: $has_subcomm_p / $m_s = $member_p / $a_s = $admin_p " - if {!$member_p && [not_closed_p -community_id $sc_id]} { - append chunk \ - "\[" + append chunk "\[" if {[member_pending_p -community_id $sc_id -user_id $user_id]} { - append chunk \ - "waiting for approval" + append chunk "waiting for approval" } elseif {[needs_approval_p -community_id $sc_id]} { - append chunk \ - "request membership" + append chunk "request membership" } else { - append chunk \ - "join" + append chunk "join" } append chunk "\]\n" } if {$admin_p} { - append chunk \ - " \[admin\]\n" + append chunk " \[admin\]\n" } } } @@ -1352,9 +1311,6 @@ Lists the applets associated with a community or only the active dotlrn applets } { - - ns_log notice "aks debug list_active_applets called with comm_id = $community_id" - if {[empty_string_p $community_id]} { # List all applets return [db_list select_all_active_applets {}] 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.46 -r1.47 --- openacs-4/packages/dotlrn/tcl/community-procs.xql 4 Apr 2002 05:55:45 -0000 1.46 +++ openacs-4/packages/dotlrn/tcl/community-procs.xql 4 Apr 2002 14:55:50 -0000 1.47 @@ -268,18 +268,18 @@ - - - select community_id as sc_id, - acs_permission.permission_p(community_id, :user_id, 'admin') as admin_p, - dotlrn_community.member_p(community_id, :user_id) as member_p, - dotlrn_community.has_subcomm_p(community_id) as has_subcomm_p, - dotlrn_community.name(community_id) as name, - dotlrn_community.url(community_id) as url - from dotlrn_communities - where parent_community_id = :community_id - - + + + select community_id as sc_id, + decode(acs_permission.permission_p(community_id, :user_id, 'admin'), 'f', 0, 1) as admin_p, + decode(dotlrn_community.member_p(community_id, :user_id), 'f', 0, 1) as member_p, + decode(dotlrn_community.has_subcomm_p(community_id), 'f', 0, 1) as has_subcomm_p, + dotlrn_community.name(community_id) as name, + dotlrn_community.url(community_id) as url + from dotlrn_communities + where parent_community_id = :community_id + +