Index: openacs-4/packages/mail-tracking/mail-tracking.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/mail-tracking/mail-tracking.info,v diff -u -r1.7.2.2 -r1.7.2.3 --- openacs-4/packages/mail-tracking/mail-tracking.info 8 Jun 2006 15:56:42 -0000 1.7.2.2 +++ openacs-4/packages/mail-tracking/mail-tracking.info 23 Jun 2006 06:50:05 -0000 1.7.2.3 @@ -8,7 +8,7 @@ t tracking - + Nima Mazloumi Mail tracking package. Records all messages send out by acs-mail-lite. 2005-10-24 @@ -18,7 +18,7 @@ 0 - + 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.4 -r1.28.2.5 --- openacs-4/packages/mail-tracking/lib/messages.tcl 18 Jun 2006 12:43:32 -0000 1.28.2.4 +++ openacs-4/packages/mail-tracking/lib/messages.tcl 23 Jun 2006 06:50:06 -0000 1.28.2.5 @@ -255,22 +255,10 @@ set subject "$before$result$after" } - 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] - set files [db_list_of_lists files {}] - foreach file_from_list $files { - set file_id [lindex $file_from_list 1] - if { [string equal [lindex $file_from_list 0] "content_revision"] } { - set file [item::get_item_from_revision $file_id] - } else { - set file $file_id - } - set title [content::item::get_title -item_id $file] - if { [empty_string_p $title] } { - set title [acs_object_name $file] - } - append download_files "$title
" + set files [db_list files {}] + foreach file_id $files { + set title [content::item::get_title -item_id $file_id] + append download_files "$title
" } set object_url "/o/$object_id" 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.3 -r1.9.2.4 --- openacs-4/packages/mail-tracking/lib/messages.xql 13 Jun 2006 06:47:28 -0000 1.9.2.3 +++ openacs-4/packages/mail-tracking/lib/messages.xql 23 Jun 2006 06:50:06 -0000 1.9.2.4 @@ -35,12 +35,8 @@ - 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 + select file_id from acs_mail_log_attachment_map + where log_id = :log_id Index: openacs-4/packages/mail-tracking/sql/postgresql/mail-tracking-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/mail-tracking/sql/postgresql/mail-tracking-create.sql,v diff -u -r1.7.2.3 -r1.7.2.4 --- openacs-4/packages/mail-tracking/sql/postgresql/mail-tracking-create.sql 23 Jun 2006 05:35:28 -0000 1.7.2.3 +++ openacs-4/packages/mail-tracking/sql/postgresql/mail-tracking-create.sql 23 Jun 2006 06:50:06 -0000 1.7.2.4 @@ -79,7 +79,7 @@ NULL -- name_method ); -create or replace function acs_mail_log__new (integer,varchar, integer, integer, varchar, varchar,integer,varchar,integer,integer,varchar,varchar,varchar) +create or replace function acs_mail_log__new (integer,varchar, integer, integer, varchar, varchar,integer,varchar,varchar,varchar) returns integer as ' declare p_log_id alias for $1; @@ -88,27 +88,12 @@ p_package_id alias for $4; p_subject alias for $5; p_body alias for $6; - p_creation_user alias for $7; - p_creation_ip alias for $8; - p_context_id alias for $9; - p_object_id alias for $10; - p_cc alias for $11; - p_bcc alias for $12; - p_to_addr alias for $13; + p_object_id alias for $7; + p_cc alias for $8; + p_bcc alias for $9; + p_to_addr alias for $10; v_log_id acs_mail_log.log_id%TYPE; begin - v_log_id := acs_object__new ( - p_log_id, - ''mail_log'', - now(), - p_creation_user, - p_creation_ip, - p_context_id, - ''t'', - null, - p__package_id - ); - insert into acs_mail_log (log_id, message_id, sender_id, package_id, subject, body, sent_date, object_id, cc, bcc, to_addr) values Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/mail-tracking/sql/postgresql/upgrade/upgrade-0.6.1.-0.6.2.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/mail-tracking/tcl/mail-tracking-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/mail-tracking/tcl/mail-tracking-procs.tcl,v diff -u -r1.5.2.3 -r1.5.2.4 --- openacs-4/packages/mail-tracking/tcl/mail-tracking-procs.tcl 23 Jun 2006 05:35:28 -0000 1.5.2.3 +++ openacs-4/packages/mail-tracking/tcl/mail-tracking-procs.tcl 23 Jun 2006 06:50:06 -0000 1.5.2.4 @@ -81,7 +81,11 @@ ns_log Debug "Mail Traking OBJECT $object_id CONTEXT $context_id FILES $file_ids LOGS $log_id" foreach file_id $file_ids { - application_data_link::new -this_object_id $log_id -target_object_id $file_id + set item_id [content::revision::item_id -revision_id $file_id] + if {$item_id eq ""} { + set item_id $file_id + } + db_dml insert_file_map "insert into acs_mail_log_attachment_map (log_id,file_id) values (:log_id,:file_id)" } # Now add the recipients to the log_id Index: openacs-4/packages/mail-tracking/www/forward.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/mail-tracking/www/forward.tcl,v diff -u -r1.1.2.1 -r1.1.2.2 --- openacs-4/packages/mail-tracking/www/forward.tcl 3 Jun 2006 19:57:47 -0000 1.1.2.1 +++ openacs-4/packages/mail-tracking/www/forward.tcl 23 Jun 2006 06:50:06 -0000 1.1.2.2 @@ -57,28 +57,11 @@ set bcc_string [join $reciever_list ","] # We get the related files -set files [list] - -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 - } - } -} - set download_files [list] - -foreach file $files { - set file_title [content::item::get_title -item_id $file] - if { [empty_string_p $file_title]} { - set file_title [acs_object_name $file] - } - lappend download_files $file_title +set files [db_list files {}] +foreach file_id $files { + set title [content::item::get_title -item_id $file_id] + lappend download_files $title } set download_files [join $download_files ", "] Index: openacs-4/packages/mail-tracking/www/forward.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/mail-tracking/www/forward.xql,v diff -u -r1.1.2.1 -r1.1.2.2 --- openacs-4/packages/mail-tracking/www/forward.xql 3 Jun 2006 19:57:47 -0000 1.1.2.1 +++ openacs-4/packages/mail-tracking/www/forward.xql 23 Jun 2006 06:50:06 -0000 1.1.2.2 @@ -24,4 +24,11 @@ + + + select file_id from acs_mail_log_attachment_map + where log_id = :log_id + + + \ No newline at end of file Index: openacs-4/packages/mail-tracking/www/one-message.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/mail-tracking/www/one-message.tcl,v diff -u -r1.8.2.2 -r1.8.2.3 --- openacs-4/packages/mail-tracking/www/one-message.tcl 8 Jun 2006 15:58:54 -0000 1.8.2.2 +++ openacs-4/packages/mail-tracking/www/one-message.tcl 23 Jun 2006 06:50:06 -0000 1.8.2.3 @@ -82,32 +82,15 @@ } set bcc_string [join $reciever_list ","] -# We get the related files -set files [list] -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 - } - } +# We get the related files +set tracking_url [apm_package_url_from_key "mail-tracking"] +set files [db_list files {}] +foreach file_id $files { + set title [content::item::get_title -item_id $file_id] + lappend download_files "$title
" } -set download_files [list] - -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 - lappend download_files "$title" -} - set download_files [join $download_files ", "] if {![ad_looks_like_html_p $body]} { Index: openacs-4/packages/mail-tracking/www/one-message.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/mail-tracking/www/one-message.xql,v diff -u -r1.1.2.2 -r1.1.2.3 --- openacs-4/packages/mail-tracking/www/one-message.xql 8 Jun 2006 15:58:54 -0000 1.1.2.2 +++ openacs-4/packages/mail-tracking/www/one-message.xql 23 Jun 2006 06:50:06 -0000 1.1.2.3 @@ -24,4 +24,11 @@ + + + select file_id from acs_mail_log_attachment_map + where log_id = :log_id + + + \ No newline at end of file