Example #1
0
 /**
  * @throws RuntimeException
  */
 private function flagEntries()
 {
     if ($this->isSchedulerInstalled()) {
         $taskUid = $this->getSchedulerTaskUid();
         $task = $this->scheduler->fetchTask($taskUid);
         if ($this->scheduler->isValidTaskObject($task)) {
             $this->scheduler->executeTask($task);
         } else {
             throw new RuntimeException('task-object of feature-flag-task is not valid!');
         }
     }
 }
Example #2
0
 function deleteReminder($eventUid)
 {
     if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('scheduler')) {
         $eventRow = BackendUtility::getRecordRaw('tx_cal_fe_user_event_monitor_mm', 'uid_local=' . $eventUid);
         $taskId = $eventRow['schedulerId'];
         if ($taskId > 0) {
             $scheduler = new \TYPO3\CMS\Scheduler\Scheduler();
             try {
                 $task = $scheduler->fetchTask($taskId);
                 $scheduler->removeTask($task);
             } catch (OutOfBoundsException $e) {
             }
         }
     } else {
         if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('gabriel')) {
             $monitoringUID = 'tx_cal_fe_user_event_monitor_mm:' . $eventUid;
             $GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_gabriel', ' crid="' . $eventUid . '"');
         }
     }
 }
Example #3
0
 function deleteSchedulerTask($calendarUid)
 {
     if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('scheduler')) {
         $calendarRow = BackendUtility::getRecordRaw('tx_cal_calendar', 'uid=' . $calendarUid);
         $taskId = $calendarRow['schedulerId'];
         if ($taskId > 0) {
             $scheduler = new \TYPO3\CMS\Scheduler\Scheduler();
             $task = $scheduler->fetchTask($taskId);
             $task->setDisabled(true);
             $task->remove();
             $task->save();
         }
     }
 }