$nextrun = $asap;
}
+ $runnow = '';
+ if (!$disabled && get_config('tool_task', 'enablerunnow')) {
+ $runnow = html_writer::div(html_writer::link(
+ new moodle_url('/admin/tool/task/schedule_task.php',
+ array('task' => get_class($task))),
+ get_string('runnow', 'tool_task')), 'task-runnow');
+ }
+
$row = new html_table_row(array(
$namecell,
$componentcell,
new html_table_cell($editlink),
- new html_table_cell($lastrun),
+ new html_table_cell($lastrun . $runnow),
new html_table_cell($nextrun),
new html_table_cell($task->get_minute()),
new html_table_cell($task->get_hour()),
$table->data = $data;
return html_writer::table($table);
}
+
+ /**
+ * Renders a link back to the scheduled tasks page (used from the 'run now' screen).
+ *
+ * @return string HTML code
+ */
+ public function link_back() {
+ return $this->render_from_template('tool_task/link_back',
+ array('url' => new moodle_url('/admin/tool/task/scheduledtasks.php')));
+ }
}