[Rt-commit] rt branch, 4.4/prefer-dropzone-pref, created. rt-4.4.2-99-g8ce8b4f95

? sunnavy sunnavy at bestpractical.com
Tue Mar 20 15:43:34 EDT 2018


The branch, 4.4/prefer-dropzone-pref has been created
        at  8ce8b4f958713065b7830490ae1f0b1f3b67068d (commit)

- Log -----------------------------------------------------------------
commit 8ce8b4f958713065b7830490ae1f0b1f3b67068d
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Mar 21 03:28:48 2018 +0800

    Add PreferDropzone config/pref option
    
    Dropzone's accessibility is not good, and unfortunately enhancing that
    feature is complicated if possible. To get around this, we add
    PreferDropzone config/pref option so people having this accessibility
    issue can simply switch back to plain file inputs.
    
    Fixes: I#33643

diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 4ef8f0979..6fe7bc7a2 100644
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -2026,6 +2026,20 @@ Set($MessageBoxIncludeSignatureOnComment, 1);
 
 =back
 
+=head2 Attach Files
+
+=over 4
+
+=item C<$PreferDropzone>
+
+By default, RT uses Dropzone to attach files if possible. If
+C<$PreferDropzone> is set to 0, RT will always use plain file inputs.
+
+=cut
+
+Set($PreferDropzone, 1);
+
+=back
 
 =head2 Transaction display
 
diff --git a/lib/RT/Config.pm b/lib/RT/Config.pm
index e73273012..d03b78d4c 100644
--- a/lib/RT/Config.pm
+++ b/lib/RT/Config.pm
@@ -348,6 +348,15 @@ our %META;
             Description => 'Place signature above quote', #loc
         },
     },
+    PreferDropzone => {
+        Section         => 'Ticket composition', #loc
+        Overridable     => 1,
+        SortOrder       => 11,
+        Widget          => '/Widgets/Form/Boolean',
+        WidgetArguments => {
+            Description => 'Use dropzone if available', #loc
+        },
+    },
     RefreshIntervals => {
         Type => 'ARRAY',
         PostLoadCheck => sub {
diff --git a/share/html/Ticket/Elements/AddAttachments b/share/html/Ticket/Elements/AddAttachments
index 1f968aabf..756bd98a1 100644
--- a/share/html/Ticket/Elements/AddAttachments
+++ b/share/html/Ticket/Elements/AddAttachments
@@ -73,6 +73,7 @@ jQuery( function() {
         dictDefaultMessage: <% loc("Drop files here or click to attach") |n,j %>,
         maxFilesize: MaxAttachmentSizeMiB,
         parallelUploads: 1,
+        forceFallback: <% RT->Config->Get('PreferDropzone', $session{CurrentUser}) ? 0 : 1 %>,
         previewTemplate: '' +
             '<div class="dz-preview dz-file-preview">' +
             '    <div class="dz-remove-mark pointer-events" data-dz-remove>' +

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


More information about the rt-commit mailing list