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.8 -r1.9 --- openacs-4/packages/mail-tracking/lib/messages.xql 14 May 2006 16:11:19 -0000 1.8 +++ openacs-4/packages/mail-tracking/lib/messages.xql 28 May 2006 07:17:27 -0000 1.9 @@ -25,8 +25,8 @@ select distinct ml.log_id, sent_date - from acs_mail_log ml, acs_mail_log_recipient_map mlrm - where ml.log_id=mlrm.log_id + from acs_mail_log ml left outer join acs_mail_log_recipient_map mlrm on (ml.log_id=mlrm.log_id) + where 1=1 $recipient_where_clause [template::list::filter_where_clauses -and -name messages] [template::list::orderby_clause -orderby -name messages] Index: openacs-4/packages/mail-tracking/tcl/mail-tracking-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/mail-tracking/tcl/mail-tracking-callback-procs.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/mail-tracking/tcl/mail-tracking-callback-procs.tcl 14 May 2006 16:11:19 -0000 1.5 +++ openacs-4/packages/mail-tracking/tcl/mail-tracking-callback-procs.tcl 28 May 2006 07:17:27 -0000 1.6 @@ -32,6 +32,12 @@ # "{element element}" set file_ids [string trim $file_ids "{}"] + foreach optional_param {cc_party_ids bcc_party_ids to_addr cc_addr bcc_addr body subject object_id file_ids to_party_ids} { + if {![info exists $optional_param]} { + set $optional_param {} + } + } + set log_id [mail_tracking::new -package_id $package_id \ -sender_id $from_party_id \ -recipient_ids $to_party_ids \ @@ -43,11 +49,9 @@ -body $body \ -message_id $message_id \ -subject $subject \ + -file_ids $file_ids \ -object_id $object_id] - foreach file_id $file_ids { - application_data_link::new -this_object_id $log_id -target_object_id $file_id - } } ad_proc -public -callback acs_mail_lite::send -impl mail_tracking { @@ -63,7 +67,7 @@ set log_id [mail_tracking::new -package_id $package_id \ -sender_id $from_party_id \ - -recipient_id $to_party_id \ + -recipient_ids $to_party_id \ -body $body \ -message_id $message_id \ -subject $subject] 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.4 -r1.5 --- openacs-4/packages/mail-tracking/tcl/mail-tracking-procs.tcl 14 May 2006 16:11:19 -0000 1.4 +++ openacs-4/packages/mail-tracking/tcl/mail-tracking-procs.tcl 28 May 2006 07:17:27 -0000 1.5 @@ -38,6 +38,7 @@ {-subject ""} {-object_id ""} {-context_id ""} + {-file_ids ""} } { Insert new log entry @@ -52,9 +53,14 @@ @param message_id Message_id of the email @param subject Subject of the email @param object_id Object for which this message was sent - @param context_id Context in which this message was send. + @param context_id Context in which this message was send. Will replace object_id + @param file_ids Files send with this e-mail } { set creation_ip "127.0.0.1" + if {![string eq "" $context_id]} { + set object_id $context_id + } + # First create the message entry set log_id [db_exec_plsql insert_log_entry {select acs_mail_log__new ( @@ -73,6 +79,11 @@ :to_addr )}] + 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 + } + # Now add the recipients to the log_id foreach recipient_id $recipient_ids {