MDL-78088 tool_dataprivacy: Enable and return additional info

This commit is contained in:
Juan Leyva
2024-02-14 15:09:31 +01:00
parent 328b48ebc5
commit 0be4d7b2bd
4 changed files with 11 additions and 1 deletions
+2
View File
@@ -32,6 +32,7 @@ $functions = [
'capabilities' => '',
'ajax' => true,
'loginrequired' => true,
'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
],
'tool_dataprivacy_contact_dpo' => [
'classname' => 'tool_dataprivacy\external',
@@ -42,6 +43,7 @@ $functions = [
'capabilities' => '',
'ajax' => true,
'loginrequired' => true,
'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
],
'tool_dataprivacy_mark_complete' => [
'classname' => 'tool_dataprivacy\external',
+1 -1
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die;
$plugin->version = 2023100900;
$plugin->version = 2023100901;
$plugin->requires = 2023100400;
$plugin->component = 'tool_dataprivacy';
+5
View File
@@ -388,6 +388,11 @@ class api {
$CFG->searchbanner, FORMAT_HTML, $context)[0];
}
if (empty($section) || $section === 'privacysettings') {
$settings->tool_dataprivacy_contactdataprotectionofficer = get_config('tool_dataprivacy', 'contactdataprotectionofficer');
$settings->tool_dataprivacy_showdataretentionsummary = get_config('tool_dataprivacy', 'showdataretentionsummary');
}
return $settings;
}
@@ -267,6 +267,9 @@ class externallib_test extends externallib_advanced_testcase {
$expected[] = ['name' => 'searchbannerenable', 'value' => $CFG->searchbannerenable];
$expected[] = ['name' => 'searchbanner', 'value' => $CFG->searchbanner];
$expected[] = ['name' => 'tool_dataprivacy_contactdataprotectionofficer', 'value' => get_config('tool_dataprivacy', 'contactdataprotectionofficer')];
$expected[] = ['name' => 'tool_dataprivacy_showdataretentionsummary', 'value' => get_config('tool_dataprivacy', 'showdataretentionsummary')];
$this->assertCount(0, $result['warnings']);
$this->assertEquals($expected, $result['settings']);