Index: openacs-4/packages/acs-subsite/www/admin/group-types/delete-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/group-types/delete-2.tcl,v diff -u -r1.7.2.1 -r1.7.2.2 --- openacs-4/packages/acs-subsite/www/admin/group-types/delete-2.tcl 10 Sep 2015 08:21:40 -0000 1.7.2.1 +++ openacs-4/packages/acs-subsite/www/admin/group-types/delete-2.tcl 27 Oct 2015 23:01:34 -0000 1.7.2.2 @@ -42,14 +42,7 @@ set package_name $group_type } -if { [db_string package_exists { - select case when exists (select 1 - from user_objects o - where o.object_type='PACKAGE' - and o.object_name = upper(:package_name)) - then 1 else 0 end - from dual -}] } { +if { [db_string package_exists {}] } { lappend plsql [list "package_drop" [db_map package_drop]] } else { set package_name "" @@ -61,13 +54,7 @@ # Remove the group_type lappend plsql [list "delete_group_type" [db_map delete_group_type]] -if { [db_string type_exists { - select case when exists (select 1 from acs_object_types t where t.object_type = :group_type) - then 1 - else 0 - end - from dual -}] } { +if { [db_string type_exists {}] } { lappend plsql [list "drop_type" [db_map drop_type]] } Index: openacs-4/packages/acs-subsite/www/admin/group-types/delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/group-types/delete.tcl,v diff -u -r1.5.2.1 -r1.5.2.2 --- openacs-4/packages/acs-subsite/www/admin/group-types/delete.tcl 10 Sep 2015 08:21:40 -0000 1.5.2.1 +++ openacs-4/packages/acs-subsite/www/admin/group-types/delete.tcl 27 Oct 2015 23:01:34 -0000 1.5.2.2 @@ -42,13 +42,7 @@ return } -set subtypes_exist_p [db_string number_subtypes { - select case when exists (select 1 - from acs_object_types t - where t.supertype = :group_type) - then 1 else 0 end - from dual -}] +set subtypes_exist_p [db_string number_subtypes {}] if { $subtypes_exist_p } { set return_url "[ad_conn url]?[ad_conn query]" @@ -68,14 +62,7 @@ } # Now let's check if any relationship types depend on this group type -set rel_types_depend_p [db_string rel_type_exists_p { - select case when exists (select 1 - from acs_rel_types t - where t.object_type_one = :group_type - or t.object_type_two = :group_type) - then 1 else 0 end - from dual -}] +set rel_types_depend_p [db_string rel_type_exists_p {}] if { $rel_types_depend_p } { set return_url "[ad_conn url]?[ad_conn query]" Index: openacs-4/packages/acs-subsite/www/admin/group-types/groups-list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/group-types/groups-list.tcl,v diff -u -r1.2.2.1 -r1.2.2.2 --- openacs-4/packages/acs-subsite/www/admin/group-types/groups-list.tcl 10 Sep 2015 08:21:40 -0000 1.2.2.1 +++ openacs-4/packages/acs-subsite/www/admin/group-types/groups-list.tcl 27 Oct 2015 23:01:34 -0000 1.2.2.2 @@ -10,21 +10,7 @@ set package_id [ad_conn package_id] -db_multirow groups select_groups { - select DISTINCT g.group_id, g.group_name - from (select group_id, group_name - from groups g, acs_objects o - where g.group_id = o.object_id - and o.object_type = :group_type) g, - (select object_id - from all_object_party_privilege_map - where party_id = :user_id and privilege = 'read') perm, - application_group_element_map m - where perm.object_id = g.group_id - and m.package_id = :package_id - and m.element_id = g.group_id - order by lower(g.group_name) -} +db_multirow groups select_groups {} ad_return_template Index: openacs-4/packages/acs-subsite/www/admin/group-types/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/group-types/index.tcl,v diff -u -r1.4.6.1 -r1.4.6.2 --- openacs-4/packages/acs-subsite/www/admin/group-types/index.tcl 10 Sep 2015 08:21:40 -0000 1.4.6.1 +++ openacs-4/packages/acs-subsite/www/admin/group-types/index.tcl 27 Oct 2015 23:01:35 -0000 1.4.6.2 @@ -25,29 +25,7 @@ set package_id [ad_conn package_id] -db_multirow group_types select_group_types { - select t.object_type as group_type, t.pretty_plural, - nvl(num.number_groups,0) as number_groups, t.indent - from (select t.object_type, t.pretty_plural, rownum as inner_rownum, - replace(lpad(' ', (level - 1) * 4), ' ', ' ') as indent - from acs_object_types t - connect by prior t.object_type = t.supertype - start with t.object_type = 'group' - order by lower(t.pretty_plural)) t, - (select o.object_type, count(*) number_groups - from groups g, acs_objects o, - acs_object_party_privilege_map perm, - application_group_element_map app_group - where perm.object_id = g.group_id - and perm.party_id = :user_id - and perm.privilege = 'read' - and o.object_id = g.group_id - and app_group.package_id = :package_id - and app_group.element_id = g.group_id - group by o.object_type) num - where t.object_type = num.object_type(+) - order by t.inner_rownum -} +db_multirow group_types select_group_types {} ad_return_template Index: openacs-4/packages/acs-subsite/www/admin/group-types/new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/group-types/new.tcl,v diff -u -r1.5.6.1 -r1.5.6.2 --- openacs-4/packages/acs-subsite/www/admin/group-types/new.tcl 10 Sep 2015 08:21:40 -0000 1.5.6.1 +++ openacs-4/packages/acs-subsite/www/admin/group-types/new.tcl 27 Oct 2015 23:01:35 -0000 1.5.6.2 @@ -71,20 +71,12 @@ Please back up and choose another." } else { # let's make sure the names are unique - if { [db_string pretty_name_unique { - select case when exists (select 1 from acs_object_types t where t.pretty_name = :pretty_name) - then 1 else 0 end - from dual - }] } { + if { [db_string pretty_name_unique {}] } { incr exception_count append exception_text "
  • The specified pretty name, $pretty_name, already exists. Please enter another
  • " } - if { [db_string pretty_name_unique { - select case when exists (select 1 from acs_object_types t where t.pretty_plural = :pretty_plural) - then 1 else 0 end - from dual - }] } { + if { [db_string pretty_name_unique {}] } { incr exception_count append exception_text "
  • The specified pretty plural, $pretty_plural, already exists. Please enter another
  • " } Index: openacs-4/packages/acs-subsite/www/admin/group-types/one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/group-types/one.tcl,v diff -u -r1.7.2.1 -r1.7.2.2 --- openacs-4/packages/acs-subsite/www/admin/group-types/one.tcl 10 Sep 2015 08:21:41 -0000 1.7.2.1 +++ openacs-4/packages/acs-subsite/www/admin/group-types/one.tcl 27 Oct 2015 23:01:35 -0000 1.7.2.2 @@ -47,22 +47,7 @@ # Pull out the first 25 groups of this type. If there are more, we'll # offer a link to display them all. Alphabetize the first 25 groups -db_multirow groups groups_select { - select my_view.group_name, my_view.group_id, rownum as num - from (select /*+ ORDERED */ DISTINCT g.group_name, g.group_id - from acs_objects o, groups g, - application_group_element_map app_group, - all_object_party_privilege_map perm - where perm.object_id = g.group_id - and perm.party_id = :user_id - and perm.privilege = 'read' - and g.group_id = o.object_id - and o.object_type = :group_type - and app_group.package_id = :package_id - and app_group.element_id = g.group_id - order by lower(g.group_name)) my_view - where rownum <= 26 -} +db_multirow groups groups_select {} # Select out all the attributes for groups of this type db_multirow -extend {one_attribute_url} attributes attributes_select { Index: openacs-4/packages/acs-subsite/www/admin/group-types/rel-type-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/group-types/rel-type-add-2.tcl,v diff -u -r1.5.2.1 -r1.5.2.2 --- openacs-4/packages/acs-subsite/www/admin/group-types/rel-type-add-2.tcl 10 Sep 2015 08:21:41 -0000 1.5.2.1 +++ openacs-4/packages/acs-subsite/www/admin/group-types/rel-type-add-2.tcl 27 Oct 2015 23:01:35 -0000 1.5.2.2 @@ -18,13 +18,7 @@ # This test makes sure this group_type can accept the # specified rel type. This means the group type is itself a # type (or subtype) of rel_type.object_type_one - if { ![db_string types_match_p { - select count(*) - from acs_rel_types t - where (t.object_type_one = :group_type - or acs_object_type.is_subtype_p(t.object_type_one, :group_type) = 't') - and t.rel_type = :rel_type - }] } { + if { ![db_string types_match_p {}] } { ad_complain "Groups of type \"$group_type\" cannot use relationships of type \"$rel_type.\"" } } Index: openacs-4/packages/acs-subsite/www/admin/group-types/rel-type-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/group-types/rel-type-add.tcl,v diff -u -r1.6.2.1 -r1.6.2.2 --- openacs-4/packages/acs-subsite/www/admin/group-types/rel-type-add.tcl 10 Sep 2015 08:21:41 -0000 1.6.2.1 +++ openacs-4/packages/acs-subsite/www/admin/group-types/rel-type-add.tcl 27 Oct 2015 23:01:35 -0000 1.6.2.2 @@ -32,21 +32,7 @@ # rel type. If you can find a more efficient way to do this query, # please let us know! -mbryzek -db_multirow primary_rels select_primary_relations { - select replace(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, level 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) - connect by prior t.object_type = t.supertype - start with t.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') -} +db_multirow primary_rels select_primary_relations {} set export_vars [export_vars -form {group_type return_url}]