[TASK] Linkvalidator task should handle emailaddresses as textfield 03/40303/2
authorWouter Wolters <typo3@wouterwolters.nl>
Tue, 16 Jun 2015 14:17:07 +0000 (16:17 +0200)
committerBenjamin Mack <benni@typo3.org>
Mon, 22 Jun 2015 11:35:08 +0000 (13:35 +0200)
Like other scheduler tasks, the emailaddresses for an task should
be in an textarea. Streamline this now in the linkvalidator task.

Resolves: #67428
Releases: master
Change-Id: Icfe6666cff7182bb41bef6a4436b1885f16605c2
Reviewed-on: http://review.typo3.org/40303
Reviewed-by: Frederic Gaus <frederic.gaus@flagbit.de>
Tested-by: Frederic Gaus <frederic.gaus@flagbit.de>
Reviewed-by: Benjamin Mack <benni@typo3.org>
Tested-by: Benjamin Mack <benni@typo3.org>
typo3/sysext/linkvalidator/Classes/Task/ValidatorTask.php
typo3/sysext/linkvalidator/Classes/Task/ValidatorTaskAdditionalFieldProvider.php

index 11f6919..cdfa0e8 100644 (file)
@@ -446,7 +446,15 @@ class ValidatorTask extends \TYPO3\CMS\Scheduler\Task\AbstractTask {
                        throw new \Exception($this->getLanguageService()->sL('LLL:EXT:linkvalidator/Resources/Private/Language/locallang.xlf:tasks.error.noSubject'), '1295476808');
                }
                if (!empty($this->email)) {
-                       $emailList = GeneralUtility::trimExplode(',', $this->email);
+                       // Check if old input field value is still there and save the value a
+                       if (strpos($this->email, ',') !== FALSE) {
+                               $emailList = GeneralUtility::trimExplode(',', $this->email, TRUE);
+                               $this->email = implode(LF, $emailList);
+                               $this->save();
+                       } else {
+                               $emailList = GeneralUtility::trimExplode(LF, $this->email, TRUE);
+                       }
+
                        foreach ($emailList as $emailAdd) {
                                if (!GeneralUtility::validEmail($emailAdd)) {
                                        throw new \Exception($this->getLanguageService()->sL('LLL:EXT:linkvalidator/Resources/Private/Language/locallang.xlf:tasks.error.invalidToEmail'), '1295476821');
index fcc2151..49e32af 100644 (file)
@@ -137,8 +137,8 @@ class ValidatorTaskAdditionalFieldProvider implements AdditionalFieldProviderInt
                        'label' => $label
                );
                $fieldId = 'task_email';
-               $fieldCode = '<input type="text" class="form-control" name="tx_scheduler[linkvalidator][email]" id="' . $fieldId . '" value="' .
-                                       htmlspecialchars($taskInfo['email']) . '">';
+               $fieldCode = '<textarea class="form-control" rows="5" cols="50" name="tx_scheduler[linkvalidator][email]" id="' . $fieldId . '">'.
+                                       htmlspecialchars($taskInfo['email']) . '</textarea>';
                $label = $lang->sL('LLL:EXT:linkvalidator/Resources/Private/Language/locallang.xlf:tasks.validate.email');
                $label = BackendUtility::wrapInHelp('linkvalidator', $fieldId, $label);
                $additionalFields[$fieldId] = array(