Index: openacs-4/packages/datamanager/www/manage-object1.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/datamanager/www/Attic/manage-object1.tcl,v
diff -u -r1.1.2.1 -r1.1.2.2
--- openacs-4/packages/datamanager/www/manage-object1.tcl 19 Oct 2005 08:16:01 -0000 1.1.2.1
+++ openacs-4/packages/datamanager/www/manage-object1.tcl 28 Oct 2005 10:17:37 -0000 1.1.2.2
@@ -8,15 +8,15 @@
} -properties {
}
+set community_id [dotlrn_community::get_community_id]
set query_name [join [list select $object_type] "_"]
-ns_log Notice "query_name: $query_name"
template::list::create\
-name usable_objects \
-multirow usable_objects\
-key object_id\
- -bulk_actions { Move one-object-move {Move Checked Items } Copy one-object-copy {Copy Checked Items} }\
+ -bulk_actions { Move one-object-move {Move Checked Items} Copy one-object-copy {Copy Checked Items} }\
-elements {
object_name {
label "Name"
@@ -28,67 +28,7 @@
label "Creation date"
}
}
- db_multirow -extend { item_url } usable_objects select_assessment {
- SELECT ao1.title as object_name,
- ao1.object_id,
- us1.username as creation_user,
- ao1.creation_date
- FROM acs_objects as ao1,
- users as us1
- WHERE us1.user_id=ao1.creation_user and
- ao1.object_id in
- (SELECT coalesce(live_revision,latest_revision)
- FROM cr_items
- WHERE item_id in
- (SELECT item_id
- FROM cr_revisions
- WHERE revision_id in
- (SELECT ao.object_id
- FROM dotlrn_community_applets as dca,
- dotlrn_applets as da,
- acs_objects as ao
- WHERE dca.applet_id=da.applet_id
- and da.applet_key='dotlrn_assessment'
- and ao.package_id=dca.package_id
- and ao.object_type='as_assessments')
- group by item_id))
- } {
+ db_multirow -extend { item_url } usable_objects $query_name {} {
set item_url [export_vars -base "item" { object_id }]
}
-
-
-
-
-
-#template::list::create -name usable_objects -multirow usable_objects -elements {
-# name {
-# label {[_ datamanager.Name]]}
-# }
-# creation_date {
-# label "Creation date"
-# }
-# }
-#
-#
-#db_multirow usable_objects select_assessment {
-# SELECT ao1.title,ao1.object_id,ao1.creation_date
-# FROM acs_objects as ao1,
-# users as us1
-# WHERE us1.user_id=ao1.creation_user and
-# ao1.object_id in
-# (SELECT coalesce(live_revision,latest_revision)
-# FROM cr_items
-# WHERE item_id in
-# (SELECT item_id
-# FROM cr_revisions
-# WHERE revision_id in
-# (SELECT ao.object_id
-# FROM dotlrn_community_applets as dca,
-# dotlrn_applets as da,
-# acs_objects as ao
-# WHERE dca.applet_id=da.applet_id
-# and da.applet_key='dotlrn_assessment'
-# and ao.package_id=dca.package_id
-# and ao.object_type='as_assessments')
-## group by item_id)) }
Index: openacs-4/packages/datamanager/www/manage-object1.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/datamanager/www/Attic/manage-object1.xql,v
diff -u -r1.1.2.1 -r1.1.2.2
--- openacs-4/packages/datamanager/www/manage-object1.xql 19 Oct 2005 08:16:01 -0000 1.1.2.1
+++ openacs-4/packages/datamanager/www/manage-object1.xql 28 Oct 2005 10:17:37 -0000 1.1.2.2
@@ -1,10 +1,78 @@
-
-
+
+
+ SELECT ao1.title as object_name,
+ ao1.object_id,
+ us1.username as creation_user,
+ ao1.creation_date
+ FROM acs_objects as ao1,
+ users as us1
+ WHERE us1.user_id=ao1.creation_user and
+ ao1.object_id in
+ (SELECT coalesce(live_revision,latest_revision)
+ FROM cr_items
+ WHERE item_id in
+ (SELECT item_id
+ FROM cr_revisions
+ WHERE revision_id in
+ (SELECT ao.object_id
+ FROM dotlrn_community_applets as dca,
+ dotlrn_applets as da,
+ acs_objects as ao
+ WHERE dca.applet_id=da.applet_id
+ and da.applet_key='dotlrn_assessment'
+ and ao.package_id=dca.package_id
+ and ao.object_type='as_assessments'
+ and dca.community_id=:community_id)
+ group by item_id))
+
+
-
+
+
+
+
+ SELECT ao.title as object_name,
+ ao.object_id,
+ us1.username as creation_user,
+ ao.creation_date
+ FROM acs_objects as ao,
+ users as us1
+ WHERE us1.user_id=ao.creation_user and
+ ao.context_id in (select package_id from dotlrn_community_applets where applet_id = (select applet_id from dotlrn_applets where applet_key='dotlrn_faq') and community_id=:community_id)
+
+
+ SELECT spc.pretty_name as object_name,ao.object_id,ao.creation_date,'Unknown' as creation_user
+ FROM acs_objects as ao,static_portal_content as spc
+ WHERE ao.object_id in (select content_id from static_portal_content where body <> '' and package_id=:community_id) and spc.content_id=ao.object_id and not(spc.pretty_name like '#dotlrn-static%_info_%#')
+
+
+
+
+ SELECT ao.title as object_name,
+ ao.object_id,
+ us1.username as creation_user,
+ ao.creation_date,
+ count(ao.object_id) as threads_number
+ FROM acs_objects as ao,
+ users as us1,
+ forums_messages as fm
+ WHERE us1.user_id=ao.creation_user
+ and fm.forum_id = ao.object_id
+ and fm.parent_id IS NULL
+ and context_id in (select package_id
+ from dotlrn_community_applets as dca, dotlrn_applets as da
+ where dca.applet_id=da.applet_id and da.applet_key='dotlrn_forums' and dca.community_id=:community_id)
+ GROUP BY ao.title,ao.object_id,us1.username,ao.creation_date
+
+
+
+
+
+
+
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.3 -r1.1.2.4
--- openacs-4/packages/datamanager/www/one-object-copy.adp 19 Oct 2005 08:16:01 -0000 1.1.2.3
+++ openacs-4/packages/datamanager/www/one-object-copy.adp 28 Oct 2005 10:17:37 -0000 1.1.2.4
@@ -3,13 +3,18 @@
<# Copy#>
@context;noquote@
+
Copy objects
@object_name@
#datamanager.to#
-Copy @object_name@ to
#datamanager.Sorry#
+
+
+ Current copy mode is @mode@
+
+
Index: openacs-4/packages/datamanager/www/one-object-copy.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/datamanager/www/one-object-copy.tcl,v
diff -u -r1.1.2.4 -r1.1.2.5
--- openacs-4/packages/datamanager/www/one-object-copy.tcl 19 Oct 2005 08:16:01 -0000 1.1.2.4
+++ openacs-4/packages/datamanager/www/one-object-copy.tcl 28 Oct 2005 10:17:37 -0000 1.1.2.5
@@ -4,7 +4,8 @@
@creation_date 2005-07-05
} -query {
- object_id:integer,notnull
+ object_id:multiple,notnull
+ {mode: ""}
} -properties {
}
@@ -15,14 +16,48 @@
#only administrator or professor must be allowed to enter this page
dotlrn::require_user_admin_community -community_id [dotlrn_community::get_community_id]
-set object_type [datamanager::get_object_type -object_id $object_id]
-set object_data [datamanager::get_object_data -object_type $object_type -object_id $object_id]
+set object_data [list]
+set object_name [list]
-set object_name [lindex $object_data 0]
-set object_url [lindex $object_data 1]
-set object_type [lindex $object_data 2]
+if {[llength $object_id] == 1} {
+ if {[llength [lindex $object_id 0]] > 1} {
+ set object_id [lindex $object_id 0]
+ }
+}
+
+
+foreach object $object_id {
+ set object_type [datamanager::get_object_type -object_id $object]
+ 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]
+}
+set object_url [lindex [lindex $object_data 0] 1]
+set object_type [lindex [lindex $object_data 0] 2]
set action "copy"
-set available_communities [datamanager::get_available_communities -object_type $object_type -action_type $action]
+if {$object_type eq "dotlrn_forums"} {
+ if {$mode == ""} {
+ set mode "empty"
+ }
+ set empty_button [list "Empty" \
+ [export_vars -base one-object-copy {object_id {mode "empty"}}] \
+ "Select the forums without threads"]
+ set threads_button [list "Threads" \
+ [export_vars -base one-object-copy {object_id {mode "threads"}}]\
+ "Select the forums with threads, but no replies"]
+ set all_button [list "All" \
+ [export_vars -base one-object-copy {object_id {mode "all"}}]\
+ "Select the forums with the threads and replies"]
+ set mode_list [concat $empty_button $threads_button $all_button]
+} else {
+ set mode_list {}
+}
+
+set available_communities [datamanager::get_available_communities\
+ -object_type $object_type\
+ -action_type $action\
+ -mode_list $mode_list\
+ -bulk_action_export_vars [list [list object_id $object_id] [list mode $mode] ] ]
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.2 -r1.1.2.3
--- openacs-4/packages/datamanager/www/one-object-move.adp 23 Sep 2005 14:15:38 -0000 1.1.2.2
+++ openacs-4/packages/datamanager/www/one-object-move.adp 28 Oct 2005 10:17:37 -0000 1.1.2.3
@@ -4,7 +4,7 @@
@context;noquote@
- #datamanager.Move_1# @object_name@ #datamanager.to#
+Move objects
@object_name@
#datamanager.to#