X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=rt%2Fshare%2Fhtml%2FElements%2FMessageBox;h=4c7711c18f7d544686f7e8a5e72f98c57adddf1c;hb=de9d037528895f7151a9aead6724ce2df95f9586;hp=2943cab4e4d615fec033f2f161c4917789ee62e3;hpb=43a06151e47d2c59b833cbd8c26d97865ee850b6;p=freeside.git diff --git a/rt/share/html/Elements/MessageBox b/rt/share/html/Elements/MessageBox index 2943cab4e..4c7711c18 100755 --- a/rt/share/html/Elements/MessageBox +++ b/rt/share/html/Elements/MessageBox @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2017 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -45,11 +45,14 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} - % $m->callback( %ARGS, CallbackName => 'AfterTextArea' ); +% if ($Type eq 'text/html') { +" /> +% } <%INIT> my $message = ''; @@ -57,24 +60,33 @@ 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 = qq(wrap="$Wrap"); -} +my $wrap_type = $Type eq 'text/html' ? '' : 'wrap="soft"'; -# If there's no cols specified, we want to set the width to 100% -my $cols = 'style="width: 100%"'; -if ( defined $Width and length $Width ) { - $cols = qq(cols="$Width"); +# If there's no cols specified, we want to set the width to 100% in CSS +my $width_attr; +if ($Width) { + $width_attr = 'cols'; +} else { + $width_attr = 'style'; + $Width = 'width: 100%'; } @@ -84,6 +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';