Skip to content
Snippets Groups Projects
Unverified Commit 4771d23a authored by Tobias Reischmann's avatar Tobias Reischmann
Browse files

Fixed global config lifecycle_duration being a local config

parent 51c2ef9c
No related branches found
No related tags found
No related merge requests found
......@@ -90,7 +90,7 @@ class form_workflow_instance extends \moodleform {
if (isset($this->workflow)) {
$mform->setDefault($elementname, $this->workflow->rollbackdelay);
} else {
$mform->setDefault($elementname, get_config(null, 'lifecycle_duration'));
$mform->setDefault($elementname, get_config('tool_lifecycle', 'duration'));
}
$elementname = 'finishdelay';
......@@ -100,7 +100,7 @@ class form_workflow_instance extends \moodleform {
if (isset($this->workflow)) {
$mform->setDefault($elementname, $this->workflow->finishdelay);
} else {
$mform->setDefault($elementname, get_config(null, 'lifecycle_duration'));
$mform->setDefault($elementname, get_config('tool_lifecycle', 'duration'));
}
$elementname = 'delayforallworkflows';
......
......@@ -409,5 +409,18 @@ function xmldb_tool_lifecycle_upgrade($oldversion) {
upgrade_plugin_savepoint(true, 2019082200, 'tool', 'lifecycle');
}
if ($oldversion < 2019082300) {
$duration = get_config(null, 'lifecycle_duration');
unset_config('lifecycle_duration');
set_config('duration', $duration, 'tool_lifecycle');
// Lifecycle savepoint reached.
upgrade_plugin_savepoint(true, 2019082300, 'tool', 'lifecycle');
}
return true;
}
\ No newline at end of file
......@@ -29,8 +29,10 @@ $string['plugintitle'] = 'Course Life Cycle';
$string['lifecycle:managecourses'] = 'May manage courses in tool_lifecycle';
$string['general_config_header'] = "General & Subplugins";
$string['config_delay_duration'] = 'Duration of a course delay';
$string['config_delay_duration_desc'] = 'After roll back via user interaction, this setting specifies the time span for which a course will be exempted from all processes.';
$string['config_delay_duration'] = 'Default duration of a course delay';
$string['config_delay_duration_desc'] = 'This setting defines the default delay duration of a workflow
in case on of its processes is rolled back or finishes.
The delay duration determines how long a course will be excepted from being processed again in either of the cases.';
$string['active_processes_list_header'] = 'Active Processes';
$string['adminsettings_heading'] = 'Workflow Settings';
$string['active_manual_workflows_heading'] = 'Active Manual Workflows';
......
......@@ -33,7 +33,7 @@ if ($hassiteconfig) {
get_string('general_config_header', 'tool_lifecycle'));
$ADMIN->add('lifecycle_category', $settings);
$settings->add(new admin_setting_configduration('lifecycle_duration',
$settings->add(new admin_setting_configduration('tool_lifecycle/duration',
get_string('config_delay_duration', 'tool_lifecycle'),
get_string('config_delay_duration_desc', 'tool_lifecycle'),
183 * 24 * 60 * 60)); // Dafault value is 180 days.
......
......@@ -24,7 +24,7 @@
defined('MOODLE_INTERNAL') || die;
$plugin->maturity = MATURITY_ALPHA;
$plugin->version = 2019082200;
$plugin->version = 2019082300;
$plugin->component = 'tool_lifecycle';
$plugin->requires = 2017111300; // Require Moodle 3.4 (or above).
$plugin->release = 'v3.6-r1';
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment