Index: openacs-4/packages/imsld/lib/imsld-chunk.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/lib/imsld-chunk.adp,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/imsld/lib/imsld-chunk.adp 25 Nov 2005 12:11:35 -0000 1.6
+++ openacs-4/packages/imsld/lib/imsld-chunk.adp 19 Apr 2006 16:29:19 -0000 1.7
@@ -1,15 +1,2 @@
-
-
-
-
-
-
Index: openacs-4/packages/imsld/lib/imsld-chunk.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/lib/imsld-chunk.tcl,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/imsld/lib/imsld-chunk.tcl 22 Feb 2006 16:09:39 -0000 1.6
+++ openacs-4/packages/imsld/lib/imsld-chunk.tcl 19 Apr 2006 16:29:19 -0000 1.7
@@ -1,40 +1,51 @@
# imsld/lib/imsld-chunk.tcl
-ad_page_contract {
- @author jopez@inv.it.uc3m.es
- @creation-date Sept 2005
- @cvs-id $Id$
-}
+set imsld_package_id [site_node_apm_integration::get_child_package_id \
+ -package_id [dotlrn_community::get_package_id $community_id] \
+ -package_key "[imsld::package_key]"]
+set imsld_url "[lindex [site_node::get_url_from_object_id -object_id $imsld_package_id] 0]"
-imsld::next_activity -imsld_item_id $imsld_item_id -return_url [ad_conn url] imsld_multirow
-
-set elements [list estilo \
- [list display_template "@imsld_multirow.estilo@" \
- hide_p 1]]
-lappend elements prereqs \
- [list label "Prerequisites" \
- display_template "@imsld_multirow.prerequisites;noquote@"]
-lappend elements objectives \
- [list label "Learning Objectives" \
- display_template "@imsld_multirow.objectives;noquote@"]
-lappend elements environments \
- [list label "Environments" \
- display_template "@imsld_multirow.environments;noquote@"]
-lappend elements activity_title \
- [list label "Activities" \
- display_template "@imsld_multirow.activities;noquote@"]
-lappend elements feedbacks \
- [list label "Feedback" \
- display_template "@imsld_multirow.feedbacks;noquote@"]
-lappend elements status \
- [list label "Status" \
- display_template "@imsld_multirow.status;noquote@"]
-
template::list::create \
- -name imsld_uol \
- -multirow imsld_multirow \
+ -name imslds \
+ -multirow imslds \
-key imsld_id \
- -pass_properties { return_url mode base_url bottom_line max_grade_label max_weight_label solution_label submitted_label grade_of_label} \
- -no_data "no data" \
- -elements $elements
+ -elements {
+ imsld_title {
+ label "[_ imsld.IMS_LD_Name]"
+ orderby_asc {imsld_title asc}
+ orderby_desc {imsld_title desc}
+ display_template {@imslds.imsld_title@}
+ }
+ creation_date {
+ label "Creation Date"
+ orderby_asc {creation_date asc}
+ orderby_desc {creation_date desc}
+ }
+ } \
+ -orderby { default_value imsld_title }
+
+set orderby [template::list::orderby_clause -orderby -name imslds]
+
+if {[string equal $orderby ""]} {
+ set orderby " order by imsld_title asc"
+}
+
+set cr_root_folder_id [imsld::cr::get_root_folder -community_id $community_id]
+
+db_multirow imslds get_manifests "
+ select imsld.imsld_id,
+ coalesce(imsld.title, imsld.identifier) as imsld_title,
+ to_char(imsld.creation_date,'MM/DD/YYYY HH24:MI') as creation_date
+ from cr_items cr1, cr_items cr2, cr_items cr3, cr_items cr4,
+ imsld_cp_manifests icm, imsld_cp_organizations ico, imsld_imsldsi imsld
+ where cr1.live_revision = icm.manifest_id
+ and cr1.parent_id = cr4.item_id
+ and cr4.parent_id = :cr_root_folder_id
+ and ico.manifest_id = cr1.item_id
+ and imsld.organization_id = cr2.item_id
+ and cr2.live_revision = ico.organization_id
+ and cr3.live_revision = imsld.imsld_id
+ $orderby
+ " {}
+
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.55 -r1.56
--- openacs-4/packages/imsld/tcl/imsld-procs.tcl 18 Apr 2006 18:28:58 -0000 1.55
+++ openacs-4/packages/imsld/tcl/imsld-procs.tcl 19 Apr 2006 16:29:19 -0000 1.56
@@ -1270,8 +1270,8 @@
set img_nodes [$dom_node selectNodes {.//img}]
foreach img_node $img_nodes {
set parent_node [$img_node parentNode]
- set conf_title [$dom_doc createTextNode "$conf_title"]
- $parent_node replaceChild $conf_title $img_node
+ set conf_title_node [$dom_doc createTextNode "$conf_title"]
+ $parent_node replaceChild $conf_title_node $img_node
}
} if_no_rows {
@@ -1282,17 +1282,21 @@
send-mail {
# FIX ME: when roles be supported, fix it so the mail is sent to the propper role
set resource_item_list ""
+ db_1row get_send_mail_info {
+ select sm.title as send_mail_title
+ from imsld_send_mail_servicesi sm
+ where sm.service_id = :service_item_id
+ and content_revision__is_live(sm.mail_id) = 't'
+ }
+ set send_mail_node_li [$dom_doc createElement li]
set a_node [$dom_doc createElement a]
- $a_node setAttribute href "[export_vars -base spam-recipients {referer one-community-admin}]"
- set img_node [$dom_doc createElement img]
- $img_node setAttribute src "[imsld::object_type_image_path -object_type $service_type]"
- $img_node setAttribute border "0"
- $img_node setAttribute width "16"
- $img_node setAttribute heigth "16"
- $img_node setAttribute alt "[_ imsld.send-mail_service]"
- $a_node appendChild $img_node
- $service_node appendChild $a_node
+ $a_node setAttribute href "[export_vars -base "[dotlrn_community::get_community_url [dotlrn_community::get_community_id]]spam-recipients" {referer one-community-admin}]"
+ set service_title [$dom_doc createTextNode "$send_mail_title"]
+ $a_node setAttribute target "content"
+ $a_node appendChild $service_title
+ $send_mail_node_li appendChild $a_node
+ $dom_node appendChild $send_mail_node_li
}
default {
@@ -1423,12 +1427,12 @@
from imsld_learning_objectsi
where environment_id = :environment_item_id
and content_revision__is_live(learning_object_id) = 't'
+ order by creation_date
}] {
set learning_object_item_id [lindex $learning_objects_list 0]
set learning_object_id [lindex $learning_objects_list 1]
set identifier [lindex $learning_objects_list 2]
set lo_title [lindex $learning_objects_list 3]
-
# learning object item. get the files associated
set linear_item_list [db_list_of_lists item_linear_list {
select ii.imsld_item_id
@@ -1462,14 +1466,15 @@
}
set one_learning_object_list [imsld::process_resource_as_ul -resource_item_id $resource_item_id \
-dom_node $environment_node \
- -dom_doc $dom_doc]
+ -dom_doc $dom_doc \
+ -li_mode]
# in order to behave like CopperCore, we decide to replace the images with the learning object title
set img_nodes [$environment_node selectNodes {.//img}]
foreach img_node $img_nodes {
set parent_node [$img_node parentNode]
- set lo_title [$dom_doc createTextNode "$lo_title"]
- $parent_node replaceChild $lo_title $img_node
+ set lo_title_node [$dom_doc createTextNode "$lo_title"]
+ $parent_node replaceChild $lo_title_node $img_node
}
if { ![string eq "" $one_learning_object_list] } {
if { [string eq "t" $resource_mode] } {
@@ -1508,8 +1513,8 @@
set img_nodes [$environment_node selectNodes {.//img}]
foreach img_node $img_nodes {
set parent_node [$img_node parentNode]
- set lo_title [$dom_doc createTextNode "$service_title"]
- $parent_node replaceChild $lo_title $img_node
+ set lo_title_node [$dom_doc createTextNode "$service_title"]
+ $parent_node replaceChild $lo_title_node $img_node
}
}
@@ -2097,7 +2102,8 @@
-resource_item_id
{-community_id ""}
-dom_node
- -dom_doc
+ -dom_doc
+ -li_mode:boolean
} {
@param resource_item_id
@option community_id
@@ -2128,6 +2134,7 @@
set files_node [$dom_doc createElement ul]
if { ![string eq $resource_type "webcontent"] && ![string eq $acs_object_id ""] } {
+ # if the resource type is not webcontent or has an associated object_id (special cases)...
if { [db_0or1row is_cr_item {
select live_revision from cr_items where item_id = :acs_object_id
}] } {
@@ -2150,10 +2157,16 @@
$img_node setAttribute border "0"
$img_node setAttribute alt "$object_title"
$a_node appendChild $img_node
- $dom_node appendChild $a_node
+ if { $li_mode_p } {
+ set file_node [$dom_doc createElement li]
+ $file_node appendChild $a_node
+ $dom_node appendChild $file_node
+ } else {
+ $dom_node appendChild $a_node
+ }
} else {
- # get associated files
+ # is webcontent, let's get the associated files
foreach file_list [db_list_of_lists associated_files {
select cpf.imsld_file_id,
cpf.file_name,
@@ -2190,8 +2203,13 @@
$img_node setAttribute border "0"
$img_node setAttribute alt "$file_name"
$a_node appendChild $img_node
- $dom_node appendChild $a_node
-
+ if { $li_mode_p } {
+ set file_node [$dom_doc createElement li]
+ $file_node appendChild $a_node
+ $dom_node appendChild $file_node
+ } else {
+ $dom_node appendChild $a_node
+ }
}
# get associated urls
db_foreach associated_urls {
@@ -2209,8 +2227,13 @@
$img_node setAttribute border "0"
$img_node setAttribute alt "$url"
$a_node appendChild $img_node
- $dom_node appendChild $a_node
-
+ if { $li_mode_p } {
+ set file_node [$dom_doc createElement li]
+ $file_node appendChild $a_node
+ $dom_node appendChild $file_node
+ } else {
+ $dom_node appendChild $a_node
+ }
}
}
}
@@ -3986,11 +4009,11 @@
if { [string eq $rel_type_nested imsld_as_info_i_rel] } {
# get the activity_structure_id and return it
set activities_list [concat $activities_list [db_list_of_lists activity_structure_ref {
- select as.structure_id as activity_id
- as.item_id as activity_item_id,
+ select structure_id as activity_id,
+ item_id as activity_item_id,
'structure'
- from imsld_activity_structuresi as
- where as.item_id = :object_id_nested
+ from imsld_activity_structuresi
+ where item_id = :object_id_nested
}]]
}
if { [string eq $rel_type_nested imsld_l_object_item_rel] } {
@@ -4094,7 +4117,7 @@
set first_resources_item_list [imsld::process_support_activity -activity_item_id $activity_item_id -resource_mode "t"]
}
structure {
- set first_resources_item_list [imsld::process_activity_structure -activity_item_id $activity_item_id -resource_mode "t"]
+ set first_resources_item_list [imsld::process_activity_structure -structure_item_id $activity_item_id -resource_mode "t"]
}
}
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.18 -r1.19
--- openacs-4/packages/imsld/tcl/imsld-procs.xql 4 Apr 2006 17:07:59 -0000 1.18
+++ openacs-4/packages/imsld/tcl/imsld-procs.xql 19 Apr 2006 16:29:20 -0000 1.19
@@ -2039,7 +2039,7 @@
cr_items cr,
cr_items cr2,
imsld_activity_structuresi iasi
- where iasi.structureid=:activity_id
+ where iasi.structure_id=:activity_id
and iasi.item_id=cr.item_id
and cr2.parent_id=cr.parent_id
and cr2.content_type='imsld_imsld'
Index: openacs-4/packages/imsld/www/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/index.adp,v
diff -u -r1.9 -r1.10
--- openacs-4/packages/imsld/www/index.adp 4 Apr 2006 10:26:04 -0000 1.9
+++ openacs-4/packages/imsld/www/index.adp 19 Apr 2006 16:29:20 -0000 1.10
@@ -2,4 +2,4 @@
@page_title;noquote@
@context;noquote@
-
+
Index: openacs-4/packages/imsld/www/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/index.tcl,v
diff -u -r1.14 -r1.15
--- openacs-4/packages/imsld/www/index.tcl 4 Apr 2006 10:26:04 -0000 1.14
+++ openacs-4/packages/imsld/www/index.tcl 19 Apr 2006 16:29:20 -0000 1.15
@@ -1,30 +1,9 @@
ad_page_contract {
+} {
+ {orderby ""}
}
set page_title {#imsld.units-of-learning#}
set context {}
-template::list::create \
- -name imslds \
- -multirow imslds \
- -key imsld_id \
- -elements {
- imsld_title {
- label "[_ imsld.IMS_LD_Name]"
- orderby_asc {imsld_title asc}
- orderby_desc {imsld_title desc}
- display_template {@imslds.imsld_title@}
- }
- }
-
-set orderby [template::list::orderby_clause -orderby -name imslds]
-
-if {[string equal $orderby ""]} {
- set orderby " order by imsld_title asc"
-}
-
set community_id [dotlrn_community::get_community_id]
-set cr_root_folder_id [imsld::cr::get_root_folder -community_id $community_id]
-
-db_multirow imslds get_manifests { *SQL* } {
-}
Index: openacs-4/packages/imsld/www/index.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/index.xql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/imsld/www/index.xql 4 Apr 2006 10:26:04 -0000 1.2
+++ openacs-4/packages/imsld/www/index.xql 19 Apr 2006 16:29:20 -0000 1.3
@@ -6,7 +6,8 @@
select imsld.imsld_id,
- coalesce(imsld.title, imsld.identifier) as imsld_title
+ coalesce(imsld.title, imsld.identifier) as imsld_title,
+ to_char(imsld.creation_date,'MM/DD/YYYY HH24:MI') as creation_date
from cr_items cr1, cr_items cr2, cr_items cr3, cr_items cr4,
imsld_cp_manifests icm, imsld_cp_organizations ico, imsld_imsldsi imsld
where cr1.live_revision = icm.manifest_id
@@ -16,6 +17,7 @@
and imsld.organization_id = cr2.item_id
and cr2.live_revision = ico.organization_id
and cr3.live_revision = imsld.imsld_id
+ $orderby