From 7d5329f4c0149d8bec437050680c369e1860abed Mon Sep 17 00:00:00 2001 From: NinaHerrmann Date: Mon, 10 Jun 2024 17:49:16 +0200 Subject: [PATCH] Advanced tha category setting to have either a specified level or the _closest_ level --- lang/en/tool_lifecycle.php | 2 ++ settings.php | 13 +++++++++++-- version.php | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/lang/en/tool_lifecycle.php b/lang/en/tool_lifecycle.php index 8cdb5d8b..cdf3d511 100644 --- a/lang/en/tool_lifecycle.php +++ b/lang/en/tool_lifecycle.php @@ -58,6 +58,8 @@ $string['config_delay_duration_desc'] = 'This setting defines the default delay duration of a workflow in case one 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['config_enablecategoryhierachy'] = 'Enable to show a specified level of the course category hierarchy in the interaction table.'; +$string['config_enablecategoryhierachy_desc'] = 'By default the directly assigned course category is shown when teachers manage the status of their courses on the view.php. The setting enables to show a specified level of the course category tree.'; $string['config_showcoursecounts'] = 'Show amount of courses which will be triggered'; $string['config_showcoursecounts_desc'] = 'The workflow overview page by default shows the amount of courses which will be triggered by the configured triggers which can be load heavy. Disable this option if you experience issues loading the workflow diff --git a/settings.php b/settings.php index 85bdacbe..a4d4fb55 100644 --- a/settings.php +++ b/settings.php @@ -46,10 +46,19 @@ get_string('config_showcoursecounts', 'tool_lifecycle'), get_string('config_showcoursecounts_desc', 'tool_lifecycle'), 1)); - $settings->add(new admin_setting_configtext('tool_lifecycle/coursecategorydepth', + $settingenablehierachy = new admin_setting_configcheckbox('tool_lifecycle/enablecategoryhierachy', + get_string('config_enablecategoryhierachy', 'tool_lifecycle'), + get_string('config_enablecategoryhierachy_desc', 'tool_lifecycle'), + false); + // $settingenablehierachy->set_updatedcallback('tool_lifecycle_'); + $settings->add($settingenablehierachy); + $coursehierachysetting = new admin_setting_configtext('tool_lifecycle/coursecategorydepth', get_string('config_coursecategorydepth', 'tool_lifecycle'), get_string('config_coursecategorydepth_desc', 'tool_lifecycle'), - 1, PARAM_INT)); + 0, PARAM_INT); + $coursehierachysetting->add_dependent_on('tool_lifecycle/enablecategoryhierachy'); + $settings->add($coursehierachysetting); + $settings->hide_if('tool_lifecycle/coursecategorydepth', 'tool_lifecycle/enablecategoryhierachy', 'notchecked'); $ADMIN->add('lifecycle_category', new admin_externalpage('tool_lifecycle_workflow_drafts', get_string('workflow_drafts_header', 'tool_lifecycle'), diff --git a/version.php b/version.php index 8e954246..790a03d1 100644 --- a/version.php +++ b/version.php @@ -25,7 +25,7 @@ defined('MOODLE_INTERNAL') || die; $plugin->maturity = MATURITY_BETA; -$plugin->version = 2024042301; +$plugin->version = 2024042302; $plugin->component = 'tool_lifecycle'; $plugin->requires = 2022112800; // Requires Moodle 4.1+. $plugin->release = 'v4.4-r1';