[Rt-commit] rt branch, 4.4/wrap-column-count, created. rt-4.4.4-6-g33efcf449

Blaine Motsinger blaine at bestpractical.com
Fri Mar 15 14:22:08 EDT 2019


The branch, 4.4/wrap-column-count has been created
        at  33efcf449fe691f3e4ff442c8ea418f661273bae (commit)

- Log -----------------------------------------------------------------
commit 33efcf449fe691f3e4ff442c8ea418f661273bae
Author: Blaine Motsinger <blaine at bestpractical.com>
Date:   Fri Mar 15 13:13:32 2019 -0500

    Added configurable option for wrap column count
    
    This change moves the default value for wrap column count from the
    RT::Transaction module to RT_Config.pm. The wrap column count can
    now be configured through RT_SiteConfig.pm with the QuoteWrapWidth
    variable.
    
        Set( $QuoteWrapWidth, 110 );
    
    Additionally, the default value has been raised from 70 to 100.

diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 54e5949e7..773f51c10 100644
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -2334,7 +2334,14 @@ It defaults to on.  Set this to 0 to disable it.
 
 Set($QuoteFolding, 1);
 
-=back
+=item C<$QuoteWrapWidth>
+
+C<$QuoteWrapWidth> controls the number of columns to use when wrapping
+quoted text within transactions.
+
+=cut
+
+Set($QuoteWrapWidth, 100);
 
 
 =head1 Application logic
diff --git a/lib/RT/Transaction.pm b/lib/RT/Transaction.pm
index b027ef664..3df3aa344 100644
--- a/lib/RT/Transaction.pm
+++ b/lib/RT/Transaction.pm
@@ -332,8 +332,9 @@ If this transaction has attached mime objects, returns the body of the first
 textual part (as defined in RT::I18N::IsTextualContentType).  Otherwise,
 returns the message "This transaction appears to have no content".
 
-Takes a paramhash.  If the $args{'Quote'} parameter is set, wraps this message 
-at $args{'Wrap'}.  $args{'Wrap'} defaults to 70.
+Takes a paramhash.  If the $args{'Quote'} parameter is set, wraps this message
+at $args{'Wrap'}.  $args{'Wrap'} is configurable through the QuoteWrapWidth
+config setting and defaults to 100 characters.
 
 If $args{'Type'} is set to C<text/html>, this will return an HTML 
 part of the message, if available.  Otherwise it looks for a text/plain
@@ -348,7 +349,7 @@ sub Content {
     my %args = (
         Type => $PreferredContentType || '',
         Quote => 0,
-        Wrap  => 70,
+        Wrap => RT->Config->Get('QuoteWrapWidth'),
         @_
     );
 
@@ -442,7 +443,7 @@ sub ApplyQuoteWrap {
         $max = length if length > $max;
     }
 
-    if ( $max > 76 ) {
+    if ( $max > $args{cols} ) {
         require Text::Quoted;
         require Text::Wrapper;
 

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


More information about the rt-commit mailing list