/**
  * Wraps the executeTask method
  *
  * @param \TYPO3\CMS\Scheduler\Task\AbstractTask $task The task to execute
  * @return boolean Whether the task was saved successfully to the database or not
  * @throws \Exception
  */
 public function executeTask(\TYPO3\CMS\Scheduler\Task\AbstractTask $task)
 {
     $taskUid = $task->getTaskUid();
     // log start
     $logUid = $this->logStart($taskUid);
     $failure = null;
     try {
         $result = parent::executeTask($task);
     } catch (\Exception $e) {
         $failure = $e;
     }
     if ($result || $failure) {
         $returnMessage = '';
         if ($task instanceof \AOE\SchedulerTimeline\Interfaces\ReturnMessage || is_callable(array($task, 'getReturnMessage'))) {
             $returnMessage = $task->getReturnMessage();
         }
         // log end
         $this->logEnd($logUid, $failure, $returnMessage);
     } else {
         // task was not executed, because another task was running
         // and multiple execution is not allowed for this task
         $this->removeLog($logUid);
     }
     if ($failure instanceof \Exception) {
         throw $failure;
     }
     return $result;
 }
 /**
  * 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 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)
 {
     $fields = array('directoriesToClean' => 'textarea');
     if ($schedulerModule->CMD == 'edit') {
         $taskInfo[$this->fieldPrefix . 'DirectoriesToClean'] = $task->getDirectoriesToClean();
     }
     // build html for additional email field
     $fieldName = $this->getFullFieldName('directoriesToClean');
     $fieldId = 'task_' . $fieldName;
     $fieldHtml = '<textarea class="form-control" rows="10" cols="75" placeholder="' . $GLOBALS['LANG']->sL('LLL:EXT:minicleaner/locallang.xml:scheduler.placeholderText') . '" name="tx_scheduler[' . $fieldName . ']" ' . 'id="' . $fieldId . '" ' . '>' . htmlspecialchars($taskInfo[$fieldName]) . '</textarea>';
     $additionalFields = array();
     $additionalFields[$fieldId] = array('code' => $fieldHtml, 'label' => $GLOBALS['LANG']->sL('LLL:EXT:minicleaner/locallang.xml:scheduler.fieldLabel'), '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;
 }
示例#5
0
 /**
  * Instantiates the Object Manager
  */
 public function __construct()
 {
     parent::__construct();
     $this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
     $this->commandManager = $this->objectManager->get(\TYPO3\CMS\Extbase\Mvc\Cli\CommandManager::class);
     $this->taskExecutor = $this->objectManager->get(\TYPO3\CMS\Extbase\Scheduler\TaskExecutor::class);
 }
示例#6
0
 /**
  * Instantiates the Object Manager
  */
 public function __construct()
 {
     parent::__construct();
     $this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
     $this->commandManager = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Cli\\CommandManager');
     $this->taskExecutor = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Scheduler\\TaskExecutor');
 }
示例#7
0
 /**
  * Constructor initializes user record pointer
  */
 public function __construct()
 {
     parent::__construct();
     $this->userRecordPointer = array('FE' => 0, 'BE' => 0);
 }
 /**
  * Takes care of saving the additional fields' values in the task's object
  *
  * @param array $submittedData An array containing the data submitted by the add/edit task form
  * @param AbstractTask $task Reference to the scheduler backend module
  * @return void
  */
 public function saveAdditionalFields(array $submittedData, AbstractTask $task)
 {
     /** @var SyncToMailChimpTask $task */
     $task->setListId($submittedData['listId']);
     GeneralUtility::devLog('T3Chimp List ID ' . $submittedData['listId'], 't3chimp');
     if (array_key_exists('mappings', $submittedData)) {
         $task->setMappings($submittedData['mappings']);
         GeneralUtility::devLog('T3Chimp List ID ' . print_r($submittedData['mappings'], TRUE), 't3chimp');
     }
 }
示例#9
0
 /**
  * Saves additional field values
  *
  * @param array $submittedData
  * @param \TYPO3\CMS\Scheduler\Task\AbstractTask $task
  * @return boolean
  */
 public function saveAdditionalFields(array $submittedData, \TYPO3\CMS\Scheduler\Task\AbstractTask $task)
 {
     $task->setCommandIdentifier($submittedData['task_cicbase']['action']);
     $task->setArguments($submittedData['task_cicbase']['arguments']);
     return TRUE;
 }
 /**
  * Saves any additional input into the current task object if the task
  * class matches.
  *
  * @param array $submittedData: array containing the data submitted by the user
  * @param AbstractTask $task: reference to the current task object
  */
 public function saveAdditionalFields(array $submittedData, AbstractTask $task)
 {
     $task->setSite(\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Tx_Solr_Site', $submittedData['site']));
     $task->setDocumentsToIndexLimit($submittedData['documentsToIndexLimit']);
 }
示例#11
0
 /**
  * Updates a task in the pool
  *
  * @param Task\AbstractTask $task Scheduler task object
  * @return bool False if submitted task was not of proper class
  */
 public function saveTask(Task\AbstractTask $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, 'disable' => $task->isDisabled(), 'description' => $task->getDescription(), 'task_group' => $task->getTaskGroup(), 'serialized_task_object' => serialize($task));
         $result = $this->getDatabaseConnection()->exec_UPDATEquery('tx_scheduler_task', 'uid = ' . $taskUid, $fields);
     } else {
         $result = false;
     }
     if ($result) {
         $this->scheduleNextSchedulerRunUsingAtDaemon();
     }
     return $result;
 }
 /**
  * Saves any additional input into the current task object if the task
  * class matches.
  *
  * @param  array $submittedData : array containing the data submitted by the user
  * @param  \TYPO3\CMS\Scheduler\Task\AbstractTask $task : reference to the current task object
  */
 public function saveAdditionalFields(array $submittedData, \TYPO3\CMS\Scheduler\Task\AbstractTask $task)
 {
     $task->setUserPid($submittedData['SessionResetter_userPid']);
 }
 /**
  * This method is used to save any additional input into the current task object
  * if the task class matches
  *
  * @param array $submittedData : array containing the data submitted by the user
  * @param tx_caretaker_TestrunnerTask|\TYPO3\CMS\Scheduler\Task\AbstractTask $task : reference to the current task object
  */
 public function saveAdditionalFields(array $submittedData, \TYPO3\CMS\Scheduler\Task\AbstractTask $task)
 {
     $task->setNodeId($submittedData['update_node_id']);
 }
 /**
  * This method is used to save any additional input into the current task object
  * if the task class matches.
  *
  * @param array $submittedData Array containing the data submitted by the user
  * @param \TYPO3\CMS\Scheduler\Task\AbstractTask $task Reference to the current task object
  * @return void
  */
 public function saveAdditionalFields(array $submittedData, \TYPO3\CMS\Scheduler\Task\AbstractTask $task)
 {
     /** @var $task ValidatorTask */
     $task->setDepth($submittedData['linkvalidator']['depth']);
     $task->setPage($submittedData['linkvalidator']['page']);
     $task->setEmail($submittedData['linkvalidator']['email']);
     if ($submittedData['linkvalidator']['emailOnBrokenLinkOnly']) {
         $task->setEmailOnBrokenLinkOnly(1);
     } else {
         $task->setEmailOnBrokenLinkOnly(0);
     }
     $task->setConfiguration($submittedData['linkvalidator']['configuration']);
     $task->setEmailTemplateFile($submittedData['linkvalidator']['emailTemplateFile']);
 }
 /**
  * Takes care of saving the additional fields' values in the task's object
  *
  * @param array $submittedData An array containing the data submitted by the add/edit task form
  * @param \TYPO3\CMS\Scheduler\Task\AbstractTask $task Reference to the scheduler backend module
  * @throws \InvalidArgumentException
  * @return void
  */
 public function saveAdditionalFields(array $submittedData, \TYPO3\CMS\Scheduler\Task\AbstractTask $task)
 {
     if (!$task instanceof CacheWarmingTask) {
         throw new \InvalidArgumentException('Task not of type CacheWarmingTask', 1384275697);
     }
     $task->setTypoScriptPageUid((int) $submittedData['yagTypoScriptPageUid']);
     $task->setSelectedThemes(array_values($submittedData['yagSelectedThemes']));
     $task->setImagesPerRun((int) $submittedData['yagImagesPerRun']);
 }
示例#16
0
 public function __construct()
 {
     parent::__construct();
     $this->initializeExtbase();
     $this->initializeScheduler();
 }
 /**
  * Saves any additional input into the current task object if the task
  * class matches.
  *
  * @param array $submittedData : array containing the data submitted by the user
  * @param AbstractTask $task : reference to the current task object
  */
 public function saveAdditionalFields(array $submittedData, AbstractTask $task)
 {
     $task->setUserPids($submittedData['Notification_userPids']);
     $task->setForumPids($submittedData['Notification_forumPids']);
     $task->setNotificationPid($submittedData['Notification_notificationPid']);
 }
示例#18
0
 /**
  * Updates a task in the pool
  *
  * @param \TYPO3\CMS\Scheduler\Task\AbstractTask $task Scheduler task object
  * @return boolean False if submitted task was not of proper class
  */
 public function saveTask(\TYPO3\CMS\Scheduler\Task\AbstractTask $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, '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;
 }
 /**
  * Saves any additional input into the current task object if the task
  * class matches.
  *
  * @param array $submittedData: array containing the data submitted by the user
  * @param AbstractTask $task: reference to the current task object
  */
 public function saveAdditionalFields(array $submittedData, AbstractTask $task)
 {
     $task->setSite(GeneralUtility::makeInstance('Tx_Solr_Site', $submittedData['site']));
     $indexingConfigurations = array();
     if (!empty($submittedData['indexingConfigurations'])) {
         $indexingConfigurations = $submittedData['indexingConfigurations'];
     }
     $task->setIndexingConfigurationsToReIndex($indexingConfigurations);
 }
 /**
  * Removes given execution from list
  *
  * @param integer $executionID Id of the execution to remove.
  * @param \Exception $failure An exception to signal a failed execution
  *
  * @return    void
  */
 public function unmarkExecution($executionID, \Exception $failure = null)
 {
     $this->logToApplicationLog();
     parent::unmarkExecution($executionID, $failure);
 }
 /**
  * @param array                                  $submittedData
  * @param \TYPO3\CMS\Scheduler\Task\AbstractTask $task
  */
 public function saveAdditionalFields(array $submittedData, \TYPO3\CMS\Scheduler\Task\AbstractTask $task)
 {
     /** @var \S3b0\ProjectRegistration\Scheduler\InfoMail\Task $task */
     $task->setSenderAddress($submittedData['senderAddress']);
     $task->setReceiverAddress($submittedData['receiverAddress']);
 }
 /**
  * Saves any additional input into the current task object if the task
  * class matches.
  *
  * @param array $submittedData array containing the data submitted by the user
  * @param AbstractTask $task reference to the current task object
  */
 public function saveAdditionalFields(array $submittedData, AbstractTask $task)
 {
     $task->setSite(GeneralUtility::makeInstance('ApacheSolrForTypo3\\Solr\\Site', $submittedData['site']));
     $task->setDocumentsToIndexLimit($submittedData['documentsToIndexLimit']);
 }
示例#23
0
 /**
  * PHP4 wrapper for constructor,
  * have to be here evne though the constructor is not defined in the derived class,
  * else the constructor of the parent class will not be called in PHP4
  */
 public function __construct()
 {
     parent::__construct();
 }
 /**
  * Save selected backends in task object.
  *
  * @param array $submittedData Contains data submitted by the user
  * @param \TYPO3\CMS\Scheduler\Task\AbstractTask $task Reference to current task
  *
  * @return void
  */
 public function saveAdditionalFields(array $submittedData, \TYPO3\CMS\Scheduler\Task\AbstractTask $task)
 {
     $this->submittedData = $submittedData;
     /**
      * Task
      *
      * @var StatisticTask $task
      */
     $task->setSelectedAggregation($submittedData[$this->getTaskUid()]['commerce_statisticTask_aggregation']);
 }
示例#25
0
	/**
	 * Saves given values in task object
	 *
	 * @param array $submittedData Contains data submitted by the user
	 * @param \TYPO3\CMS\Scheduler\Task\AbstractTask|\TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask $task Reference to the current task object
	 * @return void
	 */
	public function saveAdditionalFields(array $submittedData, \TYPO3\CMS\Scheduler\Task\AbstractTask $task) {
		if (isset($submittedData['scheduler_saltedpasswordsBulkUpdateCanDeactivateSelf']) && $submittedData['scheduler_saltedpasswordsBulkUpdateCanDeactivateSelf'] === 'IsChecked') {
			$task->setCanDeactivateSelf(TRUE);
		} else {
			$task->setCanDeactivateSelf(FALSE);
		}
		$task->setNumberOfRecords((int)$submittedData['scheduler_saltedpasswordsBulkUpdateNumberOfRecords']);
	}
 /**
  * Takes care of saving the additional fields' values in the task's object
  *
  * @param array $submittedData An array containing the data submitted by the add/edit task form
  * @param \TYPO3\CMS\Scheduler\Task\AbstractTask $task Reference to the scheduler backend module
  * @return void
  */
 public function saveAdditionalFields(array $submittedData, \TYPO3\CMS\Scheduler\Task\AbstractTask $task)
 {
     /** @var \DmitryDulepov\DdGooglesitemap\Scheduler\Task $task */
     $task->setEIdScriptUrl($submittedData['eIdUrl']);
     $task->setMaxUrlsPerSitemap($submittedData['maxUrlsPerSitemap']);
     $task->setIndexFilePath($submittedData['indexFilePath']);
 }
 /**
  * Creates the instance of the class. This call initializes the index file
  * path to the random value. After the task is configured, the user may
  * change the file and the file name will be serialized with the task and
  * used later.
  *
  * @see __sleep
  */
 public function __construct()
 {
     parent::__construct();
     $this->indexFilePath = self::DEFAULT_FILE_PATH . '/' . GeneralUtility::getRandomHexString(24) . '.xml';
 }
 /**
  * Saves any additional input into the current task object if the task
  * class matches.
  *
  * @param array $submittedData : array containing the data submitted by the user
  * @param AbstractTask $task : reference to the current task object
  */
 public function saveAdditionalFields(array $submittedData, AbstractTask $task)
 {
     $task->setUserPid($submittedData['ForumRead_userPid']);
     $task->setForumPid($submittedData['ForumRead_forumPid']);
 }
 /**
  * This method is used to save any additional input into the current task object
  * if the task class matches
  *
  * @param	array				$submittedData Array containing the data submitted by the user
  * @param	\TYPO3\CMS\Scheduler\Task\AbstractTask	$task Reference to the current task object
  *
  * @return	void
  */
 public function saveAdditionalFields(array $submittedData, \TYPO3\CMS\Scheduler\Task\AbstractTask $task)
 {
     $task->setDraft($submittedData['selecteddraft']);
 }
 /**
  * Takes care of saving the additional fields' values in the task's object.
  *
  * @param array $submittedData An array containing the data submitted by the add/edit task form
  * @param \TYPO3\CMS\Scheduler\Task\AbstractTask $task Reference to the scheduler backend module
  * @return void
  */
 public function saveAdditionalFields(array $submittedData, \TYPO3\CMS\Scheduler\Task\AbstractTask $task)
 {
     /** @var \Causal\IgLdapSsoAuth\Task\ImportUsers $task */
     $task->setMode($submittedData['tx_igldapssoauth_mode']);
     $task->setContext($submittedData['tx_igldapssoauth_context']);
     $task->setConfiguration($submittedData['tx_igldapssoauth_configuration']);
     $task->setMissingUsersHandling($submittedData['tx_igldapssoauth_missinguserhandling']);
     $task->setRestoredUsersHandling($submittedData['tx_igldapssoauth_restoreduserhandling']);
 }