[BUGFIX] Allow to check/uncheck all recipients in Workspace stage dialog 94/60494/2
authorBenni Mack <benni@typo3.org>
Wed, 17 Apr 2019 17:06:02 +0000 (19:06 +0200)
committerDaniel Goerz <daniel.goerz@posteo.de>
Wed, 17 Apr 2019 17:56:57 +0000 (19:56 +0200)
The stage dialog shows various users relevent in a workspace that
should be notified. However, it is hard for editors (UX wise) to
uncheck / check everybody when a single element should be pushed
into the next stage.

The patch adds two buttons to toggle the checkboxes (check/uncheck all).

Resolves: #59228
Releases: master, 9.5
Change-Id: I2ebbcb7ec2d46b50880f93aefd243ef791300a2e
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60494
Tested-by: Daniel Sattler <sattler@b13.de>
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Daniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: Daniel Sattler <sattler@b13.de>
Reviewed-by: Daniel Goerz <daniel.goerz@posteo.de>
typo3/sysext/workspaces/Resources/Private/Language/locallang.xlf
typo3/sysext/workspaces/Resources/Public/JavaScript/Backend.js
typo3/sysext/workspaces/Resources/Public/JavaScript/Workspaces.js

index e806ae4..e78a745 100644 (file)
                        <trans-unit id="window.sendToNextStageWindow.itemsWillBeSentTo">
                                <source>The selected element(s) will be sent to</source>
                        </trans-unit>
+                       <trans-unit id="window.sendToNextStageWindow.selectAll">
+                               <source>Select all</source>
+                       </trans-unit>
+                       <trans-unit id="window.sendToNextStageWindow.deselectAll">
+                               <source>Uncheck all</source>
+                       </trans-unit>
                        <trans-unit id="window.sendToNextStageWindow.sendMailTo">
                                <source>Send mail to</source>
                        </trans-unit>
index 3420b96..54b6686 100644 (file)
@@ -175,6 +175,13 @@ define([
 
       $me.html(Backend.getPreRenderedIcon(iconIdentifier));
     });
+    $(window.top.document).on('click', '.t3js-workspace-recipients-selectall', function(e) {
+      e.preventDefault();
+      $('.t3js-workspace-recipient', window.top.document).not(':disabled').prop('checked', true);
+    }).on('click', '.t3js-workspace-recipients-deselectall', function(e) {
+      e.preventDefault();
+      $('.t3js-workspace-recipient', window.top.document).not(':disabled').prop('checked', false);
+    });
 
     Backend.elements.$searchForm.on('submit', function(e) {
       e.preventDefault();
index adcf2d3..e9c351a 100644 (file)
@@ -39,6 +39,13 @@ define([
       $form.append(
         $('<label />', {class: 'control-label'}).text(TYPO3.lang['window.sendToNextStageWindow.itemsWillBeSentTo'])
       );
+      $form.append(
+        $('<div />', {class: 'form-group'}).append(
+          $('<a href="#" class="btn btn-default btn-xs t3js-workspace-recipients-selectall" />').text(TYPO3.lang['window.sendToNextStageWindow.selectAll']),
+          '&nbsp;',
+          $('<a href="#" class="btn btn-default btn-xs t3js-workspace-recipients-deselectall" />').text(TYPO3.lang['window.sendToNextStageWindow.deselectAll'])
+        )
+      );
 
       for (var i = 0; i < result.sendMailTo.length; ++i) {
         var recipient = result.sendMailTo[i];
@@ -49,6 +56,7 @@ define([
               $('<input />', {
                 type: 'checkbox',
                 name: 'recipients',
+                class: 't3js-workspace-recipient',
                 id: recipient.name,
                 value: recipient.value
               }).prop('checked', recipient.checked).prop('disabled', recipient.disabled)