Index: openacs-4/packages/acs-subsite/www/admin/group-types/rel-type-add-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/group-types/rel-type-add-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/www/admin/group-types/rel-type-add-postgresql.xql 19 Aug 2001 16:32:14 -0000 1.2 +++ openacs-4/packages/acs-subsite/www/admin/group-types/rel-type-add-postgresql.xql 9 Sep 2001 17:10:41 -0000 1.3 @@ -5,16 +5,18 @@ - select lpad(' ', (t.type_level - 1) * 4) as indent, - t.pretty_name, t.rel_type - from (select t.pretty_name, t.object_type as rel_type, tree_level(tree_sortkey) as type_level - from acs_object_types t - where t.object_type not in (select g.rel_type - from group_type_rels g - where g.group_type = :group_type) - and (t.tree_sortkey like (select tree_sortkey || '%' from acs_object_types where object_type = 'membership_rel') - or t.tree_sortkey like (select tree_sortkey || '%' from acs_object_types where object_type = 'composition_rel'))) t, acs_rel_types rel_type + select repeat(' ', (t.type_level - 1) * 4) as indent, + t.pretty_name, t.rel_type + from (select t2.pretty_name, t2.object_type as rel_type, tree_level(t2.tree_sortkey) - tree_level(t1.tree_sortkey) + 1 as type_level + from acs_object_types t1, + acs_object_types t2 + where t2.tree_sortkey like (t1.tree_sortkey || '%') + and t2.object_type not in (select g.rel_type + from group_type_rels g + where g.group_type = :group_type) + and t1.object_type in ('membership_rel', 'composition_rel')) t, + acs_rel_types rel_type where t.rel_type = rel_type.rel_type and (rel_type.object_type_one = :group_type or acs_object_type__is_subtype_p(rel_type.object_type_one, :group_type) = 't') Index: openacs-4/packages/acs-subsite/www/admin/groups/rel-type-add-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/groups/rel-type-add-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/www/admin/groups/rel-type-add-postgresql.xql 7 Sep 2001 20:57:20 -0000 1.2 +++ openacs-4/packages/acs-subsite/www/admin/groups/rel-type-add-postgresql.xql 9 Sep 2001 17:10:41 -0000 1.3 @@ -6,16 +6,17 @@ - select lpad(' ', (t.type_level - 1) * 4) as indent, + select repeat(' ', (t.type_level - 1) * 4) as indent, t.pretty_name, t.rel_type - from (select t.pretty_name, t.object_type as rel_type, tree_level(tree_sortkey) as type_level - from acs_object_types t - where t.object_type not in (select g.rel_type - from group_rels g - where g.group_id = :group_id) - and (t.tree_sortkey like (select tree_sortkey || '%' from acs_object_types where object_type = 'membership_rel') - or t.tree_sortkey like (select tree_sortkey || '%' from acs_object_types where object_type = 'composition_rel'))) t, acs_rel_types rel_type - + from (select t2.pretty_name, t2.object_type as rel_type, tree_level(t2.tree_sortkey) - tree_level(t1.tree_sortkey) + 1 as type_level + from acs_object_types t1, + acs_object_types t2 + where t2.tree_sortkey like (t1.tree_sortkey || '%') + and t2.object_type not in (select g.rel_type + from group_rels g + where g.group_id = :group_id) + and t1.object_type in ('membership_rel', 'composition_rel')) t, + acs_rel_types rel_type where t.rel_type = rel_type.rel_type and (rel_type.object_type_one = :group_type or acs_object_type__is_subtype_p(rel_type.object_type_one, :group_type) = 't') Index: openacs-4/packages/acs-subsite/www/admin/rel-segments/new-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-segments/new-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/www/admin/rel-segments/new-postgresql.xql 11 Aug 2001 21:31:03 -0000 1.2 +++ openacs-4/packages/acs-subsite/www/admin/rel-segments/new-postgresql.xql 9 Sep 2001 17:10:41 -0000 1.3 @@ -5,13 +5,14 @@ - select t.pretty_name, t.object_type as rel_type, - lpad(' ', (level - 1) * 4) as indent - from acs_object_types t - where t.object_type not in (select s.rel_type from rel_segments s where s.group_id = :group_id) - and (t.tree_sortkey like (select tree_sortkey || '%' from acs_object_types where object_type='membership_rel') or - t.tree_sortkey like (select tree_sortkey || '%' from acs_object_types where object_type='composition_rel')) - order by lower(t.pretty_name) desc + select t2.pretty_name, t2.object_type as rel_type, + repeat(' ', (tree_level(t2.tree_sortkey) - tree_level(t1.tree_sortkey)) * 4) as indent + from acs_object_types t1, + acs_object_types t2 + where t2.tree_sortkey like (t1.tree_sortkey || '%') + and t1.object_type in ('membership_rel', 'composition_rel') + and t2.object_type not in (select s.rel_type from rel_segments s where s.group_id = :group_id) + order by lower(t2.pretty_name) desc Index: openacs-4/packages/acs-subsite/www/admin/rel-types/new-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-types/new-postgresql.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-subsite/www/admin/rel-types/new-postgresql.xql 19 Aug 2001 16:32:15 -0000 1.3 +++ openacs-4/packages/acs-subsite/www/admin/rel-types/new-postgresql.xql 9 Sep 2001 17:10:41 -0000 1.4 @@ -6,13 +6,12 @@ - select lpad(' ', (tree_level(tree_sortkey) - 1) * 4) || t.pretty_name as name, - t.object_type - from acs_object_types t - where (t.tree_sortkey like (select tree_sortkey || '%' from acs_object_types - where object_type= 'membership_rel') - or t.tree_sortkey like (select tree_sortkey || '%' from acs_object_types - where object_type= 'composition_rel')) + select repeat(' ', (tree_level(t2.tree_sortkey) - tree_level(t1.tree_sortkey)) * 4) || t2.pretty_name as name, + t2.object_type + from acs_object_types t1, + acs_object_types t2 + where t2.tree_sortkey like (t1.tree_sortkey || '%') + and t1.object_type in ('membership_rel', 'composition_rel')