Index: openacs-4/packages/acs-subsite/tcl/application-group-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/application-group-procs-oracle.xql,v diff -u -r1.7 -r1.7.10.1 --- openacs-4/packages/acs-subsite/tcl/application-group-procs-oracle.xql 1 Feb 2009 21:50:21 -0000 1.7 +++ openacs-4/packages/acs-subsite/tcl/application-group-procs-oracle.xql 28 Oct 2015 09:38:33 -0000 1.7.10.1 @@ -3,46 +3,6 @@ oracle8.1.6 - - - - select case when exists ( - select 1 - from application_group_element_map - where package_id = :package_id - and element_id = :party_id - union all - select 1 - from application_groups - where package_id = :package_id - and group_id = :party_id - ) then 1 else 0 end - from dual - - - - - - - - - select case when exists ( - select 1 - from application_group_element_map - where package_id = :package_id - and element_id = :party_id - union all - select 1 - from application_groups - where package_id = :package_id - and group_id = :party_id - ) then 1 else 0 end - from dual - - - - - Index: openacs-4/packages/acs-subsite/tcl/application-group-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/application-group-procs-postgresql.xql,v diff -u -r1.6 -r1.6.10.1 --- openacs-4/packages/acs-subsite/tcl/application-group-procs-postgresql.xql 1 Feb 2009 21:50:21 -0000 1.6 +++ openacs-4/packages/acs-subsite/tcl/application-group-procs-postgresql.xql 28 Oct 2015 09:38:33 -0000 1.6.10.1 @@ -3,46 +3,6 @@ postgresql7.1 - - - - select case when exists ( - select 1 - from application_group_element_map - where package_id = :package_id - and element_id = :party_id - union all - select 1 - from application_groups - where package_id = :package_id - and group_id = :party_id - ) then 1 else 0 end - - - - - - - - - - select case when exists ( - select 1 - from application_group_element_map - where package_id = :package_id - and element_id = :party_id - union all - select 1 - from application_groups - where package_id = :package_id - and group_id = :party_id - ) then 1 else 0 end - - - - - - Index: openacs-4/packages/acs-subsite/tcl/application-group-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/application-group-procs.tcl,v diff -u -r1.16.2.1 -r1.16.2.2 --- openacs-4/packages/acs-subsite/tcl/application-group-procs.tcl 10 Sep 2015 08:21:35 -0000 1.16.2.1 +++ openacs-4/packages/acs-subsite/tcl/application-group-procs.tcl 28 Oct 2015 09:38:33 -0000 1.16.2.2 @@ -90,15 +90,7 @@ # Check if the rel belongs to the application group, OR # the party *is* the application group. This proc considers the # application group to contain itself. - set found_p [db_string app_group_contains_rel_p { - select case when exists ( - select 1 - from application_group_element_map - where package_id = :package_id - and rel_id = :rel_id - ) then 1 else 0 end - from dual - }] + set found_p [db_string app_group_contains_rel_p {}] return $found_p } @@ -126,15 +118,7 @@ # Check if the party is a member of the application group, OR # the party *is* the application group. This proc considers the # applcation group to contain itself. - set found_p [db_string app_group_contains_segment_p { - select case when exists ( - select 1 - from application_group_segments - where package_id = :package_id - and segment_id = :segment_id - ) then 1 else 0 end - from dual - }] + set found_p [db_string app_group_contains_segment_p {}] return $found_p } @@ -166,14 +150,7 @@ error "application_group::group_id_from_package_id - no package_id specified." } - set group_id [db_exec_plsql application_group_from_package_id_query { - begin - :1 := application_group.group_id_from_package_id ( - package_id => :package_id, - no_complain_p => :no_complain_p - ); - end; - }] + set group_id [db_exec_plsql application_group_from_package_id_query {}] return $group_id } Index: openacs-4/packages/acs-subsite/tcl/attribute-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/attribute-procs-oracle.xql,v diff -u -r1.3.30.1 -r1.3.30.2 --- openacs-4/packages/acs-subsite/tcl/attribute-procs-oracle.xql 27 Oct 2015 22:56:30 -0000 1.3.30.1 +++ openacs-4/packages/acs-subsite/tcl/attribute-procs-oracle.xql 28 Oct 2015 09:38:33 -0000 1.3.30.2 @@ -4,23 +4,6 @@ oracle8.1.6 - - - - select case when exists (select 1 - from acs_attributes a - where (a.attribute_name = :attribute - or a.column_name = :attribute) - and a.object_type = :object_type) - then 1 - else 0 - end - from dual - - - - - Index: openacs-4/packages/acs-subsite/tcl/attribute-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/attribute-procs-postgresql.xql,v diff -u -r1.4.30.1 -r1.4.30.2 --- openacs-4/packages/acs-subsite/tcl/attribute-procs-postgresql.xql 27 Oct 2015 22:56:30 -0000 1.4.30.1 +++ openacs-4/packages/acs-subsite/tcl/attribute-procs-postgresql.xql 28 Oct 2015 09:38:33 -0000 1.4.30.2 @@ -3,23 +3,6 @@ postgresql7.1 - - - - select case when exists (select 1 - from acs_attributes a - where (a.attribute_name = :attribute - or a.column_name = :attribute) - and a.object_type = :object_type) - then 1 - else 0 - end - - - - - - Index: openacs-4/packages/acs-subsite/tcl/email-image-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/email-image-procs-oracle.xql,v diff -u -r1.3 -r1.3.14.1 --- openacs-4/packages/acs-subsite/tcl/email-image-procs-oracle.xql 4 Jun 2006 00:45:42 -0000 1.3 +++ openacs-4/packages/acs-subsite/tcl/email-image-procs-oracle.xql 28 Oct 2015 09:38:33 -0000 1.3.14.1 @@ -2,15 +2,15 @@ oracle8.1.6 - + update cr_revisions set content_length = dbms_lob.getlength(content) where revision_id = :revision_id - + update cr_revisions set content = empty_blob() Index: openacs-4/packages/acs-subsite/tcl/email-image-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/email-image-procs-postgresql.xql,v diff -u -r1.2 -r1.2.14.1 --- openacs-4/packages/acs-subsite/tcl/email-image-procs-postgresql.xql 4 Jun 2006 00:45:42 -0000 1.2 +++ openacs-4/packages/acs-subsite/tcl/email-image-procs-postgresql.xql 28 Oct 2015 09:38:33 -0000 1.2.14.1 @@ -2,15 +2,15 @@ postgresql7.1 - + update cr_revisions set content_length = lob_length(lob) where revision_id = :revision_id - + update cr_revisions set mime_type = :mime_type, Index: openacs-4/packages/acs-subsite/tcl/email-image-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/email-image-procs.tcl,v diff -u -r1.14.2.2 -r1.14.2.3 --- openacs-4/packages/acs-subsite/tcl/email-image-procs.tcl 18 Sep 2015 07:27:47 -0000 1.14.2.2 +++ openacs-4/packages/acs-subsite/tcl/email-image-procs.tcl 28 Oct 2015 09:38:34 -0000 1.14.2.3 @@ -17,7 +17,7 @@ @param level Change to this level } { db_transaction { - db_dml update_users { } + db_dml update_users {} } } @@ -26,7 +26,7 @@ } { Returns the priv_email field of the user from the users table. } { - set priv_level [db_string get_private_email { }] + set priv_level [db_string get_private_email {}] if {$priv_level eq "5"} { set priv_level [parameter::get_from_package_key -package_key "acs-subsite" \ -parameter "PrivateEmailLevelP" -default 4] @@ -102,7 +102,7 @@ Returns the email of the user } { - return [db_string get_email { }] + return [db_string get_email {}] } @@ -173,9 +173,9 @@ -description "User email image" -creation_ip $creation_ip ] email_image::add_relation -user_id $user_id -item_id $item_id - db_dml update_cr_items { } - db_dml lob_content { } -blob_files [list ${dest_path}] - db_dml lob_size { } + db_dml update_cr_items_new {} + db_dml new_lob_content {} -blob_files [list ${dest_path}] + db_dml lob_size {} } # Delete the temporary file created by ImageMagick @@ -250,9 +250,9 @@ set revision_id [content::revision::new -item_id $item_id -title $image_name \ -mime_type $mime_type \ -description "User email image" -creation_ip $creation_ip ] - db_dml update_cr_items { } - db_dml lob_content { } -blob_files [list ${dest_path}] - db_dml lob_size { } + db_dml update_cr_items {} + db_dml lob_content {} -blob_files [list ${dest_path}] + db_dml lob_size {} } } else { db_transaction { @@ -265,9 +265,9 @@ email_image::add_relation -user_id $user_id -item_id $item_id - db_dml update_cr_items { } - db_dml lob_content { } -blob_files [list ${dest_path}] - db_dml lob_size { } + db_dml update_cr_items {} + db_dml lob_content {} -blob_files [list ${dest_path}] + db_dml lob_size {} } } # Delete the temporary file created by ImageMagick @@ -279,7 +279,7 @@ ad_proc -public email_image::get_folder_id { } { Returns the folder_id of the folder with the name "Email_Images" } { - return [db_string check_folder_name { } ] + return [db_string check_folder_name {} ] } ad_proc -public email_image::add_relation { @@ -290,7 +290,7 @@ @param item_id the item_id of the image in the content repository } { - db_exec_plsql add_relation { } + db_exec_plsql add_relation {} } ad_proc -public email_image::get_related_item_id { @@ -299,7 +299,7 @@ Returns the item_id of the email_image stored in the content repository for user_id. } { - return [db_string get_rel_item { } -default -1 ] + return [db_string get_rel_item {} -default -1 ] } Index: openacs-4/packages/acs-subsite/tcl/email-image-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/email-image-procs.xql,v diff -u -r1.3 -r1.3.12.1 --- openacs-4/packages/acs-subsite/tcl/email-image-procs.xql 5 Dec 2007 08:23:27 -0000 1.3 +++ openacs-4/packages/acs-subsite/tcl/email-image-procs.xql 28 Oct 2015 09:38:34 -0000 1.3.12.1 @@ -46,7 +46,7 @@ - + update cr_items set live_revision = :revision_id Index: openacs-4/packages/acs-subsite/tcl/group-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/Attic/group-procs.xql,v diff -u -r1.8 -r1.8.14.1 --- openacs-4/packages/acs-subsite/tcl/group-procs.xql 12 Sep 2006 17:25:51 -0000 1.8 +++ openacs-4/packages/acs-subsite/tcl/group-procs.xql 28 Oct 2015 09:38:34 -0000 1.8.14.1 @@ -11,16 +11,6 @@ - - - - select t.package_name, lower(t.id_column) as id_column - from acs_object_types t - where t.object_type = :group_type - - - - Index: openacs-4/packages/acs-subsite/tcl/group-type-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/group-type-procs.tcl,v diff -u -r1.6.2.1 -r1.6.2.2 --- openacs-4/packages/acs-subsite/tcl/group-type-procs.tcl 10 Sep 2015 08:21:36 -0000 1.6.2.1 +++ openacs-4/packages/acs-subsite/tcl/group-type-procs.tcl 28 Oct 2015 09:38:34 -0000 1.6.2.2 @@ -31,14 +31,7 @@ } set user_id [ad_conn user_id] } - return [db_string group_exists_p { - select case when exists (select 1 - from acs_objects o - where acs_permission.permission_p(o.object_id, :user_id, 'delete') = 'f' - and o.object_type = :group_type) - then 0 else 1 end - from dual - }] + return [db_string group_exists_p {}] } Index: openacs-4/packages/acs-subsite/tcl/package-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/package-procs-oracle.xql,v diff -u -r1.14.8.1 -r1.14.8.2 --- openacs-4/packages/acs-subsite/tcl/package-procs-oracle.xql 27 Oct 2015 22:56:30 -0000 1.14.8.1 +++ openacs-4/packages/acs-subsite/tcl/package-procs-oracle.xql 28 Oct 2015 09:38:34 -0000 1.14.8.2 @@ -86,17 +86,6 @@ - - - - select acs_object.name(:user_id) as author, - sysdate as creation_date - from dual - - - - - @@ -183,7 +172,17 @@ - + + + + select args.argument_name + from user_arguments args + where args.package_name =upper(:supertype_package_name) + and args.object_name='NEW' + + + + Index: openacs-4/packages/acs-subsite/tcl/package-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/package-procs-postgresql.xql,v diff -u -r1.20.2.1 -r1.20.2.2 --- openacs-4/packages/acs-subsite/tcl/package-procs-postgresql.xql 27 Oct 2015 22:56:30 -0000 1.20.2.1 +++ openacs-4/packages/acs-subsite/tcl/package-procs-postgresql.xql 28 Oct 2015 09:38:34 -0000 1.20.2.2 @@ -85,17 +85,6 @@ - - - - select acs_object__name(:user_id) as author, - current_timestamp as creation_date - - - - - - @@ -153,15 +142,6 @@ - - - -select 1 - - - - - @@ -176,12 +156,10 @@ - - select args.arg_name - from acs_function_args args - where args.function =upper(:supertype_package_name) || '__NEW' - - + select args.arg_name + from acs_function_args args + where args.function = upper(:supertype_package_name) || '__NEW' + Index: openacs-4/packages/acs-subsite/tcl/package-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/package-procs.tcl,v diff -u -r1.26.2.2 -r1.26.2.3 --- openacs-4/packages/acs-subsite/tcl/package-procs.tcl 27 Oct 2015 22:56:30 -0000 1.26.2.2 +++ openacs-4/packages/acs-subsite/tcl/package-procs.tcl 28 Oct 2015 09:38:34 -0000 1.26.2.3 @@ -114,19 +114,7 @@ # type and all its supertypes in order starting with this object # type up the type hierarchy - db_foreach select_all_attributes { - select upper(nvl(attr.table_name,t.table_name)) as attr_table_name, - upper(nvl(attr.column_name, attr.attribute_name)) as attr_column_name, - attr.ancestor_type, attr.min_n_values, attr.default_value - from acs_object_type_attributes attr, - (select t.object_type, t.table_name, level as type_level - from acs_object_types t - start with t.object_type = :object_type - connect by prior t.supertype = t.object_type) t - where attr.ancestor_type = t.object_type - and attr.object_type = :object_type - order by t.type_level - } { + db_foreach select_all_attributes {} { # First make sure the attribute is okay if { $limit_to ne "" } { # We have a limited list of arguments to use. Make sure @@ -243,13 +231,7 @@ including all children types. } { - set object_type_list [db_list select_object_types { - select t.object_type - from acs_object_types t - where t.dynamic_p = 't' - start with t.object_type = :object_type - connect by prior t.object_type = t.supertype - }] + set object_type_list [db_list select_object_types {}] # Something changed... flush the data dictionary cache for the # type hierarchy starting with this object's type. Note that we @@ -396,12 +378,7 @@ # Prune down the list of attributes in supertype_attr_list to # those specific to the function call in the supertype's package - set supertype_params [db_list select_supertype_function_params { - select args.argument_name - from user_arguments args - where args.package_name =upper(:supertype_package_name) - and args.object_name='NEW' - }] + set supertype_params [db_list select_supertype_function_params {}] set supertype_attr_list [package_create_attribute_list \ -supertype $supertype \ @@ -426,24 +403,14 @@ } { # First flush the cache for all pairs of object_type, ancestor_type (start_with) - db_foreach select_ancestor_types { - select t.object_type as ancestor_type - from acs_object_types t - start with t.object_type = :object_type - connect by prior t.supertype = t.object_type - } { + db_foreach select_ancestor_types {} { if { [util_memoize_cached_p [list package_object_view_helper -start_with $ancestor_type $object_type]] } { util_memoize_flush [list package_object_view_helper -start_with $ancestor_type $object_type] } } # flush the cache for all pairs of sub_type, object_type(start_with) - db_foreach select_sub_types { - select t.object_type as sub_type - from acs_object_types t - start with t.object_type = :object_type - connect by prior t.object_type = t.supertype - } { + db_foreach select_sub_types {} { if { [util_memoize_cached_p [list package_object_view_helper -start_with $object_type $sub_type]] } { util_memoize_flush [list package_object_view_helper -start_with $object_type $sub_type] } @@ -557,13 +524,9 @@ } { if { [ad_conn isconnected] } { set user_id [ad_conn user_id] - db_1row select_comments { - select acs_object.name(:user_id) as author, - sysdate as creation_date - from dual - } + db_1row select_comments {} } else { - db_1row select_comments { + db_1row select_author_unknwon { select 'Unknown' as author, sysdate as creation_date from dual @@ -696,21 +659,7 @@ # it... It's slow because of the underlying data dictionary query # against user_arguments - return [db_list_of_lists select_object_type_param_list { - select cols.table_name, cols.column_name - from user_tab_columns cols, - (select upper(t.table_name) as table_name - from acs_object_types t - start with t.object_type = :object_type - connect by prior t.supertype = t.object_type) t - where cols.column_name in - (select args.argument_name - from user_arguments args - where args.position > 0 - and args.object_name = upper(:object_name) - and args.package_name = upper(:package_name)) - and cols.table_name = t.table_name - }] + return [db_list_of_lists select_object_type_param_list {}] } Index: openacs-4/packages/acs-subsite/tcl/package-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/package-procs.xql,v diff -u -r1.6 -r1.6.22.1 --- openacs-4/packages/acs-subsite/tcl/package-procs.xql 11 Feb 2004 18:29:07 -0000 1.6 +++ openacs-4/packages/acs-subsite/tcl/package-procs.xql 28 Oct 2015 09:38:34 -0000 1.6.22.1 @@ -1,17 +1,6 @@ - - - - select t.table_name as table, t.id_column as column - from acs_object_types t - where t.object_type = :object_type - - - - - @@ -23,61 +12,6 @@ - - - - select t.table_name, t.id_column, lower(t.package_name) as package_name, t.supertype - from acs_object_types t - where t.object_type = :object_type - - - - - - - - - select t.table_name, t.id_column, lower(t.package_name) as package_name, t.supertype - from acs_object_types t - where t.object_type = :object_type - - - - - - - - - select t.table_name, t.id_column, lower(t.package_name) as package_name, t.supertype - from acs_object_types t - where t.object_type = :object_type - - - - - - - - - select t.table_name, t.id_column, lower(t.package_name) as package_name, t.supertype - from acs_object_types t - where t.object_type = :object_type - - - - - - - - - select t.table_name, t.id_column, lower(t.package_name) as package_name, t.supertype - from acs_object_types t - where t.object_type = :object_type - - - - - Index: openacs-4/packages/acs-subsite/tcl/rel-segments-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/rel-segments-procs.tcl,v diff -u -r1.5.2.1 -r1.5.2.2 --- openacs-4/packages/acs-subsite/tcl/rel-segments-procs.tcl 10 Sep 2015 08:21:36 -0000 1.5.2.1 +++ openacs-4/packages/acs-subsite/tcl/rel-segments-procs.tcl 28 Oct 2015 09:38:34 -0000 1.5.2.2 @@ -34,18 +34,7 @@ set creation_ip [ad_conn peeraddr] } } - return [db_exec_plsql create_rel_segment { - declare - begin - :1 := rel_segment.new(segment_name => :segment_name, - group_id => :group_id, - context_id => :context_id, - rel_type => :rel_type, - creation_user => :creation_user, - creation_ip => :creation_ip - ); - end; - }] + return [db_exec_plsql create_rel_segment {}] } @@ -65,14 +54,10 @@ from rel_constraints c where c.required_rel_segment = :segment_id } { - db_exec_plsql constraint_delete { - begin rel_constraint.del(:constraint_id); end; - } + db_exec_plsql constraint_delete {} } - db_exec_plsql rel_segment_delete { - begin rel_segment.del(:segment_id); end; - } + db_exec_plsql rel_segment_delete {} } Index: openacs-4/packages/acs-subsite/tcl/rel-types-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/rel-types-procs.tcl,v diff -u -r1.11.2.2 -r1.11.2.3 --- openacs-4/packages/acs-subsite/tcl/rel-types-procs.tcl 27 Oct 2015 22:56:31 -0000 1.11.2.2 +++ openacs-4/packages/acs-subsite/tcl/rel-types-procs.tcl 28 Oct 2015 09:38:34 -0000 1.11.2.3 @@ -152,12 +152,12 @@ # Create the actual acs object type - lappend plsql_drop [list db_exec_plsql drop_type {FOO}] - lappend plsql [list db_exec_plsql create_type {FOO}] + lappend plsql_drop [list db_exec_plsql drop_type {}] + lappend plsql [list db_exec_plsql create_type {}] # Mark the type as dynamic - lappend plsql [list db_dml update_type {FOO}] + lappend plsql [list db_dml update_type FOO] # Force internationalisation of Roles Index: openacs-4/packages/acs-subsite/tcl/relation-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/relation-procs-oracle.xql,v diff -u -r1.4 -r1.4.12.1 --- openacs-4/packages/acs-subsite/tcl/relation-procs-oracle.xql 10 Nov 2006 21:40:34 -0000 1.4 +++ openacs-4/packages/acs-subsite/tcl/relation-procs-oracle.xql 28 Oct 2015 09:38:34 -0000 1.4.12.1 @@ -33,20 +33,6 @@ - - - - select s.segment_id, r.object_id_two as party_id, t.package_name - from rel_segments s, acs_rels r, acs_object_types t - where r.object_id_one = s.group_id(+) - and r.rel_type = s.rel_type(+) - and r.rel_type = t.object_type - and r.rel_id = :rel_id - - - - - Index: openacs-4/packages/acs-subsite/tcl/relation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/relation-procs.tcl,v diff -u -r1.16.2.2 -r1.16.2.3 --- openacs-4/packages/acs-subsite/tcl/relation-procs.tcl 27 Oct 2015 22:56:31 -0000 1.16.2.2 +++ openacs-4/packages/acs-subsite/tcl/relation-procs.tcl 28 Oct 2015 09:38:34 -0000 1.16.2.3 @@ -141,7 +141,7 @@ } { # Pull out the segment_id and the party_id (object_id_two) from # acs_rels. Note the outer joins since the segment may not exist. - if { ![db_0or1row select_rel_info {}] } { + if { ![db_0or1row select_rel_info_rm {}] } { # Relation doesn't exist return 0 } Index: openacs-4/packages/acs-subsite/tcl/relation-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/relation-procs.xql,v diff -u -r1.5 -r1.5.18.1 --- openacs-4/packages/acs-subsite/tcl/relation-procs.xql 4 Mar 2005 21:22:05 -0000 1.5 +++ openacs-4/packages/acs-subsite/tcl/relation-procs.xql 28 Oct 2015 09:38:35 -0000 1.5.18.1 @@ -1,7 +1,7 @@ - + select s.segment_id, r.object_id_two as party_id, t.package_name Index: openacs-4/packages/acs-subsite/tcl/subsite-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/subsite-callback-procs.tcl,v diff -u -r1.7.2.1 -r1.7.2.2 --- openacs-4/packages/acs-subsite/tcl/subsite-callback-procs.tcl 10 Sep 2015 08:21:37 -0000 1.7.2.1 +++ openacs-4/packages/acs-subsite/tcl/subsite-callback-procs.tcl 28 Oct 2015 09:38:35 -0000 1.7.2.2 @@ -48,15 +48,7 @@ # handle. Note that we need the distinct in case two callbacks are # registered for an object and it's parent object type. - set callback_list [db_list_of_lists select_callbacks { - select distinct callback, callback_type - from subsite_callbacks - where object_type in (select t.object_type - from acs_object_types t - connect by prior t.supertype = t.object_type - start with t.object_type = :object_type) - and event_type = :event_type - }] + set callback_list [db_list_of_lists select_callbacks {}] set node_id [ad_conn node_id] set package_id [ad_conn package_id] Index: openacs-4/packages/acs-subsite/tcl/subsite-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/subsite-procs.tcl,v diff -u -r1.44.2.9 -r1.44.2.10 --- openacs-4/packages/acs-subsite/tcl/subsite-procs.tcl 20 Oct 2015 08:01:05 -0000 1.44.2.9 +++ openacs-4/packages/acs-subsite/tcl/subsite-procs.tcl 28 Oct 2015 09:38:35 -0000 1.44.2.10 @@ -258,12 +258,7 @@ if { $pretty_name eq "" } { # Get the name of the object mounted at this node - db_1row select_package_object_names { - select t.pretty_name as package_name, acs_object.name(s.object_id) as object_name - from site_nodes s, apm_package_types t - where s.node_id = :node_id - and t.package_key = :package_key - } + db_1row select_package_object_names {} set pretty_name "$object_name $package_name" if { $ctr > 2 } { # This was a duplicate pkg name... append the ctr used in the instance name @@ -390,15 +385,7 @@ @creation-date 2000-02-07 } { - return [db_string sub_type_exists_p { - select case - when exists (select 1 from acs_object_types - where supertype = :object_type) - then 1 - else 0 - end - from dual - }] + return [db_string sub_type_exists_p {}] } @@ -411,11 +398,7 @@ } { set path_list [list] - set type_list [db_list select_object_type_path { - select object_type from acs_object_types - start with object_type = :object_type - connect by object_type = prior supertype - }] + set type_list [db_list select_object_type_path {}] foreach type $type_list { lappend path_list $type Index: openacs-4/packages/acs-subsite/www/admin/attributes/enum-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/attributes/enum-add-2.tcl,v diff -u -r1.4.2.1 -r1.4.2.2 --- openacs-4/packages/acs-subsite/www/admin/attributes/enum-add-2.tcl 10 Sep 2015 08:21:39 -0000 1.4.2.1 +++ openacs-4/packages/acs-subsite/www/admin/attributes/enum-add-2.tcl 28 Oct 2015 09:38:35 -0000 1.4.2.2 @@ -42,16 +42,7 @@ if { [db_resultrows] == 0 } { # No update - insert the row. Set the enum_value to # the pretty_name - db_dml insert_enum_value { - insert into acs_enum_values v - (attribute_id, sort_order, enum_value, pretty_name) - select :attribute_id, :sort_order, :pretty_name, :pretty_name - from dual - where not exists (select 1 - from acs_enum_values v2 - where v2.pretty_name = :pretty_name - and v2.attribute_id = :attribute_id) - } + db_dml insert_enum_value {} } } } Index: openacs-4/packages/acs-subsite/www/admin/group-types/new-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/group-types/new-oracle.xql,v diff -u -r1.1 -r1.1.30.1 --- openacs-4/packages/acs-subsite/www/admin/group-types/new-oracle.xql 15 May 2001 16:59:00 -0000 1.1 +++ openacs-4/packages/acs-subsite/www/admin/group-types/new-oracle.xql 28 Oct 2015 09:38:35 -0000 1.1.30.1 @@ -5,24 +5,11 @@ - - select case when exists (select 1 from acs_object_types t where t.pretty_name = :pretty_name) - then 1 else 0 end + select case when exists (select 1 from acs_object_types t where t.pretty_name = :pretty_name) + then 1 else 0 end from dual - - - - - select case when exists (select 1 from acs_object_types t where t.pretty_name = :pretty_name) - then 1 else 0 end - from dual - - - - - Index: openacs-4/packages/acs-subsite/www/admin/groups/constraints-create.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/groups/constraints-create.tcl,v diff -u -r1.5.2.1 -r1.5.2.2 --- openacs-4/packages/acs-subsite/www/admin/groups/constraints-create.tcl 10 Sep 2015 08:21:41 -0000 1.5.2.1 +++ openacs-4/packages/acs-subsite/www/admin/groups/constraints-create.tcl 28 Oct 2015 09:38:35 -0000 1.5.2.2 @@ -23,12 +23,7 @@ set context [list [list "[ad_conn package_url]admin/groups/" "Groups"] [list [export_vars -base one group_id] "One Group"] "Add constraint"] set export_vars [export_vars -form {group_id rel_type return_url}] -db_1row select_props { - select acs_group.name(:group_id) as group_name, - t.pretty_name as rel_type_pretty_name - from acs_object_types t - where t.object_type = :rel_type -} +db_1row select_props {} ad_return_template Index: openacs-4/packages/acs-subsite/www/admin/groups/delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/groups/delete.tcl,v diff -u -r1.5.2.1 -r1.5.2.2 --- openacs-4/packages/acs-subsite/www/admin/groups/delete.tcl 10 Sep 2015 08:21:42 -0000 1.5.2.1 +++ openacs-4/packages/acs-subsite/www/admin/groups/delete.tcl 28 Oct 2015 09:38:35 -0000 1.5.2.2 @@ -24,18 +24,10 @@ } set context [list [list "" "Groups"] [list [export_vars -base one {group_id}] "One Group"] "Nuke group"] -set group_name [db_string object_name {select acs_object.name(:group_id) from dual}] +set group_name [db_string object_name {}] set export_form_vars [export_vars -form {group_id}] -db_1row select_counts { - select (select count(*) from group_element_map where group_id = :group_id) as elements, - (select count(*) from rel_segments where group_id = :group_id) as segments, - (select count(*) - from rel_constraints cons, rel_segments segs - where segs.segment_id in (cons.rel_segment,cons.required_rel_segment) - and segs.group_id = :group_id) as constraints - from dual -} -column_array number +db_1row select_counts {} -column_array number ad_return_template Fisheye: Tag 1.1.30.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/admin/groups/elements-by-group-type-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.30.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/admin/groups/elements-by-group-type-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-subsite/www/admin/groups/elements-by-group-type.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/groups/elements-by-group-type.tcl,v diff -u -r1.1.1.1.30.1 -r1.1.1.1.30.2 --- openacs-4/packages/acs-subsite/www/admin/groups/elements-by-group-type.tcl 10 Sep 2015 08:21:42 -0000 1.1.1.1.30.1 +++ openacs-4/packages/acs-subsite/www/admin/groups/elements-by-group-type.tcl 28 Oct 2015 09:38:35 -0000 1.1.1.1.30.2 @@ -38,7 +38,7 @@ # should tell you total number of groups, and tell you "these are the ones # you have read privilege on", so you don't get confused. db_foreach select_group_types { - select /*+ ORDERED */ + select t.object_type, t.pretty_name, count(g.group_id) as number_groups from groups g, acs_objects o, acs_object_types t, application_group_element_map app_group Fisheye: Tag 1.1.30.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/admin/groups/elements-by-group-type.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-subsite/www/admin/groups/elements-display-list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/groups/elements-display-list.tcl,v diff -u -r1.5.2.1 -r1.5.2.2 --- openacs-4/packages/acs-subsite/www/admin/groups/elements-display-list.tcl 10 Sep 2015 08:21:42 -0000 1.5.2.1 +++ openacs-4/packages/acs-subsite/www/admin/groups/elements-display-list.tcl 28 Oct 2015 09:38:35 -0000 1.5.2.2 @@ -33,16 +33,7 @@ # Pull out all the relations of the specified type -db_1row rel_type_info { - select object_type as ancestor_rel_type - from acs_object_types - where supertype = 'relationship' - and object_type in ( - select object_type from acs_object_types - start with object_type = :rel_type - connect by object_type = prior supertype - ) -} +db_1row rel_type_info {} set extra_tables "" set extra_where_clauses "" Index: openacs-4/packages/acs-subsite/www/admin/groups/elements-display.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/groups/elements-display.tcl,v diff -u -r1.6.2.1 -r1.6.2.2 --- openacs-4/packages/acs-subsite/www/admin/groups/elements-display.tcl 10 Sep 2015 08:21:42 -0000 1.6.2.1 +++ openacs-4/packages/acs-subsite/www/admin/groups/elements-display.tcl 28 Oct 2015 09:38:35 -0000 1.6.2.2 @@ -40,14 +40,7 @@ # Select out the group name and the group's object type. Note we can # use 1row because the validate filter above will catch missing groups -db_1row group_and_rel_info { - select acs_group.name(:group_id) as group_name, - acs_object_type.pretty_name(:rel_type) as rel_type_pretty_name, - acs_rel_type.role_pretty_plural(rel_types.role_two) as role_pretty_plural, - acs_rel_type.role_pretty_name(rel_types.role_two) as role_pretty_name - from acs_rel_types rel_types - where rel_types.rel_type = :rel_type -} +db_1row group_and_rel_info {} # The role pretty names can be message catalog keys that need # to be localized before they are displayed Index: openacs-4/packages/acs-subsite/www/admin/groups/new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/groups/new.tcl,v diff -u -r1.10.2.1 -r1.10.2.2 --- openacs-4/packages/acs-subsite/www/admin/groups/new.tcl 10 Sep 2015 08:21:42 -0000 1.10.2.1 +++ openacs-4/packages/acs-subsite/www/admin/groups/new.tcl 28 Oct 2015 09:38:35 -0000 1.10.2.2 @@ -45,16 +45,7 @@ } # We assume the group is on side 1... -db_1row rel_type_info { - select object_type as ancestor_rel_type - from acs_object_types - where supertype = 'relationship' - and object_type in ( - select object_type from acs_object_types - start with object_type = :add_with_rel_type - connect by object_type = prior supertype - ) -} +db_1row rel_type_info {} set create_p [group::permission_p -privilege create $add_to_group_id] Index: openacs-4/packages/acs-subsite/www/admin/groups/rel-type-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/groups/rel-type-add-2.tcl,v diff -u -r1.6.2.1 -r1.6.2.2 --- openacs-4/packages/acs-subsite/www/admin/groups/rel-type-add-2.tcl 10 Sep 2015 08:21:42 -0000 1.6.2.1 +++ openacs-4/packages/acs-subsite/www/admin/groups/rel-type-add-2.tcl 28 Oct 2015 09:38:35 -0000 1.6.2.2 @@ -23,13 +23,7 @@ from acs_objects o where o.object_id = :group_id } - 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.\"" } } @@ -44,28 +38,14 @@ (:group_rel_id, :group_id, :rel_type) } } err_msg] } { # Does this pair already exists? - if { ![db_string exists_p { - select case when exists (select 1 - from group_rels - where group_id = :group_id - and rel_type = :rel_type) - then 1 else 0 end - from dual - }] } { + if { ![db_string exists_p {}] } { ad_return_error "Error inserting to database" $err_msg return } } # Now let's see if there is no relational segment. If not, offer to create one -if { [db_string segment_exists_p { - select case when exists (select 1 - from rel_segments s - where s.group_id = :group_id - and s.rel_type = :rel_type) - then 1 else 0 end - from dual -}] } { +if { [db_string segment_exists_p {}] } { if { $return_url eq "" } { set return_url [export_vars -base one group_id] } Index: openacs-4/packages/acs-subsite/www/admin/groups/rel-type-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/groups/rel-type-add.tcl,v diff -u -r1.5.2.1 -r1.5.2.2 --- openacs-4/packages/acs-subsite/www/admin/groups/rel-type-add.tcl 10 Sep 2015 08:21:43 -0000 1.5.2.1 +++ openacs-4/packages/acs-subsite/www/admin/groups/rel-type-add.tcl 28 Oct 2015 09:38:36 -0000 1.5.2.2 @@ -33,21 +33,7 @@ where o.object_id = :group_id } -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_rels g - where g.group_id = :group_id) - 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_id return_url}] Index: openacs-4/packages/acs-subsite/www/admin/groups/rel-type-remove.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/groups/rel-type-remove.tcl,v diff -u -r1.5.2.1 -r1.5.2.2 --- openacs-4/packages/acs-subsite/www/admin/groups/rel-type-remove.tcl 10 Sep 2015 08:21:43 -0000 1.5.2.1 +++ openacs-4/packages/acs-subsite/www/admin/groups/rel-type-remove.tcl 28 Oct 2015 09:38:36 -0000 1.5.2.2 @@ -19,13 +19,7 @@ export_vars:onevalue } -if { ![db_0or1row select_info { - select g.rel_type, g.group_id, acs_object.name(g.group_id) as group_name, - t.pretty_name as rel_pretty_name - from acs_object_types t, group_rels g - where g.group_rel_id = :group_rel_id - and t.object_type = g.rel_type -}] } { +if { ![db_0or1row select_info {}] } { ad_return_error "Relation already removed." "Please back up and reload" return } Index: openacs-4/packages/acs-subsite/www/admin/parties/new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/parties/new.tcl,v diff -u -r1.9.2.1 -r1.9.2.2 --- openacs-4/packages/acs-subsite/www/admin/parties/new.tcl 10 Sep 2015 08:21:43 -0000 1.9.2.1 +++ openacs-4/packages/acs-subsite/www/admin/parties/new.tcl 28 Oct 2015 09:38:36 -0000 1.9.2.2 @@ -41,16 +41,7 @@ } # We assume the group is on side 1... -db_1row rel_type_info { - select object_type as ancestor_rel_type - from acs_object_types - where supertype = 'relationship' - and object_type in ( - select object_type from acs_object_types - start with object_type = :add_with_rel_type - connect by object_type = prior supertype - ) -} +db_1row rel_type_info {} set create_p [group::permission_p -privilege create $add_to_group_id] Index: openacs-4/packages/acs-subsite/www/admin/parties/one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/parties/one.tcl,v diff -u -r1.5.2.1 -r1.5.2.2 --- openacs-4/packages/acs-subsite/www/admin/parties/one.tcl 10 Sep 2015 08:21:44 -0000 1.5.2.1 +++ openacs-4/packages/acs-subsite/www/admin/parties/one.tcl 28 Oct 2015 09:38:36 -0000 1.5.2.2 @@ -34,12 +34,7 @@ # Select out the party name and the party's object type. Note we can # use 1row because the validate filter above will catch missing parties -db_1row party_info { - select acs_object.name(:party_id) as party_name, - object_type as party_type - from acs_objects - where object_id = :party_id -} +db_1row party_info {} ### This page redirects to different pages for groups or rel_segments. ### We have to check whether the party_type is a type of group or rel_segment. Index: openacs-4/packages/acs-subsite/www/admin/rel-segments/elements-display.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-segments/elements-display.tcl,v diff -u -r1.2.2.1 -r1.2.2.2 --- openacs-4/packages/acs-subsite/www/admin/rel-segments/elements-display.tcl 10 Sep 2015 08:21:44 -0000 1.2.2.1 +++ openacs-4/packages/acs-subsite/www/admin/rel-segments/elements-display.tcl 28 Oct 2015 09:38:36 -0000 1.2.2.2 @@ -6,15 +6,7 @@ set package_url [ad_conn package_url] set user_id [ad_conn user_id] -db_multirow elements elements_select { - select acs_object.name(map.party_id) as name, map.rel_id, - decode(map.container_id, :group_id, 1, 0) as direct_p, - acs_object.name(map.container_id) as container_name - from rel_segment_party_map map - where acs_permission.permission_p(map.party_id, :user_id, 'read') = 't' - and map.segment_id = :segment_id - order by lower(name) -} +db_multirow elements elements_select {} Index: openacs-4/packages/acs-subsite/www/admin/rel-segments/elements.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-segments/elements.tcl,v diff -u -r1.7.2.1 -r1.7.2.2 --- openacs-4/packages/acs-subsite/www/admin/rel-segments/elements.tcl 10 Sep 2015 08:21:44 -0000 1.7.2.1 +++ openacs-4/packages/acs-subsite/www/admin/rel-segments/elements.tcl 28 Oct 2015 09:38:36 -0000 1.7.2.2 @@ -24,13 +24,7 @@ } } -db_1row select_segment_info { - select s.segment_name, s.group_id, - acs_rel_type.role_pretty_plural(r.role_two) as role_pretty_plural - from rel_segments s, acs_rel_types r - where s.segment_id = :segment_id - and s.rel_type = r.rel_type -} +db_1row select_segment_info {} # The role pretty names can be message catalog keys that need # to be localized before they are displayed Index: openacs-4/packages/acs-subsite/www/admin/rel-segments/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-segments/index.tcl,v diff -u -r1.3.6.1 -r1.3.6.2 --- openacs-4/packages/acs-subsite/www/admin/rel-segments/index.tcl 10 Sep 2015 08:21:44 -0000 1.3.6.1 +++ openacs-4/packages/acs-subsite/www/admin/rel-segments/index.tcl 28 Oct 2015 09:38:36 -0000 1.3.6.2 @@ -24,21 +24,7 @@ # Select out basic information about all the segments on which the # user has read permission -db_multirow seg select_rel_segments { - select s.segment_id, s.segment_name, s.group_id, acs_object.name(s.group_id) as group_name, - s.rel_type, t.pretty_name as rel_type_pretty_name - from acs_object_types t, - rel_segments s, - acs_object_party_privilege_map perm, - application_group_segments ags - where perm.object_id = s.segment_id - and perm.party_id = :user_id - and perm.privilege = 'read' - and t.object_type = s.rel_type - and s.segment_id = ags.segment_id - and ags.package_id = :package_id - order by lower(s.segment_name) -} +db_multirow seg select_rel_segments {} ad_return_template Index: openacs-4/packages/acs-subsite/www/admin/rel-segments/new-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-segments/new-2.tcl,v diff -u -r1.6.2.1 -r1.6.2.2 --- openacs-4/packages/acs-subsite/www/admin/rel-segments/new-2.tcl 10 Sep 2015 08:21:44 -0000 1.6.2.1 +++ openacs-4/packages/acs-subsite/www/admin/rel-segments/new-2.tcl 28 Oct 2015 09:38:36 -0000 1.6.2.2 @@ -41,12 +41,7 @@ set export_vars [export_vars -form {group_id rel_type return_url}] -db_1row select_basic_info { - select acs_group.name(:group_id) as group_name, - nvl(acs_rel_type.role_pretty_plural(t.role_two),'Elements') as role_pretty_plural - from acs_rel_types t - where t.rel_type = :rel_type -} +db_1row select_basic_info {} # The role pretty names can be message catalog keys that need # to be localized before they are displayed Index: openacs-4/packages/acs-subsite/www/admin/rel-segments/new-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-segments/new-3.tcl,v diff -u -r1.7.2.1 -r1.7.2.2 --- openacs-4/packages/acs-subsite/www/admin/rel-segments/new-3.tcl 10 Sep 2015 08:21:44 -0000 1.7.2.1 +++ openacs-4/packages/acs-subsite/www/admin/rel-segments/new-3.tcl 28 Oct 2015 09:38:36 -0000 1.7.2.2 @@ -54,12 +54,7 @@ # Now let's offer to walk the user through the process of creating # constraints it there are any other segments -if { ![db_string segments_exists_p { - select case when exists - (select 1 from rel_segments s where s.segment_id <> :segment_id) - then 1 else 0 end - from dual -}] } { +if { ![db_string segments_exists_p {}] } { # No more segments... can't create constraints ad_returnredirect $return_url return Index: openacs-4/packages/acs-subsite/www/admin/rel-segments/new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-segments/new.tcl,v diff -u -r1.6.2.1 -r1.6.2.2 --- openacs-4/packages/acs-subsite/www/admin/rel-segments/new.tcl 10 Sep 2015 08:21:44 -0000 1.6.2.1 +++ openacs-4/packages/acs-subsite/www/admin/rel-segments/new.tcl 28 Oct 2015 09:38:36 -0000 1.6.2.2 @@ -41,20 +41,9 @@ set export_vars [export_vars -form {group_id return_url}] # Select out all relationship types -db_multirow rel_types select_relation_types { - select t.pretty_name, t.object_type as rel_type, - replace(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) - connect by prior t.object_type = t.supertype - start with t.object_type in ('membership_rel', 'composition_rel') - order by lower(t.pretty_name) desc -} +db_multirow rel_types select_relation_types {} -db_1row select_basic_info { - select acs_group.name(:group_id) as group_name - from dual -} +db_1row select_basic_info {} ad_return_template Index: openacs-4/packages/acs-subsite/www/admin/rel-segments/constraints/delete-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-segments/constraints/delete-2.tcl,v diff -u -r1.6.2.1 -r1.6.2.2 --- openacs-4/packages/acs-subsite/www/admin/rel-segments/constraints/delete-2.tcl 10 Sep 2015 08:21:45 -0000 1.6.2.1 +++ openacs-4/packages/acs-subsite/www/admin/rel-segments/constraints/delete-2.tcl 28 Oct 2015 09:38:36 -0000 1.6.2.2 @@ -44,9 +44,7 @@ ad_script_abort } - db_exec_plsql delete_constraint { - begin rel_constraint.del(constraint_id => :constraint_id); end; - } + db_exec_plsql delete_constraint {} db_release_unused_handles } elseif { $return_url eq "" } { Index: openacs-4/packages/acs-subsite/www/admin/rel-segments/constraints/new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-segments/constraints/new.tcl,v diff -u -r1.6.2.1 -r1.6.2.2 --- openacs-4/packages/acs-subsite/www/admin/rel-segments/constraints/new.tcl 10 Sep 2015 08:21:45 -0000 1.6.2.1 +++ openacs-4/packages/acs-subsite/www/admin/rel-segments/constraints/new.tcl 28 Oct 2015 09:38:36 -0000 1.6.2.2 @@ -39,14 +39,7 @@ set package_id [ad_conn package_id] -db_1row select_rel_properties { - select s.segment_name, - acs_rel_type.role_pretty_name(t.role_one) as role_one_name, - acs_rel_type.role_pretty_name(t.role_two) as role_two_name - from rel_segments s, acs_rel_types t - where s.rel_type = t.rel_type - and s.segment_id = :rel_segment -} +db_1row select_rel_properties {} template::form create constraint_new @@ -104,29 +97,11 @@ set creation_ip [ad_conn peeraddr] set ctr 0 db_transaction { - set constraint_id [db_exec_plsql add_constraint { - BEGIN - :1 := rel_constraint.new(constraint_name => :constraint_name, - rel_segment => :rel_segment, - rel_side => :rel_side, - required_rel_segment => :required_rel_segment, - creation_user => :creation_user, - creation_ip => :creation_ip - ); - END; - }] + set constraint_id [db_exec_plsql add_constraint {}] # check for violations template::multirow create violations rel_id name - db_foreach select_violated_rels { - select viol.rel_id, acs_object.name(viol.party_id) as name - from rel_constraints_violated_one viol - where viol.constraint_id = :constraint_id - UNION ALL - select viol.rel_id, acs_object.name(viol.party_id) as name - from rel_constraints_violated_two viol - where viol.constraint_id = :constraint_id - } { + db_foreach select_violated_rels {} { template::multirow append violations $rel_id $name incr ctr } Index: openacs-4/packages/acs-subsite/www/admin/rel-segments/constraints/one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-segments/constraints/one.tcl,v diff -u -r1.4.2.1 -r1.4.2.2 --- openacs-4/packages/acs-subsite/www/admin/rel-segments/constraints/one.tcl 10 Sep 2015 08:21:45 -0000 1.4.2.1 +++ openacs-4/packages/acs-subsite/www/admin/rel-segments/constraints/one.tcl 28 Oct 2015 09:38:36 -0000 1.4.2.2 @@ -54,34 +54,10 @@ # because they would be too hard to read in one query. set rel_type $props(rel_type) -db_1row select_rel_type_info { - select role1.role as role_one, - nvl(role1.pretty_name,'Object on side one') as role_one_pretty_name, - nvl(role1.pretty_plural,'Objects on side one') as role_one_pretty_plural, - role2.role as role_two, - nvl(role2.pretty_name,'Object on side two') as role_two_pretty_name, - nvl(role2.pretty_plural,'Objects on side two') as role_two_pretty_plural, - acs_object_type.pretty_name(rel.rel_type) as rel_type_pretty_name - from acs_rel_types rel, acs_rel_roles role1, acs_rel_roles role2 - where rel.rel_type = :rel_type - and rel.role_one = role1.role(+) - and rel.role_two = role2.role(+) -} -column_array rel +db_1row select_rel_type_info {} -column_array rel set rel_type $props(req_rel_type) -db_1row select_rel_type_info { - select role1.role as role_one, - nvl(role1.pretty_name,'Object on side one') as role_one_pretty_name, - nvl(role1.pretty_plural,'Objects on side one') as role_one_pretty_plural, - role2.role as role_two, - nvl(role2.pretty_name,'Object on side two') as role_two_pretty_name, - nvl(role2.pretty_plural,'Objects on side two') as role_two_pretty_plural, - acs_object_type.pretty_name(rel.rel_type) as rel_type_pretty_name - from acs_rel_types rel, acs_rel_roles role1, acs_rel_roles role2 - where rel.rel_type = :rel_type - and rel.role_one = role1.role(+) - and rel.role_two = role2.role(+) -} -column_array req_rel +db_1row select_rel_type_info {} -column_array req_rel # Choose the appropriate role based on the side of the relation used Index: openacs-4/packages/acs-subsite/www/admin/rel-types/delete-2-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-types/delete-2-oracle.xql,v diff -u -r1.1 -r1.1.30.1 --- openacs-4/packages/acs-subsite/www/admin/rel-types/delete-2-oracle.xql 15 May 2001 16:59:01 -0000 1.1 +++ openacs-4/packages/acs-subsite/www/admin/rel-types/delete-2-oracle.xql 28 Oct 2015 09:38:37 -0000 1.1.30.1 @@ -14,6 +14,29 @@ + + + select r.rel_id + from acs_rels r, acs_object_party_privilege_map perm + where perm.object_id = r.rel_id + and perm.party_id = :user_id + and perm.privilege = 'delete' + and r.rel_type = :rel_type + + + + + + + select s.segment_id + from rel_segments s, acs_object_party_privilege_map perm + where perm.object_id = s.segment_id + and perm.party_id = :user_id + and perm.privilege = 'delete' + and s.rel_type = :rel_type + + + Index: openacs-4/packages/acs-subsite/www/admin/rel-types/delete-2-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-types/delete-2-postgresql.xql,v diff -u -r1.4 -r1.4.30.1 --- openacs-4/packages/acs-subsite/www/admin/rel-types/delete-2-postgresql.xql 28 Nov 2001 18:39:39 -0000 1.4 +++ openacs-4/packages/acs-subsite/www/admin/rel-types/delete-2-postgresql.xql 28 Oct 2015 09:38:37 -0000 1.4.30.1 @@ -5,38 +5,34 @@ - select acs_rel_type__drop_type(:rel_type,'t') + select acs_rel_type__drop_type(:rel_type,'t') -drop table $table_name + drop table $table_name - - select r.rel_id - from acs_rels r - where acs_permission__permission_p(r.rel_id, :user_id, 'delete') - and r.rel_type = :rel_type - + select r.rel_id + from acs_rels r + where acs_permission__permission_p(r.rel_id, :user_id, 'delete') + and r.rel_type = :rel_type - - select s.segment_id - from rel_segments s - where acs_permission__permission_p(s.segment_id, :user_id, 'delete') - and s.rel_type = :rel_type - + select s.segment_id + from rel_segments s + where acs_permission__permission_p(s.segment_id, :user_id, 'delete') + and s.rel_type = :rel_type Index: openacs-4/packages/acs-subsite/www/admin/rel-types/delete-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-types/delete-2.tcl,v diff -u -r1.5.2.1 -r1.5.2.2 --- openacs-4/packages/acs-subsite/www/admin/rel-types/delete-2.tcl 10 Sep 2015 08:21:45 -0000 1.5.2.1 +++ openacs-4/packages/acs-subsite/www/admin/rel-types/delete-2.tcl 28 Oct 2015 09:38:37 -0000 1.5.2.2 @@ -28,23 +28,9 @@ set user_id [ad_conn user_id] - set rel_id_list [db_list select_rel_ids { - select r.rel_id - from acs_rels r, acs_object_party_privilege_map perm - where perm.object_id = r.rel_id - and perm.party_id = :user_id - and perm.privilege = 'delete' - and r.rel_type = :rel_type - }] + set rel_id_list [db_list select_rel_ids {}] - set segment_id [db_string select_segment_id { - select s.segment_id - from rel_segments s, acs_object_party_privilege_map perm - where perm.object_id = s.segment_id - and perm.party_id = :user_id - and perm.privilege = 'delete' - and s.rel_type = :rel_type - } -default ""] + set segment_id [db_string select_segment_id {} -default ""] # delete all relations, all segments, and drop the relationship # type. This will fail if a relation / segment for this type is created @@ -60,12 +46,7 @@ rel_segments_delete $segment_id } - db_exec_plsql drop_relationship_type { - BEGIN - acs_rel_type.drop_type( rel_type => :rel_type, - cascade_p => 't' ); - END; - } + db_exec_plsql drop_relationship_type {} } on_error { ad_return_error "Error deleting relationship type" "We got the following error trying to delete this relationship type:
$errmsg
" ad_script_abort Index: openacs-4/packages/acs-subsite/www/admin/rel-types/delete-2.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-types/delete-2.xql,v diff -u -r1.1 -r1.1.30.1 --- openacs-4/packages/acs-subsite/www/admin/rel-types/delete-2.xql 15 May 2001 16:59:01 -0000 1.1 +++ openacs-4/packages/acs-subsite/www/admin/rel-types/delete-2.xql 28 Oct 2015 09:38:37 -0000 1.1.30.1 @@ -10,34 +10,5 @@
- - - - - select r.rel_id - from acs_rels r, acs_object_party_privilege_map perm - where perm.object_id = r.rel_id - and perm.party_id = :user_id - and perm.privilege = 'delete' - and r.rel_type = :rel_type - - - - - - - - - select s.segment_id - from rel_segments s, acs_object_party_privilege_map perm - where perm.object_id = s.segment_id - and perm.party_id = :user_id - and perm.privilege = 'delete' - and s.rel_type = :rel_type - - - - -
Index: openacs-4/packages/acs-subsite/www/admin/rel-types/delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-types/delete.tcl,v diff -u -r1.4.2.1 -r1.4.2.2 --- openacs-4/packages/acs-subsite/www/admin/rel-types/delete.tcl 10 Sep 2015 08:21:45 -0000 1.4.2.1 +++ openacs-4/packages/acs-subsite/www/admin/rel-types/delete.tcl 28 Oct 2015 09:38:37 -0000 1.4.2.2 @@ -27,13 +27,7 @@ }] -set subtypes_exist_p [db_string number_subtypes { - select case when exists (select 1 - from acs_object_types t - where t.supertype = :rel_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]" @@ -53,11 +47,7 @@ } # Now let's count up the number of things we're going to delete -db_1row select_counts { - select (select count(*) from rel_segments where rel_type = :rel_type) as segments, - (select count(*) from acs_rels where rel_type = :rel_type) as rels - from dual -} -column_array counts +db_1row select_counts {} -column_array counts set export_vars [export_vars -form {rel_type return_url}] Index: openacs-4/packages/acs-subsite/www/admin/rel-types/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-types/index.tcl,v diff -u -r1.3.6.1 -r1.3.6.2 --- openacs-4/packages/acs-subsite/www/admin/rel-types/index.tcl 10 Sep 2015 08:21:45 -0000 1.3.6.1 +++ openacs-4/packages/acs-subsite/www/admin/rel-types/index.tcl 28 Oct 2015 09:38:37 -0000 1.3.6.2 @@ -21,25 +21,7 @@ # Select out all relationship types, excluding the parent type names 'relationship' # Count up the number of relations that exists for each type. -db_multirow rel_types select_relation_types { - select t.object_type as rel_type, t.pretty_name, t.indent, - nvl(num.number_relationships,0) as number_relationships - from (select t.pretty_name, t.object_type, 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 in ('membership_rel','composition_rel') - order by lower(t.pretty_name)) t, - (select r.rel_type, count(*) as number_relationships - from acs_objects o, acs_rel_types r, - app_group_distinct_rel_map m - where r.rel_type = o.object_type - and o.object_id = m.rel_id - and m.package_id = :package_id - group by r.rel_type) num - where t.object_type = num.rel_type(+) - order by t.inner_rownum -} +db_multirow rel_types select_relation_types {} ad_return_template Index: openacs-4/packages/acs-subsite/www/admin/rel-types/new-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-types/new-2.tcl,v diff -u -r1.8.2.1 -r1.8.2.2 --- openacs-4/packages/acs-subsite/www/admin/rel-types/new-2.tcl 10 Sep 2015 08:21:46 -0000 1.8.2.1 +++ openacs-4/packages/acs-subsite/www/admin/rel-types/new-2.tcl 28 Oct 2015 09:38:37 -0000 1.8.2.2 @@ -74,24 +74,12 @@ and r.rel_type = t.object_type } -set object_types_one_list [db_list_of_lists select_object_types_one { - select replace(lpad(' ', (level - 1) * 4), ' ', ' ') || t.pretty_name, - t.object_type as rel_type - from acs_object_types t - connect by prior t.object_type = t.supertype - start with t.object_type=:max_object_type_one -}] +set object_types_one_list [db_list_of_lists select_object_types_one {}] foreach obj $object_types_one_list { lappend object_types_one_list_i18n [lang::util::localize $obj] } -set object_types_two_list [db_list_of_lists select_object_types_two { - select replace(lpad(' ', (level - 1) * 4), ' ', ' ') || t.pretty_name, - t.object_type as rel_type - from acs_object_types t - connect by prior t.object_type = t.supertype - start with t.object_type=:max_object_type_two -}] +set object_types_two_list [db_list_of_lists select_object_types_two {}] foreach obj $object_types_two_list { lappend object_types_two_list_i18n [lang::util::localize $obj] } @@ -175,20 +163,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_plural_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_plural_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/rel-types/new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-types/new.tcl,v diff -u -r1.5.2.1 -r1.5.2.2 --- openacs-4/packages/acs-subsite/www/admin/rel-types/new.tcl 10 Sep 2015 08:21:46 -0000 1.5.2.1 +++ openacs-4/packages/acs-subsite/www/admin/rel-types/new.tcl 28 Oct 2015 09:38:37 -0000 1.5.2.2 @@ -15,13 +15,7 @@ } -db_multirow supertypes select_supertypes { - select replace(lpad(' ', (level - 1) * 4), ' ', ' ') || t.pretty_name as name, - t.object_type - from acs_object_types t - connect by prior t.object_type = t.supertype - start with t.object_type in ('membership_rel','composition_rel') -} +db_multirow supertypes select_supertypes {} set context [list [list "[ad_conn package_url]admin/rel-types/" [_ acs-subsite.Relationship_Types]] [_ acs-subsite.Create_relation_type]] Index: openacs-4/packages/acs-subsite/www/admin/rel-types/one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-types/one.tcl,v diff -u -r1.3.28.1 -r1.3.28.2 --- openacs-4/packages/acs-subsite/www/admin/rel-types/one.tcl 10 Sep 2015 08:21:46 -0000 1.3.28.1 +++ openacs-4/packages/acs-subsite/www/admin/rel-types/one.tcl 28 Oct 2015 09:38:37 -0000 1.3.28.2 @@ -39,39 +39,15 @@ return } -db_1row select_rel_type_properties { - select t1.pretty_name as object_type_one_pretty_name, - r.object_type_one, acs_rel_type.role_pretty_name(r.role_one) as role_one_pretty_name, - r.role_one, r.min_n_rels_one, r.max_n_rels_one, - t2.pretty_name as object_type_two_pretty_name, - r.object_type_two, acs_rel_type.role_pretty_name(r.role_two) as role_two_pretty_name, - r.role_two, r.min_n_rels_two, r.max_n_rels_two - from acs_rel_types r, acs_object_types t1, acs_object_types t2 - where r.rel_type = :rel_type - and r.object_type_one = t1.object_type - and r.object_type_two = t2.object_type -} -column_array properties +db_1row select_rel_type_properties {} -column_array properties set user_id [ad_conn user_id] # We display up to 25 relations, and then offer a link for the rest. # Pull out all the relations of this type -db_multirow rels rels_select { - select inner.* - from (select r.rel_id, acs_object.name(r.object_id_one) || ' and ' || acs_object.name(r.object_id_two) as name - from acs_rels r, acs_object_party_privilege_map perm, - app_group_distinct_rel_map m - where perm.object_id = r.rel_id - and perm.party_id = :user_id - and perm.privilege = 'read' - and r.rel_type = :rel_type - and m.rel_id = r.rel_id - and m.package_id = :package_id - order by lower(acs_object.name(r.object_id_one)), lower(acs_object.name(r.object_id_two))) inner - where rownum <= 26 -} +db_multirow rels rels_select {} db_multirow attributes attributes_select { Index: openacs-4/packages/acs-subsite/www/admin/rel-types/rels-list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-types/rels-list.tcl,v diff -u -r1.4.2.1 -r1.4.2.2 --- openacs-4/packages/acs-subsite/www/admin/rel-types/rels-list.tcl 10 Sep 2015 08:21:46 -0000 1.4.2.1 +++ openacs-4/packages/acs-subsite/www/admin/rel-types/rels-list.tcl 28 Oct 2015 09:38:37 -0000 1.4.2.2 @@ -30,18 +30,7 @@ return } -db_multirow rels rels_select { - select r.rel_id, acs_object.name(r.object_id_one) || ' and ' || acs_object.name(r.object_id_two) as name - from acs_rels r, acs_object_party_privilege_map perm, - app_group_distinct_rel_map m - where perm.object_id = r.rel_id - and perm.party_id = :user_id - and perm.privilege = 'read' - and r.rel_type = :rel_type - and m.rel_id = r.rel_id - and m.package_id = :package_id - order by lower(name) -} +db_multirow rels rels_select {} ad_return_template Index: openacs-4/packages/acs-subsite/www/admin/rel-types/roles/delete-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-types/roles/delete-2.tcl,v diff -u -r1.2.12.1 -r1.2.12.2 --- openacs-4/packages/acs-subsite/www/admin/rel-types/roles/delete-2.tcl 10 Sep 2015 08:21:46 -0000 1.2.12.1 +++ openacs-4/packages/acs-subsite/www/admin/rel-types/roles/delete-2.tcl 28 Oct 2015 09:38:38 -0000 1.2.12.2 @@ -17,11 +17,8 @@ if {$operation eq "Yes, I really want to delete this role"} { db_transaction { - if { [catch {db_exec_plsql drop_role {begin acs_rel_type.drop_role(:role);end;}} errmsg] } { - if { [db_string role_used_p { - select case when exists (select 1 from acs_rel_types where role_one = :role or role_two = :role) then 1 else 0 end - from dual - }] } { + if { [catch {db_exec_plsql drop_role {}} errmsg] } { + if { [db_string role_used_p {}] } { ad_return_complaint 1 "
  • The role \"$role\" is still in use. You must remove all relationship types that use this role before you can remove this role." return } else { Index: openacs-4/packages/acs-subsite/www/admin/relations/add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/relations/add.tcl,v diff -u -r1.15.2.1 -r1.15.2.2 --- openacs-4/packages/acs-subsite/www/admin/relations/add.tcl 10 Sep 2015 08:21:46 -0000 1.15.2.1 +++ openacs-4/packages/acs-subsite/www/admin/relations/add.tcl 28 Oct 2015 09:38:38 -0000 1.15.2.2 @@ -60,22 +60,7 @@ } # We assume the group is on side 1... -db_1row rel_type_info { - select t.object_type_two, t.role_two as role, - acs_rel_type.role_pretty_name(t.role_two) as role_pretty_name, - acs_object_type.pretty_name(t.object_type_two) as object_type_two_name, - ancestor_rel_types.object_type as ancestor_rel_type - from acs_rel_types t, acs_object_types obj_types, - acs_object_types ancestor_rel_types - where t.rel_type = :rel_type - and t.rel_type = obj_types.object_type - and ancestor_rel_types.supertype = 'relationship' - and ancestor_rel_types.object_type in ( - select object_type from acs_object_types - start with object_type = :rel_type - connect by object_type = prior supertype - ) -} +db_1row rel_type_info {} # The role pretty names can be message catalog keys that need # to be localized before they are displayed Index: openacs-4/packages/acs-subsite/www/admin/relations/one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/relations/one.tcl,v diff -u -r1.4.2.2 -r1.4.2.3 --- openacs-4/packages/acs-subsite/www/admin/relations/one.tcl 18 Sep 2015 07:27:48 -0000 1.4.2.2 +++ openacs-4/packages/acs-subsite/www/admin/relations/one.tcl 28 Oct 2015 09:38:38 -0000 1.4.2.3 @@ -45,18 +45,7 @@ set subsite_group_id [application_group::group_id_from_package_id] -if { ![db_0or1row select_rel_info { - select r.rel_type, acs_object_type.pretty_name(t.rel_type) as rel_type_pretty_name, - acs_rel_type.role_pretty_name(t.role_one) as role_one_pretty_name, - acs_rel_type.role_pretty_name(t.role_two) as role_two_pretty_name, - t.object_type_two as object_type_two, - acs_object.name(r.object_id_one) as object_id_one_name, - r.object_id_one, - acs_object.name(r.object_id_two) as object_id_two_name, - r.object_id_two - from acs_rels r, acs_rel_types t - where r.rel_id = :rel_id - and r.rel_type = t.rel_type} -column_array rel] +if { ![db_0or1row select_rel_info {} -column_array rel] } { ad_return_error "Error" "Relation #rel_id does not exist" ad_script_abort Index: openacs-4/packages/acs-subsite/www/admin/relations/remove.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/relations/remove.tcl,v diff -u -r1.3.2.1 -r1.3.2.2 --- openacs-4/packages/acs-subsite/www/admin/relations/remove.tcl 10 Sep 2015 08:21:47 -0000 1.3.2.1 +++ openacs-4/packages/acs-subsite/www/admin/relations/remove.tcl 28 Oct 2015 09:38:38 -0000 1.3.2.2 @@ -29,13 +29,7 @@ set context [list "Remove relation"] -if { ![db_0or1row select_rel_info { - select acs_object_type.pretty_name(r.rel_type) as rel_type_pretty_name, - acs_object.name(r.object_id_one) as object_id_one_name, - acs_object.name(r.object_id_two) as object_id_two_name, - r.object_id_two - from acs_rels r - where r.rel_id = :rel_id} -column_array rel] +if { ![db_0or1row select_rel_info {} -column_array rel] } { ad_return_error "Error" "Relation $rel_id does not exist" ad_script_abort @@ -49,14 +43,7 @@ # We can't remove this relation - display the violations template::multirow create dependants rel_id rel_type_pretty_name object_id_one_name object_id_two_name export_vars - db_foreach select_dependants { - select r.viol_rel_id as rel_id, - acs_object_type.pretty_name(r.viol_rel_type) as rel_type_pretty_name, - acs_object.name(r.viol_object_id_one) as object_id_one_name, - acs_object.name(r.viol_object_id_two) as object_id_two_name - from rc_violations_by_removing_rel r - where r.rel_id = :rel_id - } { + db_foreach select_dependants {} { template::multirow append dependants $rel_id $rel_type_pretty_name $object_id_one_name $object_id_two_name [export_vars {rel_id return_url}] } ad_return_template remove-dependants-exist Index: openacs-4/packages/acs-subsite/www/admin/site-map/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/site-map/index-postgresql.xql,v diff -u -r1.13 -r1.13.2.1 --- openacs-4/packages/acs-subsite/www/admin/site-map/index-postgresql.xql 27 Oct 2014 16:39:56 -0000 1.13 +++ openacs-4/packages/acs-subsite/www/admin/site-map/index-postgresql.xql 28 Oct 2015 09:38:38 -0000 1.13.2.1 @@ -18,43 +18,6 @@ - - - select package_id, - package_key, - pretty_name as package_pretty_name, - apm_package_type__num_parameters(package_key) as parameter_count, - node_id, url, parent_url, name, root_p, mylevel, object_id, - directory_p, parent_id, n_children, - p.instance_name as object_name, - acs_permission__permission_p(object_id, :user_id, 'admin') as object_admin_p - from apm_packages p join apm_package_types using (package_key) right outer join - (select n.node_id, - site_node__url(n.node_id) as url, - site_node__url(n.parent_id) as parent_url, - n.name, - case when exists (select 1 from site_nodes where parent_id = n.node_id) then 1 else 0 end as n_children, - case when n.node_id = (select site_node__node_id('/', null)) then 1 else 0 end as root_p, - (tree_level(n.tree_sortkey) - (select tree_level(n2.tree_sortkey) from site_nodes n2 where n2.node_id = (select coalesce(:root_id, site_node__node_id('/', null))))) as mylevel, - n.object_id, - n.directory_p, - n.parent_id - from site_nodes n, site_nodes n2 - where (n.object_id is null - or exists ( - select 1 from acs_object_party_privilege_map ppm - where ppm.object_id = n.object_id - and ppm.party_id = :user_id - and ppm.privilege = 'read')) - and n2.node_id = (select coalesce(:root_id, site_node__node_id('/', null))) - and n.tree_sortkey between n2.tree_sortkey and tree_right(n2.tree_sortkey) - and (n.parent_id is null or n.parent_id in ([join $expand ", "]))) site_map - on site_map.object_id = p.package_id - $where_limit - order by url - - - postgresql8.4 @@ -90,23 +53,6 @@ - - select package_id, - ap.package_key, - ap.instance_name, - apm_package_type__num_parameters(ap.package_key) as parameter_count - from apm_packages ap, - apm_package_types - where ap.package_key = apm_package_types.package_key - and package_type = 'apm_service' - and not exists (select 1 from site_nodes sn where sn.object_id = package_id) - and exists (select 1 from acs_object_party_privilege_map ppm - where ppm.object_id = package_id and ppm.party_id = :user_id and ppm.privilege = 'admin') - order by instance_name - - - - postgresql8.4 With apm_services AS ( Index: openacs-4/packages/acs-subsite/www/admin/site-map/site-map-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/site-map/site-map-postgresql.xql,v diff -u -r1.3 -r1.3.4.1 --- openacs-4/packages/acs-subsite/www/admin/site-map/site-map-postgresql.xql 2 Apr 2013 11:05:18 -0000 1.3 +++ openacs-4/packages/acs-subsite/www/admin/site-map/site-map-postgresql.xql 28 Oct 2015 09:38:38 -0000 1.3.4.1 @@ -19,43 +19,6 @@ - - select package_id, - package_key, - pretty_name as package_pretty_name, - apm_package_type__num_parameters(package_key) as parameter_count, - node_id, url, parent_url, name, root_p, mylevel, object_id, - directory_p, parent_id, n_children, - p.instance_name as object_name, - acs_permission__permission_p(object_id, :user_id, 'admin') as object_admin_p, - (select view_p from site_nodes_selection where node_id=site_map.node_id) as view_p - from apm_packages p join apm_package_types using (package_key) right outer join - (select n.node_id, - site_node__url(n.node_id) as url, - site_node__url(n.parent_id) as parent_url, - n.name, - case when exists (select 1 from site_nodes where parent_id = n.node_id) then 1 else 0 end as n_children, - case when n.node_id = (select site_node__node_id('/', null)) then 1 else 0 end as root_p, - (tree_level(n.tree_sortkey) - (select tree_level(n2.tree_sortkey) from site_nodes n2 where n2.node_id = (select coalesce(:root_id, site_node__node_id('/', null))))) as mylevel, - n.object_id, - n.directory_p, - n.parent_id - from site_nodes n, site_nodes n2 - where (n.object_id is null - or exists ( - select 1 from acs_object_party_privilege_map ppm - where ppm.object_id = n.object_id - and ppm.party_id = :user_id - and ppm.privilege = 'read')) - and n2.node_id = (select coalesce(:root_id, site_node__node_id('/', null))) - and n.tree_sortkey between n2.tree_sortkey and tree_right(n2.tree_sortkey) - and (n.parent_id is null or n.parent_id in ([join $expand ", "]))) site_map - on site_map.object_id = p.package_id - order by url - - - - postgresql8.4 select package_id, @@ -90,23 +53,6 @@ - - select package_id, - ap.package_key, - ap.instance_name, - apm_package_type__num_parameters(ap.package_key) as parameter_count - from apm_packages ap, - apm_package_types - where ap.package_key = apm_package_types.package_key - and package_type = 'apm_service' - and not exists (select 1 from site_nodes sn where sn.object_id = package_id) - and exists (select 1 from acs_object_party_privilege_map ppm - where ppm.object_id = package_id and ppm.party_id = :user_id and ppm.privilege = 'admin') - order by instance_name - - - - postgresql8.4 select package_id, Index: openacs-4/packages/acs-subsite/www/admin/users/new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/users/new.tcl,v diff -u -r1.16.2.1 -r1.16.2.2 --- openacs-4/packages/acs-subsite/www/admin/users/new.tcl 10 Sep 2015 08:21:48 -0000 1.16.2.1 +++ openacs-4/packages/acs-subsite/www/admin/users/new.tcl 28 Oct 2015 09:38:39 -0000 1.16.2.2 @@ -36,16 +36,7 @@ } # We assume the group is on side 1... -db_1row rel_type_info { - select object_type as ancestor_rel_type - from acs_object_types - where supertype = 'relationship' - and object_type in ( - select object_type from acs_object_types - start with object_type = :add_with_rel_type - connect by object_type = prior supertype - ) -} +db_1row rel_type_info {} set create_p [group::permission_p -privilege create $add_to_group_id] @@ -160,12 +151,7 @@ set email_verified_p "t" } - set double_click_p [db_string user_exists { - select case when exists - (select 1 from users where user_id = :user_id) - then 1 else 0 end - from dual - }] + set double_click_p [db_string user_exists {}] if {!$double_click_p} { Index: openacs-4/packages/acs-subsite/www/permissions/grant.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/permissions/grant.tcl,v diff -u -r1.16.2.1 -r1.16.2.2 --- openacs-4/packages/acs-subsite/www/permissions/grant.tcl 10 Sep 2015 08:21:49 -0000 1.16.2.1 +++ openacs-4/packages/acs-subsite/www/permissions/grant.tcl 28 Oct 2015 09:38:39 -0000 1.16.2.2 @@ -26,7 +26,7 @@ # acs_privileges. Note that nodes can appear more than one time in the # tree. -set existing_privs [db_list select_privileges_list { }] +set existing_privs [db_list select_privileges_list {}] # The maximum level that has been reached within the hierarchy. set maxlevel 1 @@ -41,7 +41,7 @@ # Loop through each row in acs_privilege_hierarchy and shuffle the # $hierarchy list accordingly. -db_foreach select_privileges_hierarchy { } { +db_foreach select_privileges_hierarchy {} { if { [set start_pos [lsearch -regexp $hierarchy "\\m$child_privilege\\M"]] == -1 } { # child_privilege of this relation not in privileges - skip. Index: openacs-4/packages/acs-subsite/www/permissions/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/permissions/index.tcl,v diff -u -r1.4.2.1 -r1.4.2.2 --- openacs-4/packages/acs-subsite/www/permissions/index.tcl 10 Sep 2015 08:21:49 -0000 1.4.2.1 +++ openacs-4/packages/acs-subsite/www/permissions/index.tcl 28 Oct 2015 09:38:39 -0000 1.4.2.2 @@ -20,7 +20,7 @@ set root [ad_conn package_id] } -db_multirow objects adminable_objects { *SQL* } +db_multirow objects adminable_objects {} set security_context_root [acs_magic_object security_context_root] set default_context [acs_magic_object default_context] Index: openacs-4/packages/acs-subsite/www/permissions/one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/permissions/one.tcl,v diff -u -r1.17.2.3 -r1.17.2.4 --- openacs-4/packages/acs-subsite/www/permissions/one.tcl 20 Oct 2015 07:23:00 -0000 1.17.2.3 +++ openacs-4/packages/acs-subsite/www/permissions/one.tcl 28 Oct 2015 09:38:39 -0000 1.17.2.4 @@ -30,17 +30,17 @@ set context [list [list "./" [_ acs-subsite.Permissions]] [_ acs-subsite.Permissions_for_name]] -db_multirow inherited inherited_permissions { *SQL* } { +db_multirow inherited inherited_permissions {} { } -db_multirow acl acl { *SQL* } { +db_multirow acl acl {} { } set controls [list] set controlsUrl [export_vars -base grant {application_url object_id}] lappend controls "[ns_quotehtml [_ acs-subsite.Grant_Permission]]" -db_1row context { *SQL* } +db_1row context {} set context_name [lang::util::localize $context_name] set toggleUrl [export_vars -base toggle-inherit {application_url object_id}] @@ -58,10 +58,10 @@ set hide_children_url [export_vars -base one {object_id application_url {children_p f}}] if {$children_p == "t"} { - db_multirow children children { *SQL* } { + db_multirow children children {} { } } else { - db_1row children_count { *SQL* } + db_1row children_count {} } # Local variables: Index: openacs-4/packages/acs-subsite/www/permissions/revoke.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/permissions/revoke.tcl,v diff -u -r1.6.2.1 -r1.6.2.2 --- openacs-4/packages/acs-subsite/www/permissions/revoke.tcl 10 Sep 2015 08:21:50 -0000 1.6.2.1 +++ openacs-4/packages/acs-subsite/www/permissions/revoke.tcl 28 Oct 2015 09:38:39 -0000 1.6.2.2 @@ -26,15 +26,15 @@
    Are you sure you want to remove the following entries from the access - control list of [db_string name {select acs_object.name(:object_id) from dual}]? + control list of [db_string name {}]?
      }] foreach item $revoke_list { set party_id [lindex $item 0] set privilege [lindex $item 1] append body [subst { -
    • [db_string party_name {select acs_object.name(:party_id) from dual}]
    • +
    • [db_string party_name {}]
    • }] } Index: openacs-4/packages/acs-subsite/www/pvt/hide-email.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/pvt/hide-email.tcl,v diff -u -r1.3.2.1 -r1.3.2.2 --- openacs-4/packages/acs-subsite/www/pvt/hide-email.tcl 10 Sep 2015 08:21:50 -0000 1.3.2.1 +++ openacs-4/packages/acs-subsite/www/pvt/hide-email.tcl 28 Oct 2015 09:38:39 -0000 1.3.2.2 @@ -7,7 +7,7 @@ user_id:naturalnum,notnull } -db_dml update_show_email { } +db_dml update_show_email {} ad_returnredirect "/pvt/home" # Local variables: Index: openacs-4/packages/acs-subsite/www/shared/send-email.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/shared/send-email.tcl,v diff -u -r1.8.8.2 -r1.8.8.3 --- openacs-4/packages/acs-subsite/www/shared/send-email.tcl 18 Sep 2015 07:27:49 -0000 1.8.8.2 +++ openacs-4/packages/acs-subsite/www/shared/send-email.tcl 28 Oct 2015 09:38:39 -0000 1.8.8.3 @@ -18,7 +18,7 @@ set return_url [ad_pvt_home] } -db_1row user_to_info { *SQL* } +db_1row user_to_info {} set from [email_image::get_email -user_id $user_id] ad_form -name send-email -export {sendto return_url} -form { Index: openacs-4/packages/acs-subsite/www/site-map/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/site-map/index-postgresql.xql,v diff -u -r1.3 -r1.3.4.1 --- openacs-4/packages/acs-subsite/www/site-map/index-postgresql.xql 2 Apr 2013 11:05:18 -0000 1.3 +++ openacs-4/packages/acs-subsite/www/site-map/index-postgresql.xql 28 Oct 2015 09:38:39 -0000 1.3.4.1 @@ -19,44 +19,6 @@ - - select package_id, - package_key, - pretty_name as package_pretty_name, - apm_package_type__num_parameters(package_key) as parameter_count, - node_id, url, parent_url, name, root_p, mylevel, object_id, - directory_p, parent_id, n_children, - p.instance_name as object_name, - acs_permission__permission_p(object_id, :user_id, 'admin') as object_admin_p, - (select view_p from site_nodes_selection where node_id=site_map.node_id) as view_p - from apm_packages p join apm_package_types using (package_key) right outer join - (select n.node_id, - site_node__url(n.node_id) as url, - site_node__url(n.parent_id) as parent_url, - n.name, - case when exists (select 1 from site_nodes where parent_id = n.node_id) then 1 else 0 end as n_children, - case when n.node_id = (select site_node__node_id('/', null)) then 1 else 0 end as root_p, - (tree_level(n.tree_sortkey) - (select tree_level(n2.tree_sortkey) from site_nodes n2 where n2.node_id = (select coalesce(:root_id, site_node__node_id('/', null))))) as mylevel, - n.object_id, - n.directory_p, - n.parent_id - from site_nodes n, site_nodes n2,site_nodes_selection sn - where (n.object_id is null - or exists ( - select 1 from acs_object_party_privilege_map ppm - where ppm.object_id = n.object_id - and ppm.party_id = :user_id - and ppm.privilege = 'read')) - and sn.node_id = n.node_id - and n2.node_id = (select coalesce(:root_id, site_node__node_id('/', null))) - and n.tree_sortkey between n2.tree_sortkey and tree_right(n2.tree_sortkey) - and (n.parent_id is null or n.parent_id in ([join $expand ", "]))) site_map - on site_map.object_id = p.package_id - order by url - - - - postgresql8.4 select package_id, @@ -92,23 +54,6 @@ - - select package_id, - ap.package_key, - ap.instance_name, - apm_package_type__num_parameters(ap.package_key) as parameter_count - from apm_packages ap, - apm_package_types - where ap.package_key = apm_package_types.package_key - and package_type = 'apm_service' - and not exists (select 1 from site_nodes sn where sn.object_id = package_id) - and exists (select 1 from acs_object_party_privilege_map ppm - where ppm.object_id = package_id and ppm.party_id = :user_id and ppm.privilege = 'admin') - order by instance_name - - - - postgresql8.4 select package_id,