[TASK] Scheduler: Move server time info to a partial 53/49853/5
authorDaniel Goerz <ervaude@gmail.com>
Sun, 4 Sep 2016 09:18:04 +0000 (11:18 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Wed, 28 Sep 2016 07:34:59 +0000 (09:34 +0200)
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: TYPO3com <no-reply@typo3.com>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Reviewed-by: Ralf Merz <info@merzilla.de>
Reviewed-by: Joerg Boesche <typo3@joergboesche.de>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: Robert van Kammen <rvkammen@hotmail.com>
Tested-by: Robert van Kammen <rvkammen@hotmail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/scheduler/Classes/Controller/SchedulerModuleController.php
typo3/sysext/scheduler/Resources/Private/Partials/Backend/SchedulerModule/ServerTime.html [new file with mode: 0644]
typo3/sysext/scheduler/Resources/Private/Templates/Backend/SchedulerModule/CheckScreen.html
typo3/sysext/scheduler/Resources/Private/Templates/Backend/SchedulerModule/EditTask.html
typo3/sysext/scheduler/Resources/Private/Templates/Backend/SchedulerModule/ListTasks.html

index cfb5b1f..4bd72b6 100644 (file)
@@ -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();
     }
@@ -1605,6 +1601,15 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
     }
 
     /**
+     * @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.
      *
      * @return \TYPO3\CMS\Core\Authentication\BackendUserAuthentication
diff --git a/typo3/sysext/scheduler/Resources/Private/Partials/Backend/SchedulerModule/ServerTime.html b/typo3/sysext/scheduler/Resources/Private/Partials/Backend/SchedulerModule/ServerTime.html
new file mode 100644 (file)
index 0000000..6638bae
--- /dev/null
@@ -0,0 +1,6 @@
+<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>
index 64d334c..a189b82 100644 (file)
@@ -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}" />
index ac48e25..ebc7d91 100644 (file)
@@ -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}" />
index 98ab066..0c219d8 100644 (file)
@@ -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}" />