--- /dev/null
+.. 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
--- /dev/null
+<?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);
+ }
+}
+{namespace sched = TYPO3\CMS\Scheduler\ViewHelpers}
+
<input type="hidden" name="tx_scheduler[uid]" value="{uid}" />
<input type="hidden" name="previousCMD" value="{cmd}" />
<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>