diff --git a/Build/Resources/Public/Less/TYPO3/_element_table.less b/Build/Resources/Public/Less/TYPO3/_element_table.less index 3c5d01daf2fc9186b06dba6d49e40e978119f026..b3e864046839f439b88862a51e76a2ed1a744418 100644 --- a/Build/Resources/Public/Less/TYPO3/_element_table.less +++ b/Build/Resources/Public/Less/TYPO3/_element_table.less @@ -307,3 +307,25 @@ table { margin-top: 10px; margin-bottom: 10px; } + +.taskGroup { + cursor: pointer; +} + +.taskGroup--close { + .icon-actions-view-list-collapse { + transform: rotate(180deg); + } + + td { + padding: 0 !important; + border: 0 !important; + } + .t-span { + height: 0; + overflow: hidden; + padding: 0; + line-height: 0; + display: block; + } +} diff --git a/typo3/sysext/backend/Resources/Public/Css/backend.css b/typo3/sysext/backend/Resources/Public/Css/backend.css index b42a4a11670eebbf112d31c2bf74bba7b7695acd..2f3e70c69a49a1a5ef2e70057da56e439d88ddc8 100644 --- a/typo3/sysext/backend/Resources/Public/Css/backend.css +++ b/typo3/sysext/backend/Resources/Public/Css/backend.css @@ -11086,6 +11086,23 @@ fieldset[disabled] .table .btn-default.focus { margin-top: 10px; margin-bottom: 10px; } +.taskGroup { + cursor: pointer; +} +.taskGroup--close .icon-actions-view-list-collapse { + transform: rotate(180deg); +} +.taskGroup--close td { + padding: 0 !important; + border: 0 !important; +} +.taskGroup--close .t-span { + height: 0; + overflow: hidden; + padding: 0; + line-height: 0; + display: block; +} .tooltip-inner { padding: 5px 10px; } diff --git a/typo3/sysext/core/Documentation/Changelog/master/Feature-67243-ImplementFoldingOfSchedulerTaskGroups.rst b/typo3/sysext/core/Documentation/Changelog/master/Feature-67243-ImplementFoldingOfSchedulerTaskGroups.rst new file mode 100644 index 0000000000000000000000000000000000000000..dd2a1d41678f15685c358de30bc91c4490a89a03 --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Feature-67243-ImplementFoldingOfSchedulerTaskGroups.rst @@ -0,0 +1,15 @@ +.. include:: ../../Includes.txt + +============================================================ +Feature: #67243 - Implement folding of scheduler task groups +============================================================ + +See :issue:`67243` + +Description +=========== + +When task groups are used, the tasks are displayed grouped in the list of tasks. +Clicking on the row with the group title hides or shows the tasks of the group now. + +.. index:: Backend \ No newline at end of file diff --git a/typo3/sysext/scheduler/Classes/Controller/SchedulerModuleController.php b/typo3/sysext/scheduler/Classes/Controller/SchedulerModuleController.php index 4722ec108c974255cca01c1716b0b550ef649e05..d081c1c379ae287b86a11b32b7f2eb67f4c0a56f 100644 --- a/typo3/sysext/scheduler/Classes/Controller/SchedulerModuleController.php +++ b/typo3/sysext/scheduler/Classes/Controller/SchedulerModuleController.php @@ -21,6 +21,7 @@ use TYPO3\CMS\Backend\Template\ModuleTemplate; use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Imaging\Icon; +use TYPO3\CMS\Core\Imaging\IconFactory; use TYPO3\CMS\Core\Messaging\FlashMessage; use TYPO3\CMS\Core\Page\PageRenderer; use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; @@ -942,13 +943,22 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas . '</tr></thead>'; $registeredClasses = $this->getRegisteredClasses(); - foreach ($temporaryResult as $taskGroup) { + $iconFactory = GeneralUtility::makeInstance(IconFactory::class); + $collapseIcon = $iconFactory->getIcon('actions-view-list-collapse', Icon::SIZE_SMALL)->render(); + $expandIcon = $iconFactory->getIcon('actions-view-list-expand', Icon::SIZE_SMALL)->render(); + foreach ($temporaryResult as $taskIndex => $taskGroup) { + $collapseExpandIcons = '<span class="taskGroup_' . $taskIndex . '">' . $collapseIcon . '</span>' + . '<span class="taskGroup_' . $taskIndex . '" style="display: none;">' . $expandIcon . '</span>'; if (!empty($taskGroup['groupName'])) { $groupText = '<strong>' . htmlspecialchars($taskGroup['groupName']) . '</strong>'; if (!empty($taskGroup['groupDescription'])) { $groupText .= '<br>' . nl2br(htmlspecialchars($taskGroup['groupDescription'])); } - $table[] = '<tr><td colspan="9">' . $groupText . '</td></tr>'; + $table[] = '<tr class="taskGroup" data-task-group-id="' . $taskIndex . '"><td colspan="8">' . $groupText . '</td><td style="text-align:right;">' . $collapseExpandIcons . '</td></tr>'; + } else { + if (sizeof($temporaryResult) > 1) { + $table[] = '<tr class="taskGroup" data-task-group-id="0"><td colspan="8"><strong>' . htmlspecialchars($this->getLanguageService()->getLL('label.noGroup')) . '</strong></td><td style="text-align:right;">' . $collapseExpandIcons . '</td></tr>'; + } } foreach ($taskGroup['tasks'] as $schedulerRecord) { @@ -1113,16 +1123,16 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas $taskName = '<span class="name"><a href="' . $link . '">' . $name . '</a></span>'; $table[] = - '<tr class="' . ($showAsDisabled ? 'disabled' : '') . '">' - . '<td>' . $startExecutionElement . '</td>' - . '<td class="right">' . $schedulerRecord['uid'] . '</td>' - . '<td>' . $this->makeStatusLabel($labels) . $taskName . $taskDesc . '</td>' - . '<td>' . $execType . '</td>' - . '<td>' . $frequency . '</td>' - . '<td>' . $multiple . '</td>' - . '<td>' . $lastExecution . '</td>' - . '<td>' . $nextDate . '</td>' - . '<td nowrap="nowrap">' . $actions . '</td>' + '<tr class="' . ($showAsDisabled ? 'disabled' : '') . ' taskGroup_' . $taskIndex . '">' + . '<td><span class="t-span">' . $startExecutionElement . '</span></td>' + . '<td class="right"><span class="t-span">' . $schedulerRecord['uid'] . '</span></td>' + . '<td><span class="t-span">' . $this->makeStatusLabel($labels) . $taskName . $taskDesc . '</span></td>' + . '<td><span class="t-span">' . $execType . '</span></td>' + . '<td><span class="t-span">' . $frequency . '</span></td>' + . '<td><span class="t-span">' . $multiple . '</span></td>' + . '<td><span class="t-span">' . $lastExecution . '</span></td>' + . '<td><span class="t-span">' . $nextDate . '</span></td>' + . '<td nowrap="nowrap"><span class="t-span">' . $actions . '</span></td>' . '</tr>'; } else { // The task object is not valid diff --git a/typo3/sysext/scheduler/Resources/Private/Language/locallang.xlf b/typo3/sysext/scheduler/Resources/Private/Language/locallang.xlf index e62f2b2c4feb18ad99227d7f87519f401cba4994..eca82bd8c82d470df2fdaecceef824fc6467fe07 100644 --- a/typo3/sysext/scheduler/Resources/Private/Language/locallang.xlf +++ b/typo3/sysext/scheduler/Resources/Private/Language/locallang.xlf @@ -159,6 +159,9 @@ <trans-unit id="label.group"> <source>Task group</source> </trans-unit> + <trans-unit id="label.noGroup"> + <source>(no task group defined)</source> + </trans-unit> <trans-unit id="msg.addError"> <source>The task could not be added.</source> </trans-unit> diff --git a/typo3/sysext/scheduler/Resources/Public/JavaScript/Scheduler.js b/typo3/sysext/scheduler/Resources/Public/JavaScript/Scheduler.js index de34770bb212a1f4fae8c8a9991c1eeb01fefb35..92017b522d712b44e30a80404adbb2aab7c5c24e 100644 --- a/typo3/sysext/scheduler/Resources/Public/JavaScript/Scheduler.js +++ b/typo3/sysext/scheduler/Resources/Public/JavaScript/Scheduler.js @@ -118,6 +118,17 @@ define(['jquery'], function($) { }; /** + * Toggle the visibility of task groups + * + * @param {Object} theSelector + */ + Scheduler.toggleTaskGroups = function(theSelector) { + taskGroup = theSelector.data('task-group-id'); + var taskGroupClass= '.taskGroup_' + taskGroup; + $(taskGroupClass).toggleClass('taskGroup--close'); + }; + + /** * Registers listeners */ Scheduler.initializeEvents = function() { @@ -138,6 +149,10 @@ define(['jquery'], function($) { $('#task_tableGarbageCollection_table').change(function() { Scheduler.actOnChangeSchedulerTableGarbageCollectionTable($(this)); }); + + $('.taskGroup').on('click', function() { + Scheduler.toggleTaskGroups($(this)); + }); }; /**