Index: openacs-4/packages/dotlrn/www/dotlrn-main-portlet-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/dotlrn-main-portlet-oracle.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/www/dotlrn-main-portlet-oracle.xql 7 Apr 2002 06:42:38 -0000 1.3 +++ openacs-4/packages/dotlrn/www/dotlrn-main-portlet-oracle.xql 31 May 2002 06:23:49 -0000 1.4 @@ -5,27 +5,19 @@ - select dc.*, - dotlrn_community.url(dc.community_id) as url, - acs_permission.permission_p(dc.community_id, :user_id, 'admin') as admin_p, - decode(dc.community_type, 'dotlrn_community', 'dotlrn_community', - 'dotlrn_club', 'dotlrn_club', - 'dotlrn_class_instance') as simple_community_type - from (select level, - rownum as my_rownum, - dotlrn_communities.community_id, - dotlrn_communities.parent_community_id, - dotlrn_communities.community_type, - dotlrn_communities.pretty_name - from dotlrn_communities - connect by prior dotlrn_communities.community_id = dotlrn_communities.parent_community_id - start with dotlrn_communities.parent_community_id is null - order by decode(dotlrn_communities.community_type, 'dotlrn_community', 2, 'dotlrn_club', 1, 0), - dotlrn_communities.pretty_name) dc, + select dotlrn_communities.*, + dotlrn_community.url(dotlrn_communities.community_id) as url, + decode(dotlrn_communities.community_type, 'dotlrn_community', 'dotlrn_community', + 'dotlrn_club', 'dotlrn_club', + 'dotlrn_class_instance') as simple_community_type, + tree.tree_level(dotlrn_communities.tree_sortkey) as tree_level, + acs_permission.permission_p(dotlrn_communities.community_id, :user_id, 'admin') as admin_p + from dotlrn_communities, dotlrn_member_rels_approved - where dc.community_id = dotlrn_member_rels_approved.community_id + where dotlrn_communities.community_id = dotlrn_member_rels_approved.community_id and dotlrn_member_rels_approved.user_id = :user_id - order by dc.my_rownum + order by decode(dotlrn_communities.community_type, 'dotlrn_community', 2, 'dotlrn_club', 1, 0), + tree_level