Files
FHC-Core/application/controllers/system/jq/JobsQueueManager.php
T
Paolo cd815acdbf - Added new constant BEGINNING_OF_TIME
- Added new config entry job_type_permissions_white_list in jqm.php
- Added new navigation entry jobsqueueviewer
- Added new model application/models/system/JobsQueue_model.php
- Added new option in FilterWidget for hours comparison with dates
- Added new filter core-jq-lastHour to system/filtersupdate.php
- Added new statements to system/dbupdate_3.3.php to create tables system.tbl_jobstatuses, system.tbl_jobtypes and system.tbl_jobstatuses
- Added new views application/views/system/jq/jobsQueueViewer.php and application/views/system/jq/jobsQueueViewerData.php
2020-03-05 15:57:06 +01:00

52 lines
1.3 KiB
PHP

<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* This controller acts as REST JSON interface between the JobsQueueLib, that contains all the needed functionalities to
* operate with the Jobs Queue System, and other tools that cannot access directly to such library
*/
class JobsQueueManager extends Auth_Controller
{
/**
* Constructor
*/
public function __construct()
{
parent::__construct(
array(
'getJobsByType' => 'admin:r',
'addNewJobsToQueue' => 'admin:rw'
)
);
// Loads JobsQueueLib
$this->load->library('JobsQueueLib');
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* To get all the most recently added jobs using the given job type
*/
public function getLastJobs()
{
$type = $this->input->get(JobsQueueLib::PARAM_JOB_TYPE);
$this->outputJson($this->jobsqueuelib->getLastJobs($type));
}
/**
* Add new jobs in the jobs queue with the given type
* jobs is an array of job objects
*/
public function addNewJobsToQueue()
{
$type = $this->input->post(JobsQueueLib::PARAM_JOB_TYPE);
$jobs = $this->input->post(JobsQueueLib::PARAM_JOBS);
$this->outputJson($this->jobsqueuelib->addNewJobsToQueue($type, $jobs));
}
}