Add getactivejob API
This commit is contained in:
parent
b6c6c28d6c
commit
bd07f7e9dc
4
api.php
4
api.php
@ -140,6 +140,10 @@ switch ($VARS['action']) {
|
||||
$out[] = $job;
|
||||
}
|
||||
exit(json_encode(["status" => "OK", "jobs" => $out]));
|
||||
case "getactivejob":
|
||||
$jobs = [];
|
||||
$job = $database->get('job_tracking', ['[>]jobs' => ['jobid']], ['jobs.jobid (id)', 'jobname (name)', 'color', 'start'], ["AND" => ["uid" => $userinfo['uid'], 'end' => null]]);
|
||||
exit(json_encode(["status" => "OK", "job" => $job]));
|
||||
case "setjob":
|
||||
if (is_empty($VARS['job'])) {
|
||||
exit(json_encode(["status" => "ERROR", "msg" => lang("invalid job", false)]));
|
||||
|
Loading…
x
Reference in New Issue
Block a user