X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FElements%2FMessageBox;h=4c7711c18f7d544686f7e8a5e72f98c57adddf1c;hp=6f55b270475c84be27cc8bcf094baf1d5425559a;hb=01721976fa3324f41a3093cda68bc38a7eec5ff5;hpb=7588a4ac90a9b07c08a3107cd1107d773be1c991 diff --git a/rt/share/html/Elements/MessageBox b/rt/share/html/Elements/MessageBox index 6f55b2704..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-2013 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,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; @@ -87,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';