/**
  * 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 $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;
 }
Example #2
0
 /**
  * Constructor initializes user record pointer
  */
 public function __construct()
 {
     parent::__construct();
     $this->userRecordPointer = array('FE' => 0, 'BE' => 0);
 }
 /**
  * Saves given values in task object
  *
  * @param array $submittedData Contains data submitted by the user
  * @param tx_scheduler_Task|tx_saltedpasswords_Tasks_BulkUpdate $task Reference to the current task object
  * @return void
  */
 public function saveAdditionalFields(array $submittedData, \TYPO3\CMS\Scheduler\Task $task)
 {
     if (isset($submittedData['scheduler_saltedpasswordsBulkUpdateCanDeactivateSelf']) && $submittedData['scheduler_saltedpasswordsBulkUpdateCanDeactivateSelf'] === 'IsChecked') {
         $task->setCanDeactivateSelf(TRUE);
     } else {
         $task->setCanDeactivateSelf(FALSE);
     }
     $task->setNumberOfRecords(intval($submittedData['scheduler_saltedpasswordsBulkUpdateNumberOfRecords']));
 }
Example #4
0
 /**
  * Updates a task in the pool
  *
  * @param \TYPO3\CMS\Scheduler\Task $task Scheduler task object
  * @return boolean False if submitted task was not of proper class
  */
 public function saveTask(\TYPO3\CMS\Scheduler\Task $task)
 {
     $taskUid = $task->getTaskUid();
     if (!empty($taskUid)) {
         try {
             $executionTime = $task->getNextDueExecution();
             $task->setExecutionTime($executionTime);
         } catch (\Exception $e) {
             $task->setDisabled(TRUE);
             $executionTime = 0;
         }
         $task->unsetScheduler();
         $fields = array('nextexecution' => $executionTime, 'classname' => get_class($task), 'disable' => $task->isDisabled(), 'serialized_task_object' => serialize($task));
         $result = $GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_scheduler_task', 'uid = ' . $taskUid, $fields);
     } else {
         $result = FALSE;
     }
     if ($result) {
         $this->scheduleNextSchedulerRunUsingAtDaemon();
     }
     return $result;
 }