Index: openacs-4/packages/dotlrn/www/communities-chunk-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/communities-chunk-oracle.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/www/communities-chunk-oracle.xql 23 Jan 2002 04:58:08 -0000 1.2 +++ openacs-4/packages/dotlrn/www/communities-chunk-oracle.xql 23 Jan 2002 05:45:56 -0000 1.3 @@ -10,56 +10,100 @@ - + 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, + 1 member_p, decode(acs_permission.permission_p(:user_id, dotlrn_communities.community_id, 'admin'),'f',0,1) as admin_p, (select community_type from dotlrn_community_types where supertype = 'dotlrn_community' start with community_type = dotlrn_communities.community_type connect by community_type = prior supertype) as root_community_type - from dotlrn_communities_not_closed dotlrn_communities + from dotlrn_active_comms_not_closed dotlrn_communities, + dotlrn_member_rels_full + where dotlrn_member_rels_full.user_id = :user_id + and dotlrn_member_rels_full.community_id = dotlrn_communities.community_id order by root_community_type, dotlrn_communities.community_type, 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, + 1 member_p, decode(acs_permission.permission_p(:user_id, dotlrn_communities.community_id, 'admin'),'f',0,1) as admin_p, (select community_type from dotlrn_community_types where supertype = 'dotlrn_community' start with community_type = dotlrn_communities.community_type connect by community_type = prior supertype) as root_community_type + from dotlrn_communities_not_closed dotlrn_communities, + dotlrn_member_rels_full + where dotlrn_member_rels_full.user_id = :user_id + and dotlrn_member_rels_full.community_id = dotlrn_communities.community_id + order by root_community_type, dotlrn_communities.community_type, 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, + 0 member_p, + decode(acs_permission.permission_p(:user_id, dotlrn_communities.community_id, 'admin'),'f',0,1) as admin_p, + (select community_type + from dotlrn_community_types + where supertype = 'dotlrn_community' + start with community_type = dotlrn_communities.community_type + connect by community_type = prior supertype) as root_community_type from dotlrn_active_comms_not_closed dotlrn_communities + where not 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) order by root_community_type, dotlrn_communities.community_type, 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, + 0 member_p, + decode(acs_permission.permission_p(:user_id, dotlrn_communities.community_id, 'admin'),'f',0,1) as admin_p, + (select community_type + from dotlrn_community_types + where supertype = 'dotlrn_community' + start with community_type = dotlrn_communities.community_type + connect by community_type = prior supertype) as root_community_type + from dotlrn_communities_not_closed dotlrn_communities + where not 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) + order by root_community_type, dotlrn_communities.community_type, dotlrn_communities.pretty_name + + + select count(*) @@ -68,55 +112,101 @@ - + 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, + 1 member_p, decode(acs_permission.permission_p(:user_id, dotlrn_communities.community_id, 'admin'),'f',0,1) as admin_p, (select community_type from dotlrn_community_types where supertype = 'dotlrn_community' start with community_type = dotlrn_communities.community_type connect by community_type = prior supertype) as root_community_type - from dotlrn_communities_not_closed dotlrn_communities - where dotlrn_communities.community_type = :community_type - order by root_community_type, dotlrn_communities.pretty_name + from dotlrn_active_comms_not_closed dotlrn_communities, + dotlrn_member_rels_full + where dotlrn_member_rels_full.user_id = :user_id + and dotlrn_member_rels_full.community_id = dotlrn_communities.community_id + and dotlrn_communities.community_type = :community_type + order by root_community_type, dotlrn_communities.community_type, 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, + 1 member_p, decode(acs_permission.permission_p(:user_id, dotlrn_communities.community_id, 'admin'),'f',0,1) as admin_p, (select community_type from dotlrn_community_types where supertype = 'dotlrn_community' start with community_type = dotlrn_communities.community_type connect by community_type = prior supertype) as root_community_type + from dotlrn_communities_not_closed dotlrn_communities, + dotlrn_member_rels_full + where dotlrn_member_rels_full.user_id = :user_id + and dotlrn_member_rels_full.community_id = dotlrn_communities.community_id + and dotlrn_communities.community_type = :community_type + order by root_community_type, dotlrn_communities.community_type, 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, + 0 member_p, + decode(acs_permission.permission_p(:user_id, dotlrn_communities.community_id, 'admin'),'f',0,1) as admin_p, + (select community_type + from dotlrn_community_types + where supertype = 'dotlrn_community' + start with community_type = dotlrn_communities.community_type + connect by community_type = prior supertype) as root_community_type from dotlrn_active_comms_not_closed dotlrn_communities - where dotlrn_communities.community_type = :community_type - order by root_community_type, dotlrn_communities.pretty_name + where not 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) + and dotlrn_communities.community_type = :community_type + order by root_community_type, dotlrn_communities.community_type, 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, + 0 member_p, + decode(acs_permission.permission_p(:user_id, dotlrn_communities.community_id, 'admin'),'f',0,1) as admin_p, + (select community_type + from dotlrn_community_types + where supertype = 'dotlrn_community' + start with community_type = dotlrn_communities.community_type + connect by community_type = prior supertype) as root_community_type + from dotlrn_communities_not_closed dotlrn_communities + where not 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) + and dotlrn_communities.community_type = :community_type + order by root_community_type, dotlrn_communities.community_type, dotlrn_communities.pretty_name + + Index: openacs-4/packages/dotlrn/www/communities-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/communities-chunk.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/www/communities-chunk.tcl 19 Jan 2002 22:54:20 -0000 1.1 +++ openacs-4/packages/dotlrn/www/communities-chunk.tcl 23 Jan 2002 05:45:56 -0000 1.2 @@ -1,11 +1,11 @@ -# dotlrn/www/communities.tcl +# dotlrn/www/communities-chunk.tcl ad_page_contract { @author yon (yon@milliped.com) @creation-date Dec 07, 2001 @version $Id$ } -query { - {filter "select_active_communities"} + {filter "select_current_memberships"} } -properties { n_communities:onevalue communities:multirow @@ -15,10 +15,6 @@ set community_type "" } -if {![info exists referer]} { - set referer "./" -} - set user_id [ad_conn user_id] if {![empty_string_p $community_type]} { @@ -28,10 +24,12 @@ } set filter_bar [ad_dimensional { - {filter "Status:" select_active_communities + {filter "Membership:" select_current_memberships { - {select_active_communities active {}} - {select_communities "+inactive" {}} + {select_current_memberships current {}} + {select_all_memberships all {}} + {select_current_non_memberships {join current} {}} + {select_all_non_memberships {join any} {}} } } }] @@ -40,6 +38,10 @@ append filter "_by_type" } +if {![exists_and_not_null referer]} { + set referer "all-communities" +} + db_multirow communities $filter {} ad_return_template Index: openacs-4/packages/dotlrn/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/index.tcl,v diff -u -r1.22 -r1.23 --- openacs-4/packages/dotlrn/www/index.tcl 23 Jan 2002 00:15:43 -0000 1.22 +++ openacs-4/packages/dotlrn/www/index.tcl 23 Jan 2002 05:45:56 -0000 1.23 @@ -5,6 +5,7 @@ @creation-date 2001-08-20 @version $Id$ } -query { + {filter ""} } -properties { admin_p:onevalue admin_url:onevalue