Index: openacs-4/packages/dotlrn/www/spam-2.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/spam-2.adp,v diff -u -r1.13.6.1 -r1.13.6.2 --- openacs-4/packages/dotlrn/www/spam-2.adp 22 Jul 2004 16:24:49 -0000 1.13.6.1 +++ openacs-4/packages/dotlrn/www/spam-2.adp 8 Aug 2004 05:56:05 -0000 1.13.6.2 @@ -24,7 +24,7 @@ #dotlrn.lt_Are_you_sure_you_want_to_send#?

- + Index: openacs-4/packages/dotlrn/www/spam-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/spam-2.tcl,v diff -u -r1.6.6.1 -r1.6.6.2 --- openacs-4/packages/dotlrn/www/spam-2.tcl 22 Jul 2004 16:24:49 -0000 1.6.6.1 +++ openacs-4/packages/dotlrn/www/spam-2.tcl 8 Aug 2004 05:56:05 -0000 1.6.6.2 @@ -31,22 +31,14 @@ portal_id:onevalue } -form get_values spam_message subject message +form get_values spam_message subject message format -set content [string trimright [template::util::richtext::get_property contents $message]] -set format [string trimright [template::util::richtext::get_property format $message]] - -# the following is just to make sure the previewing works ok. -# in case the user types a html message and chooses the messsage -# to be a plain text type or vice-versa. -if {$format == "text/html"} { - if [ad_looks_like_html_p $content] { - set preview_message "
$content
" - } else { - set preview_message "$content" - } +if {$format == "html"} { + set preview_message "$message" +} elseif {$format == "pre"} { + set preview_message [ad_text_to_html $message] } else { - set preview_message [ad_quotehtml $content] + set preview_message [ad_quotehtml $message] } set context_bar [list [list $referer Admin] "[_ dotlrn.Spam_Community]"] Index: openacs-4/packages/dotlrn/www/spam.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/spam.adp,v diff -u -r1.20 -r1.20.6.1 --- openacs-4/packages/dotlrn/www/spam.adp 15 Jun 2003 01:24:00 -0000 1.20 +++ openacs-4/packages/dotlrn/www/spam.adp 8 Aug 2004 05:56:05 -0000 1.20.6.1 @@ -22,7 +22,6 @@ @spam_name@@context_bar@ - Index: openacs-4/packages/dotlrn/www/spam.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/spam.tcl,v diff -u -r1.21.6.5 -r1.21.6.6 --- openacs-4/packages/dotlrn/www/spam.tcl 22 Jul 2004 17:07:21 -0000 1.21.6.5 +++ openacs-4/packages/dotlrn/www/spam.tcl 8 Aug 2004 05:56:05 -0000 1.21.6.6 @@ -90,10 +90,18 @@ element create spam_message message \ -label [_ dotlrn.Message] \ - -datatype richtext \ - -widget richtext \ + -datatype text \ + -widget textarea \ -html {rows 10 cols 80 wrap soft} + +element create spam_message format \ + -label "Format" \ + -datatype text \ + -widget select \ + -options {{"Preformatted Text" "pre"} {"Plain Text" "plain"} {HTML "html"}} + + element create spam_message send_date \ -label [_ dotlrn.Send_Date] \ -datatype date \ @@ -127,19 +135,15 @@ if {[ns_queryexists "form:confirm"]} { form get_values spam_message \ - community_id from rel_types_str subject message send_date referer recipients_str spam_all - - set content [string trimright [template::util::richtext::get_property contents $message]] - set format [string trimright [template::util::richtext::get_property format $message]] - + community_id from rel_types_str subject message send_date referer recipients_str spam_all format + set community_name [dotlrn_community::get_community_name $community_id] set community_url "[ad_parameter -package_id [ad_acs_kernel_id] SystemURL][dotlrn_community::get_community_url $community_id]" set recipients_str [join [split $recipients_str] ,] set rel_types_str [join [split $rel_types_str] ','] - # POSTGRES - change to plural # TODO - what if no rel_types @@ -163,14 +167,16 @@ set query [db_map sender_info] - # TO DO CHANGE THE ORACLE QUERY - - ns_log notice "query: $query" - if {$format == "text/html"} { - set bulk_format "html" + if {$format == "html"} { + set message "$message" + set message_type "html" + } elseif {$format == "pre"} { + set message [ad_text_to_html $message] + set message_type "html" } else { - set bulk_format "text" + set message [ad_quotehtml $message] + set message_type "text" } bulk_mail::new \ @@ -179,8 +185,8 @@ -date_format "YYYY MM DD HH24 MI SS" \ -from_addr $from \ -subject "\[$community_name\] $subject" \ - -message $content \ - -message_type $bulk_format \ + -message $message \ + -message_type $message_type \ -query $query ad_returnredirect $referer
#dotlrn.Subject#