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 }