Skip to content
Permalink
Browse files
Merge branch 'MDL-62414-master' of git://github.com/junpataleta/moodle
  • Loading branch information
David Monllao committed May 14, 2018
2 parents 05dcf35 + f946d87 commit 4557b4e0651f0e9fffb2b2244088ed590c8f050b
Showing with 14 additions and 3 deletions.
  1. +8 −2 admin/tool/dataprivacy/createdatarequest.php
  2. +5 −1 admin/tool/dataprivacy/createdatarequest_form.php
  3. +1 −0 admin/tool/dataprivacy/lang/en/tool_dataprivacy.php
@@ -57,7 +57,7 @@
redirect($returnurl, get_string('contactdpoviaprivacypolicy', 'tool_dataprivacy'), \core\output\notification::NOTIFY_ERROR);
}

$mform = new tool_dataprivacy_data_request_form($url->out(false));
$mform = new tool_dataprivacy_data_request_form($url->out(false), ['manage' => !empty($manage)]);

// Data request cancelled.
if ($mform->is_cancelled()) {
@@ -68,7 +68,13 @@
if ($data = $mform->get_data()) {
\tool_dataprivacy\api::create_data_request($data->userid, $data->type, $data->comments);

redirect($returnurl, get_string('requestsubmitted', 'tool_dataprivacy'));
if ($manage) {
$foruser = core_user::get_user($data->userid);
$redirectmessage = get_string('datarequestcreatedforuser', 'tool_dataprivacy', fullname($foruser));
} else {
$redirectmessage = get_string('requestsubmitted', 'tool_dataprivacy');
}
redirect($returnurl, $redirectmessage);
}

$title = get_string('contactdataprotectionofficer', 'tool_dataprivacy');
@@ -38,6 +38,9 @@
*/
class tool_dataprivacy_data_request_form extends moodleform {

/** @var bool Flag to indicate whether this form is being rendered for managing data requests or for regular requests. */
protected $manage = false;

/**
* Form definition.
*
@@ -49,7 +52,8 @@ public function definition() {
global $DB, $USER;
$mform =& $this->_form;

if (api::is_site_dpo($USER->id)) {
$this->manage = $this->_customdata['manage'];
if ($this->manage) {
$options = [
'ajax' => 'tool_dataprivacy/form-user-selector',
'multiple' => false
@@ -67,6 +67,7 @@
$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['datarequestcreatedforuser'] = 'Data request created for {$a}';
$string['datarequestemailsubject'] = 'Data request: {$a}';
$string['datarequests'] = 'Data requests';
$string['daterequested'] = 'Date requested';

0 comments on commit 4557b4e

Please sign in to comment.