Index: openacs-4/packages/imsld/tcl/imsld-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-procs.tcl,v
diff -u -r1.29 -r1.30
--- openacs-4/packages/imsld/tcl/imsld-procs.tcl 6 Feb 2006 18:03:13 -0000 1.29
+++ openacs-4/packages/imsld/tcl/imsld-procs.tcl 6 Feb 2006 18:12:50 -0000 1.30
@@ -423,7 +423,8 @@
then 'structure'
else 'none'
end as type,
- content_item__get_live_revision(coalesce(learning_activity_id,support_activity_id,activity_structure_id)) as activity_id
+ content_item__get_live_revision(coalesce(learning_activity_id,support_activity_id,activity_structure_id)) as activity_id,
+ coalesce(learning_activity_id, support_activity_id, activity_structure_id) as activity_item_id
from imsld_role_parts
where role_part_id = :role_part_id
}
@@ -438,6 +439,19 @@
-user_id $user_id \
-code_call
}
+
+ set resources_activities_list [imsld::process_learning_activity -activity_item_id $activity_item_id -resource_mode "t"]
+ foreach resource_activity [join $resources_activities_list] {
+ #grant permissions for newly appeared resources
+ foreach the_resource_id [join $resources_activities_list] {
+ if {![db_0or1row get_object_from_resource {}]} {
+ db_1row get_cr_item_from_resource {}
+ permission::grant -party_id $user_id -object_id $the_object_id -privilege "read"
+ } else {
+ permission::grant -party_id $user_id -object_id $the_object_id -privilege "read"
+ }
+ }
+ }
}
ad_proc -public imsld::mark_act_finished {
Index: openacs-4/packages/imsld/tcl/imsld-procs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-procs.xql,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/imsld/tcl/imsld-procs.xql 6 Feb 2006 17:07:44 -0000 1.6
+++ openacs-4/packages/imsld/tcl/imsld-procs.xql 6 Feb 2006 18:12:50 -0000 1.7
@@ -225,14 +225,34 @@
then 'structure'
else 'none'
end as type,
- content_item__get_live_revision(coalesce(learning_activity_id,support_activity_id,activity_structure_id)) as activity_id
+ content_item__get_live_revision(coalesce(learning_activity_id,support_activity_id,activity_structure_id)) as activity_id,
+ coalesce(learning_activity_id, support_activity_id, activity_structure_id) as activity_item_id
from imsld_role_parts
where role_part_id = :role_part_id
-
+
+
+
+ select acs_object_id as the_object_id
+ from imsld_cp_resourcesi
+ where item_id = :the_resource_id and
+ acs_object_id is not null
+
+
+
+
+
+ select ar.object_id_two as the_object_id
+ from acs_rels ar
+ where ar.object_id_one=:the_resource_id and
+ ar.rel_type='imsld_res_files_rel'
+
+
+
+
select item_id as act_item_id