MDL-80727 tool_task: replace hard-coded adhoc task runner strings.
This commit is contained in:
@@ -80,6 +80,9 @@ $string['runnow'] = 'Run now';
|
||||
$string['runagain'] = 'Run again';
|
||||
$string['runadhoc_confirm'] = 'Tasks will run on the web server and may take some time to complete.';
|
||||
$string['runadhoc'] = 'Run ad hoc tasks now?';
|
||||
$string['runadhoctask'] = 'Run \'{$a->task}\' task ID {$a->taskid}';
|
||||
$string['runadhoctasks'] = 'Run all \'{$a}\' tasks';
|
||||
$string['runadhoctasksfailed'] = 'Run failed \'{$a}\' tasks';
|
||||
$string['runnow_confirm'] = 'Are you sure you want to run this task \'{$a}\' now? The task will run on the web server and may take some time to complete.';
|
||||
$string['runclassname'] = 'Run all';
|
||||
$string['runclassnamefailedonly'] = 'Run all failed';
|
||||
|
||||
@@ -54,13 +54,19 @@ if ($taskid) {
|
||||
throw new \moodle_exception('invalidtaskid');
|
||||
}
|
||||
$classname = $record->classname;
|
||||
$heading = "Run $classname task Id $taskid";
|
||||
$heading = get_string('runadhoctask', 'tool_task', ['task' => $classname, 'taskid' => $taskid]);
|
||||
$tasks = [core\task\manager::adhoc_task_from_record($record)];
|
||||
} else {
|
||||
if (!$classname) {
|
||||
throw new \moodle_exception('noclassname', 'tool_task');
|
||||
}
|
||||
$heading = "Run " . s($classname) . " " . ($failedonly ? "failed" : "all")." tasks";
|
||||
|
||||
$heading = get_string(
|
||||
$failedonly ? 'runadhoctasksfailed' : 'runadhoctasks',
|
||||
'tool_task',
|
||||
s($classname),
|
||||
);
|
||||
|
||||
$now = time();
|
||||
$tasks = array_filter(
|
||||
core\task\manager::get_adhoc_tasks($classname, $failedonly, true),
|
||||
|
||||
Reference in New Issue
Block a user