From 1c538bfabc2cd31f27067505f0c3d1a46cba6ef0 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Thu, 9 Jul 2015 22:18:55 -0700 Subject: RT 4.2.11, ticket#13852 --- rt/share/html/Elements/MessageBox | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'rt/share/html/Elements/MessageBox') diff --git a/rt/share/html/Elements/MessageBox b/rt/share/html/Elements/MessageBox index c4a2de98c..bcc64d403 100755 --- a/rt/share/html/Elements/MessageBox +++ b/rt/share/html/Elements/MessageBox @@ -45,13 +45,13 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} - % $m->callback( %ARGS, CallbackName => 'AfterTextArea' ); -% if (RT->Config->Get('MessageBoxRichText', $session{'CurrentUser'})) { -" /> +% if ($Type eq 'text/html') { +" /> % } <%INIT> @@ -60,19 +60,25 @@ my $message = ''; if ( $QuoteTransaction ) { my $transaction = RT::Transaction->new( $session{'CurrentUser'} ); $transaction->Load( $QuoteTransaction ); - $message = $transaction->Content( Quote => 1 ); + $message = $transaction->Content( Quote => 1, Type => $Type ); } my $signature = ''; if ( $IncludeSignature and my $text = $session{'CurrentUser'}->UserObj->Signature ) { - $signature = "-- \n". $text; + $signature = "-- \n". $text; + if ($Type eq 'text/html') { + $signature =~ s/&/&/g; + $signature =~ s//>/g; + $signature =~ s/"/"/g; # "//; + $signature =~ s/'/'/g; # '//; + $signature =~ s{\n}{
}g; + $signature = "

$signature

"; + } } # wrap="something" seems to really break IE + richtext -my $wrap_type = ''; -if ( not RT->Config->Get('MessageBoxRichText', $session{'CurrentUser'}) ) { - $wrap_type = 'wrap="' . $m->interp->apply_escapes($Wrap, 'h') . '"'; -} +my $wrap_type = $Type eq 'text/html' ? '' : 'wrap="soft"'; # If there's no cols specified, we want to set the width to 100% in CSS my $width_attr; @@ -90,7 +96,7 @@ $Name => 'Content' $Default => '' $Width => RT->Config->Get('MessageBoxWidth', $session{'CurrentUser'} ) $Height => RT->Config->Get('MessageBoxHeight', $session{'CurrentUser'} ) || 15 -$Wrap => RT->Config->Get('MessageBoxWrap', $session{'CurrentUser'} ) || 'SOFT' $IncludeSignature => RT->Config->Get('MessageBoxIncludeSignature'); $IncludeArticle => 1; +$Type => RT->Config->Get('MessageBoxRichText', $session{'CurrentUser'}) ? 'text/html' : 'text/plain'; -- cgit v1.2.1