mirror of
https://github.com/moodle/moodle.git
synced 2025-04-20 07:56:06 +02:00
MDL-79128 adhoc_task: Added 'Never' status for ad-hoc task Next run
Co-authored-by: Stevani Andolo <stevani.andolo@moodle.com>
This commit is contained in:
parent
f13392d230
commit
bd3af64741
@ -119,7 +119,9 @@ class tool_task_renderer extends plugin_renderer_base {
|
||||
|
||||
// Prepares the next run time cell contents.
|
||||
$nextrun = '';
|
||||
if ($stats['due'] > 0) {
|
||||
if ($stats['stop']) {
|
||||
$nextrun = get_string('never', 'admin');
|
||||
} else if ($stats['due'] > 0) {
|
||||
$nextrun = get_string('asap', 'tool_task');
|
||||
} else if ($stats['nextruntime']) {
|
||||
$nextrun = userdate($stats['nextruntime']);
|
||||
@ -271,7 +273,11 @@ class tool_task_renderer extends plugin_renderer_base {
|
||||
if (!$started) {
|
||||
$nextruntime = $task->get_next_run_time();
|
||||
$due = $nextruntime < $now;
|
||||
$nextrun = $due ? userdate($nextruntime) : get_string('asap', 'tool_task');
|
||||
if ($task->get_attempts_available() > 0) {
|
||||
$nextrun = $due ? userdate($nextruntime) : get_string('asap', 'tool_task');
|
||||
} else {
|
||||
$nextrun = get_string('never', 'admin');
|
||||
}
|
||||
|
||||
if ($wantruntasks && ($faildelay || $due)) {
|
||||
$nextrun .= ' '.html_writer::div(
|
||||
|
@ -543,6 +543,7 @@ class manager {
|
||||
'failed' => 0,
|
||||
'running' => 0,
|
||||
'due' => 0,
|
||||
'stop' => false,
|
||||
];
|
||||
}
|
||||
|
||||
@ -564,6 +565,11 @@ class manager {
|
||||
}
|
||||
}
|
||||
|
||||
// Mark the task as stopped if it has no attempts available.
|
||||
if (isset($r->attemptsavailable) && $r->attemptsavailable == 0) {
|
||||
$classsummary['stop'] = true;
|
||||
}
|
||||
|
||||
$summary[$r->component][$r->classname] = $classsummary;
|
||||
}
|
||||
return $summary;
|
||||
|
Loading…
x
Reference in New Issue
Block a user