* @copyright Copyright (C) 2013 Uwe Steinmann * @version Release: @package_version@ */ /** * Include parent class */ require_once("class.Bootstrap.php"); /** * Class which outputs the html page for SchedulerTaskMgr view * * @category DMS * @package SeedDMS * @author Uwe Steinmann * @copyright Copyright (C) 2013 Uwe Steinmann * @version Release: @package_version@ */ class SeedDMS_View_SchedulerTaskMgr extends SeedDMS_Bootstrap_Style { function js() { /* {{{ */ header('Content-Type: application/javascript'); ?> $(document).ready( function() { $('body').on('click', '.addtask', function(ev){ ev.preventDefault(); $('#editaddtask.ajax').trigger('update', {extension: $(this).data('extension'), task: $(this).data('task')}); }); $('body').on('click', '.listtasks', function(ev){ ev.preventDefault(); $('#listtasks.ajax').trigger('update', {extension: $(this).data('extension'), task: $(this).data('task')}); }); $('body').on('click', '.edittask', function(ev){ ev.preventDefault(); $('#editaddtask.ajax').trigger('update', {taskid: $(this).data('id'), action: $(this).data('action')}); }); $('#listtasks.ajax').trigger('update', {}); }); params['dms']; $user = $this->params['user']; $extname = $this->params['extname']; $taskname = $this->params['taskname']; if($extname && $taskname) { $taskobj = $GLOBALS['SEEDDMS_SCHEDULER']['tasks'][$extname][$taskname]; if(method_exists($taskobj, 'getAdditionalParams')) $additionalparams = $taskobj->getAdditionalParams(); else $additionalparams = null; ?>
::
params['dms']; $user = $this->params['user']; $scheduler = $this->params['scheduler']; $taskid = $this->params['taskid']; $task = $scheduler->getTask($taskid); $taskobj = $GLOBALS['SEEDDMS_SCHEDULER']['tasks'][$task->getExtension()][$task->getTask()]; ?>
getExtension() ?>::getTask() ?>
getAdditionalParams()) { foreach($additionalparams as $param) { switch($param['type']) { default: ?>
params['dms']; $user = $this->params['user']; $extname = $this->params['extname']; $taskname = $this->params['taskname']; $scheduler = $this->params['scheduler']; if($extname && $taskname) $tasks = $scheduler->getTasksByExtension($extname, $taskname); else $tasks = $scheduler->getTasks(); if(!$tasks) return; $this->contentHeading(getMLText("scheduler_class_tasks")); echo "\n"; print "\n\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; foreach($tasks as $task) { echo "getDisabled() ? " class=\"success\"" : "").">"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } echo "
".getMLText('scheduler_class')."".getMLText('task_name')."".getMLText('task_description')."".getMLText('task_frequency')."".getMLText('task_next_run')."".getMLText('task_last_run')."
"; echo $task->getExtension()."::".$task->getTask(); echo ""; echo $task->getName(); echo ""; echo $task->getDescription(); echo ""; echo $task->getFrequency(); echo ""; echo $task->getNextRun(); echo ""; echo $task->getLastRun(); echo ""; print ""; echo "
\n"; } /* }}} */ function show() { /* {{{ */ $dms = $this->params['dms']; $user = $this->params['user']; $extname = $this->params['extname']; $taskname = $this->params['taskname']; $scheduler = $this->params['scheduler']; $this->htmlStartPage(getMLText("admin_tools")); $this->globalNavigation(); $this->contentStart(); $this->pageNavigation(getMLText("admin_tools"), "admin_tools"); $this->contentHeading(getMLText("scheduler_task_mgr")); ?>
\n"; print "\n\n"; print "".getMLText('scheduler_class')."\n"; print "".getMLText('scheduler_class_description')."\n"; print "".getMLText('scheduler_class_parameter')."\n"; print "\n"; print "\n"; $errmsgs = array(); foreach($GLOBALS['SEEDDMS_SCHEDULER']['tasks'] as $extname=>$tasks) { foreach($tasks as $taskname=>$task) { echo ""; echo ""; echo $extname."::".$taskname; echo ""; echo ""; echo $task->getDescription(); echo ""; echo ""; $params = $task->getAdditionalParams(); foreach($params as $param) $k[] = $param['name']; echo implode(', ', $k); echo ""; echo ""; print "
"; $t = $scheduler->getTasksByExtension($extname, $taskname); if($t) { print ""; } print ""; print "
"; echo ""; echo ""; } } echo "\n"; } ?>
contentEnd(); $this->htmlEndPage(); } /* }}} */ } ?>