Skip to content
Snippets Groups Projects
Commit 00774c52 authored by Justus Dieckmann's avatar Justus Dieckmann Committed by Tobias Reischmann
Browse files

Delays: Add coursename and category filtering

parent 195d4b5d
No related branches found
No related tags found
No related merge requests found
......@@ -47,6 +47,9 @@ class delayed_courses_table extends \table_sql {
public function __construct($filterdata) {
parent::__construct('tool_lifecycle-delayed-courses');
global $DB;
$DB->set_debug(true);
$fields = 'c.id as courseid, c.fullname as coursefullname, cat.name as category, ';
$selectseperatedelays = true;
......@@ -119,6 +122,17 @@ class delayed_courses_table extends \table_sql {
$where = 'true ';
if ($filterdata && $filterdata->category) {
$where .= 'AND cat.id = :catid ';
$params['catid'] = $filterdata->category;
}
if ($filterdata && $filterdata->coursename) {
global $DB;
$where .= 'AND c.fullname LIKE \'%' . $DB->sql_like_escape($filterdata->coursename) . '%\' ';
$params['cname'] = $filterdata->coursename;
}
$this->set_sql($fields, $from, $where, $params);
$this->column_nosort = ['workflow', 'tools'];
$this->define_columns(['coursefullname', 'category', 'workflow', 'tools']);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment