Commit 5f27da1e authored by Maria Sorica's avatar Maria Sorica Committed by Robert Lyon

Bug 1746259: Withdraw consent to the T&C

1. Change the user manu item name from
Settings -> Privacy statement to Settings -> Legal.
2. Display T&C on the user's Legal page.
3. Allow T&C consent withdraw.

behatnotneeded

Change-Id: I08e5d97fc5ee712d3b930881aa97de6b2486ead4
parent 2814975b
......@@ -16,7 +16,7 @@ define('SECTION_PLUGINNAME', 'account');
define('SECTION_PAGE', 'userprivacy');
require(dirname(dirname(__FILE__)) . '/init.php');
require_once(get_config('docroot') . 'lib/user.php');
define('TITLE', get_string('privacy', 'admin'));
define('TITLE', get_string('legal', 'admin'));
if (!is_logged_in()) {
throw new AccessDeniedException();
......@@ -24,8 +24,7 @@ if (!is_logged_in()) {
$form = privacy_form();
// JQuery logic for panel hide/show.
// Needed here because there are multiple dropdown panels on this page.
// JQuery logic for panel hide/show submit button.
$js = <<< EOF
$( document ).ready(function() {
$(".state-label").click(function() {
......@@ -33,19 +32,9 @@ $js = <<< EOF
showSubmitButton();
});
});
function showSubmitButton() {
if ($('body').find(".redraw-consent").length == 0) {
$('#agreetoprivacy_submit_container').addClass('js-hidden');
$('#agreetoprivacy_submit').addClass('js-hidden');
}
else {
$('#agreetoprivacy_submit_container').removeClass('js-hidden');
$('#agreetoprivacy_submit').removeClass('js-hidden');
}
}
EOF;
$smarty = smarty();
$smarty = smarty(array('privacy'));
setpageicon($smarty, 'icon-umbrella');
$smarty->assign('form', $form);
......
......@@ -61,3 +61,16 @@ function reloadUsers() {
}
window.location.href = config.wwwroot + 'admin/users/institutionprivacy.php?institution=' + $('#usertypeselect_institution').val() + appendfs;
}
// User's Legal page: show the submit button if the user changes
// the value of one or more switches from YES to NO.
function showSubmitButton() {
if ($('body').find(".redraw-consent").length == 0) {
$('#agreetoprivacy_submit_container').addClass('js-hidden');
$('#agreetoprivacy_submit').addClass('js-hidden');
}
else {
$('#agreetoprivacy_submit_container').removeClass('js-hidden');
$('#agreetoprivacy_submit').removeClass('js-hidden');
}
}
\ No newline at end of file
......@@ -1352,7 +1352,7 @@ $string['privacyversionfor'] = 'Privacy statement for version "%s" is as follows
$string['termsversionfor'] = 'Terms and conditions for version "%s" is as follows:';
$string['institutionprivacystatement'] = 'Institution privacy statement';
$string['institutiontermsstatement'] = 'Institution terms and conditions';
$string['userprivacypagedescription'] = 'Displayed are the current privacy statements to which you consented.';
$string['userprivacypagedescription'] = 'Displayed are the current privacy statements and terms and conditions to which you consented.';
$string['lastupdated'] = 'Last updated on';
$string['newprivacy'] = 'Before entering your account, please read the information displayed below.';
$string['privacyagreement'] = 'I consent to this %s';
......
......@@ -3254,7 +3254,7 @@ function get_latest_privacy_versions($institutions = array(), $ignoreagreevalue
GROUP BY institution, type) s2 ON s.institution = s2.institution AND s.id = s2.current
" . $useragreementsql . "
WHERE s.institution IN (" . join(',',array_map('db_quote',$institutions)) . ")
ORDER BY site", $params);
ORDER BY site, type", $params);
return $latestversions;
}
......
......@@ -3044,7 +3044,7 @@ function right_nav() {
'settings/privacy' => array(
'path' => 'settings/privacy',
'url' => 'account/userprivacy.php',
'title' => get_string('privacy', 'admin'),
'title' => get_string('legal', 'admin'),
'weight' => 30
),
'settings/notifications' => array(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment