MDL-63013 tool_policy: Change acceptance flow for policies with own page
commit362ae1b4434a4d6f55321edf1449a100229015f6
authorDavid Mudrák <david@moodle.com>
Wed, 29 Aug 2018 21:43:57 +0000 (29 23:43 +0200)
committerDavid Mudrák <david@moodle.com>
Wed, 19 Sep 2018 07:55:42 +0000 (19 09:55 +0200)
tree55111d4726fb1014f1fa6a1b09345914b14a0ec6
parent23b663ed55f9fcb65a905655654c00143d19f8e1
MDL-63013 tool_policy: Change acceptance flow for policies with own page

The idea of the patch is to check the list of policies that are shown
before and on the consent page. If that list contains a policy that is
supposed to be accepted on its own page, the existing flow is
interrupted and the user is redirected to a view.php to display that
particular policy.

The view template for such a policy contains a button for getting the
user agreement. When pressed, the policy is marked as accepted and we
can go to start again.

To make this working during the signup, we need to extend the existing
logic and start tracking which particular policies the visitor accepted
prior reaching the signup form. Similarly, we need to start track which
particular policies were displayed and use that list when evaluating
which policies were unchecked on the consent page.
admin/tool/policy/classes/output/page_agreedocs.php
admin/tool/policy/classes/output/page_viewdoc.php
admin/tool/policy/index.php
admin/tool/policy/templates/page_agreedocs.mustache
admin/tool/policy/templates/page_viewdoc.mustache