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 -N -r1.34.4.3 -r1.34.4.4 --- openacs-4/packages/imsld/catalog/imsld.en_US.ISO-8859-1.xml 14 Jun 2007 14:31:29 -0000 1.34.4.3 +++ openacs-4/packages/imsld/catalog/imsld.en_US.ISO-8859-1.xml 27 Jun 2007 10:21:58 -0000 1.34.4.4 @@ -1,8 +1,6 @@ - 1. Local Properties - 5. Global Properties | Assigned users: Component Identifier | Creation Date: @@ -34,7 +32,7 @@ Confirm Confirm: New IMS-LD Confirm these changes - Context info + Environment Create a new group Create New? Create new @@ -57,6 +55,7 @@ Error parsing file Existing href Exit UoL + Exit Monitor Expression Extra Activities Feedbach Title @@ -67,6 +66,7 @@ Finish Date finished Finished Date + Global Properties Go back go back Go to UoL page @@ -146,21 +146,22 @@ Learning Object Learning Objects Level + Local Properties <li> %activity_title% </li> <li> %file_name% </li> <li> impozzible </li> - 2. Local-personal Properties - 3. Local-role Properties - 4. Global-personal Properties + Local-personal Properties + Local-role Properties + Global-personal Properties [_ imsld.create_new_run] Activity Description Identifier Activity Structure Identifier Add selected members to the group Are all the students asigned to the proper roles? If you confirm now, no more changes will be acepted later. <br>\ Go to the activity <a href=\"%activity_url%\">%activity_title%</a> (of the UoL <a href=\"%imsld_url%\">%imsld_title%</a> in the community <a href=\"%community_url%\">%community_name%</a>) for further details. - <br>\ - Go to the UoL <a href=\"%imsld_url%\">$imsld_title</a> (in the <a href=\"%community_url%\">%community_name%</a> community) for further details. + <br> + Go to the Learning Unit <a href=\"%imsld_url%\">$imsld_title</a> (in the <a href=\"%community_url%\">%community_name%</a> community) for further details. <br /> Warnings: <ul> %warnings% </ul> Change Property Value Identifier Change Property Value XML @@ -173,8 +174,8 @@ Create a new instance of a role Current Unit of Learning does not allow creation of multiple instances of this role. Current UoL does not allow to include them in more than one subroles of the role. - Dear %recepient_name% <br> - %sender_name has% triggered this notification. Please do not replay to this email. <br> + Dear %recepient_name%. <br> + %sender_name% has triggered this notification. Please do not replay to this email. <br> Email Propery Identifier Environment Identifier Error creating folder @@ -352,8 +353,8 @@ Username Property Identifier User's individual report Users who have at least visited the service - Users who have viewed or visited all the referenced resources from the environment - Users who have started and/or finished this activity + Users who have viewed or visited all resources in the learning object + Users who have started and/or finished activity Valid types are learning, support and structure More than one learning object in environment %identifier%. Just one used (the first one) We will continue automatically when processing is complete. @@ -385,6 +386,8 @@ No IMS LD No info was found No properties found. + No users + No user selected. None None, please select Not defined @@ -454,7 +457,7 @@ The selected role has no parent Then Identifier There are no descendant roles - is the list of activities started (and finished) by %member_name% + Activity report for user Time in Seconds Total Activities Parent Roles @@ -467,6 +470,10 @@ Uploading IMS LD URI User Choice? + User activity reports + user + Users + users Value Version view file Index: openacs-4/packages/imsld/catalog/imsld.es_ES.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/catalog/imsld.es_ES.ISO-8859-1.xml,v diff -u -N -r1.2 -r1.2.4.1 --- openacs-4/packages/imsld/catalog/imsld.es_ES.ISO-8859-1.xml 6 Apr 2006 14:25:02 -0000 1.2 +++ openacs-4/packages/imsld/catalog/imsld.es_ES.ISO-8859-1.xml 27 Jun 2007 10:21:58 -0000 1.2.4.1 @@ -1,8 +1,8 @@ - Informaci�n de Contexto + Entorno Material Unidades de Aprendizaje - Administraci�n de Unidades de Aprendizaje + Administración de Unidades de Aprendizaje Index: openacs-4/packages/imsld/lib/imsld-master.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/lib/imsld-master.adp,v diff -u -N -r1.1.2.2 -r1.1.2.3 --- openacs-4/packages/imsld/lib/imsld-master.adp 25 Jun 2007 17:46:53 -0000 1.1.2.2 +++ openacs-4/packages/imsld/lib/imsld-master.adp 27 Jun 2007 10:21:58 -0000 1.1.2.3 @@ -1,73 +1,137 @@ @doc.type;noquote@ lang="@doc.lang;noquote@"> - + lang="@doc.title_lang;noquote@">@doc.title;noquote@ + + http-equiv="@meta.http_equiv;noquote" + name="@meta.name;noquote@" + scheme="@meta.scheme;noquote@" + lang="@meta.lang;noquote@" content="@meta.content@">> + + + lang="@link.lang;noquote@" + title="@link.title;noquote@" + type="@link.type;noquote@" + media="@link.media@"/> + + + @head;noquote@ + + + + + + class="@body.class;noquote@" id="@body.id;noquote@"@event_handlers;noquote@> + + + + +
+
    + +
    @user_messages.message;noquote@
    +
    +
+
+
+ + + - http-equiv="@meta.http_equiv;noquote" name="@meta.name;noquote@" scheme="@meta.scheme;noquote@" lang="@meta.lang;noquote@" content="@meta.content@"> - - lang="@link.lang;noquote@" title="@link.title;noquote@" type="@link.type;noquote@" media="@link.media@"> - - - -@head;noquote@ - - class="@body.class;noquote@" id="@body.id;noquote@"@event_handlers;noquote@> - - + + + - -
-
    - -
    @user_messages.message;noquote@
    -
    -
-
-
+ + + - - - + + + + + - + function _tp(a){ + var ab=document.getElementById("addc"); + var ac=document.getElementById("addc1"); - + if (a) { + ai=''; + aj='none'; + parent.document.getElementsByTagName("frameset")[1].cols='30%,*'; + } else { + ai='none'; + aj=''; + parent.document.getElementsByTagName("frameset")[1].cols='0%,*'; + } + + ac.style.display=ai; + ab.style.display=aj; + + return false; + } + + - + - + Index: openacs-4/packages/imsld/lib/imsld-master.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/lib/imsld-master.tcl,v diff -u -N -r1.1.2.1 -r1.1.2.2 --- openacs-4/packages/imsld/lib/imsld-master.tcl 14 Jun 2007 14:31:29 -0000 1.1.2.1 +++ openacs-4/packages/imsld/lib/imsld-master.tcl 27 Jun 2007 10:21:58 -0000 1.1.2.2 @@ -14,11 +14,20 @@ } if { [string match /dotlrn/clubs/* [ad_conn url]] } { - set css_url [parameter::get_from_package_key -package_key "theme-zen" -parameter "communityCssUrl" -default "/resources/theme-zen/css/color/purple.css"] + set css_url [parameter::get_from_package_key \ + -package_key "theme-zen" \ + -parameter "communityCssUrl" \ + -default "/resources/theme-zen/css/color/purple.css"] } elseif { [string match /dotlrn/classes/* [ad_conn url]] } { - set css_url [parameter::get_from_package_key -package_key "theme-zen" -parameter "courseCssUrl" -default "/resources/theme-zen/css/color/green.css"] + set css_url [parameter::get_from_package_key \ + -package_key "theme-zen" \ + -parameter "courseCssUrl" \ + -default "/resources/theme-zen/css/color/green.css"] } else { - set css_url [parameter::get_from_package_key -package_key "theme-zen" -parameter "cssUrl" -default "/resources/theme-zen/css/color/blue.css"] + set css_url [parameter::get_from_package_key \ + -package_key "theme-zen" \ + -parameter "cssUrl" \ + -default "/resources/theme-zen/css/color/blue.css"] } set header_stuff "[subst { @@ -47,11 +56,11 @@ } set translations [list \ - doc_type doc(type) \ - title doc(title) \ - header_stuff head \ - onload body(onload) \ -] + doc_type doc(type) \ + title doc(title) \ + header_stuff head \ + onload body(onload) \ + ] foreach {from to} $translations { if {[info exists $from]} { @@ -62,7 +71,6 @@ } if { ![template::util::is_nil focus] } { - # Handle elements where the name contains a dot if { [regexp {^([^.]*)\.(.*)$} $focus match form_name element_name] } { lappend body(onload) "acs_Focus('${form_name}', '${element_name}');" @@ -98,11 +106,14 @@ template::multirow create link rel type href title lang media } -# DRB: this shouldn't really be in blank master, there should be some way for the templating -# package to associate a particular css file with pages that use particular form or list -# templates. Therefore I'll put the hard-wired values in blank-compat for the moment. -multirow append link stylesheet text/css /resources/acs-templating/lists.css "" [ad_conn language] all -multirow append link stylesheet text/css /resources/acs-templating/forms.css "" [ad_conn language] all +# DRB: this shouldn't really be in blank master, there should be some way for +# the templating package to associate a particular css file with pages that use +# particular form or list templates. Therefore I'll put the hard-wired values +# in blank-compat for the moment. +multirow append link stylesheet text/css /resources/acs-templating/lists.css \ + "" [ad_conn language] all +multirow append link stylesheet text/css /resources/acs-templating/forms.css \ + "" [ad_conn language] all if {![template::multirow exists script]} { template::multirow create script type src charset defer content @@ -115,20 +126,19 @@ if {[info exists acs_blank_master__htmlareas] && [llength $acs_blank_master__htmlareas] > 0} { - # # Add RTE scripts if we are using RTE # if {[info exists acs_blank_master(rte)]} { foreach htmlarea_id [lsort -unique $acs_blank_master__htmlareas] { - lappend body(onload) "acs_rteInit('${htmlarea_id}')" + lappend body(onload) "acs_rteInit('${htmlarea_id}')" } - + template::multirow append script \ "text/javascript" \ "/resources/acs-templating/rte/richtext.js" } - + # # Add Xinha scripts if we are using Xinha # @@ -146,16 +156,13 @@ template::multirow append script "text/javascript" {} {} {} " _editor_url = \"$xinha_dir\"; _editor_lang = \"$xinha_lang\";" - + template::multirow append script \ "text/javascript" \ "${xinha_dir}htmlarea.js" } } - - - #ad_page_contract { blank-master #} @@ -167,9 +174,9 @@ set doc(charset) [ad_conn charset] } -# The document language is always set from [ad_conn lang] which by default -# returns the language setting for the current user. This is probably -# not a bad guess, but the rest of OpenACS must override this setting when +# The document language is always set from [ad_conn lang] which by default +# returns the language setting for the current user. This is probably not a +# bad guess, but the rest of OpenACS must override this setting when # appropriate and set the lang attribute of tags which differ from the language # of the page. Otherwise we are lying to the browser. set doc(lang) [ad_conn language] @@ -184,7 +191,8 @@ if {![template::multirow exists script]} { template::multirow create script type src charset defer content } -template::multirow append script text/javascript /resources/acs-subsite/core.js "" "" "" +template::multirow append script text/javascript \ + /resources/acs-subsite/core.js "" "" "" if {![template::multirow exists body_script]} { template::multirow create body_script type src charset defer content @@ -234,14 +242,16 @@ if { [ad_conn untrusted_user_id] == 0 } { set user_name {} } else { - set user_name [acs_user::get_element -user_id [ad_conn untrusted_user_id] -element name] + set user_name [acs_user::get_element -user_id [ad_conn untrusted_user_id] \ + -element name] } if {![exists_and_not_null title]} { set title [ad_system_name] } -if {[empty_string_p [dotlrn_community::get_parent_community_id -package_id [ad_conn package_id]]]} { +if {[empty_string_p [dotlrn_community::get_parent_community_id \ + -package_id [ad_conn package_id]]]} { set parent_comm_p 0 } else { set parent_comm_p 1 @@ -261,23 +271,22 @@ if { ![template::util::is_nil focus] } { # Handle elements wohse name contains a dot if { [regexp {^([^.]*)\.(.*)$} $focus match form_name element_name] } { - + # Add safety code to test that the element exists ' append header_stuff " - " - + " template::multirow append \ - attribute onload "javascript:acs_focus('${form_name}', '${element_name}')" + attribute onload \ + "javascript:acs_focus('${form_name}', '${element_name}')" } } Index: openacs-4/packages/imsld/sql/postgresql/imsld-level-c-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/sql/postgresql/imsld-level-c-create.sql,v diff -u -N -r1.3 -r1.3.4.1 --- openacs-4/packages/imsld/sql/postgresql/imsld-level-c-create.sql 23 Jan 2007 11:33:48 -0000 1.3 +++ openacs-4/packages/imsld/sql/postgresql/imsld-level-c-create.sql 27 Jun 2007 10:21:58 -0000 1.3.4.1 @@ -18,8 +18,7 @@ not null, activity_id integer constraint imsld_notif_act_fk - references cr_items --imsld_learning_activities/imsld_support_activities - not null, + references cr_items, --imsld_learning_activities/imsld_support_activities subject text ); Index: openacs-4/packages/imsld/tcl/imsld-condition-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-condition-procs.tcl,v diff -u -N -r1.24 -r1.24.4.1 --- openacs-4/packages/imsld/tcl/imsld-condition-procs.tcl 25 Apr 2007 10:52:30 -0000 1.24 +++ openacs-4/packages/imsld/tcl/imsld-condition-procs.tcl 27 Jun 2007 10:21:58 -0000 1.24.4.1 @@ -260,7 +260,7 @@ where complete_act_id = :complete_act_item_id and content_revision__is_live(activity_id) = 't' }] } { - # mark the act completed for all the users in the run + # mark the learning activity completed for all the users in the run set role_part_id_list [imsld::get_role_part_from_activity -activity_type learning -leaf_id $activity_item_id] set users_in_run [db_list get_users_in_run { @@ -302,7 +302,7 @@ where complete_act_id = :complete_act_item_id and content_revision__is_live(activity_id) = 't' }] } { - # mark the act completed for all the users in the run + # mark the support activity completed for all the users in the run set role_part_id_list [imsld::get_role_part_from_activity -activity_type learning -leaf_id $activity_item_id] set users_in_run [db_list get_users_in_run { @@ -373,7 +373,7 @@ where complete_act_id = :complete_act_item_id and content_revision__is_live(play_id) = 't' }] } { - # mark the act completed for all the users in the run + # mark the play completed for all the users in the run set users_in_run [db_list get_users_in_run { select gmm.member_id from group_member_map gmm, Index: openacs-4/packages/imsld/tcl/imsld-instance-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-instance-procs.tcl,v diff -u -N -r1.13.4.4 -r1.13.4.5 --- openacs-4/packages/imsld/tcl/imsld-instance-procs.tcl 26 Jun 2007 16:34:05 -0000 1.13.4.4 +++ openacs-4/packages/imsld/tcl/imsld-instance-procs.tcl 27 Jun 2007 10:21:58 -0000 1.13.4.5 @@ -156,8 +156,7 @@ identifier, datatype, initial_value, - title, - item_id as property_item_id + title from imsld_propertiesi where component_id = :component_item_id and type = 'loc' @@ -176,7 +175,7 @@ [list identifier $identifier] \ [list property_id $property_id]] \ -content_type imsld_property_instance \ - -title $identifier \ + -title $title \ -parent_id [expr [string eq $datatype "file"] ? $run_folder_id : $cr_folder_id]] if { [string eq $datatype "file"] } { @@ -192,8 +191,7 @@ identifier, datatype, initial_value, - title, - item_id as property_item_id + title from imsld_propertiesi where component_id = :component_item_id and type = 'locpers' @@ -203,7 +201,7 @@ set identifier [lindex $property_list 1] set datatype [lindex $property_list 2] set initial_value [lindex $property_list 3] - set property_item_id [lindex $property_list 4] + set title [lindex $property_list 4] db_foreach user_in_run { select ar.object_id_two as party_id from acs_rels ar @@ -225,7 +223,7 @@ [list party_id $party_id] \ [list property_id $property_id]] \ -content_type imsld_property_instance \ - -title $identifier \ + -title $title \ -parent_id [expr [string eq $datatype "file"] ? $run_folder_id : $cr_folder_id]] if { [string eq $datatype "file"] } { # initialize the file to an empty one so the fs doesn't generate an error when requesting the file @@ -235,14 +233,14 @@ } } - # 3. locrole-property: Instantiate the property for each role associated to the run + # 3. locrole-property: Instantiate the property for each role associated to + # the run db_foreach locrole_property { select property_id, identifier, datatype, initial_value, - title, - item_id as property_item_id + title from imsld_propertiesi where component_id = :component_item_id and type = 'locrole' @@ -275,7 +273,7 @@ [list party_id $party_id] \ [list property_id $property_id]] \ -content_type imsld_property_instance \ - -title $identifier \ + -title $title \ -parent_id [expr [string eq $datatype "file"] ? $run_folder_id : $cr_folder_id]] if { [string eq $datatype "file"] } { # initialize the file to an empty one so the fs doesn't generate an error when requesting the file @@ -297,8 +295,7 @@ initial_value, existing_href, uri, - title, - item_id as property_item_id + title from imsld_propertiesi where component_id = :component_item_id and type = 'globpers' @@ -310,7 +307,7 @@ set initial_value [lindex $property_list 3] set existing_href [lindex $property_list 4] set uri [lindex $property_list 5] - set property_item_id [lindex $property_list 6] + set title [lindex $property_list 6] db_foreach user_in_run { select ar.object_id_two as party_id from acs_rels ar @@ -337,7 +334,7 @@ [list party_id $party_id] \ [list property_id $property_id]] \ -content_type imsld_property_instance \ - -title $identifier \ + -title $title \ -parent_id [expr [string eq $datatype "file"] ? $global_folder_id : $cr_folder_id]] if { [string eq $datatype "file"] } { # initialize the file to an empty one so the fs doesn't generate an error when requesting the file @@ -347,17 +344,16 @@ } } - # 5. glob-property: Special case, just like the one above but with the difference that the checking - # is not done for all the users + # 5. glob-property: Special case, just like the one above but with the + # difference that the checking is not done for all the users db_foreach global_property { select property_id, identifier, datatype, initial_value, existing_href, uri, - title, - item_id as property_item_id + title from imsld_propertiesi where component_id = :component_item_id and type = 'global' @@ -369,20 +365,25 @@ where identifier = :identifier and content_revision__is_live(instance_id) = 't' }] } { - # not instantiated... is it already defined (existing href)? or must we use the one of the global definition? + # not instantiated... is it already defined (existing href)? or + # must we use the one of the global definition? if { ![string eq $existing_href ""] } { # it is already defined - # NOTE: there must be a better way to deal with this, but by the moment we treat the href as the property value + # NOTE: there must be a better way to deal with this, but by + # the moment we treat the href as the property value set initial_value $existing_href } - # TODO: the property must be somehow instantiated in the given URI also + # TODO: the property must be somehow instantiated in the given URI + # also set instance_id [imsld::item_revision_new -attributes [list [list value $initial_value] \ [list identifier $identifier] \ [list property_id $property_id]] \ -content_type imsld_property_instance \ + -title $title \ -parent_id [expr [string eq $datatype "file"] ? $global_folder_id : $cr_folder_id]] if { [string eq $datatype "file"] } { - # initialize the file to an empty one so the fs doesn't generate an error when requesting the file + # initialize the file to an empty one so the fs doesn't + # generate an error when requesting the file imsld::fs::empty_file -revision_id [content::item::get_live_revision -item_id $instance_id] } } Index: openacs-4/packages/imsld/tcl/imsld-monitor-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-monitor-procs.tcl,v diff -u -N -r1.2.4.1 -r1.2.4.2 --- openacs-4/packages/imsld/tcl/imsld-monitor-procs.tcl 14 Jun 2007 14:24:25 -0000 1.2.4.1 +++ openacs-4/packages/imsld/tcl/imsld-monitor-procs.tcl 27 Jun 2007 10:21:58 -0000 1.2.4.2 @@ -67,30 +67,20 @@ db_1row get_sort_order { select sort_order from imsld_as_la_rels where rel_id = :rel_id } - set activity_node [$dom_doc createElement li] - $activity_node setAttribute class "liOpen" - set a_node [$dom_doc createElement a] - $a_node setAttribute href "[export_vars -base "activity-frame" -url {activity_id run_id {type "learning"}}]" - $a_node setAttribute target "content" - set text [$dom_doc createTextNode "$activity_title"] - $a_node appendChild $text - $activity_node appendChild $a_node - - set text [$dom_doc createTextNode " "] - $activity_node appendChild $text + set activity_node [imsld::monitor::link_to_visitors_info \ + -dom_doc $dom_doc \ + -title $activity_title \ + -href "[export_vars -base "activity-frame" -url {activity_id run_id {type "learning"}}]" \ + -run_id $run_id \ + -revision_id $activity_id \ + -type "activity"] - set info_node [$dom_doc createElement a] - $info_node setAttribute href "[export_vars -base "activity-frame" -url {activity_id run_id {type "learning"}}]" - $info_node setAttribute target "content" - set text [$dom_doc createTextNode "([imsld::monitor::number_of_visitors -run_id $run_id -revision_id $activity_id -type "activity"])"] - $info_node appendChild $text - $activity_node appendChild $info_node - - set completed_list [linsert $completed_list $sort_order [$activity_node asList]] + set completed_list [linsert $completed_list \ + $sort_order [$activity_node asList]] } imsld_as_sa_rel { - # add the activiti to the TCL list + # add the activity to the TCL list db_1row get_support_activity_info { select sa.title as activity_title, sa.item_id as activity_item_id, @@ -104,25 +94,14 @@ select sort_order from imsld_as_sa_rels where rel_id = :rel_id } - set activity_node [$dom_doc createElement li] - $activity_node setAttribute class "liOpen" - set a_node [$dom_doc createElement a] - $a_node setAttribute href "[export_vars -base "activity-frame" -url {activity_id run_id {type "support"}}]" - $a_node setAttribute target "content" - set text [$dom_doc createTextNode "$activity_title"] - $a_node appendChild $text - $activity_node appendChild $a_node + set activity_node [imsld::monitor::link_to_visitors_info \ + -dom_doc $dom_doc \ + -title $activity_title \ + -href "[export_vars -base "activity-frame" -url {activity_id run_id {type "support"}}]" \ + -run_id $run_id \ + -revision_id $activity_id \ + -type "activity"] - set text [$dom_doc createTextNode " "] - $activity_node appendChild $text - - set info_node [$dom_doc createElement a] - $info_node setAttribute href "[export_vars -base "activity-frame" -url {activity_id run_id {type "support"}}]" - $info_node setAttribute target "content" - set text [$dom_doc createTextNode "([imsld::monitor::number_of_visitors -run_id $run_id -revision_id $activity_id -type "activity"])"] - $info_node appendChild $text - $activity_node appendChild $info_node - set completed_list [linsert $completed_list $sort_order [$activity_node asList]] } imsld_as_as_rel { @@ -139,25 +118,15 @@ select sort_order from imsld_as_as_rels where rel_id = :rel_id } - set structure_node [$dom_doc createElement li] - $structure_node setAttribute class "liOpen" - set a_node [$dom_doc createElement a] - $a_node setAttribute href "[export_vars -base "activity-frame" -url {structure_id run_id {type "structure"}}]" - $a_node setAttribute target "content" - set text [$dom_doc createTextNode "$activity_title"] - $a_node appendChild $text - $structure_node appendChild $a_node + set structure_node [imsld::monitor::link_to_visitors_info \ + -dom_doc $dom_doc \ + -title $activity_title \ + -href "[export_vars -base "activity-frame" \ + -url {{activity_id "$structure_id"} run_id {type "structure"}}]" \ + -run_id $run_id \ + -revision_id $structure_id \ + -type "activity"] - set text [$dom_doc createTextNode " "] - $structure_node appendChild $text - - set info_node [$dom_doc createElement a] - $info_node setAttribute href "[export_vars -base "activity-frame" -url {{activity_id $structure_id} run_id {type "structure"}}]" - $info_node setAttribute target "content" - set text [$dom_doc createTextNode "([imsld::monitor::number_of_visitors -run_id $run_id -revision_id $structure_id -type "activity"])"] - $info_node appendChild $text - $structure_node appendChild $info_node - set nested_activities_list [imsld::monitor::structure_activities_list -imsld_id $imsld_id \ -run_id $run_id \ -structure_item_id $structure_item_id \ @@ -236,25 +205,15 @@ from imsld_learning_activitiesi la where activity_id = :activity_id } - set activity_node [$dom_doc createElement li] - $activity_node setAttribute class "liOpen" - set a_node [$dom_doc createElement a] - $a_node setAttribute href "[export_vars -base "activity-frame" -url {activity_id run_id {type "learning"}}]" - $a_node setAttribute target "content" - set text [$dom_doc createTextNode "$activity_title"] - $a_node appendChild $text - $activity_node appendChild $a_node - - set text [$dom_doc createTextNode " "] - $activity_node appendChild $text + set activity_node [imsld::monitor::link_to_visitors_info \ + -dom_doc $dom_doc \ + -title $activity_title \ + -href "[export_vars -base "activity-frame" \ + -url {activity_id run_id {type "learning"}}]" \ + -run_id $run_id \ + -revision_id $activity_id \ + -type "activity"] - set info_node [$dom_doc createElement a] - $info_node setAttribute href "[export_vars -base "activity-frame" -url {activity_id run_id {type "learning"}}]" - $info_node setAttribute target "content" - set text [$dom_doc createTextNode "([imsld::monitor::number_of_visitors -run_id $run_id -revision_id $activity_id -type "activity"])"] - $info_node appendChild $text - $activity_node appendChild $info_node - $dom_node appendChild $activity_node } support { @@ -267,25 +226,15 @@ from imsld_support_activitiesi sa where sa.activity_id = :activity_id } - set activity_node [$dom_doc createElement li] - $activity_node setAttribute class "liOpen" - set a_node [$dom_doc createElement a] - $a_node setAttribute href "[export_vars -base "activity-frame" -url {activity_id run_id {type "support"}}]" - $a_node setAttribute target "content" - set text [$dom_doc createTextNode "$activity_title"] - $a_node appendChild $text - $activity_node appendChild $a_node + set activity_node [imsld::monitor::link_to_visitors_info \ + -dom_doc $dom_doc \ + -title $activity_title \ + -href "[export_vars -base "activity-frame" \ + -url {activity_id run_id {type "support"}}]"\ + -run_id $run_id \ + -revision_id $activity_id \ + -type "activity"] - set text [$dom_doc createTextNode " "] - $activity_node appendChild $text - - set info_node [$dom_doc createElement a] - $info_node setAttribute href "[export_vars -base "activity-frame" -url {activity_id run_id {type "support"}}]" - $info_node setAttribute target "content" - set text [$dom_doc createTextNode "([imsld::monitor::number_of_visitors -run_id $run_id -revision_id $activity_id -type "activity"])"] - $info_node appendChild $text - $activity_node appendChild $info_node - $dom_node appendChild $activity_node } structure { @@ -298,25 +247,15 @@ where structure_id = :activity_id } - set structure_node [$dom_doc createElement li] - $structure_node setAttribute class "liOpen" - set a_node [$dom_doc createElement a] - $a_node setAttribute href "[export_vars -base "activity-frame" -url {activity_id run_id {type "structure"}}]" - $a_node setAttribute target "content" - set text [$dom_doc createTextNode "$activity_title"] - $a_node appendChild $text - $structure_node appendChild $a_node + set structure_node [imsld::monitor::link_to_visitors_info \ + -dom_doc $dom_doc \ + -title $activity_title \ + -href "[export_vars -base "activity-frame" \ + -url {activity_id run_id {type "structure"}}]" \ + -run_id $run_id \ + -revision_id $structure_id \ + -type "activity"] - set text [$dom_doc createTextNode " "] - $structure_node appendChild $text - - set info_node [$dom_doc createElement a] - $info_node setAttribute href "[export_vars -base "activity-frame" -url {activity_id run_id {type "structure"}}]" - $info_node setAttribute target "content" - set text [$dom_doc createTextNode "([imsld::monitor::number_of_visitors -run_id $run_id -revision_id $structure_id -type "activity"])"] - $info_node appendChild $text - $structure_node appendChild $info_node - set nested_list [imsld::monitor::structure_activities_list -imsld_id $imsld_id \ -run_id $run_id \ -structure_item_id $structure_item_id \ @@ -357,7 +296,7 @@ set a_node [$dom_doc createElement a] $a_node setAttribute href "[export_vars -base "properties-frame" -url {run_id {type "loc"}}]" $a_node setAttribute target "content" - set text [$dom_doc createTextNode "[_ imsld.1_Local_Properties]"] + set text [$dom_doc createTextNode "1. [_ imsld.Local_Properties]"] $a_node appendChild $text $local_node appendChild $a_node @@ -370,7 +309,7 @@ set a_node [$dom_doc createElement a] $a_node setAttribute href "[export_vars -base "properties-frame" -url {run_id {type "locpers"}}]" $a_node setAttribute target "content" - set text [$dom_doc createTextNode "[_ imsld.lt_2_Local-personal_Prop]"] + set text [$dom_doc createTextNode "2. [_ imsld.lt_Local-personal_Prop]"] $a_node appendChild $text $locpers_node appendChild $a_node @@ -379,8 +318,8 @@ # 3. loc-role properties: associated to each role in the run set locrole_node [$dom_doc createElement li] - $locrole_node setAttribute class "liClosed" - set text [$dom_doc createTextNode "[_ imsld.lt_3_Local-role_Properti]"] + $locrole_node setAttribute class "liOpen" + set text [$dom_doc createTextNode "3. [_ imsld.lt_Local-role_Properti]"] $a_node appendChild $text $locrole_node appendChild $text @@ -410,7 +349,7 @@ set a_node [$dom_doc createElement a] $a_node setAttribute href "[export_vars -base "properties-frame" -url {run_id {type "globpers"}}]" $a_node setAttribute target "content" - set text [$dom_doc createTextNode "[_ imsld.lt_4_Global-personal_Pro]"] + set text [$dom_doc createTextNode "4. [_ imsld.lt_Global-personal_Pro]"] $a_node appendChild $text $globpers_node appendChild $a_node @@ -423,7 +362,7 @@ set a_node [$dom_doc createElement a] $a_node setAttribute href "[export_vars -base "properties-frame" -url {run_id {type "glob"}}]" $a_node setAttribute target "content" - set text [$dom_doc createTextNode "[_ imsld.5_Global_Properties]"] + set text [$dom_doc createTextNode "5. [_ imsld.Global_Properties]"] $a_node appendChild $text $globpers_node appendChild $a_node @@ -496,23 +435,14 @@ where activity_id = :activity_id } - set activity_node [$dom_doc createElement li] - $activity_node setAttribute class "liOpen" - set a_node [$dom_doc createElement a] - $a_node setAttribute href "[export_vars -base "activity-frame" -url {activity_id run_id {type "learning"}}]" - $a_node setAttribute target "content" - set text [$dom_doc createTextNode "$activity_title"] - $a_node appendChild $text - $activity_node appendChild $a_node - - set text [$dom_doc createTextNode " "] - $activity_node appendChild $text - set info_node [$dom_doc createElement a] - $info_node setAttribute href "[export_vars -base "activity-frame" -url {activity_id run_id {type "learning"}}]" - $info_node setAttribute target "content" - set text [$dom_doc createTextNode "([imsld::monitor::number_of_visitors -run_id $run_id -revision_id $activity_id -type "activity"])"] - $info_node appendChild $text - $activity_node appendChild $info_node + set activity_node [imsld::monitor::link_to_visitors_info \ + -dom_doc $dom_doc \ + -title $activity_title \ + -href "[export_vars -base "activity-frame" \ + -url {activity_id run_id {type "learning"}}]"\ + -run_id $run_id \ + -revision_id $activity_id \ + -type "activity"] $dom_node appendChild $activity_node } @@ -527,25 +457,15 @@ where sa.activity_id = :activity_id } - set activity_node [$dom_doc createElement li] - $activity_node setAttribute class "liOpen" - set a_node [$dom_doc createElement a] - $a_node setAttribute href "[export_vars -base "activity-frame" -url {activity_id run_id {type "support"}}]" - $a_node setAttribute target "content" - set text [$dom_doc createTextNode "$activity_title"] - $a_node appendChild $text - $activity_node appendChild $a_node + set activity_node [imsld::monitor::link_to_visitors_info \ + -dom_doc $dom_doc \ + -title $activity_title \ + -href "[export_vars -base "activity-frame" \ + -url {activity_id run_id {type "support"}}]"\ + -run_id $run_id \ + -revision_id $activity_id \ + -type "activity"] - set text [$dom_doc createTextNode " "] - $activity_node appendChild $text - - set info_node [$dom_doc createElement a] - $info_node setAttribute href "[export_vars -base "activity-frame" -url {activity_id run_id {type "support"}}]" - $info_node setAttribute target "content" - set text [$dom_doc createTextNode "([imsld::monitor::number_of_visitors -run_id $run_id -revision_id $activity_id -type "activity"])"] - $info_node appendChild $text - $activity_node appendChild $info_node - $dom_node appendChild $activity_node } } @@ -630,25 +550,16 @@ set resource_item_id [lindex $environments_list 1] set resource_type [lindex $environments_list 2] - set lo_node [$dom_doc createElement li] - $lo_node setAttribute class "liOpen" - set a_node [$dom_doc createElement a] - $a_node setAttribute href "[export_vars -base "activity-frame" -url {run_id learning_object_id {type learning_object}}]" - $a_node setAttribute target "content" - set text [$dom_doc createTextNode "$lo_title"] - $a_node appendChild $text - $lo_node appendChild $a_node + set lo_node [imsld::monitor::link_to_visitors_info \ + -dom_doc $dom_doc \ + -title $lo_title \ + -href "[export_vars -base "activity-frame" \ + -url {run_id learning_object_id {type learning_object}}]"\ + -run_id $run_id \ + -revision_id $learning_object_id \ + -item_id $learning_object_item_id \ + -type "learning_object"] - set text [$dom_doc createTextNode " "] - $lo_node appendChild $text - - set info_node [$dom_doc createElement a] - $info_node setAttribute href "[export_vars -base "activity-frame" -url {run_id learning_object_id {type learning_object}}]" - $info_node setAttribute target "content" - set text [$dom_doc createTextNode "([imsld::monitor::number_of_visitors -run_id $run_id -revision_id $learning_object_id -item_id $learning_object_item_id -type "learning_object"])"] - $info_node appendChild $text - $lo_node appendChild $info_node - $environment_node appendChild $lo_node } } @@ -673,25 +584,15 @@ set service_title [expr { [string eq [lindex $services_list 4] ""] ? $environment_title : [lindex $services_list 4] }] set class_name [lindex $services_list 5] - set service_node [$dom_doc createElement li] - $service_node setAttribute class "liOpen" - set a_node [$dom_doc createElement a] - $a_node setAttribute href "[export_vars -base "activity-frame" -url {run_id service_id {type service}}]" - $a_node setAttribute target "content" - set text [$dom_doc createTextNode "$service_title"] - $a_node appendChild $text - $service_node appendChild $a_node + set service_node [imsld::monitor::link_to_visitors_info \ + -dom_doc $dom_doc \ + -title $service_title \ + -href "[export_vars -base "activity-frame" \ + -url {run_id service_id {type service}}]" \ + -run_id $run_id \ + -revision_id $service_id \ + -type "service"] - set text [$dom_doc createTextNode " "] - $service_node appendChild $text - - set info_node [$dom_doc createElement a] - $info_node setAttribute href "[export_vars -base "activity-frame" -url {run_id service_id {type service}}]" - $info_node setAttribute target "content" - set text [$dom_doc createTextNode "([imsld::monitor::number_of_visitors -run_id $run_id -revision_id $service_id -type "service"])"] - $info_node appendChild $text - $service_node appendChild $info_node - $environment_node appendChild $service_node } @@ -928,3 +829,61 @@ } return $number_of_visitors } + +ad_proc -public imsld::monitor::link_to_visitors_info { + -dom_doc:required + -title:required + -href:required + -run_id:required + -revision_id:required + -type:required + -item_id +} { + @param dom_doc:required + @param href:required + @param run_id:required + @param revision_id:required + @param type:required + @param item_id + +

+ Adds to the given lo_node a link to the number of users visiting the + activity in activity_id/run_id +

+} { + set result [$dom_doc createElement li] + $result setAttribute class "liOpen" + + set a_node [$dom_doc createElement a] + $a_node setAttribute href $href + $a_node setAttribute target "content" + $result appendChild $a_node + + set text [$dom_doc createTextNode "$title "] + $a_node appendChild $text + + if { $type == "learning_object" } { + set visitors [imsld::monitor::number_of_visitors \ + -run_id $run_id \ + -revision_id $revision_id \ + -item_id $item_id \ + -type $type] + } else { + set visitors [imsld::monitor::number_of_visitors \ + -run_id $run_id \ + -revision_id $revision_id \ + -type $type] + } + + if { $visitors > 1 } { + set text [$dom_doc createTextNode "($visitors [_ imsld.users ])"] + } elseif { $visitors > 0 } { + set text [$dom_doc createTextNode "($visitors [_ imsld.user ])"] + } else { + set text [$dom_doc createTextNode "([_ imsld.No_users ])"] + } + + $result appendChild $text + + return $result +} Index: openacs-4/packages/imsld/tcl/imsld-parse-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-parse-procs.tcl,v diff -u -N -r1.63.4.1 -r1.63.4.2 --- openacs-4/packages/imsld/tcl/imsld-parse-procs.tcl 25 Jun 2007 17:46:54 -0000 1.63.4.1 +++ openacs-4/packages/imsld/tcl/imsld-parse-procs.tcl 27 Jun 2007 10:21:58 -0000 1.63.4.2 @@ -1231,7 +1231,7 @@ set lrp_datatype [string tolower [imsld::parse::get_attribute -node $lrp_datatype -attr_name datatype]] set role_ref [$locrole_property selectNodes "*\[local-name()='role-ref'\]"] - imsld::parse::validate_multiplicity -tree $lrp_datatype -multiplicity 1 -element_name "locrole-property role" -equal + imsld::parse::validate_multiplicity -tree $role_ref -multiplicity 1 -element_name "locrole-property role" -equal set ref [imsld::parse::get_attribute -node $role_ref -attr_name ref] if { ![db_0or1row get_role_id { select item_id as role_id @@ -1320,7 +1320,7 @@ set g_existing [$glob_property selectNodes "*\[local-name()='existing'\]"] imsld::parse::validate_multiplicity -tree $g_existing -multiplicity 1 -element_name "existing(glob)" -lower_than if { [llength $g_existing] } { - set g_existing_href [imsld::parse::get_attribute -node $g_exiting -attr_name href] + set g_existing_href [imsld::parse::get_attribute -node $g_existing -attr_name href] } else { set g_existing_href "" } @@ -1649,7 +1649,8 @@ [list parameters $parameters] \ [list service_type send-mail]] \ -content_type imsld_service \ - -parent_id $parent_id] + -parent_id $parent_id \ + -title $title] # create the send mail service set send_mail_id [imsld::item_revision_new -attributes [list [list service_id $service_id] \ [list is_visible_p $is_visible_p] \ @@ -1754,19 +1755,20 @@ [list parameters $parameters] \ [list service_type conference]] \ -content_type imsld_service \ - -parent_id $parent_id] + -parent_id $parent_id \ + -title $title] if { [string eq $conference_type "asynchronous"] } { - set moderator_list [$conference selectNodes "*\[local-name()='moderator'\]"] - if { [llength $moderator_list] } { - set acs_object_id [imsld::parse::parse_and_create_forum -name $title -is_moderated] - - } else { - set acs_object_id [imsld::parse::parse_and_create_forum -name $title] - } + set moderator_list [$conference selectNodes "*\[local-name()='moderator'\]"] + if { [llength $moderator_list] } { + set acs_object_id [imsld::parse::parse_and_create_forum -name $title -is_moderated] + + } else { + set acs_object_id [imsld::parse::parse_and_create_forum -name $title] + } - + set resource_id [imsld::cp::resource_new -manifest_id $manifest_id \ -identifier "forumresource-$service_id" \ -type "forum" \ @@ -1785,7 +1787,7 @@ # map item with resource relation_add imsld_item_res_rel $imsld_item_id $resource_id - + } else { # item set conference_item [$conference selectNodes "*\[local-name()='item'\]"] @@ -1902,7 +1904,8 @@ [list service_type monitor]] \ -title $title \ -content_type imsld_service \ - -parent_id $parent_id] + -parent_id $parent_id \ + -title $title] # monitor: role-ref set role_ref [$monitor_service selectNodes "*\[local-name()='role-ref'\]"] 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 -N -r1.95.2.4 -r1.95.2.5 --- openacs-4/packages/imsld/tcl/imsld-procs.tcl 26 Jun 2007 16:34:05 -0000 1.95.2.4 +++ openacs-4/packages/imsld/tcl/imsld-procs.tcl 27 Jun 2007 10:21:58 -0000 1.95.2.5 @@ -511,6 +511,7 @@ mark the act as finished, as well as all the referenced role_parts } { set user_id [expr { [string eq "" $user_id] ? [ad_conn user_id] : $user_id }] + if { [imsld::act_finished_p -run_id $run_id -act_id $act_id -user_id $user_id] } { return } @@ -530,6 +531,7 @@ and content_revision__is_live(rp.role_part_id) = 't' }] { set role_part_id [lindex $referenced_role_part 0] + imsld::mark_role_part_finished -role_part_id $role_part_id \ -act_id $act_id \ -play_id $play_id \ @@ -775,10 +777,10 @@ } { set user_id [expr { [string eq "" $user_id] ? [ad_conn user_id] : $user_id }] - # notifications - # according to the spec: "The implementation should ensure that a user receives one notification only, - # even if the user is a member of several roles targeted by the notification", that's why we use the list - # notified_users_list and check before sending the notification. + # notifications according to the spec: "The implementation should ensure + # that a user receives one notification only, even if the user is a member + # of several roles targeted by the notification", that's why we use the + # list notified_users_list and check before sending the notification. set community_id [dotlrn_community::get_community_id] set community_name [dotlrn_community::get_community_name $community_id] set community_url [ns_conn location][dotlrn_community::get_community_url $community_id] @@ -919,10 +921,12 @@ regexp {finish-component-element-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([a-z]+).imsld$} $url match imsld_id run_id play_id act_id role_part_id element_id type } if { ![db_0or1row marked_as_started { *SQL* }] } { - # NOTE: this should not happen... UNLESS the activity is marked as finished automatically + # NOTE: this should not happen... UNLESS the activity is marked as + # finished automatically db_dml mark_element_started { *SQL* } } - # now that we have the necessary info, mark the finished element completed and return + # now that we have the necessary info, mark the finished element completed + # and return db_dml insert_element_entry { *SQL* } switch $type { @@ -1064,13 +1068,19 @@ } } - # we continue with A LOT of validations (in order to support the when-xxx-finished tag of the spec + # we continue with A LOT of validations (in order to support the + # when-xxx-finished tag of the spec # -- with xxx in (role_part,act,play)): - # 1. let's see if the finished activity triggers the ending of the role_part - # 2. let's see if the finished role_part triggers the ending of the act which references it. - # 3. let's see if the finished act triggers the ending the play which references it - # 4. let's see if the finished play triggers the ending of the method which references it. + # 1. let's see if the finished activity triggers the ending of the + # role_part + # 2. let's see if the finished role_part triggers the ending of the act + # which references it. + # 3. let's see if the finished act triggers the ending the play which + # references it + # 4. let's see if the finished play triggers the ending of the method which + # references it. set role_part_id_list [imsld::get_role_part_from_activity -activity_type $type -leaf_id [db_string get_item_id { select item_id from cr_revisions where revision_id = :element_id}]] + foreach role_part_id $role_part_id_list { db_1row context_info { select acts.act_id, @@ -2254,6 +2264,7 @@ -resource_mode $resource_mode \ -dom_node $dom_node \ -dom_doc $dom_doc + } elseif { [db_0or1row is_support { select 1 from imsld_support_activitiesi where item_id = :activity_item_id }] } { @@ -2446,7 +2457,9 @@ } } } - if { [llength $linear_item_list ] > 0 } { $dom_node appendChild $description_node } + if { [llength $linear_item_list ] > 0 } { + $dom_node appendChild $description_node + } # prerequisites set prerequisites_node [$dom_doc createElement div] @@ -2879,6 +2892,7 @@ set role_part_id [lindex $role_part_list 2] set act_id [lindex $role_part_list 3] set play_id [lindex $role_part_list 4] + switch $type { learning { # add the learning activity to the tree @@ -3909,5 +3923,6 @@ } } } + ad_register_proc GET /finish-component-element* imsld::finish_component_element ad_register_proc POST /finish-component-element* imsld::finish_component_element Index: openacs-4/packages/imsld/tcl/imsld-runtime-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-runtime-procs.tcl,v diff -u -N -r1.16.4.3 -r1.16.4.4 --- openacs-4/packages/imsld/tcl/imsld-runtime-procs.tcl 26 Jun 2007 16:34:05 -0000 1.16.4.3 +++ openacs-4/packages/imsld/tcl/imsld-runtime-procs.tcl 27 Jun 2007 10:21:58 -0000 1.16.4.4 @@ -45,17 +45,20 @@ # db_dml update_instance_value { *SQL* } - set instance_item_id [imsld::item_revision_new -attributes [list [list run_id $run_id] \ - [list value $value] \ - [list identifier $identifier] \ - [list party_id $party_id] \ - [list property_id $property_id]] \ - -content_type imsld_property_instance \ - -title $title \ - -item_id $item_id] + set instance_item_id \ + [imsld::item_revision_new -attributes \ + [list [list run_id $run_id] \ + [list value $value] \ + [list identifier $identifier] \ + [list party_id $party_id] \ + [list property_id $property_id]] \ + -content_type imsld_property_instance \ + -title $title \ + -item_id $item_id] if { [string eq "file" $datatype] } { - set instance_id [content::item::get_live_revision -item_id $instance_item_id] + set instance_id \ + [content::item::get_live_revision -item_id $instance_item_id] # Get the filename part of the upload file if { ![regexp {[^//\\]+$} $upload_file file_name] } { @@ -65,10 +68,13 @@ set mime_type [cr_filename_to_mime_type -create $file_name] # database_p according to the file storage parameter - set fs_package_id [site_node_apm_integration::get_child_package_id \ - -package_id [dotlrn_community::get_package_id [dotlrn_community::get_community_id]] \ - -package_key "file-storage"] - set database_p [parameter::get -parameter "StoreFilesInDatabaseP" -package_id $fs_package_id] + set fs_package_id \ + [site_node_apm_integration::get_child_package_id \ + -package_id [dotlrn_community::get_package_id \ + [dotlrn_community::get_community_id]] \ + -package_key "file-storage"] + set database_p [parameter::get -parameter \ + "StoreFilesInDatabaseP" -package_id $fs_package_id] set content_length [file size $tmpfile] if { !$database_p } { # create the new item @@ -87,7 +93,8 @@ set lob = [set __lob_id [db_string get_lob_id "select empty_lob()"]] where revision_id = :instance_id" -blob_files [list $tmpfile] - # Unfortunately, we can only calculate the file size after the lob is uploaded + # Unfortunately, we can only calculate the file size after the lob + # is uploaded db_dml lob_size { update cr_revisions set content_length = :content_length @@ -107,7 +114,8 @@ {-tmpfile ""} {-role_instance_id ""} } { - Sets a property to the given value. If some restriction is violated returns 0 and an explanation. + Sets a property to the given value. If some restriction is violated returns + 0 and an explanation. } { upvar recursivity_count recursivity_count @@ -143,9 +151,9 @@ } } - # instance info - # there are two places where this proc is called: from run-time procs or from the monitor interface - # if we are inside the monitor interface, we know the role_instance_id, otherwise we have to find it out + # instance info there are two places where this proc is called: from + # run-time procs or from the monitor interface if we are inside the monitor + # interface, we know the role_instance_id, otherwise we have to find it out if { [string eq "" $role_instance_id] && [string eq $type "locrole"] } { if { ![string eq $role_id ""] } { # find the role instance we are working on @@ -250,7 +258,8 @@ # Recursive call only if the property value has changed if { $old_value != $value } { - # There might be infinite recursive loops, so the counter recursivity_count is used to avoid crashing the server + # There might be infinite recursive loops, so the counter + # recursivity_count is used to avoid crashing the server if { ![exists_and_not_null recursivity_count] } { # this is the first recursive call, initialize the variable set recursivity_count 1 @@ -267,14 +276,14 @@ } set conditions_list [db_list get_conditions_from_property { - select ici.condition_id - from imsld_conditionsi ici, - acs_rels ar, - imsld_propertiesi ipi - where ipi.property_id = :property_id - and ipi.item_id = ar.object_id_one - and ar.rel_type = 'imsld_prop_cond_rel' - and ar.object_id_two = ici.item_id + select ici.condition_id + from imsld_conditionsi ici, + acs_rels ar, + imsld_propertiesi ipi + where ipi.property_id = :property_id + and ipi.item_id = ar.object_id_one + and ar.rel_type = 'imsld_prop_cond_rel' + and ar.object_id_two = ici.item_id }] #property conditions foreach member_id [db_list user_in_run { @@ -301,11 +310,11 @@ } # when-condition-true: - # foreach when-condition-true related with the property, evaluate the whole expression - # referenced from the table when-condition-true to all the members of the referenced role (in the same table), - # and if it's true, set the act (in the table complete-acts) completed - # n.b. this won't generate endless loops - + # foreach when-condition-true related with the property, evaluate the + # whole expression referenced from the table when-condition-true to all + # the members of the referenced role (in the same table), and if it's + # true, set the act (in the table complete-acts) completed # n.b. this + # won't generate endless loops foreach when_cond_true_item_id [db_list when_condition_true { select ar.object_id_two as when_cond_true_item_id from acs_rels ar, @@ -318,10 +327,10 @@ } # when-property-vale-is-set: - # foreach when-property-value-is-set related with the property, evaluete the expression - # and compare it with the referenced property, and if they have the same value, mark the referencer - # activity as completed - # n.b. this won't generate endless loops + # foreach when-property-value-is-set related with the property, + # evaluete the expression and compare it with the referenced property, + # and if they have the same value, mark the referencer activity as + # completed # n.b. this won't generate endless loops foreach complete_act_item_id [db_list when_prop_value_is_set { select ar.object_id_two as complete_act_item_id @@ -331,10 +340,12 @@ and ipi.item_id = ar.object_id_one and ar.rel_type = 'imsld_prop_wpv_is_rel' }] { - imsld::condition::eval_when_prop_value_is_set -complete_act_item_id $complete_act_item_id -run_id $run_id + imsld::condition::eval_when_prop_value_is_set \ + -complete_act_item_id $complete_act_item_id -run_id $run_id } - # role conditions, time conditions... the rest of conditions must be evaluated every time a property value changes + # role conditions, time conditions... the rest of conditions must be + # evaluated every time a property value changes imsld::condition::execute_time_role_conditions -run_id $run_id } } @@ -400,8 +411,8 @@ set role_instance_id [imsld::roles::get_user_role_instance -run_id $run_id -role_id $role_id -user_id $user_id] if { !$role_instance_id } { # runtime error... the user doesn't belong to any role instance - ns_log notice "User does not belong to any role instance" - continue + util_user_message -message "<#_ User does not belong to any role instance #>" + ad_script_abort } } @@ -603,7 +614,7 @@ select gmm.member_id from group_member_map gmm, imsld_run_users_group_ext iruge, - acs_rels ar1 + acs_rels ar1 where iruge.run_id=:run_id and ar1.object_id_two=iruge.group_id and ar1.object_id_one=gmm.group_id 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 -N -r1.16 -r1.16.4.1 --- openacs-4/packages/imsld/www/activity-frame.tcl 25 Apr 2007 10:52:30 -0000 1.16 +++ openacs-4/packages/imsld/www/activity-frame.tcl 27 Jun 2007 10:21:59 -0000 1.16.4.1 @@ -74,7 +74,6 @@ 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 Index: openacs-4/packages/imsld/www/environment-frame.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/environment-frame.tcl,v diff -u -N -r1.7.4.2 -r1.7.4.3 --- openacs-4/packages/imsld/www/environment-frame.tcl 14 Jun 2007 14:31:29 -0000 1.7.4.2 +++ openacs-4/packages/imsld/www/environment-frame.tcl 27 Jun 2007 10:21:59 -0000 1.7.4.3 @@ -31,7 +31,6 @@ -run_id $run_id \ -dom_node $environments_node \ -dom_doc $doc -$dom_root appendChild $environments_node_li $environments_node_li appendChild $environments_node $dom_root appendChild $environments_node_li Index: openacs-4/packages/imsld/www/properties-value-set.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/properties-value-set.tcl,v diff -u -N -r1.4.4.3 -r1.4.4.4 --- openacs-4/packages/imsld/www/properties-value-set.tcl 26 Jun 2007 16:34:06 -0000 1.4.4.3 +++ openacs-4/packages/imsld/www/properties-value-set.tcl 27 Jun 2007 10:21:59 -0000 1.4.4.4 @@ -30,15 +30,17 @@ } if { [string eq "file" $datatype] } { - imsld::runtime::property::property_value_set -run_id $run_id \ + imsld::runtime::property::property_value_set \ + -run_id $run_id \ -user_id $owner_id \ -role_instance_id $role_instance_id \ -value $instances_ids($instance_id) \ -property_id $property_id \ -upload_file $instances_ids($instance_id) \ -tmpfile $instances_ids(${instance_id}.tmpfile) } else { - imsld::runtime::property::property_value_set -run_id $run_id \ + imsld::runtime::property::property_value_set \ + -run_id $run_id \ -user_id $owner_id \ -role_instance_id $role_instance_id \ -value $instances_ids($instance_id) \ Index: openacs-4/packages/imsld/www/admin/imsld-admin-roles.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/imsld-admin-roles.adp,v diff -u -N -r1.3.4.3 -r1.3.4.4 --- openacs-4/packages/imsld/www/admin/imsld-admin-roles.adp 26 Jun 2007 16:34:06 -0000 1.3.4.3 +++ openacs-4/packages/imsld/www/admin/imsld-admin-roles.adp 27 Jun 2007 10:21:59 -0000 1.3.4.4 @@ -19,7 +19,7 @@ text-indent:-180px; margin-top:40px; } -ul { +.one-element ul { text-indent: 0px; } Index: openacs-4/packages/imsld/www/admin/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/index.adp,v diff -u -N -r1.2.4.3 -r1.2.4.4 --- openacs-4/packages/imsld/www/admin/index.adp 25 Jun 2007 17:46:54 -0000 1.2.4.3 +++ openacs-4/packages/imsld/www/admin/index.adp 27 Jun 2007 10:21:59 -0000 1.2.4.4 @@ -1,12 +1,13 @@ @page_title;noquote@ @context;noquote@ + -

+

-

#imsld.IMS-LDs_1#

- +

#imsld.IMS-LDs_1#

+
-

#imsld.Runs#

- +

#imsld.Runs#

+
Index: openacs-4/packages/imsld/www/admin/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/index.tcl,v diff -u -N -r1.14.4.3 -r1.14.4.4 --- openacs-4/packages/imsld/www/admin/index.tcl 14 Jun 2007 14:31:29 -0000 1.14.4.3 +++ openacs-4/packages/imsld/www/admin/index.tcl 27 Jun 2007 10:21:59 -0000 1.14.4.4 @@ -169,3 +169,4 @@ } } } + Index: openacs-4/packages/imsld/www/admin/monitor/activity-frame.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/monitor/activity-frame.adp,v diff -u -N -r1.2.4.3 -r1.2.4.4 --- openacs-4/packages/imsld/www/admin/monitor/activity-frame.adp 14 Jun 2007 14:31:30 -0000 1.2.4.3 +++ openacs-4/packages/imsld/www/admin/monitor/activity-frame.adp 27 Jun 2007 10:21:59 -0000 1.2.4.4 @@ -1,47 +1,12 @@ -@page_title;noquote@ -@context;noquote@ - - - - - - -#imsld.Hide# - - - -@list_header@ -

- -
- - +
@frame_header@
+ +
+ +
+ +
Index: openacs-4/packages/imsld/www/admin/monitor/activity-frame.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/monitor/activity-frame.tcl,v diff -u -N -r1.1.4.1 -r1.1.4.2 --- openacs-4/packages/imsld/www/admin/monitor/activity-frame.tcl 30 May 2007 08:06:18 -0000 1.1.4.1 +++ openacs-4/packages/imsld/www/admin/monitor/activity-frame.tcl 27 Jun 2007 10:21:59 -0000 1.1.4.2 @@ -23,15 +23,42 @@ set page_title "[_ imsld.lt_Monitoring_One_Activi]" set context [list] -set elements [list user_name \ +set elements [list portrait \ + [list label "" \ + display_template {No Portrait}] \ + user_name \ [list label "[_ imsld.Name]" \ display_template {@related_users.user_name@}] \ email \ [list label "[_ imsld.Email]"]] if { [string eq $type "learning"] || [string eq $type "support"] || [string eq $type "structure"] } { + set frame_header "[_ imsld.lt_Users_who_have_starte] " + # status directly recorded in the status table, get the info - set list_header "[_ imsld.lt_Users_who_have_starte]" + if { [string eq $type "structure"] } { + db_1row activity_info { + select title as activity_title + from imsld_activity_structuresi + where structure_id = :activity_id + } + } elseif { [string eq $type "support"] } { + db_1row activity_info { + select title as activity_title + from imsld_support_activitiesi + where activity_id = :activity_id + } + } else { + db_1row activity_info { + select title as activity_title + from imsld_learning_activitiesi + where activity_id = :activity_id + } + } + append frame_header " \"$activity_title\"" + template::multirow create related_users user_id user_name email role start_date finish_date lappend elements start_date \ [list label "[_ imsld.Start_Date]"] @@ -104,18 +131,20 @@ foreach user $users_list { template::multirow append related_users [lindex $user 0] [lindex $user 1] [lindex $user 2] [lindex $user 3] [lindex $user 4] [lindex $user 5] } - } elseif { [string eq $type "learning_object"] } { - # the environment has been viwed (finished) if the user have seen the referenced resources - set list_header "[_ imsld.lt_Users_who_have_bviewe]" + # the environment has been viwed (finished) if the user have seen the + # referenced resources + set frame_header "[_ imsld.lt_Users_who_have_bviewe]" template::multirow create related_users user_name email user_id db_1row lo_info { select item_id as learning_object_item_id, - environment_id as environment_item_id + environment_id as environment_item_id, + title as lo_title from imsld_learning_objectsi where learning_object_id = :learning_object_id } + append frame_header " \"$lo_title\"" set item_list [db_list item_linear_list { select ii.imsld_item_id @@ -154,11 +183,12 @@ } } elseif { [string eq $type "service"] } { - # currently, we support there are three types of services: 1. conference, 2. monitory and 3. send-mail - # the first two types have resources associated whereas the last one doesn't and has to be treated as a separate case + # currently, we support there are three types of services: 1. conference, + # 2. monitory and 3. send-mail the first two types have resources + # associated whereas the last one doesn't and has to be treated as a + # separate case + set frame_header "[_ imsld.lt_Users_who_have_bat_le]" - set list_header "[_ imsld.lt_Users_who_have_bat_le]" - template::multirow create related_users user_name email user_id db_1row service_info { @@ -171,7 +201,7 @@ switch $service_type { conference { - append list_header "[_ imsld.conference]" + append frame_header " [_ imsld.conference]" db_1row conference_info { select conf.conference_id, conf.conference_type, @@ -183,6 +213,7 @@ and cr.item_id = conf.imsld_item_id and content_revision__is_live(cr.live_revision) = 't' } + append frame_header " \"$conf_title\"" set related_resources [db_list conf_resources_list { select cpr.resource_id @@ -208,7 +239,7 @@ template::multirow append related_users [person::name -person_id $user_id] [party::email -party_id $user_id] $user_id } } monitor { - append list_header "[_ imsld.monitor]" + append frame_header "[_ imsld.monitor]" db_1row monitor_info { select ims.title as monitor_service_title, ims.monitor_id, @@ -249,9 +280,9 @@ } send-mail { # 1. get the users associated to the run # 2. get the users IN the run who have sent a bulk-mail message - append list_header "[_ imsld.sendmail]" + append frame_header "[_ imsld.sendmail]" - append list_header "
[_ imsld.lt_This_is_a_special_cas]" + append frame_header "
[_ imsld.lt_This_is_a_special_cas]" db_foreach user_in_run { select gmm.member_id, Index: openacs-4/packages/imsld/www/admin/monitor/choice-select.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/monitor/Attic/choice-select.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/imsld/www/admin/monitor/choice-select.adp 27 Jun 2007 10:21:59 -0000 1.1.2.1 @@ -0,0 +1,41 @@ + +
+ + @aux_pre_text;noquote@ + + + + + + + + + + + + + + + @aux_post_text;noquote@ + +
+ +
Index: openacs-4/packages/imsld/www/admin/monitor/environment-frame.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/monitor/environment-frame.adp,v diff -u -N -r1.1.4.2 -r1.1.4.3 --- openacs-4/packages/imsld/www/admin/monitor/environment-frame.adp 14 Jun 2007 14:31:30 -0000 1.1.4.2 +++ openacs-4/packages/imsld/www/admin/monitor/environment-frame.adp 27 Jun 2007 10:21:59 -0000 1.1.4.3 @@ -1,38 +1,16 @@ - - - - - - - - - - + + @page_title;noquote@ + @context;noquote@ + 1 -@environments;noquote@ +
@frame_header@
- + @environments;noquote@ - - - + Index: openacs-4/packages/imsld/www/admin/monitor/environment-frame.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/monitor/environment-frame.tcl,v diff -u -N -r1.2 -r1.2.4.1 --- openacs-4/packages/imsld/www/admin/monitor/environment-frame.tcl 25 Apr 2007 10:52:31 -0000 1.2 +++ openacs-4/packages/imsld/www/admin/monitor/environment-frame.tcl 27 Jun 2007 10:21:59 -0000 1.2.4.1 @@ -9,36 +9,28 @@ run_id:integer,notnull } +set frame_header "[_ imsld.Context_info]" +set page_title $frame_header +set context [list] + dom createDocument ul doc set dom_root [$doc documentElement] -#set environments_node_ul [$doc createElement ul] -set environments_node_li [$doc createElement li] -set text [$doc createTextNode "[_ imsld.Context_info]"] -$environments_node_li appendChild $text -set environments_node [$doc createElement ul] -$environments_node setAttribute class "mktree" -$environments_node setAttribute style "white-space: nowrap;" +# Create the ul element which will hold all the environment info +$dom_root setAttribute class "mktree" +$dom_root setAttribute style "white-space: nowrap;" -# FIX-ME: if the ul is empty, the browser shows the ul incorrectly -set text [$doc createTextNode ""] -$environments_node appendChild $text - +# Create the li nodes for each environment set activity_item_id [content::revision::item_id -revision_id $activity_id] - imsld::monitor::activity_environments_tree -activity_item_id $activity_item_id \ -run_id $run_id \ - -dom_node $environments_node \ + -dom_node $dom_root \ -dom_doc $doc -$dom_root appendChild $environments_node_li -set environments_node_li [$doc createElement li] -$environments_node_li setAttribute class "liOpen" +# Set the result only if it is not empty +if { [$dom_root hasChildNodes]} { + # Set the result + set environments [$dom_root asXML] +} -$environments_node_li appendChild $environments_node -$dom_root appendChild $environments_node_li -set environments [$dom_root asXML] - -set page_title {} -set context [list] Index: openacs-4/packages/imsld/www/admin/monitor/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/monitor/index.adp,v diff -u -N -r1.2 -r1.2.4.1 --- openacs-4/packages/imsld/www/admin/monitor/index.adp 25 Apr 2007 10:52:31 -0000 1.2 +++ openacs-4/packages/imsld/www/admin/monitor/index.adp 27 Jun 2007 10:21:59 -0000 1.2.4.1 @@ -5,10 +5,10 @@ @course_name@ - + - + Index: openacs-4/packages/imsld/www/admin/monitor/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/monitor/index.tcl,v diff -u -N -r1.1 -r1.1.4.1 --- openacs-4/packages/imsld/www/admin/monitor/index.tcl 21 Dec 2006 15:20:47 -0000 1.1 +++ openacs-4/packages/imsld/www/admin/monitor/index.tcl 27 Jun 2007 10:21:59 -0000 1.1.4.1 @@ -14,4 +14,9 @@ } -errors { } -set course_name "" +set course_name "[db_string run_name { + select obj.title + from acs_objects obj, imsld_runs ir + where obj.object_id = ir.imsld_id + and ir.run_id = :run_id}]" + Index: openacs-4/packages/imsld/www/admin/monitor/individual-report-frame.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/monitor/individual-report-frame.adp,v diff -u -N -r1.2.4.2 -r1.2.4.3 --- openacs-4/packages/imsld/www/admin/monitor/individual-report-frame.adp 4 Jun 2007 14:00:04 -0000 1.2.4.2 +++ openacs-4/packages/imsld/www/admin/monitor/individual-report-frame.adp 27 Jun 2007 10:21:59 -0000 1.2.4.3 @@ -1,49 +1,25 @@ - + @page_title;noquote@ @context;noquote@ - - + 1 - -#imsld.Hide# - - +
+ + + @frame_header;noquote@ +
-#imsld.This# +
-

- - - - - + +
+ +
+
Index: openacs-4/packages/imsld/www/admin/monitor/individual-report-frame.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/monitor/individual-report-frame.tcl,v diff -u -N -r1.1.4.1 -r1.1.4.2 --- openacs-4/packages/imsld/www/admin/monitor/individual-report-frame.tcl 30 May 2007 08:06:18 -0000 1.1.4.1 +++ openacs-4/packages/imsld/www/admin/monitor/individual-report-frame.tcl 27 Jun 2007 10:21:59 -0000 1.1.4.2 @@ -8,13 +8,53 @@ @creation-date Dic 2006 } -query { run_id:integer,notnull - member_id:integer,notnull + {member_id:integer ""} } set page_title "[_ imsld.Individual_Report]" set context [list] -set member_name [party::name -party_id $member_id] +set frame_header "[_ imsld.This]: " +# Fetch the users that are active in the run +set users_in_run [imsld::runtime::users_in_run -run_id $run_id] + +if { [llength $users_in_run] == 1 } { + set member_id [lindex $users_in_run 0] +} + +template::multirow create item_select item_id item_name + +set select_name "member_id" +set select_id "users_in_run" +set post_text "" +set selected_item "" +set select_string "" + +# If no member_id has been given, add the option pull-down menu +if { [string eq "" $member_id] } { + set select_string "[_ imsld.Select]" +} else { + # Set variable portrait_revision if user has portrait + if { [db_0or1row get_member_portrait { + select c.live_revision + from acs_rels a, cr_items c + where a.object_id_two = c.item_id + and a.object_id_one = :member_id + and a.rel_type = 'user_portrait_rel'}]} { + + set post_text "\"Portrait\"/" + } +} + +foreach user_id_in_run $users_in_run { + template::multirow append item_select $user_id_in_run \ + "[person::name -person_id $user_id_in_run]" + + if { $member_id == $user_id_in_run} { + set selected_item $member_id + } +} + set elements [list user_name \ [list label "[_ imsld.Activity_Name]" \ display_template {@related_activities.activity_name@}] \ @@ -93,4 +133,4 @@ -multirow related_activities \ -key related_id \ -no_data "[_ imsld.No_info_was_found]" \ - -elements $elements \ No newline at end of file + -elements $elements Index: openacs-4/packages/imsld/www/admin/monitor/monitor-tree.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/monitor/monitor-tree.adp,v diff -u -N -r1.2.4.3 -r1.2.4.4 --- openacs-4/packages/imsld/www/admin/monitor/monitor-tree.adp 14 Jun 2007 14:31:30 -0000 1.2.4.3 +++ openacs-4/packages/imsld/www/admin/monitor/monitor-tree.adp 27 Jun 2007 10:21:59 -0000 1.2.4.4 @@ -1,32 +1,33 @@ - - - - - - - + @page_title;noquote@ + @context;noquote@ + 1 -#imsld.Exit# -
-@properties_tree;noquote@ -@html_tree;noquote@ -@aux_html_tree;noquote@ - - + - - Index: openacs-4/packages/imsld/www/admin/monitor/monitor-tree.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/monitor/monitor-tree.tcl,v diff -u -N -r1.2.4.3 -r1.2.4.4 --- openacs-4/packages/imsld/www/admin/monitor/monitor-tree.tcl 26 Jun 2007 16:34:06 -0000 1.2.4.3 +++ openacs-4/packages/imsld/www/admin/monitor/monitor-tree.tcl 27 Jun 2007 10:21:59 -0000 1.2.4.4 @@ -12,7 +12,8 @@ set cr_root_folder_id [imsld::cr::get_root_folder -community_id $community_id] set user_id [ad_conn user_id] set imsld_package_id [site_node_apm_integration::get_child_package_id \ - -package_id [dotlrn_community::get_package_id $community_id] \ + -package_id [dotlrn_community::get_package_id \ + $community_id] \ -package_key "[imsld::package_key]"] set imsld_admin_url [export_vars -base "[lindex [site_node::get_url_from_object_id -object_id $imsld_package_id] 0]admin/"] @@ -55,9 +56,28 @@ set properties_tree "" } +# Create the link to the page to monitor user activity dom createDocument ul doc set dom_root [$doc documentElement] $dom_root setAttribute class "mktree" + +set li_node [$doc createElement li] +$dom_root appendChild $li_node +$li_node setAttribute class "liBullet" + +set a_node [$doc createElement a] +$a_node setAttribute href \ + "[export_vars -base "individual-report-frame" -url {run_id}]" +$a_node setAttribute target "content" +$a_node appendChild [$doc createTextNode "[_ imsld.User_activity_reports]"] +$li_node appendChild $a_node + +set user_activity [$dom_root asXML] + +# Create the activity tree +dom createDocument ul doc +set dom_root [$doc documentElement] +$dom_root setAttribute class "mktree" set imsld_title_node [$doc createElement li] $imsld_title_node setAttribute class "liOpen" set text [$doc createTextNode "$imsld_title"] Index: openacs-4/packages/imsld/www/admin/monitor/properties-frame.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/monitor/properties-frame.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/imsld/www/admin/monitor/properties-frame.adp 27 Jun 2007 10:21:59 -0000 1.1.2.1 @@ -0,0 +1,28 @@ + + @page_title;noquote@ + 1 + +
+ + + @frame_header;noquote@ + +
+ +
+ + +
+ @table_node;noquote@ +
+
+ Index: openacs-4/packages/imsld/www/admin/monitor/properties-frame.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/monitor/properties-frame.tcl,v diff -u -N -r1.1.4.1 -r1.1.4.2 --- openacs-4/packages/imsld/www/admin/monitor/properties-frame.tcl 25 Jun 2007 17:46:55 -0000 1.1.4.1 +++ openacs-4/packages/imsld/www/admin/monitor/properties-frame.tcl 27 Jun 2007 10:21:59 -0000 1.1.4.2 @@ -26,153 +26,102 @@ -package_key "file-storage"] set root_folder_id [fs::get_root_folder -package_id $fs_package_id] -dom createDocument html dom_doc -set dom_root [$dom_doc documentElement] -set head_node [$dom_doc createElement head] -set link_node [$dom_doc createElement link] -$link_node setAttribute rel "stylesheet" -$link_node setAttribute type "text/css" -$link_node setAttribute href "/resources/acs-templating/lists.css" -$link_node setAttribute media "all" -$head_node appendChild $link_node - -set script_node [$dom_doc createElement script] -$script_node appendChild [$dom_doc createTextNode { - function confirmValue(myform){ - myform.submit() - } -}] - -$head_node appendChild $script_node -$dom_root appendChild $head_node - -set body_node [$dom_doc createElement body] - -# prepare final output... a little bit tedious to get it "pretty" -# using the default css of openacs - # if the property type is of type locpers or globpers # we first need to specify which user will be monitorized if { [string eq $type "locpers"] || [string eq $type "globpers"] } { - set form_node [$dom_doc createElement form] - $form_node setAttribute name "choose" - $form_node setAttribute action "" - set select_node [$dom_doc createElement select] - $select_node setAttribute name "user_id" - $select_node setAttribute id "users_in_run" - $select_node setAttribute onChange "confirmValue(this.form)" + # Fetch the users that are active in the run + set users_in_run [imsld::runtime::users_in_run -run_id $run_id] - if { [string eq "" $user_id] } { - set option_node [$dom_doc createElement option] - $option_node setAttribute value "select" - set text [$dom_doc createTextNode "[_ imsld.Select]"] - $option_node appendChild $text - $select_node appendChild $option_node + template::multirow create item_select item_id item_name + + # Add the frame main title depending on the type of property + if { [string eq $type "locpers"] } { + set frame_header "[_ imsld.lt_Local-personal_Prop]: " + } else { + set frame_header "[_ imsld.lt_Global-personal_Pro]: " } - foreach user_id_in_run [imsld::runtime::users_in_run -run_id $run_id] { - set option_node [$dom_doc createElement option] - $option_node setAttribute value $user_id_in_run - set text [$dom_doc createTextNode "[person::name -person_id $user_id_in_run]"] - $option_node appendChild $text + if { [llength $users_in_run] == 1 } { + set user_id [lindex $users_in_run 0] + } + set select_name "user_id" + set select_id "users_in_run" + set post_text "" + set selected_item "" + set select_string "" + + # If no user has been given, add the option pull-down menu + if { [string eq "" $user_id] } { + set select_string "[_ imsld.Select]" + } else { + # Set variable portrait_revision if user has portrait + if { [db_0or1row get_member_portrait { + select c.live_revision + from acs_rels a, cr_items c + where a.object_id_two = c.item_id + and a.object_id_one = :user_id + and a.rel_type = 'user_portrait_rel'}]} { + + set post_text "\"Portrait\"/" + } + } + + foreach user_id_in_run $users_in_run { + template::multirow append item_select $user_id_in_run \ + "[person::name -person_id $user_id_in_run]" + if { $user_id == $user_id_in_run} { - $option_node setAttribute selected "selected" + set selected_item $user_id } - $select_node appendChild $option_node } - $form_node appendChild $select_node +} elseif { [string eq $type "locrole"] } { + # first, the role instance must be selected + set role_instance_ids [imsld::roles::get_role_instances \ + -role_id $role_id \ + -run_id $run_id] - # adding hidden variables - set type_node [$dom_doc createElement "input"] - $type_node setAttribute name "type" - $type_node setAttribute type "hidden" - $type_node setAttribute value "$type" - $form_node appendChild $type_node + template::multirow create item_select item_id item_name - set run_id_node [$dom_doc createElement "input"] - $run_id_node setAttribute name "run_id" - $run_id_node setAttribute type "hidden" - $run_id_node setAttribute value "$run_id" - $form_node appendChild $run_id_node + set frame_header "[_ imsld.lt_Local-role_Properti]: " + set page_title $frame_header - # adding the submit button - set submit_node [$dom_doc createElement "input"] - $submit_node setAttribute type "submit" - $submit_node setAttribute value "ok" - $submit_node setAttribute name "ok" - $form_node appendChild $submit_node + if { [llength $role_instance_ids] == 1 } { + set role_instance_id [lindex $role_instance_ids 0] + set role_name "[db_string role_instance_name { select acs_group__name(:role_instance_id) }]" + } - # done... add the form to the document - $body_node appendChild $form_node + set select_name "role_instance_id" + set select_id "roles_in_run" + set post_text "" + set selected_item "" + set select_string "" -} elseif { [string eq $type "locrole"] } { - - # first, the role instance must be selected - - set form_node [$dom_doc createElement form] - $form_node setAttribute name "choose" - $form_node setAttribute action "" - set select_node [$dom_doc createElement select] - $select_node setAttribute name "role_instance_id" - $select_node setAttribute id "roles_in_run" - $select_node setAttribute onChange "confirmValue(this.form)" - if { [string eq "" $role_instance_id] } { - set option_node [$dom_doc createElement option] - $option_node setAttribute value "select" - set text [$dom_doc createTextNode "[_ imsld.Select_role]"] - $option_node appendChild $text - $select_node appendChild $option_node + set select_string "[_ imsld.Select_role]" } + + foreach role_instance_id_in_role $role_instance_ids { + template::multirow append item_select $role_instance_id_in_role \ + "[db_string role_instance_name {select + acs_group__name(:role_instance_id_in_role) }]" - foreach role_instance_id_in_role [imsld::roles::get_role_instances -role_id $role_id -run_id $run_id] { - set option_node [$dom_doc createElement option] - $option_node setAttribute value $role_instance_id_in_role - set text [$dom_doc createTextNode "[db_string role_instance_name { select acs_group__name(:role_instance_id_in_role) }]"] - $option_node appendChild $text - if { $role_instance_id == $role_instance_id_in_role } { - $option_node setAttribute selected "selected" + set selected_item $role_instance_id } - $select_node appendChild $option_node } - $form_node appendChild $select_node - #adding hidden variables - set type_node [$dom_doc createElement "input"] - $type_node setAttribute name "type" - $type_node setAttribute type "hidden" - $type_node setAttribute value "$type" - $form_node appendChild $type_node +} elseif { [string eq $type "glob"] } { + set frame_header "[_ imsld.Global_Properties]" +} elseif { [string eq $type "loc"] } { + set frame_header "[_ imsld.Local_Properties]" +} - set run_id_node [$dom_doc createElement "input"] - $run_id_node setAttribute name "run_id" - $run_id_node setAttribute type "hidden" - $run_id_node setAttribute value "$run_id" - $form_node appendChild $run_id_node - - set role_id_node [$dom_doc createElement "input"] - $role_id_node setAttribute name "role_id" - $role_id_node setAttribute type "hidden" - $role_id_node setAttribute value "$role_id" - $form_node appendChild $role_id_node - - # adding the submit button - set submit_node [$dom_doc createElement "input"] - $submit_node setAttribute type "submit" - $submit_node setAttribute value "ok" - $submit_node setAttribute name "ok" - $form_node appendChild $submit_node - - # done... add the form to the document - $body_node appendChild $form_node - -} - -set table_node [$dom_doc createElement table] -$table_node setAttribute class list +# Create the table with the properties +dom createDocument table dom_doc +set table_node [$dom_doc documentElement] +$table_node setAttribute class list-table $table_node setAttribute cellpadding 3 $table_node setAttribute cellspacing 1 @@ -217,7 +166,7 @@ prop.datatype, prop.item_id as property_item_id, coalesce(ins.value, prop.initial_value) as value, - ins.title, + coalesce(ins.title, ins.identifier) as title, ins.instance_id from imsld_property_instancesx ins, cr_revisions cr, @@ -226,6 +175,7 @@ and $where_clause and cr.revision_id = ins.instance_id and content_revision__is_live(ins.instance_id) = 't' + order by title " { # if the property is of type file, we must provide a file-upload field set input_text_node "" @@ -348,6 +298,7 @@ $submit_node setAttribute type "submit" $submit_node setAttribute value "ok" $form_node appendChild $submit_node + # done... add the form to the table set td_node [$dom_doc createElement td] $td_node setAttribute class list @@ -368,14 +319,13 @@ $table_node appendChild $tr_node } -$body_node appendChild $table_node -$dom_root appendChild $body_node +# Render table only if user_id or role_instance_id is set +if { ![string eq "" $user_id] || ![string eq "" $role_instance_id] + || [string eq $type "glob"] || [string eq $type "loc"]} { + set table_node [$table_node asXML] +} else { + set table_node "" +} -set script_node [$dom_doc createElement script] -$script_node appendChild [$dom_doc createTextNode {document.forms['choose'].elements['ok'].style.display="none"}] +set page_title $frame_header -$dom_root appendChild $script_node - -set xmloutput {} -append xmloutput [$dom_root asXML] -ns_return 200 text/html $xmloutput Index: openacs-4/packages/imsld/www/admin/monitor/run-info.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/monitor/run-info.adp,v diff -u -N -r1.1.4.1 -r1.1.4.2 --- openacs-4/packages/imsld/www/admin/monitor/run-info.adp 14 Jun 2007 14:31:30 -0000 1.1.4.1 +++ openacs-4/packages/imsld/www/admin/monitor/run-info.adp 27 Jun 2007 10:21:59 -0000 1.1.4.2 @@ -1,30 +1,38 @@ - + - + - + - - - -

#imsld.Runinfo_Name# @imsld_title@ #imsld._Assigned_users# @number_of_members@ #imsld._Creation_Date# @creation_date@ #imsld._Status_The_run_is# @status@ #imsld.since# @status_date@

- + + + +

+ #imsld.Runinfo_Name# + @imsld_title@ #imsld._Assigned_users# + @number_of_members@ #imsld._Creation_Date# + @creation_date@ #imsld._Status_The_run_is# + @status@ #imsld.since# + @status_date@ +

+ Index: openacs-4/packages/imsld/www/admin/monitor/run-info.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/monitor/run-info.tcl,v diff -u -N -r1.1 -r1.1.4.1 --- openacs-4/packages/imsld/www/admin/monitor/run-info.tcl 21 Dec 2006 15:20:47 -0000 1.1 +++ openacs-4/packages/imsld/www/admin/monitor/run-info.tcl 27 Jun 2007 10:21:59 -0000 1.1.4.1 @@ -33,4 +33,4 @@ where iruge.run_id=:run_id and ar1.object_id_two=iruge.group_id and ar1.object_id_one=gmm.group_id -} \ No newline at end of file +} Index: openacs-4/packages/imsld/www/resources/imsld.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/resources/imsld.css,v diff -u -N -r1.1.2.5 -r1.1.2.6 --- openacs-4/packages/imsld/www/resources/imsld.css 26 Jun 2007 16:34:06 -0000 1.1.2.5 +++ openacs-4/packages/imsld/www/resources/imsld.css 27 Jun 2007 10:21:59 -0000 1.1.2.6 @@ -44,7 +44,7 @@ margin:0px; } -ul { +ul.mktree, ul.mktree ul { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; @@ -82,3 +82,7 @@ left:0px; } +.centered-table table { + margin-right: auto; + margin-left: auto +}