コード例 #1
0
 /**
  * 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();
         $taskInfo[$this->fieldPrefix . 'NotificationAll'] = $task->getNotificationAll();
     }
     // 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 = [];
     $additionalFields[$fieldId] = ['code' => $fieldHtml, 'label' => 'LLL:EXT:reports/Resources/Private/Language/locallang_reports.xlf:status_updateTaskField_notificationEmails', 'cshKey' => '', 'cshLabel' => $fieldId];
     // build html for additional mail all checkbox field
     $fieldName = $this->getFullFieldName('notificationAll');
     $fieldId = 'task_' . $fieldName;
     $fieldHtml = '<input type="checkbox" name="tx_scheduler[' . $fieldName . ']" id="' . $fieldId . '" value="1"' . ($taskInfo[$fieldName] ? ' checked="checked"' : '') . '>';
     $additionalFields[$fieldId] = ['code' => $fieldHtml, 'label' => 'LLL:EXT:reports/Resources/Private/Language/locallang_reports.xlf:status_updateTaskField_notificationAll', 'cshKey' => '', 'cshLabel' => $fieldId];
     return $additionalFields;
 }