2 namespace TYPO3\CMS\Reports\Task;
28 protected $fields = array(
'notificationEmail');
45 public function getAdditionalFields(array &$taskInfo, $task, \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $schedulerModule)
47 $fields = array(
'notificationEmail' =>
'textarea');
48 if ($schedulerModule->CMD ==
'edit') {
49 $taskInfo[$this->fieldPrefix .
'NotificationEmail'] = $task->getNotificationEmail();
53 $fieldId =
'task_' . $fieldName;
54 $fieldHtml =
'<textarea class="form-control" ' .
'rows="5" cols="50" name="tx_scheduler[' . $fieldName .
']" ' .
'id="' . $fieldId .
'" ' .
'>' . htmlspecialchars($taskInfo[$fieldName]) .
'</textarea>';
56 $additionalFields = array();
57 $additionalFields[$fieldId] = array(
59 'label' =>
'LLL:EXT:reports/Resources/Private/Language/locallang_reports.xlf:status_updateTaskField_notificationEmails',
61 'cshLabel' => $fieldId
64 return $additionalFields;
74 public function validateAdditionalFields(array &$submittedData, \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $schedulerModule)
77 $notificationEmails = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(LF, $submittedData[$this->fieldPrefix .
'NotificationEmail'],
true);
78 foreach ($notificationEmails as $notificationEmail) {
84 if (empty($submittedData[$this->fieldPrefix .
'NotificationEmail']) || !$validInput) {
85 $schedulerModule->addMessage(
$GLOBALS[
'LANG']->sL(
'LLL:EXT:reports/Resources/Private/Language/locallang_reports.xlf:status_updateTaskField_notificationEmails_invalid'), \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
101 throw new \InvalidArgumentException(
'Expected a task of type ' . \TYPO3\CMS\Reports\Task\SystemStatusUpdateTask::class .
', but got ' . get_class($task), 1295012802);
103 $task->setNotificationEmail($submittedData[$this->fieldPrefix .
'NotificationEmail']);
114 return $this->fieldPrefix . ucfirst($fieldName);