[Rt-commit] rt branch, 4.2/quote-folding-config, created. rt-4.1.17-198-g405dc11

? sunnavy sunnavy at bestpractical.com
Mon Aug 5 11:38:15 EDT 2013


The branch, 4.2/quote-folding-config has been created
        at  405dc11aaa7c9a9d212f7bc96baa3e98c47aa6f0 (commit)

- Log -----------------------------------------------------------------
commit 405dc11aaa7c9a9d212f7bc96baa3e98c47aa6f0
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Mon Aug 5 23:22:54 2013 +0800

    make quote folding an option so we can enable/disable it

diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 9f86bd6..d872800 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -1839,6 +1839,15 @@ your own styles of link detection.
 
 Set(@Active_MakeClicky, qw(httpurl_overwrite));
 
+=item C<$QuoteFolding>
+
+Quote folding is the hiding of old replies in transaction history.
+It defaults to on.  Set this to 0 to disable it.
+
+=cut
+
+Set($QuoteFolding, 1);
+
 =back
 
 
diff --git a/lib/RT/Config.pm b/lib/RT/Config.pm
index 7e2faae..e28a429 100644
--- a/lib/RT/Config.pm
+++ b/lib/RT/Config.pm
@@ -443,6 +443,15 @@ our %META = (
             Description => 'Display ticket after "Quick Create"', #loc
         },
     },
+    QuoteFolding => {
+        Section => 'Ticket display',
+        Overridable => 1,
+        SortOrder => 9,
+        Widget => '/Widgets/Form/Boolean',
+        WidgetArguments => {
+            Description => 'Enable quote folding?' # loc
+        }
+    },
 
     # User overridable locale options
     DateTimeFormat => {
diff --git a/share/html/Elements/ShowHistory b/share/html/Elements/ShowHistory
index f876124..5563f98 100644
--- a/share/html/Elements/ShowHistory
+++ b/share/html/Elements/ShowHistory
@@ -54,12 +54,14 @@ if ( $ShowDisplayModes or $ShowTitle ) {
 
     my $titleright = '';
     if ( $ShowDisplayModes ) {
-        my $open_all  = $m->interp->apply_escapes( loc("Show all quoted text"), 'j' );
-        my $open_html = $m->interp->apply_escapes( loc("Show all quoted text"), 'h' );
-        my $close_all = $m->interp->apply_escapes( loc("Hide all quoted text"), 'j' );
-        $titleright .=    '<a href="#" data-direction="open" '
-                        . qq{onclick="return toggle_all_folds(this, $open_all, $close_all);"}
-                        . ">$open_html</a> — ";
+        if ( RT->Config->Get( 'QuoteFolding', $session{CurrentUser} ) ) {
+            my $open_all  = $m->interp->apply_escapes( loc("Show all quoted text"), 'j' );
+            my $open_html = $m->interp->apply_escapes( loc("Show all quoted text"), 'h' );
+            my $close_all = $m->interp->apply_escapes( loc("Hide all quoted text"), 'j' );
+            $titleright .=    '<a href="#" data-direction="open" '
+                            . qq{onclick="return toggle_all_folds(this, $open_all, $close_all);"}
+                            . ">$open_html</a> — ";
+        }
 
         if ($ShowHeaders) {
             $titleright .= qq{<a href="?ForceShowHistory=1;id=} .
diff --git a/share/html/Elements/ShowTransactionAttachments b/share/html/Elements/ShowTransactionAttachments
index 88e74b1..4cad511 100644
--- a/share/html/Elements/ShowTransactionAttachments
+++ b/share/html/Elements/ShowTransactionAttachments
@@ -212,7 +212,7 @@ my $render_attachment = sub {
                     $displayed_inline->{$_}++ for @rewritten;
                 }
 
-                unless (length $name) {
+                if ( !length $name && RT->Config->Get( 'QuoteFolding', $session{CurrentUser} ) ) {
                     eval {
                         require HTML::Quoted;
                         $content = HTML::Quoted->extract($content)
@@ -239,7 +239,7 @@ my $render_attachment = sub {
 
             # It's a text type we don't have special handling for
             else {
-                unless ( length $name ) {
+                if ( !length $name && RT->Config->Get( 'QuoteFolding', $session{CurrentUser} ) ) {
                     eval {
                         require Text::Quoted;
                         Text::Quoted::set_quote_characters(undef);

-----------------------------------------------------------------------


More information about the Rt-commit mailing list