initial code to check for upcomming events in calendar

This commit is contained in:
Uwe Steinmann 2022-03-28 17:36:20 +02:00
parent 988dc9deff
commit 283d051d3a

View File

@ -475,7 +475,47 @@ class SeedDMS_PreviewTask extends SeedDMS_SchedulerTaskBase { /* {{{ */
}
} /* }}} */
/**
* Class containing methods for running a scheduled task
*
* @author Uwe Steinmann <uwe@steinmann.cx>
* @package SeedDMS
* @subpackage core
*/
class SeedDMS_CalendarTask extends SeedDMS_SchedulerTaskBase { /* {{{ */
/**
* Run the task
*
* @param $task task to be executed
* @param $dms dms
* @return boolean true if task was executed succesfully, otherwise false
*/
public function execute(SeedDMS_SchedulerTask $task) {
$dms = $this->dms;
$user = $this->user;
$logger = $this->logger;
$settings = $this->settings;
$taskparams = $task->getParameter();
$calendar = new SeedDMS_Calendar($dms->getDB(), $user);
$events = $calendar->getEventsInInterval(mktime(0,0,0, $start[1], $start[2], $start[0]), mktime(23,59,59, $end[1], $end[2], $end[0]));
return true;
}
public function getDescription() {
return 'Check calendar for upcoming events';
}
public function getAdditionalParams() {
return array(
);
}
} /* }}} */
$GLOBALS['SEEDDMS_SCHEDULER']['tasks']['core']['expireddocs'] = 'SeedDMS_ExpiredDocumentsTask';
$GLOBALS['SEEDDMS_SCHEDULER']['tasks']['core']['indexingdocs'] = 'SeedDMS_IndexingDocumentsTask';
$GLOBALS['SEEDDMS_SCHEDULER']['tasks']['core']['checksum'] = 'SeedDMS_CheckSumTask';
$GLOBALS['SEEDDMS_SCHEDULER']['tasks']['core']['preview'] = 'SeedDMS_PreviewTask';
//$GLOBALS['SEEDDMS_SCHEDULER']['tasks']['core']['calendar'] = 'SeedDMS_CalendarTask';