Index: openacs-4/packages/contacts/lib/email.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/lib/email.tcl,v diff -u -r1.23 -r1.24 --- openacs-4/packages/contacts/lib/email.tcl 22 Mar 2006 13:19:07 -0000 1.23 +++ openacs-4/packages/contacts/lib/email.tcl 3 May 2006 10:39:35 -0000 1.24 @@ -78,7 +78,22 @@ } } +# Get the list of files from the file storage folder +set file_folder_id [parameter::get_from_package_key -package_key "acs-mail-lite" -parameter "FolderID"] +if {![string eq "" $file_folder_id]} { + # get the list of files in an option + set file_options [db_list_of_lists files "select name, item_id from cr_items where parent_id = :file_folder_id and content_type = 'file_storage_object'"] + if {![string eq "" $file_options]} { + append form_elements { + {files_extend:text(checkbox),optional + {label "[_ acs-mail-lite.Additional_files]"} + {options $file_options} + } + } + } +} + if { [exists_and_not_null file_ids] } { set files [list] foreach file $file_ids { @@ -200,6 +215,13 @@ lappend file_ids $revision_id } + # Append the additional files + if {[exists_and_not_null files_extend]} { + foreach file_id $files_extend { + lappend file_ids $file_id + } + } + set locale [lang::system::site_wide_locale] # Send the mail to all parties. Index: openacs-4/packages/contacts/lib/oo_mailing.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/lib/oo_mailing.tcl,v diff -u -r1.13 -r1.14 --- openacs-4/packages/contacts/lib/oo_mailing.tcl 22 Mar 2006 13:19:53 -0000 1.13 +++ openacs-4/packages/contacts/lib/oo_mailing.tcl 3 May 2006 10:39:35 -0000 1.14 @@ -85,6 +85,21 @@ } } +# Get the list of files from the file storage folder +set file_folder_id [parameter::get_from_package_key -package_key "acs-mail-lite" -parameter "FolderID"] +if {![string eq "" $file_folder_id]} { + # get the list of files in an option + set file_options [db_list_of_lists files "select name, item_id from cr_items where parent_id = :file_folder_id and content_type = 'file_storage_object'"] + if {![string eq "" $file_options]} { + append form_elements { + {files_extend:text(checkbox),optional + {label "[_ acs-mail-lite.Additional_files]"} + {options $file_options} + } + } + } +} + ad_form -action message \ -name letter \ -cancel_label "[_ contacts.Cancel]" \ @@ -245,6 +260,22 @@ set from_addr [contact::email -party_id $from] set package_id [ad_conn package_id] + # Append the file(s) + if {[exists_and_not_null revision_id]} { + if {[exists_and_not_null file_ids]} { + append file_ids " $revision_id" + } else { + set file_ids $revision_id + } + } + + # Append the additional files + if {[exists_and_not_null files_extend]} { + foreach file_id $files_extend { + lappend file_ids $file_id + } + } + template::multirow foreach messages { # Send the e-mail to each of the users @@ -254,7 +285,7 @@ -subject "$subject" \ -body "$content_body" \ -package_id $package_id \ - -file_ids $revision_id \ + -file_ids $file_ids \ -mime_type "text/plain" \ -object_id $item_id } Index: openacs-4/packages/contacts/www/message.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/message.adp,v diff -u -r1.21 -r1.22 --- openacs-4/packages/contacts/www/message.adp 31 Dec 2005 07:39:40 -0000 1.21 +++ openacs-4/packages/contacts/www/message.adp 3 May 2006 10:39:34 -0000 1.22 @@ -28,6 +28,7 @@ return_url=@return_url;noquote@ party_ids=@party_ids@ file_ids=@file_ids@ + files_extend=@files_extend@ item_id=@item_id@ signature_id=@signature_id@ recipients=@recipients;noquote@ Index: openacs-4/packages/contacts/www/message.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/message.tcl,v diff -u -r1.29 -r1.30 --- openacs-4/packages/contacts/www/message.tcl 22 Mar 2006 13:21:04 -0000 1.29 +++ openacs-4/packages/contacts/www/message.tcl 3 May 2006 10:39:35 -0000 1.30 @@ -14,6 +14,7 @@ {footer_id:integer ""} {return_url "./"} {file_ids ""} + {files_extend:integer,multiple,optional ""} {item_id:integer ""} {folder_id:integer ""} {signature_id:integer ""}