[FOLLOWUP][FEATURE] EXT:Scheduler: Add sorting to the list of scheduler tasks 29/55029/4
authorStefan Neufeind <typo3.neufeind@speedpartner.de>
Mon, 11 Dec 2017 14:12:47 +0000 (15:12 +0100)
committerBenni Mack <benni@typo3.org>
Tue, 12 Dec 2017 06:42:21 +0000 (07:42 +0100)
Properly set variable SplitButtons again.
Show missing classes in an extra table.

Resolves: #45535
Releases: master
Change-Id: I4ac967ba640f6663ef4d4262e11c2cb428cb0ee5
Reviewed-on: https://review.typo3.org/55029
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/scheduler/Classes/Controller/SchedulerModuleController.php
typo3/sysext/scheduler/Resources/Private/Partials/Backend/SchedulerModule/TaskList.html
typo3/sysext/scheduler/Resources/Private/Templates/Backend/SchedulerModule/ListTasks.html
typo3/sysext/scheduler/Resources/Public/JavaScript/Scheduler.js

index f4a9ce2..97eaa6b 100644 (file)
@@ -855,6 +855,7 @@ class SchedulerModuleController
         $tasks = $temporaryResult;
 
         $registeredClasses = $this->getRegisteredClasses();
+        $missingClasses = [];
         foreach ($temporaryResult as $taskIndex => $taskGroup) {
             foreach ($taskGroup['tasks'] as $recordIndex => $schedulerRecord) {
                 if ((int)$schedulerRecord['disable'] === 1) {
@@ -980,11 +981,15 @@ class SchedulerModuleController
                     if ($showAsDisabled) {
                         $tasks[$taskIndex]['tasks'][$recordIndex]['showAsDisabled'] = 'disabled';
                     }
+                } else {
+                    $missingClasses[] = $tasks[$taskIndex]['tasks'][$recordIndex];
+                    unset($tasks[$taskIndex]['tasks'][$recordIndex]);
                 }
             }
         }
 
         $this->view->assign('tasks', $tasks);
+        $this->view->assign('missingClasses', $missingClasses);
         $this->view->assign('moduleUri', $this->moduleUri);
         $this->view->assign('now', $this->getServerTime());
 
index c2a157f..35ae06a 100644 (file)
             </tr></thead>
             <f:for each="{taskGroup.tasks}" as="taskRecord" iteration="taskIterator">
                 <f:if condition="{taskRecord.validClass}">
-                    <f:then>
-                        <tr class="{taskRecord.showAsDisabled} taskGroup_{groupIterator.index}">
-                            <td><span class="t-span"><label class="btn btn-default btn-checkbox"><input type="checkbox" name="tx_scheduler[execute][]" value="{taskRecord.uid}" id="task_{taskRecord.uid}"><span class="t3-icon fa"></span></label></span></td>
-                            <td class="right"><span class="t-span">{taskRecord.uid}</span></td>
-                            <td><span class="t-span">
-                            <f:for each="{taskRecord.labels}" as="label">
-                                <f:if condition="{taskRecord.validClass}">
-                                    <span class="label label-{label.class} pull-right" title="{label.desciption}">{label.text}</span>
-                                </f:if>
-                            </f:for>
-                            <span class="name">
-                                <a href="{moduleUri}&CMD=edit&tx_scheduler[uid]={taskRecord.uid}">{taskRecord.classTitle} ({taskRecord.classExtension})
-                                <f:if condition="{taskRecord.progress}">
-                                    <div class="progress">
-                                        <div class="progress-bar progress-bar-striped" role="progressbar" aria-valuenow="{taskRecord.progress}" aria-valuemin="0" aria-valuemax="100" style="width: {taskRecord.progress}%;">{f:translate(key:'label.checkAll')}:&nbsp;{taskRecord.progress}%</div>
-                                    </div>
-                                </f:if>
-                                <f:if condition="{taskRecord.additionalInformation}">
-                                    <div class="additional-information"><f:format.nl2br>{taskRecord.additionalInformation}</f:format.nl2br></div>
-                                </f:if>
-                                </a>
-                            </span>
-                            <f:if condition="{taskRecord.description} != ''">
-                                <span class="description"><f:format.nl2br>{taskRecord.description}</f:format.nl2br></span>
+                    <tr class="{taskRecord.showAsDisabled} taskGroup_{groupIterator.index}">
+                        <td><span class="t-span"><label class="btn btn-default btn-checkbox"><input type="checkbox" name="tx_scheduler[execute][]" value="{taskRecord.uid}" id="task_{taskRecord.uid}"><span class="t3-icon fa"></span></label></span></td>
+                        <td class="right"><span class="t-span">{taskRecord.uid}</span></td>
+                        <td><span class="t-span">
+                        <f:for each="{taskRecord.labels}" as="label">
+                            <f:if condition="{taskRecord.validClass}">
+                                <span class="label label-{label.class} pull-right" title="{label.desciption}">{label.text}</span>
                             </f:if>
-                            </span>
-                            </td>
-                            <td><span class="t-span">{taskRecord.execType}</span></td>
-                            <td><span class="t-span">{taskRecord.frequency}</span></td>
-                            <td><span class="t-span">{taskRecord.multiple}</span></td>
-                            <td><span class="t-span">{taskRecord.lastExecution}</span></td>
-                            <td><span class="t-span">{taskRecord.nextDate}</span></td>
-                            <td class="nowrap"><span class="t-span">
-                            <f:if condition="{taskRecord.isRunning}">
-                            <f:then>
-                                <div class="btn-group" role="group">
-                                    <a data-toggle="tooltip" data-container="body" class="btn btn-default t3js-modal-trigger" href="{moduleUri}&CMD=stop&tx_scheduler[uid]={taskRecord.uid}"
-                                       data-severity="warning"
-                                       data-title="{f:translate(key:'LLL:EXT:lang/Resources/Private/Language/locallang_common.xlf:stop')}"
-                                       data-button-close-text="{f:translate(key:'LLL:EXT:lang/Resources/Private/Language/locallang_common.xlf:cancel')}"
-                                       data-content="{f:translate(key:'msg.stop')}"
-                                       title="{f:translate(key:'LLL:EXT:lang/Resources/Private/Language/locallang_common.xlf:stop')}">
-                                        <core:icon identifier="actions-close" />
-                                    </a>
-                                </div>
-                            </f:then>
-                            <f:else>
-                                <div class="btn-group" role="group">
-                                    <a data-toggle="tooltip" data-container="body" class="btn btn-default" href="{moduleUri}&CMD=edit&tx_scheduler[uid]={taskRecord.uid}" title="{f:translate(key:'LLL:EXT:lang/Resources/Private/Language/locallang_common.xlf:edit')}">
-                                        <core:icon identifier="actions-open" />
-                                    </a>
-                                    <a data-toggle="tooltip" data-container="body" class="btn btn-default" href="{moduleUri}&CMD=toggleHidden&tx_scheduler[uid]={taskRecord.uid}" title="{f:translate(key:'LLL:EXT:lang/Resources/Private/Language/locallang_common.xlf:{taskRecord.translationKey}')}">
-                                        <f:if condition="{taskRecord.translationKey} == 'enable'">
-                                        <f:then>
-                                            <core:icon identifier="actions-edit-unhide" />
-                                        </f:then>
-                                        <f:else>
-                                            <core:icon identifier="actions-edit-hide" />
-                                        </f:else>
-                                        </f:if>
-                                    </a>
-                                    <a data-toggle="tooltip" data-container="body" class="btn btn-default t3js-modal-trigger" href="{moduleUri}&CMD=delete&tx_scheduler[uid]={taskRecord.uid}"
-                                       data-severity="warning"
-                                       data-title="{f:translate(key:'LLL:EXT:lang/Resources/Private/Language/locallang_common.xlf:delete')}"
-                                       data-button-close-text="{f:translate(key:'LLL:EXT:lang/Resources/Private/Language/locallang_common.xlf:cancel')}"
-                                       data-content="{f:translate(key:'msg.delete')}"
-                                       title="{f:translate(key:'LLL:EXT:lang/Resources/Private/Language/locallang_common.xlf:delete')}">
-                                        <core:icon identifier="actions-edit-delete" />
-                                    </a>
-                                </div>
-                                &nbsp;
-                                <div class="btn-group" role="group">
-                                    <a class="btn btn-default" data-toggle="tooltip" data-container="body" href="{moduleUri}&CMD=setNextExecutionTime&tx_scheduler[uid]={taskRecord.uid}" title="{f:translate(key:'action.run_task_cron')}">
-                                        <core:icon identifier="extensions-scheduler-run-task-cron" />
-                                    </a>
-                                    <a class="btn btn-default" data-toggle="tooltip" data-container="body" href="{moduleUri}&tx_scheduler[execute][]={taskRecord.uid}" title="{f:translate(key:'action.run_task')}">
-                                        <core:icon identifier="extensions-scheduler-run-task" />
-                                    </a>
+                        </f:for>
+                        <span class="name">
+                            <a href="{moduleUri}&CMD=edit&tx_scheduler[uid]={taskRecord.uid}">{taskRecord.classTitle} ({taskRecord.classExtension})
+                            <f:if condition="{taskRecord.progress}">
+                                <div class="progress">
+                                    <div class="progress-bar progress-bar-striped" role="progressbar" aria-valuenow="{taskRecord.progress}" aria-valuemin="0" aria-valuemax="100" style="width: {taskRecord.progress}%;">{f:translate(key:'label.checkAll')}:&nbsp;{taskRecord.progress}%</div>
                                 </div>
-                            </f:else>
                             </f:if>
-                            </span>
-                            </td>
-                        </tr>
-                    </f:then>
-                    <f:else>
-                        <tr>
-                            <td><span class="btn btn-default disabled"><core:icon identifier="empty-empty" /></span></td>
-                            <td class="right">{taskRecord.uid}</td>
-                            <td colspan="6"><span class="label label-danger"><f:translate key="msg.invalidTaskClass" arguments="{0: '{taskRecord.class}'}" /></span></td>
-                            <td class="nowrap">
-                                <div class="btn-group" role="group">
-                                    <span class="btn btn-default disabled"><core:icon identifier="empty-empty" /></span>
-                                    <span class="btn btn-default disabled"><core:icon identifier="empty-empty" /></span>
-                                    $deleteAction
-                                    <span class="btn btn-default disabled"><core:icon identifier="empty-empty" /></span>
-                                </div>
-                            </td>
-                        </tr>
-                    </f:else>
+                            <f:if condition="{taskRecord.additionalInformation}">
+                                <div class="additional-information"><f:format.nl2br>{taskRecord.additionalInformation}</f:format.nl2br></div>
+                            </f:if>
+                            </a>
+                        </span>
+                        <f:if condition="{taskRecord.description} != ''">
+                            <span class="description"><f:format.nl2br>{taskRecord.description}</f:format.nl2br></span>
+                        </f:if>
+                        </span>
+                        </td>
+                        <td><span class="t-span">{taskRecord.execType}</span></td>
+                        <td><span class="t-span">{taskRecord.frequency}</span></td>
+                        <td><span class="t-span">{taskRecord.multiple}</span></td>
+                        <td><span class="t-span">{taskRecord.lastExecution}</span></td>
+                        <td><span class="t-span">{taskRecord.nextDate}</span></td>
+                        <td class="nowrap"><span class="t-span">
+                        <f:if condition="{taskRecord.isRunning}">
+                        <f:then>
+                            <div class="btn-group" role="group">
+                                <a data-toggle="tooltip" data-container="body" class="btn btn-default t3js-modal-trigger" href="{moduleUri}&CMD=stop&tx_scheduler[uid]={taskRecord.uid}"
+                                   data-severity="warning"
+                                   data-title="{f:translate(key:'LLL:EXT:lang/Resources/Private/Language/locallang_common.xlf:stop')}"
+                                   data-button-close-text="{f:translate(key:'LLL:EXT:lang/Resources/Private/Language/locallang_common.xlf:cancel')}"
+                                   data-content="{f:translate(key:'msg.stop')}"
+                                   title="{f:translate(key:'LLL:EXT:lang/Resources/Private/Language/locallang_common.xlf:stop')}">
+                                    <core:icon identifier="actions-close" />
+                                </a>
+                            </div>
+                        </f:then>
+                        <f:else>
+                            <div class="btn-group" role="group">
+                                <a data-toggle="tooltip" data-container="body" class="btn btn-default" href="{moduleUri}&CMD=edit&tx_scheduler[uid]={taskRecord.uid}" title="{f:translate(key:'LLL:EXT:lang/Resources/Private/Language/locallang_common.xlf:edit')}">
+                                    <core:icon identifier="actions-open" />
+                                </a>
+                                <a data-toggle="tooltip" data-container="body" class="btn btn-default" href="{moduleUri}&CMD=toggleHidden&tx_scheduler[uid]={taskRecord.uid}" title="{f:translate(key:'LLL:EXT:lang/Resources/Private/Language/locallang_common.xlf:{taskRecord.translationKey}')}">
+                                    <f:if condition="{taskRecord.translationKey} == 'enable'">
+                                    <f:then>
+                                        <core:icon identifier="actions-edit-unhide" />
+                                    </f:then>
+                                    <f:else>
+                                        <core:icon identifier="actions-edit-hide" />
+                                    </f:else>
+                                    </f:if>
+                                </a>
+                                <a data-toggle="tooltip" data-container="body" class="btn btn-default t3js-modal-trigger" href="{moduleUri}&CMD=delete&tx_scheduler[uid]={taskRecord.uid}"
+                                   data-severity="warning"
+                                   data-title="{f:translate(key:'LLL:EXT:lang/Resources/Private/Language/locallang_common.xlf:delete')}"
+                                   data-button-close-text="{f:translate(key:'LLL:EXT:lang/Resources/Private/Language/locallang_common.xlf:cancel')}"
+                                   data-content="{f:translate(key:'msg.delete')}"
+                                   title="{f:translate(key:'LLL:EXT:lang/Resources/Private/Language/locallang_common.xlf:delete')}">
+                                    <core:icon identifier="actions-edit-delete" />
+                                </a>
+                            </div>
+                            &nbsp;
+                            <div class="btn-group" role="group">
+                                <a class="btn btn-default" data-toggle="tooltip" data-container="body" href="{moduleUri}&CMD=setNextExecutionTime&tx_scheduler[uid]={taskRecord.uid}" title="{f:translate(key:'action.run_task_cron')}">
+                                    <core:icon identifier="extensions-scheduler-run-task-cron" />
+                                </a>
+                                <a class="btn btn-default" data-toggle="tooltip" data-container="body" href="{moduleUri}&tx_scheduler[execute][]={taskRecord.uid}" title="{f:translate(key:'action.run_task')}">
+                                    <core:icon identifier="extensions-scheduler-run-task" />
+                                </a>
+                            </div>
+                        </f:else>
+                        </f:if>
+                        </span>
+                        </td>
+                    </tr>
                 </f:if>
             </f:for>
         </table>
     </div>
 </f:for>
+
+<f:if condition="{missingClasses}">
+    <table class="table table-striped table-hover">
+        <thead>
+            <th><span class="t-span"><f:translate key="label.id" /></span></th>
+            <th><span class="t-span"><f:translate key="task" /></span></th>
+            <th><span class="t-span"></span></th>
+        </thead>
+        <f:for each="{missingClasses}" as="missingClass">
+            <tr>
+                <td class="right">{missingClass.uid}</td>
+                <td><span class="label label-danger" style="white-space: normal"><f:translate key="msg.invalidTaskClass" arguments="{0: '{missingClass.class}'}" /></span></td>
+                <td class="nowrap">
+                    <div class="btn-group" role="group">
+                        <a data-toggle="tooltip" data-container="body" class="btn btn-default t3js-modal-trigger" href="{moduleUri}&CMD=delete&tx_scheduler[uid]={missingClass.uid}"
+                           data-severity="warning"
+                           data-title="{f:translate(key:'LLL:EXT:lang/Resources/Private/Language/locallang_common.xlf:delete')}"
+                           data-button-close-text="{f:translate(key:'LLL:EXT:lang/Resources/Private/Language/locallang_common.xlf:cancel')}"
+                           data-content="{f:translate(key:'msg.delete')}"
+                           title="{f:translate(key:'LLL:EXT:lang/Resources/Private/Language/locallang_common.xlf:delete')}">
+                            <core:icon identifier="actions-edit-delete" />
+                        </a>
+                    </div>
+                </td>
+            </tr>
+        </f:for>
+    </table>
+</f:if>
 <br />
 </html>
index 35fbc1c..d6f4a3c 100644 (file)
@@ -1,4 +1,4 @@
-<f:render partial="TaskList" arguments="{tasks: tasks, moduleUri: moduleUri}" />
+<f:render partial="TaskList" arguments="{tasks: tasks, moduleUri: moduleUri, missingClasses: missingClasses}" />
 
 <button class="btn btn-default" name="go_cron" id="scheduler_executeselected">
        <core:icon identifier="extensions-scheduler-run-task-cron" />
index e533737..3af13bb 100644 (file)
@@ -15,8 +15,8 @@
  * Module: TYPO3/CMS/Scheduler/Scheduler
  */
 define(['jquery',
-               'datatables',
-               'TYPO3/CMS/Backend/SplitButtons'
+               'TYPO3/CMS/Backend/SplitButtons',
+               'datatables'
                ], function($, SplitButtons) {
 
        /**