Commit 037fe02f authored by Michael Oehlhof's avatar Michael Oehlhof Committed by Frans Saris
Browse files

[FEATURE] EXT:Scheduler: Create task group from add/edit task form

Resolves: #69187
Releases: master
Change-Id: I880f476c1df8cc4c92eec099eaa6f5439b5cc359
Reviewed-on: https://review.typo3.org/55234


Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarJoerg Boesche <typo3@joergboesche.de>
Reviewed-by: Frank Nägler's avatarFrank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Nägler's avatarFrank Naegler <frank.naegler@typo3.org>
Reviewed-by: Frans Saris's avatarFrans Saris <franssaris@gmail.com>
Tested-by: Frans Saris's avatarFrans Saris <franssaris@gmail.com>
parent 43a9f0cf
.. include:: ../../Includes.txt
==========================================================================
Feature: #69187 - EXT:Scheduler: Create task group from add/edit task form
==========================================================================
See :issue:`69187`
Description
===========
It is now possible to create a new scheduler task group while editing or creating a task.
Impact
======
It is no longer needed to switch to the list module and create a new task group on page 0 before editing or creating a scheduler task.
.. index:: Backend, NotScanned
......@@ -703,6 +703,7 @@ class SchedulerModuleController
}
$this->view->assign('additionalFields', $additionalFieldList);
$this->view->assign('returnUrl', rawurlencode((string)GeneralUtility::getIndpEnv('REQUEST_URI')));
$this->view->assign('table', implode(LF, $table));
$this->view->assign('now', $this->getServerTime());
......
<?php
namespace TYPO3\CMS\Scheduler\ViewHelpers;
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
/**
* Edit Record ViewHelper, see FormEngine logic
*
* @internal
*/
class EditRecordViewHelper extends AbstractViewHelper
{
use CompileWithRenderStatic;
/**
* Initializes the arguments
*/
public function initializeArguments()
{
$this->registerArgument('parameters', 'string', 'Is a set of GET params to send to FormEngine', true);
}
/**
* Returns a URL to link to FormEngine
*
* @param array $arguments
* @param \Closure $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
*
* @see \TYPO3\CMS\Backend\Routing\UriBuilder::buildUriFromRoute()
* @return string URL to FormEngine module + parameters
* @throws \TYPO3\CMS\Backend\Routing\Exception\RouteNotFoundException
*/
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
{
$parameters = GeneralUtility::explodeUrl2Array($arguments['parameters']);
/** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
$uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
return (string)$uriBuilder->buildUriFromRoute('record_edit', $parameters);
}
}
......@@ -28,6 +28,9 @@ Scheduler task groups are records stored on the root page (pid=0). They may be c
Management of scheduler task groups
It is also possible to create a new task group from within the edit task form whith clicking on the `+` icon next to the
task group select box.
Individual tasks may then be edited as usual and associated to a given scheduler task group.
The individual groups can be sorted independent of each other by clicking the column label.
......
{namespace sched = TYPO3\CMS\Scheduler\ViewHelpers}
<input type="hidden" name="tx_scheduler[uid]" value="{uid}" />
<input type="hidden" name="previousCMD" value="{cmd}" />
......@@ -49,14 +51,19 @@
<div class="form-group">
<f:be.labels.csh table="{csh}" field="task_group" label="{lang}label.group"/>
<div class="form-control-wrap">
<select name="tx_scheduler[task_group]" id="task_class" class="form-control">
<option value="0" title=""></option>
<f:for each="{registeredTaskGroups}" as="registeredTaskGroup">
<option value="{registeredTaskGroup.uid}" title="{registeredTaskGroup.groupName}" {registeredTaskGroup.selected}>
{registeredTaskGroup.groupName}
</option>
</f:for>
</select>
<div class="input-group">
<select name="tx_scheduler[task_group]" id="task_class" class="form-control">
<option value="0" title=""></option>
<f:for each="{registeredTaskGroups}" as="registeredTaskGroup">
<option value="{registeredTaskGroup.uid}" title="{registeredTaskGroup.groupName}" {registeredTaskGroup.selected}>
{registeredTaskGroup.groupName}
</option>
</f:for>
</select>
<div class="input-group-btn" role="group">
<a class="btn btn-default" href="{sched:editRecord(parameters: 'edit[tx_scheduler_task_group][0]=new&returnUrl={returnUrl}')}" ><core:icon identifier="actions-add" /></a>
</div>
</div>
</div>
</div>
</div>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment