/** * Gets additional fields to render in the form to add/edit a task * * @param array $taskInfo Values of the fields from the add/edit task form * @param \TYPO3\CMS\Scheduler\Task\AbstractTask $task The task object being edited. Null when adding a task! * @param \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $schedulerModule Reference to the scheduler backend module * @return array A two dimensional array, array('Identifier' => array('fieldId' => array('code' => '', 'label' => '', 'cshKey' => '', 'cshLabel' => '')) */ public function getAdditionalFields(array &$taskInfo, $task, SchedulerModuleController $schedulerModule) { if ($schedulerModule->CMD == 'edit') { $taskInfo[$this->fieldPrefix . 'NotificationEmail'] = $task->getNotificationEmail(); } // build html for additional email field $fieldName = $this->getFullFieldName('notificationEmail'); $fieldId = 'task_' . $fieldName; $fieldHtml = '<textarea class="form-control" ' . 'rows="5" cols="50" name="tx_scheduler[' . $fieldName . ']" ' . 'id="' . $fieldId . '" ' . '>' . htmlspecialchars($taskInfo[$fieldName]) . '</textarea>'; $additionalFields = array(); $additionalFields[$fieldId] = array('code' => $fieldHtml, 'label' => 'LLL:EXT:reports/Resources/Private/Language/locallang_reports.xlf:status_updateTaskField_notificationEmails', 'cshKey' => '', 'cshLabel' => $fieldId); return $additionalFields; }
/** * Gets additional fields to render in the form to add/edit a task * * @param array $taskInfo Values of the fields from the add/edit task form * @param \TYPO3\CMS\Scheduler\Task\AbstractTask $task The task object being eddited. Null when adding a task! * @param \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $schedulerModule Reference to the scheduler backend module * @return array A two dimensional array, array('Identifier' => array('fieldId' => array('code' => '', 'label' => '', 'cshKey' => '', 'cshLabel' => '')) */ public function getAdditionalFields(array &$taskInfo, $task, \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $schedulerModule) { $fields = array('notificationEmail'); if ($schedulerModule->CMD == 'edit') { $taskInfo[$this->fieldPrefix . 'NotificationEmail'] = $task->getNotificationEmail(); } $additionalFields = array(); foreach ($fields as $field) { $fieldName = $this->getFullFieldName($field); $fieldId = 'task_' . $fieldName; $fieldHtml = '<input type="text" ' . 'name="tx_scheduler[' . $fieldName . ']" ' . 'id="' . $fieldId . '" ' . 'value="' . htmlspecialchars($taskInfo[$fieldName]) . '" />'; $additionalFields[$fieldId] = array('code' => $fieldHtml, 'label' => 'LLL:EXT:reports/reports/locallang.xml:status_updateTaskField_' . $field, 'cshKey' => '', 'cshLabel' => $fieldId); } return $additionalFields; }