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.6 -r1.1.2.7
--- openacs-4/packages/datamanager/tcl/datamanager-procs.tcl 2 Nov 2005 16:57:13 -0000 1.1.2.6
+++ openacs-4/packages/datamanager/tcl/datamanager-procs.tcl 9 Nov 2005 19:43:28 -0000 1.1.2.7
@@ -80,10 +80,13 @@
return $object_data
}
+
ad_proc -public get_available_communities {
-object_type:required
-bulk_action_export_vars
-mode_list
+ -communities_classes
+ -department_key
{-action_type "move"}
} {
Get the list of communities, subgroups or classes where an object can be moved
@@ -144,8 +147,6 @@
set action $action_type
-
-
#create the template_list
template::list::create \
-name available_communities \
@@ -156,19 +157,49 @@
-bulk_action_export_vars [concat $my_bulk_action_export_vars action]\
-elements $elements
- set comm_id [dotlrn_community::get_community_id]
+# 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 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]
+
+ foreach community $communities_list {
+ if { [dotlrn::user_can_admin_community_p -community_id $community] } {
+ lappend communities_list_p $community
+ }
+ }
+} elseif {$communities_classes eq "classes"} {
+ if { $department_key eq "all" } {
+ set communities_list [db_list get_list_of_all_dest_classes {}]
+ } else {
+ set communities_list [db_list get_list_of_dest_classes {}]
+ }
+ set communities_list_p [list]
+
+ foreach community $communities_list {
+ if { [dotlrn::user_can_admin_community_p -community_id $community] } {
+ lappend communities_list_p $community
+ }
+ }
+}
+
+if {[llength $communities_list_p] eq 0 } {
+ set communities_list_p [list 0]
+}
db_multirow -extend { type } communities get_data_communities {} {
+
if {$community_type == "dotlrn_club"} {
set type "[_ datamanager.Community]"
} elseif {$community_type == "dotlrn_community"} {
@@ -178,11 +209,13 @@
} else {
set type "[_ datamanager.Class]"
}
- }
-
- return available_communities
+ } if_no_rows { }
+ return [list available_communities ]
}
+
+
+
ad_proc -public get_trash_id {
} {
Get the trash identifier
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.5 -r1.1.2.6
--- openacs-4/packages/datamanager/tcl/datamanager-procs.xql 2 Nov 2005 17:02:19 -0000 1.1.2.5
+++ openacs-4/packages/datamanager/tcl/datamanager-procs.xql 9 Nov 2005 19:43:28 -0000 1.1.2.6
@@ -61,23 +61,58 @@
- select community_id
- from dotlrn_communities_all
- where community_id <> :comm_id and
- (parent_community_id <> community_id or parent_community_id is null) and
- (community_id in (select community_id
- from dotlrn_community_applets applets
- where applet_id = (select applet_id
- from dotlrn_applets
- where applet_key=:object_type)))
+ SELECT community_id
+ FROM dotlrn_communities_all
+ 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,
+ dotlrn_applets da
+ where dca.applet_id = da.applet_id
+ and da.applet_key= :object_type))
+
+
+ SELECT community_id
+ FROM dotlrn_communities_all dca,
+ dotlrn_classes dc,
+ dotlrn_departments dd
+ WHERE dca.community_id <> :comm_id
+ and dca.community_type = dc.class_key
+ 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,
+ dotlrn_applets da
+ where dca.applet_id = da.applet_id
+ and da.applet_key=:object_type))
+
+
+
+
+
+ SELECT community_id
+ FROM dotlrn_communities_all dca
+ 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,
+ dotlrn_applets da
+ 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 ","])
+ where community_id in ([join $communities_list_p ","])
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/datamanager/www/available-comm-template.adp'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/datamanager/www/available-comm-template.tcl'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/datamanager/www/available-comm-template.xql'.
Fisheye: No comparison available. Pass `N' to diff?
Index: openacs-4/packages/datamanager/www/manage-object1.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/datamanager/www/Attic/manage-object1.adp,v
diff -u -r1.1.2.1 -r1.1.2.2
--- openacs-4/packages/datamanager/www/manage-object1.adp 19 Oct 2005 08:16:01 -0000 1.1.2.1
+++ openacs-4/packages/datamanager/www/manage-object1.adp 9 Nov 2005 19:42:40 -0000 1.1.2.2
@@ -1,6 +1,6 @@
-#datamanager.pretty_name#
+
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/datamanager/www/manage-object2.adp'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/datamanager/www/manage-object2.tcl'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/datamanager/www/manage-object2.xql'.
Fisheye: No comparison available. Pass `N' to diff?
Index: openacs-4/packages/datamanager/www/one-object-copy.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/datamanager/www/one-object-copy.adp,v
diff -u -r1.1.2.4 -r1.1.2.5
--- openacs-4/packages/datamanager/www/one-object-copy.adp 28 Oct 2005 10:17:37 -0000 1.1.2.4
+++ openacs-4/packages/datamanager/www/one-object-copy.adp 9 Nov 2005 19:42:40 -0000 1.1.2.5
@@ -1,6 +1,6 @@
-<# Copy#>
+Copy selected objects
@context;noquote@
Copy objects
@object_name@
#datamanager.to#
Index: openacs-4/packages/datamanager/www/one-object-delete.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/datamanager/www/Attic/one-object-delete.adp,v
diff -u -r1.1.2.2 -r1.1.2.3
--- openacs-4/packages/datamanager/www/one-object-delete.adp 10 Oct 2005 12:59:34 -0000 1.1.2.2
+++ openacs-4/packages/datamanager/www/one-object-delete.adp 9 Nov 2005 19:42:40 -0000 1.1.2.3
@@ -1,6 +1,6 @@
-<# Delete#>
+Delete selected objects
@context;noquote@
Index: openacs-4/packages/datamanager/www/one-object-move.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/datamanager/www/Attic/one-object-move.adp,v
diff -u -r1.1.2.3 -r1.1.2.4
--- openacs-4/packages/datamanager/www/one-object-move.adp 28 Oct 2005 10:17:37 -0000 1.1.2.3
+++ openacs-4/packages/datamanager/www/one-object-move.adp 9 Nov 2005 19:42:40 -0000 1.1.2.4
@@ -1,6 +1,6 @@
-<# Move#>
+Move selected objects
@context;noquote@
@@ -9,14 +9,21 @@
+
+
+
+
+
+
Index: openacs-4/packages/datamanager/www/one-object-move.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/datamanager/www/Attic/one-object-move.tcl,v
diff -u -r1.1.2.6 -r1.1.2.7
--- openacs-4/packages/datamanager/www/one-object-move.tcl 2 Nov 2005 16:58:12 -0000 1.1.2.6
+++ openacs-4/packages/datamanager/www/one-object-move.tcl 9 Nov 2005 19:42:40 -0000 1.1.2.7
@@ -4,17 +4,22 @@
@creation_date 2005-07-05
} -query {
- object_id:integer,notnull,multiple
+ object_id:multiple
+ {department_key: "all"}
} -properties {
}
-
set context [list [_ datamanager.Object_Move]]
set title "[_ datamanager.Choose_Destination]"
+
#only administrator or professor must be allowed to enter this page
dotlrn::require_user_admin_community -community_id [dotlrn_community::get_community_id]
+if {[llength $object_id] == 1} {
+ if {[llength [lindex $object_id 0]] > 1} {
+ set object_id [lindex $object_id 0]
+ }
+}
-
if { [llength $object_id] > 1 } {
set descendant_ids [list]
set ancestors_ids [list]
@@ -35,14 +40,15 @@
if {$descendant_p eq "f"} {lappend ancestors_ids $item_id} else {lappend descendant_ids $item_id}
}
lappend checked_items $tree_sortkey
- }
-}
+ } if_no_rows {set ancestors_ids $object_id}
+} else { set ancestors_ids $object_id }
set object_data [list]
set object_name [list]
foreach object $ancestors_ids {
set object_type [datamanager::get_object_type -object_id $object]
+ ns_log Notice $object_type
set object_data_temp [datamanager::get_object_data -object_type $object_type -object_id $object]
lappend object_data $object_data_temp
lappend object_name [lindex $object_data_temp 0]
@@ -54,5 +60,28 @@
set action "move"
-set available_communities [datamanager::get_available_communities -object_type $object_type -action_type $action]
+set departments_temp [db_list_of_lists get_departments_list {}]
+ns_log Notice "departments_antes: $departments_temp"
+set departments [linsert $departments_temp 0 [list All all]]
+#
+#foreach dpt_item $departments_temp {
+# set departments [lappend $departments $dpt_item]
+# ns_log Notice "departments_despues: $departments"
+#}
+ns_log Notice "departments_despues: $departments"
+form create department_form -has_submit 1
+element create department_form department_key \
+ -label "Departments" \
+ -datatype text \
+ -widget select \
+ -options $departments \
+ -optional \
+ -html {onChange document.department_form.submit()} \
+ -value $department_key
+
+element create department_form object_id \
+ -datatype text \
+ -widget hidden \
+ -value $object_id
+
Index: openacs-4/packages/datamanager/www/one-object-move.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/datamanager/www/Attic/one-object-move.xql,v
diff -u -r1.1.2.2 -r1.1.2.3
--- openacs-4/packages/datamanager/www/one-object-move.xql 2 Nov 2005 16:58:12 -0000 1.1.2.2
+++ openacs-4/packages/datamanager/www/one-object-move.xql 9 Nov 2005 19:42:40 -0000 1.1.2.3
@@ -101,4 +101,13 @@
+
+
+ SELECT dct.pretty_name, dd.department_key
+ FROM dotlrn_departments dd, dotlrn_community_types dct
+ WHERE dct.community_type=dd.department_key
+
+
+
+
Index: openacs-4/packages/datamanager/www/select-objects.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/datamanager/www/Attic/select-objects.adp,v
diff -u -r1.1.2.1 -r1.1.2.2
--- openacs-4/packages/datamanager/www/select-objects.adp 19 Oct 2005 08:16:01 -0000 1.1.2.1
+++ openacs-4/packages/datamanager/www/select-objects.adp 9 Nov 2005 19:42:40 -0000 1.1.2.2
@@ -1,5 +1,5 @@
-#datamanager.pretty_name#
+Datamanager: select objects
@context;noquote@
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/datamanager/www/use-dotlrn_assessment.tcl'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/datamanager/www/use-dotlrn_faq.tcl'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/datamanager/www/use-dotlrn_news.tcl'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/datamanager/www/use-dotlrn_static.tcl'.
Fisheye: No comparison available. Pass `N' to diff?