mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 07:22:11 +00:00
task to run can be passed in url
This commit is contained in:
parent
ae72faab11
commit
8039a0f479
|
@ -28,6 +28,7 @@ class SeedDMS_Controller_Cron extends SeedDMS_Controller_Common {
|
|||
$settings = $this->params['settings'];
|
||||
$logger = $this->params['logger'];
|
||||
$mode = $this->params['mode'];
|
||||
$seltask = $this->params['task'];
|
||||
$db = $dms->getDb();
|
||||
|
||||
$scheduler = new SeedDMS_Scheduler($db);
|
||||
|
@ -35,6 +36,8 @@ class SeedDMS_Controller_Cron extends SeedDMS_Controller_Common {
|
|||
|
||||
$jsonarr = [];
|
||||
foreach($tasks as $task) {
|
||||
if($seltask && $seltask != $task->getExtension()."::".$task->getTask())
|
||||
continue;
|
||||
if(isset($GLOBALS['SEEDDMS_SCHEDULER']['tasks'][$task->getExtension()]) && is_object($taskobj = resolveTask($GLOBALS['SEEDDMS_SCHEDULER']['tasks'][$task->getExtension()][$task->getTask()]))) {
|
||||
$arr = array(
|
||||
'extension'=>$task->getExtension(),
|
||||
|
|
|
@ -42,10 +42,14 @@ if($user->getLogin() != 'cli_scheduler') {
|
|||
$mode = 'list';
|
||||
if(!empty($_GET['mode']) && in_array($_GET['mode'], array('list', 'run', 'dryrun', 'check')))
|
||||
$mode = $_GET['mode'];
|
||||
$task = '';
|
||||
if(!empty($_GET['task']))
|
||||
$task = $_GET['task'];
|
||||
|
||||
$controller->setParam('settings', $settings);
|
||||
$controller->setParam('logger', $logger);
|
||||
$controller->setParam('mode', $mode);
|
||||
$controller->setParam('task', $task);
|
||||
if(!$controller->run()) {
|
||||
echo getMLText("error_occured");
|
||||
exit;
|
||||
|
|
Loading…
Reference in New Issue
Block a user