mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 15:32:13 +00:00
include new task for checking for expired documents
This commit is contained in:
parent
fc5ad6e5e5
commit
376df1cb20
|
@ -65,3 +65,5 @@ if(isset($GLOBALS['SEEDDMS_HOOKS']['initDMS'])) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
require_once('inc/inc.Tasks.php');
|
||||
|
|
40
inc/inc.Tasks.php
Normal file
40
inc/inc.Tasks.php
Normal file
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Class containing methods for running a scheduled task
|
||||
*
|
||||
* @author Uwe Steinmann <uwe@steinmann.cx>
|
||||
* @package SeedDMS
|
||||
* @subpackage trash
|
||||
*/
|
||||
class SeedDMS_ExpiredDocumentsTask 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($task, $dms, $user, $settings) {
|
||||
$taskparams = $task->getParameter();
|
||||
$dms->getDocumentsExpired(intval($taskparams['days']));
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getDescription() {
|
||||
return 'Check for expired documents and set the document status';
|
||||
}
|
||||
|
||||
public function getAdditionalParams() {
|
||||
return array(
|
||||
array(
|
||||
'name'=>'days',
|
||||
'type'=>'integer',
|
||||
'description'=> 'Number of days to check for. Negative values will look into the past. 0 will just check for documents expiring the current day. Keep in mind that the document is still valid on the expiration date.',
|
||||
)
|
||||
);
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
$GLOBALS['SEEDDMS_SCHEDULER']['tasks']['core']['expireddocs'] = new SeedDMS_ExpiredDocumentsTask;
|
Loading…
Reference in New Issue
Block a user