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'];
|
$settings = $this->params['settings'];
|
||||||
$logger = $this->params['logger'];
|
$logger = $this->params['logger'];
|
||||||
$mode = $this->params['mode'];
|
$mode = $this->params['mode'];
|
||||||
|
$seltask = $this->params['task'];
|
||||||
$db = $dms->getDb();
|
$db = $dms->getDb();
|
||||||
|
|
||||||
$scheduler = new SeedDMS_Scheduler($db);
|
$scheduler = new SeedDMS_Scheduler($db);
|
||||||
|
@ -35,6 +36,8 @@ class SeedDMS_Controller_Cron extends SeedDMS_Controller_Common {
|
||||||
|
|
||||||
$jsonarr = [];
|
$jsonarr = [];
|
||||||
foreach($tasks as $task) {
|
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()]))) {
|
if(isset($GLOBALS['SEEDDMS_SCHEDULER']['tasks'][$task->getExtension()]) && is_object($taskobj = resolveTask($GLOBALS['SEEDDMS_SCHEDULER']['tasks'][$task->getExtension()][$task->getTask()]))) {
|
||||||
$arr = array(
|
$arr = array(
|
||||||
'extension'=>$task->getExtension(),
|
'extension'=>$task->getExtension(),
|
||||||
|
|
|
@ -42,10 +42,14 @@ if($user->getLogin() != 'cli_scheduler') {
|
||||||
$mode = 'list';
|
$mode = 'list';
|
||||||
if(!empty($_GET['mode']) && in_array($_GET['mode'], array('list', 'run', 'dryrun', 'check')))
|
if(!empty($_GET['mode']) && in_array($_GET['mode'], array('list', 'run', 'dryrun', 'check')))
|
||||||
$mode = $_GET['mode'];
|
$mode = $_GET['mode'];
|
||||||
|
$task = '';
|
||||||
|
if(!empty($_GET['task']))
|
||||||
|
$task = $_GET['task'];
|
||||||
|
|
||||||
$controller->setParam('settings', $settings);
|
$controller->setParam('settings', $settings);
|
||||||
$controller->setParam('logger', $logger);
|
$controller->setParam('logger', $logger);
|
||||||
$controller->setParam('mode', $mode);
|
$controller->setParam('mode', $mode);
|
||||||
|
$controller->setParam('task', $task);
|
||||||
if(!$controller->run()) {
|
if(!$controller->run()) {
|
||||||
echo getMLText("error_occured");
|
echo getMLText("error_occured");
|
||||||
exit;
|
exit;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user