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

Delays: cleanup

parent 755c8e0f
No related branches found
No related tags found
No related merge requests found
......@@ -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
*/
......
......@@ -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) {
......
......@@ -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}';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment