[BUGFIX] Scheduler: fix and add missing CSH labels 48/49848/4
authorJosef Glatz <jousch@gmail.com>
Sat, 3 Sep 2016 15:44:20 +0000 (17:44 +0200)
committerGeorg Ringer <georg.ringer@gmail.com>
Mon, 12 Sep 2016 14:52:45 +0000 (16:52 +0200)
Activate CSH labels while creating a new scheduler task.
Also add missing localization strings for common description
field.

Resolves: #77822
Releases: master
Change-Id: I6a92a7d0e89a64eeb0ef907f13f889bce58c0344
Reviewed-on: https://review.typo3.org/49848
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Tested-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/scheduler/Classes/Controller/SchedulerModuleController.php
typo3/sysext/scheduler/Resources/Private/Language/locallang_csh_scheduler.xlf

index 80b406d..cfb5b1f 100644 (file)
@@ -721,7 +721,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
         $table = [];
 
         // Disable checkbox
-        $label = '<label for="task_disable">' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_common.xlf:disable') . '</label>';
+        $label = '<label>' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_common.xlf:disable') . '</label>';
         $table[] =
             '<div class="form-section" id="task_disable_row"><div class="form-group">'
                 . BackendUtility::wrapInHelp($this->cshKey, 'task_disable', $label)
@@ -732,7 +732,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
             . '</div></div>';
 
         // Task class selector
-        $label = '<label for="task_class">' . $this->getLanguageService()->getLL('label.class') . '</label>';
+        $label = '<label>' . $this->getLanguageService()->getLL('label.class') . '</label>';
 
         // On editing, don't allow changing of the task class, unless it was not valid
         if ($this->submittedData['uid'] > 0 && !empty($taskInfo['class'])) {
@@ -766,7 +766,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
             . '</div></div>';
 
         // Task type selector
-        $label = '<label for="task_type">' . $this->getLanguageService()->getLL('label.type') . '</label>';
+        $label = '<label>' . $this->getLanguageService()->getLL('label.type') . '</label>';
         $table[] =
             '<div class="form-section" id="task_type_row"><div class="form-group">'
                 . BackendUtility::wrapInHelp($this->cshKey, 'task_type', $label)
@@ -779,7 +779,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
             . '</div></div>';
 
         // Task group selector
-        $label = '<label for="task_group">' . $this->getLanguageService()->getLL('label.group') . '</label>';
+        $label = '<label>' . $this->getLanguageService()->getLL('label.group') . '</label>';
         $cell = '<select name="tx_scheduler[task_group]" id="task_class" class="form-control">';
 
         // Loop on all groups to display a selector
@@ -802,7 +802,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
 
         $dateFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['USdateFormat'] ? '%H:%M %m-%d-%Y' : '%H:%M %d-%m-%Y';
 
-        $label = '<label for="tceforms-datetimefield-task_start">' . BackendUtility::wrapInHelp($this->cshKey, 'task_start', $this->getLanguageService()->getLL('label.start')) . '</label>';
+        $label = '<label>' . BackendUtility::wrapInHelp($this->cshKey, 'task_start', $this->getLanguageService()->getLL('label.start')) . '</label>';
         $value = ($taskInfo['start'] > 0 ? strftime($dateFormat, $taskInfo['start']) : '');
         $table[] =
             '<div class="form-section"><div class="row"><div class="form-group col-sm-6" id="task_start_col">'
@@ -819,7 +819,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
         // End date/time field
         // NOTE: datetime fields need a special id naming scheme
         $value = ($taskInfo['end'] > 0 ? strftime($dateFormat, $taskInfo['end']) : '');
-        $label = '<label for="tceforms-datetimefield-task_end">' . $this->getLanguageService()->getLL('label.end') . '</label>';
+        $label = '<label>' . $this->getLanguageService()->getLL('label.end') . '</label>';
         $table[] =
             '<div class="form-group col-sm-6" id="task_end_col">'
                 . BackendUtility::wrapInHelp($this->cshKey, 'task_end', $label)
@@ -833,7 +833,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
             . '</div></div></div>';
 
         // Frequency input field
-        $label = '<label for="task_frequency">' . $this->getLanguageService()->getLL('label.frequency.long') . '</label>';
+        $label = '<label>' . $this->getLanguageService()->getLL('label.frequency.long') . '</label>';
         $table[] =
             '<div class="form-section" id="task_frequency_row"><div class="form-group">'
                 . BackendUtility::wrapInHelp($this->cshKey, 'task_frequency', $label)
@@ -843,7 +843,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
             . '</div></div>';
 
         // Multiple execution selector
-        $label = '<label for="task_multiple">' . $this->getLanguageService()->getLL('label.parallel.long') . '</label>';
+        $label = '<label>' . $this->getLanguageService()->getLL('label.parallel.long') . '</label>';
         $table[] =
             '<div class="form-section" id="task_multiple_row"><div class="form-group">'
                 . BackendUtility::wrapInHelp($this->cshKey, 'task_multiple', $label)
@@ -854,7 +854,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
             . '</div></div>';
 
         // Description
-        $label = '<label for="task_description">' . $this->getLanguageService()->getLL('label.description') . '</label>';
+        $label = '<label>' . $this->getLanguageService()->getLL('label.description') . '</label>';
         $table[] =
             '<div class="form-section" id="task_description_row"><div class="form-group">'
                 . BackendUtility::wrapInHelp($this->cshKey, 'task_description', $label)
@@ -873,7 +873,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
             // Add each field to the display, if there are indeed any
             if (isset($fields) && is_array($fields)) {
                 foreach ($fields as $fieldID => $fieldInfo) {
-                    $label = '<label for="' . $fieldID . '">' . $this->getLanguageService()->sL($fieldInfo['label']) . '</label>';
+                    $label = '<label>' . $this->getLanguageService()->sL($fieldInfo['label']) . '</label>';
                     $htmlClassName = strtolower(str_replace('\\', '-', $class));
 
                     $table[] =
index c682922..a7fc5a9 100644 (file)
@@ -86,6 +86,18 @@ The Scheduler supports the full cron syntax.</source>
                        <trans-unit id="task_email.description">
                                <source>Enter a recipient for the mails sent by the test task</source>
                        </trans-unit>
+                       <trans-unit id="task_description.alttitle">
+                               <source>Task description</source>
+                       </trans-unit>
+                       <trans-unit id="task_description.description">
+                               <source>Enter a description for this task</source>
+                       </trans-unit>
+                       <trans-unit id="task_group.alttitle">
+                               <source>Task group</source>
+                       </trans-unit>
+                       <trans-unit id="task_group.description">
+                               <source>In case of a high number of different tasks, it may be useful to visually group similar tasks.</source>
+                       </trans-unit>
                        <trans-unit id="task_sleepTime.alttitle">
                                <source>Sleep time</source>
                        </trans-unit>