From 15ed7d938ec48cb3ff2f952a3cf9e9a2553575cf Mon Sep 17 00:00:00 2001 From: Sara Arjona Date: Sun, 13 May 2018 20:42:04 +0200 Subject: [PATCH 1/2] MDL-62418 tool_policy: Display blocks in Consent page when using clean --- admin/tool/policy/classes/output/page_agreedocs.php | 1 - admin/tool/policy/index.php | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/tool/policy/classes/output/page_agreedocs.php b/admin/tool/policy/classes/output/page_agreedocs.php index 6fb53308ada..82201c6d845 100644 --- a/admin/tool/policy/classes/output/page_agreedocs.php +++ b/admin/tool/policy/classes/output/page_agreedocs.php @@ -295,7 +295,6 @@ class page_agreedocs implements renderable, templatable { // Page setup. $PAGE->set_context(context_system::instance()); - $PAGE->set_pagelayout('standard'); $PAGE->set_url($myurl); $PAGE->set_heading($SITE->fullname); $PAGE->set_title(get_string('policiesagreements', 'tool_policy')); diff --git a/admin/tool/policy/index.php b/admin/tool/policy/index.php index c420c5f0837..4be85548368 100644 --- a/admin/tool/policy/index.php +++ b/admin/tool/policy/index.php @@ -41,6 +41,7 @@ $agreedocs = optional_param_array('agreedoc', null, PARAM_INT); $behalfid = optional_param('userid', null, PARAM_INT); $PAGE->set_context(context_system::instance()); +$PAGE->set_pagelayout('standard'); $PAGE->set_url('/admin/tool/policy/index.php'); $PAGE->set_popup_notification_allowed(false); From 5bf7f59a199e2722551fa2ba393db0900440f873 Mon Sep 17 00:00:00 2001 From: Sara Arjona Date: Sun, 13 May 2018 21:26:47 +0200 Subject: [PATCH 2/2] MDL-62418 tool_policy: Redirect always to home when agreed all policies --- admin/tool/policy/classes/output/page_agreedocs.php | 4 +--- admin/tool/policy/tests/behat/acceptances.feature | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/admin/tool/policy/classes/output/page_agreedocs.php b/admin/tool/policy/classes/output/page_agreedocs.php index 82201c6d845..5ede1610a2b 100644 --- a/admin/tool/policy/classes/output/page_agreedocs.php +++ b/admin/tool/policy/classes/output/page_agreedocs.php @@ -278,9 +278,7 @@ class page_agreedocs implements renderable, templatable { // and $SESSION->wantsurl is defined, redirect to the return page. $hasagreedsignupuser = empty($USER->id) && $this->signupuserpolicyagreed; $hasagreedloggeduser = $USER->id == $userid && !empty($USER->policyagreed); - $canrevoke = api::can_revoke_policies($USER->id); - if (!is_siteadmin() && ($hasagreedsignupuser || - ($hasagreedloggeduser && !$canrevoke))) { + if (!is_siteadmin() && ($hasagreedsignupuser || $hasagreedloggeduser)) { $this->redirect_to_previous_url(); } diff --git a/admin/tool/policy/tests/behat/acceptances.feature b/admin/tool/policy/tests/behat/acceptances.feature index 02588bd82c3..b8c6d6e8066 100644 --- a/admin/tool/policy/tests/behat/acceptances.feature +++ b/admin/tool/policy/tests/behat/acceptances.feature @@ -80,6 +80,7 @@ Feature: Viewing acceptances reports and accepting on behalf of other users And I press "Next" And I set the field "I agree to the This site policy" to "1" And I press "Next" + And I should not see "Next" And I navigate to "Users > Privacy and policies > Manage policies" in site administration And I click on "1 of 4 (25%)" "link" in the "This site policy" "table_row" And I click on "Consent not given" "link" in the "User One" "table_row"