Commit 6083f55f authored by Daniel Goerz's avatar Daniel Goerz Committed by Wouter Wolters
Browse files

[TASK] Scheduler: Move server time info to a partial

Additionally the appearance is improved by using an infobox
and the infobox is added to the check view as well.

Change-Id: I63336fb5d724fcbc2b5da47c3f79e91a4724cec5
Resolves: #77838
Releases: master
Reviewed-on: https://review.typo3.org/49853


Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: Nicole Cordes's avatarNicole Cordes <typo3@cordes.co>
Reviewed-by: default avatarRalf Merz <info@merzilla.de>
Reviewed-by: default avatarJoerg Boesche <typo3@joergboesche.de>
Reviewed-by: default avatarStefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: default avatarStefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: Robert van Kammen's avatarRobert van Kammen <rvkammen@hotmail.com>
Tested-by: Robert van Kammen's avatarRobert van Kammen <rvkammen@hotmail.com>
Reviewed-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
parent 6fcb5d70
......@@ -106,6 +106,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
$this->backendTemplatePath = ExtensionManagementUtility::extPath('scheduler') . 'Resources/Private/Templates/Backend/SchedulerModule/';
$this->view = GeneralUtility::makeInstance(\TYPO3\CMS\Fluid\View\StandaloneView::class);
$this->view->getRequest()->setControllerExtensionName('scheduler');
$this->view->setPartialRootPaths([ExtensionManagementUtility::extPath('scheduler') . 'Resources/Private/Partials/Backend/SchedulerModule/']);
$this->moduleUri = BackendUtility::getModuleUrl($this->moduleName);
$pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
......@@ -472,6 +473,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
}
$this->view->assign('isExecutableMessage', $message);
$this->view->assign('isExecutableSeverity', $severity);
$this->view->assign('now', $this->getServerTime());
return $this->view->render();
}
......@@ -886,10 +888,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
}
$this->view->assign('table', implode(LF, $table));
// Server date time
$dateFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'] . ' ' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'] . ' T (e';
$this->view->assign('now', date($dateFormat) . ', GMT ' . date('P') . ')');
$this->view->assign('now', $this->getServerTime());
return $this->view->render();
}
......@@ -1225,10 +1224,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
}
$this->view->assign('table', '<table class="table table-striped table-hover">' . implode(LF, $table) . '</table>');
// Server date time
$dateFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'] . ' ' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'] . ' T (e';
$this->view->assign('now', date($dateFormat) . ', GMT ' . date('P') . ')');
$this->view->assign('now', $this->getServerTime());
return $this->view->render();
}
......@@ -1604,6 +1600,15 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
$buttonBar->addButton($shortcutButton);
}
/**
* @return string
*/
protected function getServerTime()
{
$dateFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'] . ' ' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'] . ' T (e';
return date($dateFormat) . ', GMT ' . date('P') . ')';
}
/**
* Returns the global BackendUserAuthentication object.
*
......
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:be.infobox state="-1" title="{f:translate(key:'label.serverTime')}">
<p><f:translate key="msg.serverTimeHelp" /></p>
<p><f:translate key="msg.serverTime" arguments="{0: now}" /></p>
</f:be.infobox>
</html>
......@@ -13,3 +13,5 @@
<p>{f:translate(key: 'msg.cliScript', arguments: '{0: script}') -> f:format.raw()}</p>
{isExecutableMessage}
</f:be.infobox>
<f:render partial="ServerTime" arguments="{now: now}" />
......@@ -3,6 +3,4 @@
<f:format.raw>{table}</f:format.raw>
<h3><f:translate key="label.serverTime" /></h3>
<p><f:translate key="msg.serverTimeHelp" /></p>
<p><f:translate key="msg.serverTime" arguments="{0: now}" /></p>
\ No newline at end of file
<f:render partial="ServerTime" arguments="{now: now}" />
......@@ -3,6 +3,4 @@
<f:translate key="label.executeSelected" />
</button>
<h3><f:translate key="label.serverTime" /></h3>
<p><f:translate key="msg.serverTimeHelp" /></p>
<p><f:translate key="msg.serverTime" arguments="{0: now}" /></p>
\ No newline at end of file
<f:render partial="ServerTime" arguments="{now: now}" />
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