mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-08 07:39:27 +00:00
cd815acdbf
- 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
52 lines
1.3 KiB
PHP
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));
|
|
}
|
|
}
|