Index: openacs-4/packages/imsld/catalog/imsld.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/catalog/imsld.en_US.ISO-8859-1.xml,v diff -u -r1.26 -r1.27 --- openacs-4/packages/imsld/catalog/imsld.en_US.ISO-8859-1.xml 20 Jul 2006 16:18:48 -0000 1.26 +++ openacs-4/packages/imsld/catalog/imsld.en_US.ISO-8859-1.xml 25 Jul 2006 17:28:17 -0000 1.27 @@ -276,6 +276,7 @@ information found in the imsmanifest.xml file. Nothing to do. No IMS LD None + None, please select Not defined Number of IMD LDs Number to Select @@ -315,6 +316,7 @@ stopped Structure Type Support Activities + user: %supported_user_name% Then Identifier Time in Seconds Total Activities Index: openacs-4/packages/imsld/www/activity-frame.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/activity-frame.adp,v diff -u -r1.8 -r1.9 --- openacs-4/packages/imsld/www/activity-frame.adp 20 Jun 2006 19:20:38 -0000 1.8 +++ openacs-4/packages/imsld/www/activity-frame.adp 25 Jul 2006 17:28:18 -0000 1.9 @@ -20,15 +20,25 @@ - + - - - + + +
+ +
+
+ @activities;noquote@ + + Index: openacs-4/packages/imsld/www/activity-frame.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/activity-frame.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/imsld/www/activity-frame.tcl 20 Jul 2006 10:16:36 -0000 1.11 +++ openacs-4/packages/imsld/www/activity-frame.tcl 25 Jul 2006 17:28:18 -0000 1.12 @@ -9,8 +9,11 @@ } -query { run_id:integer,notnull activity_id:integer,notnull + {role_id ""} + {supported_user_id ""} } +set roles_template_p 0 set user_id [ad_conn user_id] db_1row context_info { select r.imsld_id, @@ -59,27 +62,28 @@ if {[llength $supported_roles]} { set roles_template_p 1 } - - -dom createDocument div doc -set dom_root [$doc documentElement] -$dom_root setAttribute class "tabber" -set activity_item_id [content::revision::item_id -revision_id $activity_id] -imsld::process_activity_as_ul -activity_item_id $activity_item_id -run_id $run_id -dom_doc $doc -dom_node $dom_root +if { !$roles_template_p } { -if { ![string eq $activity_id ""] && [db_0or1row get_table_name { - select - case - when exists (select 1 from imsld_learning_activities where activity_id=:activity_id) - then 'imsld_learning_activities' - when exists (select 1 from imsld_support_activities where activity_id=:activity_id) - then 'imsld_support_activities' - end as table_name - from dual -}] && ![string eq "" $table_name] } { - #grant permissions to resources in activity - set resources_list [db_list get_resources_from_activity " + dom createDocument div doc + set dom_root [$doc documentElement] + $dom_root setAttribute class "tabber" + + set activity_item_id [content::revision::item_id -revision_id $activity_id] + imsld::process_activity_as_ul -activity_item_id $activity_item_id -run_id $run_id -dom_doc $doc -dom_node $dom_root + + if { ![string eq $activity_id ""] && [db_0or1row get_table_name { + select + case + when exists (select 1 from imsld_learning_activities where activity_id=:activity_id) + then 'imsld_learning_activities' + when exists (select 1 from imsld_support_activities where activity_id=:activity_id) + then 'imsld_support_activities' + end as table_name + from dual + }] && ![string eq "" $table_name] } { + #grant permissions to resources in activity + set resources_list [db_list get_resources_from_activity " select ar2.object_id_two from $table_name ila, acs_rels ar1, @@ -90,10 +94,10 @@ and ar1.object_id_two=ar2.object_id_one and ar2.rel_type='imsld_item_res_rel' "] - - if {[string eq 'imsld_learning_activities' $table_name]} { - set prerequisites_list [db_list get_prerequisites_list " + if {[string eq 'imsld_learning_activities' $table_name]} { + + set prerequisites_list [db_list get_prerequisites_list " select ar2.object_id_two from acs_rels ar1, acs_rels ar2, @@ -104,7 +108,7 @@ and ar1.object_id_two=ar2.object_id_one and ar2.rel_type='imsld_item_res_rel' "] - set objectives_list [db_list get_objectives_list " + set objectives_list [db_list get_objectives_list " select ar2.object_id_two from acs_rels ar1, acs_rels ar2, @@ -115,15 +119,47 @@ and ar1.object_id_two=ar2.object_id_one and ar2.rel_type='imsld_item_res_rel' "] - } else { - set prerequisites_list [list] - set objectives_list [list] + } else { + set prerequisites_list [list] + set objectives_list [list] + } + set resources_list [concat $resources_list [concat $prerequisites_list $objectives_list]] + imsld::grant_permissions -resources_activities_list $resources_list -user_id $user_id } - set resources_list [concat $resources_list [concat $prerequisites_list $objectives_list]] - imsld::grant_permissions -resources_activities_list $resources_list -user_id $user_id + + set activities [$dom_root asXML] + +} else { + # a user has been selected to be supported + # get the associated resource of the support activity + db_1row activity_info { + select ii.imsld_item_id + from imsld_items ii, imsld_activity_descs sad, imsld_support_activities sa, + cr_items cr1, cr_items cr2, + acs_rels ar + where sa.activity_id = :activity_id + and sa.activity_description_id = cr1.item_id + and cr1.live_revision = sad.description_id + and ar.object_id_one = sa.activity_description_id + and ar.object_id_two = cr2.item_id + and cr2.live_revision = ii.imsld_item_id + } + + db_1row support_activity_associated_item { + select cpr.resource_id, + cpr.item_id as resource_item_id, + cpr.type as resource_type + from imsld_cp_resourcesi cpr, imsld_itemsi ii, + acs_rels ar + where ar.object_id_one = ii.item_id + and ar.object_id_two = cpr.item_id + and content_revision__is_live(cpr.resource_id) = 't' + and ii.imsld_item_id = :imsld_item_id + } + + set activities [export_vars -base "imsld-content-serve" -url { run_id resource_item_id role_id {owner_user_id $supported_user_id} }] } -set activities [$dom_root asXML] set page_title {} set context [list] Index: openacs-4/packages/imsld/www/support-activity-roles.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/support-activity-roles.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/imsld/www/support-activity-roles.adp 18 May 2006 11:13:01 -0000 1.1 +++ openacs-4/packages/imsld/www/support-activity-roles.adp 25 Jul 2006 17:28:18 -0000 1.2 @@ -1,18 +1,22 @@ -
+#imsld.Supporting# + +
- -
+ +
Index: openacs-4/packages/imsld/www/support-activity-roles.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/support-activity-roles.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/imsld/www/support-activity-roles.tcl 6 Jun 2006 13:24:46 -0000 1.3 +++ openacs-4/packages/imsld/www/support-activity-roles.tcl 25 Jul 2006 17:28:18 -0000 1.4 @@ -1,8 +1,4 @@ -ad_page_contract { - Here is placed information about roles and users in support activities - -} db_multirow role_info get_multirow_role_info "select title as role_name, role_id from imsld_rolesi @@ -37,6 +33,13 @@ } +if { [string eq "" $supported_user_id] } { + set supported_user_name "[_ imsld.None_please_select]" +} else { + set supported_user_name "[person::name -person_id $supported_user_id]" +} + + set lista [template::util::multirow_to_list supported_users_in_role]