Use `WoltLabSuite/Core/Acp/Ui/Worker` instead of `WCF.ACP.Worker` (#3686)
authorMatthias Schmidt <gravatronics@live.com>
Sat, 16 Jan 2021 09:35:59 +0000 (10:35 +0100)
committerGitHub <noreply@github.com>
Sat, 16 Jan 2021 09:35:59 +0000 (10:35 +0100)
Additionally, the mail worker dialogs now use titles.

wcfsetup/install/files/acp/js/WCF.ACP.js
wcfsetup/install/files/acp/templates/sendMailUserBulkProcessing.tpl
wcfsetup/install/files/acp/templates/sitemapList.tpl
wcfsetup/install/files/acp/templates/userActivityPointOption.tpl
wcfsetup/install/files/acp/templates/userMail.tpl

index c3466880274bfabe8166a7316ce5400cde056604..3258d2b028f78924ef40fb5fd70036ec39f54660 100644 (file)
@@ -1789,12 +1789,20 @@ WCF.ACP.User.SendNewPasswordHandler = {
         */
        _clipboardAction: function(actionData) {
                if (actionData.data.actionName === 'com.woltlab.wcf.user.sendNewPassword') {
-                       WCF.System.Confirmation.show(actionData.data.parameters.confirmMessage, function(action) {
-                               if (action === 'confirm') {
-                                       new WCF.ACP.Worker('sendingNewPasswords', 'wcf\\system\\worker\\SendNewPasswordWorker', WCF.Language.get('wcf.acp.user.sendNewPassword.workerTitle'), {
-                                               userIDs: actionData.data.parameters.objectIDs
-                                       });
-                               }
+                       require(['Language', 'Ui/Confirmation', 'WoltLabSuite/Core/Acp/Ui/Worker'], function(Language, UiConfirmation, AcpUiWorker) {
+                               UiConfirmation.show({
+                                       confirm: () => {
+                                               new AcpUiWorker({
+                                                       dialogId: 'sendingNewPasswords',
+                                                       dialogTitle: Language.get('wcf.acp.user.sendNewPassword.workerTitle'),
+                                                       className: 'wcf\\system\\worker\\SendNewPasswordWorker',
+                                                       parameters: {
+                                                               userIDs: actionData.data.parameters.objectIDs
+                                                       },
+                                               });
+                                       },
+                                       message: actionData.data.parameters.confirmMessage,
+                               })
                        });
                }
        }
index 9933270a0e793e29766f58e4ea024791122f9d1a..42081a4ae82ec442da9a7a90a186b37662f06d91 100644 (file)
 
 {if !$mailID|empty}
        <script data-relocate="true">
-               require(['Language'], function(Language) {
+               require(['Language', 'WoltLabSuite/Core/Acp/Ui/Worker'], function (Language, AcpUiWorker) {
                        Language.add('wcf.acp.worker.abort.confirmMessage', '{jslang}wcf.acp.worker.abort.confirmMessage{/jslang}');
                        
-                       new WCF.ACP.Worker('mail', 'wcf\\system\\worker\\MailWorker', '', {
-                               mailID: {@$mailID}
+                       new AcpUiWorker({
+                               dialogId: 'mail',
+                               dialogTitle: '{jslang}wcf.acp.user.bulkProcessing.sendMail{/jslang}',
+                               className: 'wcf\\system\\worker\\MailWorker',
+                               parameters: {
+                                       mailID: {@$mailID},
+                               },
                        });
                });
        </script>
index 6bde07ae6f0f1a5e2a54039cb54c4ed5aaf5a2e2..d789e89ebaf7b13c18fead94029b77772e183d01 100644 (file)
 {/if}
 
 <script data-relocate="true">
-       require(['Language'], function(Language) {
+       require(['Language', 'WoltLabSuite/Core/Acp/Ui/Worker'], function (Language, AcpUiWorker) {
                Language.add('wcf.acp.worker.abort.confirmMessage', '{jslang}wcf.acp.worker.abort.confirmMessage{/jslang}');
                
-               elById('sitemapRebuildButton').addEventListener('click', function () {
-                       new WCF.ACP.Worker('sitemapRebuild', 'wcf\\system\\worker\\SitemapRebuildWorker', '{jslang}wcf.acp.rebuildData.com.woltlab.wcf.sitemap{/jslang}', {
-                               forceRebuild: true
+               document.getElementById('sitemapRebuildButton').addEventListener('click', () => {
+                       new AcpUiWorker({
+                               dialogId: 'sitemapRebuild',
+                               dialogTitle: '{jslang}wcf.acp.rebuildData.com.woltlab.wcf.sitemap{/jslang}',
+                               className: 'wcf\\system\\worker\\SitemapRebuildWorker',
+                               parameters: {
+                                       forceRebuild: true,
+                               },
                        });
                });
        });
index a1f903c61b7ba11c08f74ca8c52f8b9c20c1231c..0dc74ac1ef6aa5cc28feeb811f2fd17ed64221a0 100644 (file)
@@ -1,11 +1,15 @@
 {include file='header' pageTitle='wcf.acp.user.activityPoint.option'}
 
 <script data-relocate="true">
-       $(function() {
-               WCF.Language.add('wcf.acp.worker.abort.confirmMessage', '{jslang}wcf.acp.worker.abort.confirmMessage{/jslang}');
+       require(['Language', 'WoltLabSuite/Core/Acp/Ui/Worker'], function (Language, AcpUiWorker) {
+               Language.add('wcf.acp.worker.abort.confirmMessage', '{jslang}wcf.acp.worker.abort.confirmMessage{/jslang}');
                
-               $('#updateEvents').click(function () {
-                       new WCF.ACP.Worker('events', 'wcf\\system\\worker\\UserActivityPointUpdateEventsWorker', '{jslang}wcf.acp.user.activityPoint.updateEvents{/jslang}');
+               document.getElementById('updateEvents').addEventListener('click', () => {
+                       new AcpUiWorker({
+                               dialogId: 'events',
+                               dialogTitle: '{jslang}wcf.acp.user.activityPoint.updateEvents{/jslang}',
+                               className: 'wcf\\system\\worker\\UserActivityPointUpdateEventsWorker',
+                       });
                });
        });
 </script>
index f5140622ca82f7308960c259c332c8d1e97046e4..a9de7937d18e818704bcee5c5ab19ab9a358d892 100644 (file)
 
 {if $mailID|isset}
        <script data-relocate="true">
-               $(function() {
-                       WCF.Language.add('wcf.acp.worker.abort.confirmMessage', '{jslang}wcf.acp.worker.abort.confirmMessage{/jslang}');
+               require(['Language', 'WoltLabSuite/Core/Acp/Ui/Worker'], function (Language, AcpUiWorker) {
+                       Language.add('wcf.acp.worker.abort.confirmMessage', '{lang}wcf.acp.worker.abort.confirmMessage{/lang}');
                        
-                       new WCF.ACP.Worker('mail', 'wcf\\system\\worker\\MailWorker', '', {
-                               mailID: {@$mailID}
+                       new AcpUiWorker({
+                               dialogId: 'mail',
+                               dialogTitle: '{jslang}{$pageTitle}{/jslang}',
+                               className: 'wcf\\system\\worker\\MailWorker',
+                               parameters: {
+                                       mailID: {@$mailID},
+                               },
                        });
                });
        </script>