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 -N -r1.11 -r1.12 --- openacs-4/packages/dotlrn/www/communities-chunk-oracle.xql 31 May 2002 06:23:49 -0000 1.11 +++ openacs-4/packages/dotlrn/www/communities-chunk-oracle.xql 13 Jun 2018 16:27:20 -0000 1.12 @@ -2,213 +2,50 @@ oracle8.1.6 - - - - select count(*) - from dotlrn_communities_not_closed - - - - - - 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, - 1 as member_p, - decode(acs_permission.permission_p(:user_id, dotlrn_communities.community_id, 'admin'), 'f', 0, 1) as admin_p, - (select dotlrn_community_types.community_type - from dotlrn_community_types - where dotlrn_community_types.tree_sortkey = tree.ancestor_key(dotlrn_communities.tree_sortkey, 1)) as root_community_type - from dotlrn_active_communities dotlrn_communities, - dotlrn_member_rels_approved - where dotlrn_member_rels_approved.user_id = :user_id - and dotlrn_member_rels_approved.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, 1 as member_p, - decode(acs_permission.permission_p(:user_id, dotlrn_communities.community_id, 'admin'), 'f', 0, 1) as admin_p, (select dotlrn_community_types.community_type from dotlrn_community_types - where dotlrn_community_types.tree_sortkey = tree.ancestor_key(dotlrn_communities.tree_sortkey, 1)) as root_community_type + where dotlrn_community_types.tree_sortkey = tree.ancestor_key(dotlrn_communities.tree_sortkey, 1)) as root_community_type from dotlrn_communities dotlrn_communities, dotlrn_member_rels_approved where dotlrn_member_rels_approved.user_id = :user_id and dotlrn_member_rels_approved.community_id = dotlrn_communities.community_id + and (:community_type is null or 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 as member_p, - decode(acs_permission.permission_p(:user_id, dotlrn_communities.community_id, 'admin'), 'f', 0, 1) as admin_p, - (select dotlrn_community_types.community_type - from dotlrn_community_types - where dotlrn_community_types.tree_sortkey = tree.ancestor_key(dotlrn_communities.tree_sortkey, 1)) 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 as member_p, - decode(acs_permission.permission_p(:user_id, dotlrn_communities.community_id, 'admin'), 'f', 0, 1) as admin_p, (select dotlrn_community_types.community_type from dotlrn_community_types - where dotlrn_community_types.tree_sortkey = tree.ancestor_key(dotlrn_communities.tree_sortkey, 1)) as root_community_type + where dotlrn_community_types.tree_sortkey = tree_ancestor_key(dotlrn_communities.tree_sortkey, 1)) 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.parent_community_id is null + and (:community_type is null or dotlrn_communities.community_type = :community_type) order by root_community_type, dotlrn_communities.community_type, dotlrn_communities.pretty_name - - - select count(*) - from dotlrn_communities_not_closed dotlrn_communities - where dotlrn_communities.community_type = :community_type - - - - - - 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, - 1 as member_p, - decode(acs_permission.permission_p(:user_id, dotlrn_communities.community_id, 'admin'), 'f', 0, 1) as admin_p, - (select dotlrn_community_types.community_type - from dotlrn_community_types - where dotlrn_community_types.tree_sortkey = tree.ancestor_key(dotlrn_communities.tree_sortkey, 1)) as root_community_type - from dotlrn_active_communities dotlrn_communities, - dotlrn_member_rels_approved - where dotlrn_member_rels_approved.user_id = :user_id - and dotlrn_member_rels_approved.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, - 1 as member_p, - decode(acs_permission.permission_p(:user_id, dotlrn_communities.community_id, 'admin'), 'f', 0, 1) as admin_p, - (select dotlrn_community_types.community_type - from dotlrn_community_types - where dotlrn_community_types.tree_sortkey = tree.ancestor_key(dotlrn_communities.tree_sortkey, 1)) as root_community_type - from dotlrn_communities dotlrn_communities, - dotlrn_member_rels_approved - where dotlrn_member_rels_approved.user_id = :user_id - and dotlrn_member_rels_approved.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 as member_p, - decode(acs_permission.permission_p(:user_id, dotlrn_communities.community_id, 'admin'), 'f', 0, 1) as admin_p, - (select dotlrn_community_types.community_type - from dotlrn_community_types - where dotlrn_community_types.tree_sortkey = tree.ancestor_key(dotlrn_communities.tree_sortkey, 1)) 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) - 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 as member_p, - decode(acs_permission.permission_p(:user_id, dotlrn_communities.community_id, 'admin'), 'f', 0, 1) as admin_p, - (select dotlrn_community_types.community_type - from dotlrn_community_types - where dotlrn_community_types.tree_sortkey = tree.ancestor_key(dotlrn_communities.tree_sortkey, 1)) 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-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/communities-chunk-postgresql.xql,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/dotlrn/www/communities-chunk-postgresql.xql 27 Jan 2018 17:58:19 -0000 1.3 +++ openacs-4/packages/dotlrn/www/communities-chunk-postgresql.xql 13 Jun 2018 16:27:20 -0000 1.4 @@ -1,233 +1,51 @@ - postgresql7.1 - - - - select count(*) - from dotlrn_communities_not_closed - - - + postgresql7.1 + 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, 1 as member_p, - CASE - WHEN acs_permission__permission_p(:user_id, - dotlrn_communities.community_id, - 'admin') = 'f' - THEN 0 - ELSE 1 - END as admin_p, (select dotlrn_community_types.community_type from dotlrn_community_types - where dotlrn_community_types.tree_sortkey = tree_ancestor_key(dotlrn_communities.tree_sortkey, 1)) as root_community_type + where dotlrn_community_types.tree_sortkey = tree_ancestor_key(dotlrn_communities.tree_sortkey, 1)) as root_community_type from dotlrn_communities dotlrn_communities, dotlrn_member_rels_approved where dotlrn_member_rels_approved.user_id = :user_id and dotlrn_member_rels_approved.community_id = dotlrn_communities.community_id + and (:community_type is null or 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 as member_p, - CASE - WHEN acs_permission__permission_p(:user_id, - dotlrn_communities.community_id, - 'admin') = 'f' - THEN 0 - ELSE 1 - END as admin_p, - (select dotlrn_community_types.community_type - from dotlrn_community_types - where dotlrn_community_types.tree_sortkey = tree_ancestor_key(dotlrn_communities.tree_sortkey, 1)) 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 as member_p, - CASE - WHEN acs_permission__permission_p(:user_id, - dotlrn_communities.community_id, - 'admin') = 'f' - THEN 0 - ELSE 1 - END as admin_p, (select dotlrn_community_types.community_type from dotlrn_community_types - where dotlrn_community_types.tree_sortkey = tree_ancestor_key(dotlrn_communities.tree_sortkey, 1)) as root_community_type + where dotlrn_community_types.tree_sortkey = tree_ancestor_key(dotlrn_communities.tree_sortkey, 1)) 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.parent_community_id is null + and (:community_type is null or dotlrn_communities.community_type = :community_type) order by root_community_type, dotlrn_communities.community_type, dotlrn_communities.pretty_name - - - select count(*) - from dotlrn_communities_not_closed dotlrn_communities - where dotlrn_communities.community_type = :community_type - - - - - - 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, - 1 as member_p, - CASE - WHEN acs_permission__permission_p(:user_id, - dotlrn_communities.community_id, - 'admin') = 'f' - THEN 0 - ELSE 1 - END as admin_p, - (select dotlrn_community_types.community_type - from dotlrn_community_types - where dotlrn_community_types.tree_sortkey = tree_ancestor_key(dotlrn_communities.tree_sortkey, 1)) as root_community_type - from dotlrn_active_communities dotlrn_communities, - dotlrn_member_rels_approved - where dotlrn_member_rels_approved.user_id = :user_id - and dotlrn_member_rels_approved.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, - 1 as member_p, - CASE - WHEN acs_permission__permission_p(:user_id, - dotlrn_communities.community_id, - 'admin') = 'f' - THEN 0 - ELSE 1 - END as admin_p, - (select dotlrn_community_types.community_type - from dotlrn_community_types - where dotlrn_community_types.tree_sortkey = tree_ancestor_key(dotlrn_communities.tree_sortkey, 1)) as root_community_type - from dotlrn_communities dotlrn_communities, - dotlrn_member_rels_approved - where dotlrn_member_rels_approved.user_id = :user_id - and dotlrn_member_rels_approved.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 as member_p, - CASE - WHEN acs_permission__permission_p(:user_id, - dotlrn_communities.community_id, - 'admin') = 'f' - THEN 0 - ELSE 1 - END as admin_p, - (select dotlrn_community_types.community_type - from dotlrn_community_types - where dotlrn_community_types.tree_sortkey = tree_ancestor_key(dotlrn_communities.tree_sortkey, 1)) 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) - 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 as member_p, - CASE - WHEN acs_permission__permission_p(:user_id, - dotlrn_communities.community_id, - 'admin') = 'f' - THEN 0 - ELSE 1 - END as admin_p, - (select dotlrn_community_types.community_type - from dotlrn_community_types - where dotlrn_community_types.tree_sortkey = tree_ancestor_key(dotlrn_communities.tree_sortkey, 1)) 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.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/communities-chunk.adp,v diff -u -N -r1.13 -r1.14 --- openacs-4/packages/dotlrn/www/communities-chunk.adp 15 May 2007 20:14:25 -0000 1.13 +++ openacs-4/packages/dotlrn/www/communities-chunk.adp 13 Jun 2018 16:27:20 -0000 1.14 @@ -17,7 +17,7 @@ # %> - +

#dotlrn.Communities#@title@

@filter_bar;noquote@

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 -N -r1.15 -r1.16 --- openacs-4/packages/dotlrn/www/communities-chunk.tcl 15 Sep 2017 07:28:53 -0000 1.15 +++ openacs-4/packages/dotlrn/www/communities-chunk.tcl 13 Jun 2018 16:27:20 -0000 1.16 @@ -23,7 +23,7 @@ } -query { {filter "select_all_memberships"} } -properties { - n_communities:onevalue + communities_p:onevalue communities:multirow } @@ -33,26 +33,22 @@ set user_id [ad_conn user_id] -if {$community_type ne ""} { - set n_communities [db_string select_all_communities_count_by_type {}] -} else { - set n_communities [db_string select_all_communities_count {}] -} +set communities_p [db_string communities_p { + select exists ( + select 1 from dotlrn_communities_not_closed + where (:community_type is null or community_type = :community_type) + ) from dual +}] set filter_bar [ad_dimensional [list [list filter "[_ dotlrn.Memberships_1]" select_all_memberships \ { {select_all_memberships current {}} {select_all_non_memberships join {}} }]]] -if {$community_type ne ""} { - append filter "_by_type" -} - -db_multirow -extend {query referer} communities $filter {} { - if {(![info exists referer] || $referer eq "")} { - set referer "./" - } +db_multirow -extend {query url referer} communities $filter {} { + set referer "./" + set url [dotlrn_community::get_community_url $community_id] set query $filter } @@ -82,9 +78,6 @@ } } -ad_return_template - - # Local variables: # mode: tcl # tcl-indent-level: 4