Index: openacs-4/packages/mail-tracking/www/forward.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/mail-tracking/www/forward.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/mail-tracking/www/forward.adp 3 Jun 2006 19:57:47 -0000 1.1.2.1 @@ -0,0 +1,16 @@ + +@title;noquote@ +@context;noquote@ + + + + 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 -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/mail-tracking/www/forward.tcl 3 Jun 2006 19:57:47 -0000 1.1.2.1 @@ -0,0 +1,108 @@ +# packages/project-manager/www/send-mail.tcl + +ad_page_contract { + Use acs-mail-lite/lib/email chunk to send out going mail messages. + + party_ids: List of party_ids which will be appended to the assignee list + party_id: A single party_id which will be used instead of anything else. Useful for sending the mail to only one person. +} { + log_id:notnull + {return_url ""} +} -validate { + message_exists -requires {log_id} { + if { ![db_0or1row message_exists_p { }] } { + ad_complain "[_ mail-tracking.The_specified_message_does_not_exist]" + } + } +} + + +set title [_ mail-tracking.Forward_message] +set context [list [list "one-message?log_id=$log_id" [_ mail-tracking.One_message]] $title] + +set return_url "one-message?log_id=$log_id" + +# Get the information of the message +db_1row get_message_info { } +set sender [party::name -party_id $sender_id] + +set reciever_list [list] +db_foreach reciever_id {select recipient_id from acs_mail_log_recipient_map where type ='to' and log_id = :log_id and recipient_id is not null} { + lappend reciever_list "[party::name -party_id $recipient_id]" +} +if {![string eq "" $to_addr]} { + lappend reciever_list $to_addr +} +set recipient [join $reciever_list ","] + +set export_vars {log_id} +# Now the CC users +set reciever_list [list] +db_foreach reciever_id {select recipient_id from acs_mail_log_recipient_map where type ='cc' and log_id = :log_id and recipient_id is not null} { + lappend reciever_list "[party::name -party_id $recipient_id]" +} +if {![string eq "" $cc]} { + lappend reciever_list $cc +} +set cc_string [join $reciever_list ","] + +# And the BCC ones +set reciever_list [list] +db_foreach reciever_id {select recipient_id from acs_mail_log_recipient_map where type ='bcc' and log_id = :log_id and recipient_id is not null} { + lappend reciever_list "[party::name -party_id $recipient_id]" +} +if {![string eq "" $bcc]} { + lappend reciever_list $bcc +} +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 download_files [join $download_files ", "] + +if {![ad_looks_like_html_p $body]} { + set body "
$body
" +} + +set mime_type "text/html" + +set content_body "
+ + +
+#mail-tracking.Sender#:$sender
+#mail-tracking.Recipient#:$recipient
+#mail-tracking.CC#:$cc_string
+#mail-tracking.BCC#:$bcc_string
+#mail-tracking.Subject#:$subject
+#mail-tracking.Attachments#:$download_files
+#mail-tracking.MessageID#:$message_id
+
+

+$body +" + +set subject "FW: $subject" \ No newline at end of file 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 -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/mail-tracking/www/forward.xql 3 Jun 2006 19:57:47 -0000 1.1.2.1 @@ -0,0 +1,27 @@ + + + + + + select + 1 + from + acs_mail_log + where + log_id = :log_id + + + + + + + select + * + from + acs_mail_log + where + log_id = :log_id + + + + \ No newline at end of file