Index: openacs-4/packages/simulation/www/simplay/task-detail.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/task-detail.tcl,v diff -u -r1.25 -r1.26 --- openacs-4/packages/simulation/www/simplay/task-detail.tcl 29 Jun 2004 10:17:34 -0000 1.25 +++ openacs-4/packages/simulation/www/simplay/task-detail.tcl 30 Nov 2004 21:09:17 -0000 1.26 @@ -52,7 +52,7 @@ set object_url [simulation::object::content_url -name [ns_set get $attachment_set name]] set object_title [ns_set get $attachment_set title] set mime_type [ns_set get $attachment_set mime_type] - append received_attachments "$object_title ($mime_type)
" + append received_attachments "$object_title ($mime_type)
" } } else { @@ -94,9 +94,9 @@ set body " -----Original Message----- -From: [workflow::role::get_element -role_id $from_role_id -element character_title] +From: [simulation::role::get_element -role_id $from_role_id -element character_title] Sent: [lc_time_fmt $creation_date "%x %X"] -To: [workflow::role::get_element -role_id $to_role_id -element character_title] +To: [simulation::role::get_element -role_id $to_role_id -element character_title] Subject: $subject [ad_html_text_convert -from $mime_type -to "text/plain" $triggering_body]" @@ -163,7 +163,13 @@ set document_upload_url [export_vars -base document-upload {case_id role_id {return_url {[ad_return_url]}}}] -if { ![empty_string_p $action(recipients)] } { +if { [empty_string_p $action(recipients)] } { + set message_p false +} else { + set message_p true +} + +if { $message_p } { # We have recipient roles - use message form if { !$bulk_p } { @@ -176,7 +182,7 @@ set form_id action - ad_form -name $form_id -edit_buttons { { Send ok } } -export { case_id role_id {enabled_action_ids $enabled_action_id} bulk_p} \ + ad_form -name $form_id -edit_buttons { { Send ok } } -cancel_url $return_url -export { case_id role_id {enabled_action_ids $enabled_action_id} bulk_p} \ -form { {pretty_name:text(inform) {label {[_ simulation.Task]}} @@ -214,23 +220,37 @@ } set body [template::util::richtext::create $body $body_mime_type] set focus "action.body" - } + } else { + if { ![empty_string_p $action(default_text)] } { + set body [template::util::richtext::create $action(default_text) $action(default_text_mime_type)] + set body_mime_type $action(default_text_mime_type) + } + } set pretty_name $action(pretty_name) set description [template::util::richtext::create $action(description) $action(description_mime_type)] - set documents [simulation::ui::forms::document_upload::documents_element_value $action_id] + set documents [simulation::ui::forms::document_upload::documents_element_value_content \ + $action_id] + + # Let's tell users if there's no attachments instead of giving + # them an empty