[Rt-commit] rt branch, 4.2/prefer-rich-text-pref, created. rt-4.0.6-446-g16bffed

Thomas Sibley trs at bestpractical.com
Mon Jul 2 21:28:10 EDT 2012


The branch, 4.2/prefer-rich-text-pref has been created
        at  16bffedfeaf0a714f13be292f7daa93706930e82 (commit)

- Log -----------------------------------------------------------------
commit 16bffedfeaf0a714f13be292f7daa93706930e82
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Mon Jul 2 18:27:21 2012 -0700

    Enable PreferRichText as a per-user preference
    
    Composition is a preference, display should be too.

diff --git a/lib/RT/Config.pm b/lib/RT/Config.pm
index deb099b..27be183 100644
--- a/lib/RT/Config.pm
+++ b/lib/RT/Config.pm
@@ -337,6 +337,16 @@ our %META = (
     },
 
     # User overridable options for Ticket displays
+    PreferRichText => {
+        Section         => 'Ticket display', # loc
+        Overridable     => 1,
+        SortOrder       => 0.9,
+        Widget          => '/Widgets/Form/Boolean',
+        WidgetArguments => {
+            Description => 'Display messages in rich text if available', # loc
+            Hints       => 'Rich text (HTML) shows formatting such as colored text, bold, italics, and more', # loc
+        },
+    },
     MaxInlineBody => {
         Section         => 'Ticket display',              #loc
         Overridable     => 1,
diff --git a/share/html/Ticket/Elements/ShowTransactionAttachments b/share/html/Ticket/Elements/ShowTransactionAttachments
index 95a2341..27b8ff4 100644
--- a/share/html/Ticket/Elements/ShowTransactionAttachments
+++ b/share/html/Ticket/Elements/ShowTransactionAttachments
@@ -182,10 +182,10 @@ my $render_attachment = sub {
             # or it's of our prefered alterative type
             || (
                 (
-                    RT->Config->Get('PreferRichText')
+                    RT->Config->Get('PreferRichText', $session{CurrentUser})
                     && ( $content_type =~ m{^text/(?:html|enriched)$} )
                 )
-                || ( !RT->Config->Get('PreferRichText')
+                || ( !RT->Config->Get('PreferRichText', $session{CurrentUser})
                     && ( $content_type !~ m{^text/(?:html|enriched)$} )
                 )
             )

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


More information about the Rt-commit mailing list