From e79fa7c94d1818c3bcac13b9146c78bbbfaec566 Mon Sep 17 00:00:00 2001 From: Justus Dieckmann <justusdieckmann@wwu.de> Date: Thu, 26 Sep 2019 18:24:39 +0200 Subject: [PATCH] Delays: cleanup --- classes/form/form_delays_filter.php | 14 -------------- delayedcourses.php | 16 ++++++++-------- lang/en/tool_lifecycle.php | 5 +++-- 3 files changed, 11 insertions(+), 24 deletions(-) diff --git a/classes/form/form_delays_filter.php b/classes/form/form_delays_filter.php index f262d60..3e41611 100644 --- a/classes/form/form_delays_filter.php +++ b/classes/form/form_delays_filter.php @@ -44,20 +44,6 @@ require_once($CFG->libdir . '/formslib.php'); */ class form_delays_filter extends \moodleform { - /** - * @var $cache cache the cache to get stored data from; - */ - private $cache; - - /** - * Constructor - * - * @param \moodle_url $url . - */ - public function __construct($url) { - parent::__construct($url); - } - /** * Defines forms elements */ diff --git a/delayedcourses.php b/delayedcourses.php index 8d93f5e..8957dbf 100644 --- a/delayedcourses.php +++ b/delayedcourses.php @@ -74,25 +74,25 @@ if ($action) { $categoryid = optional_param('catid', null, PARAM_INT); $params = []; - $where_course = []; + $whereforcourse = []; if ($coursename) { - $where_course[] = 'c.fullname LIKE :cname'; + $whereforcourse[] = 'c.fullname LIKE :cname'; $params['cname'] = '%' . $DB->sql_like_escape($coursename) . '%'; } if ($categoryid) { - $where_course[] = 'cat.id = :catid'; + $whereforcourse[] = 'cat.id = :catid'; $params['catid'] = $categoryid; } - $where_course = implode(' AND ', $where_course); + $whereforcourse = implode(' AND ', $whereforcourse); if ($deleteglobal) { $sql = 'DELETE FROM {tool_lifecycle_delayed} d '; - if ($where_course) { + if ($whereforcourse) { $sql .= 'WHERE d.courseid IN ( ' . 'SELECT c.id FROM {course} c ' . 'JOIN {course_categories} cat ON c.category = cat.id ' . - 'WHERE ' . $where_course . + 'WHERE ' . $whereforcourse . ')'; } $DB->execute($sql, $params); @@ -101,11 +101,11 @@ if ($action) { if ($deleteseperate) { $sql = 'DELETE FROM {tool_lifecycle_delayed_workf} dw ' . 'WHERE TRUE '; - if ($where_course) { + if ($whereforcourse) { $sql .= 'AND dw.courseid IN ( ' . 'SELECT c.id FROM {course} c ' . 'JOIN {course_categories} cat ON c.category = cat.id ' . - 'WHERE ' . $where_course . + 'WHERE ' . $whereforcourse . ')'; } if ($workflowfilterid) { diff --git a/lang/en/tool_lifecycle.php b/lang/en/tool_lifecycle.php index a8cc60b..95755a1 100644 --- a/lang/en/tool_lifecycle.php +++ b/lang/en/tool_lifecycle.php @@ -175,7 +175,7 @@ $string['restore_subplugins_invalid'] = 'Wrong format of the backup file. The st $string['restore_step_does_not_exist'] = 'The step {$a} is not installed, but is included in the backup file. Please installed it first and try again.'; $string['restore_trigger_does_not_exist'] = 'The trigger {$a} is not installed, but is included in the backup file. Please installed it first and try again.'; -// Events +// Events. $string['process_triggered_event'] = 'A process has been triggered'; $string['process_proceeded_event'] = 'A process has been proceeded'; $string['process_rollback_event'] = 'A process has been rolled back'; @@ -189,7 +189,8 @@ $string['privacy:metadata:tool_lifecycle_action_log:stepindex'] = 'Index of the $string['privacy:metadata:tool_lifecycle_action_log:time'] = 'Time when the action was done.'; $string['privacy:metadata:tool_lifecycle_action_log:userid'] = 'ID of the user that did the action.'; $string['privacy:metadata:tool_lifecycle_action_log:action'] = 'Identifier of the action that was done.'; -// Delays + +// Delays. $string['delayed_courses_header'] = 'Delayed courses'; $string['delete_delay'] = 'Delete delay'; $string['globally_until_date'] = 'Globally until {$a}'; -- GitLab