From 4023f84b29640d32b50dd304f890d43a50837274 Mon Sep 17 00:00:00 2001 From: David Monllao Date: Thu, 10 May 2018 13:55:46 +0200 Subject: [PATCH] MDL-62016 tool_dataprivacy: More data registry information --- .../dataprivacy/classes/form/context_instance.php | 4 ++++ admin/tool/dataprivacy/classes/form/defaults.php | 2 ++ .../classes/output/data_registry_page.php | 6 +++++- admin/tool/dataprivacy/lang/en/tool_dataprivacy.php | 13 +++++++++++-- .../dataprivacy/templates/data_registry.mustache | 5 +++++ 5 files changed, 27 insertions(+), 3 deletions(-) diff --git a/admin/tool/dataprivacy/classes/form/context_instance.php b/admin/tool/dataprivacy/classes/form/context_instance.php index 707b290a84af9..14790b51374ba 100644 --- a/admin/tool/dataprivacy/classes/form/context_instance.php +++ b/admin/tool/dataprivacy/classes/form/context_instance.php @@ -55,6 +55,7 @@ public function definition() { $subjectscope = get_string('noassignedroles', 'tool_dataprivacy'); } $this->_form->addElement('static', 'subjectscope', get_string('subjectscope', 'tool_dataprivacy'), $subjectscope); + $this->_form->addHelpButton('subjectscope', 'subjectscope', 'tool_dataprivacy'); $this->add_purpose_category($this->_customdata['context']->contextlevel); @@ -79,6 +80,7 @@ protected function add_purpose_category($contextlevel = false) { $addcategory = $mform->createElement('button', 'addcategory', $addcategorytext, ['data-add-element' => 'category']); $mform->addElement('group', 'categorygroup', get_string('category', 'tool_dataprivacy'), [$categoryselect, $addcategory], null, false); + $mform->addHelpButton('categorygroup', 'category', 'tool_dataprivacy'); $mform->setType('categoryid', PARAM_INT); $mform->setDefault('categoryid', 0); @@ -87,12 +89,14 @@ protected function add_purpose_category($contextlevel = false) { $addpurpose = $mform->createElement('button', 'addpurpose', $addpurposetext, ['data-add-element' => 'purpose']); $mform->addElement('group', 'purposegroup', get_string('purpose', 'tool_dataprivacy'), [$purposeselect, $addpurpose], null, false); + $mform->addHelpButton('purposegroup', 'purpose', 'tool_dataprivacy'); $mform->setType('purposeid', PARAM_INT); $mform->setDefault('purposeid', 0); if (!empty($this->_customdata['currentretentionperiod'])) { $mform->addElement('static', 'retention_current', get_string('retentionperiod', 'tool_dataprivacy'), $this->_customdata['currentretentionperiod']); + $mform->addHelpButton('retention_current', 'retentionperiod', 'tool_dataprivacy'); } } diff --git a/admin/tool/dataprivacy/classes/form/defaults.php b/admin/tool/dataprivacy/classes/form/defaults.php index 74765481e19b1..4e599c3bef718 100644 --- a/admin/tool/dataprivacy/classes/form/defaults.php +++ b/admin/tool/dataprivacy/classes/form/defaults.php @@ -68,9 +68,11 @@ public function definition() { $purposeoptions = data_registry_page::category_options($this->_customdata['purposes'], false, $includeinherit); $mform->addElement('select', $categoryvar, get_string('category', 'tool_dataprivacy'), $categoryoptions); + $mform->addHelpButton($categoryvar, 'categorydefault', 'tool_dataprivacy'); $mform->setType($categoryvar, PARAM_INT); $mform->addElement('select', $purposevar, get_string('purpose', 'tool_dataprivacy'), $purposeoptions); + $mform->addHelpButton($purposevar, 'purposedefault', 'tool_dataprivacy'); $mform->setType($purposevar, PARAM_INT); } diff --git a/admin/tool/dataprivacy/classes/output/data_registry_page.php b/admin/tool/dataprivacy/classes/output/data_registry_page.php index b16bfacbea819..4a5348c253730 100644 --- a/admin/tool/dataprivacy/classes/output/data_registry_page.php +++ b/admin/tool/dataprivacy/classes/output/data_registry_page.php @@ -101,6 +101,10 @@ public function export_for_template(renderer_base $output) { $data->actions = $actionmenu->export_for_template($output); if (!data_registry::defaults_set()) { + $data->info = (object)[ + 'message' => get_string('dataregistryinfo', 'tool_dataprivacy'), + 'announce' => 1 + ]; $data->nosystemdefaults = (object)[ 'message' => get_string('nosystemdefaults', 'tool_dataprivacy'), 'announce' => 1 @@ -131,7 +135,7 @@ private function get_default_tree_structure() { 'text' => get_string('user'), 'contextlevel' => CONTEXT_USER, ], [ - 'text' => get_string('categories', 'tool_dataprivacy'), + 'text' => get_string('categories'), 'branches' => $categorybranches, 'expandelement' => 'category', ], [ diff --git a/admin/tool/dataprivacy/lang/en/tool_dataprivacy.php b/admin/tool/dataprivacy/lang/en/tool_dataprivacy.php index ea87d52025e51..fbfaedbd689bc 100644 --- a/admin/tool/dataprivacy/lang/en/tool_dataprivacy.php +++ b/admin/tool/dataprivacy/lang/en/tool_dataprivacy.php @@ -37,7 +37,10 @@ $string['cancelrequestconfirmation'] = 'Do you really want cancel this data request?'; $string['categories'] = 'Categories'; $string['category'] = 'Category'; +$string['category_help'] = 'A category in the data registry describes a type of data. A new category may be added, or if Inherit is selected, the data category from a higher context is applied. Contexts are (from low to high): Blocks > Activity modules > Courses > Course categories > Site.'; $string['categorycreated'] = 'Category created'; +$string['categorydefault'] = 'Default category'; +$string['categorydefault_help'] = 'The default category is the data category applied to any new instances. If Inherit is selected, the data category from a higher context is applied. Contexts are (from low to high): Blocks > Activity modules > Courses > Course categories > User > Site.'; $string['categorieslist'] = 'List of data categories'; $string['categoryupdated'] = 'Category updated'; $string['close'] = 'Close'; @@ -58,11 +61,12 @@ $string['createcategory'] = 'Create data category'; $string['createpurpose'] = 'Create data purpose'; $string['datadeletion'] = 'Data deletion'; -$string['datadeletionpagehelp'] = 'This page lists the contexts that are already past their retention period and need to be confirmed for user data deletion. Once the selected contexts have been confirmed for deletion, the user data related to these contexts will be deleted on the next execution of the "Delete expired contexts" scheduled task.'; +$string['datadeletionpagehelp'] = 'Data for which the retention period has expired are listed here. Please review and confirm data deletion, which will then be executed by the "Delete expired contexts" scheduled task.'; $string['dataprivacy:makedatarequestsforchildren'] = 'Make data requests for minors'; $string['dataprivacy:managedatarequests'] = 'Manage data requests'; $string['dataprivacy:managedataregistry'] = 'Manage data registry'; $string['dataregistry'] = 'Data registry'; +$string['dataregistryinfo'] = 'The data registry enables categories (types of data) and purposes (the reasons for processing data) to be set for all content on the site - from users and courses down to activities and blocks. For each purpose, a retention period may be set. When a retention period has expired, the data is flagged and listed for deletion, awaiting admin confirmation.'; $string['datarequestemailsubject'] = 'Data request: {$a}'; $string['datarequests'] = 'Data requests'; $string['daterequested'] = 'Date requested'; @@ -156,7 +160,7 @@ $string['noblockstoload'] = 'No blocks'; $string['nocategories'] = 'There are no categories yet'; $string['nocoursestoload'] = 'No activities'; -$string['noexpiredcontexts'] = 'There are no expired contexts in this level that need to be confirmed for deletion.'; +$string['noexpiredcontexts'] = 'This context level has no data for which the retention period has expired.'; $string['nopersonaldatarequests'] = 'You don\'t have any personal data requests'; $string['nopurposes'] = 'There are no purposes yet'; $string['nosubjectaccessrequests'] = 'There are no data requests that you need to act on'; @@ -174,7 +178,10 @@ $string['protected'] = 'Protected'; $string['protectedlabel'] = 'The retention of this data has a higher legal precedent over a user\'s request to be forgotten. This data will only be deleted after the retention period has expired.'; $string['purpose'] = 'Purpose'; +$string['purpose_help'] = 'The purpose describes the reason for processing the data. A new purpose may be added, or if Inherit is selected, the purpose from a higher context is applied. Contexts are (from low to high): Blocks > Activity modules > Courses > Course categories > User > Site.'; $string['purposecreated'] = 'Purpose created'; +$string['purposedefault'] = 'Default purpose'; +$string['purposedefault_help'] = 'The default purpose is the purpose which is applied to any new instances. If Inherit is selected, the purpose from a higher context is applied. Contexts are (from low to high): Blocks > Activity modules > Courses > Course categories > User > Site.'; $string['purposes'] = 'Purposes'; $string['purposeslist'] = 'List of data purposes'; $string['purposeupdated'] = 'Purpose updated'; @@ -201,6 +208,7 @@ $string['resultdownloadready'] = 'Your copy of your personal data in {$a} that you recently requested is now available for download. Please click on the link below to go to the download page.'; $string['reviewdata'] = 'Review data'; $string['retentionperiod'] = 'Retention period'; +$string['retentionperiod_help'] = 'The retention period specifies the length of time that data should be kept for. When the retention period has expired, the data is flagged and listed for deletion, awaiting admin confirmation.'; $string['retentionperiodnotdefined'] = 'No retention period was defined'; $string['retentionperiodzero'] = 'No retention period'; $string['send'] = 'Send'; @@ -217,6 +225,7 @@ $string['statuspending'] = 'Pending'; $string['statusrejected'] = 'Rejected'; $string['subjectscope'] = 'Subject scope'; +$string['subjectscope_help'] = 'The subject scope lists the roles which may be assigned in this context.'; $string['user'] = 'User'; $string['viewrequest'] = 'View the request'; $string['visible'] = 'Expand all'; diff --git a/admin/tool/dataprivacy/templates/data_registry.mustache b/admin/tool/dataprivacy/templates/data_registry.mustache index e4aa0c6bbdac0..fb86ae901673e 100644 --- a/admin/tool/dataprivacy/templates/data_registry.mustache +++ b/admin/tool/dataprivacy/templates/data_registry.mustache @@ -41,6 +41,11 @@ {{> core/action_menu}} {{/actions}} + {{#info}} +
+ {{> core/notification_info}} +
+ {{/info}} {{#nosystemdefaults}}
{{> core/notification_warning}}