Index: openacs-4/packages/mail-tracking/lib/messages.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/mail-tracking/lib/messages.tcl,v
diff -u -r1.28.2.2 -r1.28.2.3
--- openacs-4/packages/mail-tracking/lib/messages.tcl 8 Jun 2006 15:56:43 -0000 1.28.2.2
+++ openacs-4/packages/mail-tracking/lib/messages.tcl 13 Jun 2006 06:47:28 -0000 1.28.2.3
@@ -250,25 +250,16 @@
set files [list]
# We get the related files for all the object_types
set content_types [list content_revision content_item file_storage_object image]
- foreach content_type $content_types {
-
- foreach file [application_data_link::get_linked -from_object_id $log_id -to_object_type "$content_type"] {
- if { [string equal $content_type "content_revision"] } {
- lappend files [item::get_item_from_revision $file]
- } else {
- lappend files $file
- }
+ db_foreach files {} {
+ if { [string equal $content_type "content_revision"] } {
+ set file [item::get_item_from_revision $file_id]
+ } else {
+ set file $file_id
}
- }
-
- set download_files ""
-
- foreach file $files {
set title [content::item::get_title -item_id $file]
if { [empty_string_p $title] } {
set title [acs_object_name $file]
}
- # Creating the link to dowload the files
append download_files "$title
"
}
Index: openacs-4/packages/mail-tracking/lib/messages.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/mail-tracking/lib/messages.xql,v
diff -u -r1.9.2.2 -r1.9.2.3
--- openacs-4/packages/mail-tracking/lib/messages.xql 8 Jun 2006 15:56:43 -0000 1.9.2.2
+++ openacs-4/packages/mail-tracking/lib/messages.xql 13 Jun 2006 06:47:28 -0000 1.9.2.3
@@ -33,4 +33,15 @@
+
+
+ select o.object_type as content_type, o.object_id as file_id
+ from acs_data_links r, acs_objects o
+ where r.object_id_one = :log_id
+ and r.object_id_two = o.object_id
+ and o.object_type in ([template::util::tcl_to_sql_list $content_types])
+ order by o.object_type, o.object_id
+
+
+