Index: openacs-4/packages/datamanager/tcl/datamanager-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/datamanager/tcl/datamanager-procs.tcl,v diff -u -r1.1.2.8 -r1.1.2.9 --- openacs-4/packages/datamanager/tcl/datamanager-procs.tcl 10 Nov 2005 12:12:09 -0000 1.1.2.8 +++ openacs-4/packages/datamanager/tcl/datamanager-procs.tcl 11 Nov 2005 10:04:59 -0000 1.1.2.9 @@ -4,20 +4,8 @@ @author Luis de la Fuente (lfuente@it.uc3m.es) @creation-date 14 June 2005 } - namespace eval datamanager { -# ejemplo de uso de ad_proc -# ad_proc -public add_self_to_page { -# {-portal_id:required} -# {-package_id:required} -# } { -# Adds a static PE to the given page -# } { -# ns_log notice "static_portlet::add_self_to_page - Don't call me. Use static_portal_content:: instead" -# error -# } - ad_proc -public get_object_type { -object_id:required } { @@ -73,14 +61,14 @@ default { set object_name "[_ datamanager._Not]" set object_url "" - set object_type "" + set object_type "" } } set object_data [list $object_name $object_url $object_type] return $object_data } - + ad_proc -public get_available_communities { -object_type:required -bulk_action_export_vars @@ -108,7 +96,6 @@ dest_community_id { hide_p 1 } - community_type { label {[_ datamanager.Type]} display_col type @@ -125,7 +112,6 @@ dest_community_id { hide_p 1 } - community_type { label {[_ datamanager.Type]} display_col type @@ -149,6 +135,7 @@ ns_log Notice "my bulk action export vars : $my_bulk_action_export_vars" ns_log Notice "action: $action" set available_name [join [list "available" $communities_classes] "_"] + #create the template_list template::list::create \ -name $available_name \ @@ -158,22 +145,10 @@ -bulk_actions $bulk_actions \ -bulk_action_export_vars [concat $my_bulk_action_export_vars action]\ -elements $elements - -# set comm_id [dotlrn_community::get_community_id] -# -# set communities_list [db_list get_list_of_dest_communities {}] -# set communities_list_p [list] -# -# foreach community $communities_list { -# if { [dotlrn::user_can_admin_community_p -community_id $community] } { -# lappend communities_list_p $community -# } -# } set comm_id [dotlrn_community::get_community_id] if {$communities_classes eq "communities"} { - set communities_list [db_list get_list_of_dest_communities {}] set communities_list_p [list] @@ -184,7 +159,7 @@ } } elseif {$communities_classes eq "classes"} { if { $department_key eq "all" } { - set communities_list [db_list get_list_of_all_dest_classes {}] + set communities_list [db_list get_list_of_all_dest_classes {}] } else { set communities_list [db_list get_list_of_dest_classes {}] } @@ -216,13 +191,10 @@ return [list $available_name ] } - - - ad_proc -public get_trash_id { } { Get the trash identifier - } { + } { db_1row get_id {} return $trash_id } @@ -235,9 +207,8 @@ if {[info exist community_id] == 0 } { set community_id [dotlrn_community::get_community_id] - } - + } db_1row get_package_id {} return $trash_package_id - } + } } Index: openacs-4/packages/datamanager/tcl/datamanager-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/datamanager/tcl/datamanager-procs.xql,v diff -u -r1.1.2.6 -r1.1.2.7 --- openacs-4/packages/datamanager/tcl/datamanager-procs.xql 9 Nov 2005 19:43:28 -0000 1.1.2.6 +++ openacs-4/packages/datamanager/tcl/datamanager-procs.xql 11 Nov 2005 10:04:59 -0000 1.1.2.7 @@ -3,59 +3,59 @@ - select object_type - from acs_objects - where object_id= :object_id + SELECT object_type + FROM acs_objects + WHERE object_id= :object_id - select name as object_name - from forums_forums - where forum_id=:object_id + SELECT name as object_name + FROM forums_forums + WHERE forum_id=:object_id - select faq_name as object_name - from faqs - where faq_id = :object_id + SELECT faq_name as object_name + FROM faqs + WHERE faq_id = :object_id - select title as object_name - from acs_objects - where object_id = :object_id + SELECT title as object_name + FROM acs_objects + WHERE object_id = :object_id - select pretty_name as object_name - from static_portal_content - where content_id = :object_id; + SELECT pretty_name as object_name + FROM static_portal_content + WHERE content_id = :object_id; - select title as object_name - from acs_objects - where object_id = :object_id + SELECT title as object_name + FROM acs_objects + WHERE object_id = :object_id - select title as object_name - from acs_objects - where object_id = :object_id + SELECT title as object_name + FROM acs_objects + WHERE object_id = :object_id @@ -66,10 +66,10 @@ WHERE community_id <> :comm_id and community_type='dotlrn_club' and (parent_community_id <> community_id or parent_community_id is null) - and (community_id in (select dca.community_id - from dotlrn_community_applets dca, + and (community_id in (SELECT dca.community_id + FROM dotlrn_community_applets dca, dotlrn_applets da - where dca.applet_id = da.applet_id + WHERE dca.applet_id = da.applet_id and da.applet_key= :object_type)) @@ -85,10 +85,10 @@ and dc.department_key=dd.department_key and dd.department_key=:department_key and (parent_community_id <> community_id or parent_community_id is null) - and (community_id in (select dca.community_id - from dotlrn_community_applets dca, + and (community_id in (SELECT dca.community_id + FROM dotlrn_community_applets dca, dotlrn_applets da - where dca.applet_id = da.applet_id + WHERE dca.applet_id = da.applet_id and da.applet_key=:object_type)) @@ -100,33 +100,33 @@ WHERE dca.community_id <> :comm_id and dca.community_type <> 'dotlrn_club' and (parent_community_id <> community_id or parent_community_id is null) - and (community_id in (select dca.community_id - from dotlrn_community_applets dca, + and (community_id in (SELECT dca.community_id + FROM dotlrn_community_applets dca, dotlrn_applets da - where dca.applet_id = da.applet_id + WHERE dca.applet_id = da.applet_id and da.applet_key=:object_type)) - select community_id as dest_community_id, community_type, pretty_name as name, parent_community_id - from dotlrn_communities_all - where community_id in ([join $communities_list_p ","]) + SELECT community_id as dest_community_id, community_type, pretty_name as name, parent_community_id + FROM dotlrn_communities_all + WHERE community_id in ([join $communities_list_p ","]) - select pretty_name - from dotlrn_communities_all - where community_id = :parent_community_id + SELECT pretty_name + FROM dotlrn_communities_all + WHERE community_id = :parent_community_id - SELECT object_id as trash_id + SELECT object_id as trash_id FROM acs_objects WHERE object_type='trash' and title IS NULL and context_id IS NULL and package_id IS NULL;