Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
moodle-tool_lifecycle
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elc
moodle-tool_lifecycle
Commits
86ba8cca
Unverified
Commit
86ba8cca
authored
8 years ago
by
Tobias Reischmann
Browse files
Options
Downloads
Patches
Plain Diff
Added config for delay_duration
parent
9b5c9640
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
classes/manager/process_manager.php
+2
-2
2 additions, 2 deletions
classes/manager/process_manager.php
lang/en/tool_cleanupcourses.php
+2
-0
2 additions, 0 deletions
lang/en/tool_cleanupcourses.php
settings.php
+5
-0
5 additions, 0 deletions
settings.php
with
9 additions
and
2 deletions
classes/manager/process_manager.php
+
2
−
2
View file @
86ba8cca
...
@@ -119,8 +119,9 @@ class process_manager {
...
@@ -119,8 +119,9 @@ class process_manager {
* @param process $process process the rollback should be triggered for.
* @param process $process process the rollback should be triggered for.
*/
*/
public
static
function
rollback_process
(
$process
)
{
public
static
function
rollback_process
(
$process
)
{
global
$CFG
;
// TODO: Add logic to revert changes made by steps.
// TODO: Add logic to revert changes made by steps.
delayed_courses_manager
::
set_course_delayed
(
$process
->
courseid
,
60
);
delayed_courses_manager
::
set_course_delayed
(
$process
->
courseid
,
$CFG
->
cleanupcourses_duration
);
self
::
remove_process
(
$process
);
self
::
remove_process
(
$process
);
}
}
...
@@ -132,6 +133,5 @@ class process_manager {
...
@@ -132,6 +133,5 @@ class process_manager {
global
$DB
;
global
$DB
;
$DB
->
delete_records
(
'tool_cleanupcourses_procdata'
,
array
(
'processid'
=>
$process
->
id
));
$DB
->
delete_records
(
'tool_cleanupcourses_procdata'
,
array
(
'processid'
=>
$process
->
id
));
$DB
->
delete_records
(
'tool_cleanupcourses_process'
,
(
array
)
$process
);
$DB
->
delete_records
(
'tool_cleanupcourses_process'
,
(
array
)
$process
);
delayed_courses_manager
::
remove_delay_entry
(
$process
->
courseid
);
}
}
}
}
This diff is collapsed.
Click to expand it.
lang/en/tool_cleanupcourses.php
+
2
−
0
View file @
86ba8cca
...
@@ -28,6 +28,8 @@ $string['pluginname'] = 'Cleanup Courses';
...
@@ -28,6 +28,8 @@ $string['pluginname'] = 'Cleanup Courses';
$string
[
'plugintitle'
]
=
'Cleanup Courses'
;
$string
[
'plugintitle'
]
=
'Cleanup Courses'
;
$string
[
'general_config_header'
]
=
"General & Subplugins"
;
$string
[
'general_config_header'
]
=
"General & Subplugins"
;
$string
[
'config_delay_duration'
]
=
'Duration of a course delay'
;
$string
[
'config_delay_duration_desc'
]
=
'Defines the time frame, which a course is excluded from the cleanup course, when rolled back via user interaction.'
;
$string
[
'active_processes_list_header'
]
=
'Active Processes'
;
$string
[
'active_processes_list_header'
]
=
'Active Processes'
;
$string
[
'subpluginssettings_heading'
]
=
'Subplugin Workflow'
;
$string
[
'subpluginssettings_heading'
]
=
'Subplugin Workflow'
;
$string
[
'subpluginssettings_trigger_heading'
]
=
'Trigger Definition'
;
$string
[
'subpluginssettings_trigger_heading'
]
=
'Trigger Definition'
;
...
...
This diff is collapsed.
Click to expand it.
settings.php
+
5
−
0
View file @
86ba8cca
...
@@ -33,6 +33,11 @@ if ($hassiteconfig) {
...
@@ -33,6 +33,11 @@ if ($hassiteconfig) {
get_string
(
'general_config_header'
,
'tool_cleanupcourses'
));
get_string
(
'general_config_header'
,
'tool_cleanupcourses'
));
$ADMIN
->
add
(
'cleanupcourses_category'
,
$settings
);
$ADMIN
->
add
(
'cleanupcourses_category'
,
$settings
);
$settings
->
add
(
new
admin_setting_configduration
(
'cleanupcourses_duration'
,
get_string
(
'config_delay_duration'
,
'tool_cleanupcourses'
),
get_string
(
'config_delay_duration_desc'
,
'tool_cleanupcourses'
),
183
*
24
*
60
*
60
));
// Dafault value is 180 days.
$ADMIN
->
add
(
'cleanupcourses_category'
,
new
tool_cleanupcourses\admin_page_active_processes
());
$ADMIN
->
add
(
'cleanupcourses_category'
,
new
tool_cleanupcourses\admin_page_active_processes
());
$ADMIN
->
add
(
'cleanupcourses_category'
,
new
tool_cleanupcourses\admin_page_sublugins
());
$ADMIN
->
add
(
'cleanupcourses_category'
,
new
tool_cleanupcourses\admin_page_sublugins
());
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment