Compare commits

...

1953 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7) 9650f3f56f Moodle release 3.4.9 2019-05-11 23:17:37 +02:00
Eloy Lafuente (stronk7) d44c73e438 weekly release 3.4.8+ 2019-05-10 20:31:09 +02:00
Eloy Lafuente (stronk7) 3020929da8 Merge branch 'install_34_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_34_STABLE 2019-05-10 20:31:07 +02:00
Michael Hawkins 3f4f2da9e0 MDL-61738 messageinbound: Fix quota checks & filesize for email uploads
Private files uploaded by email will now honour the file quota limit,
because the filesize is set correctly and checked against users'
remaining personal quota limit. Previously, attachment size was always
set to zero, and quota was checked against the draft area (this is
not valid for email uploads, because each file is moved out of the
draft area as it is processed, so multiple files totalling greater
than the remaining quota would still pass the check).
2019-05-07 10:17:57 +08:00
Dan Marsden 5a89ac9640 MDL-64708 cohort: Return url is not used anywhere in core. 2019-05-01 17:40:37 +02:00
AMOS bot 6bbf56b9e2 Automatically generated installer lang files 2019-04-30 00:12:42 +00:00
AMOS bot 6be97cb9ac Automatically generated installer lang files 2019-04-27 00:13:00 +00:00
AMOS bot 2fc307e4d4 Automatically generated installer lang files 2019-04-13 00:13:38 +00:00
AMOS bot c426429a08 Automatically generated installer lang files 2019-04-09 00:11:40 +00:00
AMOS bot b848c97164 Automatically generated installer lang files 2019-04-09 00:11:40 +00:00
AMOS bot df5502034a Automatically generated installer lang files 2019-03-29 00:15:44 +00:00
AMOS bot c2c3db84b1 Automatically generated installer lang files 2019-03-25 00:09:40 +00:00
Sara Arjona 52bd62f2be Moodle release 3.4.8 2019-03-08 11:03:07 +01:00
Sara Arjona 53392df219 Merge branch 'install_34_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_34_STABLE 2019-03-08 11:03:06 +01:00
AMOS bot 344386f873 Automatically generated installer lang files 2019-03-08 00:15:41 +00:00
Andrew Nicols 8a2e9542c9 MDL-64971 access: Ensure that the capability exists when fetching 2019-03-06 10:18:03 +08:00
AMOS bot 1f01b678df Automatically generated installer lang files 2019-03-06 00:09:48 +00:00
Jun Pataleta 90740716be Merge branch 'MDL-64799_34' of https://github.com/timhunt/moodle into MOODLE_34_STABLE 2019-03-05 15:52:15 +08:00
Shamim Rezaie 2cebb87682 MDL-64830 core_calendar: Do cap check on event edit form 2019-03-05 04:17:42 +01:00
Damyon Wiese 907b377e51 MDL-64651 comments: Do not send referrer
Use blanktarget option on all comments to prevent malicious links.
2019-03-05 04:17:42 +01:00
Viktor b77dcd23d8 MDL-62702 core_lib: fix broken verification signature 2019-03-05 04:17:42 +01:00
Mark Nelson 1a3612bb5b MDL-62702 core_lib: updated the 'ltiprovider' readme_moodle.txt 2019-03-05 04:17:42 +01:00
Brendan Cox fba7dcd90a MDL-62702 core_lib: parameters in POST override other LTI values
This fixes an exploit where you could alter the 'Content-Type' of the
request and bypass the case-sensitive check 'strstr'. For example,
setting it to 'application/x-www-FORM-urlencoded'. However, changing
this to use 'stristr' was also not an acceptable approach as you
could also bypass it by setting the value to 'multipart/form-data'.
2019-03-05 04:17:42 +01:00
Ryan Wyllie e836242e1c MDL-63786 core_my: prevent dashboard access when logged in as
Stop a "logged in as" session from accessing the user's dashboard
to prevent user JavaScript from being executed in the logged in
as session
2019-03-05 04:17:42 +01:00
Jun Pataleta 6f05d22622 Merge branch 'MDL-64652-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2019-03-05 11:13:03 +08:00
Andrew Nicols 141271b726 MDL-64652 mod_data: Break LEFT JOINs to multiple INNER 2019-03-05 10:32:22 +08:00
Andrew Nicols aae3a2fdd4 MDL-64652 glossary: Break LEFT JOINs to multiple INNER 2019-03-05 10:32:22 +08:00
Andrew Nicols abd634d64c MDL-64652 forum: Use an inner join when fetching ratings 2019-03-05 10:32:22 +08:00
Andrew Nicols e24f8994b5 MDL-64652 rating: Add optional inner join option to sql 2019-03-05 10:32:20 +08:00
Andrew Nicols d16e730116 MDL-64652 mod_forum: Performance improvement for provider
There are possibly some further improvements that can be made to:
- export_discussion_data
- export_all_posts
2019-03-05 10:31:51 +08:00
AMOS bot 3cc11668c8 Automatically generated installer lang files 2019-03-04 00:09:59 +00:00
AMOS bot 3c72d44b18 Automatically generated installer lang files 2019-03-01 00:16:04 +00:00
AMOS bot 4546269170 Automatically generated installer lang files 2019-02-27 00:09:59 +00:00
Tim Hunt ad4dfb1e8c MDL-64799 qtype_random: orphaned random questions should be deleted
This is a back-port of MDL-63260

This fix is based on some original code written by Bo Pierce.
2019-02-26 15:59:05 +00:00
AMOS bot 4f6373bf05 Automatically generated installer lang files 2019-02-16 00:14:36 +00:00
Andrew Nicols 31c05704b8 weekly release 3.4.7+ 2019-02-15 08:29:19 +08:00
Andrew Nicols 384c4c29db Merge branch 'install_34_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_34_STABLE 2019-02-15 08:29:17 +08:00
Jun Pataleta 2282d6932b Merge branch 'MDL-63892-34-rework' of git://github.com/mickhawkins/moodle into MOODLE_34_STABLE 2019-02-13 21:00:24 +08:00
Michael Hawkins 47265ccf62 MDL-63892 mod_forum: Behat update for post order 2019-02-13 17:02:29 +08:00
Jun Pataleta 2d0d9a4748 Merge branch 'MDL-64835-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2019-02-13 16:26:51 +08:00
Andrew Nicols 0cbb46b944 Merge branch 'MDL-63892-34-rework' of git://github.com/mickhawkins/moodle into MOODLE_34_STABLE 2019-02-13 10:20:13 +08:00
Andrew Nicols 3dcf5f9930 MDL-64835 JS: Reduce cache invalidation checks
The cache invalidation check was previously occuring every time either
the `set` or `get` function was called on the cache. However, the cache
invalidation check is based on the jsrev which is static for the
lifetime of the page.

This change moved the invalidation to happen during the setup of the AMD
module such that it only happens one time per storage type (Local +
Session).
2019-02-13 10:14:33 +08:00
Andrew Nicols 3456505930 MDL-64835 JS: Stop using the jsrev in the jsrevPrefix
We only use the jsrevPrefix to determine if the cache should be
invalidated, but the prefix that we were using is based on the new
jsrev.

For example, the jsrevPrefix will be:

    hash(wwwroot + '/ + config.jsrev) + '/jsrev'

Where config.jsrev is the _current_ (new) jsrev.

As a result when searching for the jsrev used to store the data which is
currently in the storage cache, no key is returned, and we instead set
an 'initial' value and the cache is not cleared

This patch changes the jsrevPrefix to be:

    hash(wwwroot) + '/jsrev'

Since the wwwroot does not change, the key remains static for the
current site. As a result, when the jsrev is bumped via a Moodle cache
purge, we are able to correctly fetch the old jsrev from the cache,
determine that the jsrev has changed, and purge the cache.
2019-02-13 10:14:33 +08:00
AMOS bot 18c80ae8a5 Automatically generated installer lang files 2019-02-13 00:12:01 +00:00
Michael Hawkins 4fccbafa46 MDL-63892 mod_forum: Updating lib unit test 2019-02-12 17:28:23 +08:00
Michael Hawkins 11fc8b3d02 MDL-63892 mod_forum: Fix last post details in forum view 2019-02-12 17:28:17 +08:00
Michael Hawkins 4e190d7eae MDL-63892 mod_forum: Correction to timestamp added to edit strings 2019-02-12 17:28:07 +08:00
Eloy Lafuente (stronk7) acd27d90c8 Merge branch 'MDL-64725-34' of git://github.com/junpataleta/moodle into MOODLE_34_STABLE 2019-02-11 17:06:15 +01:00
Jun Pataleta d81447751e Merge branch 'MDL-64644_34' of git://github.com/markn86/moodle into MOODLE_34_STABLE 2019-02-11 16:46:21 +08:00
Andrew Nicols eb3df7ecad Merge branch 'MDL-64597-34' of git://github.com/junpataleta/moodle into MOODLE_34_STABLE 2019-02-11 16:34:30 +08:00
Mark Nelson a9d153e61d MDL-64644 completion: fixed assertions in privacy test 2019-02-11 14:11:05 +08:00
Mark Nelson c2c8ce4b6d MDL-64644 completion: set status correctly in provider 2019-02-11 14:11:05 +08:00
Mark Nelson 27f608a5c9 MDL-64644 completion: ensure we return array for provider 2019-02-11 14:11:04 +08:00
AMOS bot 181cf34341 Automatically generated installer lang files 2019-02-10 00:10:33 +00:00
Jun Pataleta 56c15f5c99 MDL-64725 composer: Use lowercase for package name of dev dependencies 2019-02-04 09:07:48 +08:00
Jun Pataleta 87711249c3 weekly release 3.4.7+ 2019-02-01 08:57:05 +08:00
Jun Pataleta 0a03b2fd63 Merge branch 'install_34_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_34_STABLE 2019-02-01 08:57:04 +08:00
Eloy Lafuente (stronk7) 398c4c107d Merge branch 'MDL-64737-34-attoprivacysql' of git://github.com/mudrd8mz/moodle into MOODLE_34_STABLE 2019-01-31 22:47:07 +01:00
David Mudrák 5789961754 MDL-64737 editor_atto: Fix the privacy export_user_data() implementation
Multiple issues fixed:

* Fixed order of the statements to avoid access to undefined variables.
* Fixed population of the SQL query parameter to make sure they match
  the placeholder in the query.
* Fixed missing table aliases in the second query to make sure the query
  actually works as expected.
2019-01-31 12:51:19 +01:00
David Mudrák 587a8a9732 MDL-64737 privacy: Fix privacy provider testsuite file names
Only files ending with "_test.php" suffix are implicit part of a
testsuite. So these two were not actually executed.
2019-01-31 12:51:19 +01:00
AMOS bot 53d0efba1f Automatically generated installer lang files 2019-01-30 00:10:32 +00:00
Eloy Lafuente (stronk7) 16045c4846 Merge branch 'MDL-64424-34-expiredfrontpage' of git://github.com/mudrd8mz/moodle into MOODLE_34_STABLE 2019-01-29 23:48:55 +01:00
Jun Pataleta 57d2a28425 MDL-64597 behat: Properly import behat_util when dropping parallel sites 2019-01-24 12:51:35 +08:00
David Mudrák 33cbe249dd MDL-64424 privacy: Use system context purpose on the front page, too
For activities on the site's front page, use the purpose and retention
periods as defined for the system context, not for the courses.
2019-01-23 11:09:02 +01:00
AMOS bot 82e23b9443 Automatically generated installer lang files 2019-01-22 00:10:14 +00:00
Eloy Lafuente (stronk7) ea1d1cf9e1 Moodle release 3.4.7 2019-01-12 13:25:52 +01:00
Sara Arjona 7bd7754ad0 weekly release 3.4.6+ 2019-01-10 17:51:42 +01:00
Sara Arjona 734ce33b99 Merge branch 'install_34_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_34_STABLE 2019-01-10 17:51:42 +01:00
AMOS bot 4f19471b9e Automatically generated installer lang files 2019-01-10 00:08:57 +00:00
Eloy Lafuente (stronk7) 78275d44f0 Merge branch 'MDL-64285-34' of git://github.com/junpataleta/moodle into MOODLE_34_STABLE 2019-01-09 00:03:59 +01:00
Michael Hawkins cfde0b8d38 MDL-64395 groups: Added XSS Risk to the manage groups capability 2019-01-08 00:07:45 +01:00
Michael Hawkins 74746ce412 MDL-64372 userpix: Escape fullname string on userpix index page 2019-01-08 00:07:45 +01:00
Sara Arjona 5dd590a3bd MDL-64222 badge: Removed backpackurl from the edit_form 2019-01-08 00:07:45 +01:00
Andrew Nicols 7b97be9f25 Merge branch 'MDL-63276_34' of https://github.com/stronk7/moodle into MOODLE_34_STABLE 2019-01-08 06:56:50 +08:00
Mathew aaf4b2b489 MDL-49651 mod_forum: Respect course visibility in cron
This checks the courses' current visibility and the users permissions.
If they have the permission to view the course when it is hidden they'll get messages.

We already have checks for the users enrolled & subscription status.
2019-01-03 10:50:39 +08:00
Eloy Lafuente (stronk7) 5b1d246758 MDL-63276 environment: PHP 7.1 and Moodle 3.2 required 2019-01-03 01:19:15 +01:00
Eloy Lafuente (stronk7) 3aef542a35 MDL-63276 environment: 3.7 base information
This is a direct copy of the 3.6 branch to
have changes under control easier in next commits.
2019-01-03 01:19:15 +01:00
AMOS bot 07b8bb1ae7 Automatically generated installer lang files 2018-12-19 00:09:24 +00:00
Jun Pataleta 18c55facc0 MDL-64285 core: Fix environment check test
* Looping the environment results and skipping some items mean that
if a test gets skipped, the rest of the environment results won't be
tested. It's better to use a data provider for this in order to
individually test each environment result.
2018-12-13 16:46:53 +08:00
AMOS bot e8a62dc4c2 Automatically generated installer lang files 2018-12-07 00:09:43 +00:00
Eloy Lafuente (stronk7) b63c41d762 weekly release 3.4.6+ 2018-11-30 18:02:05 +01:00
Eloy Lafuente (stronk7) 1aa56ceaca Merge branch 'install_34_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_34_STABLE 2018-11-30 18:02:03 +01:00
Jun Pataleta fdf3d59a00 Merge branch 'MDL-64214-34' of git://github.com/junpataleta/moodle into MOODLE_34_STABLE 2018-11-30 09:43:50 +08:00
Jun Pataleta f648211569 MDL-64214 calendar: Populate the groups select box on page load 2018-11-30 09:26:41 +08:00
Simey Lameze f8de60ce57 MDL-64214 calendar: fix failing unit tests 2018-11-30 09:26:41 +08:00
Simey Lameze 48b2284317 MDL-64214 core_calendar: fix event types form element handling 2018-11-30 09:26:41 +08:00
AMOS bot 1720738ca9 Automatically generated installer lang files 2018-11-30 00:07:50 +00:00
AMOS bot f6d48eeb87 Automatically generated installer lang files 2018-11-29 00:08:36 +00:00
David Monllao 66774319b3 weekly release 3.4.6+ 2018-11-28 11:23:17 +01:00
Eloy Lafuente (stronk7) c3238ac39b Merge branch 'MDL-64220-34' of git://github.com/damyon/moodle into MOODLE_34_STABLE 2018-11-27 16:44:38 +01:00
David Monllao a922416edb Merge branch 'MDL-64205-34-sarunconfirmeduser' of git://github.com/mudrd8mz/moodle into MOODLE_34_STABLE 2018-11-27 08:10:29 +01:00
Damyon Wiese fef96d285e MDL-64220 privacy: Clean path params
We need to consistently clean the path params before we use them. This
shows a difference on windows where dir separators are different.
2018-11-27 15:02:54 +08:00
Jun Pataleta bd38b68684 Merge branch 'MDL-64181-34-fix' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-11-27 14:43:27 +08:00
Andrew Nicols 8a5095d453 MDL-64181 core: Ensure that self is included in parentage 2018-11-27 14:42:52 +08:00
Jun Pataleta c9cd95223a Merge branch 'MDL-64181-34' of git://github.com/damyon/moodle into MOODLE_34_STABLE 2018-11-27 11:44:46 +08:00
Damyon Wiese 80221982fa MDL-64181 javascript: Recursive template fix
This change prevents template rendering from waiting for itself, but does
allow it to wait for another async call to render.
2018-11-27 08:43:28 +08:00
David Mudrák 03edaa4290 MDL-64205 privacy: Delete orphaned data request records on upgrade
As a result of the bug, some requests can be orphaned - the linked user
record may not exist any more. This is a cleanup of such records.
2018-11-26 14:18:31 +01:00
David Mudrák 0401ae362c MDL-64205 users: Do not delete the actual records of unconfirmed users
There is an automatic data privacy request created to get rid of all the
personal data upon the user deletion. With the actual user record
absent, the data privacy requests page throws an error. Let's do here
same as we do in `delete_incomplete_users_task` and let us not delete
the actual user record.
2018-11-25 07:27:10 +01:00
Eloy Lafuente (stronk7) f5fcf31947 weekly release 3.4.6+ 2018-11-23 16:36:43 +01:00
Eloy Lafuente (stronk7) e5e3cb4577 Merge branch 'install_34_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_34_STABLE 2018-11-23 16:36:41 +01:00
Jun Pataleta 999c187559 Merge branch 'MDL-64030-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-11-23 11:15:20 +08:00
AMOS bot b5fa0b3893 Automatically generated installer lang files 2018-11-23 00:07:40 +00:00
Andrew Nicols 9e75d8d7fc MDL-64030 tool_dataprivacy: Process requests when system purpose not set 2018-11-23 07:55:28 +08:00
Jun Pataleta 0f908de1e3 Merge branch 'MDL-64119-34' of git://github.com/sarjona/moodle into MOODLE_34_STABLE 2018-11-22 20:26:10 +08:00
Sara Arjona bbd79a469a MDL-64119 output: Use context of renderer_base's page object 2018-11-22 12:44:44 +01:00
Jun Pataleta a67ed33ed3 Merge branch 'MDL-64119-34' of git://github.com/sarjona/moodle into MOODLE_34_STABLE 2018-11-22 09:51:45 +08:00
Sara Arjona f757055b9f MDL-64119 user: Display full names consistently for teachers
Fix an error with users with the moodle/site:viewfullnames capability
in a course context (like teachers), to display properly the full
names in pages like the participants one.
2018-11-20 19:48:52 +01:00
David Monllao 1b1465210b weekly release 3.4.6+ 2018-11-20 12:55:10 +01:00
Jun Pataleta f06b51262f Merge branch 'MDL-63994-34-castoken' of git://github.com/mudrd8mz/moodle into MOODLE_34_STABLE 2018-11-19 15:45:18 +08:00
Eloy Lafuente (stronk7) e4a6f46527 weekly release 3.4.6+ 2018-11-16 12:03:05 +01:00
Jun Pataleta ec12901c8c Merge branch 'MDL-63660-34' of git://github.com/junpataleta/moodle into MOODLE_34_STABLE 2018-11-16 11:06:37 +08:00
Jun Pataleta b871a7a7e1 MDL-63660 tool_dataprivacy: Fix illegal whitespaces 2018-11-16 11:04:22 +08:00
Jun Pataleta 876302149f Merge branch 'MDL-63660-34' of git://github.com/junpataleta/moodle into MOODLE_34_STABLE 2018-11-16 10:52:45 +08:00
Jun Pataleta 1164fa8370 MDL-63660 tool_dataprivacy: Increase expected export file size 2018-11-16 10:34:47 +08:00
Eloy Lafuente (stronk7) e087069258 Merge branch 'MDL-64012_34' of https://github.com/timhunt/moodle into MOODLE_34_STABLE 2018-11-16 01:03:56 +01:00
David Mudrák 8275b2d502 MDL-63994 auth_cas: Include the login token in the simulated login form
The CAS login process relies on the standard authenticate_user_login()
call to set up the user. So we need to inject the login token to pass
the validation.
2018-11-15 21:26:24 +01:00
David Mudrák c49c373209 MDL-63994 login: Improve the logintoken param input
The logintoken is supposed to arrive as a part of the login form ($frm)
together with the username and password. So it should be handled the
same way - including the opportunity for the auth plugins to provide the
form data via the loginpage_hook().

This also implies that only logintoken coming as a part of the POST
request are taken into account, which is a good thing and another thin
layer in this security mechanism.
2018-11-15 21:26:24 +01:00
David Mudrák 2e80552524 MDL-63994 login: Clarify inline comments on loginpage_hook() usage
While working on the issue, I found these inline comments outdated and
confusing. The auth plugin types can implement a loginpage_hook()
method, the purpose of which is to inject the $user and/or $frm into
this login/index.php script. The new comments should make it more clear.

Note the second comment mentioned a prelogin_hook() which was an old
name of what is now called loginpage_hook(). It had nothing to do with
the existing pre_loginpage_hook() and was only confusing.
2018-11-15 21:26:23 +01:00
Mark Johnson d9cab9de67 MDL-63660 privacy: Include CSS locally for data export 2018-11-14 16:12:38 +00:00
Tim Hunt 6546fd1043 MDL-64012 filters: activity name autolinking fails for names with () 2018-11-14 16:07:54 +00:00
Eloy Lafuente (stronk7) 4c39ccf8a3 Merge branch 'MDL-63842-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-11-14 16:12:13 +01:00
David Monllao 270ba66408 weekly release 3.4.6+ 2018-11-13 13:10:53 +01:00
David Monllao 8fdf8a4ed5 Merge branch 'install_34_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_34_STABLE 2018-11-13 13:10:51 +01:00
Damyon Wiese 9d7e968130 Merge branch 'MDL-63927_34' of git://github.com/stronk7/moodle into MOODLE_34_STABLE 2018-11-13 11:58:33 +08:00
AMOS bot 668e1a2ade Automatically generated installer lang files 2018-11-13 00:07:47 +00:00
Eloy Lafuente (stronk7) 8e3bb05807 Merge branch 'MDL-63907-34' of git://github.com/cescobedo/moodle into MOODLE_34_STABLE 2018-11-12 12:09:11 +01:00
David Monllao 6d67532717 Merge branch 'MDL-63925-34' of git://github.com/mickhawkins/moodle into MOODLE_34_STABLE 2018-11-12 11:58:00 +01:00
David Monllao 529d402ca6 Merge branch 'MDL-63940-34-recaptchaurl' of git://github.com/mudrd8mz/moodle into MOODLE_34_STABLE 2018-11-12 10:56:18 +01:00
David Monllao 6c9d494f35 Merge branch 'MDL-63823-34' of git://github.com/lameze/moodle into MOODLE_34_STABLE 2018-11-12 10:10:13 +01:00
Simey Lameze 327acfdadb MDL-63823 tool_lpimportcsv: supress progress bar debugging 2018-11-12 09:54:05 +08:00
Eloy Lafuente (stronk7) d1e834866e Moodle release 3.4.6 2018-11-10 20:36:22 +01:00
Eloy Lafuente (stronk7) fc8544f5a8 weekly release 3.4.5+ 2018-11-10 12:53:19 +01:00
Eloy Lafuente (stronk7) cdb82d9b38 Merge branch 'MDL-63960-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-11-10 10:28:26 +01:00
Andrew Nicols fb14aa9291 MDL-63960 dataprivacy: Do not perform strict type checks for id
When inherit is specified in the data registry it is stored as a
string and we cannot perform a strict comparison with it.

We should still compare strict comparison checks against null, or false,
but not for the NOTSET (0) or INHERIT values (-1).
2018-11-10 15:34:11 +08:00
Eloy Lafuente (stronk7) b8d51a20e4 MDL-63919 tool_dataprivacy: admin & notify fixes
This includes the following:

1) Replace $ADMIN->id by get_admin()->id. The former doesn't exist.
2) Only change the notify parameter when it has not been specified
   at creation time (null). If specified, observe it.
3) Set the current user in tests to admin, able to create those
   requests.
2018-11-10 11:01:08 +08:00
Eloy Lafuente (stronk7) 6e3c97c71c Merge branch 'MDL-63596-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-11-10 03:51:53 +01:00
Andrew Nicols b5b4734ba0 MDL-63596 backup: Add missing include 2018-11-10 10:49:47 +08:00
Eloy Lafuente (stronk7) 14b0c3f56c Merge branch 'MDL-63596-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-11-09 19:33:05 +01:00
Damyon Wiese 6a8a4cb217 MDL-63596 backup: Deal with controller types
For privacy requests, deal with all 3 controller types.
2018-11-09 17:56:22 +08:00
Mihail Geshoski ec9b96c5b3 MDL-63596 core_backup: Add support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-11-09 17:56:22 +08:00
Andrew Nicols a273b993e9 MDL-62564 tool_dataprivacy: Do not delete deleted user
This also ensures that we do not call delete_user on an already deleted
user.
2018-11-09 17:36:11 +08:00
cescobedo 3758b9c6ab MDL-63907 core_message: Pass user object to show_online_status.
Fix create_contact() to pass user object as parameter in show_online_status.
2018-11-09 10:02:18 +01:00
Jun Pataleta 693929f632 Merge branch 'MDL-63867-34' of git://github.com/mickhawkins/moodle into MOODLE_34_STABLE 2018-11-09 15:29:54 +08:00
Michael Hawkins 529f4cff0e MDL-63867 tool_dataprivacy: Add site purpose checks to tasks
If a site purpose is not defined, requests cannot be processed.
2018-11-09 15:21:39 +08:00
Michael Hawkins 052d678465 MDL-63867 tool_dataprivacy: Fix context expired/unprotected user check
It now checks the system context has been defined, since that is
required for data privacy to be set up correctly, and the check
to be valid. This also fixes an error being thrown when checking
pending delete requests in cron.
2018-11-09 15:21:39 +08:00
Jun Pataleta f00facd901 Merge branch 'MDL-63946-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-11-09 13:41:21 +08:00
Andrew Nicols 2c8c29f2d5 MDL-63946 plagirism: Filename typo fix 2018-11-09 13:25:33 +08:00
Jun Pataleta ce6d64be15 Merge branch 'MDL-63924-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-11-09 11:56:10 +08:00
Jun Pataleta f08e3a0cb9 Merge branch 'MDL-63942-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-11-09 11:42:29 +08:00
Peter 6adc784d16 MDL-62415 repo_filepicker: Display search results in tree view
Disable overriding call to list all files in tree view and show search results instead
2018-11-09 10:55:10 +08:00
Andrew Nicols 054e9ecbe4 Merge branch 'MDL-63919-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-11-09 10:53:18 +08:00
Jun Pataleta 5190239c44 Merge branch 'MDL-62589-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-11-09 10:36:37 +08:00
Andrew Nicols e5e418338e MDL-63942 dataprivacy: Disable deleted user task by default 2018-11-09 09:39:35 +08:00
Damyon Wiese 1d56c59038 Merge branch 'MDL-63671-34-2' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-11-09 09:14:30 +08:00
David Mudrák db1002a36a MDL-63940 recaptcha: Use www.recaptcha.net in the service endpoint URL
There are countries where www.google.com is a being blocked and
recaptcha does not work there. As shown at
https://developers.google.com/recaptcha/docs/faq#can-i-use-recaptcha-globally
it is enough to simply use www.recaptcha.net in the service endpoint
URL.
2018-11-08 22:59:38 +01:00
Eloy Lafuente (stronk7) 8e8029a4d0 Merge branch 'MDL-62564-integration-34-1' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-11-08 16:50:29 +01:00
Andrew Nicols 22aabbbc48 MDL-63924 privacy: Add shared user providers to subsytsems 2018-11-08 21:27:47 +08:00
Andrew Nicols 18f218dc3a MDL-63924 core_privacy: Add shared_userlist provider 2018-11-08 21:27:47 +08:00
Eloy Lafuente (stronk7) e48cc26687 MDL-63927 performance: Update the plan to support the new login token 2018-11-08 10:27:16 +01:00
Mihail Geshoski 0c3857ca51 MDL-63671 tool_cohortroles: Limit data to the system context in provider 2018-11-08 16:07:57 +08:00
Michael Hawkins a5f813e039 MDL-63925 privacy: Fixed Moodle URL in template 2018-11-08 15:54:43 +08:00
Mihail Geshoski 6ac295cd26 MDL-63919 privacy: Store the creation method of the data request 2018-11-08 14:50:22 +08:00
Mihail Geshoski 41a0a8f97f MDL-63919 privacy: Disable notifications for auto created data requests 2018-11-08 14:50:22 +08:00
Jun Pataleta d59a7b781f Merge branch 'MDL-63902-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-11-08 13:38:44 +08:00
Andrew Nicols 6be14b1ff0 MDL-62589 dataprivacy: Add ability to resubmit a request 2018-11-08 11:45:35 +08:00
Jun Pataleta ce6f4feac9 Merge branch 'MDL-63840-34' of https://github.com/lucaboesch/moodle into MOODLE_34_STABLE 2018-11-08 11:21:36 +08:00
Mihail Geshoski 42487b3544 MDL-62564 privacy: Create request for deleted users when setting enabled 2018-11-08 10:15:23 +08:00
Mihail Geshoski cef56ddf5e MDL-62564 privacy: Improve bulk deletion 2018-11-08 10:14:39 +08:00
Mihail Geshoski 28bb3a62bb MDL-62564 privacy: Add unit tests 2018-11-08 10:14:39 +08:00
Andrew Nicols 0878ecb537 MDL-63902 dataprivacy: Check course children not the course
When checking the expiry and protected state of a context, we need to do
so knowing what kind of use that context has.

If it is used in the user context, then only the user context matters.
If it is used within a course, then that child context must be checked
in relation to the course.
2018-11-08 09:13:15 +08:00
Andrew Nicols 6997ab6b25 MDL-62589 dataprivacy: Correct not in sql 2018-11-08 09:03:31 +08:00
Luca Bösch ab192796be MDL-63840 theme: block menu cog size. 2018-11-07 18:08:51 +01:00
Eloy Lafuente (stronk7) 3623efa604 Merge branch 'MDL-62294-34' of git://github.com/junpataleta/moodle into MOODLE_34_STABLE 2018-11-07 17:25:54 +01:00
Dan Marsden 2ac7cdf32a MDL-63800 mod_assign: don't show grade if not set. 2018-11-07 15:28:32 +08:00
Damyon Wiese 7fb9023bec Merge branch 'MDL-63839_34' of git://github.com/markn86/moodle into MOODLE_34_STABLE 2018-11-07 14:28:33 +08:00
Damyon Wiese ea5f2ed91d Merge branch 'MDL-63451_34' of https://github.com/peterspicer-catalyst/moodle into MOODLE_34_STABLE 2018-11-07 13:04:54 +08:00
Jun Pataleta a8e3df906d MDL-63183 auth_shibboleth: Don't render page when already logged in 2018-11-07 00:17:48 +01:00
Jun Pataleta daf0893181 MDL-63183 auth_shibboleth: Add hidden login token in guest login form 2018-11-07 00:17:48 +01:00
Damyon Wiese 8f3b93f686 MDL-63183 auth: Login protection
CSRF protection for the login form. The authenticate_user_login function was
extended to validate the token (in \core\session\manager) but by default it
does not perform the extra validation. Existing uses of this function from
auth plugins and features like "change password" will continue to work without
changes. New config value $CFG->disablelogintoken can bypass this check.
2018-11-07 00:17:48 +01:00
Eloy Lafuente (stronk7) ed2d5791ed Merge branch 'm34_MDL-63789_Search_SOLR_Fixes_Proxy_Auth' of https://github.com/scara/moodle into MOODLE_34_STABLE 2018-11-07 00:08:32 +01:00
Eloy Lafuente (stronk7) 75bcad753d weekly release 3.4.5+ 2018-11-06 19:06:41 +01:00
Eloy Lafuente (stronk7) 8f57f1940f Merge branch 'install_34_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_34_STABLE 2018-11-06 19:06:39 +01:00
Andrew Nicols bacac1e7e0 Merge branch 'MDL-63711-34-fix' of git://github.com/junpataleta/moodle into MOODLE_34_STABLE 2018-11-06 14:21:37 +08:00
Jun Pataleta 496281a0b9 MDL-63711 core_grade: Use canonicalize for checking userlist IDs 2018-11-06 14:17:09 +08:00
Andrew Nicols 4d82bfa076 Merge branch 'MDL-62563-34-3' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-11-06 10:02:15 +08:00
AMOS bot aa3befa1e1 Automatically generated installer lang files 2018-11-06 00:07:33 +00:00
David Monllao 7b7665f35f Merge branch 'MDL-63711-34' of git://github.com/abgreeve/moodle into MOODLE_34_STABLE 2018-11-05 16:35:58 +01:00
Eloy Lafuente (stronk7) 273486c49e Merge branch 'MDL-63748-34' of git://github.com/jleyva/moodle into MOODLE_34_STABLE 2018-11-05 13:11:59 +01:00
David Monllao d85a4a9900 Merge branch 'MDL-63764-34' of git://github.com/mickhawkins/moodle into MOODLE_34_STABLE 2018-11-05 12:46:42 +01:00
David Monllao 0b62f4608f Merge branch 'MDL-63700-34' of git://github.com/mickhawkins/moodle into MOODLE_34_STABLE 2018-11-05 11:14:04 +01:00
Mihail Geshoski 2115bda424 MDL-62563 privacy: Create delete data request for existing deleted users 2018-11-05 16:25:47 +08:00
Mihail Geshoski 7db764172f MDL-62563 privacy: Add unit tests 2018-11-05 16:22:15 +08:00
Andrew Nicols 9faabb3400 Merge branch 'MDL-63689-34-workshopprivacy' of git://github.com/mudrd8mz/moodle into MOODLE_34_STABLE 2018-11-05 15:01:15 +08:00
Damyon Wiese a168c3ed17 Merge branch 'MDL-63717-34' of git://github.com/jleyva/moodle into MOODLE_34_STABLE 2018-11-05 13:45:58 +08:00
Andrew Nicols 41a03384f7 Merge branch 'MDL-63564-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-11-05 13:23:41 +08:00
Mark Nelson ba27222184 MDL-63839 core_message: use component name for Behat tag 2018-11-05 10:36:51 +08:00
Andrew Nicols c80fbc1762 Merge branch 'MDL-63712-34' of git://github.com/mickhawkins/moodle into MOODLE_34_STABLE 2018-11-05 09:34:55 +08:00
Eloy Lafuente (stronk7) 1955206566 Merge branch 'MDL-63818-34-2' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-11-05 00:03:25 +01:00
Matteo Scaramuccia 3899e71bf2 MDL-63789 search_solr: use proxy creds, if any
Also use proxy port, IF any.
2018-11-02 23:35:37 +01:00
Eloy Lafuente (stronk7) ea40b6fb60 weekly release 3.4.5+ 2018-11-02 21:08:34 +01:00
Adrian Greeve e606b429f3 MDL-63711 core_grades: Delete data for specified users in a context. 2018-11-03 03:04:18 +08:00
Juan Leyva 3d4bef51fa MDL-63748 core_auth: Fix redirect parameter being ignored 2018-11-02 15:25:33 +01:00
Juan Leyva 95733c47af MDL-63717 tool_mobile: Ensure URLs are valid
We need to clean the URLs returned by the get_public_config WS because some old plugins didn't validate the stored data.
2018-11-02 14:35:41 +01:00
Mihail Geshoski 030cc62697 MDL-63564 core_question: Avoid using UNION in get_users_in_context() 2018-11-02 14:40:53 +08:00
Shamim Rezaie 465256bf63 MDL-63564 mod_quiz: Added delete_quizaccess_data_for_users to polyfill
This issue is a part of the MDL-62560 Epic.
2018-11-02 14:40:52 +08:00
Shamim Rezaie 80ea64da26 MDL-63564 mod_quiz: support removal of multiple users in a context
This issue is a part of the MDL-62560 Epic.
2018-11-02 14:40:52 +08:00
Shamim Rezaie 92efc5c352 MDL-63564 mod_quiz: Added quizaccess_user_provider interface
This issue is a part of the MDL-62560 Epic.
2018-11-02 14:40:52 +08:00
Shamim Rezaie 53ccb0ac47 MDL-63564 question: Add helper to fetch users in context
This issue is a part of the MDL-62560 Epic.
2018-11-02 14:40:52 +08:00
Shamim Rezaie a04d18dbaa MDL-63564 core_question: support removal of multiple users in a context
This issue is a part of the MDL-62560 Epic.
2018-11-02 14:40:51 +08:00
Andrew Nicols 7453948947 Merge branch 'MDL-63701-34-1' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-11-02 12:03:51 +08:00
Andrew Nicols f7f4e3022c Merge branch 'MDL-63666-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-11-02 10:53:13 +08:00
Mihail Geshoski 3725fa78d4 MDL-63666 logging: Rename delete_data_for_all_users() function 2018-11-02 09:42:32 +08:00
Adrian Greeve d86001b150 MDL-63666 logging: Add support for removal of context users.
This creates a new interface for the logging subplugins to
implement for the users to be deleted separately.
2018-11-02 09:42:32 +08:00
Andrew Nicols 622be7e630 MDL-63842 core_user: Remove unnecessary DB fetch 2018-11-02 09:08:07 +08:00
Andrew Nicols 99f56b6847 Merge branch 'MDL-63703-34-1' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-11-02 09:01:00 +08:00
Andrew Nicols d0851ea944 MDL-63702 core_block: Correct phpdoc for get_users 2018-11-02 08:35:07 +08:00
Andrew Nicols a6589f69f5 MDL-63422 blog: Correct phpdoc for get_users 2018-11-02 08:35:07 +08:00
Andrew Nicols 18a1d5100f Merge branch 'MDL-63816-34' of git://github.com/mickhawkins/moodle into MOODLE_34_STABLE 2018-11-02 08:01:06 +08:00
Eloy Lafuente (stronk7) b5d14e08a2 Merge branch 'MDL-63746-34' of git://github.com/damyon/moodle into MOODLE_34_STABLE 2018-11-01 15:38:48 +01:00
Andrew Nicols 036efee8b5 MDL-63818 core: Add all relevant module context caps
This change ensures that all capabilities at module context level are
shown within a module, only filtering out those which belong to another
module or the subplugins of another module.

This has the effect that module-level capabilities are included
providing they relate to
- the module being queried
- any subplugin of that module
- any capability at module level which does not belong to another module
  or its subplugin
- any other explicitly included capability

This allows permissions to be defined on a capability at a context
level.
2018-11-01 20:52:20 +08:00
Michael Hawkins 9898c108a3 MDL-63712 core_message: Unit test improvements for fetching context/user
This issue is part of the MDL-62560 Epic.
2018-11-01 16:55:16 +08:00
Michael Hawkins a05d4df146 MDL-63712 core_message: Minor provider improvements
This issue is part of the MDL-62560 Epic.
2018-11-01 16:13:49 +08:00
Shamim Rezaie 23d4767f8c MDL-63712 core_message: support removal of multiple users in a context
This issue is a part of the MDL-62560 Epic.
2018-11-01 14:52:28 +08:00
Shamim Rezaie 734d9f403b MDL-63712 core_message: Data should be in user context, not system
This issue is a part of the MDL-62560 Epic.
2018-11-01 14:52:18 +08:00
Mihail Geshoski 708dd97405 MDL-63701 editor_atto: Add support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-11-01 14:21:26 +08:00
Mihail Geshoski dfc0106255 MDL-63703 core_role: Add support for removal of context users
This issue is a part of the MDL-62560 Epic.
2018-11-01 12:14:07 +08:00
Damyon Wiese 39e707450a MDL-63746 boost: Dropdown menu styles
Show focus outlines when a menu button has focus.

Remove btn styling from menu buttons as the additional padding makes things not line up.
2018-11-01 11:07:40 +08:00
Andrew Nicols 850050ed87 Merge branch 'MDL-63566-34' of git://github.com/mickhawkins/moodle into MOODLE_34_STABLE 2018-11-01 10:16:32 +08:00
Adrian Greeve 63ca7583d6 MDL-63566 tool_dataprivacy: New interface check for userlist.
This adds another check to see if the plugins are implementing the
new core_userlist_provider.
2018-11-01 10:09:17 +08:00
Jun Pataleta bf81ba3456 Merge branch 'MDL-63826_34' of git://github.com/stronk7/moodle into MOODLE_34_STABLE 2018-11-01 09:28:13 +08:00
Eloy Lafuente (stronk7) 6a4e92da5c MDL-63826 tests: Don't rely on random array keys for testing 2018-11-01 00:34:55 +01:00
Andrew Nicols 7e163a6473 Merge branch 'm34_MDL-63727_Wrong_SCO_Launched_Link' of https://github.com/scara/moodle into MOODLE_34_STABLE 2018-11-01 07:02:36 +08:00
Matteo Scaramuccia 925c732053 MDL-63727 mod_scorm: Fixed typo in test_launch_sco() 2018-10-31 22:40:56 +01:00
Davo Smith 035c8b349c MDL-63727 mod_scorm: fix typo in sco_launched URL 2018-10-31 22:40:56 +01:00
David Monllao 39ce011f9d Merge branch 'MDL-63726-34' of https://github.com/lucaboesch/moodle into MOODLE_34_STABLE 2018-10-31 10:22:21 +01:00
Luca Bösch 4f32e3af8c MDL-63726 tool_dataprivacy: En-/disable 'Data retention summary' link 2018-10-31 09:10:40 +01:00
Andrew Nicols ae7c8cd2e0 Merge branch 'MDL-63684-34-1' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-10-31 15:18:09 +08:00
Mihail Geshoski d57c7e7c94 MDL-63684 core_calendar: Fix test_get_contexts_for_userid() test
This issue is part of the MDL-62560 Epic.
2018-10-31 14:12:20 +08:00
Mihail Geshoski 9b669f6787 MDL-63684 core_calendar: Add support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-31 14:12:20 +08:00
Andrew Nicols 0cdf08265a Merge branch 'MDL-63702-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-10-31 14:07:48 +08:00
Michael Hawkins 684740b24e MDL-63700 core_analytics: Add support for removal of context users
This issue is a part of the MDL-62560 Epic.
2018-10-31 13:48:33 +08:00
David Monllao a2890d9301 Merge branch 'MDL-62601-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-10-31 06:47:48 +01:00
Andrew Nicols e2f33953c8 MDL-62601 core_privacy: Ensure providers can handle deleted users 2018-10-31 13:45:00 +08:00
Andrew Nicols 534842a3a1 MDL-62601 editor_atto: Do not use context_user 2018-10-31 13:45:00 +08:00
Jun Pataleta e5a82f8e18 Merge branch 'MDL-63690-34-integration' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-10-31 12:52:09 +08:00
Michael Hawkins 646de1f8a8 MDL-63816 privacy: Corrected provider get_users_in_context descriptions 2018-10-31 12:14:41 +08:00
Michael Hawkins 51c8b3543f MDL-63816 privacy: Corrected interface get_users_in_context description 2018-10-31 12:14:41 +08:00
Mihail Geshoski 7aed850593 MDL-63690 core_blog: Handle when user blog posts are not being returned 2018-10-31 11:51:47 +08:00
Jun Pataleta ba6125b60f Merge branch 'MDL-60897-34' of git://github.com/junpataleta/moodle into MOODLE_34_STABLE 2018-10-31 11:33:54 +08:00
Andrew Nicols 3f557f8beb Merge branch 'MDL-63624-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-10-31 11:22:29 +08:00
Mihail Geshoski 589bfad95e MDL-63624 tool_cohortroles: Add support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-31 11:09:56 +08:00
Adrian Greeve 69e66bf86f MDL-63702 core_block: Update to use new userlist interface.
This allows user data to be deleted on a role basis.
2018-10-31 10:05:34 +08:00
Jun Pataleta 7a132e9418 MDL-60897 qtype_multianswer: Code style fixes
And Behat steps improvement, too!
2018-10-31 09:57:18 +08:00
Jean-Michel Vedrine 0a76c61d4e MDL-60897 qtype_multianswer: Invalid cloze-questions saved to db 2018-10-31 09:52:41 +08:00
Andrew Nicols 45def3e813 Merge branch 'MDL-63530-34-2' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-10-31 09:22:46 +08:00
Andrew Nicols 8c75fc2dd7 Merge branch 'MDL-63606-34-2' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-10-31 08:56:52 +08:00
Andrew Nicols f47eb4322a Merge branch 'MDL-63690-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-10-31 08:28:08 +08:00
Eloy Lafuente (stronk7) 4b681328f3 weekly release 3.4.5+ 2018-10-30 18:24:03 +01:00
David Mudrák 2ca0f3f174 MDL-63689 workshop: Add support for removal of multiple context users
The mod_workshop\privacy\provider now implements the new
core_userlist_provider interface. Deleting (erasing) data follows the
same principles as in other existing methods - we do not actually delete
data that might affect other users. Instead, we only erase the sensitive
owned personal information such as provided content.
2018-10-30 14:35:45 +01:00
Mihail Geshoski c2a596ba08 MDL-63606 core_badges: Add support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-30 16:42:36 +08:00
Mihail Geshoski 66ec209ac6 MDL-63530 core_notes: Add support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-30 16:19:40 +08:00
Andrew Nicols d2f8852662 Merge branch 'MDL-63634-34' of git://github.com/rezaies/moodle into MOODLE_34_STABLE 2018-10-30 12:05:58 +08:00
Andrew Nicols 1873af51cc Merge branch 'MDL-63626-34' of git://github.com/rezaies/moodle into MOODLE_34_STABLE 2018-10-30 10:59:54 +08:00
Jun Pataleta f54f0adc7f Merge branch 'MDL-63531-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-10-30 10:50:39 +08:00
Adrian Greeve 3a0288dfef MDL-63531 privacy: Update to comments provider to simplfy sql.
This updates the get_users_in_context_from_sql query to include
the context id to simplify the calls made from other components.
2018-10-30 09:47:14 +08:00
Adrian Greeve 45bcb6111e MDL-63531 assignfeedback: Update to use the new privacy interface.
This now uses the new interface to allow the deletion of users based
on a context.
2018-10-30 09:47:14 +08:00
Adrian Greeve cc678d7593 MDL-63531 assignsubmission: Update to use the new interface.
This updates the plugins to use the new inteface for deleting
data for users in a context.
2018-10-30 09:47:14 +08:00
Andrew Nicols 26babcb57b Merge branch 'MDL-63656-34' of git://github.com/mickhawkins/moodle into MOODLE_34_STABLE 2018-10-30 09:36:14 +08:00
Adrian Greeve da8d77b521 MDL-63531 mod_assign: Update mod assign to use new interface.
This introduces a new interface for assign sub-plugins and
updates the mod_assign provider to implement the new general
interface for deleting data for users in a context.
2018-10-30 08:48:07 +08:00
Eloy Lafuente (stronk7) 572bd2fb5e Merge branch 'MDL-63730-34-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_34_STABLE 2018-10-29 13:19:41 +01:00
David Monllao 4ab60c91f4 Merge branch 'MDL-63528-34' of git://github.com/junpataleta/moodle into MOODLE_34_STABLE 2018-10-29 11:18:32 +01:00
Michael Hawkins ed40358c90 MDL-63656 tool_messageinbound: Add support for removal of context users
This issue is a part of the MDL-62560 Epic.
2018-10-29 14:16:08 +08:00
Michael Hawkins 99eefdd8b2 MDL-63764 core_competency: Add support for removal of context users
This issue is a part of the MDL-62560 Epic.
2018-10-29 13:03:13 +08:00
Michael Hawkins b463e023b2 MDL-63764 core_competency: Support bulk user delete course competencies
This issue is a part of the MDL-62560 Epic.
Also made user IDs optional, so user course competencies can be deleted by course ID only.
2018-10-29 13:03:13 +08:00
Jun Pataleta 747e8433e5 Merge branch 'MDL-63622-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-10-29 11:43:45 +08:00
Adrian Greeve 793f109279 MDL-63622 core_grading: Add support for removal of context users.
Core grading now implements the new core_userlist_provider
interface to allow for deletion of specific users in a context.
2018-10-29 09:20:37 +08:00
Andrew Nicols 7ce597a687 Merge branch 'MDL-63665-34' of git://github.com/rezaies/moodle into MOODLE_34_STABLE 2018-10-29 09:15:23 +08:00
Andrew Nicols 30c5170ec2 Merge branch 'MDL-63680-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-10-29 08:40:57 +08:00
Andrew Nicols 65c19b684c Merge branch 'MDL-63267-34' of git://github.com/lameze/moodle into MOODLE_34_STABLE 2018-10-27 19:22:18 +08:00
Tim Lock e250be6d66 MDL-63267 tool_privacy: Handle modules without privacy support. 2018-10-26 18:33:01 -04:00
Adrian Greeve d7ac44446e MDL-63267 grading methods: Unit test update for fix. 2018-10-26 18:33:01 -04:00
Adrian Greeve 47e0ed7b3e MDL-63267 grading methods: Fix for multiple intances.
We were only exporting the one instance per item id.
Instead we should have been exporting all instances for each
item id.
2018-10-26 18:33:01 -04:00
Adrian Greeve f6020ec3aa MDL-63267 tool_dataprivacy: Registry shows deprecated interfaces. 2018-10-26 18:33:01 -04:00
Adrian Greeve a97a654851 MDL-63267 privacy: Create deprecated provider interface.
Any interfaces that have become deprecated should extend
this interface.
2018-10-26 18:33:01 -04:00
Adrian Greeve 8f31f87f2f MDL-63267 core_grading: Unit test for new methods. 2018-10-26 18:33:01 -04:00
Adrian Greeve 327707245c MDL-63267 mod_assign: Update to providers to include adv grading. 2018-10-26 18:33:01 -04:00
Adrian Greeve 152a5227b9 MDL-63267 core_grading: Update to providers and interface.
The previous interface was inadequate for retrieving user
information stored in the sub-plugins.

A new interface and methods have been added to successfully
deal with user data.
2018-10-26 18:33:01 -04:00
Eloy Lafuente (stronk7) a8c87c20e9 weekly release 3.4.5+ 2018-10-26 18:05:04 +02:00
David Mudrák 54944a93f7 MDL-63730 lang: Update Behat scenarios to use the new strings 2018-10-26 14:02:01 +02:00
Helen Foster 82047d18a6 MDL-63730 lang: Merge English strings from the en_fix language pack
Significant string changes:

* withselectedusers_help, core - removing mention of 'Add a common note'
  as the option no longer exists
* considereddigitalminor and digitalminor_desc, core - more
  child-friendly wording
* auth_dbtype, auth_db - fixed broken link
2018-10-26 14:00:43 +02:00
Shamim Rezaie 0eb0612886 MDL-63634 enrol_paypal: Improve query performance
This issue is a part of the MDL-62560 Epic.
2018-10-26 19:36:56 +11:00
Shamim Rezaie 9109e547ae MDL-63634 enrol_paypal: support removal of multiple users in a context
This issue is a part of the MDL-62560 Epic.
2018-10-26 19:36:56 +11:00
Shamim Rezaie ded33b32cc MDL-63634 enrol_paypal: Fix a typo in unit tests
This issue is a part of the MDL-62560 Epic.
2018-10-26 19:36:56 +11:00
Eloy Lafuente (stronk7) 48bc997f74 Merge branch 'MDL-63765-34' of git://github.com/damyon/moodle into MOODLE_34_STABLE 2018-10-26 10:22:49 +02:00
Damyon Wiese 7fa74a2020 MDL-63765 behat: Fix behat tests opening a menu
If javascript is disabled, we don't need to open the menus at all. If it is enabled
we should use the custom step where possible.

In some tests (user profile) we have to use link_or_button because
the element that opens the menu will be a link or a button in different themes.
2018-10-26 16:15:02 +08:00
Shamim Rezaie 821a5d9efb MDL-63665 mod_choice: no exception when course_modules doesn't exist
This issue is a part of the MDL-62560 Epic.
2018-10-26 18:49:51 +11:00
Shamim Rezaie 89c6cddff5 MDL-63665 mod_choice: support removal of multiple users in a context
This issue is a part of the MDL-62560 Epic.
2018-10-26 18:49:51 +11:00
Mihail Geshoski 05aca6a266 MDL-63680 report_stats: Add support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-26 13:09:43 +08:00
Andrew Nicols 323c407874 Merge branch 'MDL-63673-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-10-26 11:42:29 +08:00
Andrew Nicols 0ada140505 Merge branch 'MDL-63682-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-10-26 11:03:46 +08:00
Mihail Geshoski e936dd2040 MDL-63682 mnetservice_enrol: Add support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-26 10:24:50 +08:00
Andrew Nicols d505813ce6 Merge branch 'MDL-63688-34-1' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-10-26 10:17:53 +08:00
Mihail Geshoski f41f2d53cf MDL-63690 core_privacy: Handle when add_users() receives an empty array 2018-10-26 09:28:03 +08:00
Adrian Greeve f32c037c7a MDL-63690 core_blog: Update providers for userlist deletion. 2018-10-26 09:27:44 +08:00
Eloy Lafuente (stronk7) f2d07ac911 Merge branch 'MDL-62904-34' of git://github.com/junpataleta/moodle into MOODLE_34_STABLE 2018-10-26 00:04:01 +02:00
Andrew Nicols 01189bf5a4 Merge branch 'MDL-63552-34' of git://github.com/mickhawkins/moodle into MOODLE_34_STABLE 2018-10-25 15:45:31 +08:00
Andrew Nicols 632aac365f Merge branch 'MDL-63679-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-10-25 15:36:00 +08:00
Andrew Nicols fe3a63d8a4 Merge branch 'MDL-63655_34' of git://github.com/stronk7/moodle into MOODLE_34_STABLE 2018-10-25 14:57:37 +08:00
Michael Hawkins d22b87614d MDL-63552 search_solr: Add support for removal of context users
This issue is a part of the MDL-62560 Epic.
2018-10-25 11:56:38 +08:00
Eloy Lafuente (stronk7) 6522b3d418 Merge branch 'MDL-62145-34' of git://github.com/damyon/moodle into MOODLE_34_STABLE 2018-10-25 01:35:30 +02:00
Eloy Lafuente (stronk7) 526b2cfc90 Merge branch 'MDL-63714-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-10-25 00:11:09 +02:00
Mihail Geshoski 81fa52d9ca MDL-63688 core_tag: Add method that returns users in context
This issue is part of the MDL-62560 Epic.
2018-10-24 09:28:11 +08:00
Andrew Nicols bcbc20b6d9 MDL-63619 tool_dataprivacy: Cache purposes in form 2018-10-24 08:49:43 +08:00
Andrew Nicols 7646385cdc MDL-63619 tool_dataprivacy: Performance improvement 2018-10-24 08:49:43 +08:00
Andrew Nicols 737a2f46ce MDL-63619 tool_dataprivacy: Fix inheritance from parent contexts
Inheritance should behave such that all contexts inherit from their
parent context.

Prior to this fix, if the value was not set on a context, then it was
getting a default of 'Inherit', but instead of inheritting from the
parent context, it was inheritting from its parent context _level_ which
is just wrong.
2018-10-24 08:49:43 +08:00
Andrew Nicols 98e2aa1669 MDL-63714 javascript: Add new core/pending module 2018-10-24 08:44:06 +08:00
Andrew Nicols 5be7156473 MDL-63714 core: Wrap doRender in pendingjs 2018-10-24 08:44:06 +08:00
Andrew Nicols 4e30dbbef2 MDL-63714 javascript: Improve docs for pendingjs 2018-10-24 08:44:06 +08:00
Mihail Geshoski b36794f0f8 MDL-63673 fileconverter_googledrive: Support removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-24 07:04:50 +08:00
David Monllao 7fff8f46e8 weekly release 3.4.5+ 2018-10-23 16:39:23 +02:00
David Monllao 22f9a36ead Merge branch 'install_34_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_34_STABLE 2018-10-23 16:39:22 +02:00
David Monllao 50d6a67262 Merge branch 'MDL-62139-34-fix3' of git://github.com/damyon/moodle into MOODLE_34_STABLE 2018-10-23 11:17:24 +02:00
Damyon Wiese 1d97b8af8a MDL-62139 behat: Invalid test
If javascript is disabled, we can't open the menu.
2018-10-23 16:35:03 +08:00
Damyon Wiese e93868b26e MDL-62139 output: Revert template changes
Revert accessibility changes for menus in standard themes.
2018-10-23 10:15:36 +02:00
Damyon Wiese c47dbbbd5d MDL-62139 output: Revert template changes
Revert accessibility changes for menus in standard themes.
2018-10-23 15:50:23 +08:00
Mihail Geshoski 73069b9b59 MDL-63679 ltiservice_memberships: Support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-23 13:37:05 +08:00
Andrew Nicols 65b16113c0 MDL-63657 completion: Coding style fix 2018-10-23 11:33:23 +08:00
Andrew Nicols a2572fb75c Merge branch 'MDL-63668-34' of git://github.com/mickhawkins/moodle into MOODLE_34_STABLE 2018-10-23 11:33:08 +08:00
Andrew Nicols 6d3187bec4 MDL-63657 core_files: Coding style fix 2018-10-23 11:27:56 +08:00
Andrew Nicols b25a9d2ce0 Merge branch 'MDL-63640-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-10-23 11:27:48 +08:00
Andrew Nicols 6e27e3201f MDL-63657 tool_mobile: Coding style fix 2018-10-23 11:22:43 +08:00
Andrew Nicols 7448bba870 Merge branch 'MDL-63657-34' of git://github.com/mickhawkins/moodle into MOODLE_34_STABLE 2018-10-23 11:22:25 +08:00
Andrew Nicols a83e5b8f03 MDL-63535 core_rss: Coding style fix 2018-10-23 11:17:53 +08:00
Andrew Nicols b3e8985ce9 Merge branch 'MDL-63535-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-10-23 11:17:11 +08:00
Michael Hawkins 61d6025b0e MDL-63657 tool_mobile: Add support for removal of context users
This issue is a part of the MDL-62560 Epic.
2018-10-23 11:02:24 +08:00
Andrew Nicols d5ec4f8378 MDL-63664 tool_policy: Whitespace fix 2018-10-23 10:53:57 +08:00
Andrew Nicols c90f269158 Merge branch 'MDL-63664-34' of git://github.com/mickhawkins/moodle into MOODLE_34_STABLE 2018-10-23 10:52:04 +08:00
Michael Hawkins f2423ec4df MDL-63668 core_course: Add support for removal of context users
This issue is a part of the MDL-62560 Epic.
2018-10-23 10:45:29 +08:00
Michael Hawkins ff3a01cdac MDL-63668 core_completion: Add get and delete by approved userlist.
This issue is a part of the MDL-62560 Epic.
2018-10-23 10:45:29 +08:00
Michael Hawkins 13bcb76d5a MDL-63664 tool_policy: Add support for removal of context users
This issue is a part of the MDL-62560 Epic.
2018-10-23 10:40:13 +08:00
Mihail Geshoski 1ad86e27d0 MDL-63535 core_userkey: Add method that returns users in context
This issue is part of the MDL-62560 Epic.
2018-10-23 10:29:50 +08:00
Mihail Geshoski 8fbb8bc0fd MDL-63535 core_rss: Add support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-23 10:29:50 +08:00
Andrew Nicols 83edd966a1 Merge branch 'MDL-63649-34' of git://github.com/rezaies/moodle into MOODLE_34_STABLE 2018-10-23 10:19:40 +08:00
Mihail Geshoski 5ee7ec1b9c MDL-63640 core_files: Add method that returns users in context
This issue is part of the MDL-62560 Epic.
2018-10-23 10:12:12 +08:00
Andrew Nicols b3ad855ded Merge branch 'MDL-63713-34' of git://github.com/rezaies/moodle into MOODLE_34_STABLE 2018-10-23 10:09:32 +08:00
Shamim Rezaie e5a542a73e MDL-63649 enrol_lti: support removal of multiple users in a context
This issue is a part of the MDL-62560 Epic.
2018-10-23 13:06:46 +11:00
Shamim Rezaie 991aa49b7b MDL-63713 core: Support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-23 13:05:49 +11:00
Andrew Nicols a9564af46a MDL-62560 tool_dataprivacy: Behat fix for protected check 2018-10-23 09:21:56 +08:00
David Monllao 1378ac0662 Merge branch 'MDL-62144-34' of git://github.com/damyon/moodle into MOODLE_34_STABLE 2018-10-22 16:35:33 +02:00
David Monllao 10dfab520c Merge branch 'MDL-61052-34' of git://github.com/damyon/moodle into MOODLE_34_STABLE 2018-10-22 14:37:40 +02:00
David Monllao 6118d537c3 Merge branch 'MDL-62560-34' into MOODLE_34_STABLE 2018-10-22 13:01:36 +02:00
Andrew Nicols 674b262d9e MDL-62560 tool_dataprivacy: Add a purpose override cache 2018-10-22 13:01:18 +02:00
Andrew Nicols b8fa9168ba MDL-62560 tool_dataprivacy: Fetch user purpose once 2018-10-22 13:01:17 +02:00
Andrew Nicols aefebb9f84 MDL-62560 tool_dataprivacy: Add status logging 2018-10-22 13:01:17 +02:00
Andrew Nicols dc59b9475d MDL-62560 tool_dataprivacy: Add unit test for filtered userlist 2018-10-22 13:01:17 +02:00
Mihail Geshoski a4cca8f5e3 MDL-63636 block_recent_activity: Support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-22 13:01:16 +02:00
Mihail Geshoski 023ff07502 MDL-63621 core_cohort: Add support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-22 13:01:16 +02:00
Mihail Geshoski 8f71325a00 MDL-63633 block_comments: Add support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-22 13:01:15 +02:00
Mihail Geshoski 9a1fd38274 MDL-63635 block_community: Add support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-22 13:01:15 +02:00
Mihail Geshoski 8bae3f76d8 MDL-63593 auth_mnet: Add support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-22 13:01:14 +02:00
Mihail Geshoski 6882588c8f MDL-63592 auth_oauth2: Add support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-22 13:01:14 +02:00
Mihail Geshoski 6372d0c328 MDL-63637 block_rss_client: Add support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-22 13:01:13 +02:00
Mihail Geshoski f7c431b2a5 MDL-63638 block_tag_flickr: Add support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-22 13:01:13 +02:00
Mihail Geshoski f359a73542 MDL-63639 core_fileconverter: Add support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-22 13:01:12 +02:00
Shamim Rezaie fd239233c7 MDL-63647 enrol_flatfile: Improving existing unit tests
This issue is a part of the MDL-62560 Epic.
2018-10-22 13:01:12 +02:00
Shamim Rezaie 88e2805888 MDL-63647 enrol_flatfile: support removal of multiple users in context
This issue is a part of the MDL-62560 Epic.
2018-10-22 13:01:11 +02:00
Michael Hawkins c1d856ed28 MDL-63659 tool_monitor: Add support for removal of context users
This issue is a part of the MDL-62560 Epic.
2018-10-22 13:01:11 +02:00
Mihail Geshoski fe3c821528 MDL-63615 message_airnotifier: Add support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-22 13:01:10 +02:00
Mihail Geshoski 23d749161a MDL-63616 message_email: Add support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-22 13:01:10 +02:00
Mihail Geshoski f335392b2f MDL-63617 message_jabber: Add support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-22 13:01:10 +02:00
Adrian Greeve 5f136c284a MDL-63618 core_plagiarism: Added support to remove users in a context.
This issue is a part of the MDL-62560 Epic.
2018-10-22 13:00:34 +02:00
Mihail Geshoski fdef31e3c5 MDL-63572 profilefield_checkbox: Add support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-22 13:00:34 +02:00
Mihail Geshoski a33f0b6b18 MDL-63575 profilefield_datetime: Add support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-22 13:00:33 +02:00
Mihail Geshoski 5b71e0236f MDL-63586 profilefield_menu: Add support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-22 13:00:33 +02:00
Mihail Geshoski 376c39da69 MDL-63587 profilefield_text: Add support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-22 13:00:32 +02:00
Mihail Geshoski 68eabea2f9 MDL-63588 profilefield_textarea: Add support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-22 13:00:32 +02:00
Michael Hawkins fcdb29da6c MDL-63538 repository_onedrive: Add support for removal of context users
This issue is a part of the MDL-62560 Epic.
2018-10-22 13:00:31 +02:00
Michael Hawkins 6840d1b424 MDL-63538 repository_youtube: Add support for removal of context users
This issue is a part of the MDL-62560 Epic.
2018-10-22 13:00:31 +02:00
Michael Hawkins 20e16adcde MDL-63538 repository_wikimedia: Add support for removal of context users
This issue is a part of the MDL-62560 Epic.
2018-10-22 13:00:30 +02:00
Michael Hawkins 9d8e74cc4a MDL-63538 repository_picasa: Add support for removal of context users
This issue is a part of the MDL-62560 Epic.
2018-10-22 13:00:30 +02:00
Michael Hawkins edd54f38c3 MDL-63538 repository_merlot: Add support for removal of context users
This issue is a part of the MDL-62560 Epic.
2018-10-22 13:00:30 +02:00
Michael Hawkins 6f0f9e9816 MDL-63538 repository_googledocs: Support removal of context users
This issue is a part of the MDL-62560 Epic.
2018-10-22 13:00:29 +02:00
Michael Hawkins 0967aa3fde MDL-63538 repository_flickr_public: Support removal of context users
This issue is a part of the MDL-62560 Epic.
2018-10-22 13:00:29 +02:00
Michael Hawkins fbfb768f07 MDL-63538 repository_flickr: Add support for removal of context users
This issue is a part of the MDL-62560 Epic.
2018-10-22 13:00:28 +02:00
Michael Hawkins f4b06c4fb3 MDL-63538 repository_dropbox: Add support for removal of context users
This issue is a part of the MDL-62560 Epic.
2018-10-22 13:00:28 +02:00
Michael Hawkins 19f8412015 MDL-63538 repository_boxnet: Add support for removal of context users
This issue is a part of the MDL-62560 Epic.
2018-10-22 13:00:28 +02:00
Mihail Geshoski 7e6bcd9424 MDL-63536 core_repository: Add support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-22 13:00:27 +02:00
Mihail Geshoski 4db5681054 MDL-63534 core_user: Add support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-22 13:00:27 +02:00
Mihail Geshoski 4a973080dd MDL-63532 core_portfolio: Add support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-22 13:00:26 +02:00
Mihail Geshoski 85439fc637 MDL-63529 core_enrol: Add support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-22 13:00:26 +02:00
Michael Hawkins 1b8dd3096e MDL-63514 mod_wiki: Add support for removal of context users
This issue is a part of the MDL-62560 Epic.
2018-10-22 13:00:26 +02:00
Michael Hawkins 461b388358 MDL-63510 mod_survey: Add support for removal of context users
This issue is a part of the MDL-62560 Epic.
2018-10-22 13:00:25 +02:00
Michael Hawkins 7de1d37f80 MDL-63501 mod_scorm: Add support for removal of context users
This issue is a part of the MDL-62560 Epic.
2018-10-22 13:00:25 +02:00
Michael Hawkins 200916ba98 MDL-63497 mod_lesson: Add support for removal of context users
This issue is a part of the MDL-62560 Epic.
2018-10-22 13:00:24 +02:00
Michael Hawkins c79943ca14 MDL-63497 mod_feedback: Add support for removal of context users
This issue is a part of the MDL-62560 Epic.
2018-10-22 13:00:24 +02:00
Michael Hawkins ebbf35d9a2 MDL-63497 mod_glossary: Add support for removal of context users
This issue is a part of the MDL-62560 Epic.
Also added missing ratings include and test to mod_glossary unit tests.
2018-10-22 13:00:24 +02:00
Michael Hawkins c445946955 MDL-63497 mod_data: Add support for removal of context users
This issue is a part of the MDL-62560 Epic.
2018-10-22 13:00:23 +02:00
Michael Hawkins 2642039f65 MDL-63497 block_html: Add support for removal of context users
This issue is a part of the MDL-62560 Epic.
2018-10-22 13:00:23 +02:00
Michael Hawkins 9e96c5292a MDL-63497 mod_chat: Add support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-22 13:00:22 +02:00
Shamim Rezaie 518ebb3323 MDL-63554 cachestore_memcache: Support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-22 13:00:22 +02:00
Shamim Rezaie 1335e0bc3e MDL-63554 cachestore_session: Support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-22 13:00:22 +02:00
Shamim Rezaie 6ea63bc54c MDL-63554 cachestore_redis: Support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-22 13:00:21 +02:00
Shamim Rezaie e3b6fe667d MDL-63554 cachestore_mongodb: Support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-22 13:00:21 +02:00
Shamim Rezaie 699847af7b MDL-63554 cachestore_memcached: Support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-22 13:00:20 +02:00
Shamim Rezaie 5a49fe3f51 MDL-63500 enrol_cohort: refactoring get_contexts_for_userid
This issue is part of the MDL-62560 Epic.
2018-10-22 13:00:20 +02:00
Shamim Rezaie 3fcb71bd53 MDL-63500 enrol_meta: refactoring get_contexts_for_userid
This issue is part of the MDL-62560 Epic.
2018-10-22 13:00:19 +02:00
Shamim Rezaie 3afb545307 MDL-63500 core_group: get_contexts_for_userid should respect component
The get_contexts_for_userid method should not return contexts for all group memberships.
It should only return the contexts in where there is manual group
membership.

This issue is part of the MDL-62560 Epic.
2018-10-22 13:00:19 +02:00
Shamim Rezaie cfe3ba39e8 MDL-63500 enrol_cohort: Support for removal of multiple context users
This issue is part of the MDL-62560 Epic.
2018-10-22 13:00:19 +02:00
Shamim Rezaie 1b0fc6098e MDL-63500 enrol_meta: Support for removal of multiple context users
This issue is part of the MDL-62560 Epic.
2018-10-22 13:00:18 +02:00
Shamim Rezaie 8f30bd5945 MDL-63500 core_group: support removal of multiple users in a context
This issue is part of the MDL-62560 Epic.
2018-10-22 13:00:18 +02:00
Mihail Geshoski 181da22a4d MDL-63533 core_webservice: Unit tests for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-22 13:00:17 +02:00
Mihail Geshoski 549232ade8 MDL-63533 core_webservice: Add support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-22 13:00:17 +02:00
Adrian Greeve 7a5ad3c9f1 MDL-63513 mod_assignment: Add removal of context users.
This issue is part of the MDL-62560 Epic.
2018-10-22 13:00:17 +02:00
Michael Hawkins 1b78edeb44 MDL-63498 mod_lti: Add support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-22 13:00:16 +02:00
Michael Hawkins 37dffc7b4d MDL-63495 comment: Added provider::get_users_in_context_from_sql
This issue is a part of the MDL-62560 Epic.
2018-10-22 13:00:07 +02:00
Damyon Wiese 1ec78d3549 MDL-61052 assign: Do not queue conversions
Identical submissions do not require individual conversions from the document converter. Text passing through
format_text cannot be trusted and is likely to be unique each time, even for the same text.
2018-10-22 12:03:40 +08:00
Zig Tan 3b34e951b9 MDL-61052 assign: Improve strip_images() to avoid HTML5 tags errors 2018-10-22 12:02:51 +08:00
Damyon Wiese 8be7d9a52f MDL-62145 theme_boost: Custom menu fixes
Make sure the site navigation element is labelled, actionmenu items
have correct role and actionmenu trigger controls the menu.
2018-10-22 11:05:28 +08:00
Damyon Wiese 4fa885d003 MDL-62144 user menu: Accessibility
Ensure user menu passes the accessibility tests.
2018-10-22 10:50:55 +08:00
Damyon Wiese 5cccea615a MDL-62139 output: Accessible action menus
Add label on the "gear" menu and default keyboard and focus controls.

S
2018-10-22 10:39:11 +08:00
Eloy Lafuente (stronk7) bb1e0fdbb9 weekly release 3.4.5+ 2018-10-22 10:39:11 +08:00
AMOS bot b859bed2eb Automatically generated installer lang files 2018-10-22 10:39:11 +08:00
AMOS bot 5f69056fe5 Automatically generated installer lang files 2018-10-22 10:39:11 +08:00
AMOS bot e670975845 Automatically generated installer lang files 2018-10-22 00:07:28 +00:00
Eloy Lafuente (stronk7) c757afbac1 weekly release 3.4.5+ 2018-10-19 17:10:52 +02:00
Eloy Lafuente (stronk7) a28eccf172 Merge branch 'install_34_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_34_STABLE 2018-10-19 17:10:50 +02:00
AMOS bot 532bd1c768 Automatically generated installer lang files 2018-10-19 00:08:19 +00:00
Eloy Lafuente (stronk7) da1507c1dd Merge branch 'MDL-62920_34' of https://github.com/aanabit/moodle into MOODLE_34_STABLE 2018-10-18 23:52:00 +02:00
Eloy Lafuente (stronk7) 6270847e8f Merge branch 'MDL-60145-34' of https://github.com/snake/moodle into MOODLE_34_STABLE 2018-10-18 18:57:58 +02:00
Tim Hunt f777a0b0dc MDL-63403 filter_glossary: changes made during integration review 2018-10-18 18:45:38 +02:00
Tim Hunt 86543cb1db MDL-63403 filter_glossary: only create replacement HTML if needed 2018-10-18 18:44:37 +02:00
Tim Hunt 59045c0a75 MDL-63403 filter_glossary: only prepare the replacement if used 2018-10-18 18:44:32 +02:00
Tim Hunt 957e3dbbd6 MDL-63403 filter_glossary: clean up filterobject class
This is another preliminary commit, rationalising the ->work... fields
and also moving the code that sets them up into a separate function.
This is also to prepare for the next commit.
2018-10-18 18:44:26 +02:00
Tim Hunt 6f9e7f7989 MDL-63403 filter_glossary: only prepare_phrases_for_filtering once 2018-10-18 18:44:23 +02:00
Tim Hunt d6be60ed51 MDL-63403 filter_glossary: use preg features for fullmatch
This eliminates a lot of necessary string manipulation for something
that preg can just do with the \b assertion.

The change also extracts all the work to prepare ->work_phrase (renamed
->regexp) into a separate function. This is to pave the way for future
efficiency gains, but for now I have not done them, so it is easier to
verify by inspection that this commit does not change behaviour.

Also, some tidy-ups to the filterobject structure, to eliminate some
redundant fields.
2018-10-18 18:44:19 +02:00
Tim Hunt 1a710d2dd8 MDL-63403 filter_glossary: cache concept list in a MUC static cache
This is a slight improvement on a suggestion by David Monllaó
2018-10-18 18:44:15 +02:00
Tim Hunt 2e14a686ea MDL-63403 filter_glossary: Fix lang string concatenation 2018-10-18 18:44:11 +02:00
Tim Hunt 8b73e0f6fe MDL-63403 filter_glossary: $GLOSSARY_EXCLUDEENTRY shouldn't stop caching
Also, greatly improved unit tests, to test more cases of how the filter
should work.
2018-10-18 18:44:07 +02:00
Tim Hunt 6cb74724a3 MDL-63403 filterlib: Fix lots of coding style 2018-10-18 18:43:57 +02:00
Jun Pataleta 6871e90c9e Merge branch 'MDL-63667-34-fix2' of git://github.com/damyon/moodle into MOODLE_34_STABLE 2018-10-18 14:39:31 +08:00
Andrew Nicols 0ede37a30c MDL-63667 amd: Check for parent template recursion 2018-10-18 12:12:43 +08:00
Damyon Wiese 1a3a8a9d6d MDL-63667 output: Fix for recursive templates
A template can include itself - e.g. by looping over the context children and rendering a tree.

Ensure this promise still resolves.

Example: admin/tool/lp/templates/competencies_tree.mustache.
2018-10-18 10:54:01 +08:00
Eloy Lafuente (stronk7) be3a6f83c2 Merge branch 'MDL-63632-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-10-18 02:39:33 +02:00
AMOS bot d15cbdd72f Automatically generated installer lang files 2018-10-18 00:07:35 +00:00
Andrew Nicols 7fa07866b7 MDL-63632 forum: Delete where not discussion author 2018-10-18 07:20:29 +08:00
Eloy Lafuente (stronk7) ab4d4619c2 Merge branch 'MDL-63068_34' of https://github.com/aanabit/moodle into MOODLE_34_STABLE 2018-10-18 00:40:16 +02:00
Jun Pataleta 8464779f2a MDL-62904 tool_dataprivacy: Add data request links in profile page 2018-10-17 16:42:56 +08:00
Jun Pataleta 5775e12509 Merge branch 'MDL-63667-34' of git://github.com/damyon/moodle into MOODLE_34_STABLE 2018-10-17 15:03:50 +08:00
Ryan Wyllie 7ffafab4f7 MDL-63667 javascript: fix failed to pre-fetch the template error 2018-10-17 13:53:28 +08:00
Michael Hawkins b6a8e4db77 MDL-63495 comment: Added provider::delete_comments_for_users
This issue is a part of the MDL-62560 Epic.
2018-10-17 13:13:55 +08:00
Andrew Nicols 121f12aa3c MDL-63495 mod_forum: Add intial support for removal of multiple context users
This issue is a part of the MDL-62560 Epic.
2018-10-17 13:13:55 +08:00
Andrew Nicols 924881fba9 MDL-63495 core_rating: Add helper to fetch users in context
This issue is a part of the MDL-62560 Epic.
2018-10-17 13:13:55 +08:00
Andrew Nicols b11130cf15 MDL-63496 tool_dataprivacy: Add configuration for per-role retention
This issue is a part of the MDL-62560 Epic.
2018-10-17 13:13:55 +08:00
Andrew Nicols f3e39f4bce MDL-63496 tool_dataprivacy: Respect expiry with protected flag
This issue is a part of the MDL-62560 Epic.
2018-10-17 13:13:54 +08:00
Andrew Nicols 037f741214 MDL-63496 tool_dataprivacy: Support for per-role retention
This issue is a part of the MDL-62560 Epic.
2018-10-17 13:13:54 +08:00
Michael Hawkins c71a358c69 MDL-63497 tool_dataprivacy: Add support for removal of context users
This issue is a part of the MDL-62560 Epic.
2018-10-17 13:13:54 +08:00
Andrew Nicols f2c6d5cc11 MDL-63495 privacy: Add support for removal of multiple users in a context
This issue is a part of the MDL-62560 Epic.
2018-10-17 13:13:54 +08:00
Eloy Lafuente (stronk7) c600fd5712 weekly release 3.4.5+ 2018-10-16 16:05:34 +02:00
Eloy Lafuente (stronk7) 67634c4102 Merge branch 'install_34_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_34_STABLE 2018-10-16 16:05:32 +02:00
Damyon Wiese 668934466b Merge branch 'MDL-62960-34' of git://github.com/rezaies/moodle into MOODLE_34_STABLE 2018-10-16 11:44:18 +08:00
Shamim Rezaie a183d18041 MDL-62960 calendar: Visuall indicator for valid course event drop zones 2018-10-16 13:14:36 +11:00
Shamim Rezaie c0e7ba026d MDL-62960 calendar: Rename get_module_timestamp_min/max_limit methods
The methods get_module_timestamp_min_limit() and get_module_timestamp_max_limit()
are doing generic stuff and can be used for other calendar event types as well.
I have renamed them to get_timestamp_min_limit() and get_timestamp_max_limit() respectively.
2018-10-16 13:14:26 +11:00
Shamim Rezaie 9211b03e86 MDL-62960 calendar: Implementing course events validity check callback 2018-10-16 13:12:57 +11:00
Shamim Rezaie b43f9b39fa MDL-62960 calendar: Added range check callback for course events
Added core_calendar_get_valid_event_timestart_range callback for course events
2018-10-16 13:12:57 +11:00
Andrew Nicols e098de35bc Merge branch 'MDL-63421_34' of git://github.com/stronk7/moodle into MOODLE_34_STABLE 2018-10-16 08:55:39 +08:00
Eloy Lafuente (stronk7) b6ff1269e8 Merge branch 'MDL-63583-34' of git://github.com/jleyva/moodle into MOODLE_34_STABLE 2018-10-16 00:29:28 +02:00
Eloy Lafuente (stronk7) 4f88dff731 Merge branch 'MDL-63456-34' of git://github.com/merrill-oakland/moodle into MOODLE_34_STABLE 2018-10-16 00:17:26 +02:00
Eloy Lafuente (stronk7) cdc68e910a Merge branch 'MDL-62319-34' of git://github.com/damyon/moodle into MOODLE_34_STABLE 2018-10-16 00:07:23 +02:00
Andrew Nicols 1694162476 Merge branch 'MDL-63542-34' of git://github.com/jleyva/moodle into MOODLE_34_STABLE 2018-10-15 11:40:10 +08:00
AMOS bot c9e89351aa Automatically generated installer lang files 2018-10-15 00:07:27 +00:00
Eloy Lafuente (stronk7) a08235c914 MDL-63655 core: Fix miss-placed parenthesis 2018-10-15 01:03:04 +02:00
Amaia Anabitarte bcd99539b7 MDL-63068 user: Allow underscore for profile custom fields shortname 2018-10-11 16:40:34 +02:00
Amaia Anabitarte acca768961 MDL-62920 user: Uploading deleted user and adding to a cohort 2018-10-11 16:27:48 +02:00
Shamim Rezaie c5d2f4d0b3 MDL-63626 mod_quiz: Fixed a bug when there was no attempt on the quiz 2018-10-12 01:04:17 +11:00
Eloy Lafuente (stronk7) 0dfa4a3c18 weekly release 3.4.5+ 2018-10-11 13:22:49 +02:00
Eloy Lafuente (stronk7) c8ed9615de Merge branch 'install_34_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_34_STABLE 2018-10-11 13:22:47 +02:00
Damyon Wiese ffee9dcc59 MDL-62319 assignfeedback_editpdf: Disable touch scrolling
Assignment editpdf canvas provides it's own scroll tool and the native browser one breaks
the rest of the tools for the canvas. Turn it off.
2018-10-11 13:33:14 +08:00
Nathan Nguyen edbc4b5816 MDL-62319 Assign: Grading interface is broken when using iOS 11.3 devices 2018-10-11 13:33:11 +08:00
AMOS bot aa29f93afe Automatically generated installer lang files 2018-10-11 00:07:26 +00:00
Eloy Lafuente (stronk7) 7918ae0457 Merge branch 'MDL-62891-34-callable_name' of git://github.com/mudrd8mz/moodle into MOODLE_34_STABLE 2018-10-10 23:33:20 +02:00
Eloy Lafuente (stronk7) 33b264e80a Merge branch 'MDL-63225-34' of git://github.com/jleyva/moodle into MOODLE_34_STABLE 2018-10-10 23:26:00 +02:00
Peter Spicer 7e4872e91e MDL-63451 core_message: Properly escape URLs for notification popup 2018-10-10 13:03:42 +01:00
Jake Dallimore 57429ec39b MDL-60145 course: fix bug with group restictions button during mod edit
If a mod doesn't support groups, then we remove the grouping element,
and now also the 'add group/group restriction' helper button too.
2018-10-10 08:43:46 +08:00
AMOS bot 837ac1b79d Automatically generated installer lang files 2018-10-10 00:07:22 +00:00
Eloy Lafuente (stronk7) 447b4bdf5a Merge branch 'MDL-63439-34' of git://github.com/damyon/moodle into MOODLE_34_STABLE 2018-10-10 00:48:29 +02:00
Eloy Lafuente (stronk7) 3d92367a80 Merge branch 'MDL-62395-34' of git://github.com/junpataleta/moodle into MOODLE_34_STABLE 2018-10-09 23:06:47 +02:00
Eloy Lafuente (stronk7) 957c839884 Merge branch 'MDL-63401-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-10-09 11:36:44 +02:00
David Monllao cde9c8ccc0 Merge branch 'MDL-62738_34' of https://github.com/mfabriczy/moodle into MOODLE_34_STABLE 2018-10-09 09:24:39 +02:00
David Monllao 8d6c617e59 Merge branch 'MDL-51969-MOODLE_34_STABLE' of https://github.com/dmitriim/moodle into MOODLE_34_STABLE 2018-10-09 09:21:14 +02:00
Jun Pataleta a474308f74 Merge branch 'MDL-62491-34' of git://github.com/abgreeve/moodle into MOODLE_34_STABLE 2018-10-09 14:39:33 +08:00
Jun Pataleta 8dc8bfdb1d Merge branch 'MDL-63241-34-take2' of https://github.com/lucaboesch/moodle into MOODLE_34_STABLE 2018-10-09 12:48:27 +08:00
Adrian Greeve 42129c29b4 MDL-62491 navigation: Update to tree.js to allow callbacks. 2018-10-09 09:42:14 +08:00
Adrian Greeve bcad932ef8 MDL-62491 mod_assign: Fill in the rewrite plugin urls properly. 2018-10-09 09:42:04 +08:00
Adrian Greeve 40d08b4fb1 MDL-62491 core_privacy: Add html files to the user data export.
This adds html to the data export that allows for easier navigation
and reading of data.
2018-10-09 09:41:55 +08:00
Damyon Wiese f68ad5439b MDL-63439 assign: Unicode charsets for pdf
Prefer to use freesans font for generated pdfs as it has the biggest charset support.
2018-10-09 09:31:34 +08:00
Jun Pataleta 2d065b56c7 Merge branch 'MDL-63194_34' of https://github.com/timhunt/moodle into MOODLE_34_STABLE 2018-10-09 08:55:00 +08:00
Andrew Nicols e5088f07a8 MDL-63401 tool_dataprivacy: Change default for require end date
We should preserve the existing behaviour.
2018-10-09 08:32:18 +08:00
Andrew Nicols bc09a4398c MDL-63401 tool_dataprivacy: Simplify where processing 2018-10-09 08:22:41 +08:00
Andrew Nicols 5e77c5f24f MDL-63401 tool_dataprivacy: Move final cap check to endpoint 2018-10-09 08:22:41 +08:00
Eric Merrill 372476328c MDL-63456 qtype_multichoice: Return a default options object if missing 2018-10-08 16:31:35 -04:00
Eric Merrill 98dec1b08c MDL-63456 question: Improve Aiken error handling and multichoice errors 2018-10-08 16:31:35 -04:00
Tim Hunt 474ee16ec7 MDL-63194 quiz editing: subtle drag-drop bug if moving between sections 2018-10-08 17:46:36 +01:00
Juan Leyva 4105b2d351 MDL-63583 course: Include course/lib.php always
core_course_get_courses_by_field WS must include always course/lib.php to not depend on functions including it.
2018-10-08 16:57:14 +02:00
Andrew Nicols ec259ef812 MDL-63401 tool_dataprivacy: Allow expiriration of users without end date 2018-10-08 20:52:45 +08:00
Andrew Nicols 3e90c7df33 MDL-63401 tool_dataprivacy: Rewrite expired deletion handling
This change rewrites the way in which expiry is calculated and addresses
a number of closely related issues:

Users can customise, and add blocks with data to, their dashboard.  When
a user had done so, the user could be flagged for deletion, but the
blocks in their Dashboard were subject to the default block retention
policy. In addition there is no way to override the retention policy for
user blocks.

This change modifies the structure of the expiry mechanism:
- to consider any subcontext of the user context to be a part of the user
  context during calculation. User child contexts are not the property
  of the system, and should not be treated separately.
- the way in which the context expiry mechanism worked was to select
  use a multiple different managers based solely on the context level.
  Because of the use of user blocks, this proved to be unreliable as
  blocks has been attributed purely to courses.
  This has been changed to a single manager which is aware of hierarchy
  and deletions as a whole.
- to prepare for upcoming work relating to more detailed expiry
  mechanisms, a new expiry_info class is introduced and used to
  merge the expiry of child contexts into a working in-memory view.

This changeset includes extensive unit tests.
2018-10-08 20:52:27 +08:00
Andrew Nicols 6b0512cc52 MDL-63401 core: Do not delete the user context
As long as we have a user record, we should not delete the context which
relates to it.
2018-10-08 20:52:27 +08:00
Andrew Nicols a9c0a87ffd MDL-63401 tool_dataprivacy: Move cap checks to endpoints from API 2018-10-08 20:52:27 +08:00
David Monllao 4de8dd37c7 Merge branch 'MDL-63323-34-wrong-classes-attribute-into-activity_navigation' of https://github.com/davidherney/moodle into MOODLE_34_STABLE 2018-10-08 11:30:27 +02:00
Luca Bösch 32052e77f8 MDL-63241 calendar: Add missing table alias in SQL query. 2018-10-07 21:45:53 +02:00
Marcus Fabriczy 35f6db9232 MDL-62738: editor_tinymce: Fix call stack size bug on Safari
The call stack size was being exceeded via a recursive loop brought
by MDL-61189.

To fix, this item removes MDL-36803 and MDL-41328 as the iOS keyboard works
nicely now on Safari with TinyMCE.
2018-10-06 17:30:20 +09:30
Juan Leyva c5ab666ece MDL-63542 core_course: Support stealth activities in WS 2018-10-05 14:51:31 +02:00
Eloy Lafuente (stronk7) 06579f587c MDL-63421 env: Moodle 3.4.x and 3.5.x do not support PHP 7.3 2018-10-05 13:38:00 +02:00
David Mudrák 152b534b6d MDL-62891 core: Stop using var_export() to describe callables
Make use of the newly added function get_callable_name() when reporting
that an exception happened during shutdown.
2018-10-05 08:53:20 +02:00
David Mudrák 4081f82d5c MDL-62891 core: Introduce new get_callable_name() function 2018-10-05 08:53:20 +02:00
Dmitrii Metelkin ef0688bf35 MDL-51969 mod_lti: Fixed missing tool proxy GUID 2018-10-05 15:15:33 +10:00
Jun Pataleta 57241c56c0 weekly release 3.4.5+ 2018-10-05 10:29:04 +08:00
Jun Pataleta 994d82f64d Merge branch 'install_34_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_34_STABLE 2018-10-05 10:29:03 +08:00
Jun Pataleta 4db4682464 MDL-62395 tool_dataprivacy: Purpose name and description in one column
* Show the purpose's name and description under one column.
2018-10-05 09:28:48 +08:00
Jun Pataleta 591a54cd72 Merge branch 'MDL-35788-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-10-04 12:46:07 +08:00
Jun Pataleta 0f6973ac13 MDL-63528 auth: Behat scenario for "Remember username" display 2018-10-04 12:25:15 +08:00
Jun Pataleta 8c9a724672 MDL-63528 auth: Show "Remember username" on login form only when needed 2018-10-04 12:25:15 +08:00
Andrew Nicols 1f700517cd MDL-35788 mod_forum: Move post creation fetch 2018-10-04 11:42:54 +08:00
AMOS bot 7a2da2f137 Automatically generated installer lang files 2018-10-04 00:07:29 +00:00
Eloy Lafuente (stronk7) 7277817938 Merge branch 'MDL-63141-34' of git://github.com/rezaies/moodle into MOODLE_34_STABLE 2018-10-04 00:24:30 +02:00
Eloy Lafuente (stronk7) 6187351760 Merge branch 'MDL-63142-34' of git://github.com/rezaies/moodle into MOODLE_34_STABLE 2018-10-04 00:18:53 +02:00
Eloy Lafuente (stronk7) f65a5b5f34 Merge branch 'MDL-63143-34' of git://github.com/rezaies/moodle into MOODLE_34_STABLE 2018-10-04 00:02:56 +02:00
David Monllao ef1e76b490 Merge branch 'MDL-62558-34' of git://github.com/abgreeve/moodle into MOODLE_34_STABLE 2018-10-03 17:16:17 +02:00
Adrian Greeve df3cc8c9c5 MDL-62558 tool_dataprivacy: Create a summary page for users. 2018-10-03 10:40:34 +08:00
Jun Pataleta 9e026e05df Merge branch 'MDL-35788-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-10-03 10:12:43 +08:00
Eloy Lafuente (stronk7) ed19765c8d Merge branch 'MDL-60685-34' of git://github.com/damyon/moodle into MOODLE_34_STABLE 2018-10-03 00:24:19 +02:00
Eloy Lafuente (stronk7) 31252432a1 Merge branch 'MDL-63435-34' of https://github.com/lucaboesch/moodle into MOODLE_34_STABLE 2018-10-02 23:48:27 +02:00
Juan Leyva d14393fb3d MDL-63225 webservice: Return proper debuginfo on WS exceptions
In order to make developers easy, we should give some clues about the type of the data generating exceptions.
2018-10-02 13:15:37 +02:00
Andrew Nicols 8fe630d49b MDL-35788 forum: Show post creation time not modified 2018-10-01 08:39:56 +08:00
Jun Pataleta bd7573e471 MDL-62395 tool_dataprivacy: Fix tables display
* Use standard Bootstrap4 table classes for the categories and purposes
  tables.
* Set 25% width for the name and description columns of the purposes
  table.
* Set 50% width for the description column of the categories table.
2018-09-28 14:33:55 +08:00
David Herney 571ee73a77 MDL-63323 course: Fixed wrong classes key in activity_navigation class
Replaced "classes" by "class" attribute, when the prev and next links are builded into the activity navigation.
2018-09-27 18:44:00 -05:00
Luca Bösch ce3f7aeb16 MDL-63435 gradebook: let activity icons re-appear. 2018-09-27 18:10:40 +02:00
Eloy Lafuente (stronk7) 75d95d140b weekly release 3.4.5+ 2018-09-27 15:17:55 +02:00
Eloy Lafuente (stronk7) 54b432fb4f Merge branch 'MDL-61981-34_nestedmath' of git://github.com/Mankro/moodle into MOODLE_34_STABLE 2018-09-25 23:41:03 +02:00
Eloy Lafuente (stronk7) 0c5279e4c5 Merge branch 'MDL-62279-34' of git://github.com/damyon/moodle into MOODLE_34_STABLE 2018-09-25 23:26:51 +02:00
Eloy Lafuente (stronk7) 514dce5460 Merge branch 'MDL-62714-34-boost_course_visibility_in_navbar' of https://github.com/fskandalis/moodle into MOODLE_34_STABLE 2018-09-25 23:20:13 +02:00
Eloy Lafuente (stronk7) 8e20e22be9 Merge branch 'MDL-60028-34' of https://github.com/paulholden/moodle into MOODLE_34_STABLE 2018-09-25 16:58:44 +02:00
David Monllao 61859ec680 Merge branch 'MDL-63119-34' of git://github.com/lameze/moodle into MOODLE_34_STABLE 2018-09-25 12:36:36 +02:00
David Monllao 816f9a560b Merge branch 'MDL-62717-34' of https://github.com/lucaboesch/moodle into MOODLE_34_STABLE 2018-09-25 12:19:00 +02:00
Andrew Nicols abb789b0fb Merge branch 'MDL-63346_34' of https://github.com/stronk7/moodle into MOODLE_34_STABLE 2018-09-25 08:51:41 +08:00
Eloy Lafuente (stronk7) 0e7711084a MDL-63020 tests: ensure that searching for is null values also works ok 2018-09-24 17:43:19 +02:00
Tim Hunt 70b3253d46 MDL-63020 dml: improve the unit tests 2018-09-24 17:43:19 +02:00
Eloy Lafuente (stronk7) fd5cc5ee03 Merge branch 'MDL-63020_34' of git://github.com/timhunt/moodle into MOODLE_34_STABLE 2018-09-24 17:42:52 +02:00
Paul Holden 4f1725493d MDL-60028 enrol: fix counting of enrolled users in a given context.
Previously users enrolled in a course via multiple enrolment methods
would be counted multiple times.
2018-09-21 10:19:38 +01:00
Tim Hunt eb43bdbbb0 MDL-63020 ddl: fix nullable unique indexes in OCI and MS SQL
This works-around the default non-standard behaviour of these DB engines.
2018-09-20 17:50:30 +01:00
Tim Hunt a27808cd1b MDL-63020 xmldb: Improve PHPdoc comments for better IDE autocomplete 2018-09-20 17:50:28 +01:00
Luca Bösch 1157c4c29a MDL-62717 forum: Create announcements forum with HTML format intro. 2018-09-20 17:47:01 +02:00
Markku Riekkinen 65dc7eba8d MDL-61981 filter_mathjaxloader: add unit tests 2018-09-20 15:00:52 +03:00
Eloy Lafuente (stronk7) f05c493776 weekly release 3.4.5+ 2018-09-20 12:12:05 +02:00
Eloy Lafuente (stronk7) 761179ce00 MDL-63346 nodejs: Bump to created from scratch shrinkwrap file
Steps:

- remove node_modules & npm-shrinkwrap.json
- npm cache clear --force
- npm install
- npm shrinkwrap
2018-09-20 10:54:51 +02:00
Eloy Lafuente (stronk7) 3763566864 MDL-63346 travis: GRUNT job immune to npm-shrinkwrap.json changes
When upgrading nodejs/npm versions, there are modifications to
different packages or to the format of the npm-shrinkwrap.json
file. Usually that leads to failed jobs untill the bundled file
is updated.

To avoid that, we just ignore the npm-shrinkwrap.json file, so
just the REAL modifications in css/js/ignore stuff are considered.
2018-09-20 10:53:47 +02:00
Markku Riekkinen 5acd022bf6 MDL-61981 filter_mathjaxloader: nested math environments
The MathJax filter used to break mathematics if inline math was
used inside display math. Nolink spans were added around
the inline math even though it was nested inside another math
environment. This fix is aware of the nesting so that the spans
may be inserted only at the outer math environment. No regular
expressions are used because they do not support detecting
arbitrary, unlimited nesting of parentheses in the text, which
is now needed.
2018-09-19 15:36:37 +03:00
David Monllao 5bf7359a98 Merge branch 'MDL-63140-34' of git://github.com/rezaies/moodle into MOODLE_34_STABLE 2018-09-19 13:31:23 +02:00
David Monllao a0b0988443 Merge branch 'MDL-63135-34' of git://github.com/rezaies/moodle into MOODLE_34_STABLE 2018-09-19 13:13:25 +02:00
Eloy Lafuente (stronk7) cd475230e3 Merge branch 'MDL-63116-34-1' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-09-18 23:51:01 +02:00
Mihail Geshoski 7ef99fc213 MDL-61908 privacy: Fix heading in data privacy pages 2018-09-18 18:51:26 +02:00
Eloy Lafuente (stronk7) 39d9d254f8 Merge branch 'MDL-63109-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-09-18 18:32:17 +02:00
David Monllao cb5fb29cd7 Merge branch 'MDL-63138-34' of git://github.com/rezaies/moodle into MOODLE_34_STABLE 2018-09-18 16:41:23 +02:00
David Monllao 693959a524 Merge branch 'MDL-63139-34' of git://github.com/rezaies/moodle into MOODLE_34_STABLE 2018-09-18 16:37:54 +02:00
David Monllao 4a4f563f26 Merge branch 'MDL-63117-34' of git://github.com/rezaies/moodle into MOODLE_34_STABLE 2018-09-18 16:34:37 +02:00
Mihail Geshoski 2eccec9542 MDL-63109 privacy: Add behat tests 2018-09-18 15:08:21 +08:00
Mihail Geshoski 4c9c186fdc MDL-63109 privacy: Fix the initialisation of the policy acceptance modal 2018-09-18 15:05:01 +08:00
Tim Schroeder 0cd1bc0b67 MDL-63119 calendar: now showing event end in modal
When clicking on an event in the month view, a modal opens with
    information about it. That modal did previously only show the start time
    of the event. It now also shows the end (if the event has one).
2018-09-18 13:41:58 +08:00
Jun Pataleta 90a6d883b1 Merge branch 'm34_MDL-63319_MySQL_MSSQL_Rename_Field_Reserved_Word' of https://github.com/scara/moodle into MOODLE_34_STABLE 2018-09-18 13:41:39 +08:00
Eloy Lafuente (stronk7) c883e9bf96 Merge branch 'MDL-58781_34' of https://github.com/aanabit/moodle into MOODLE_34_STABLE 2018-09-17 23:43:35 +02:00
Eloy Lafuente (stronk7) 0b07e65fba Merge branch 'MDL-63009-34' of git://github.com/mickhawkins/moodle into MOODLE_34_STABLE 2018-09-17 23:31:13 +02:00
Eloy Lafuente (stronk7) 390dcea39c Merge branch 'MDL-63184-34-2' of git://github.com/junpataleta/moodle into MOODLE_34_STABLE 2018-09-17 23:11:45 +02:00
Eloy Lafuente (stronk7) ae7dc5dcfb Merge branch 'MDL-63354-34' of https://github.com/HuongNV13/moodle into MOODLE_34_STABLE 2018-09-17 23:06:57 +02:00
Jun Pataleta b333c94a01 MDL-63184 tool_dataprivacy: Ensure PO roles have correct capability 2018-09-17 22:35:49 +08:00
David Monllao 6385c8f0b7 Merge branch 'MDL-62554-34' of git://github.com/junpataleta/moodle into MOODLE_34_STABLE 2018-09-17 13:45:58 +02:00
Eloy Lafuente (stronk7) 8b16f4d7f2 Merge branch 'MDL-63215-34' of https://github.com/lucaboesch/moodle into MOODLE_34_STABLE 2018-09-17 10:43:28 +02:00
Mihail Geshoski 5f01d507cb MDL-63116 privacy: Add bulk actions to the privacy request table 2018-09-17 08:24:13 +08:00
Mihail Geshoski 449b4461ee MDL-63116 privacy: Add behat tests 2018-09-17 08:24:13 +08:00
Mihail Geshoski 980e81275b MDL-63116 privacy: Add unit tests 2018-09-17 08:24:13 +08:00
Michelle Melton aa21de4c84 MDL-63215 block_rss_client: Escaping tags in RSS entries 2018-09-16 23:46:05 +02:00
Matteo Scaramuccia da2d40de4c MDL-63319 ddl: Added getRenameFieldSQL() coverage 2018-09-14 22:45:01 +02:00
Matteo Scaramuccia 41e73ee448 MDL-63319 ddl: Improved rename_field() coverage
DB API should allow to rename fields, including renaming
those columns named using a reserved word.
2018-09-14 22:45:01 +02:00
Matteo Scaramuccia 5dca702169 MDL-63319 ddl: MSSQL should rename reserved words 2018-09-14 22:36:48 +02:00
Matteo Scaramuccia cd579c4b1a MDL-63319 ddl: MySQL should rename reserved words 2018-09-14 22:36:48 +02:00
Amaia Anabitarte ac97d778c7 MDL-58781 mod_feedback: Inconsistency in analysis exported to excel 2018-09-14 12:38:48 +02:00
Shamim Rezaie 308fda5fb1 MDL-63143 mod_lesson: Check if the module is visible to the user 2018-09-14 20:35:58 +10:00
Shamim Rezaie 6ebe20ee9b MDL-63143 mod_lesson: Add userid param to mod_lesson calendar callbacks 2018-09-14 20:35:58 +10:00
Eloy Lafuente (stronk7) 09b00ee19c weekly release 3.4.5+ 2018-09-14 11:06:50 +02:00
Shamim Rezaie 73fb05948f MDL-63142 mod_label: Check if the module is visible to the user 2018-09-14 17:56:11 +10:00
Shamim Rezaie 10da17c8b8 MDL-63142 mod_label: Add userid param to mod_label calendar callbacks 2018-09-14 17:56:11 +10:00
Shamim Rezaie 2b58ab0274 MDL-63141 mod_imscp: Check if the module is visible to the user 2018-09-14 17:50:37 +10:00
Shamim Rezaie e0f7f1ef95 MDL-63141 mod_imscp: Add userid param to mod_imscp calendar callbacks 2018-09-14 17:50:37 +10:00
Shamim Rezaie 9fc96f244c MDL-63140 mod_glossary: Check if the module is visible to the user 2018-09-14 17:44:56 +10:00
Shamim Rezaie 236636ea00 MDL-63140 mod_glossary: Add userid param to glossary calendar callbacks 2018-09-14 17:44:55 +10:00
Huong Nguyen a49d2c334a MDL-63354 Group: Rollover text on long group names is not consistent 2018-09-14 09:45:43 +07:00
Eloy Lafuente (stronk7) 8c4e26977c MDL-61169 iplookup: Change to another block still remaining to SF 2018-09-13 19:06:54 +02:00
Jun Pataleta 35e28afab4 MDL-62554 tool_dataprivacy: Integration review fixes 2018-09-13 14:52:34 +08:00
Michael Hawkins c718e9f671 MDL-63009 tool_dataprivacy: Added site name/link to request emails 2018-09-12 17:45:50 +08:00
Jun Pataleta 7eddff8e55 MDL-62294 lib: Take note of cherry-picked upstream commit
* Make a note of the applied upstream patch in
  lib/lessphp/moodle_readme.txt which fixes the PHP 7.2 compatibility
  issue when counting ruleset rules.
2018-09-12 16:46:37 +08:00
Michaël Marinetti da81219682 MDL-62294 lessphp: Fix for PHP 7.2 compatibility
From upstream commit:
https://github.com/oyejorge/less.php/commit/669acc51817a8da162b5f1b7137e79f0e4acc636
2018-09-12 16:46:37 +08:00
Jun Pataleta 43bd47b67a Merge branch 'mdl63321-moodle34' of https://github.com/tlock/moodle into MOODLE_34_STABLE 2018-09-12 15:33:21 +08:00
Jun Pataleta f251d75803 Merge branch 'MDL-63231-set-default-value-for-int-param-MOODLE_34' of https://github.com/guillalva06/moodle into MOODLE_34_STABLE 2018-09-12 09:58:39 +08:00
Jun Pataleta fc9a4136a7 Merge branch 'MDL-50314_34' of git://github.com/do-you-even-curl/moodle into MOODLE_34_STABLE 2018-09-12 09:43:26 +08:00
Tim Lock b0412aa454 MDL-63321 block: Fix warning in Calendar month block after MDL-60587 2018-09-12 08:31:02 +09:30
Eloy Lafuente (stronk7) 8fde61edd4 Merge branch 'MDL-63136-34' of git://github.com/rezaies/moodle into MOODLE_34_STABLE 2018-09-11 23:53:06 +02:00
Eloy Lafuente (stronk7) b736aab921 Merge branch 'MDL-62528-34' of git://github.com/bmbrands/moodle into MOODLE_34_STABLE 2018-09-11 23:05:44 +02:00
Guillermo Alvarez 95a0dce3d4 MDL-63231 filepicker: Skype validation for null values
In file_get_all_files_in_draftarea function an integer could get
a null value so it is necessary to execute this function only
when is called with a valid integer value.
2018-09-11 09:05:48 -05:00
Fotis Skandalis 21f3395f7a MDL-62714 theme_boost: Course visibility in navigation bar
Added check in navbar.mustache to add dimmed_text class if needed.
Added is_hidden() in navigationlib.php to return if the class needs
to be added.
2018-09-10 16:57:56 +03:00
Jun Pataleta d21dd7fbfc MDL-62554 tool_dataprivacy: Bump version for new WS functions 2018-09-10 12:18:55 +08:00
Jun Pataleta 2035a7a55e MDL-62554 tool_dataprivacy: Fix display of activity options 2018-09-10 12:18:55 +08:00
Jun Pataleta 3becb16f53 MDL-62554 tool_dataprivacy: Fix template for Bootstrapbase compatibility 2018-09-10 12:18:55 +08:00
Jun Pataleta cd6a9957fa MDL-62554 tool_dataprivacy: Remove defaults form
With the changes in this issue, this form is no longer being used.
2018-09-10 12:18:55 +08:00
Jun Pataleta 7b0cd65883 MDL-62554 tool_dataprivacy: Behat tests for managing registry defaults
* Also new step definitions and generator for:
  - Creating categories and purposes
  - Assigning category and purpose to context instances.
2018-09-10 12:18:55 +08:00
Jun Pataleta 402eec348e MDL-62554 tool_dataprivacy: Unit tests for new WS/API functions 2018-09-10 12:18:55 +08:00
Jun Pataleta 42e3825a92 MDL-62554 tool_dataprivacy: Fix fetching of default contexts
* We also need to handle default contexts for activities. If defaults
  for an activity is set, fetch that. If not, fetch the defaults for
  the context level.
2018-09-10 12:18:55 +08:00
Jun Pataleta d6c0be9438 MDL-62554 tool_dataprivacy: Allow setting of activity defaults
* Allow the setting of data registry defaults for activity modules.
* Rewrite the defaults page so that it uses templates.
* Use a tabbed layout for the defaults page that shows the default
  category and purpose per context level.
* New API and web service functions that enables the setting of the
  defaults.
2018-09-10 12:18:50 +08:00
Eloy Lafuente (stronk7) 28f6460de3 Moodle release 3.4.5 2018-09-08 16:49:46 +02:00
AMOS bot a63c88c57a Automatically generated installer lang files 2018-09-08 00:07:45 +00:00
Tim Schroeder 0d17150a0c MDL-50314 mod_quiz: removed hardcoded export columns
* The columns 'institution', 'department' and 'email' are no longer
  automatically included in all quiz result exports.
* These columns can still be used, but have to be configured under
  'showuseridentity'.
2018-09-07 14:16:41 +02:00
Shamim Rezaie b8d91beab4 MDL-63136 mod_data: Check if the module is visible to the user 2018-09-07 17:42:32 +10:00
Shamim Rezaie 8f8093ac0f MDL-63136 mod_data: Add userid param to mod_data calendar callbacks 2018-09-07 17:42:31 +10:00
Shamim Rezaie 5eae317838 MDL-63139 mod_forum: Check if the module is visible to the user 2018-09-07 16:56:44 +10:00
Shamim Rezaie 445be5614a MDL-63139 mod_forum: Add userid param to mod_forum calendar callbacks 2018-09-07 16:56:44 +10:00
Shamim Rezaie ae9af4e486 MDL-63138 mod_folder: Check if the module is visible to the user 2018-09-07 15:06:52 +10:00
Shamim Rezaie 08392add89 MDL-63138 mod_folder: Add userid param to mod_folder calendar callback 2018-09-07 15:06:52 +10:00
Jun Pataleta 1796e82ef3 weekly release 3.4.4+ 2018-09-07 11:12:18 +08:00
Jun Pataleta d6df81c983 Merge branch 'install_34_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_34_STABLE 2018-09-07 11:11:55 +08:00
Shamim Rezaie 75bad7de80 MDL-63135 mod_choice: Check if the module is visible to the user 2018-09-06 20:15:16 +10:00
Shamim Rezaie 056dd08cd2 MDL-63135 mod_choice: Add userid param to mod_choice calendar callback 2018-09-06 20:15:16 +10:00
Shamim Rezaie 1f9034982e MDL-63135 mod_choice: Added choice_get_user_response function
A new function to return choice answers records of a given user in a given choice activity.
2018-09-06 20:15:15 +10:00
Shamim Rezaie ace999418c MDL-63117 mod_book: Check if the module is visible to the user 2018-09-06 17:46:32 +10:00
Shamim Rezaie 5892083e98 MDL-63117 mod_book: Add userid param to mod_book calendar callbacks 2018-09-06 17:46:29 +10:00
Jake Dallimore d7fbf4a33e Merge branch 'MDL-63302-34' of git://github.com/junpataleta/moodle into MOODLE_34_STABLE 2018-09-06 09:23:55 +08:00
Jun Pataleta 165ce9437e MDL-63302 tool_dataprivacy: Increment version of the merged plugin
This is to distinguish the versions available from the plugins directory
from the versions that are part of Moodle standard distribution.
2018-09-06 08:51:52 +08:00
Eloy Lafuente (stronk7) eacb15b2b2 Merge branch 'MDL-63292-34-policyversion' of git://github.com/mudrd8mz/moodle into MOODLE_34_STABLE 2018-09-05 21:10:23 +02:00
David Mudrák ae650468ed MDL-63292 tool_policy: Increment version of the merged plugin
This is to distinguish the versions available from the plugins directory
from the versions that are part of Moodle standard distribution.
2018-09-05 13:47:32 +02:00
Jake Dallimore dab2e7771f MDL-62947 mod_feedback: fix feedback so it correctly uses forms API
Feedback code was doing the following, which is incompatible with the
sec-patched quickforms lib:
- appending '[0]' to non-group element names, meaning type checks in
getCleanType() were falling back to PARAM_RAW instead of PARAM_INT,
and meaning _findValue() was comparing elements it thought to be arrays
with scalar submit values (worked with eval() implementation as the 0th
element of a string was the character, but not working when patched).
- external unit tests incorrectly testing multichoice questions in the
process_page tests - patched lib highlighted failures.

It was also doing the following:
- actively setting null as default element values instead of 0 for
radio buttons and dropdowns (for 'not selected'). This is incompatible
with more recent quickforms lib (see MDL-63070).
- creating groups using addElement instead of addGroup - not recommended

This patch addresses the above.
2018-09-05 12:13:52 +08:00
Jake Dallimore bd509e7575 MDL-62947 core_form: fix remote code execution exploit in QuickForms
Applies the patch found upstream:
https://github.com/pear/HTML_QuickForm/commit/
d3a6d5c44dedf3c164c6c79198e4ef479bcedcd2 and make util methods static
for php7 compatibility.
2018-09-05 12:13:52 +08:00
AMOS bot e6394e2eaa Automatically generated installer lang files 2018-09-05 00:07:38 +00:00
Damyon Wiese 40e3c83ec8 MDL-62748 course: maxsections is a limit
For course formats shipped with core, maxsections should be a limit to the number of sections
allowed in the course.
2018-09-04 22:37:50 +02:00
Mihail Geshoski 3ea7d116b8 MDL-62857 theme_boost: Better filtering on navbar / breadcrumbs 2018-09-04 22:37:50 +02:00
Tim Hunt cfc4393aa6 MDL-62880 qtype_ddwtos: drop support for legacy import format
It was more than 8 years since we wrote in that format.
2018-09-04 22:37:50 +02:00
Eloy Lafuente (stronk7) f477be8684 Merge branch 'MDL-63249-34-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_34_STABLE 2018-09-04 22:35:12 +02:00
Helen Foster 9d9d1b985f MDL-63249 lang: Merge English strings from the en_fix language pack
Significant string changes:

* completionpass_help, gradetopassnotset in mod_quiz - grade to pass
  set in quiz settings not gradebook
* namecolumnmissing,core_cohort - fixing incorrect message about adding
  users to a cohort
2018-09-04 15:14:50 +02:00
David Monllao bb5a6b610c Merge branch 'MDL-62342-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-09-04 14:34:13 +02:00
Neill Magill 2720c9570a MDL-62944 calendar: Clarify the intended use of $checkcapability 2018-09-04 12:19:07 +02:00
David Monllao 3955345d8c Merge branch 'MDL-62944-m34' of https://github.com/NeillM/moodle into MOODLE_34_STABLE 2018-09-04 12:16:15 +02:00
David Monllao 2df693e17d Merge branch 'MDL-55993-34' of https://github.com/albertolarah/moodle into MOODLE_34_STABLE 2018-09-04 10:53:40 +02:00
Jun Pataleta 929962527c Merge branch 'MDL-60901_34' of git://github.com/stronk7/moodle into MOODLE_34_STABLE 2018-09-04 10:17:45 +08:00
Dan Poltawski 8252dfbd00 MDL-48846 filter: Stop reffering to invalid moodle.org/download/mimetex 2018-09-03 23:45:16 +02:00
Eloy Lafuente (stronk7) de7cc3fbea Merge branch 'MDL-61325-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-09-03 23:34:02 +02:00
Eloy Lafuente (stronk7) 898d1beb5c Merge branch 'MDL-63255-34' of git://github.com/vmdef/moodle into MOODLE_34_STABLE 2018-09-03 23:31:21 +02:00
Eloy Lafuente (stronk7) eb19e3352a Merge branch 'MDL-62848-34-placeholderwidth' of git://github.com/mudrd8mz/moodle into MOODLE_34_STABLE 2018-09-03 23:01:59 +02:00
David Monllao 0c8dfdcf0e Merge branch 'MDL-38301-34' of git://github.com/junpataleta/moodle into MOODLE_34_STABLE 2018-09-03 12:45:06 +02:00
David Monllao f14acd208f Merge branch 'MDL-55744-34_atto_should_not_autosave_on_not_loggedin_users' of https://github.com/dravek/moodle into MOODLE_34_STABLE 2018-09-03 12:28:07 +02:00
Alberto Lara Hernández a5ca74838f Merge branch 'MDL-55993-34' of https://github.com/albertolarah/moodle into MDL-55993-34 2018-09-03 12:25:24 +02:00
Alberto Lara Hernández 588b484099 MDL-55993 mod_assign: web services don´t set a URL. 2018-09-03 12:25:17 +02:00
Eloy Lafuente (stronk7) 47de66238b MDL-60901 environment: 3.6 requirements
Changes include:
- MySQL 5.6 is required.
- PostgreSQL 8.4 is required.
- Oracle 11.2 is required.
- 64bits architecture is recommended.
2018-09-03 10:14:22 +02:00
Víctor Déniz Falcón 93654d4b60 Merge branch 'MDL-63255-34' of git://github.com/vmdef/moodle into MDL-63255-34-test 2018-09-03 07:00:33 +01:00
Mihail Geshoski 4dc8fa2237 MDL-62342 privacy: Fix strings used in the consent on behalf modal 2018-09-03 13:00:58 +08:00
Mihail Geshoski 38127e5ed6 MDL-62342 privacy: Use singular/plural form in labels 2018-09-03 13:00:58 +08:00
Mihail Geshoski 69e15470dc MDL-56998 blog: Remove associated blog posts when module is deleted 2018-09-03 08:40:02 +08:00
AMOS bot 8c55985f99 Automatically generated installer lang files 2018-09-02 00:07:36 +00:00
AMOS bot 150f2bdfe3 Automatically generated installer lang files 2018-09-01 00:07:36 +00:00
David Mudrák 847444bc5b MDL-62848 form: Fix width of the autocomplete input field
Make sure that the autcomplete input field is wide enough to display the
placeholder text.
2018-08-31 14:54:33 +02:00
David Mudrák 6906f50822 MDL-62848 form: Fix missing support for {{#js}} helper in autocomplete
The form-autocomplete module uses three Mustache templates
core/form_autocomplete_input, core/form_autocomplete_suggestions and
core/form_autocomplete_selection. However, it did not support executing
the JS that is eventually part of those templates.
2018-08-31 14:54:33 +02:00
Simey Lameze 9d9d5af530 MDL-62944 calendar: Fix actionevent logic on template
During the calendar work, we have added the feature of
drag and drop activity event or "action events".

The problem at that time was, action events could not be
editable through the calendar UI, but should be allowed
to drag and drop. So, we couldn't use the return of
calendar_edit_event_allowed() because it can return true
(in case of teachers, that have permission to change the
activity) and the attribute isactionevent was created to
control on the UI if the user is viewing an action event.

So what my patch does is just add the check if we are
viewing an action event, and in this case, it won't display
the cog to edit that event.
2018-08-31 10:19:26 +01:00
Neill Magill c98058add8 MDL-62944 activities: Activities should not require capability
Activities should not require the user manipulating them to have
calendar capabilities for their events to be added to the Moodle
calendar
2018-08-31 10:19:26 +01:00
Neill Magill de198dce1b MDL-62944 activities: Test adding activities with no calendar capability 2018-08-31 10:19:25 +01:00
Neill Magill 2d533ee7e8 MDL-62944 completion: Calendar capabilities should not be required
The completion API should not require a user to have the capability to
add calendar events for it to function correctly.
2018-08-31 10:19:25 +01:00
Neill Magill 8b2e002cca MDL-62944 completion: Test that completion dates add events to calendar
When a user does not have calendar capabilities completion dates should
still be created correctly.
2018-08-31 10:19:25 +01:00
Neill Magill a620750547 MDL-62944 mod_data: Action menu missing from database pages
The action menu was missing from many of the database activity pages,
which meant that it could not be accessed until enough had been done to
the activity to make the editing tabs that used view.php accessible.
2018-08-31 10:19:25 +01:00
Eloy Lafuente (stronk7) 0416ad83f6 weekly release 3.4.4+ 2018-08-30 19:04:22 +02:00
Eloy Lafuente (stronk7) 620654f9bb Merge branch 'install_34_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_34_STABLE 2018-08-30 19:04:19 +02:00
Dan Marsden a26c9ceff5 MDL-61325 use correct value when looking for string. 2018-08-30 09:14:40 +08:00
AMOS bot a2e0bea764 Automatically generated installer lang files 2018-08-30 00:08:14 +00:00
Eloy Lafuente (stronk7) f0f0bd87cd Merge branch 'MDL-63094-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-08-29 00:22:57 +02:00
Eloy Lafuente (stronk7) 916415860a Merge branch 'MDL-62914-34' of git://github.com/lameze/moodle into MOODLE_34_STABLE 2018-08-28 23:17:04 +02:00
Victor Deniz f7ea5aef8f MDL-63255 core_user: fix hardcoded sql table aliases 2018-08-28 11:57:05 +01:00
Jake Dallimore 22cbbb04bb Merge branch 'MDL-63101-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-08-28 16:56:12 +08:00
Andrew Nicols 3cb27d07cd Merge branch 'MDL-62782-34' of git://github.com/damyon/moodle into MOODLE_34_STABLE 2018-08-28 07:07:59 +08:00
Eloy Lafuente (stronk7) 351552597e Merge branch 'MDL-62989-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-08-27 17:51:39 +02:00
Jun Pataleta db3a6dc2c8 MDL-63187 tool_dataprivacy: Behat fixes for confirmation lang strings 2018-08-27 22:44:58 +08:00
David Monllao 5158d78e89 Merge branch 'MDL-63174-34-emptyusername' of git://github.com/mudrd8mz/moodle into MOODLE_34_STABLE 2018-08-27 15:09:11 +02:00
David Monllao 322c827a92 MDL-63187 tool_dataprivacy: Update delete purpose and category lang strings 2018-08-27 12:12:08 +02:00
David Monllao 9e4450e2c3 Merge branch 'MDL-63187-34' of git://github.com/junpataleta/moodle into MOODLE_34_STABLE 2018-08-27 11:59:00 +02:00
David Monllao dacd9f0aaf Merge branch 'MDL-63210_34' of git://github.com/markn86/moodle into MOODLE_34_STABLE 2018-08-27 11:47:07 +02:00
David Monllao 3497dbd58f Merge branch 'MDL-62867-34-missing_colon_in_query' of https://github.com/bitumin/moodle into MOODLE_34_STABLE 2018-08-27 11:23:05 +02:00
Andrew Nicols e553601950 Merge branch 'MDL-53024-34' of git://github.com/damyon/moodle into MOODLE_34_STABLE 2018-08-27 15:46:53 +08:00
Damyon Wiese d0920c3ccf MDL-53024 assign: Remove incorrect logic in query
We are simplifying this query so it will return grades if the attempt matches
the submission attempt, or there is no submission. The case where there is a grade
but no submission can happen only for group assignments.
2018-08-27 15:35:04 +08:00
Zig Tan 79c0b489dd MDL-38301 mod_assign: Fix date validation logic & message consistency 2018-08-27 15:33:35 +08:00
Andrew Nicols bb52200f87 MDL-63101 cache: Improve accuracy of cache event invalidation 2018-08-27 14:44:26 +08:00
Alberto Lara Hernández 0cd85a850c MDL-55993 mod_assign: web services don´t set a URL. 2018-08-24 16:30:21 +02:00
Mitxel Moriana a21664df59 MDL-62867 tags: Fix missing colon in sql placeholder
Due to a missing colon in an sql query field value placeholder
the calculation of the ordering field for a newly added tag
was ignoring itemid.
2018-08-24 15:02:10 +02:00
Mihail Geshoski 2f4fe81c81 MDL-62989 privacy: Improve data request order for users 2018-08-24 15:34:24 +08:00
Jake Dallimore 1a7ae6c763 weekly release 3.4.4+ 2018-08-24 13:08:55 +08:00
Mark Nelson 5b4811c28b MDL-63210 core: convert for loop to forEach in JS 2018-08-24 11:34:50 +08:00
Jun Pataleta 73daef62b4 MDL-63187 tool_dataprivacy: Improve confirm message lang strings
* Updated the delete confirmation messages so that the category/purpose
names are shown in italics. This makes it easier for the privacy officer
to see the category/purpose that is being deleted.
2018-08-23 16:58:59 +08:00
Jun Pataleta 6368757029 MDL-63187 tool_dataprivacy: Behat tests for purposes/categories CRUD 2018-08-23 16:58:59 +08:00
Jun Pataleta 19efff94f4 MDL-63187 tool_dataprivacy: Fix delete button text
* No need to add the purpose/category name for the delete button itself
* Fix delete confirmation lang strings.
* Add button titles to Add purpose/category buttons so they can be
  clicked on when running Behat tests.
2018-08-23 16:58:59 +08:00
Mark Nelson a456850616 MDL-63210 core: touch-up after review
1. Reworded the string.
2. Removed logic handling form data.
3. Do not use window.location.replace.

Backport of MDL-54551.
2018-08-23 12:40:04 +08:00
Thom Rawson 24342e7617 MDL-63210 core: AJAX call redirects to login page when session expired
Backport of MDL-54551.
2018-08-23 12:40:04 +08:00
Jake Dallimore b56a0d69f1 MDL-36255 core_grade: fix to ensure correct context used for filters
Some grade object (outcomes,scales) can be created at site or course
context, so this patch just makes sure we use the respective context
when applying format_string to the name in the get_name() function.
2018-08-22 17:58:07 +08:00
Andrew Nicols 86c7c955eb MDL-63094 tool_policy: Fix the cookie banner to the bottom
Floating banners cause issues with clickability in Behat as it is unable
to understand that it cannot interact with the elements underneath the
floating banner, or that it needs to scroll the page so that the
required content is no longer beneath the floating banner.

Changing the banner to be fixed to the bottom of the page during Behat
runes is a reliable fix.
2018-08-22 11:00:08 +08:00
Andrew Nicols 0c94a92429 MDL-63094 js: Do not check visibility before hiding backdrop
It's possible for the backdrop to be created during the show, before the
modal is actually fully shown.

This check is unnecessary because the getBackdrop() function always
returns a value and will always succeed.
2018-08-22 10:28:32 +08:00
Andrew Nicols fed3dbe83e MDL-63094 tool_policy: Fix race condition in modal display
The way in which the modal was displayed meant that there were no
pending JS items, whilst the modal was rendered, causing random behat
fails.

This JS has been restructured to create the Modal and pass it a set of
Promises for both the title, and body.
2018-08-22 10:27:58 +08:00
Henning Bostelmann 45c3cf28e9 MDL-62914 Calendar: handle TZURL iCal property 2018-08-22 10:11:17 +08:00
Andrew Nicols ebb2a1e101 Merge branch 'MDL-62660_34' of https://github.com/stronk7/moodle into MOODLE_34_STABLE 2018-08-22 08:04:33 +08:00
Eloy Lafuente (stronk7) 4d7029fd03 MDL-62660 xmldb: fix tool_dataprivacy_request_>status to int(2)
So the new defined statuses fit in the column for all databases.
2018-08-22 00:05:30 +02:00
Jake Dallimore 70b6f5fb55 Merge branch 'MDL-36255-34' of https://github.com/lucaboesch/moodle into MOODLE_34_STABLE 2018-08-21 16:07:02 +08:00
Jake Dallimore e03c0c9c4c Merge branch 'MDL-62534-34' of https://github.com/mackensen/moodle into MOODLE_34_STABLE 2018-08-21 11:45:42 +08:00
Andrew Nicols 50eea43f99 Merge branch 'MDL-62660-34' of git://github.com/junpataleta/moodle into MOODLE_34_STABLE 2018-08-21 11:11:33 +08:00
Jun Pataleta 5f51b6dcf0 MDL-62660 tool_dataprivacy: Behat fix for data deletion 2018-08-21 10:38:28 +08:00
Jun Pataleta 52df040e61 MDL-62660 tool_dataprivacy: CI fixes 2018-08-21 09:38:14 +08:00
Charles Fulton 93c174cbf1 MDL-62534 course formats: do not purge empty sections on upgrade 2018-08-20 09:16:22 -04:00
Michael Hawkins a8fb33368c MDL-62660 tool_dataprivacy: Behat additions for deletion and data expiry 2018-08-20 16:05:13 +08:00
Michael Hawkins ceb825a892 MDL-62660 tool_dataprivacy: Add and update PHPUnit tests
Updated tests with latest statuses.
Added testing for request download expiry functionality and method.
Added assign_site_dpo within a parent class for unit tests.
2018-08-20 16:05:12 +08:00
Michael Hawkins c47a276b00 MDL-62660 tool_dataprivacy: Add scheduled task to expire data requests 2018-08-20 16:05:12 +08:00
Jun Pataleta 1efd8b0291 MDL-62660 tool_dataprivacy: Fix version number in upgrade code 2018-08-20 16:05:12 +08:00
Michael Hawkins 332a03df8b MDL-62660 tool_dataprivacy: Add ability to expire data requests
Also replaced Completed status with situation specific statuses.
Also improved UX on request pages in line with expiries and the aadditional statuses.
2018-08-20 16:03:55 +08:00
Andrew Nicols 90f7c52e40 MDL-62660 tool_dataprivacy: Add method for unit tests to run adhoc tasks 2018-08-20 16:02:32 +08:00
Luca Bösch 13b07ada78 MDL-36255 grades: allow multilang filters in grades 2018-08-20 08:34:36 +02:00
Jake Dallimore 402d5de15a Merge branch 'MDL-57741-34' of git://github.com/cescobedo/moodle into MOODLE_34_STABLE 2018-08-20 10:12:34 +08:00
Eloy Lafuente (stronk7) 94409c69b1 weekly release 3.4.4+ 2018-08-17 17:37:42 +02:00
Eloy Lafuente (stronk7) b0bbe6b2c8 NOBUG: Fixed file access permissions 2018-08-17 17:37:41 +02:00
Eloy Lafuente (stronk7) edb7272666 Merge branch 'install_34_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_34_STABLE 2018-08-17 17:37:39 +02:00
David Mudrák 1d3cbad20e MDL-63174 user: user_create_user to throw exception on empty username
The core API function user_create_user() did not check the case when the
given username was empty.

Also adding a missing string 'usernamelowercase' for the existing lower
case check and unit tests.
2018-08-17 13:24:23 +02:00
David Mudrák fa9d16fd66 MDL-63174 user: core_user_create_users to throw exception on empty names
To be consistent with the web administration UI, we should not allow to
create invalid user records with empty username, lastname or firstname
via the web services.
2018-08-17 13:24:23 +02:00
Damyon Wiese 9d6bf4c4c0 MDL-62884 privacy: Additional fix for popper.js
The older version of popper needs custom CSS to ensure the menus are
visible without scrolling.
2018-08-17 16:07:15 +08:00
Damyon Wiese aaf055af33 MDL-62884 privacy: Fix styles
An action menu displayed inside a table needs to be tested on every theme. It is
required to ensure that the menu displays correctly, even when it would display outside
the scrollable region for the table.
2018-08-17 16:07:07 +08:00
cescobedo 08f4b0323b MDL-57741 enrol_lti: Add Launch URL to Published as LTI tools 2018-08-16 09:19:27 +02:00
AMOS bot 494a91d003 Automatically generated installer lang files 2018-08-16 00:08:27 +00:00
Bas Brands 4179c7d022 MDL-62528 forum: Fixed vertical position when loading permalinks 2018-08-15 11:43:05 +02:00
Jake Dallimore 9028bd17a5 Merge branch 'MDL-63050-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-08-15 11:00:32 +08:00
Andrew Nicols a3d0d0adba Merge branch 'MDL-62600-34' of git://github.com/mickhawkins/moodle into MOODLE_34_STABLE 2018-08-15 08:55:46 +08:00
AMOS bot 0b68426b3c Automatically generated installer lang files 2018-08-15 00:07:49 +00:00
Luke Carrier b939f70922 MDL-61238 cohort: require_once all libraries 2018-08-15 00:13:58 +02:00
Eloy Lafuente (stronk7) 5ae2ec409b Merge branch 'MDL-62341-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-08-15 00:06:22 +02:00
Eloy Lafuente (stronk7) e660bc47f0 Merge branch 'MDL-58409-34_needs_clean_in_autocomplete_element' of https://github.com/dravek/moodle into MOODLE_34_STABLE 2018-08-14 17:50:55 +02:00
Eloy Lafuente (stronk7) e8eb4f7825 Merge branch 'MDL-61650-34' of git://github.com/damyon/moodle into MOODLE_34_STABLE 2018-08-14 16:57:34 +02:00
Michael Hawkins 635a878bae MDL-62600 tool_dataprivacy: Corrected availability of PO pages to admins 2018-08-14 12:28:54 +08:00
Andrew Nicols 85a0f30489 Merge branch 'MDL-62643-34' of git://github.com/damyon/moodle into MOODLE_34_STABLE 2018-08-14 09:21:12 +08:00
Karen Holland df8f32bdf8 MDL-62896 Privacy: External plugin Additional label update. 2018-08-14 08:05:38 +08:00
David Monllao 7fda5667ba Merge branch 'MDL-62761-34' of https://github.com/jmvedrine/moodle into MOODLE_34_STABLE 2018-08-13 15:30:15 +02:00
David Monllao 3d5d4ad291 Merge branch 'MDL-59015-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-08-13 12:19:33 +02:00
Jake Dallimore 6a96c6d9b7 Merge branch 'MDL-60114_34_radio-option-choose' of https://github.com/awagner/moodle into MOODLE_34_STABLE 2018-08-13 16:04:07 +08:00
Andrew Nicols 3636e715e0 Merge branch 'MDL-62799-34-2' of git://github.com/junpataleta/moodle into MOODLE_34_STABLE 2018-08-13 13:53:28 +08:00
Jun Pataleta 7c85d38e93 MDL-62799 core: Add tool_dataprivacy to list of standard plugins 2018-08-13 12:46:16 +08:00
Jun Pataleta 51e87bce2f MDL-62799 tool_dataprivacy: Fix CiBoT complaints 2018-08-13 12:30:26 +08:00
Jun Pataleta 983b72cedd MDL-62799 tool_dataprivacy: Move user generation within the test
Patch originally from MDL-62962.
2018-08-13 12:30:07 +08:00
sam marshall fc4ca0f91c MDL-62799 tool_dataprivacy: Add capabilities to control data downloads
Patch originally from MDL-61652.
2018-08-13 12:29:46 +08:00
Jun Pataleta e2a2d8424b MDL-62799 tool_dataprivacy: Behat tests for contacting PO
Patch originally from MDL-62026.
2018-08-13 12:29:36 +08:00
Jun Pataleta b6168a9990 MDL-62799 tool_dataprivacy: Allow manual completion of general enquiries
Patch originally from MDL-62026.
2018-08-13 12:29:24 +08:00
Jun Pataleta aaa58a165d MDL-62799 tool_dataprivacy: Merge the data privacy tool in 3.4 2018-08-13 09:07:42 +08:00
Mihail Geshoski 5676f7308f MDL-62341 privacy: Add behat test 2018-08-13 08:00:26 +08:00
Mihail Geshoski 52415401b6 MDL-62341 privacy: Add link to previous page in viewall policies page 2018-08-13 08:00:26 +08:00
Mihail Geshoski 59e3d345a1 MDL-59015 blocks: Confusing View more button in course overview block 2018-08-13 07:59:07 +08:00
Jean-Michel Vedrine 5eb7a89f6f MDL-62761 lesson: wrong deadlines on index with overrides 2018-08-12 07:53:56 +02:00
Andreas Wagner 76847757ec MDL-60114 mod_data: adding db activity lost radio field choose option 2018-08-11 07:45:51 +02:00
Eloy Lafuente (stronk7) e8452a3d0a weekly release 3.4.4+ 2018-08-10 13:22:01 +02:00
Andrew Nicols 2e7ffa7af4 Merge branch 'MDL-62619_34' of git://github.com/stronk7/moodle into MOODLE_34_STABLE 2018-08-10 08:46:00 +08:00
Eloy Lafuente (stronk7) 283369be28 MDL-62619 privacy: Prevent action when boolean queries are involved
Before the patch, queries like:

SELECT 1 FROM dual UNION SELECT 2 FROM dual

were failing badly, with everything but the first numeric element
being ignored by the optimization.

So, being conservative, now we reduce the query being analysed,
ignoring any subquery, inline view (anything within parenthesis
in general) and, in the remaining query, if a boolean query (UNION,
MINUS, INTERSECT...) is found, we don't apply any optimization.
2018-08-09 16:15:54 +02:00
Eloy Lafuente (stronk7) 3b10f8db20 Merge branch 'MDL-62619-34-privacycontexts' of git://github.com/mudrd8mz/moodle into MOODLE_34_STABLE 2018-08-08 01:03:21 +02:00
Eloy Lafuente (stronk7) 8ad1ba5675 Merge branch 'MDL-43334-34' of git://github.com/damyon/moodle into MOODLE_34_STABLE 2018-08-08 00:16:43 +02:00
Eloy Lafuente (stronk7) e08af21694 Merge branch 'MDL-61839-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-08-07 23:56:34 +02:00
Eloy Lafuente (stronk7) e9fcb3bcf9 Merge branch 'MDL-61870-34' of git://github.com/damyon/moodle into MOODLE_34_STABLE 2018-08-07 23:48:49 +02:00
Eloy Lafuente (stronk7) 8a6b47642e Merge branch 'MDL-62750_34' of https://github.com/aanabit/moodle into MOODLE_34_STABLE 2018-08-07 17:23:59 +02:00
David Matamoros b391ba4214 MDL-55744 EDITOR_ATTO: Now atto does not autosave for not loggedin user 2018-08-07 15:24:15 +02:00
David Matamoros cb9ab70513 MDL-58409 core_form: needs clean in autocomplete element 2018-08-07 11:04:36 +02:00
Andrew Nicols 51b1c2b4d6 MDL-62800 behat: Correct path to P&P
This commit was originally a part of MDL-62950
2018-08-07 14:13:34 +08:00
Andrew Nicols d812eb333b Merge branch 'MDL-62798-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-08-07 13:13:13 +08:00
Andrew Nicols 288710cac2 Merge branch 'MDL-62800-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-08-07 12:11:52 +08:00
Mihail Geshoski 32c0d93b26 MDL-62800 tool_policy: Add policy plugin in standard_plugins_list() 2018-08-07 11:21:19 +08:00
sarjona 5174d7ad75 MDL-62800 tool_policy: Merge the policy tool to 3.4
The following changes has been done from the original repo:
- Remove README.md, LICENSE.md and .travis.yml
- Review the version.php content, to look like a standard plugin
- Adapt jquery-eu-cookie-law-popup.js and readme_moodle.txt to remove the
eslint-ignore
2018-08-07 11:04:38 +08:00
Andrew Nicols 7c8dadf029 Merge branch 'wip-MDL-61424-34' of git://github.com/marinaglancy/moodle into MOODLE_34_STABLE 2018-08-07 09:30:09 +08:00
Amaia Anabitarte 9a0e25e7dd MDL-62750 lang: Trim langlist setting values 2018-08-06 09:41:27 +01:00
Mihail Geshoski 3c1e4d11b7 MDL-62798 repositories: Report sections by name in server repository 2018-08-06 09:54:49 +08:00
Mihail Geshoski 5d10a3e920 MDL-61839 glossary: One letter search in glossary returns all entries 2018-08-06 09:50:38 +08:00
Damyon Wiese 29d815799b MDL-61650 assign: More consistent empty text
Consistently check for empty submissions with count_words(trim($text)).
2018-08-03 16:53:47 +08:00
Damyon Wiese 3cb6f1de33 MDL-62279 assign: Properly set the defaults
Before an assignment has been created, we need to use the site defaults,
not the per instance defaults for the settings.
2018-08-03 15:13:25 +08:00
Andrew Nicols 80ed1e0cd7 weekly release 3.4.4+ 2018-08-03 11:30:24 +08:00
Andrew Nicols c6149d54d6 Merge branch 'install_34_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_34_STABLE 2018-08-03 11:30:22 +08:00
Damyon Wiese ef12348101 MDL-60685 assign: Do not falsely use admin user
When an assign_grades record is automatically populated, do not use the admin user as the default grader.

This would generate false information on the assignment summary screen and send false notifications from
the admin user.
2018-08-02 14:20:02 +08:00
Damyon Wiese 3eaca718a5 MDL-61870 mod_assign: Conditionally backup groups
When group info is not backed up, do not backup assignment submissions or overrides that related to a specific group.
We are already correctly not restoring them, but it is more robust not to include them in the backup file at all.
2018-08-02 13:09:06 +08:00
Zig Tan 3b7ead71a4 MDL-61870 mod_assign: Fix/clean up imported group override duedates
Applying patch supplied from Damyon Wiese to address the root-cause
of this issue in the backup/restore logic.
2018-08-02 13:09:01 +08:00
Zig Tan ae25d0ec2c MDL-61870 mod_assign: Fix/clean up imported group override duedates
- Prevent group override duedate events from being imported when groups are excluded
- Clean up any existing group override duedate events when editing assignment in upgradelib.php
- Updated lib.php unit tests
2018-08-02 13:08:28 +08:00
Andrew Nicols 5f901db7e7 Merge branch 'MDL-59847-34' of https://github.com/snake/moodle into MOODLE_34_STABLE 2018-08-02 11:41:01 +08:00
Andrew Nicols 8266c03f7a Merge branch 'MDL-62983-34' of git://github.com/sarjona/moodle into MOODLE_34_STABLE 2018-08-02 11:27:51 +08:00
Andrew Nicols 03587989ea MDL-63050 cachestore_redis: Update hExists to check empty 2018-08-02 11:00:42 +08:00
Andrew Nicols 8058d53f6a MDL-63050 redis: Make session check compatible with Redis 4.0 2018-08-02 11:00:42 +08:00
David Mudrák 52b377677a MDL-59847 core: Fix display of hidden identity fields in user selectors
User selectors now respect the user's permission to view other users'
hidden profile fields.
2018-08-02 10:35:25 +08:00
Eloy Lafuente (stronk7) 6cabd9b1f2 Merge branch 'MDL-57666-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-08-02 01:28:10 +02:00
Eloy Lafuente (stronk7) 85e4550689 Merge branch 'MDL-62965-34-userprofilesignup' of git://github.com/mudrd8mz/moodle into MOODLE_34_STABLE 2018-08-02 00:41:45 +02:00
Eloy Lafuente (stronk7) 5636f37daf Merge branch 'MDL-59595-34-2' of git://github.com/snake/moodle into MOODLE_34_STABLE 2018-08-02 00:21:44 +02:00
Eloy Lafuente (stronk7) 71db484a6a Merge branch 'MDL-62977_34' of git://github.com/markn86/moodle into MOODLE_34_STABLE 2018-08-01 16:44:15 +02:00
Jonathon Fowler d065231113 MDL-62983 core_user: Hold multiple filters when clicking any link 2018-08-01 12:11:00 +02:00
Eloy Lafuente (stronk7) 5aa54cc598 Merge branch 'MDL-41847-34' of git://github.com/sarjona/moodle into MOODLE_34_STABLE 2018-07-31 23:51:04 +02:00
David Monllao 389a43143e Merge branch 'm34_MDL-58015' of https://github.com/danmarsden/moodle into MOODLE_34_STABLE 2018-07-31 13:37:16 +02:00
David Monllao 09fd0f485a Merge branch 'MDL-59611-34' of git://github.com/damyon/moodle into MOODLE_34_STABLE 2018-07-31 13:31:23 +02:00
David Monllao 0aa0600059 Merge branch 'MDL-44538-34' of https://github.com/lucaboesch/moodle into MOODLE_34_STABLE 2018-07-31 11:21:23 +02:00
Jun Pataleta b415e34429 Merge branch 'MDL-58768-34-2' of git://github.com/rezaies/moodle into MOODLE_34_STABLE 2018-07-31 16:16:35 +08:00
Shamim Rezaie 723e5b7533 MDL-58768 mod_assign: Added userid param to calendar callbacks
The mod_assign_core_calendar_is_event_visible and mod_assign_core_calendar_provide_event_action
functions now accept a new parameter ($userid) so they are not always dependet to the logged in user.
2018-07-31 15:45:36 +10:00
Shamim Rezaie 4ac18c8480 MDL-58768 core: Fix a typo for callback name 2018-07-31 15:45:36 +10:00
Shamim Rezaie ec92334c18 MDL-58768 mod_assign: Add $user param to assign::can_grade 2018-07-31 15:45:36 +10:00
Shamim Rezaie 856d6bcaf7 MDL-58768 calendar: Add $requestinguser to the container class
The requesting user is not always the same as the current user. The container class now allows a different user
to be set as the requesting user. All capability checks are done against the requesting user.

Also, the $requestinguser is passed to core_calendar_provide_event_action and core_calendar_is_event_visible
callback functions. These callback functions need to be updated in all activity modules to accept a $user parameter.
2018-07-31 15:45:36 +10:00
Shamim Rezaie b2704139ad MDL-58768 coursecat: coursecat::get to accept a $user parameter 2018-07-31 15:45:35 +10:00
Shamim Rezaie 991850894e MDL-58768 Calendar: Update get_raw_events_legacy_implementation
Update get_raw_events_legacy_implementation to work with the passed $users parameter instead of the logged in user.
Also, fixed a bug where get_raw_events_legacy_implementation was failing when $users was set to true, and a list of
$groups was given.
2018-07-31 15:45:35 +10:00
Shamim Rezaie a20071b2fe MDL-58768 Calendar: Added user param to calendar_set_filters
Decoupled calendar_set_filters from $USER.
Also removed the backward compatibility bit from the function because it was a left over.
2018-07-31 15:44:58 +10:00
Shamim Rezaie c71fe8690c MDL-58768 Calendar: Added userid param to calendar_get_default_courses 2018-07-31 15:31:58 +10:00
Eloy Lafuente (stronk7) 66e70ef537 Merge branch 'MDL-57977-34' of git://github.com/vmdef/moodle into MOODLE_34_STABLE 2018-07-30 21:10:17 +02:00
Eloy Lafuente (stronk7) 0ed13e1936 MDL-63002 core: fixed incorrect calls to non-existent delete_record() 2018-07-30 16:17:24 +02:00
Marina Glancy 01ed2a4b1c MDL-61424 admin: reset registration if token is rejected 2018-07-30 16:13:30 +02:00
Mihail Geshoski f99d2fc276 MDL-57666 repositories: Error when copying file from Dropbox repository 2018-07-30 09:30:41 +08:00
AMOS bot d4079a3b2d Automatically generated installer lang files 2018-07-28 00:08:54 +00:00
David Mudrák e2cbb82469 MDL-62965 core_user: Fix missing user profile fields on signup page 2018-07-27 10:36:47 +02:00
Jun Pataleta aaca3f9244 Merge branch 'MDL-62950-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-07-27 16:18:25 +08:00
David Mudrák b2586b47c6 MDL-62619 privacy: Fix a missing alias in the blog provider class
The new implementation revealed another existing bug that did not expose
before due to coincidently same named table alias in the outer query.
2018-07-27 10:14:33 +02:00
David Mudrák 52bb7f16d3 MDL-62619 privacy: Fix some bits of performance improvements
* We need to use is_numeric() in this case as is_int() would never
  return true.
* Extend the supported cases, add support for SQL consisting just of
  numerical value or selectinga numerical constant.
* Do not rely on any particulat letter case in provided SQL.
* Add unit tests for the new method. Even when it is a protected one, it
  is an essential unit to be tested on its own.
2018-07-27 10:14:33 +02:00
Andrew Nicols 9f3ca3e7ac MDL-62619 privacy: Improve performance of contexts loading
When possible, we want to use JOIN over WHERE IN. It is known that the
later performs badly in MySQL.
2018-07-27 10:14:33 +02:00
David Mudrák bee9ca08af MDL-59847 core: Fix display of hidden identity fields in user lists
Places that display list of users (such as course participants page)
with additional identifier fields now respect the user's permission to
view other users' hidden profile fields.
2018-07-27 10:09:05 +02:00
Sara Arjona 6e09d47fc5 MDL-41847 core_user: Add preferred lang field to the user creation form
The preferred language has been added only to the user creation form.
For existing users, you should access to the user profile, click over
Preferences and go to the Preferred language page.
2018-07-27 09:07:39 +02:00
Sara Arjona 396b60a4c2 MDL-41847 core_user: Add lang to login URL email for new user accounts 2018-07-27 09:07:39 +02:00
Andrew Nicols ebba2fc8d3 MDL-62950 behat: Disable editing for boost test 2018-07-27 11:06:30 +08:00
Andrew Nicols e93427657a MDL-62950 behat: Correct use of nav 2018-07-27 11:02:52 +08:00
Andrew Nicols f1cb7fc6a3 MDL-62950 behat: Correct path to P&P 2018-07-27 11:02:47 +08:00
Mark Nelson 687d4c6aec MDL-62977 mod_wiki: style buttons appropriately 2018-07-27 10:51:38 +08:00
AMOS bot 58829757c3 Automatically generated installer lang files 2018-07-27 00:40:34 +00:00
Dan Marsden f3a4d3fef3 MDL-58015 mod_scorm: set orgidentifier correctly for popup. 2018-07-27 10:37:06 +12:00
Eloy Lafuente (stronk7) e8ebf0f088 weekly release 3.4.4+ 2018-07-26 19:56:45 +02:00
Eloy Lafuente (stronk7) bbc29a982c Merge branch 'MDL-62771-34_move_plag_disclosure' of https://github.com/jmcgettrick/moodle into MOODLE_34_STABLE 2018-07-26 00:39:36 +02:00
Andrew Nicols d2354a36e2 Merge branch 'MDL-60826-34-fix' of https://github.com/lameze/moodle into MOODLE_34_STABLE 2018-07-25 13:42:37 +08:00
Simey Lameze e1f4fdeef0 MDL-60826 calendar: fix group event type logic 2018-07-25 12:50:48 +08:00
Tony Butler c4ebaeccfc MDL-59611 mod_assign: Move help icons for subplugin types out of labels 2018-07-25 12:22:05 +08:00
Andrew Nicols 7aaaf91ff7 Merge branch 'MDL-60826-34' of git://github.com/lameze/moodle into MOODLE_34_STABLE 2018-07-25 09:20:14 +08:00
Simey Lameze 0159ae55db MDL-60826 calendar: further performance improvements
This commit does few tweaks and other performance improvements to
calendar_get_allowed_event_types to be more efficient. Also some minor
queries optimizations on the event form to fetch the list of courses
without groups.
2018-07-25 09:03:54 +08:00
Simey Lameze 98e7b3b5bc MDL-60826 calendar: restrict course fields to be retrieved 2018-07-25 09:03:54 +08:00
Simey Lameze b7f4c5d9db MDL-60826 calendar: update manage subscription page to use new function 2018-07-25 09:03:54 +08:00
Simey Lameze e220725ad7 MDL-60826 calendar: lazy load groups on event form 2018-07-25 09:03:54 +08:00
Simey Lameze 7eec9cd236 MDL-60826 calendar: tests for calendar_get_allowed_event_types 2018-07-25 09:03:54 +08:00
Simey Lameze 8105a66d02 MDL-60826 calendar: introduce calendar_get_allowed_event_types function 2018-07-25 09:03:54 +08:00
Eloy Lafuente (stronk7) efa0914c75 Merge branch 'MDL-62961_34' of git://github.com/markn86/moodle into MOODLE_34_STABLE 2018-07-25 01:25:02 +02:00
Eloy Lafuente (stronk7) aa7004d325 Merge branch 'MDL-62935-34' of git://github.com/bmbrands/moodle into MOODLE_34_STABLE 2018-07-25 01:17:31 +02:00
Eloy Lafuente (stronk7) d35b833ff1 Merge branch 'MDL-62653-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-07-25 00:39:20 +02:00
Eloy Lafuente (stronk7) f62ab7dcbc Merge branch 'MDL-60874-34-enrolautocomplete' of git://github.com/mudrd8mz/moodle into MOODLE_34_STABLE 2018-07-24 19:06:37 +02:00
Eloy Lafuente (stronk7) ce3f2aec3d Merge branch 'MDL-62925_34' of git://github.com/markn86/moodle into MOODLE_34_STABLE 2018-07-24 18:33:05 +02:00
Bas Brands 826725db5b MDL-62935 boost: slideshow view page overflow 2018-07-24 10:27:39 +02:00
Jun Pataleta 9ed6f59d5c Merge branch 'MDL-62919-34' of git://github.com/cescobedo/moodle into MOODLE_34_STABLE 2018-07-24 16:23:01 +08:00
Jun Pataleta 42f4ae18eb Merge branch 'MDL-62939-34-cleanhtmluserdesc' of git://github.com/mudrd8mz/moodle into MOODLE_34_STABLE 2018-07-24 11:58:01 +08:00
Jake Dallimore ab53088e8d MDL-59595 admin: Make sure $ADMIN is properly unset when changing users 2018-07-24 08:33:04 +08:00
Jake Dallimore 3bbb669729 MDL-59595 admin: unit test covering the adminroot cache reset scenario
The adminroot cache should be reset when the current user is changed,
which can occur during cron or during unit tests.
2018-07-24 08:33:04 +08:00
Victor Deniz 215dd70bd7 MDL-57977 search: GlobalSearch by alternate name fields
Enable support for searching all name fields in search
2018-07-23 10:12:28 +01:00
Mark Nelson 9573812fc1 MDL-62961 mod_feedback: style buttons appropriately 2018-07-23 15:49:18 +08:00
Andrew Nicols b82c612bf5 Merge branch 'MDL-35977-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-07-23 15:31:38 +08:00
Jun Pataleta 8962d2972f Merge branch 'MDL-62949-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-07-23 14:53:19 +08:00
Andrew Nicols 7c20db0f18 Merge branch 'MDL-61707-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-07-23 11:41:17 +08:00
Andrew Nicols aa425b569b Merge branch 'MDL-29701-34' of https://github.com/phuchau1509/moodle into MOODLE_34_STABLE 2018-07-23 09:44:23 +08:00
Mihail Geshoski 80418bedc0 MDL-61707 authentication: Remove presignup session upon user signup 2018-07-23 09:33:32 +08:00
Mihail Geshoski 28ec0dff6e MDL-35977 comments: Missing label in blog and assignment comment area 2018-07-23 08:56:06 +08:00
Andrew Nicols 7968c4c46a MDL-62949 calendar: Fix behat nav to calendar 2018-07-20 18:01:45 +08:00
Andrew Nicols 2d6cb43e1e weekly release 3.4.4+ 2018-07-20 15:09:07 +08:00
Andrew Nicols 68bc0a0b80 Merge branch 'install_34_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_34_STABLE 2018-07-20 15:09:06 +08:00
Jake Hau b405813ec0 MDL-29701 editor: mform disableif doesn't work on editor element 2018-07-19 11:35:59 +07:00
David Mudrák 4b6910d319 MDL-62939 user: Fix field type of the user profile description
As this is an editor element field, the it is supposed to be PARAM_RAW.
Otherwise it cleans-up certain non-HTML syntax such as Markdown
blockquote characters.
2018-07-18 14:30:05 +02:00
Jun Pataleta 760e425c62 Merge branch 'MDL-62811_34' of git://github.com/timhunt/moodle into MOODLE_34_STABLE 2018-07-18 16:12:00 +08:00
Andrew Nicols c87e271a95 Merge branch 'MDL-62889_34' of git://github.com/markn86/moodle into MOODLE_34_STABLE 2018-07-18 15:36:50 +08:00
Jun Pataleta c6dc53a0d6 Merge branch 'MDL-62769_34' of https://github.com/timhunt/moodle into MOODLE_34_STABLE 2018-07-18 14:54:17 +08:00
Mark Nelson 23a04bf2cb MDL-62889 message_popup: redirect using moodle_url
Without this relative URLs passed (like /message/index.php)
were being redirected to HOST/message/index.php rather than
$CFG->wwwroot/message/index.php.
2018-07-18 13:25:36 +08:00
Mark Nelson b36383fb42 MDL-62889 message_popup: redirect to notification page if url is empty
If you pass a URL that is not a valid URL (for example
';') it is cleaned to an empty string which redirects to
$CFG->wwwroot/message/output/popup/ which is not a valid
page.
2018-07-18 13:24:57 +08:00
Mark Nelson bf69854d40 MDL-62889 message_popup: allow redirects to external URLs
Many institutions create notifications that link to an
external service. We need to allow redirects to these
systems.
2018-07-18 13:18:15 +08:00
Mark Nelson f52e88ac70 MDL-62889 message_popup: only add redirecturl if it exists
We allow notifications to have a null value for the 'contexturl'.
In this case we should not be appending a 'redirecturl' param to
the URL when it is going to be empty.
2018-07-18 13:16:18 +08:00
Jun Pataleta d0026b8b25 Merge branch 'MDL-62781-34' of git://github.com/junpataleta/moodle into MOODLE_34_STABLE 2018-07-18 10:05:19 +08:00
Jun Pataleta a67cc10051 MDL-62781 core_question: Remove unnecessary assertion 2018-07-18 09:59:51 +08:00
Tim Hunt cf3f82bd18 MDL-62781 question/privacy: fix tests with CodeRunner is installed
The tests were assuming that no plugin ever created questions on
install.

Also change the tests to do the counting in the DB. That is more
efficient.
2018-07-18 09:59:51 +08:00
AMOS bot 2e1dab9f60 Automatically generated installer lang files 2018-07-18 00:07:42 +00:00
cescobedo c6a9858c98 MDL-62919 auth_shibboleth: Use the right shibboleth_auth_instructions
Change $CFG->auth_instructions by shibboleth/auth_instructions in the index_form.html
2018-07-17 21:08:00 +02:00
David Monllao 9c48f36931 Merge branch 'MDL-59447-34' of https://github.com/nwp90/moodle into MOODLE_34_STABLE 2018-07-17 14:35:13 +02:00
David Monllao c0a2bba4e7 Merge branch 'MDL-54830-34' of https://github.com/snake/moodle into MOODLE_34_STABLE 2018-07-17 13:55:20 +02:00
David Monllao c650dd8568 Merge branch 'MDL-61351_34' of git://github.com/markn86/moodle into MOODLE_34_STABLE 2018-07-17 12:32:16 +02:00
Tim Schroeder af4c2fb8cf MDL-61351 auth_shibboleth: removed redundant session handler class check 2018-07-17 16:48:22 +08:00
Tim Schroeder 823bbbfc00 MDL-61351 core: added \core\session\manager\get_handler_class()
* This is needed e.g. by the shibboleth logout handler to check which
type of sessions are used.
2018-07-17 16:48:22 +08:00
Mark Nelson 18a937e9d1 MDL-61351 auth_shibboleth: move new functions to separate class
This reduces the amount of code to an already confusing logout.php
file and prevents conflicts if someone else happens to be using
the same function name in a file.
2018-07-17 16:48:22 +08:00
David Monllao b55fa75d03 Merge branch 'MDL-62868-34' of https://github.com/snake/moodle into MOODLE_34_STABLE 2018-07-17 10:20:30 +02:00
Tim Schroeder 2170351cbc MDL-61351 shibboleth: Logout: fix session handler class not being used
* use $CFG->session_handler_class to determine which type of session is
  used
* if not set, use $CFG->dbsession instead
2018-07-17 16:19:13 +08:00
David Monllao 2abfaea271 Merge branch 'MDL-62663_34' of https://github.com/andrewhancox/moodle into MOODLE_34_STABLE 2018-07-17 09:58:47 +02:00
David Monllao efd4bdb490 Merge branch 'MDL-60924-34' of git://github.com/sarjona/moodle into MOODLE_34_STABLE 2018-07-17 09:39:23 +02:00
Mark Nelson 5d12627609 MDL-62925 mod_wiki: style 'Search wikis' button 2018-07-17 11:31:58 +08:00
Andrew Nicols 52a3e011e3 Merge branch 'MDL-62849-34' of git://github.com/abgreeve/moodle into MOODLE_34_STABLE 2018-07-17 10:37:09 +08:00
Adrian Greeve f1900faf75 MDL-62849 files lib: Add method to return all files.
Added a function which returns all the files from all directories
in the draftarea.
2018-07-17 10:28:22 +08:00
AMOS bot a52a06c744 Automatically generated installer lang files 2018-07-17 00:08:28 +00:00
David Mudrák 33d87fdbc4 MDL-60874 enrol_manual: Improve searching of users in quick enrol UI
* The maximum of users to be displayed raised from 30 to 100. This is
  consistent with the legacy users selector available via enrolment
  methods page.
* If there are more users found matching the search criteria, notify the
  user instead of displaying them. This is to prevent false impression
  that there are only that many users.
* Added behat tests for the new behaviour.
2018-07-16 20:54:40 +02:00
David Mudrák 5015c4229e MDL-60874 core_form: allow autocomplete AJAX handlers return a string
Custom AJAX handlers for the form autocomplete fields can now optionally
return string in their processResults() callback. If a string is
returned, it is displayed instead of the list of suggested items.

The string is displayed same way as we inform about no available
suggestions.
2018-07-16 20:54:40 +02:00
sarjona 44bae9d937 MDL-60924 core_user: Hold participant filters when clicking some link 2018-07-16 18:06:29 +02:00
David Monllao b88a479c6d Merge branch 'MDL-49025-m34' of https://github.com/NeillM/moodle into MOODLE_34_STABLE 2018-07-16 13:35:13 +02:00
David Monllao 982a838ec1 Merge branch 'MDL-61019-34' of https://github.com/lucaboesch/moodle into MOODLE_34_STABLE 2018-07-16 13:25:21 +02:00
Andrew Nicols a96703eae4 Merge branch 'MDL-45851_34' of git://github.com/timhunt/moodle into MOODLE_34_STABLE 2018-07-16 13:18:44 +08:00
Jake Dallimore 6a3aaf1803 MDL-54830 core_course: fix maxbytes logic in course_update web service
The service should allow the special value of 0 (site limit) to be set.
2018-07-16 10:43:33 +08:00
Jake Dallimore 36f47cb5e5 MDL-62868 core_group: clear group_grouping cache when changing grouping 2018-07-16 10:36:48 +08:00
Jake Dallimore ae125e5c39 Merge branch 'MDL-45389-34' of https://github.com/lucaboesch/moodle into MOODLE_34_STABLE 2018-07-16 10:12:16 +08:00
Neill Magill 3c5064892c MDL-49025 assign: Submissions of an empty directory should not save
Before this change if only a folder was submitted the submission_is_empty
check would return true. This meant that the draft area would be saved.
The is_empty check would then be called which would return false. This
caused the submission form to indicate to the user that the submission
had failed.

Now is_empty and submission_is_empty should both return false if only
folders are submitted.
2018-07-13 14:05:41 +01:00
Neill Magill dae2f76b7d MDL-49025 assign: Test than an empty directory will not submit 2018-07-13 14:05:41 +01:00
Luca Bösch 7775958575 MDL-61019 Theme boost: lesson display issues with buttons/progress bar. 2018-07-13 09:24:25 +02:00
Luca Bösch e1dc6ff735 MDL-45389 theme_bootstrapbase: Forum index page alignment in clean. 2018-07-13 09:24:08 +02:00
Luca Bösch c9f5af8596 MDL-44538 action_menu: rounded corner of highlights only where needed. 2018-07-13 09:24:00 +02:00
Andrew Nicols d1040fe2b3 MDL-62653 behat: Ensure that tasks run properly from behat 2018-07-13 13:54:15 +08:00
Jake Dallimore a7c1f4497c weekly release 3.4.4+ 2018-07-13 12:26:11 +08:00
Nick Phillips a29d421ac4 MDL-59447 question: GIFT import to respect multichoice defaults
Fix GIFT import to respect default answernumbering for new multichoice
questions (introduced in MDL-50011). Default for shuffleanswers is still
ignored, as this is a rather coarse-grained way to do it, and the wrong
setting for shuffleanswers would irreversibly alter the meaning of some
questions.

This is not an ideal long-term fix, but will save significant effort
for anyone who needs to be able to set answernumbering style for
questions imported in GIFT format.
2018-07-13 13:32:27 +12:00
Andrew Nicols aae5f920ae Merge branch 'MDL-62746-34-fix' of git://github.com/junpataleta/moodle into MOODLE_34_STABLE 2018-07-12 16:22:47 +08:00
Jun Pataleta b53c5e3891 MDL-62746 tag: Behat fix for combining tags scenario 2018-07-12 16:04:06 +08:00
David Monllao 30854621a0 MDL-59599 navigation: Respect previous activity-level navigation
The original patch was overwriting grading methods navigation.

All credit goes to Andrew Nicols.
2018-07-12 10:25:34 +08:00
David Monllao 6cc1f2efda Merge branch 'MDL-62618-34' of git://github.com/mickhawkins/moodle into MOODLE_34_STABLE 2018-07-11 18:48:22 +02:00
Jake Dallimore 63dc12acea Merge branch 'MDL-62712-34' of https://github.com/HuongNV13/moodle into MOODLE_34_STABLE 2018-07-11 09:02:51 +08:00
Andrew Nicols 8350a4fddd Merge branch 'MDL-52318-34' of https://github.com/snake/moodle into MOODLE_34_STABLE 2018-07-11 08:58:59 +08:00
David Monllao 42a2445ddc Merge branch 'MDL-62262-34' of https://github.com/lucaboesch/moodle into MOODLE_34_STABLE 2018-07-10 13:33:30 +02:00
David Monllao c07a557a40 Merge branch 'MDL-62823-m34' of https://github.com/NeillM/moodle into MOODLE_34_STABLE 2018-07-10 11:46:50 +02:00
Andrew Nicols 080bb928ab Merge branch 'MDL-61578-34' of git://github.com/mickhawkins/moodle into MOODLE_34_STABLE 2018-07-10 16:46:43 +08:00
Huong Nguyen d49d4dbcd4 MDL-62712 Filepicker: Improve upload process
Lost the uploading file when user press Submit before upload process has done
2018-07-10 15:21:40 +07:00
David Monllao 32b39ec6bb Merge branch 'MDL-62814-34' of https://github.com/HuongNV13/moodle into MOODLE_34_STABLE 2018-07-10 07:51:05 +02:00
Andrew Hancox b88f38e65d MDL-61578 backup: Added unit test for is_course_modified check. 2018-07-10 10:59:52 +08:00
Michael Hawkins af2afaae9b MDL-61578 backup: Prevent backup logging triggering fresh backups.
Thanks to Renaat Debleu for their contribution to this solution.
2018-07-10 10:57:28 +08:00
Andrew Nicols 273e37cba7 Merge branch 'MDL-62746-34' of git://github.com/junpataleta/moodle into MOODLE_34_STABLE 2018-07-10 10:09:17 +08:00
Jake Dallimore a91db9907e Merge branch 'MDL-62772-34_always_show_disclosure' of https://github.com/jmcgettrick/moodle into MOODLE_34_STABLE 2018-07-10 09:00:57 +08:00
David Monllao 2722c38955 Merge branch 'mdl34_MDL-62753' of https://github.com/OdyX/moodle into MOODLE_34_STABLE 2018-07-09 15:15:54 +02:00
David Monllao 662e17e502 Merge branch 'MDL-56881-34' of https://github.com/snake/moodle into MOODLE_34_STABLE 2018-07-09 14:39:21 +02:00
David Monllao be49e1f9cc Merge branch 'MDL-62037-34' of https://github.com/lethevinh/moodle into MOODLE_34_STABLE 2018-07-09 13:48:59 +02:00
David Monllao 5d33da7569 Merge branch 'MDL-62831-34' of git://github.com/damyon/moodle into MOODLE_34_STABLE 2018-07-09 13:36:29 +02:00
David Monllao 7f044c1ed4 MDL-59599 navigation: Strict zero-position comparision 2018-07-09 12:27:43 +02:00
David Monllao 4013b661b4 Merge branch 'MDL-59599-34' of https://github.com/Kathrin84/moodle into MOODLE_34_STABLE 2018-07-09 12:00:20 +02:00
Andrew Hancox 8b36e8a5c2 MDL-62663 core_user: Enforce viewalldetails capability when editing user 2018-07-09 09:50:26 +01:00
John McGettrick 61d5685b04 MDL-62772 mod_assign: Show disclosure for all submitters 2018-07-09 09:14:38 +01:00
Andrew Nicols cb932b8692 Merge branch 'MDL-33509-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-07-09 14:02:22 +08:00
Damyon Wiese ee70cf9d15 MDL-43334 backup: Fix cancel JS
The cancel button is a form element within a div that has the confirmcancel class. When we
accept a cancel modal, we should attempt to click the most specific form element of the
div, not the entire div.
2018-07-09 12:18:46 +08:00
Damyon Wiese ad83f25e94 MDL-43334 backup: Lanuage for cancel
Cancel backup buttons need clear lang strings.
2018-07-09 12:18:45 +08:00
Andrew Nicols b54f6d4781 MDL-56093 auth_db: Remove issue no. from comment 2018-07-09 12:14:50 +08:00
Andrew Nicols 8a78198376 Merge branch 'MOODLE_34_STABLE_MDL_56093' of https://github.com/eledia/moodle into MOODLE_34_STABLE 2018-07-09 12:14:46 +08:00
Jake Dallimore ebaabae83d Merge branch 'MDL-61359-34' of git://github.com/mickhawkins/moodle into MOODLE_34_STABLE 2018-07-09 12:11:26 +08:00
Jake Dallimore 2eeb189638 MDL-52318 core_form: allow multiple filepicker-enabled url elements
In cases when filepicker support is enabled, this patch adds a wrapper
div around the url element and includes the filepicker id in its id.
This allows the js callback code to target the specific input field
with which it is associated.
2018-07-09 11:34:00 +08:00
Jake Dallimore ea89ce9406 MDL-56881 mod_choice: add unit tests for choice_user_submit_response
Tests cover option limits and multiple option responses.
2018-07-09 11:09:13 +08:00
Jake Dallimore 3dac03b060 MDL-56881 mod_choice: clarify lang string for limit-reached scenarios 2018-07-09 11:08:45 +08:00
Jake Dallimore c58e6ca41e MDL-56881 mod_choice: fix bug with limits when saving existing choice
The check determining whether a choice option's limit was exceeded was
including the user's existing answers in its checks, meaning a user
couldn't save an existing choice answer, or select further options,
if all a choice option limit was reached. This patch fixes that.
2018-07-09 11:08:41 +08:00
Eloy Lafuente (stronk7) 5ebb6eb15c Moodle release 3.4.4 2018-07-07 06:53:43 +02:00
AMOS bot c97874b7a8 Automatically generated installer lang files 2018-07-07 00:08:37 +00:00
Luca Bösch 79e6e5de26 MDL-62262 quiz: quiz index page showing wrong dates. 2018-07-06 15:05:03 +02:00
vinhle ba335d048c MDL-62037 Filepicker: Review image not change when overwrite same 2018-07-06 17:50:34 +07:00
John McGettrick 39e69c1b9b MDL-62771 mod_forum: Move print_disclosure 2018-07-06 09:21:22 +01:00
Andrew Nicols 71e351ec79 weekly release 3.4.3+ 2018-07-06 14:05:10 +08:00
Andrew Nicols 9347c4f8a3 Merge branch 'install_34_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_34_STABLE 2018-07-06 14:05:08 +08:00
Huong Nguyen 7591658a47 MDL-62814 Question: Improve column base display_header
Column base does not support custom tip if sortable is an array
2018-07-06 10:59:38 +07:00
Tim Hunt b05acb6b10 MDL-62811 question bank: rendering shouldn't load individual questions 2018-07-05 17:01:54 +01:00
Benjamin Wolf be616a6fd9 MDL-56093 auth_db: Save custom profile fields in auth_db 2018-07-05 11:12:50 +02:00
Didier 'OdyX' Raboud 79172a41fe MDL-62753 shibboleth: Logout: fix DB sessions kill
* Use the Moodle 2+ {sessions} table, and decode the session
  correctly using session_decode (adodb_unserialize is deprecated).
* Kill all user sessions using \core\session\manager's
  kill_user_sessions.
2018-07-05 09:06:47 +02:00
Michael Hawkins 1d3ff57a88 MDL-62618 user: Display full names consistently on users page 2018-07-05 10:17:16 +08:00
Michael Hawkins d0f3521f27 MDL-62618 forum: Made full names displayed consistent 2018-07-05 10:17:16 +08:00
AMOS bot c1491880fa Automatically generated installer lang files 2018-07-05 00:08:32 +00:00
Kathrin Osswald f3f44ad3d8 MDL-59599 navigation: Improve activity status for nav nodes. 2018-07-04 20:00:56 +02:00
Tim Hunt 3b5086f510 MDL-45851 restore: random questions must always be created
They are really a pointer from a particular quiz to a question category.
They should never be shared, because if they are, unexpected things
happend when they are edited.
2018-07-04 16:30:33 +01:00
Tim Hunt 9dd7b0f7f4 MDL-62820 question import: properly escape output 2018-07-04 15:41:05 +08:00
Jake Dallimore eeefdaebcf Merge branch 'wip-nolink-bug-34' of https://gitlab.di.unito.it/rabellino/moodle into MOODLE_34_STABLE 2018-07-04 14:39:08 +08:00
Damyon Wiese d2761afa21 MDL-62782 assign: viewgrades allows files
Grade viewer role should be able to see feedback files for an assignment submission.
2018-07-04 14:19:24 +08:00
Jake Dallimore 29f7ef8305 Merge branch 'MDL-41463-34' of https://github.com/lucaboesch/moodle into MOODLE_34_STABLE 2018-07-04 12:59:44 +08:00
Damyon Wiese 89908c0256 MDL-62831 mod_assign: Download as folders help
The help string for the download as folders setting should not mention the number of files
submitted by the student. It is not related to that, it is only dependant on the value of this setting.
2018-07-04 12:20:50 +08:00
Jake Dallimore 7aeaba8b8b Merge branch 'MDL-44081-34' of git://github.com/zig-moodle/moodle into MOODLE_34_STABLE 2018-07-04 10:51:09 +08:00
Andrew Nicols 136f206331 MDL-62834 behat: Move include to function 2018-07-04 10:45:35 +08:00
Eloy Lafuente (stronk7) 80ad7014f9 Merge branch 'wip-MDL-62526-34' of git://github.com/marinaglancy/moodle into MOODLE_34_STABLE 2018-07-04 04:19:31 +02:00
Adrian Greeve adbfa2fbfa MDL-62616 tool_log: Add a setting to disable exporting logs. 2018-07-04 10:00:16 +08:00
Eloy Lafuente (stronk7) ed3bf90af1 Merge branch 'MDL-62792_34' of https://github.com/timhunt/moodle into MOODLE_34_STABLE 2018-07-04 00:55:31 +02:00
Eloy Lafuente (stronk7) 3861d07c02 Merge branch 'MDL-62838_34' of git://github.com/timhunt/moodle into MOODLE_34_STABLE 2018-07-04 00:52:23 +02:00
Eloy Lafuente (stronk7) 131fbed9fb Merge branch 'MDL-62834_34' of git://github.com/timhunt/moodle into MOODLE_34_STABLE 2018-07-04 00:46:49 +02:00
David Monllao e418005609 Merge branch 'MDL-61296-34' of git://github.com/cescobedo/moodle into MOODLE_34_STABLE 2018-07-03 23:34:25 +02:00
David Monllao 41562c927f Merge branch 'MDL-62656-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-07-03 23:34:25 +02:00
David Monllao d83f207e8a Merge branch 'MDL-60915_34' of git://github.com/stronk7/moodle into MOODLE_34_STABLE 2018-07-03 23:34:24 +02:00
David Monllao bc1f051c49 Merge branch 'MDL-60014-34-catcherror-nopermission-annotatepdfcron' of https://github.com/Eva-Dv/moodle into MOODLE_34_STABLE 2018-07-03 23:34:24 +02:00
David Monllao 69ae176ca3 Merge branch 'MDL-62813-34' of git://github.com/lameze/moodle into MOODLE_34_STABLE 2018-07-03 23:34:23 +02:00
David Monllao 6fef4bfb2f Merge branch 'MDL-32232-34' of https://github.com/lucaboesch/moodle into MOODLE_34_STABLE 2018-07-03 14:00:29 +02:00
Michael Hawkins d683aff069 MDL-62767 theme: Remove old localcaches when clearing/updating theme cache 2018-07-03 14:00:51 +08:00
Michael Hawkins 58fba949c4 MDL-61359 message: Updated sender contact text to text node content 2018-07-03 13:33:32 +08:00
Michael Hawkins 032abb1a6f MDL-62801 themes: Added missing filelib include 2018-07-03 13:08:51 +08:00
Marina Glancy 58b1b213ee MDL-62790 course: cap check in core_course_get_categories 2018-07-03 12:04:14 +08:00
Mihail Geshoski 94ac5fce56 MDL-33509 forms: Change button type in url resource editing page 2018-07-03 12:00:03 +08:00
Jake Dallimore eb2f403c10 Merge branch 'MDL-62715-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-07-03 08:50:14 +08:00
Eloy Lafuente (stronk7) af9ae800ee Merge branch 'MDL-62763-34-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_34_STABLE 2018-07-02 20:09:27 +02:00
Eloy Lafuente (stronk7) 9cc4cc02cf Merge branch 'MDL-62621-34-ixcomment' of git://github.com/mudrd8mz/moodle into MOODLE_34_STABLE 2018-07-02 20:03:01 +02:00
Helen Foster 23790560f3 MDL-62763 lang: Merge English strings from the en_fix language pack
Significant string change:

* idnumbermod_help,core - mentioning resource and custom reporting
2018-07-02 13:44:38 +02:00
Jake Dallimore c082a46980 Merge branch 'MDL-62801-34' of git://github.com/mickhawkins/moodle into MOODLE_34_STABLE 2018-07-02 16:19:30 +08:00
David Mudrák 644a76167a MDL-62621 comments: Add missing indexes on comments table
The composite index over the fields contextid, commentarea and itemid
helps the comments API to load all comments for the given area
effectively.

The index over the userid field helps the privacy API to load all
comments by the given user.
2018-07-02 10:11:51 +02:00
Mihail Geshoski 31f830c2e8 MDL-62656 course: Align elements in course and category management 2018-07-02 08:26:14 +08:00
Eloy Lafuente (stronk7) 7cba6c1671 MDL-60915 core_dml: Change behavior to disabled by default
In stables it was decided to keep the current behavior
(not buffering/cursors) so nothing breaks/changes suddenly.

So this commit just disables the default buffer size used in
Moodle 3.5 and up (100000), defaulting to zero (feature disabled).

Still the feature can be enabled via dboptions and it's docummented
in the config-dist file.
2018-07-02 01:15:49 +02:00
sam marshall 9d97d1e006 MDL-60915 Document new dboption in config-dist.php 2018-07-02 00:46:36 +02:00
sam marshall f83d748f77 MDL-60915 core_dml: fix miscellaneous incorrect recordset usage
The new recordset support for Postgres requires transactions and
will cause errors if recordsets are not closed correctly. This
commit fixes problems that were identified during unit tests, and
via some basic code analysis, across all core code. Most of these
are incorrect usage of recordset (forgetting to close them).
2018-07-02 00:46:26 +02:00
sam marshall 838f07703a MDL-60915 core_dml: get_recordset on Postgres eats all the RAM
On Postgres, get_recordset_sql loads all the results into memory
(within the Postgres library, which doesn't count towards the PHP
memory limit, but does count towards making your server run out of
memory) as soon as the query completes.

This commit changes the code to use cursors, which in Postgres
allow the results to be returned in smaller chunks (by default
100,000 rows).
2018-07-02 00:46:09 +02:00
Tim Hunt 189c996f4f MDL-62838 filters: dont use statics inside functions. Use MUC 2018-06-29 17:25:17 +01:00
Tim Hunt a8887717eb MDL-62834 behat: new step for enabling filters 2018-06-29 11:27:49 +01:00
Neill Magill cc008824ee MDL-62823 filter: Save changes button should be styled 2018-06-29 08:41:48 +01:00
Michael Hawkins dc39780050 MDL-62801 themes: Remove old mustache caches when new one generated 2018-06-29 10:51:09 +08:00
Zig Tan 282e6fe54d MDL-44081 assign: Fix Grader annotation button accessibility ordering 2018-06-29 09:28:46 +08:00
Luca Bösch dccacb6649 MDL-41463 course: Reset remove groups section advanced toggle. 2018-06-28 23:04:34 +02:00
Luca Bösch 7fe6acac9e MDL-32232 lesson: changing a page type chooser option for consistency 2018-06-28 23:04:23 +02:00
Sergio Rabellino 328ec4459f MDL-61403 filter: Fix for the nolink tag ignored
Fix for the nolink tag ignored if there are some other attributes defined in the same span
2018-06-28 11:01:40 +02:00
Simey Lameze 2a643b019e MDL-62813 calendar: add behat test for form validation 2018-06-28 14:12:32 +08:00
Simey Lameze 8291540ae7 MDL-62813 calendar: fix dmlreadexception on event form 2018-06-28 14:12:32 +08:00
Jake Dallimore ec68f39a1b weekly release 3.4.3+ 2018-06-28 14:03:01 +08:00
Marina Glancy 5a4668943d MDL-62526 admin: ask privacy policy agreement for moodle.net 2018-06-28 11:44:23 +08:00
Eloy Lafuente (stronk7) fa38f0302e Merge branch 'MDL-62325-34' of git://github.com/rezaies/moodle into MOODLE_34_STABLE 2018-06-28 02:06:10 +02:00
Eloy Lafuente (stronk7) 672dacf797 Merge branch 'wip-MDL-62755-34' of git://github.com/abgreeve/moodle into MOODLE_34_STABLE 2018-06-28 01:56:52 +02:00
Eloy Lafuente (stronk7) 681fd03543 Merge branch 'MDL-62747_34' of https://github.com/timhunt/moodle into MOODLE_34_STABLE 2018-06-28 00:32:52 +02:00
Matteo Scaramuccia 50402581d1 MDL-51080 env: warn when running MariaDB w/ wrong dbtype 2018-06-28 00:15:41 +02:00
Jake Dallimore b088c6d89b Merge branch 'MDL-61732-34' of https://github.com/Dagefoerde/moodle into MOODLE_34_STABLE 2018-06-27 12:18:36 +08:00
Eloy Lafuente (stronk7) 7811b73968 Merge branch 'MDL-45088-34' of https://github.com/lucaboesch/moodle into MOODLE_34_STABLE 2018-06-27 03:23:34 +02:00
Eloy Lafuente (stronk7) 08f2d2a061 Merge branch 'MDL-62703-34' of git://github.com/bmbrands/moodle into MOODLE_34_STABLE 2018-06-27 03:17:59 +02:00
Eloy Lafuente (stronk7) 98523f6970 Merge branch 'MDL-62735-34-refactor' of https://github.com/snake/moodle into MOODLE_34_STABLE 2018-06-26 10:44:45 +02:00
Eloy Lafuente (stronk7) a73c0c82f0 Merge branch 'MDL-59047-34' of git://github.com/bmbrands/moodle into MOODLE_34_STABLE 2018-06-26 03:05:38 +02:00
Eloy Lafuente (stronk7) 30fca6d09c Merge branch 'MDL-51419-34' of https://github.com/snake/moodle into MOODLE_34_STABLE 2018-06-26 02:42:34 +02:00
Eva Davitasvili ffa3e0e25e MDL-60014 assign: Annotate PDF - catch no permission error 2018-06-25 14:10:06 -04:00
Tim Hunt 215f3c9c25 MDL-62792 filters: fix some bad PHPdocs 2018-06-25 15:55:25 +01:00
Tim Hunt 4b862a14c9 MDL-62792 filter_mathjaxloader: don't use statics for once-only items 2018-06-25 15:55:23 +01:00
Shamim Rezaie 7bb4d2d88e MDL-62325 enrol_paypal: Added some keys and indexes to enrol_paypal.
- Added these keys to the enrol_paypal db: courseid, userid, instanceid
- Added these indexes to the enrol_paypal db: business, receiver_email
2018-06-25 13:01:16 +10:00
Adrian Greeve e57455a92d MDL-62755 mod_assign: Update to unit tests.
Overrides are now checked to be exported properly.
2018-06-25 09:52:37 +08:00
Adrian Greeve aa0a70f203 MDL-62755 mod_assign: Fix override export problem.
The cutoffdate and allowsubmissionsfromdate were not
being exported.
2018-06-25 09:52:37 +08:00
Christian Glahn 4fbb27eb13 MDL-61732 filters: Have emoticons respect nolink
Also extracts static emoticon cache to a field in order to increases
testability of filter_emoticon, because we are now able to reset the
static emoticon cache before tests, particularly for observing the
response to changing $CFG->emoticons.
2018-06-22 10:27:54 +02:00
Jake Dallimore 8e6d95b9cf MDL-51419 core_files: Support for utf8 in file names in MS Edge 2018-06-22 10:30:23 +08:00
Jake Dallimore 8aeacce28a MDL-62735 core_search: searchareas page now respects indexing support 2018-06-22 10:15:12 +08:00
Luca Bösch ebb40e783d MDL-45088 xmldb: Fix table alignment 2018-06-21 19:36:12 +02:00
Tim Hunt e997551349 MDL-62769 quiz statistics: graph should show all, not last, variant 2018-06-21 14:55:30 +01:00
Eloy Lafuente (stronk7) 7b1139543c weekly release 3.4.3+ 2018-06-21 14:01:04 +02:00
Andrew Nicols f720f30fd8 MDL-62715 mod_assign: Bump submissions back when grading in tests 2018-06-21 08:41:24 +08:00
Jun Pataleta 33bce7fa20 Merge branch 'MDL-62017-34' of https://github.com/lucaboesch/moodle into MOODLE_34_STABLE 2018-06-20 19:39:58 +08:00
David Monllao aa7263c202 Merge branch 'MDL-61482-34' of git://github.com/zig-moodle/moodle into MOODLE_34_STABLE 2018-06-20 13:29:33 +02:00
cescobedo e21e44b054 MDL-61296 auth_ldap: remove PHP notices when field does not exist. 2018-06-20 11:49:11 +02:00
Luca Bösch e99625f496 MDL-62017 tool_customlang: format language customisation buttons. 2018-06-20 10:54:04 +02:00
Eloy Lafuente (stronk7) 288fe4fe35 Merge branch 'MDL-62014-34' of git://github.com/nashtechdev01/moodle into MOODLE_34_STABLE 2018-06-20 00:57:37 +02:00
Eloy Lafuente (stronk7) 908a8be88b Merge branch 'MDL-36424-34' of https://github.com/lucaboesch/moodle into MOODLE_34_STABLE 2018-06-19 19:20:46 +02:00
Eloy Lafuente (stronk7) 3000c7bd3a Merge branch 'wip-MDL-61786-34' of git://github.com/abgreeve/moodle into MOODLE_34_STABLE 2018-06-19 19:16:51 +02:00
Eloy Lafuente (stronk7) 93bce58feb Merge branch 'MDL-62358-34' of https://github.com/HuongNV13/moodle into MOODLE_34_STABLE 2018-06-19 19:08:59 +02:00
Eloy Lafuente (stronk7) ec78b3cb99 Merge branch 'MDL-44791-34' of https://github.com/lucaboesch/moodle into MOODLE_34_STABLE 2018-06-19 18:59:57 +02:00
Eloy Lafuente (stronk7) 421a61a4fb Merge branch 'MDL-62449-34' of git://github.com/sarjona/moodle into MOODLE_34_STABLE 2018-06-19 18:52:40 +02:00
Zig Tan ac8b6611c9 MDL-61482 mod_assign: Clean html in offline grading CSV 2018-06-19 23:30:24 +08:00
Tim Hunt 3d2ba2e8f1 MDL-62747 accesslib: rdef caching should handle roles with no caps 2018-06-19 16:26:25 +01:00
Jun Pataleta 98434f6594 MDL-62746 tag: Make forms in tag modals use proper BS classes 2018-06-19 23:23:27 +08:00
Bas Brands d4213e994c MDL-62703 Themes: remove hover styles in course listings 2018-06-19 16:32:41 +02:00
Bas Brands 18c7a47105 MDL-59047 question type: short answer boost styles 2018-06-19 15:50:15 +02:00
David Monllao f601f8fa3f Merge branch 'MDL-62588-34' of git://github.com/rezaies/moodle into MOODLE_34_STABLE 2018-06-19 12:53:28 +02:00
Jun Pataleta 7090d8002b Merge branch 'MDL-61894-34' of https://github.com/lucaboesch/moodle into MOODLE_34_STABLE 2018-06-19 17:56:42 +08:00
David Monllao 61f06e8430 Merge branch 'MDL-58702-34' of git://github.com/zig-moodle/moodle into MOODLE_34_STABLE 2018-06-19 11:55:00 +02:00
Andrew Nicols 0e9bbab80b Merge branch 'MDL-60950-34' of git://github.com/damyon/moodle into MOODLE_34_STABLE 2018-06-19 11:41:11 +08:00
Damyon Wiese 8b4346c530 MDL-60950 assign: Update incompatible unit test
Maintain compatibility with unit test changes after MDL-55609.
2018-06-19 10:59:19 +08:00
Damyon Wiese 0877aacab9 MDL-60950 assign: Rename class
testable_assign was renamed to mod_assign_testable_assign
2018-06-19 10:59:18 +08:00
Damyon Wiese 53e833b459 MDL-60950 assign: Robust filtering of grading table
For assignments with gradetype set to none, we need special handling when generating the query to filter submissions that need grading.
2018-06-19 10:59:18 +08:00
Damyon Wiese ba22824230 MDL-60950 assign: Test for the requires grading filter
This test covers when the requires grading filter is applied, but the
assignment has no grade and the feedbackcomments plugin is disabled.
2018-06-19 10:59:18 +08:00
Eloy Lafuente (stronk7) 6742a6f486 Merge branch 'MDL-62638-34' of git://github.com/bmbrands/moodle into MOODLE_34_STABLE 2018-06-19 02:04:09 +02:00
Eloy Lafuente (stronk7) 53be2f2707 Merge branch 'MDL-62571_34' of git://github.com/markn86/moodle into MOODLE_34_STABLE 2018-06-19 01:49:58 +02:00
Sara Arjona 368aa15e22 MDL-62449 scorm: Move related data to data in the privacy export 2018-06-18 10:43:56 +02:00
Sara Arjona 55471119bd MDL-62449 scorm: Add SCORM data to privacy export (name, description) 2018-06-18 10:43:55 +02:00
Jun Pataleta d45d70b86b Merge branch 'MDL-62614-34' of git://github.com/zig-moodle/moodle into MOODLE_34_STABLE 2018-06-18 16:12:12 +08:00
Jun Pataleta 303aaced3d Merge branch 'MDL-62658_34' of git://github.com/markn86/moodle into MOODLE_34_STABLE 2018-06-18 14:36:31 +08:00
Jun Pataleta 784bb185a5 Merge branch 'wip-MDL-62474-34' of git://github.com/abgreeve/moodle into MOODLE_34_STABLE 2018-06-18 14:32:12 +08:00
Mark Nelson 276f6435af MDL-62658 message_popup: fixed issue with malformed URL being generated 2018-06-18 14:31:35 +08:00
Adrian Greeve 4cc042dff7 MDL-62474 theme_boost: Update to provider and unit test.
Theme boost contains a user preference which was not reported
before. Unit tests have been added to test the update.
2018-06-18 14:09:02 +08:00
Willian Mano 49d65dc9ee MDL-62474 theme_boost: Fix Boost privacy provider 2018-06-18 14:08:55 +08:00
Huong Nguyen 70c2cb7266 MDL-62614 Privacy: Core tag provider delete_item_tags function not work 2018-06-18 14:00:50 +08:00
Andrew Nicols 10845183f3 Merge branch 'MDL-62320-34' of git://github.com/vmdef/moodle into MOODLE_34_STABLE 2018-06-18 13:59:31 +08:00
Shamim Rezaie 5dcdf1d1ba MDL-62588 enrol_paypal: Add missing instanceid field 2018-06-18 15:15:50 +10:00
Andrew Nicols 7d0956191d Merge branch 'MDL-57968-34' of git://github.com/cescobedo/moodle into MOODLE_34_STABLE 2018-06-18 09:10:36 +08:00
Victor Deniz ab3759815a MDL-62320 mimetypes: Add JSON to the default mime types list 2018-06-15 13:18:18 +01:00
Damyon Wiese 7621280df1 MDL-62643 assign: Skip empty online text files
Online text assignment submissions with no text entered into the editor should not
create a blank html document for providing feedback.
2018-06-15 13:45:39 +08:00
HungTran b338e8d272 MDL-62014 course: Add title to activity completion button 2018-06-15 10:21:01 +07:00
Zig Tan c53170461f MDL-58702 backup: Fix restoration of role mappings labels
Changes:
- Add logic to retrieve all the existing current roles.
- Apply the backup's role shortname by matching on the archetype.
- Added backup lang string 'undefinedrolemapping'.
2018-06-15 09:56:17 +08:00
Luca Bösch b4fdf0a5a3 MDL-61894 tag: Modal buttons style. 2018-06-14 17:30:50 +02:00
Luca Bösch 8fcf9309bb MDL-44791 admin: Open server check doc links in new window. 2018-06-14 17:29:52 +02:00
Ed Basset 6f5ae7edad MDL-36424 wiki: set group so subwiki tabs/pages display correctly 2018-06-14 17:29:35 +02:00
Huong Nguyen 132169831f MDL-62358 Question: Improve number function
Support all 'question numbers' that might be needed
2018-06-14 19:47:11 +07:00
Eloy Lafuente (stronk7) d8832ae8b9 weekly release 3.4.3+ 2018-06-14 10:56:00 +02:00
Eloy Lafuente (stronk7) 3e7543e81f Merge branch 'install_34_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_34_STABLE 2018-06-14 10:55:58 +02:00
Mark Nelson 5d42ef7732 MDL-31443 core_backup: change review heading to 'Restore settings' 2018-06-13 18:39:20 +02:00
Luca Bösch adf5986331 MDL-31443 core_backup: revert changes to util/ui/renderer.php 2018-06-13 18:39:19 +02:00
Jun Pataleta a7a630a3f5 Merge branch 'MDL59980_block_bug_34_STABLE' of git://github.com/kristian-94/moodle into MOODLE_34_STABLE 2018-06-13 09:58:33 +08:00
AMOS bot 92c1d10595 Automatically generated installer lang files 2018-06-13 00:08:19 +00:00
Kristian Ringer 6eef69757b MDL-59980 core_admin: Fix bug preventing block modification in settings 2018-06-13 09:33:02 +10:00
Simey Lameze 816b448956 MDL-62446 mod_glossary: optimize provider code 2018-06-12 18:28:31 +02:00
Simey Lameze f0c0534cf8 MDL-62446 mod_glossary: improve privacy unit tests 2018-06-12 18:28:30 +02:00
David Monllao cf482a6e6e Merge branch 'MDL-58063-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-06-12 11:05:53 +02:00
David Monllao c1f3810e42 Merge branch 'MDL-55609-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-06-12 10:20:38 +02:00
Jun Pataleta 1568720496 Merge branch 'wip-MDL-62574-34' of git://github.com/abgreeve/moodle into MOODLE_34_STABLE 2018-06-12 11:55:32 +08:00
Adrian Greeve f136376f51 MDL-62574 core_privacy: Unit tests to check the context base.
This now tests the possibility of a context being deleted.
2018-06-12 11:28:33 +08:00
Adrian Greeve 9bef4c5495 MDL-62574 core_privacy: Check the contextlist for real contexts.
There are situations when contexts will be deleted in the provider.
The context list is not updated and so we have introduced a try
catch.
2018-06-12 11:28:33 +08:00
Andrew Nicols c172b1e2f7 Merge branch 'MDL-62628-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-06-12 09:55:08 +08:00
Andrew Nicols 37e7988513 Merge branch 'MDL-60819-34' of https://github.com/snake/moodle into MOODLE_34_STABLE 2018-06-12 09:27:49 +08:00
Eloy Lafuente (stronk7) 66705e877b Merge branch 'MDL-31443-34' of https://github.com/lucaboesch/moodle into MOODLE_34_STABLE 2018-06-12 01:38:09 +02:00
Michael Aherne 55e47947e5 MDL-62577 unit tests: Quote class name in re-run command. 2018-06-12 00:08:24 +02:00
Leon Stringer fc1b6699df MDL-61786 auth: Changed strings for Test Settings to lang strings
The output strings for the Test Settings function were hard-coded English
strings. They've been changed to standard language strings which can be
translated and maintained via AMOS.
2018-06-11 14:18:46 +08:00
Jake Dallimore 843c3d5242 MDL-60819 core_files: fix exception thrown from generate_image_thumbnail
This function now requires gdlib.php.
2018-06-11 10:46:57 +08:00
Luca Bösch 68d4285fc4 MDL-31443 backup: Title and cancel messages stating import and restore 2018-06-08 11:33:09 +02:00
Mihail Geshoski eb1798f392 MDL-62628 resource: Folder name formatting issue when displayed inline 2018-06-08 08:36:48 +08:00
Mihail Geshoski fa141e42e5 MDL-58063 blocks: Cannot access manage files in HTML block in clean 2018-06-08 08:30:37 +08:00
Eloy Lafuente (stronk7) cad7a07170 weekly release 3.4.3+ 2018-06-07 16:59:57 +02:00
Bas Brands 5275d9edc6 MDL-62638 Theme boost: remove broken css 2018-06-07 16:44:54 +02:00
Jun Pataleta b7ce4d277b Merge branch 'MDL-61826-34' of git://github.com/junpataleta/moodle into MOODLE_34_STABLE 2018-06-06 11:25:17 +02:00
Jun Pataleta 77870cc549 Merge branch 'MDL-46513_34' of git://github.com/markn86/moodle into MOODLE_34_STABLE 2018-06-06 11:25:14 +02:00
Jun Pataleta 456651626c Merge branch 'MDL-62586-34' of git://github.com/bmbrands/moodle into MOODLE_34_STABLE 2018-06-06 11:25:11 +02:00
Andrew Nicols 4606d898b0 Merge branch 'm34_MDL-61702_MariaDB_InnoDB10d3d1_Params_Removed' of https://github.com/scara/moodle into MOODLE_34_STABLE 2018-06-06 11:25:07 +02:00
Eloy Lafuente (stronk7) ca9a22327d Merge branch 'MDL-39486-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-06-06 11:25:04 +02:00
David Monllao 2e0fa15542 Merge branch 'MDL-46344-34' of https://github.com/lucaboesch/moodle into MOODLE_34_STABLE 2018-06-06 11:25:01 +02:00
Jun Pataleta cf5ed61e0d Merge branch 'MDL-62336_34' of git://github.com/markn86/moodle into MOODLE_34_STABLE 2018-06-06 11:24:57 +02:00
Jun Pataleta e266745dd9 Merge branch 'MDL-61778-34' of git://github.com/mickhawkins/moodle into MOODLE_34_STABLE 2018-06-06 11:24:54 +02:00
cescobedo 4db0f1446c MDL-57968 core_message: Remove multiple unnecessary AJAX requests
Remove AJAX requests core_message_get_unread_conversations_count and
message_popup_get_unread_popup_notification_count and
render the unread messages and notifications into mustache template.
2018-06-06 11:07:48 +02:00
Jun Pataleta b8df0041ef MDL-61826 auth: Make Facebook endpoints more maintainable 2018-06-06 12:44:55 +08:00
Łukasz Szeremeta e5b9894cb1 MDL-61826 auth: Facebook OAuth2 - getting a better-quality profile photo
Get 200x200 px instead of 50x50 px user profile picture from Facebook OAuth2.
2018-06-06 12:44:55 +08:00
Bas Brands 82082aef16 MDL-62586 Themes: use Boostrap media compontent for author display 2018-06-05 15:14:22 +02:00
Luca Bösch 3149273dc0 MDL-62605 core_user: course name filter in unenrol modal. 2018-06-05 08:12:10 +02:00
Luca Bösch c5999e9816 MDL-46344 outputrenderers: Localize 'This page is'. 2018-06-01 11:43:54 +02:00
Michael Hawkins 40e7951409 MDL-61778 message: Renamed online status icon and replaced Boost icon 2018-06-01 10:25:24 +08:00
Andrew Nicols 572c939ec2 MDL-55609 assignfeedback_comments: Remove shared setUp 2018-06-01 07:33:14 +08:00
Andrew Nicols 6f1bf92b2f MDL-55609 mod_assign: Move fixture to folder 2018-06-01 07:33:14 +08:00
Andrew Nicols aea6fc7e83 MDL-55609 mod_assign: Remove shared setUp for all tests 2018-06-01 07:33:12 +08:00
Andrew Nicols 5e3bc5f34f MDL-55609 testing: Add a create_and_enrol helper 2018-06-01 07:32:25 +08:00
Matteo Scaramuccia 7d91d88601 MDL-61702 dml: MariaDB 10.3 supports only the Barracuda file format.
More details about this change also in https://tracker.moodle.org/browse/MDL-59099

Ref.: https://mariadb.com/kb/en/library/mariadb-1031-release-notes/#other-variables
2018-05-31 23:00:08 +02:00
Mark Nelson 6a1bb0f2be MDL-62571 mod_forum: fixed redirection URLs 2018-05-31 21:15:57 +08:00
David Monllao 8ebe976393 weekly release 3.4.3+ 2018-05-31 08:39:35 +02:00
Andrew Nicols de6d69b43e Merge branch 'MDL-57486-34-fix' of git://github.com/junpataleta/moodle into MOODLE_34_STABLE 2018-05-30 13:27:31 +08:00
Jun Pataleta 43ae2182a9 MDL-57486 tool_recyclebin: Close the files recordset properly 2018-05-30 13:16:39 +08:00
Andrew Nicols b8bc620619 Merge branch 'MDL-57600-34' of git://github.com/lameze/moodle into MOODLE_34_STABLE 2018-05-30 09:19:05 +08:00
Andrew Nicols 999fcfaa9f MDL-57486 tool_recyclebin: Coding style fix 2018-05-30 08:35:38 +08:00
Andrew Nicols f722092645 Merge branch 'm34_MDL-57486' of https://github.com/danmarsden/moodle into MOODLE_34_STABLE 2018-05-30 08:35:17 +08:00
Dan Marsden 92a2087415 MDL-57486 tool_recyclebin: Delete items when context already deleted. 2018-05-29 14:26:02 +12:00
Jun Pataleta 8ee54d3a01 Merge branch 'MDL-56498-34' of git://github.com/mickhawkins/moodle into MOODLE_34_STABLE 2018-05-29 09:37:05 +08:00
David Monllao c2036ae370 Merge branch 'MDL-62316_oauth_guess_image_fix_34_STABLE' of https://github.com/leonstr/moodle into MOODLE_34_STABLE 2018-05-28 16:48:57 +02:00
David Monllao 85b0aa82b5 Merge branch 'wip-MDL-62584-34' of git://github.com/marinaglancy/moodle into MOODLE_34_STABLE 2018-05-28 16:32:22 +02:00
David Monllao 2bb95d9c5a Merge branch 'MDL-42779-34' of https://github.com/lucaboesch/moodle into MOODLE_34_STABLE 2018-05-28 11:43:02 +02:00
Mark Nelson 86e3a67a95 MDL-62336 media_videojs: ensure videos have unique IDs 2018-05-28 16:44:46 +08:00
Luca Bösch 000e6f4975 MDL-42779 course: Pagination in management page preserves view action 2018-05-28 10:37:08 +02:00
Mark Nelson 9963253093 MDL-46513 mod_chat: pass has_capability result to fullname function 2018-05-28 15:53:10 +08:00
David Monllao 3753139ffe Merge branch 'MDL-57742_34' of git://github.com/markn86/moodle into MOODLE_34_STABLE 2018-05-28 09:16:55 +02:00
David Monllao 8359822423 Merge branch 'm34_MDL-59596_DDL_Issues_With_MariaDB_10p2_SQLMode' of https://github.com/scara/moodle into MOODLE_34_STABLE 2018-05-28 08:19:35 +02:00
Mark Nelson 6c4ffecc59 MDL-57742 core_lib: Updated readme_moodle.txt 2018-05-28 13:14:02 +08:00
David Balch 2d8ba1ea5e MDL-57742 core_lib: Make tool_consumer_instance_guid optional
In the specification, tool_consumer_instance_guid is only listed
as recommended. However, the library was requiring it.

https://www.imsglobal.org/specs/ltiv2p0/implementation-guide#toc-42
2018-05-28 13:13:55 +08:00
Andrew Nicols cb6b89a3e6 Merge branch 'MDL-62515-34' of git://github.com/junpataleta/moodle into MOODLE_34_STABLE 2018-05-28 12:30:17 +08:00
Marina Glancy d5897a6b17 MDL-62584 xmlrpc: return correct content-length 2018-05-28 11:20:08 +08:00
Simey Lameze e04ac51a29 MDL-57600 course: fix typo on courselib test 2018-05-28 09:42:11 +08:00
Alex 39a586d2fa MDL-57600 format: Fix spelling errors 2018-05-28 09:42:10 +08:00
Jun Pataleta eb7b1a9688 Merge branch 'MDL-61832-34' of https://github.com/lucaboesch/moodle into MOODLE_34_STABLE 2018-05-28 09:20:59 +08:00
Andrew Nicols e5434384e5 MDL-62543 mod_forum: Add RSS Unit tests 2018-05-28 08:54:58 +08:00
Andrew Nicols c5e1d2e5d2 Merge branch 'MDL-62543-34' of git://github.com/tobiasreischmann/moodle into MOODLE_34_STABLE 2018-05-28 08:54:46 +08:00
Eloy Lafuente (stronk7) bad2f9df33 Merge branch 'MDL-62408_34_STABLE' of https://github.com/marxjohnson/moodle into MOODLE_34_STABLE 2018-05-28 02:15:39 +02:00
Mihail Geshoski 27b62bbaf4 MDL-39486 lesson: Length of label text too narrow in matching questions 2018-05-25 10:03:14 +08:00
Luca Bösch 9e1acf813b MDL-61832 lesson: don't hide lesson page editing options 2018-05-24 15:43:28 +02:00
David Monllao 9cf74e2636 weekly release 3.4.3+ 2018-05-24 10:45:59 +02:00
Tobias Reischmann 708dca3400 MDL-62543 forum: Switched the usage of the deleted flag for rss
The deleted flag was introduced through the Privacy API and was used
for post selection for the rss feed. In there it was used in the
wrong way, which lead to the exclusion of all non deleted posts instead
of excluding all deleted ones.
This commit fixes this problem.
2018-05-23 14:24:11 +02:00
Simey Lameze 951febb2a8 MDL-61189 editor_tinymce: save data before submitting 2018-05-23 10:48:50 +08:00
Jake Dallimore dde3643075 Merge branch 'MDL-61932-34' of git://github.com/junpataleta/moodle into MOODLE_34_STABLE 2018-05-23 10:03:09 +08:00
Jun Pataleta 1fc9b813b2 MDL-61932 mod_glossary: Fetch the correct front page section 1 ID 2018-05-23 09:58:40 +08:00
Jun Pataleta a8662028ab MDL-61932 mod_glossary: Display site-level glossaries on section 1
* Glossary activities created on the front page by importing
entries are being added to section 0, but the front page only shows
activities on section 1.
2018-05-23 09:58:37 +08:00
Leon Stringer 1755077688 MDL-62316 OAuth 2: Only guess image if base URL set.
If you added an OAuth 2 service with no base URL guess_image() would try to
parse this empty value looking for a favicon.ico.  We now check if the base
URL is empty beforehand and skip this if so.
2018-05-22 19:46:12 +01:00
Jun Pataleta 41d477d8d6 Merge branch 'wip-MDL-62239-34' of https://github.com/Beedell/moodle into MOODLE_34_STABLE 2018-05-22 10:05:06 +08:00
Andrew Nicols 7c8dc9bc0d Merge branch 'MDL-62482_34' of git://github.com/timhunt/moodle into MOODLE_34_STABLE 2018-05-22 09:42:40 +08:00
Andrew Nicols 69471d8f81 Merge branch 'MDL-62488_34_STABLE' of https://github.com/marxjohnson/moodle into MOODLE_34_STABLE 2018-05-22 09:31:41 +08:00
Jake Dallimore e41a1d1409 Merge branch 'MDL-61015-34' of https://github.com/lucaboesch/moodle into MOODLE_34_STABLE 2018-05-22 08:15:30 +08:00
Eloy Lafuente (stronk7) 48dbc763c9 Merge branch 'MDL-62500-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-05-21 13:37:48 +02:00
John Beedell e306188732 MDL-62239 QTYPE: iOS 11.3 broke Moodle drag-drop question types 2018-05-21 11:50:36 +01:00
David Monllao 137508e70f Merge branch 'm34_MDL-61893_Accept_Any_Node_Carbon_Version' of https://github.com/scara/moodle into MOODLE_34_STABLE 2018-05-21 12:04:50 +02:00
Luca Bösch 32211803c3 MDL-61015 course: consistently display hidden sections
This commit moves the availability info on top.
2018-05-21 11:33:57 +02:00
Marina Glancy eeb84ca381 MDL-61015 course: consistently display hidden sections
When section is hidden but the course setting says to show hidden sections display the hidden
sections consistently with how we display the sections with access restriction.

The only difference is that we didn't previously display the summary of the hidden section
in this case, the new logic repeats this behavior
2018-05-21 11:33:57 +02:00
David Monllao 5aa946dda7 Merge branch 'MDL-62516-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-05-21 11:15:15 +02:00
Jun Pataleta 88d0b05172 Merge branch 'MDL-62229-34' of git://github.com/jleyva/moodle into MOODLE_34_STABLE 2018-05-21 17:04:16 +08:00
Jake Dallimore f25a5f42ea Merge branch 'MDL-62440_34' of git://github.com/timhunt/moodle into MOODLE_34_STABLE 2018-05-21 14:56:05 +08:00
Andrew Nicols 841b8c5e34 MDL-62516 mod_forum: Only delete files for requested user 2018-05-21 14:12:49 +08:00
Michael Hawkins 81a8c42a15 MDL-56498 message: Ensure clicked notifications are marked read 2018-05-21 13:08:58 +08:00
Jun Pataleta c23417e9ad MDL-62515 templates: Remove unnecessary button role for submit button 2018-05-21 09:33:32 +08:00
Andrew Nicols dc387ce16f Merge branch 'MDL-62386-34' of git://github.com/bmbrands/moodle into MOODLE_34_STABLE 2018-05-21 09:11:44 +08:00
Andrew Nicols 63e64aa6cb MDL-62500 tag: Update checkbox label when updating tag 2018-05-20 15:15:37 +08:00
Matteo Scaramuccia dd61328be3 MDL-61893 JavaScript: Bumped npm packages
Performed by removing the current 'npm-shrinkwrap.json' file:
$ rm -Rf node_modules
$ rm -f npm-shrinkwrap.json
$ npm install
$ npm shrinkwrap
2018-05-18 00:34:14 +02:00
Matteo Scaramuccia 4cc2b64cb6 MDL-61893 JavaScript: Accept any node version but Carbon (LTS) 2018-05-18 00:34:14 +02:00
Mark Johnson 83acfca76a MDL-62488 filebrowser: Stop unit tests assuming number of categories 2018-05-17 16:02:28 +01:00
Tim Hunt d7cdf10744 MDL-62482 file_storage: may have many files with same content hash 2018-05-17 11:25:12 +01:00
Tim Hunt a534d3e044 MDL-62440 participants: out-of-memory is many site-wide role assigns 2018-05-17 10:44:30 +01:00
Eloy Lafuente (stronk7) 05a434229c Moodle release 3.4.3 2018-05-16 18:42:18 +02:00
Marina Glancy e5c3ba2df9 MDL-62469 qtype_calculated: check remaining placeholders, see MDL-62275 2018-05-16 17:30:09 +02:00
David Monllao 2f3bcbc5ce Merge branch 'MDL-62456_34' of git://github.com/markn86/moodle into MOODLE_34_STABLE 2018-05-16 08:58:47 +02:00
Andrew Nicols 4c2a5ce403 Merge branch 'wip-MDL-62147-34' of git://github.com/marinaglancy/moodle into MOODLE_34_STABLE 2018-05-16 14:28:13 +08:00
Jun Pataleta 97a800149c Merge branch 'MDL-62463-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-05-16 14:21:51 +08:00
Frédéric Massart 9510c3c535 MDL-62147 core_grades: Report contexts and data related to scales 2018-05-16 13:56:14 +08:00
Marina Glancy 5c1b473931 MDL-62147 core_grades: Declare metadata of scales and import tables 2018-05-16 13:56:14 +08:00
Marina Glancy f2f7255f7b MDL-62147 portfolio: add missing tables to privacy provider 2018-05-16 13:56:11 +08:00
Marina Glancy 3a20fb23a5 MDL-62147 privacy: unittest ensures that all tables covered 2018-05-16 13:56:07 +08:00
Andrew Nicols 6f0e3c70a9 MDL-62463 mod_glossary: Fix SQL query
The query was doing:
WHERE c.id ... AND ... OR ... OR ...

Which equates to:
WHERE (c.id ... AND ...) OR ... OR ...

Adding parens to:
WHERE (c.id ... AND (... OR ... OR ...))
2018-05-16 13:51:17 +08:00
Marina Glancy 212b6daf32 MDL-62147 privacy: corrections to tables, temporary tables 2018-05-16 12:46:24 +08:00
Mark Nelson d5f69f0c5c MDL-62456 mod_lti: add missing add_external_location_link call 2018-05-16 12:23:06 +08:00
Jake Dallimore b066f554c4 Merge branch 'MDL-62134-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-05-16 12:02:30 +08:00
Andrew Nicols e6a65ee796 MDL-62134 core_privacy: Allow for a failure handler 2018-05-16 11:52:46 +08:00
Andrew Nicols d44adb98f6 Merge branch 'MDL-62426-34' of https://github.com/snake/moodle into MOODLE_34_STABLE 2018-05-16 11:00:55 +08:00
Jake Dallimore 321d41a022 MDL-62426 core_enrol: control enrolment subcontexts at the provider
Added a function to the core_enrol provider allowing enrol plugins
to set their subcontext relative to a fixed 'enrolments' parent dir.
2018-05-16 10:23:24 +08:00
Jake Dallimore 2f477b5764 MDL-62426 enrol_flatfile: make provider a plugin provider
The enrol_flatfile table can contain userdata relating to pending
enrolments, so this should be exported and deleted as necessary.
2018-05-16 09:38:11 +08:00
Marina Glancy 8596627666 MDL-62134 privacy: consistantly call components methods 2018-05-16 09:05:45 +08:00
Eloy Lafuente (stronk7) 7f7e03e923 Merge branch 'MDL-62447_34' of git://github.com/dmonllao/moodle into MOODLE_34_STABLE 2018-05-16 01:26:16 +02:00
Eloy Lafuente (stronk7) f9d6769ecd Merge branch 'MDL-62448-34' of git://github.com/sarjona/moodle into MOODLE_34_STABLE 2018-05-15 17:29:15 +02:00
Sara Arjona dc15df1651 MDL-62448 block_rss_client: Export all feeds from Privacy API 2018-05-15 14:26:55 +02:00
David Monllao 17d4aeacb4 Merge branch 'MDL-62228_34' of git://github.com/markn86/moodle into MOODLE_34_STABLE 2018-05-15 13:31:50 +02:00
David Monllao 4d2dc4246d MDL-62447 user: Fix component name typo 2018-05-15 10:45:24 +02:00
Mark Johnson d577e027b6 MDL-62408 behat: Correct PHPUNIT_TEST checks in behat_config_util 2018-05-15 09:12:53 +01:00
David Monllao 08c3480834 weekly release 3.4.2+ 2018-05-15 09:42:13 +02:00
David Monllao 67d10dd9f3 Merge branch 'install_34_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_34_STABLE 2018-05-15 09:42:11 +02:00
Mark Nelson 13a215ee8f MDL-62228 core: remove unnecessary context check in privacy providers 2018-05-15 11:59:38 +08:00
Andrew Nicols 8b90c6d421 Merge branch 'MDL-62444-34' of git://github.com/zig-moodle/moodle into MOODLE_34_STABLE 2018-05-15 11:39:09 +08:00
Andrew Nicols 1087c7ecf6 Merge branch 'MDL-62428_34' of git://github.com/markn86/moodle into MOODLE_34_STABLE 2018-05-15 11:05:40 +08:00
Zig Tan a7a2e52230 MDL-62444 mod_assignment: Fix missing lang string. 2018-05-15 09:54:23 +08:00
Jun Pataleta a061b37c9f Merge branch 'MDL-62432-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-05-15 09:34:11 +08:00
Andrew Nicols a7e25a4743 MDL-62432 quiz: Check contexts more carefully 2018-05-15 09:25:51 +08:00
Eloy Lafuente (stronk7) 6ed7752d77 Merge branch 'MDL-62430_34' of git://github.com/dmonllao/moodle into MOODLE_34_STABLE 2018-05-15 02:56:13 +02:00
AMOS bot 3d519e9028 Automatically generated installer lang files 2018-05-15 00:06:29 +00:00
David Monllao cca4584795 MDL-62430 block_html: Check that block instances are block_html 2018-05-14 17:07:12 +02:00
David Monllao 285d723271 Merge branch 'MDL-62370-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-05-14 16:00:58 +02:00
Andrew Nicols 862b48ec3e Merge branch 'MDL-62356-34' of git://github.com/cescobedo/moodle into MOODLE_34_STABLE 2018-05-14 21:01:44 +08:00
Andrew Nicols 2c00480315 Merge branch 'MDL-62357-34' of git://github.com/cescobedo/moodle into MOODLE_34_STABLE 2018-05-14 20:45:12 +08:00
Andrew Nicols 93476477d6 MDL-62370 core_privacy: Directory-less subsystems are compliant 2018-05-14 20:01:35 +08:00
Marina Glancy 755fe15718 MDL-62430 privacy: validate context when deleting all user data 2018-05-14 18:14:04 +08:00
David Monllao 38899f4068 Merge branch 'MDL-62425-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-05-14 10:59:06 +02:00
cescobedo 07e77422e6 MDL-62356 enrol_meta: Add privacy implementation for enrol_meta 2018-05-14 10:57:44 +02:00
cescobedo 2e2bfe1c8e MDL-62357 enrol_cohort: Add privacy implementation for enrol_cohort 2018-05-14 10:50:06 +02:00
Andrew Nicols b04d01c29e MDL-62425 core: Add privacy implementation 2018-05-14 15:42:59 +08:00
Andrew Nicols 67b4cde9bd MDL-62425 core_privacy: Add core to the list of components 2018-05-14 15:42:05 +08:00
Mark Nelson e1baf5e1d6 MDL-62428 core: fix incorrect early return in privacy providers 2018-05-14 13:07:49 +08:00
Jake Dallimore 0f82392c8b Merge branch 'MDL-62420-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-05-14 11:58:13 +08:00
Jake Dallimore a023256c41 Merge branch 'MDL-62393-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-05-14 09:37:57 +08:00
Andrew Nicols 108ed14f1d MDL-62420 enrol_lti: Fix random unit test fail in privacy 2018-05-14 08:44:10 +08:00
Eloy Lafuente (stronk7) d419fe2ccf Merge branch 'MDL-62371-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-05-14 02:42:04 +02:00
Eloy Lafuente (stronk7) d70da80b82 Merge branch 'MDL-62251-34' of git://github.com/rezaies/moodle into MOODLE_34_STABLE 2018-05-13 23:56:20 +02:00
Andrew Nicols 8ef2cc73c7 MDL-62371 core_privacy: Add support for progress trace 2018-05-13 15:45:24 +08:00
AMOS bot 2e764430b3 Automatically generated installer lang files 2018-05-13 00:06:43 +00:00
Andrew Nicols 644c42f936 MDL-62393 message: Fix random unit test fails 2018-05-12 22:54:29 +08:00
Eloy Lafuente (stronk7) 6df0fa92f3 weekly release 3.4.2+ 2018-05-12 12:56:48 +02:00
Eloy Lafuente (stronk7) a274f62195 MDL-62275 qtype_calculatedmulti: Fix typo 2018-05-11 21:17:25 +02:00
David Monllao c941c541b4 MDL-62029 core_course: Site format is not a standard plugin 2018-05-11 20:19:25 +02:00
Eloy Lafuente (stronk7) 6204ed292e Merge branch 'MDL-62384-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-05-11 18:27:58 +02:00
David Monllao 3c4be4e9f5 Merge branch 'MDL-61858_34' of git://github.com/markn86/moodle into MOODLE_34_STABLE 2018-05-11 18:07:10 +02:00
David Monllao 2489791a70 Merge branch 'MDL-62368_34' of git://github.com/markn86/moodle into MOODLE_34_STABLE 2018-05-11 17:59:30 +02:00
Bas Brands 75bff87d18 MDL-62386 theme: Fix audio playback display for HTML audio
Fixed for boost
Fixed for bootstrapbase
2018-05-11 14:52:53 +02:00
Mark Nelson e0700b4c79 MDL-61858 tool_phpunit: added missing privacy null provider 2018-05-11 19:39:43 +08:00
Mark Nelson 91fdd3b806 MDL-61858 gradingform_guide: added missing metadata implementation 2018-05-11 19:39:43 +08:00
Mark Nelson a4a05cffdb MDL-61858 core_portfolio: added missing metadata implementation 2018-05-11 19:39:43 +08:00
Andrew Nicols 039f5b0472 MDL-61858 core_privacy: Add test to ensure component implementations 2018-05-11 19:39:43 +08:00
Sara Arjona 4a6aa192a0 MDL-61951 core_grading: Review SQL to avoid Oracle errors 2018-05-11 13:35:34 +02:00
David Monllao c4a24dbc2e Merge branch 'MDL-61714-34' of git://github.com/sarjona/moodle into MOODLE_34_STABLE 2018-05-11 11:31:36 +02:00
Sara Arjona 1f89dde34f MDL-61714 admin: Removed Slovenian digital age 2018-05-11 10:12:51 +02:00
Shamim Rezaie 5604f5977f MDL-62251 Privacy: Fix dir separator in export_file() 2018-05-11 17:33:08 +10:00
Shamim Rezaie 6d882faecf MDL-62251 Privacy: Url path separator should be platform independant
It should always be forward slash.
2018-05-11 17:31:23 +10:00
Shamim Rezaie b561a9a3c2 MDL-62251 Privacy: Fix get_path() and get_full_path() bug in Windows 2018-05-11 17:27:49 +10:00
Shamim Rezaie 836f8eb62e MDL-62251 backup: Fix replace_tempdir() bug under Windows
rename() fails under Windows if the destination file/directory exists.
I modified the code to only call $this->get_workdir_path() once as that function
creates the directory if doesn't exist. And we don't want that considering the
behaviour of rename on Windows.
2018-05-11 17:19:12 +10:00
Eloy Lafuente (stronk7) 5bcf683030 MDL-62354 notes: Reduce string to avoid js_call_amd() lenght limits
That way we are under the max 1024 allowed and also, the help string
is shown properly in the modal (previously part of it was not visible
falling off-window).
2018-05-11 14:53:12 +08:00
Jun Pataleta 3403ae0f9d Merge branch 'MDL-62394-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-05-11 14:23:33 +08:00
Andrew Nicols 6e7bc3a86a MDL-62394 privacy: Make JSON export pretty 2018-05-11 14:12:40 +08:00
Mark Nelson cd674a6d1d MDL-62368 enrol_lti: implement privacy provider 2018-05-11 14:06:13 +08:00
Mihail Geshoski 9b5778fcd1 MDL-62384 privacy: Modify user contexts query for auth_oauth2 2018-05-11 11:14:12 +08:00
Andrew Nicols 2986db7b8d MDL-62384 core_rating: Move WHERE clauses to JOIN 2018-05-11 11:14:11 +08:00
Andrew Nicols 75f2840454 MDL-62384 core_grade: Move WHERE clause to JOIN 2018-05-11 11:14:11 +08:00
Andrew Nicols 0d91ed2942 MDL-62384 mod_lesson: Move WHERE clause to JOIN 2018-05-11 11:14:11 +08:00
Andrew Nicols b2b8f037de MDL-62384 logstore_standard: Remove unnecessary join on context 2018-05-11 11:14:10 +08:00
Andrew Nicols 0011785c0a MDL-62384 mod_quiz: Improve performancy of privacy queries 2018-05-11 11:14:10 +08:00
Adrian Greeve bfd070b711 MDL-62384 mod_data: Update sql to improve performance. 2018-05-11 11:14:10 +08:00
Adrian Greeve 53616ddb09 MDL-62384 tool_monitor: Update to sql to fix performance. 2018-05-11 11:14:09 +08:00
Adrian Greeve 9c10ba6e78 MDL-62384 core_competency: Update to sql to increase performance. 2018-05-11 11:14:09 +08:00
Adrian Greeve db2797b58c MDL-62384 core_completion: Update to sql to improve performance. 2018-05-11 11:14:09 +08:00
Adrian Greeve a50cb83349 MDL-62384 mod_assign: Update to sql query for performance. 2018-05-11 11:14:08 +08:00
Andrew Nicols 25e366c3f5 Merge branch 'wip-MDL-61814-34-fix' of git://github.com/abgreeve/moodle into MOODLE_34_STABLE 2018-05-11 10:49:23 +08:00
Adrian Greeve df986a59fc MDL-61814 report_stats: Update to sql to increase performance. 2018-05-11 10:43:57 +08:00
Jake Dallimore 78f478c00b MDL-61951 core_grading: SQL improvements for grading_instance join 2018-05-11 10:19:50 +08:00
Jake Dallimore 031a7948f1 Merge branch 'MDL-61951-34' of git://github.com/sarjona/moodle into MOODLE_34_STABLE 2018-05-11 10:19:46 +08:00
Jun Pataleta 0c1f7db133 Merge branch 'MDL-62117-34-fix' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-05-11 09:31:43 +08:00
Andrew Nicols 3fa0cd9708 MDL-62117 enrol_paypal: Improve SQL efficiency 2018-05-11 09:30:10 +08:00
Tim Hunt 023c3d4f0d MDL-62275 qtype_calc*: improve validation of formulae
Many thanks to Marina Glancy for helping with this.
2018-05-11 01:28:47 +02:00
David Monllao 20f9ff3a10 Merge branch 'MDL-62366-34' of git://github.com/zig-moodle/moodle into MOODLE_34_STABLE 2018-05-10 18:14:10 +02:00
David Monllao 464a6c7f7e Merge branch 'MDL-61714-34' of git://github.com/sarjona/moodle into MOODLE_34_STABLE 2018-05-10 18:10:55 +02:00
David Monllao 43f86202dc Merge branch 'MDL-62200-34' of git://github.com/bmbrands/moodle into MOODLE_34_STABLE 2018-05-10 18:04:26 +02:00
David Monllao 0cd244b5c7 Merge branch 'MDL-61949-34-privacy-upgrade-txt' of git://github.com/mudrd8mz/moodle into MOODLE_34_STABLE 2018-05-10 17:53:16 +02:00
Jake Dallimore 1d49ba282a MDL-61951 core_grading: Several fixes to the privacy implementation
- Fixed legacy polyfill method definitions
- Added unit test for legacy polyfill
- Fixed delete_gradingform_for_userid in gradingform provider
2018-05-10 13:27:21 +02:00
Sara Arjona 500a03f9ed MDL-61951 grading: Implement privacy API 2018-05-10 13:27:20 +02:00
Andrew Nicols 74d018c3e0 MDL-61905 mod_workshop: Adjust privacy SQL queries
This change moves the content of WHERE to the JOIN, thus filtering the
results before they are returned. This reduces the number of joined rows
which gives a big performance benefit.
2018-05-10 13:05:48 +02:00
David Mudrák 0628adc6c7 MDL-61949 privacy: Add mention of the new API in upgrade.txt files
The notice is explicitly repeated for activity modules because they
usually process user data heavily.
2018-05-10 12:01:09 +02:00
Eloy Lafuente (stronk7) 4f53102a9e Merge branch 'MDL-62354-34-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_34_STABLE 2018-05-10 11:38:50 +02:00
Sara Arjona 3c3451b1b6 MDL-61714 admin: Update digital age consent map according legislation 2018-05-10 10:33:17 +02:00
David Monllao 29d090c15c Merge branch 'MDL-61309-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-05-10 08:48:19 +02:00
Andrew Nicols 500146d1e6 MDL-61309 mod_forum: Improve privacy query performance 2018-05-10 14:06:30 +08:00
Marina Glancy 6cc7e8cd51 MDL-62206 blocks: do not add fixed form elements as hidden 2018-05-10 12:08:56 +08:00
Adam Olley 18a3db531e MDL-62210 mod_assign: limit file lookup to the target assign 2018-05-10 11:21:58 +08:00
Brendan Cox 00781f3590 MDL-62210 mod_assign: improved validation in portfolio caller class 2018-05-10 11:21:58 +08:00
Jake Dallimore 475d4345ca Merge branch 'MDL-62383-34' of git://github.com/junpataleta/moodle into MOODLE_34_STABLE 2018-05-10 10:03:57 +08:00
Jun Pataleta 569e2aae3b MDL-62383 privacy: Close recordset in contextlist::add_from_sql() 2018-05-10 09:56:48 +08:00
Jake Dallimore eb0b01e3c9 MDL-62257 mnetservice_enrol: minor fixes to privacy provider 2018-05-10 09:37:46 +08:00
Jake Dallimore 6147acceba Merge branch 'MDL-62257-34' of git://github.com/cescobedo/moodle into MOODLE_34_STABLE 2018-05-10 09:37:40 +08:00
Eloy Lafuente (stronk7) 5c581ac980 Merge branch 'MDL-61309-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-05-10 09:18:59 +08:00
David Monllao fe99227626 Merge branch 'MDL-62308_34' of git://github.com/markn86/moodle into MOODLE_34_STABLE 2018-05-10 09:18:59 +08:00
David Monllao a586c08def MDL-61976 mod_wiki: Trim returned value to avoid EOF-related failures 2018-05-10 09:18:59 +08:00
Andrew Nicols 9db4483076 Merge branch 'wip-MDL-62351-34' of git://github.com/marinaglancy/moodle into MOODLE_34_STABLE 2018-05-10 09:18:58 +08:00
David Monllao 927fe3ce99 Merge branch 'MDL-62249-34' of git://github.com/zig-moodle/moodle into MOODLE_34_STABLE 2018-05-10 09:18:58 +08:00
Andrew Nicols b53663e359 Merge branch 'MDL-62217_34' of git://github.com/dmonllao/moodle into MOODLE_34_STABLE 2018-05-10 09:18:57 +08:00
Andrew Nicols 3e88f8e7d1 Merge branch 'MDL-62269-34' of git://github.com/vmdef/moodle into MOODLE_34_STABLE 2018-05-10 09:18:57 +08:00
David Monllao 608cb5dcc0 Merge branch 'wip-MDL-61976-34' of git://github.com/marinaglancy/moodle into MOODLE_34_STABLE 2018-05-10 09:18:56 +08:00
David Monllao d99070f10e MDL-61994 mod_glossary: Fixing wrong subsystem name 2018-05-10 09:18:56 +08:00
David Monllao 9b7163faf1 Merge branch 'MDL-61994-34' of git://github.com/lameze/moodle into MOODLE_34_STABLE 2018-05-10 09:18:55 +08:00
David Monllao 40e290fe27 Merge branch 'MDL-61309-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-05-10 09:18:55 +08:00
Brendan Cox f53c4b18b4 MDL-62232 mod_forum: Additional tests for portfolio file export 2018-05-10 09:18:55 +08:00
Adam Olley ef56dcb9dd MDL-62232 mod_forum: Limit portfolio to files belonging to the post 2018-05-10 09:18:54 +08:00
Andrew Nicols 1e0ca61d45 Merge branch 'MDL-61905-34-privacyworkshop' of git://github.com/mudrd8mz/moodle into MOODLE_34_STABLE 2018-05-10 09:18:54 +08:00
Andrew Nicols adb4e9b55e Merge branch 'MDL-62029-34-2' of git://github.com/snake/moodle into MOODLE_34_STABLE 2018-05-10 09:18:53 +08:00
Jun Pataleta 31f20b9309 Merge branch 'MDL-62332-34' of git://github.com/bmbrands/moodle into MOODLE_34_STABLE 2018-05-10 09:18:53 +08:00
Andrew Nicols 472770e15e Merge branch 'MDL-62318-34' of git://github.com/rezaies/moodle into MOODLE_34_STABLE 2018-05-10 09:18:52 +08:00
Andrew Nicols 8a5c22a052 Merge branch 'MDL-62117-34' of git://github.com/rezaies/moodle into MOODLE_34_STABLE 2018-05-10 09:18:52 +08:00
Marina Glancy 32df854591 MDL-62233 portfolio: check caller parent class 2018-05-10 09:18:51 +08:00
Zig Tan 42caaedf5e MDL-62366 mod_assign: Followup fix for attemptnumber in exported JSON 2018-05-10 09:18:46 +08:00
Andrew Nicols 1813fb1019 MDL-61309 mod_forum: Remove unnecessary deletion check 2018-05-10 07:48:13 +08:00
Helen Foster b909153fef MDL-62354 lang: Merge English strings from the en_fix language pack
* publishstate_help, core_notes - including GDPR guidance
2018-05-09 22:56:40 +02:00
Mark Nelson 0b01e3abc1 MDL-62308 core_backup: implement privacy provider
The provider was added to 'backup/util/ui/' due to
Moodle's implementation of autoclass loading. See
fetch_subsystems() in lib/classes/component.php.
2018-05-09 23:14:25 +08:00
Marina Glancy ed061d4a9a MDL-62351 privacy: check that subsystem/plugintype exist 2018-05-09 17:38:11 +08:00
Marina Glancy 6a06f60fc6 MDL-61976 mod_wiki: implement privacy API 2018-05-09 17:30:45 +08:00
Victor Deniz b694fb4a33 MDL-62269 auth_mnet: Implement privacy API
AMOS BEGIN
 CPY [privacy:metadata:address,core_user],[privacy:metadata:mnet_external:address,auth_mnet]
 CPY [privacy:metadata:aim,core_user],[privacy:metadata:mnet_external:aim,auth_mnet]
 CPY [privacy:metadata:aim,core_user],[privacy:metadata:mnet_external:aim,auth_mnet]
 CPY [privacy:metadata:alternatename,core_user],[privacy:metadata:mnet_external:alternatename,auth_mnet]
 CPY [privacy:metadata:autosubscribe,core_user],[privacy:metadata:mnet_external:autosubscribe,auth_mnet]
 CPY [privacy:metadata:calendartype,core_user],[privacy:metadata:mnet_external:calendartype,auth_mnet]
 CPY [privacy:metadata:city,core_user],[privacy:metadata:mnet_external:city,auth_mnet]
 CPY [privacy:metadata:country,core_user],[privacy:metadata:mnet_external:country,auth_mnet]
 CPY [privacy:metadata:currentlogin,core_user],[privacy:metadata:mnet_external:currentlogin,auth_mnet]
 CPY [privacy:metadata:department,core_user],[privacy:metadata:mnet_external:department,auth_mnet]
 CPY [privacy:metadata:description,core_user],[privacy:metadata:mnet_external:description,auth_mnet]
 CPY [privacy:metadata:email,core_user],[privacy:metadata:mnet_external:email,auth_mnet]
 CPY [privacy:metadata:emailstop,core_user],[privacy:metadata:mnet_external:emailstop,auth_mnet]
 CPY [privacy:metadata:firstaccess,core_user],[privacy:metadata:mnet_external:firstaccess,auth_mnet]
 CPY [privacy:metadata:firstname,core_user],[privacy:metadata:mnet_external:firstname,auth_mnet]
 CPY [privacy:metadata:firstnamephonetic,core_user],[privacy:metadata:mnet_external:firstnamephonetic,auth_mnet]
 CPY [privacy:metadata:icq,core_user],[privacy:metadata:mnet_external:icq,auth_mnet]
 CPY [privacy:metadata:id,core_user],[privacy:metadata:mnet_external:id,auth_mnet]
 CPY [privacy:metadata:idnumber,core_user],[privacy:metadata:mnet_external:idnumber,auth_mnet]
 CPY [privacy:metadata:imagealt,core_user],[privacy:metadata:mnet_external:imagealt,auth_mnet]
 CPY [privacy:metadata:institution,core_user],[privacy:metadata:mnet_external:institution,auth_mnet]
 CPY [privacy:metadata:lang,core_user],[privacy:metadata:mnet_external:lang,auth_mnet]
 CPY [privacy:metadata:lastaccess,core_user],[privacy:metadata:mnet_external:lastaccess,auth_mnet]
 CPY [privacy:metadata:lastlogin,core_user],[privacy:metadata:mnet_external:lastlogin,auth_mnet]
 CPY [privacy:metadata:lastname,core_user],[privacy:metadata:mnet_external:lastname,auth_mnet]
 CPY [privacy:metadata:lastnamephonetic,core_user],[privacy:metadata:mnet_external:lastnamephonetic,auth_mnet]
 CPY [privacy:metadata:maildigest,core_user],[privacy:metadata:mnet_external:maildigest,auth_mnet]
 CPY [privacy:metadata:maildisplay,core_user],[privacy:metadata:mnet_external:maildisplay,auth_mnet]
 CPY [privacy:metadata:middlename,core_user],[privacy:metadata:mnet_external:middlename,auth_mnet]
 CPY [privacy:metadata:msn,core_user],[privacy:metadata:mnet_external:msn,auth_mnet]
 CPY [privacy:metadata:phone,core_user],[privacy:metadata:mnet_external:phone1,auth_mnet]
 CPY [privacy:metadata:picture,core_user],[privacy:metadata:mnet_external:picture,auth_mnet]
 CPY [privacy:metadata:policyagreed,core_user],[privacy:metadata:mnet_external:policyagreed,auth_mnet]
 CPY [privacy:metadata:skype,core_user],[privacy:metadata:mnet_external:skype,auth_mnet]
 CPY [privacy:metadata:suspended,core_user],[privacy:metadata:mnet_external:suspended,auth_mnet]
 CPY [privacy:metadata:timezone,core_user],[privacy:metadata:mnet_external:timezone,auth_mnet]
 CPY [privacy:metadata:trackforums,core_user],[privacy:metadata:mnet_external:trackforums,auth_mnet]
 CPY [privacy:metadata:trustbitmask,core_user],[privacy:metadata:mnet_external:trustbitmask,auth_mnet]
 CPY [privacy:metadata:url,core_user],[privacy:metadata:mnet_external:url,auth_mnet]
 CPY [privacy:metadata:username,core_user],[privacy:metadata:mnet_external:username,auth_mnet]
 CPY [privacy:metadata:yahoo,core_user],[privacy:metadata:mnet_external:yahoo,auth_mnet]
AMOS END
2018-05-09 10:06:18 +01:00
David Monllao 852a814791 MDL-62217 search_solr: Plugin provider fake implementation 2018-05-09 10:58:06 +02:00
David Monllao 3cd8687bec MDL-62217 search: Privacy providers 2018-05-09 10:58:05 +02:00
David Mudrák 0d7e2fc5ec MDL-61905 workshop: Implement privacy API in grading evaluators
Standard workshop ships with only one evaluation method and that one
holds no personal data.
2018-05-09 10:02:46 +02:00
David Mudrák fdcb33c5c5 MDL-61905 workshop: Implement privacy API in assessment allocators
Assessment allocation methods normally do not store any personal data.
Their duty is to create assessment records that are then exported by the
workshop core itself.

Still, some allocators (such as the Manual allocation) can store certain
personal data such as user preferences.
2018-05-09 10:02:46 +02:00
David Mudrák 07dc8783a9 MDL-61905 workshop: Implement privacy API in grading strategies
On low level, standard grading strategies subplugins do not store
personal themselves.  They make use of the grades storage provided by
the workshop itself.  What they do contain though is the information
about how the assessment forms were defined. And they are also
responsible for correctly interpreting the values in the central grades
table.

Grading strategies fulfil the contract with the parent workshop module
by implementing the workshopform_provider interface. That gives them a
chance to export data about the assessment form to each of exported
assessment.
2018-05-09 10:02:45 +02:00
David Mudrák 4d829b1159 MDL-61905 workshop: Implement the privacy API in the workshop core
Workshop module stores personal data in its tables, via user
preference and via core_files and core_plagiarism subsystems.

When exporting the data, we export not only data created by users
themselves (such as their submissions and provided peer-assessments) but
also all relevant data that can (or must) be used to interpret created
content and evaluate the user's performance and skills.

On the other hand, when deleting data at user's request, we delete only
those data that do not affect other users' performance evaluation. The
reasoning is that one's right for privacy does not overweight someone
else's right for fair assessment. For that reason, we can't fully delete
whole provided peer-assessments, for example. Because they are used in
cross-comparison and grading evaluation of all other peers who assessed
the same submission. So instead, we replace provided texts but still
keep the original record.

Workshop defines the interface for its grading strategy subplugins to
allow them attach personal data under their control to the exported
structures.
2018-05-09 10:02:45 +02:00
Jake Dallimore 791824e682 MDL-62029 core_course: Fixes to context-aware provider implementation. 2018-05-09 15:41:31 +08:00
Andrew Nicols 3c7fe9a187 MDL-61309 mod_forum: Implement privacy deletion 2018-05-09 14:03:33 +08:00
Andrew Nicols 6359c7e7be MDL-61309 mod_forum: Implement the Privacy API 2018-05-09 14:03:33 +08:00
Andrew Nicols 36f95f4473 MDL-61309 core_tags: Add privacy unit test trait 2018-05-09 13:54:49 +08:00
Shamim Rezaie 059b45807e MDL-62318 core_group: Updating cache when deleting group memberships 2018-05-09 13:30:28 +10:00
Shamim Rezaie bc36eb358c MDL-62318 core_group: Add implementation of privacy API 2018-05-09 13:30:28 +10:00
Simey Lameze 9dcb1ca891 MDL-61994 mod_glossary: add unit tests for provider 2018-05-09 10:59:35 +08:00
Simey Lameze e8aed4e726 MDL-61994 mod_glossary: implement privacy providers 2018-05-09 10:59:35 +08:00
Adrian Greeve 5701891122 MDL-62029 core_privacy: context aware provider creation. 2018-05-09 10:08:07 +08:00
Adrian Greeve 79c1c70d3e MDL-62029 core_course: Create privacy files for core_course. 2018-05-09 10:07:59 +08:00
Marina Glancy 4972e130b0 MDL-61996 core: when loggedin always check user is complete 2018-05-09 02:56:55 +02:00
Andrew Nicols 29fde8b965 Merge branch 'MDL-62010-34' of git://github.com/cescobedo/moodle into MOODLE_34_STABLE 2018-05-09 08:51:40 +08:00
cescobedo 9a8e043005 MDL-62010 core_enrol: Add privacy implementation for core_enrol 2018-05-08 18:54:50 +02:00
David Monllao 01c96e9407 MDL-61814 core_user: Remove empty line to avoid ci warning 2018-05-08 17:19:53 +02:00
David Monllao fe91efe959 Merge branch 'wip-MDL-61814-34' of git://github.com/abgreeve/moodle into MOODLE_34_STABLE 2018-05-08 17:19:44 +02:00
David Monllao b70613ff41 Merge branch 'MDL-61943-34' of git://github.com/cescobedo/moodle into MOODLE_34_STABLE 2018-05-08 16:44:09 +02:00
David Monllao f4fb0b93ce weekly release 3.4.2+ 2018-05-08 14:02:17 +02:00
David Monllao 4d5b3a33b4 Merge branch 'install_34_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_34_STABLE 2018-05-08 14:02:16 +02:00
cescobedo 042bce6e96 MDL-61943 core_role: Add privacy implementation for core_role 2018-05-08 13:43:07 +02:00
cescobedo 7f0e4dc648 MDL-62257 mnetservice_enrol: Implement Privacy API 2018-05-08 10:08:14 +02:00
Bas Brands ebad5e1ad0 MDL-62332 Theme boost: paging bar empty active link 2018-05-08 09:54:34 +02:00
Andrew Nicols c4e40568e6 Merge branch 'wip-MDL-61937-34-fix' of https://github.com/marinaglancy/moodle into MOODLE_34_STABLE 2018-05-08 14:44:34 +08:00
Marina Glancy 7e34297bc4 MDL-61937 mod_data: fix commentarea name 2018-05-08 14:39:55 +08:00
Adrian Greeve 00ee2d2253 MDL-61814 report_stats: Update to be a full privacy provider. 2018-05-08 13:50:32 +08:00
Adrian Greeve 4f63dba263 MDL-61814 core_portfolio: Update to portfolio provider. 2018-05-08 13:50:19 +08:00
Adrian Greeve 50c5de127c MDL-61814 core_user: Implement privacy system for user. 2018-05-08 13:50:06 +08:00
Zig Tan 3a4032ddc8 MDL-62249 block_tag_flickr: Corrected privacy providers 2018-05-08 12:12:01 +08:00
Marina Glancy b3db534b8c MDL-61976 privacy: replace pluginfile in test writer 2018-05-08 12:02:40 +08:00
Marina Glancy a37d821895 MDL-61976 privacy: add subcontext argument to has_any_data 2018-05-08 12:02:40 +08:00
Andrew Nicols 763db71ad3 Merge branch 'wip-MDL-62068-34' of git://github.com/marinaglancy/moodle into MOODLE_34_STABLE 2018-05-08 11:45:16 +08:00
Shamim Rezaie 87abd9b0aa MDL-62117 enrol_paypal: Add implementation of Privacy API 2018-05-08 13:34:25 +10:00
Marina Glancy 8d34874399 MDL-62068 core_tag: implement privacy API 2018-05-08 11:31:54 +08:00
Andrew Nicols 1fe42d1cd1 Merge branch 'MDL-62285-34' of git://github.com/ryanwyllie/moodle into MOODLE_34_STABLE 2018-05-08 11:11:24 +08:00
Ryan Wyllie 5764a4640f MDL-62285 privacy: use context id when generating context path
moodle_content_writer::get_context_path() now includes the context
id in the path to ensure that it will always generate unique paths
even when the context names are not unique.
2018-05-08 01:41:03 +00:00
Eloy Lafuente (stronk7) 403e3b0333 Merge branch 'MDL-61521-34' of git://github.com/jleyva/moodle into MOODLE_34_STABLE 2018-05-08 01:44:53 +02:00
Andrew Nicols c305233628 Merge branch 'MDL-62326-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-05-07 17:26:10 +08:00
Andrew Nicols 47265c83e0 Merge branch 'MDL-62169-34' of git://github.com/zig-moodle/moodle into MOODLE_34_STABLE 2018-05-07 17:25:49 +08:00
Zig Tan a942eb648a MDL-62169 mod_assignment: Improved phpunit test reliability 2018-05-07 16:44:03 +08:00
Andrew Nicols 26fad064f0 Merge branch 'MDL-61919_34' of git://github.com/markn86/moodle into MOODLE_34_STABLE 2018-05-07 15:46:46 +08:00
Andrew Nicols 26c255a160 Merge branch 'wip-MDL-62137-34' of git://github.com/abgreeve/moodle into MOODLE_34_STABLE 2018-05-07 15:27:53 +08:00
Andrew Nicols e00c025ed6 MDL-62326 core_antivirus: Implement null provider 2018-05-07 14:40:22 +08:00
Adrian Greeve 3bf826e23d MDL-62137 core_privacy: Update to helper to use core_completion 2018-05-07 14:27:10 +08:00
Adrian Greeve 3f98a6af5b MDL-62137 core_completion: Privacy files for core_completion. 2018-05-07 14:27:10 +08:00
Andrew Nicols ab4de7a081 Merge branch 'MDL-62169-34' of git://github.com/zig-moodle/moodle into MOODLE_34_STABLE 2018-05-07 14:16:25 +08:00
Andrew Nicols 269327c0fb Merge branch 'MDL-61407-34-fix' of git://github.com/junpataleta/moodle into MOODLE_34_STABLE 2018-05-07 13:51:37 +08:00
Zig Tan 4b012e921c MDL-62169 mod_assignment: Implemented privacy providers 2018-05-07 13:45:38 +08:00
Jun Pataleta f304a59b8a MDL-61407 mod_quiz: Determine quiz step for manual comment 2018-05-07 13:35:18 +08:00
Andrew Nicols 6294e3b9ec MDL-61937 mod_data: Correct rating export args in privacy 2018-05-07 09:43:20 +08:00
David Monllao 845a6a8329 MDL-61937 mod_data: Target the correct area 2018-05-07 09:43:20 +08:00
Andrew Nicols d038e858df MDL-61407 question: Export step files in privacy 2018-05-07 07:10:07 +08:00
Eloy Lafuente (stronk7) 176aacfe93 MDL-61693 core_calendar: make results deterministic for better testing 2018-05-06 18:19:05 +02:00
David Monllao 9063bdf5b1 MDL-62218 analytics: Add missing sample origin checking 2018-05-04 16:38:41 +02:00
Bas Brands 1ed8bd1b2f MDL-62200 Theme boost: popup in popup styles 2018-05-04 14:08:16 +02:00
Frédéric Massart c78bbe369c MDL-61877 core_competency: False negative due to random ordering 2018-05-04 11:18:48 +02:00
Zig Tan baec14ae3a MDL-61693 core_calendar: Simplified get calendar event details SQL 2018-05-04 13:11:21 +08:00
Jake Dallimore 876fd26435 Merge branch 'MDL-61407-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-05-04 11:51:22 +08:00
Andrew Nicols c7c6f2107b Merge branch 'wip-MDL-61937-34' of git://github.com/marinaglancy/moodle into MOODLE_34_STABLE 2018-05-04 11:29:55 +08:00
Jun Pataleta f49cae6e04 Merge branch 'MDL-61877-34' of git://github.com/FMCorz/moodle into MOODLE_34_STABLE 2018-05-04 11:25:37 +08:00
Marina Glancy ba84a6e926 MDL-61937 mod_data: implement privacy provider 2018-05-04 11:16:00 +08:00
Marina Glancy defa163768 MDL-61937 tag: new method in privacy api 2018-05-04 11:15:59 +08:00
Marina Glancy f88ea97b79 MDL-61937 rating: delete method in privacy provider 2018-05-04 11:15:59 +08:00
Marina Glancy 4e71852fbc MDL-61937 comment: do not use API in provider
When exporting comments we can not use comments API because:
- we don't need to call component validate, comments may be disabled right now but
  are still stored
- we don't need to call display callback
- we need to export all comments and not only first 15 of them
2018-05-04 11:15:59 +08:00
Marina Glancy 7e8fc8cc0f MDL-61937 mod_data: generator for all field types 2018-05-04 11:15:59 +08:00
cescobedo 4cd32d3712 MDL-61937 datafield: Add privacy implementation for all datafield 2018-05-04 11:15:58 +08:00
Andrew Nicols a8027ed5cb Merge branch 'MDL-62218-34' of git://github.com/ryanwyllie/moodle into MOODLE_34_STABLE 2018-05-04 11:12:21 +08:00
Ryan Wyllie e5affab8bd MDL-62218 analytics: make privacy test class name more unique 2018-05-04 03:06:31 +00:00
David Monllao 4e262e6b2b MDL-62218 analytics: Privacy API implementation 2018-05-04 03:06:23 +00:00
David Monllao eb5bcca5ad MDL-62218 mlbackend: Null privacy providers for core mlbackends 2018-05-04 03:06:16 +00:00
Mark Nelson 94b01d5304 MDL-61919 core_message: implement privacy provider 2018-05-04 11:03:22 +08:00
Jake Dallimore fcc16c0dd3 Merge branch 'MDL-62046-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-05-04 10:27:44 +08:00
Jake Dallimore 79aac77a26 Merge branch 'MDL-62032-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-05-04 09:57:17 +08:00
Jake Dallimore 3bc60b4f89 Merge branch 'MDL-62030-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-05-04 09:51:53 +08:00
Jake Dallimore 872958acbf Merge branch 'MDL-59845-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-05-04 09:47:39 +08:00
Jake Dallimore b4ff89c851 Merge branch 'MDL-62007-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-05-04 09:22:57 +08:00
Eloy Lafuente (stronk7) e9780ff068 Merge branch 'MDL-62315-34-privacycoreform' of git://github.com/mudrd8mz/moodle into MOODLE_34_STABLE 2018-05-03 23:40:49 +02:00
Eloy Lafuente (stronk7) 640fda0ce5 Merge branch 'MDL-61800-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-05-03 23:28:42 +02:00
David Mudrák 8010382a9c MDL-62315 form: Implement the privacy API for core_form subsystem
Forms subsystem has no own database table. The only personal data is the
user preference 'filemanager_recentviewmode' that stores the view mode
of the file picker element.

It was discussed whether handling of this preference should be added
here into core_form, or rather into core_repository subsystem. The final
decision was to consider the preference as owned by the core_form
because it is affecting the display of a form element, not the
repository backend (even though the strings describing it had been put
into core_repository strings).
2018-05-03 19:06:19 +02:00
Andrew Nicols ce76768382 Merge branch 'MDL-62240-34' of git://github.com/sarjona/moodle into MOODLE_34_STABLE 2018-05-03 19:05:51 +08:00
Jake Dallimore a4efb88ff2 Merge branch 'MDL-62310-34' of git://github.com/cescobedo/moodle into MOODLE_34_STABLE 2018-05-03 18:03:29 +08:00
Jun Pataleta 6d0112902a Merge branch 'MDL-61194-34' of git://git.cameron1729.xyz/moodle into MOODLE_34_STABLE 2018-05-03 17:06:28 +08:00
Cameron Ball 1078a686bd MDL-61194 assignfeedback_editpdf: Check if we can convert online text
This patch adds a check to make sure there is a converter available that
will be able to handle html->pdf conversion before adding onlinetext
submissions to the list of files to combine.
2018-05-03 16:46:32 +08:00
Mihail Geshoski 352fd99b38 MDL-62046 profilefield_textarea: Add privacy files and unit tests 2018-05-03 16:26:42 +08:00
David Monllao 238a285a1b Merge branch 'MDL-61693-34' of git://github.com/zig-moodle/moodle into MOODLE_34_STABLE 2018-05-03 10:24:25 +02:00
Andrew Nicols df14c026bf MDL-61407 privacy: Reset the writer after writer tests
The writer was not reset after these tests which had the potential to
affect the next test after these were run.
2018-05-03 16:14:38 +08:00
Andrew Nicols 2915719cb9 MDL-61407 quizaccess: Add null_writer implementations 2018-05-03 16:14:37 +08:00
Andrew Nicols 9abdeed325 MDL-61407 quiz: Add reports for quiz 2018-05-03 16:14:37 +08:00
Andrew Nicols 52dd3facb5 MDL-61407 qtype: Add null_writer for all qtypes 2018-05-03 16:14:37 +08:00
Andrew Nicols 27aaaf2998 MDL-61407 qformat: Add null_writer for all qformats
Questions formats do not store any personal data.
Any contrib format which does store personal data should utilise the
standard export interfaces as this subsystem will not call them directly.
2018-05-03 16:14:36 +08:00
Andrew Nicols e4fcfbb8f9 MDL-61407 question: Add null_writer for all behaviours
Behaviours do not store any personal data.
Any contrib behaviour which does store personal data should utilise the
standard export interfaces as this subsystem will not call them directly.
2018-05-03 16:14:36 +08:00
Andrew Nicols 4e62b0f999 MDL-61407 mod_quiz: Add initial privacy implementation 2018-05-03 16:14:35 +08:00
Andrew Nicols b09f1d8be9 MDL-61407 question: Add initial privacy implementation 2018-05-03 16:14:35 +08:00
Mihail Geshoski 3bab35e6b1 MDL-62032 profilefield_text: Add privacy files and unit tests 2018-05-03 16:08:55 +08:00
David Monllao 419af6769e Merge branch 'MDL-62059-34' of git://github.com/rezaies/moodle into MOODLE_34_STABLE 2018-05-03 10:08:16 +02:00
Mihail Geshoski 82f8050bb8 MDL-62030 profilefield_menu: Add privacy files and unit tests 2018-05-03 15:52:57 +08:00
Mihail Geshoski 8e8a48cfd9 MDL-62007 profilefield_checkbox: Modify privacy provider 2018-05-03 15:28:28 +08:00
Sara Arjona 4a877f36d2 MDL-62240 privacy: Avoid error when path is higher than allowed
A new method shorten_filenames has been added to moodlelib.
2018-05-03 09:17:05 +02:00
Andrew Nicols 27b956ef56 MDL-62240 file: Add includehash to shorten_filename + unit tests 2018-05-03 09:17:04 +02:00
Mihail Geshoski 5603f19631 MDL-62007 profilefield_datetime: Add privacy files and unit tests 2018-05-03 14:58:28 +08:00
Jun Pataleta 44378db9cf Merge branch 'MDL-61956-34' of https://github.com/lucaboesch/moodle into MOODLE_34_STABLE 2018-05-03 14:43:56 +08:00
Jake Dallimore 83ff8f1eac Merge branch 'MDL-62264-34' of git://github.com/cescobedo/moodle into MOODLE_34_STABLE 2018-05-03 14:06:05 +08:00
Jun Pataleta 31ced1fa3f Merge branch 'MDL-62202-34' of git://github.com/sarjona/moodle into MOODLE_34_STABLE 2018-05-03 13:31:46 +08:00
Andrew Nicols 361fc9a30c Merge branch 'MDL-62009-34' of git://github.com/FMCorz/moodle into MOODLE_34_STABLE 2018-05-03 12:28:24 +08:00
Andrew Nicols 37d4ba0269 Merge branch 'wip-MDL-62312-34' of git://github.com/marinaglancy/moodle into MOODLE_34_STABLE 2018-05-03 11:10:28 +08:00
Jake Dallimore 8d229bfb4c Merge branch 'MDL-62280-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-05-03 10:53:25 +08:00
Marina Glancy 59354457e0 MDL-62312 course: Move core_publish renderer methods to course renderer 2018-05-03 10:09:00 +08:00
Jun Pataleta 276d129e03 Merge branch 'MDL-60414-34' of https://github.com/lucaboesch/moodle into MOODLE_34_STABLE 2018-05-03 09:33:12 +08:00
AMOS bot 639add8bf9 Automatically generated installer lang files 2018-05-03 00:06:30 +00:00
Luca Bösch 7b25853ccb MDL-60414 theme_boost: bootstrap dropdown menu html spec char rendering 2018-05-02 23:02:39 +02:00
Jun Pataleta 111a056d3f MDL-62312 admin: Move moodleorg_registration_message to admin renderer 2018-05-02 23:43:48 +08:00
Andrew Nicols b3753e60fa MDL-61407 question: Allow formatters to ignore caps 2018-05-02 19:10:24 +08:00
Andrew Nicols e9419db48d MDL-61407 privacy: Track changes in any context 2018-05-02 19:10:24 +08:00
cescobedo 6d30a1ded4 MDL-62310 core_admin: Implement Privacy API 2018-05-02 11:58:48 +02:00
Andrew Nicols 9cf2c160dc MDL-62135 tool_log: Use plugintype_class_callback 2018-05-02 17:46:45 +08:00
Andrew Nicols f4603b1e15 Merge branch 'MDL-62135-34' of git://github.com/FMCorz/moodle into MOODLE_34_STABLE 2018-05-02 17:38:23 +08:00
cescobedo 97585a325d MDL-62264 core_mnet: Implement Privacy API 2018-05-02 11:20:20 +02:00
Frédéric Massart fb34d23759 MDL-62135 logstore_legacy: Implement privacy API 2018-05-02 17:18:19 +08:00
Frédéric Massart f46e96bd91 MDL-62135 logstore_database: Implement privacy API 2018-05-02 17:18:19 +08:00
Frédéric Massart 4a62ff444e MDL-62135 logstore_standard: Implement privacy API 2018-05-02 17:18:19 +08:00
Frédéric Massart d3cbf97a2e MDL-62135 tool_log: Implement privacy API 2018-05-02 17:18:19 +08:00
David Mudrák b62eb9310e MDL-61905 workshop: Drop the old 1.x era tables
These tables may still contain relics of old personal data if the site
was installed before Moodle 2.0. We do not need these tables any more.
Following the "privacy by design" principles, we are dropping them now.
2018-05-02 11:15:13 +02:00
Luca Bösch f6ebb57702 MDL-61956 calendar: allow to see hidden course with switch role 2018-05-02 09:37:13 +02:00
Sara Arjona c381d9c18f MDL-62202 privacy: Move Privacy and policies category to Users page 2018-05-02 08:46:01 +02:00
Jun Pataleta 386c5299d8 Merge branch 'MDL-62253-34' of git://github.com/FMCorz/moodle into MOODLE_34_STABLE 2018-05-02 13:53:01 +08:00
Jun Pataleta c96525e2bd Merge branch 'MDL-61898-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-05-02 13:46:40 +08:00
Andrew Nicols 5886b5ef47 MDL-61898 cache: Implement privacy API for all stores and locks 2018-05-02 13:37:29 +08:00
Andrew Nicols 8bde0603d1 MDL-61898 core_cache: Implement Privacy API 2018-05-02 13:37:29 +08:00
Frédéric Massart fcf745c170 MDL-62214 tool_messageinbound: False negative due to time() usage
PHP Unit is so fast that my test couldn't cope with it!
2018-05-02 13:09:55 +08:00
Andrew Nicols bdda38b8b6 Merge branch 'MDL-61920_34' of git://github.com/markn86/moodle into MOODLE_34_STABLE 2018-05-02 13:07:51 +08:00
Andrew Nicols 8048aedf46 Merge branch 'MDL-62266-34' of git://github.com/sarjona/moodle into MOODLE_34_STABLE 2018-05-02 12:34:34 +08:00
Andrew Nicols 057a8fe78b Merge branch 'MDL-62214-34' of git://github.com/FMCorz/moodle into MOODLE_34_STABLE 2018-05-02 12:29:10 +08:00
Andrew Nicols 8b8f1bf85c MDL-61800 task: Reset the OUTPUT and PAGE on execution 2018-05-02 11:58:09 +08:00
Andrew Nicols d5a6324fe1 Merge branch 'MDL-62236-34' of git://github.com/FMCorz/moodle into MOODLE_34_STABLE 2018-05-02 10:54:00 +08:00
Andrew Nicols 2964d00f94 MDL-59845 tool_lp: Add js tracking around UI refresh 2018-05-02 09:16:14 +08:00
Eloy Lafuente (stronk7) 8e5187c0b6 weekly release 3.4.2+ 2018-05-01 23:04:20 +02:00
Eloy Lafuente (stronk7) 04c8c1431b Merge branch 'install_34_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_34_STABLE 2018-05-01 23:04:19 +02:00
Frédéric Massart 61091a5457 MDL-62167 core_badges: Remove usage of a reserved keyword of Oracle 2018-05-01 15:22:33 +02:00
Frédéric Massart b5400f20cb MDL-62167 core_badges: Prevent SQL error with Oracle 2018-05-01 15:22:32 +02:00
Andrew Nicols 5d705cbed4 Merge branch 'wip-MDL-61308-34-testfix' of git://github.com/abgreeve/moodle into MOODLE_34_STABLE 2018-05-01 12:32:49 +02:00
Adrian Greeve 8966bb5b38 MDL-61308 assignsubmission_comments: Unit test ordering fix. 2018-05-01 12:32:39 +02:00
Andrew Nicols 46985532b5 Merge branch 'MDL-62231-34' of git://github.com/rezaies/moodle into MOODLE_34_STABLE 2018-05-01 12:32:28 +02:00
Shamim Rezaie 75dc5bf14b MDL-62231 block_recent_activity: Implement null provider for the block 2018-05-01 14:07:52 +10:00
Andrew Nicols 82c8ef17b0 Merge branch 'wip-MDL-62138-34' of git://github.com/marinaglancy/moodle into MOODLE_34_STABLE 2018-05-01 11:57:41 +08:00
Andrew Nicols aeaf9f0986 Merge branch 'MDL-61411-34' of git://github.com/Kathrin84/moodle into MOODLE_34_STABLE 2018-05-01 11:22:27 +08:00
Andrew Nicols 031f4e28d9 Merge branch 'MDL-62167-34' of git://github.com/FMCorz/moodle into MOODLE_34_STABLE 2018-05-01 11:14:47 +08:00
Andrew Nicols 9bb560cd7c MDL-62280 xhprof: Support tideways_xhprof 2018-05-01 11:03:00 +08:00
Frédéric Massart 269cbdce37 MDL-62009 core_grades: Implement privacy API 2018-05-01 10:50:30 +08:00
Jun Pataleta 998fad0954 Merge branch 'MDL-62060-34' of git://github.com/rezaies/moodle into MOODLE_34_STABLE 2018-05-01 10:44:53 +08:00
Shamim Rezaie 970515e932 MDL-62060 core_privacy: Make sure the exported json is human readable 2018-05-01 12:36:42 +10:00
Frédéric Massart de070d92e1 MDL-62214 tool_messageinbound: Implement privacy API 2018-05-01 09:23:21 +08:00
Frédéric Massart 5555399582 MDL-62214 tool_messageinbound: Delete old messages pending verification 2018-05-01 09:23:20 +08:00
Frédéric Massart bfa32ae5c0 MDL-62253 core_auth: Implement privacy API 2018-05-01 09:15:22 +08:00
Jake Dallimore fc7c30e3f0 Merge branch 'MDL-62005-34' of git://github.com/rezaies/moodle into MOODLE_34_STABLE 2018-05-01 09:10:39 +08:00
AMOS bot fad52c36fd Automatically generated installer lang files 2018-05-01 00:07:04 +00:00
Jun Pataleta 1e3a6e2d32 Merge branch 'MDL-62248-34-fix' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-04-30 21:24:34 +08:00
Andrew Nicols a59a5912ee MDL-62248 core_privacy: Add getter for user context prefs 2018-04-30 20:37:46 +08:00
Mark Nelson 5e8f5cbce3 MDL-61920 mod_lti: implement privacy provider 2018-04-30 18:49:38 +08:00
Mark Nelson 2d390e8b69 MDL-61920 ltiservice_toolsettings: implement privacy provider 2018-04-30 18:49:38 +08:00
Mark Nelson d1c45ed355 MDL-61920 ltiservice_toolproxy: implement privacy provider 2018-04-30 18:49:38 +08:00
Mark Nelson 08fd60f505 MDL-61920 ltiservice_profile: implement privacy provider 2018-04-30 18:49:38 +08:00
Mark Nelson dd95c21a95 MDL-61920 ltiservice_memberships: implement privacy provider 2018-04-30 18:49:38 +08:00
Jun Pataleta dc9888df17 Merge branch 'MDL-61012_v3.4.x' of https://github.com/troywilliams/moodle into MOODLE_34_STABLE 2018-04-30 17:29:04 +08:00
Sara Arjona 636a50044b MDL-62266 core_availability: Implement privacy API 2018-04-30 11:20:55 +02:00
Shamim Rezaie ac2e6921cb MDL-62005 block_comments: Add implementation of Privacy API 2018-04-30 18:20:54 +10:00
Andrew Nicols 2dcc83ac38 MDL-62248 core_privacy: Unit test for get_user_preferences 2018-04-30 16:01:38 +08:00
Andrew Nicols c2f944b022 Merge branch 'MDL-62248-34' of git://github.com/FMCorz/moodle into MOODLE_34_STABLE 2018-04-30 16:01:33 +08:00
Frédéric Massart f47cd85ff6 MDL-62248 core_block: Implement privacy API 2018-04-30 15:30:27 +08:00
Frédéric Massart 1a329e6977 MDL-62248 core_privacy: Test writer writes user prefs in right contexts 2018-04-30 15:30:27 +08:00
Shamim Rezaie 351bfbef06 MDL-62059 mod_book: Implement null provider for mod_book 2018-04-30 16:15:59 +10:00
Andrew Nicols 951c886951 Merge branch 'MDL-62235-34' of git://github.com/FMCorz/moodle into MOODLE_34_STABLE 2018-04-30 14:01:28 +08:00
Frédéric Massart a4c23f2b13 MDL-62235 core_files: Implement privacy API 2018-04-30 13:46:09 +08:00
Andrew Nicols 647c7ec982 Merge branch 'MDL-62208-34' of git://github.com/FMCorz/moodle into MOODLE_34_STABLE 2018-04-30 13:20:40 +08:00
Troy Williams 31ebe1ff67 MDL-61012 course: Allow extending class to set 2018-04-30 16:27:38 +12:00
Andrew Nicols aaf9b0db67 Merge branch 'MDL-62241-34-typehint' of git://github.com/mudrd8mz/moodle into MOODLE_34_STABLE 2018-04-30 11:45:20 +08:00
Andrew Nicols 790a3c60de Merge branch 'MDL-61959-34' of git://github.com/sarjona/moodle into MOODLE_34_STABLE 2018-04-30 10:24:58 +08:00
Andrew Nicols ab58842db9 MDL-61308 mod_assign: Whitespace fix 2018-04-30 09:27:23 +08:00
Andrew Nicols 38c5451942 Merge branch 'wip-MDL-61308-34' of git://github.com/abgreeve/moodle into MOODLE_34_STABLE 2018-04-30 09:19:48 +08:00
AMOS bot 1a3bdfd652 Automatically generated installer lang files 2018-04-30 00:06:29 +00:00
Frédéric Massart 5dcc3bca58 MDL-62236 core_webservice: Implement privacy API 2018-04-29 10:10:40 +08:00
David Mudrák 4e5e4d715b MDL-62241 privacy: Include the unit tests from the 3.3 branch
The tests do not actually do anything, they just make sure that the
method signature is correct on the given PHP version. They are mostly
relevant and useful on 3.3.
2018-04-27 15:23:04 +02:00
Eloy Lafuente (stronk7) 533e41f82e weekly release 3.4.2+ 2018-04-27 13:15:48 +02:00
Eloy Lafuente (stronk7) 24a171c5b9 Merge branch 'install_34_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_34_STABLE 2018-04-27 13:15:41 +02:00
Eloy Lafuente (stronk7) 43be1507a1 MDL-61993 profilefield_checkbox: take rid of oracle reserved word 2018-04-27 10:42:57 +02:00
Frédéric Massart 7c772f449b MDL-61877 core_competency: Handle comments in privacy API 2018-04-27 11:30:30 +08:00
Frédéric Massart 72da93a9ea MDL-61877 core_competency: Implement privacy API 2018-04-27 11:30:30 +08:00
Frédéric Massart 802ab825ed MDL-62167 core_badges: Implement privacy API 2018-04-27 10:51:53 +08:00
Bas Brands 5c8bebc159 MDL-62172 Theme boostrapbase: align advanced checkbox in mform 2018-04-27 09:56:13 +08:00
Eloy Lafuente (stronk7) 1d5d122b27 Merge branch 'MDL-60882-34' of git://github.com/jleyva/moodle into MOODLE_34_STABLE 2018-04-27 01:38:45 +02:00
Eloy Lafuente (stronk7) 242797a9d8 Merge branch 'wip_MDL-62011_34_approval_of_course_request' of https://github.com/grabs/moodle into MOODLE_34_STABLE 2018-04-27 01:30:17 +02:00
Eloy Lafuente (stronk7) 734825bc6d Merge branch 'MDL-61993-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-04-27 01:01:14 +02:00
Eloy Lafuente (stronk7) bd087739c6 Merge branch 'MDL-61863-34' of git://github.com/zig-moodle/moodle into MOODLE_34_STABLE 2018-04-26 22:31:49 +02:00
Eloy Lafuente (stronk7) 28a7c5b677 Merge branch 'MDL-61715-34' of https://github.com/lethevinh/moodle into MOODLE_34_STABLE 2018-04-26 22:23:07 +02:00
Sara Arjona c7b3f78e25 MDL-61959 mod_scorm: Implement privacy API 2018-04-26 19:57:14 +02:00
Sara Arjona ec2474927f MDL-61959 scormreport_objectives: Implement privacy API 2018-04-26 19:57:13 +02:00
sarjona abb19f6cd1 MDL-61959 scormreport_interactions: Implement privacy API 2018-04-26 19:57:13 +02:00
Sara Arjona f95d1bd73a MDL-61959 scormreport_graphs: Implement privacy API 2018-04-26 19:57:13 +02:00
sarjona 3d791f1b6b MDL-61959 scormreport_basic: Implement privacy API 2018-04-26 19:57:12 +02:00
Juan Leyva 82482a0b65 MDL-62229 tool_mobile: Add missing supported module
The Workshop module it’s been supported since Moodle 3.4 so it
should’ve been included here.
2018-04-26 19:18:41 +02:00
Jun Pataleta 3b9f278a95 Merge branch 'MDL-61986_34' of git://github.com/stronk7/moodle into MOODLE_34_STABLE 2018-04-27 00:46:42 +08:00
Eloy Lafuente (stronk7) 6ca9bbd0e8 MDL-61986 mod_lesson: oracle order by clob fix 2018-04-26 18:31:40 +02:00
Eloy Lafuente (stronk7) 8e786a3a30 Merge branch 'MDL-62224_34' of git://github.com/markn86/moodle into MOODLE_34_STABLE 2018-04-26 17:38:35 +02:00
Zig Tan 770045533a MDL-61693 core_calendar: Implemented privacy providers 2018-04-26 21:10:59 +08:00
Mark Nelson d45a552c02 MDL-62224 core_rss: implement correct provider 2018-04-26 20:16:59 +08:00
Kathrin Osswald 276350a9a6 MDL-61411 theme Boost: Close navigation on all items (on small screens) 2018-04-26 13:19:40 +02:00
Juan Leyva ae4963c300 MDL-61521 course: Add missing text formatting for category name 2018-04-26 12:38:10 +02:00
Juan Leyva 27a3313539 MDL-60882 mod_choice: Avoid teacher delete all responses
Teachers should be able to delete all responses but when indicating the
response ids.
When the response ids are not passed, only their own responses should
be deleted (as the function documentation said).
2018-04-26 10:26:50 +02:00
Andrew Nicols 45742c52a4 Merge branch 'MDL-61947-34' of git://github.com/zig-moodle/moodle into MOODLE_34_STABLE 2018-04-26 14:52:36 +08:00
Jun Pataleta 4ab9b1a502 Merge branch 'MDL-62188-34' of git://github.com/sarjona/moodle into MOODLE_34_STABLE 2018-04-26 14:49:44 +08:00
Adrian Greeve fa83660e35 MDL-61308 assign_feedback: Privacy code for user rights. 2018-04-26 14:24:34 +08:00
Adrian Greeve 15c5a72024 MDL-61308 assign_submission: Privacy code for user rights. 2018-04-26 14:24:24 +08:00
Adrian Greeve 63f3fd97b0 MDL-61308 mod_assign: Adding privacy classes. 2018-04-26 14:24:13 +08:00
Sara Arjona 49f37c4573 MDL-62188 enrol: Avoid ignoring the Recover grades default setting 2018-04-26 08:14:08 +02:00
Frédéric Massart 7029b4eff4 MDL-62208 core_fileconverter: Implement privacy API 2018-04-26 12:55:16 +08:00
Zig Tan 730f7da8eb MDL-61947 core_my: Implemented privacy providers 2018-04-26 12:50:55 +08:00
Mihail Geshoski 389fed5720 MDL-61993 profilefield_checkbox: Add privacy files and unit tests 2018-04-26 10:30:25 +08:00
Eloy Lafuente (stronk7) 9967972257 Merge branch 'MDL-61979-34' of git://github.com/zig-moodle/moodle into MOODLE_34_STABLE 2018-04-26 03:09:36 +02:00
Eloy Lafuente (stronk7) 698391ffe4 Merge branch 'MDL-61998-34' of git://github.com/sarjona/moodle into MOODLE_34_STABLE 2018-04-26 02:40:05 +02:00
Andrew Nicols bae1a479aa Merge branch 'MDL-61944-34' of git://github.com/cescobedo/moodle into MOODLE_34_STABLE 2018-04-26 08:35:10 +08:00
Eloy Lafuente (stronk7) 365697c942 Merge branch 'MDL-62181-34-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_34_STABLE 2018-04-25 19:09:46 +02:00
David Monllao a61fab9c50 Merge branch 'MDL-62175-34' of git://github.com/jleyva/moodle into MOODLE_34_STABLE 2018-04-25 17:37:33 +02:00
David Monllao 4fbacc4a5e Merge branch 'MDL-61986-34' of git://github.com/FMCorz/moodle into MOODLE_34_STABLE 2018-04-25 16:32:49 +02:00
cescobedo 0ffb2b4156 MDL-61944 tool_mobile: Implement Privacy API 2018-04-25 15:35:52 +02:00
AMOS bot 9d3b7bb04c Automatically generated installer lang files 2018-04-25 00:06:34 +00:00
David Mudrák b712af05fb MDL-62181 lang: Fix changed admin node title in behat scenario 2018-04-24 22:08:27 +02:00
Helen Foster 7cc490a3dd MDL-62181 lang: Merge English strings from the en_fix language pack
Significant string changes:

* sitepolicies, core_admin - 'Site policies' changed to 'Site security
  settings'
* sitepolicy_help and sitepolicyguest_help, core_admin - setting will
  only have an effect if the site policy handler is set to default
* sitepolicyhandler_desc,core_admin - improved wording
* pathtodot_help, core_admin - Windows and Mac paths
* debugstringids_desc, core_admin - improved explanation
2018-04-24 22:08:27 +02:00
Eloy Lafuente (stronk7) 66df2222f5 weekly release 3.4.2+ 2018-04-24 18:57:22 +02:00
Eloy Lafuente (stronk7) 373a574f62 Merge branch 'install_34_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_34_STABLE 2018-04-24 18:57:20 +02:00
Juan Leyva c15b72b415 MDL-62175 auth_email: Fix site policy enabled check 2018-04-24 15:06:56 +02:00
vinhle b7236f9fdb MDL-61715 question: qbank_chooser is not intelligent about headings 2018-04-24 16:09:49 +07:00
Zig Tan 376212f1b9 MDL-61863 core_notes: Implemented privacy providers 2018-04-24 12:08:07 +08:00
Jun Pataleta b22517e334 Merge branch 'MDL-62079-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-04-24 11:56:10 +08:00
Andrew Nicols 3fd4a77fde MDL-62079 core_filters: Implement null provider 2018-04-24 11:49:04 +08:00
Mark Nelson 26ec8c1b67 MDL-62140 core_privacy: only reset tests when necessary 2018-04-24 11:16:46 +08:00
Frédéric Massart 7a88d29380 MDL-61984 mod_chat: Do not assume context passed is one of chat 2018-04-24 11:04:08 +08:00
Andrew Nicols 3df1711e6d MDL-62140 core_privacy: Improve unit test 2018-04-24 10:19:03 +08:00
Andrew Nicols 14d714b69c Merge branch 'MDL-62140_34' of git://github.com/markn86/moodle into MOODLE_34_STABLE 2018-04-24 10:18:44 +08:00
Jun Pataleta 72c09c0e3f Merge branch 'MDL-61764_34' of git://github.com/markn86/moodle into MOODLE_34_STABLE 2018-04-24 09:54:08 +08:00
Jun Pataleta d52682b09d Merge branch 'MDL-61882-34' of git://github.com/cescobedo/moodle into MOODLE_34_STABLE 2018-04-24 09:38:14 +08:00
Andrew Nicols 61506589a6 Merge branch 'MDL-61984-34' of git://github.com/FMCorz/moodle into MOODLE_34_STABLE 2018-04-24 09:34:44 +08:00
Andrew Nicols b124c934ee Merge branch 'MDL-61995-34' of git://github.com/zig-moodle/moodle into MOODLE_34_STABLE 2018-04-24 08:16:07 +08:00
AMOS bot 65b7b6cac5 Automatically generated installer lang files 2018-04-24 00:06:32 +00:00
cescobedo 52797db36b MDL-61882 auth_oauth2: Implement Privacy API 2018-04-23 17:40:03 +02:00
David Monllao 63869e39b5 Merge branch 'MDL-61915-34' of git://github.com/cescobedo/moodle into MOODLE_34_STABLE 2018-04-23 16:26:18 +02:00
David Monllao 9053adb675 Merge branch 'MDL-62042-m34' of https://github.com/sammarshallou/moodle into MOODLE_34_STABLE 2018-04-23 16:08:13 +02:00
cescobedo d73cb53055 MDL-61915 enrol: Add privacy implementation for all enrol plugins
None of the Enrol plugins (except lti and paypal) have any user preference or database table.
They all implement the null provider.
2018-04-23 14:24:36 +02:00
Mark Nelson 9b6bf24f7f MDL-62140 core_privacy: add helper functions to add system/user context 2018-04-23 20:06:32 +08:00
Andrew Nicols eb8d5f283e Merge branch 'wip-MDL-61759-34' of https://github.com/marinaglancy/moodle into MOODLE_34_STABLE 2018-04-23 18:32:20 +08:00
David Monllao ba2d1550a9 Merge branch 'MDL-62078-34' of git://github.com/sarjona/moodle into MOODLE_34_STABLE 2018-04-23 12:08:58 +02:00
David Monllao ace94710be Merge branch 'MDL-62047-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-04-23 11:59:32 +02:00
David Monllao 75af50bb8d Merge branch 'MDL-61891-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-04-23 11:55:33 +02:00
Sara Arjona 54ccd521a9 MDL-61998 cohort: Implement privacy API 2018-04-23 11:41:31 +02:00
Zig Tan 9a4404e071 MDL-61995 tool_assignmentupgrade: Implemented privacy providers 2018-04-23 16:49:29 +08:00
Marina Glancy afc0076cf2 MDL-61759 admin: non-existing site policy handler means no policy 2018-04-23 16:46:46 +08:00
Andrew Nicols bcefe75402 Merge branch 'MDL-62055-34' of git://github.com/sarjona/moodle into MOODLE_34_STABLE 2018-04-23 16:04:01 +08:00
Jun Pataleta 2e49807d50 Merge branch 'MDL-62049_34' of git://github.com/markn86/moodle into MOODLE_34_STABLE 2018-04-23 13:54:31 +08:00
Marina Glancy dbdae3d343 MDL-62138 core: remove core_register and core_publish
These components have no classes and no strings and have no purspose. Component core_hub is responsible
for storing data, defining classes and strings for site registration and course publishing

This also reverts MDL-61945
2018-04-23 13:21:15 +08:00
Jun Pataleta 06f237aa68 Merge branch 'wip-MDL-61966-34' of git://github.com/abgreeve/moodle into MOODLE_34_STABLE 2018-04-23 13:11:22 +08:00
Mark Nelson 1062a75b04 MDL-62049 core_privacy: use correct lang string for date 2018-04-23 13:03:35 +08:00
Andrew Nicols 84f092a44b MDL-61891 core_portfolio: Use manager method caller 2018-04-23 10:09:13 +08:00
Andrew Nicols 35e39d8b5d MDL-61891 core_plagiarism: Use manager method caller 2018-04-23 10:09:13 +08:00
Andrew Nicols 7fe24b695c MDL-61891 privacy: Add helper to call methods on interfaces 2018-04-23 10:09:13 +08:00
Andrew Nicols a7ffba763d Merge branch 'MDL-61759-34-nonexistinghandler' of git://github.com/mudrd8mz/moodle into MOODLE_34_STABLE 2018-04-22 21:05:55 +08:00
Frédéric Massart 973457da4c MDL-61986 mod_lesson: Implement privacy API 2018-04-22 17:31:30 +08:00
sarjona 8a18c88a60 MDL-62078 rss: Link to core_userkey in the Privacy API implementation 2018-04-22 09:04:53 +02:00
Andreas Grabs ab8eb0a56e MDL-62011 course: Approval of a course request fails 2018-04-21 20:55:46 +02:00
AMOS bot 95368281bc Automatically generated installer lang files 2018-04-21 01:02:39 +00:00
Eloy Lafuente (stronk7) f234880958 weekly release 3.4.2+ 2018-04-20 23:52:15 +02:00
Eloy Lafuente (stronk7) d1387ac765 Merge branch 'install_34_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_34_STABLE 2018-04-20 23:52:13 +02:00
sam marshall 5262ae8faf MDL-62042 core_search: Unicode non-characters cause indexing problems
Unicode characters such as U+FFEF can be entered into Moodle data and
cause indexing failures. This change strips them out of search fields.
2018-04-20 13:17:20 +01:00
Sara Arjona aae70e19ae MDL-62055 imscp: Implement privacy API 2018-04-20 08:58:18 +02:00
Adrian Greeve 19f06a1877 MDL-61966 block_myoverview: Update to provider for user preferences. 2018-04-20 14:52:45 +08:00
Mark Nelson fbf766ba01 MDL-61764 message_popup: implement privacy provider 2018-04-20 12:06:06 +08:00
Jun Pataleta d4db4a869f Merge branch 'MDL-62048_34' of git://github.com/markn86/moodle into MOODLE_34_STABLE 2018-04-20 11:53:29 +08:00
Andrew Nicols 627299b796 Merge branch 'MDL-61892-34' of git://github.com/zig-moodle/moodle into MOODLE_34_STABLE 2018-04-20 11:49:31 +08:00
Zig Tan 6e102f2c6d MDL-61892 admin/tools: Implement null privacy providers 2018-04-20 11:41:58 +08:00
Andrew Nicols fb639d95b5 Merge branch 'wip-MDL-62035-34' of git://github.com/abgreeve/moodle into MOODLE_34_STABLE 2018-04-20 11:33:59 +08:00
Adrian Greeve af90bd0b7e MDL-62035 core_blog: Update to blog with comments.
This makes blog use the updated delete methods in the
comments provider.
2018-04-20 10:46:07 +08:00
Adrian Greeve b598bd2f79 MDL-62035 core_comment: Update to deletion methods.
Also clarification with the export method to clarify that it
is only for one context.
2018-04-20 10:45:56 +08:00
Andrew Nicols c8cf913c76 Merge branch 'MDL-62003-34-privacyfiles' of git://github.com/mudrd8mz/moodle into MOODLE_34_STABLE 2018-04-20 10:34:35 +08:00
Jun Pataleta 88639eefc4 Merge branch 'MDL-61848-34' of git://github.com/cescobedo/moodle into MOODLE_34_STABLE 2018-04-20 09:20:04 +08:00
Eloy Lafuente (stronk7) 444bdb189a Merge branch 'MDL-61836-34-order' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-04-20 03:04:24 +02:00
Andrew Nicols 96f5327b3d MDL-61836 blog: Fix random order failures 2018-04-20 08:49:00 +08:00
Łukasz Szeremeta f505863218 MDL-61827 auth: Change Facebook Graph API v2.8 to v.2.12 in OAuth2
Use v2.12 Facebook Graph API instead of v2.8
2018-04-20 02:33:41 +02:00
Eloy Lafuente (stronk7) f6dc9263f8 Merge branch 'MDL-61836-34-fix' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-04-20 02:28:38 +02:00
Eloy Lafuente (stronk7) 09577f1ec8 Merge branch 'MDL-61991-34' of https://github.com/lucaboesch/moodle into MOODLE_34_STABLE 2018-04-20 02:24:54 +02:00
Andrew Nicols 92b4e5956e MDL-61836 comment: Add missing require 2018-04-20 08:17:46 +08:00
Eloy Lafuente (stronk7) 1de7010e47 Merge branch 'MDL-61975-34' of git://github.com/zig-moodle/moodle into MOODLE_34_STABLE 2018-04-20 02:17:42 +02:00
Eloy Lafuente (stronk7) 7bf7bee56c Merge branch 'MDL-61348-take2_34' of git://github.com/timhunt/moodle into MOODLE_34_STABLE 2018-04-20 02:02:02 +02:00
cescobedo 95bc9fa631 MDL-61848 auth_manual: Implement Privacy API 2018-04-20 00:14:20 +02:00
Andrew Nicols a1656afa41 Merge branch 'MDL-61836-34' of git://github.com/FMCorz/moodle into MOODLE_34_STABLE 2018-04-19 20:36:47 +08:00
Frédéric Massart df77539994 MDL-61836 core_blog: Prevent randomness in comments order 2018-04-19 16:06:06 +08:00
Mark Nelson 04ef818023 MDL-62025 mod_choice: add missing join on modules table 2018-04-19 15:51:07 +08:00
Andrew Nicols 1444ea075e MDL-62047 core_userkey: Add privacy implementation 2018-04-19 15:30:40 +08:00
Andrew Nicols 457f4b7551 MDL-62047 core_userkey: Define component path 2018-04-19 15:30:40 +08:00
Andrew Nicols f02e11d668 Merge branch 'MDL-61568-34' of git://github.com/zig-moodle/moodle into MOODLE_34_STABLE 2018-04-19 15:01:08 +08:00
Andrew Nicols a1eef605f0 Merge branch 'MDL-61970-34' of git://github.com/FMCorz/moodle into MOODLE_34_STABLE 2018-04-19 14:53:23 +08:00
Andrew Nicols fe3ece78ea Merge branch 'MDL-61969-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-04-19 14:48:49 +08:00
Jun Pataleta 8905f55508 Merge branch 'MDL-61878-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-04-19 14:40:03 +08:00
Zig Tan 89feef08e8 MDL-61568 repository_flickr: Fix oauth secret export 2018-04-19 14:37:55 +08:00
Mihail Geshoski 96a257f7a9 MDL-61878 fileconverter_googledrive: Add privacy files and unit tests 2018-04-19 13:17:06 +08:00
Frédéric Massart 45b3665c00 MDL-61970 mod_survey: Do not assume context passed is one of survey 2018-04-19 13:11:43 +08:00
Mark Nelson 509c176f0a MDL-62048 core_privacy: extend test to ensure table exists 2018-04-19 13:03:53 +08:00
Andrew Nicols 8788ad4f14 Merge branch 'MDL-61945-34' of git://github.com/cescobedo/moodle into MOODLE_34_STABLE 2018-04-19 11:55:26 +08:00
Andrew Nicols 64466bd2b8 Merge branch 'MDL-61948-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-04-19 11:47:16 +08:00
Andrew Nicols 1d1baa54f0 Merge branch 'MDL-61836-34' of git://github.com/FMCorz/moodle into MOODLE_34_STABLE 2018-04-19 11:20:15 +08:00
Andrew Nicols 4376919fee Merge branch 'MDL-61970-34' of git://github.com/FMCorz/moodle into MOODLE_34_STABLE 2018-04-19 11:13:15 +08:00
AMOS bot 6de72ccebd Automatically generated installer lang files 2018-04-19 00:06:20 +00:00
David Monllao 5011a166b8 Merge branch 'MDL-61716-34' of git://github.com/mastnym/moodle into MOODLE_34_STABLE 2018-04-18 17:40:21 +02:00
David Monllao 6e6edbe001 MDL-61958 rss: Add rss test suite 2018-04-18 17:38:23 +02:00
David Monllao 6728b43113 Merge branch 'MDL-61958-34' of git://github.com/sarjona/moodle into MOODLE_34_STABLE 2018-04-18 17:22:31 +02:00
David Mudrák 34858987ca MDL-62003 privacy: Fix reported coding style violation 2018-04-18 17:11:10 +02:00
David Mudrák c6f9dce2a0 MDL-62003 privacy: Consistently export files into _files folder
There were two major issues with the previous implementation:

* The exported folder name was localised so it was "Files" or "Soubory"
  etc depending on the current language. Yet URLs referring to the files
  in that folder were always rewritten with hard-coded English "files".
* Files from all fileareas and itemids were all exported to a single
  target directory. So if there were two files with the same name being
  exported from multiple areas (such as submission_content and
  submission_attachment in the workshop module), one would overwrite
  another.

The patch addresses these issues as follows:

* To unify the folder name and also to minimise the risk of conflict
  with a subcontext folder, we now always export stored files under
  "_files" folder.
* Under that folder, there is a subdirectory with the area name and then
  eventually another subdirectory with non-zero itemid. And there
  finally the stored_file is exported to under its own file path.
2018-04-18 17:11:10 +02:00
Martin Mastny 06d3bab902 MDL-61716 auth_oauth2: field names in mappings allow all characters 2018-04-18 16:54:56 +02:00
David Monllao 0eb5643936 Merge branch 'MDL-61796-34' of https://github.com/lucaboesch/moodle into MOODLE_34_STABLE 2018-04-18 15:20:52 +02:00
David Monllao 4d53f252e3 Merge branch 'MDL-38099-34' of https://github.com/lucaboesch/moodle into MOODLE_34_STABLE 2018-04-18 14:14:46 +02:00
Sara Arjona 775a804c68 MDL-61958 core_rss: Implement privacy API 2018-04-18 13:39:21 +02:00
Sara Arjona ac183832bc MDL-61958 rss: Create core_rss lang file and move rss string
At the moment will only be copied one of the rss strings ('rss').
The issue MDL-61997 has been created to move the rest of the core_rss lang
strings from moodle.php to rss.php.

AMOS BEGIN
 CPY [rss,core],[rss,core_rss]
AMOS END
2018-04-18 13:39:21 +02:00
Sara Arjona 9d0f4315f0 MDL-61958 lang: Move privatefilesmanage string to correct place 2018-04-18 13:39:20 +02:00
Eloy Lafuente (stronk7) 524312d1ef Merge branch 'MDL-61621_34' of git://github.com/dmonllao/moodle into MOODLE_34_STABLE 2018-04-18 12:58:27 +02:00
Jun Pataleta 81bd6817b9 Merge branch 'MDL-62025_34' of git://github.com/markn86/moodle into MOODLE_34_STABLE 2018-04-18 16:26:01 +08:00
Jun Pataleta 99b227c604 Merge branch 'MDL-61928_34' of git://github.com/timhunt/moodle into MOODLE_34_STABLE 2018-04-18 16:00:37 +08:00
Mark Nelson ecc63154f9 MDL-62025 mod_choice: only export in the CONTEXT_MODULE context 2018-04-18 15:11:58 +08:00
Frédéric Massart 642389a9a9 MDL-61970 mod_survey: Implement privacy API 2018-04-18 14:56:46 +08:00
Andrew Nicols 8cac59ef84 Merge branch 'MDL-61568-34' of git://github.com/zig-moodle/moodle into MOODLE_34_STABLE 2018-04-18 14:25:25 +08:00
Mihail Geshoski bb9dcb7479 MDL-61969 datapreset_imagegallery: Implement null privacy provider 2018-04-18 13:50:46 +08:00
Zig Tan 3b1e2eb6f4 MDL-61568 core_repository: Implement privacy providers 2018-04-18 13:44:21 +08:00
Mihail Geshoski 1692fae8c0 MDL-61948 core_media: Implement null privacy provider 2018-04-18 13:44:21 +08:00
Zig Tan 7d8b9d454e MDL-61568 repository_onedrive: Implement privacy providers 2018-04-18 13:44:21 +08:00
Zig Tan f4b2263a56 MDL-61568 repository_youtube: Implement privacy providers 2018-04-18 13:44:21 +08:00
Zig Tan db318336de MDL-61568 repository_wikimedia: Implement privacy providers 2018-04-18 13:44:21 +08:00
Zig Tan e072d0eec4 MDL-61568 repository_picasa: Implement privacy providers 2018-04-18 13:44:21 +08:00
Zig Tan 3d8caa7ea5 MDL-61568 repository_merlot: Implement privacy providers 2018-04-18 13:44:21 +08:00
Zig Tan 4984f4bdac MDL-61568 repository_googledocs: Implement privacy providers 2018-04-18 13:44:21 +08:00
Zig Tan b2eccf48da MDL-61568 repository_flickr_public: Implement privacy providers 2018-04-18 13:44:21 +08:00
Zig Tan 98daec96f4 MDL-61568 repository_flickr: Implement privacy providers 2018-04-18 13:44:20 +08:00
Zig Tan b8fb5e361a MDL-61568 repository_dropbox: Implement privacy providers 2018-04-18 13:44:20 +08:00
Zig Tan 4917cc34e7 MDL-61568 repository_boxnet: Implement privacy providers 2018-04-18 13:44:20 +08:00
Zig Tan 66208cc750 MDL-61568 repository_webdav: Implement null privacy provider 2018-04-18 13:44:20 +08:00
Zig Tan 9df4cecb27 MDL-61568 repository_user: Implement null privacy provider 2018-04-18 13:44:20 +08:00
Zig Tan 8338bf6593 MDL-61568 repository_url: Implement null privacy provider 2018-04-18 13:44:20 +08:00
Zig Tan 1c86c7ddc1 MDL-61568 repository_upload: Implement null privacy provider 2018-04-18 13:44:20 +08:00
Zig Tan ec0dae6909 MDL-61568 repository_skydrive: Implement null privacy provider 2018-04-18 13:44:20 +08:00
Zig Tan 9556d7bb2b MDL-61568 repository_s3: Implement null privacy provider 2018-04-18 13:44:20 +08:00
Zig Tan 7eb62206da MDL-61568 repository_recent: Implement null privacy provider 2018-04-18 13:44:19 +08:00
Zig Tan d4b288aa9f MDL-61568 repository_local: Implement null privacy provider 2018-04-18 13:44:19 +08:00
Zig Tan 18b5d648d3 MDL-61568 repository_filesystem: Implement null privacy provider 2018-04-18 13:44:19 +08:00
Zig Tan 7fcec033b0 MDL-61568 repository_equella: Implement null privacy provider 2018-04-18 13:44:19 +08:00
Zig Tan f1e5ab7715 MDL-61568 repository_coursefiles: Implement null privacy provider 2018-04-18 13:44:19 +08:00
Zig Tan ece49dae92 MDL-61568 repository_areafiles: Implement null privacy provider 2018-04-18 13:44:19 +08:00
Jun Pataleta 8e7f7d2e50 Merge branch 'MDL-61520-34' of git://github.com/lameze/moodle into MOODLE_34_STABLE 2018-04-18 13:28:22 +08:00
Andrew Nicols 56909e7f80 Merge branch 'MDL-61957-34' of git://github.com/sarjona/moodle into MOODLE_34_STABLE 2018-04-18 13:09:27 +08:00
Zig Tan 4c58569211 MDL-61979 tool_cohortroles: Implemented privacy providers 2018-04-18 10:50:36 +08:00
Jun Pataleta 3da0292df5 Merge branch 'MDL-61950-34' of git://github.com/ryanwyllie/moodle into MOODLE_34_STABLE 2018-04-18 09:46:48 +08:00
Eloy Lafuente (stronk7) 4663dc19f2 Merge branch 'm34_MDL-59857' of https://github.com/danmarsden/moodle into MOODLE_34_STABLE 2018-04-18 03:07:45 +02:00
AMOS bot 1971a6b958 Automatically generated installer lang files 2018-04-18 00:07:59 +00:00
Luca Bösch 3515c76f92 MDL-61796 themes: In Clean, normalize filter labels font size.
Actually, in every theme not overriding the template.
2018-04-17 22:43:50 +02:00
Luca Bösch fb795d0177 MDL-61991 theme_boost: Question correctness displayed as label. 2018-04-17 22:39:54 +02:00
Luca Bösch 868681e9ba MDL-38099 comments: year in comments date 2018-04-17 22:39:01 +02:00
Eloy Lafuente (stronk7) 9a6b854e5c weekly release 3.4.2+ 2018-04-17 19:54:42 +02:00
Eloy Lafuente (stronk7) 397bd9aa3c Merge branch 'install_34_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_34_STABLE 2018-04-17 19:54:40 +02:00
Sara Arjona 54d35aec03 MDL-61957 gradereport_user: Implement privacy API 2018-04-17 14:34:20 +02:00
Sara Arjona 7b15e26ef7 MDL-61957 gradereport_singleview: Implement privacy API 2018-04-17 14:34:20 +02:00
Sara Arjona c2ea064a30 MDL-61957 gradereport_overview: Implement privacy API 2018-04-17 14:34:20 +02:00
Sara Arjona 7b585ddb84 MDL-61957 gradereport_outcomes: Implement privacy API 2018-04-17 14:34:19 +02:00
Sara Arjona a991d5b9f4 MDL-61957 gradereport_history: Implement privacy API 2018-04-17 14:34:19 +02:00
Sara Arjona 1ab6c6caef MDL-61957 gradereport_grader: Implement privacy API 2018-04-17 14:34:19 +02:00
Frédéric Massart 24abced8a6 MDL-61984 mod_chat: Implement privacy API 2018-04-17 15:34:16 +08:00
Andrew Nicols d2b9bbf551 MDL-61663 phpunit: Add portfolio to the testsuite list 2018-04-17 14:44:43 +08:00
cescobedo 14bdc702a5 MDL-61945 core_register: Implement Privacy API 2018-04-17 08:25:27 +02:00
Frédéric Massart fd8a0e5498 MDL-61862 mod_feedback: Tweak query to support UNION on TEXT fields
Thanks Oracle.
2018-04-17 12:09:51 +08:00
Andrew Nicols ca91ebf33e Merge branch 'wip-MDL-61663-34' of git://github.com/abgreeve/moodle into MOODLE_34_STABLE 2018-04-17 11:46:32 +08:00
Andrew Nicols 8df10e8a28 Merge branch 'MDL-61977-34' of git://github.com/zig-moodle/moodle into MOODLE_34_STABLE 2018-04-17 11:43:07 +08:00
Adrian Greeve 6292041827 MDL-61663 portfolio: Update to the external system link names.
Changed the name of the link to something less like an English
string for each of the portfolios.
2018-04-17 11:41:38 +08:00
Andrew Nicols cc53b1773a Merge branch 'MDL-61980-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-04-17 11:35:01 +08:00
Andrew Nicols 708d156131 Merge branch 'MDL-61916-34' of git://github.com/cescobedo/moodle into MOODLE_34_STABLE 2018-04-17 11:18:43 +08:00
Andrew Nicols 1266d56c57 Merge branch 'MDL-61918-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-04-17 11:12:55 +08:00
Andrew Nicols c4c73a3b44 Merge branch 'MDL-61903-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-04-17 11:10:16 +08:00
Mihail Geshoski 24a051e949 MDL-61903 webservice: Implement null privacy provider
Implement null privacy provider to rest, soap and xmlrpc webservice plugins.
2018-04-17 09:20:35 +08:00
AMOS bot 1fc5fe1ddd Automatically generated installer lang files 2018-04-17 00:07:17 +00:00
Dan Marsden e819de5611 MDL-59857 mod_scorm: use valid length for grade type field. 2018-04-17 08:36:46 +12:00
Jun Pataleta 0cc1957ddd Merge branch 'MDL-61862-34' of git://github.com/FMCorz/moodle into MOODLE_34_STABLE 2018-04-16 23:30:28 +08:00
Eloy Lafuente (stronk7) 953a4575d7 MDL-61819 editor: add testsuite to phpunit.xml 2018-04-16 16:38:35 +02:00
David Monllao ed94efe520 Merge branch 'MDL-61819-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-04-16 16:15:01 +02:00
Andrew Nicols 8c9880c2ba MDL-61819 core_editor: Implement core provider 2018-04-16 21:55:35 +08:00
Andrew Nicols 8f52e5f0da MDL-61819 editor_atto: Implement null provider 2018-04-16 21:55:35 +08:00
Andrew Nicols b4d758c6a7 MDL-61819 editor: Implement editor null providers 2018-04-16 21:55:34 +08:00
Frédéric Massart 0de5067c23 MDL-61862 mod_feedback: Implement core_privacy API 2018-04-16 18:45:56 +08:00
David Monllao 1f52bff88a Merge branch 'MDL-61741-34-paypal' of git://github.com/mudrd8mz/moodle into MOODLE_34_STABLE 2018-04-16 10:58:34 +02:00
David Monllao e0c45f30a8 Merge branch 'wip-MDL-61808-34' of git://github.com/abgreeve/moodle into MOODLE_34_STABLE 2018-04-16 10:03:57 +02:00
Jun Pataleta 6b2ac967a8 Merge branch 'MDL-61708-MOODLE34-lti-fullnamedisplay' of https://github.com/wjroes/moodle into MOODLE_34_STABLE 2018-04-16 15:29:31 +08:00
Jun Pataleta ce1bde9502 Merge branch 'MDL-61974-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-04-16 13:16:54 +08:00
Andrew Nicols 28780bdb62 MDL-61974 privacy: Rewrite the content writer storage 2018-04-16 11:12:37 +08:00
Andrew Nicols 9959542265 Merge branch 'MDL-61952-34' of git://github.com/sarjona/moodle into MOODLE_34_STABLE 2018-04-16 10:51:48 +08:00
Andrew Nicols a7713fd8eb Merge branch 'MDL-61954-34' of git://github.com/sarjona/moodle into MOODLE_34_STABLE 2018-04-16 10:47:02 +08:00
Andrew Nicols bff5ccf474 Merge branch 'MDL-61902-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-04-16 10:21:38 +08:00
Mihail Geshoski 9d1d7caf54 MDL-61918 assignment: Implement null privacy provider
Implement null privacy provider to offline, online, upload and uploadsingle assignment plugins.
2018-04-16 10:02:39 +08:00
Mihail Geshoski ee7c1b3a24 MDL-61902 media: Implement null privacy provider 2018-04-16 09:47:51 +08:00
AMOS bot 8c43f4cc9f Automatically generated installer lang files 2018-04-16 00:07:18 +00:00
Adrian Greeve 496c5f57f6 MDL-61808 tool_monitor: Implemented privacy classes.
This plugin is now compatible with the new privacy system.
2018-04-14 10:50:00 +08:00
AMOS bot 966acf7fc5 Automatically generated installer lang files 2018-04-14 00:08:01 +00:00
Mihail Geshoski 4548bff23b MDL-61980 booktool: Implement null privacy provider
Implement null privacy provider into booktool_exportimscp, booktool_importhtml, booktool_print plugin.
2018-04-13 16:18:23 +08:00
David Mudrák 0c24851679 MDL-61759 admin: Fix notice if attempting use nonexisting policy handler
The list of all known handlers may not contain the configured value,
raising the PHP undefined index notice.
2018-04-13 10:00:33 +02:00
Jake Dallimore f98c0bc576 MDL-61663 portfolio_picasa: add privacy provider implementation 2018-04-13 14:48:54 +08:00
Jake Dallimore fa49cdeb8a MDL-61663 portfolio_googledocs: add privacy provider implementation 2018-04-13 14:48:54 +08:00
Jake Dallimore 634830af0b MDL-61663 portfolio_flickr: add privacy provider implementation 2018-04-13 14:48:54 +08:00
Jake Dallimore 77f4c014b4 MDL-61663 portfolio_download: add privacy provider implementation 2018-04-13 14:48:54 +08:00
Jake Dallimore 3b8e4fb5de MDL-61663 portfolio_boxnet: add privacy provider implementation 2018-04-13 14:48:53 +08:00
Jake Dallimore c321bdd891 MDL-61663 portfolio_mahara: add privacy provider implementation 2018-04-13 14:48:53 +08:00
Jake Dallimore 77430d203d MDL-61663 core_portfolio: add subsystem privacy provider
Added provider for portfolio plugins, and legacy polyfill for plugins.
2018-04-13 14:48:53 +08:00
Zig Tan 69693630a4 MDL-61977 tool_profiling: Implemented null privacy provider 2018-04-13 14:39:09 +08:00
Zig Tan 0e16e180df MDL-61975 tool_recyclebin: Implemented null privacy provider 2018-04-13 14:00:48 +08:00
Frédéric Massart 2cd0309d90 MDL-61836 core_blog: Implement privacy API 2018-04-13 13:30:13 +08:00
AMOS bot 52a844087a Automatically generated installer lang files 2018-04-13 00:07:27 +00:00
David Monllao 109eb1124c weekly release 3.4.2+ 2018-04-12 14:38:25 +02:00
David Monllao 5c1004b8a3 Merge branch 'install_34_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_34_STABLE 2018-04-12 14:38:24 +02:00
Sara Arjona 5309e7f63d MDL-61954 gradeimport_xml: Implement privacy API 2018-04-12 09:54:12 +02:00
Sara Arjona 686e91d5c0 MDL-61954 gradeimport_direct: Implement privacy API 2018-04-12 09:54:12 +02:00
Sara Arjona 1355912aa8 MDL-61954 gradeimport_csv: Implement privacy API 2018-04-12 09:54:12 +02:00
Sara Arjona b9aa614831 MDL-61952 gradeexport_xml: Implement privacy API 2018-04-12 08:41:56 +02:00
Sara Arjona 1e803c595a MDL-61952 gradeexport_xls: Implement privacy API 2018-04-12 08:41:56 +02:00
Sara Arjona c52427e1b8 MDL-61952 gradeexport_txt: Implement privacy API 2018-04-12 08:41:56 +02:00
Sara Arjona 33b62aab65 MDL-61952 gradeexport_ods: Implement privacy API 2018-04-12 08:41:55 +02:00
Ryan Wyllie 0961388a0a MDL-61950 question: include random questions in statistics calculator 2018-04-12 05:39:37 +00:00
nlnrose 92c327fccd MDL-61802 Admin: Corrected typo in test file.
The file privcacy_provider_test.php was supposed to be
privacy_provider_test.php.
2018-04-12 00:23:48 +02:00
Eloy Lafuente (stronk7) fe7fbf24b9 Merge branch 'MDL-61828-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-04-12 00:14:41 +02:00
Eloy Lafuente (stronk7) 2998e41620 Merge branch 'MDL-61895-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-04-11 23:58:02 +02:00
Eloy Lafuente (stronk7) 89e4561e94 Merge branch 'MDL-61896-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-04-11 23:54:55 +02:00
Eloy Lafuente (stronk7) 92c7a3b3c5 Merge branch 'MDL-61859-34' of https://github.com/snake/moodle into MOODLE_34_STABLE 2018-04-11 22:28:46 +02:00
Eloy Lafuente (stronk7) f33ef72a29 Merge branch 'MDL-61743_34' of git://github.com/dmonllao/moodle into MOODLE_34_STABLE 2018-04-11 19:23:22 +02:00
David Monllao db7a1199cf Merge branch 'MDL-61873-34' of git://github.com/cescobedo/moodle into MOODLE_34_STABLE 2018-04-11 18:42:00 +02:00
David Monllao 6a670f942c Merge branch 'MDL-61581-34' of https://github.com/lucaboesch/moodle into MOODLE_34_STABLE 2018-04-11 18:07:56 +02:00
Jake Dallimore 4d5ae78760 Merge branch 'MDL-59691-34' of https://github.com/lucisgit/moodle into MOODLE_34_STABLE 2018-04-11 16:01:26 +08:00
David Monllao 02ca3a12ce MDL-61743 message: Add context level checking 2018-04-11 08:57:51 +02:00
David Monllao fc2238cfec MDL-61743 core_privacy: Add context level checks for all users deletion 2018-04-11 08:57:50 +02:00
Andrew Nicols ab30639634 MDL-61743 core_privacy: Reduce context specificty
Deletion is called for a context against all components, not just
modules.
2018-04-11 08:57:25 +02:00
Simey Lameze 666b12c1e6 MDL-61520 quiz: fix references for xhtml on stats report 2018-04-11 10:49:31 +08:00
Andrew Nicols 53f38ff0d9 Merge branch 'MDL-61881-34' of git://github.com/zig-moodle/moodle into MOODLE_34_STABLE 2018-04-11 10:15:05 +08:00
Zig Tan 4030001cf8 MDL-61881 report: fix privacy lang strings 2018-04-11 10:07:05 +08:00
Zig Tan 184f7d3a85 MDL-61881 report_usersessions: Implement null privacy provider 2018-04-11 10:07:05 +08:00
Zig Tan 7409199411 MDL-61881 report_stats: Implement null privacy provider 2018-04-11 10:07:05 +08:00
Zig Tan bc421d6d46 MDL-61881 report_security: Implement null privacy provider 2018-04-11 10:07:05 +08:00
Zig Tan 850bbe3b97 MDL-61881 report_questioninstances: Implement null privacy provider 2018-04-11 10:07:05 +08:00
Zig Tan e95b8a7c7b MDL-61881 report_performance: Implement null privacy provider 2018-04-11 10:07:05 +08:00
Zig Tan c98c41712d MDL-61881 report_participation: Implement null privacy provider 2018-04-11 10:07:04 +08:00
Zig Tan df5f0c8f93 MDL-61881 report_outline: Implement null privacy provider 2018-04-11 10:07:04 +08:00
Zig Tan b05ffcfc57 MDL-61881 report_loglive: Implement null privacy provider 2018-04-11 10:07:04 +08:00
Zig Tan 7015547371 MDL-61881 report_log: Implement null privacy provider 2018-04-11 10:07:04 +08:00
Zig Tan 70242a8f17 MDL-61881 report_insights: Implement null privacy provider 2018-04-11 10:07:04 +08:00
Zig Tan 6b39e44679 MDL-61881 report_eventlist: Implement null privacy provider 2018-04-11 10:07:04 +08:00
Zig Tan bb49184116 MDL-61881 report_courseoverview: Implement null privacy provider 2018-04-11 10:07:04 +08:00
Zig Tan 07dd873f63 MDL-61881 report_configlog: Implement null privacy provider 2018-04-11 10:07:04 +08:00
Zig Tan 00ab1f6e58 MDL-61881 report_competency: Implement null privacy provider 2018-04-11 10:07:04 +08:00
Zig Tan 8f2e5829ce MDL-61881 report_backup: Implement null privacy provider 2018-04-11 10:07:03 +08:00
Andrew Nicols d564f67b2d Merge branch 'MDL-61731-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-04-11 09:12:28 +08:00
Mihail Geshoski db6aacf45e MDL-61731 message_email: Add privacy files and unit tests 2018-04-11 09:04:48 +08:00
Andrew Nicols b808bf5374 Merge branch 'MDL-61867-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-04-11 08:52:16 +08:00
AMOS bot 2fbd688d8f Automatically generated installer lang files 2018-04-11 00:07:21 +00:00
Eloy Lafuente (stronk7) d39ae0084a Merge branch 'MDL-61824-m34' of https://github.com/sammarshallou/moodle into MOODLE_34_STABLE 2018-04-11 01:07:01 +02:00
Eric Merrill f539686553 MDL-61913 restore: Protect against blocks that aren't being created 2018-04-11 00:52:00 +02:00
Tim Hunt fadee607e9 MDL-61928 formslib: shortforms should work with non-editable forms 2018-04-10 17:40:19 +01:00
Tim Hunt 199b34b5d0 MDL-61348 quiz reports: fix incorrect groups averages
the averages were wrong if a user had mulitple enrolments in a course,
which can happen with some enrolment plugins.
2018-04-10 17:12:04 +01:00
Eloy Lafuente (stronk7) 713a61f712 Merge branch 'wip-MDL-58697-34-assigngrading' of git://github.com/adamann2/moodle into MOODLE_34_STABLE 2018-04-10 15:53:59 +02:00
sam marshall 5a4cd49648 MDL-61824 core_search: Deleting restored context caused error
When restoring content, this adds it to a queue for indexing. If the
restored content was then deleted before the indexing takes place,
this caused an exception in the scheduled task.

This change makes it continue safely past missing contexts.
2018-04-10 13:07:57 +01:00
David Monllao dec44f9d39 Merge branch 'MDL-61838-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-04-10 13:44:36 +02:00
David Monllao 61bb1ebe33 Merge branch 'MDL-61843-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-04-10 13:42:50 +02:00
Eloy Lafuente (stronk7) 933ce256a6 MDL-61875 tests: Use existing component & support $CFG->admin 2018-04-10 13:14:01 +02:00
Eloy Lafuente (stronk7) 70348aa81e Merge branch 'MDL-61875-34' of https://github.com/snake/moodle into MOODLE_34_STABLE 2018-04-10 13:06:30 +02:00
David Monllao 5f1145b4ce Merge branch 'MDL-61846-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-04-10 09:00:08 +02:00
David Monllao 308435acb4 Merge branch 'MDL-61129-fix-accessibility-on-tables-mod_survey_Moodle-34' of https://github.com/guillalva06/moodle into MOODLE_34_STABLE 2018-04-10 07:59:09 +02:00
Andrew Nicols a8c579b4c5 Merge branch 'MDL-61795-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-04-10 10:42:10 +08:00
Mihail Geshoski 321a30e14f MDL-61795 block_rss_client: Add privacy files and unit tests 2018-04-10 09:37:38 +08:00
Jake Dallimore edadfa06cb MDL-61875 core_privacy: update the core_component_list in the manager 2018-04-10 08:51:00 +08:00
Jake Dallimore 21c438f24a MDL-61875 core_component: new method to get full components list 2018-04-10 08:50:58 +08:00
Eloy Lafuente (stronk7) 4d01802d31 Merge branch 'MDL-61860-34' of https://github.com/mackensen/moodle into MOODLE_34_STABLE 2018-04-10 01:01:07 +02:00
Eloy Lafuente (stronk7) 91513c6bd3 Merge branch 'MDL-60196_34' of https://github.com/mfabriczy/moodle into MOODLE_34_STABLE 2018-04-10 00:57:35 +02:00
cescobedo 623acad16b MDL-61916 format: Add privacy implementation for all format plugins
None of the Course format plugins have any user preference or database table.
They all implement the null provider.
2018-04-10 00:24:58 +02:00
Daniel Thies f62a247467 MDL-61476 mod_glossary: Check XML arrays exist 2018-04-09 23:45:58 +02:00
Daniel Thies 8071b5fc9e MDL-61476 mod_glossary: Support tags in entries export 2018-04-09 23:45:38 +02:00
Eloy Lafuente (stronk7) 6d044ed3d9 Merge branch 'MDL-61861-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-04-09 20:28:34 +02:00
Tony Butler 966f659277 MDL-59691 assignfeedback_editpdf: Allow comment placement to all edges
Plus a couple of extra usability improvements:
- Collapse comment during move to allow precise placement
- Change cursor style to indicate that dragging is possible
2018-04-09 16:56:08 +01:00
Tony Butler 00e98f2a8b MDL-59691 assignfeedback_editpdf: Allow comments to collapse to top-left
Forcing them to collapse to the bottom-left corner seems less natural
and effectively changes the location of existing comments from pre-3.3
2018-04-09 16:56:08 +01:00
Guillermo Alvarez ca9f979270 MDL-61129 survey: Add colgroup attribute at survey question tables 2018-04-09 10:32:43 -05:00
Andrew Nicols 6f1680569b Merge branch 'MDL-61829-34' of git://github.com/zig-moodle/moodle into MOODLE_34_STABLE 2018-04-09 15:28:37 +08:00
Andrew Nicols f647b94a75 Merge branch 'MDL-61736-34' of git://github.com/sarjona/moodle into MOODLE_34_STABLE 2018-04-09 15:25:48 +08:00
Sara Arjona b1f50cdf98 MDL-61736 user: Show correct status when enrol method is disabled
When disabling an enrolment method, the user status will be displayed
as "Not current" instead of "Active".
2018-04-09 08:47:12 +02:00
Zig Tan 26109431b5 MDL-61829 block_community: Implement privacy provider 2018-04-09 14:09:27 +08:00
Mihail Geshoski 36506f7354 MDL-61867 fileconverter_unoconv: Add privacy files 2018-04-09 11:44:48 +08:00
Helen Foster 60d78e5a11 MDL-61033 mod_quiz: Update lang string 2018-04-09 10:40:17 +08:00
Andrew Nicols 7569618528 Merge branch 'MDL-61033-34' of https://github.com/nashtechdev01/moodle into MOODLE_34_STABLE 2018-04-09 10:39:34 +08:00
Andrew Nicols f42a899268 MDL-61896 filter: Implement privacy API for all filters 2018-04-08 15:56:14 +08:00
Andrew Nicols 46612109ff MDL-61895 availability: Implement null provider for plugins 2018-04-08 14:22:16 +08:00
Andrew Nicols 5712717383 MDL-61861 privacy: Add unit tests to check all providers. 2018-04-08 14:13:22 +08:00
Andrew Nicols a00bc971d5 MDL-61861 core_tag: Correct langstring identifier 2018-04-08 14:13:22 +08:00
Andrew Nicols ec965d9e00 MDL-61828 core_privacy: Support proper nesting in test trees 2018-04-08 13:35:39 +08:00
Charles Fulton 507867b76d MDL-61860 auth: standardise config inclusion 2018-04-07 12:19:17 -04:00
cescobedo 935d2c9f29 MDL-61873 auth: Add privacy implementation for all auth plugins
None of the Auth plugins (except manual and oauth2) have any user preference or database table.
They all implement the null provider.
2018-04-07 11:26:51 +02:00
Luca Bösch 0023c0254f MDL-61581 lesson: style continue to last buttons 2018-04-06 16:43:00 +02:00
David Monllao 42770ce9a9 MDL-61621 blocks: New API function 2018-04-06 13:13:33 +02:00
Jake Dallimore 810e854153 MDL-61859 core_completion: fix unit tests expecting exceptions twice
We can't expectException twice in the same test, so split this out into
another test.
2018-04-06 17:31:38 +08:00
Mihail Geshoski bc7287eaf5 MDL-61846 dataformat: Add privacy implementation for all plugins 2018-04-06 09:25:53 +08:00
Mihail Geshoski 4dc61ed547 MDL-61843 report_completion: Add privacy files 2018-04-06 09:14:20 +08:00
Mihail Geshoski 2496cd7ffd MDL-61838 report_progress: Add privacy files 2018-04-06 09:00:52 +08:00
Eloy Lafuente (stronk7) 2d8ddc8239 weekly release 3.4.2+ 2018-04-05 15:38:15 +02:00
Eloy Lafuente (stronk7) d7174ce4e2 Merge branch 'install_34_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_34_STABLE 2018-04-05 15:38:12 +02:00
Jake Dallimore 4fe8b57969 Merge branch 'MDL-61761-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-04-05 13:18:30 +08:00
Mihail Geshoski ed7d3f13b6 MDL-61761 message_jabber: Add privacy files and unit tests 2018-04-05 12:01:20 +08:00
Jake Dallimore 55653a2dac Merge branch 'wip-MDL-61163-34' of git://github.com/marinaglancy/moodle into MOODLE_34_STABLE 2018-04-05 10:37:15 +08:00
Andrew Nicols 4fe9879b14 Merge branch 'MDL-60726-34' of git://github.com/zig-moodle/moodle into MOODLE_34_STABLE 2018-04-05 08:39:18 +08:00
Eloy Lafuente (stronk7) 2f6c6c0026 Merge branch 'MDL-61818-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-04-05 00:53:10 +02:00
Rohith 551fa309a0 MDL-61746 PARAM_CLEANHTML: Fix documentation typos 2018-04-05 00:43:34 +02:00
Eloy Lafuente (stronk7) 476380749b Merge branch 'MDL-61673-fix-wrong-string-on-calendar-mustache_Moodle_34' of https://github.com/guillalva06/moodle into MOODLE_34_STABLE 2018-04-05 00:37:39 +02:00
Eloy Lafuente (stronk7) f143f75d91 Merge branch 'MDL-61781-34-fix' of git://github.com/junpataleta/moodle into MOODLE_34_STABLE 2018-04-04 10:51:11 +02:00
Jun Pataleta 4ed6dd031a MDL-61781 admin_settings: Fix default settings value for docroot 2018-04-04 16:48:02 +08:00
Zig Tan f13c851d05 MDL-60726 assign: Fix assign submission confirmation alignment 2018-04-04 16:35:27 +08:00
Andrew Nicols 328c32c3db Merge branch 'MDL-61692-34-2' of https://github.com/snake/moodle into MOODLE_34_STABLE 2018-04-04 13:03:24 +08:00
Andrew Nicols 5a0251179a Merge branch 'wip-MDL-56635-34' of git://github.com/marinaglancy/moodle into MOODLE_34_STABLE 2018-04-04 11:32:22 +08:00
Andrew Nicols 450aa66dcd Merge branch 'MDL-61183-34' of git://github.com/farhan6318/moodle into MOODLE_34_STABLE 2018-04-04 11:02:00 +08:00
Farhan Karmali 2377be335a MDL-61183 user: Added total participants count on paricipants page 2018-04-04 07:59:17 +05:30
Jake Dallimore 9665640c24 MDL-61692 core_privacy: add privacyfields to link_ methods
Some subsystems are like conduits, passing data along to plugins which,
in turn, send the data externally. Only the component linking to (using)
the subsystem will know what data it is sending along to the eventual
external system, so should be able to specify this at the time of
linking. The same goes for plugintypes.
2018-04-04 10:06:04 +08:00
Andrew Nicols bd0ce23402 Merge branch 'MDL-61751-34-fix' of https://github.com/snake/moodle into MOODLE_34_STABLE 2018-04-04 09:11:39 +08:00
Jake Dallimore 82df7d0a4d MDL-61751 core_plagiarism: fix fatal error with privacy legacy polyfill 2018-04-04 08:59:12 +08:00
Eloy Lafuente (stronk7) b3c6973362 Merge branch 'MDL-61451-34' of git://github.com/cescobedo/moodle into MOODLE_34_STABLE 2018-04-04 01:40:45 +02:00
Eloy Lafuente (stronk7) dc43213556 Merge branch 'MDL-61817-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-04-04 01:23:11 +02:00
Eloy Lafuente (stronk7) 5959911fff MDL-61751 core_plagiarism: add testsuite to phpunit.xml 2018-04-04 01:05:40 +02:00
Luca Bösch 90632e0763 MDL-61502 questions: add filter tests to gapselect question type. 2018-04-04 00:56:29 +02:00
Eloy Lafuente (stronk7) 2d621dc0ef Merge branch 'wip-MDL-61522-34' of git://github.com/marinaglancy/moodle into MOODLE_34_STABLE 2018-04-04 00:46:33 +02:00
Eloy Lafuente (stronk7) 9066f3bde6 Merge branch 'MDL-61525-34' of https://github.com/HuongNV13/moodle into MOODLE_34_STABLE 2018-04-04 00:44:40 +02:00
Eloy Lafuente (stronk7) e3529026a0 Merge branch 'MDL-61665-34' of https://github.com/iamandrew/moodle into MOODLE_34_STABLE 2018-04-04 00:39:31 +02:00
Eloy Lafuente (stronk7) 2f56d7d101 Merge branch 'MDL-61703-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-04-04 00:35:12 +02:00
Eloy Lafuente (stronk7) 15a84d14d5 Merge branch 'MDL-61751-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-04-04 00:23:55 +02:00
Eloy Lafuente (stronk7) c184fb81f3 Merge branch 'MDL-61781-34' of https://github.com/lucaboesch/moodle into MOODLE_34_STABLE 2018-04-03 23:46:40 +02:00
Eloy Lafuente (stronk7) 737f272b1e Merge branch 'MDL-61724-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-04-03 23:39:56 +02:00
Eloy Lafuente (stronk7) 89d622013b Merge branch 'MDL-60115-Book-cancel-button-redirect-bug-34' of https://github.com/Moodlers/moodle-1 into MOODLE_34_STABLE 2018-04-03 21:46:27 +02:00
Marcus Fabriczy 44d7ee0937 MDL-60196 core_course: Fix the display of custom LTI icons
Custom LTI icons attached to LTI tools did not display - a regression
caused by MDL-55796.

Change-Id: Ia7e3428755fae4a2b1bc31b3903574061a23ee9b
2018-04-03 20:34:47 +09:30
Jake Dallimore 12440c7f9d Merge branch 'wip-MDL-61815-34' of git://github.com/abgreeve/moodle into MOODLE_34_STABLE 2018-04-03 17:53:39 +08:00
Eloy Lafuente (stronk7) df740a511b MDL-61629 message_airnotifier: whitespace fix 2018-04-03 11:48:51 +02:00
Jake Dallimore 334bea41ec Merge branch 'wip-MDL-61127-34' of git://github.com/abgreeve/moodle into MOODLE_34_STABLE 2018-04-03 17:34:20 +08:00
Adrian Greeve fd3d62ca37 MDL-61127 filepicker: Selected repository now highlighted. 2018-04-03 16:43:21 +08:00
Adrian Greeve 3ad6fc7852 MDL-61127 filepicker: Added aria-selected attribute to repos.
The repository list in the file picker now as aria-selected
added to denote which repository is selected.
2018-04-03 16:43:10 +08:00
Andrew Nicols d61bbb5f37 Merge branch 'wip-MDL-61629-34' of git://github.com/abgreeve/moodle into MOODLE_34_STABLE 2018-04-03 15:59:58 +08:00
Adrian Greeve e4a71a9a96 MDL-61629 message_airnotifier: Add privacy files and unit tests. 2018-04-03 15:29:46 +08:00
Andrew Nicols 51cd6d5f48 Merge branch 'MDL-61020-34' of git://github.com/rezaies/moodle into MOODLE_34_STABLE 2018-04-03 14:21:17 +08:00
Adrian Greeve 34a39ba884 MDL-61815 core_privacy: Fix for metadata types and new method.
Minor fix for subsystem_link and plugintype_link.
Addition of get_null_provider_reason in the manager class.
2018-04-03 13:05:11 +08:00
Eloy Lafuente (stronk7) fe9c70b9b5 Merge branch 'MDL-61689-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-04-03 01:17:26 +02:00
Eloy Lafuente (stronk7) 5d4d21a31a MDL-61223 course: keep some tests using old values (January 1st 1970) 2018-04-03 00:13:28 +02:00
Guillermo Alvarez a564495dcf MDL-61673 calendar: Replace wrong string on mustache template 2018-04-02 10:34:23 -05:00
Eloy Lafuente (stronk7) f070d262a1 MDL-61223 course: amend test setup to keep passing and covering case 2018-04-02 12:03:51 +02:00
Andrew Nicols 12d8c5a611 MDL-61223 course: Set default course start date 2018-04-02 12:03:46 +02:00
Eloy Lafuente (stronk7) 5251a11c59 Merge branch 'MDL-61801-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-04-02 11:04:39 +02:00
Andrew Nicols 522f199222 MDL-61817 tinymce: Add privacy implementation for all plugins
None of the TinyMCE plugins have any user preference or database table.
They all implement the null provider.
2018-04-02 13:51:40 +08:00
Andrew Nicols 1e70bd2b95 MDL-61818 antivirus: Implement core_privacy API 2018-04-02 13:47:45 +08:00
Michael Brown 2830aca413 MDL-60115 mod_book: Book Resource Cancel Button Redirect Bug
When the user creates a book but adds no chapters, hitting cancel on
 the chapter creation page would redirect you right back to the same
 page with no explanation. This solution redirects to the course page
 when canceling chapter creation when no chapters are present.
2018-04-02 04:09:35 +00:00
AMOS bot 8995a77306 Automatically generated installer lang files 2018-04-02 00:07:17 +00:00
Huong Nguyen 97e8019261 MDL-61525 Groups: Index page error on first time visit 2018-04-01 23:01:10 +07:00
Andrew Nicols 658b689b12 MDL-61751 core_privacy: Correct test return 2018-04-01 13:35:14 +08:00
Jake Dallimore 92282f5320 MDL-61751 core_plagiarism: add polyfill for plagiarism provider 2018-04-01 13:35:14 +08:00
AMOS bot 2cfb7f823f Automatically generated installer lang files 2018-03-31 00:07:13 +00:00
Andrew Nicols 8e02d8b3df MDL-61801 core_privacy: Correct bug in unit test provider 2018-03-29 22:45:28 +08:00
Luca Bösch aa096c380d MDL-61781 installation: docs link should have https. 2018-03-29 12:12:45 +02:00
Andrew Nicols cf0e873506 MDL-61703 privacy: Allow writing of user preferences at any context 2018-03-29 15:28:45 +08:00
Jun Pataleta bdceed1023 weekly release 3.4.2+ 2018-03-29 12:55:59 +08:00
Jun Pataleta 53f8de7af4 Merge branch 'install_34_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_34_STABLE 2018-03-29 12:55:58 +08:00
Marina Glancy c30595af59 MDL-61163 mod_wiki: guests should be able to view frontpage modules
When wiki is added to the frontpage and the guest role has capability to view
wiki, users should not be required to log in.
2018-03-29 11:12:30 +08:00
Marina Glancy ec5e497a35 MDL-61163 mod_wiki: add default view capability to frontpage
It is inconsistent that guests are allowed to view frontpage wiki but once user is logged in they
loose this capability
2018-03-29 11:12:30 +08:00
Marina Glancy b800501c76 MDL-61163 mod_wiki: correct capability check in modinfo
Wiki defines capability mod/wiki:viewpage instead of standard mod/wiki:view . This means that people
who do not have capability to view wiki still see it in the modules list.

Also corrected unittest that was testing situation when student has capability to create pages
but does not have capability to view pages. Such student should not see wiki module at all.
2018-03-29 11:12:30 +08:00
dinhloc e2e7f32d6c MDL-61033 quiz: Editing a quiz while a preview is open
Editing a quiz while a preview is open in another browser tab can leads to a cryptic error that is hard to recover from
2018-03-28 13:53:01 +07:00
Jake Dallimore 2cd48e09c7 Merge branch 'MDL-61770-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-03-28 13:36:31 +08:00
Andrew Nicols 0d2a976843 MDL-61770 iplookup: Check types rather than values 2018-03-28 10:58:51 +08:00
Shamim Rezaie bc021bf6c6 MDL-61020 media_videojs: Fix RTL display issues 2018-03-28 13:38:02 +11:00
Eloy Lafuente (stronk7) a2545bad49 Merge branch 'MDL-39060-34' of git://github.com/zig-moodle/moodle into MOODLE_34_STABLE 2018-03-27 13:45:42 +02:00
Ankit Agarwal 62bfa92b7a MDL-51362 libraries: Remove deprecated admin tool unittest 2018-03-27 13:37:39 +02:00
Eloy Lafuente (stronk7) 68842b56d4 Merge branch 'MDL-61321-34' of git://github.com/jleyva/moodle into MOODLE_34_STABLE 2018-03-27 12:45:11 +02:00
Eloy Lafuente (stronk7) 513ac30d0a Merge branch 'MDL-61718-34' of git://github.com/junpataleta/moodle into MOODLE_34_STABLE 2018-03-27 12:40:49 +02:00
Jun Pataleta df5eac853a Merge branch 'MDL-60762-34' of git://github.com/junpataleta/moodle into MOODLE_34_STABLE 2018-03-27 15:47:27 +08:00
Adam Pawełczak edec1e65d2 MDL-60762 tool_usertours: Respect $CFG->admin in manager.php 2018-03-27 15:23:19 +08:00
Jun Pataleta 1b99f0c8a1 Merge branch 'wip-MDL-61328-34' of git://github.com/marinaglancy/moodle into MOODLE_34_STABLE 2018-03-27 13:50:10 +08:00
Jun Pataleta 128f077b68 Merge branch 'MDL-61257-34' of git://github.com/mihailges/moodle into MOODLE_34_STABLE 2018-03-27 12:53:06 +08:00
Jun Pataleta 497d52b407 Merge branch 'MDL-61656_34' of git://github.com/stronk7/moodle into MOODLE_34_STABLE 2018-03-27 12:12:02 +08:00
Eloy Lafuente (stronk7) e58107b258 Merge branch 'MDL-61248_m34' of https://github.com/ak4t0sh/moodle into MOODLE_34_STABLE 2018-03-27 01:42:09 +02:00
Eloy Lafuente (stronk7) f0a2fb7e2f Merge branch 'MDL-61576-34' of git://github.com/cescobedo/moodle into MOODLE_34_STABLE 2018-03-26 23:26:21 +02:00
Matteo Scaramuccia 1edb0f1027 MDL-59596 ddl: Support MariaDB 10.2.4+ SQL_MODE new default value. 2018-03-26 23:16:10 +02:00
Matteo Scaramuccia ad75e8bb15 MDL-59596 ddl: Added has_breaking_change_sqlmode() 2018-03-26 23:15:47 +02:00
Eloy Lafuente (stronk7) d7e920d8dd Merge branch 'MDL-61691-34' of https://github.com/snake/moodle into MOODLE_34_STABLE 2018-03-26 23:15:19 +02:00
Willem Roes 65f957051c MDL-61708 mod_lti: use fullname for lis_person_name_full
Fullname passed on to LTI Provider was in format 'firstname lastname' 
completely ignoring fullnamedisplay settings.
2018-03-26 12:54:52 +02:00
Andrew Nicols 6972d683ef Merge branch 'MDL-55532-34' of git://github.com/lameze/moodle into MOODLE_34_STABLE 2018-03-26 15:36:12 +08:00
Andrew Nicols 60c03cf181 Merge branch 'MDL-61733-34' of https://github.com/MartinGauk/moodle into MOODLE_34_STABLE 2018-03-26 15:02:04 +08:00
Jake Dallimore 0786b8a1c3 MDL-61691 core_plagiarism: fix namespace in privacy provider interface 2018-03-26 12:29:59 +08:00
Mihail Geshoski da769bbc8c MDL-61257 reports: Report logs link to unavailable completion report 2018-03-26 12:24:13 +08:00
Nick Phillips 173b5ea5ac MDL-55532 gradebook: fix grade export to include category names 2018-03-26 11:50:35 +08:00
Mihail Geshoski c5c18d46dc MDL-61724 resource: Unable to view or download file resource 2018-03-26 11:20:07 +08:00
Marina Glancy 8253bba831 MDL-61328 tool_usertours: do not fix tour sortorder after step editing
otherwise it breaks when we try to modify the step sortorder
2018-03-26 09:53:11 +08:00
Zig Tan b65ae316f8 MDL-39060 backup: fix typo backup destroy() function 2018-03-26 09:27:55 +08:00
AMOS bot 31f46d8db2 Automatically generated installer lang files 2018-03-25 00:06:23 +00:00
David Mudrák 72b01c5382 MDL-61741 enrol_paypal: Prevent some edge-case false errors
While testing the plugin in various scenarios, I've noticed that there
are two situations which the current code does not handle quite well:

* Detecting for existing txn_id record was likely to throw "found more
  than one record" debugging message. Fixed by explicitly ignoring
  multiple records.
* The incoming IPN verification message does not always contain the
  recipient's email in the "business" field. When a payment has to be
  claimed manually at PayPal (e.g. as a result of currencies mismatch
  and other settings), the email is coming only in the "receiver_email"
  field. This led to PHP notice and caused the script to fail falsely.
2018-03-23 19:51:13 +01:00
David Mudrák 021be5877a MDL-61741 enrol_paypal: Fix the IPN verification endpoint URL
IPN protocol spec has different URL for sending the verification
request. Better to have it fixed even if the existing value still
seems to work - to avoid unexpected surprise in the future.

Source: https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNImplementation/#specs
2018-03-23 19:44:42 +01:00
Arnaud Trouvé 90feb75113 MDL-61248 admin: fix incorrectly initialized property 2018-03-23 16:24:18 +01:00
Martin Gauk b13a4c68ed MDL-61733 atto_table: fix creating new table
If Atto is embedded in an HTML table (e.g. in the database activity
on the template pages), you could not create a new table.
2018-03-23 09:39:18 +00:00
Eloy Lafuente (stronk7) 70937a4a20 weekly release 3.4.2+ 2018-03-22 16:57:17 +01:00
Eloy Lafuente (stronk7) 3db6e89ccc Merge branch 'install_34_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_34_STABLE 2018-03-22 16:57:15 +01:00
Jun Pataleta 285f957a5b MDL-61718 admin: Make sure city and country columns are not duplicated
* Since City/town and Country have been added in $CFG->showuseridentity
since 3.4, we need to exclude the required city and country columns
when fetching the extra columns using get_extra_user_fields().
2018-03-22 13:53:09 +08:00
Jun Pataleta 98c563e0b7 Merge branch 'MDL-61678_34' of git://github.com/stronk7/moodle into MOODLE_34_STABLE 2018-03-22 12:33:17 +08:00
Jake Dallimore 6894a65f72 Merge branch 'MDL-58179-34-fix' of https://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-03-22 12:06:26 +08:00
Andrew Nicols bfff12f527 MDL-58179 mod_lesson: Add missing : in labels 2018-03-22 12:01:37 +08:00
Andrew Nicols d16e97fdcc Merge branch 'MDL-61530-34' of git://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-03-22 11:49:37 +08:00
Renaat Debleu 389a872baa MDL-61530 mod_glossary: import_entries.feature needs @_file_upload tag 2018-03-22 11:45:11 +08:00
Jun Pataleta 1127f6768d Merge branch 'MDL-52989-34' of git://github.com/junpataleta/moodle into MOODLE_34_STABLE 2018-03-22 11:29:43 +08:00
Jun Pataleta f34b345910 MDL-52989 mod_lesson: Fix typo in feature description 2018-03-22 11:28:39 +08:00
Luca Bösch 17615d90d4 MDL-52989 mod_lesson: Fix cluster_jump returning a cluster page id. 2018-03-22 11:28:39 +08:00
Eloy Lafuente (stronk7) 05866360b7 Merge branch 'MDL-61658-34-allcountrycodes' of git://github.com/mudrd8mz/moodle into MOODLE_34_STABLE 2018-03-21 19:37:55 +01:00
David Mudrák c3ab217820 MDL-61658 user: Fix displaying of user's country name
In these cases we want to use the method get_list_of_countries() to
obtain translated names of all potential country codes. The country code
is already there in the database. So it does not matter if the country
is among those whitelisted in $CFG->allcountrycodes - we want to see its
name anyway.
2018-03-21 18:15:20 +01:00
David Mudrák a3ef4709ae MDL-61658 user: Fix parsing of the agedigitalconsentmap setting
When parsing and validating the value of the Digital age of consent
(agedigitalconsentmap) field, we want to load all country codes. Not
just the ones whitelisted for drop down menus that users can choose
from.
2018-03-21 18:15:19 +01:00
Andrew Nicols 6966cdc45b Merge branch 'MDL-61519-34' of https://github.com/andrewnicols/moodle into MOODLE_34_STABLE 2018-03-21 09:09:59 +08:00
Andrew Nicols 65fa7c7d15 MDL-61519 coursecat: Reset the coursecat cache on enrolment 2018-03-21 09:07:46 +08:00
Andrew Nicols 96cf945c7e Merge branch 'MDL-61519-34' of https://github.com/MartinGauk/moodle into MOODLE_34_STABLE 2018-03-21 09:07:29 +08:00
AMOS bot 47f75d41ab Automatically generated installer lang files 2018-03-21 00:06:11 +00:00
Martin Gauk bede042b12 MDL-61519 coursecat: do not cache get_all_children_ids 2018-03-20 13:13:08 +00:00
Juan Leyva b195c7dc90 MDL-61321 mod_feedback: Return all the items responses
The WS should receive all the item responses for all the attempts.
2018-03-20 10:37:14 +01:00
Andrew Davidson 2988b04705 MDL-61665 calendar: Added missing complete layout call for calendar page 2018-03-20 09:27:17 +00:00
Andrew Nicols 78928a3537 Merge branch 'MDL-61519-34' of https://github.com/MartinGauk/moodle into MOODLE_34_STABLE 2018-03-20 13:56:29 +08:00
Luca Bösch a1b9c05003 MDL-58179 lesson: Avoid using span with class "label" 2018-03-20 13:48:12 +08:00
Andrew Nicols ef86897b46 MDL-61597 calendartype: Implement the privacy API 2018-03-20 02:26:14 +01:00
Andrew Nicols 1886d9df92 MDL-61689 phpunit: Be stricter about output during unit tests
This change also add fail-on-risky to travis to help pick these up, and
verbosity too.

We only fail on risky during Travis and not during normal output because
developers may want to debug tests.
2018-03-20 08:32:27 +08:00
AMOS bot dee930150d Automatically generated installer lang files 2018-03-20 00:06:11 +00:00
AMOS bot 3267f5be8c Automatically generated installer lang files 2018-03-20 00:06:11 +00:00
Andrew Nicols 799b4a2618 Merge branch 'MDL-61265-34' of git://github.com/sarjona/moodle into MOODLE_34_STABLE 2018-03-19 10:51:58 +08:00
Andrew Nicols 794ec9478e Merge branch 'MDL-58179-34' of https://github.com/lucaboesch/moodle into MOODLE_34_STABLE 2018-03-19 10:31:40 +08:00
Andrew Nicols 86d77c31ca Merge branch 'MDL-61154_34' of git://github.com/dmonllao/moodle into MOODLE_34_STABLE 2018-03-19 10:20:16 +08:00
Eloy Lafuente (stronk7) 8b66c45e9d MDL-61678 phpunit: Bump to current / latest 6.5.x before major release 2018-03-18 23:50:21 +01:00
Martin Gauk 72901ac846 MDL-61519 calendar: do not iterate through all categories
Replace calls to \coursecat::get_all() or cache the results.
2018-03-16 14:28:41 +00:00
cescobedo 71aad59120 MDL-61451 message_area: core/auto_rows remove set height to 1px 2018-03-16 13:04:30 +01:00
Sara Arjona 3f476f0c5a MDL-61265 enrol: Add default numsections for external db 2018-03-16 11:33:23 +01:00
cescobedo 5499f63d46 MDL-61576 mod_lti: remove allowinstructorcustom in lib/locallib.php 2018-03-16 10:38:36 +01:00
David Monllao 973108a5c8 MDL-61154 analytics: No escaping for text format url 2018-03-16 09:27:19 +01:00
Luca Bösch 3094f53f1e MDL-58179 lesson: Avoid using span with class "label" 2018-03-16 08:48:11 +01:00
Eloy Lafuente (stronk7) ec33505139 MDL-61656 report_security: fix role name 2018-03-16 02:26:10 +01:00
Marina Glancy 93244439b5 MDL-61522 mod_glossary: use full url in links 2018-02-23 10:56:32 +08:00
Marina Glancy 004e5f9c66 MDL-56635 tags: use recordset since component may not be unique 2018-02-16 09:51:33 +08:00
Ann Adamcik 4c492f8646 MDL-58697: Only get group submission if enabled 2017-12-01 12:53:28 -07:00
1974 changed files with 178161 additions and 10128 deletions
+1
View File
@@ -3,6 +3,7 @@
*/**/build/
node_modules/
vendor/
admin/tool/policy/amd/src/jquery-eu-cookie-law-popup.js
admin/tool/usertours/amd/src/tour.js
admin/tool/usertours/amd/src/popper.js
auth/cas/CAS/
+2
View File
@@ -2,8 +2,10 @@
theme/bootstrapbase/style/
theme/clean/style/custom.css
theme/more/style/custom.css
theme/boost/style/moodle.css
node_modules/
vendor/
admin/tool/policy/amd/src/jquery-eu-cookie-law-popup.js
admin/tool/usertours/amd/src/tour.js
admin/tool/usertours/amd/src/popper.js
auth/cas/CAS/
+4 -2
View File
@@ -56,7 +56,7 @@ matrix:
include:
# Run grunt/npm install on highest version ('node' is an alias for the latest node.js version.)
- php: 7.2
env: DB=none TASK=GRUNT NVM_VERSION='8.9'
env: DB=none TASK=GRUNT NVM_VERSION='lts/carbon'
exclude:
# MySQL - it's just too slow.
@@ -248,7 +248,7 @@ script:
- >
if [ "$TASK" = 'PHPUNIT' ];
then
vendor/bin/phpunit;
vendor/bin/phpunit --fail-on-risky --disallow-test-output --verbose;
fi
- >
@@ -263,7 +263,9 @@ script:
grunt ;
# Add all files to the git index and then run diff --cached to see all changes.
# This ensures that we get the status of all files, including new files.
# We ignore npm-shrinkwrap.json to make the tasks immune to npm changes.
git add . ;
git reset -- npm-shrinkwrap.json ;
git diff --cached --exit-code ;
fi
+2 -1
View File
@@ -214,7 +214,8 @@ module.exports = function(grunt) {
'# Generated by "grunt ignorefiles"',
'theme/bootstrapbase/style/',
'theme/clean/style/custom.css',
'theme/more/style/custom.css'
'theme/more/style/custom.css',
'theme/boost/style/moodle.css'
].concat(thirdPartyPaths);
grunt.file.write('.stylelintignore', stylelintIgnores.join('\n'));
};
+41
View File
@@ -0,0 +1,41 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Privacy Subsystem implementation for core_admin.
*
* @package core_admin
* @copyright 2018 Carlos Escobedo <carlos@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_admin\privacy;
defined('MOODLE_INTERNAL') || die();
/**
* Privacy Subsystem for core_admin implementing null_provider.
*
* @copyright 2018 Carlos Escobedo <carlos@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class provider implements \core_privacy\local\metadata\null_provider {
/**
* Get the language string identifier with the component's language
* file to explain why this plugin stores no data.
*
* @return string
*/
public static function get_reason() : string {
return 'privacy:metadata';
}
}
+1
View File
@@ -73,6 +73,7 @@ foreach ($rs as $user) {
echo "Redeleting user $user->id: $user->username ($user->email)\n";
delete_user($user);
}
$rs->close();
cli_heading('Deleting all leftovers');
+364
View File
@@ -2097,6 +2097,7 @@
<VENDOR name="oracle" version="10.2" />
</DATABASE>
<PHP version="7.0.0" level="required">
<RESTRICT function="restrict_php_version_73" message="unsupportedphpversion73" />
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
@@ -2273,6 +2274,7 @@
<VENDOR name="oracle" version="10.2" />
</DATABASE>
<PHP version="7.0.0" level="required">
<RESTRICT function="restrict_php_version_73" message="unsupportedphpversion73" />
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
@@ -2435,4 +2437,366 @@
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="3.6" requires="3.1">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mariadb" version="5.5.31" />
<VENDOR name="mysql" version="5.6" />
<VENDOR name="postgres" version="9.4" />
<VENDOR name="mssql" version="10.0" />
<VENDOR name="oracle" version="11.2" />
</DATABASE>
<PHP version="7.0.0" level="required">
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
<ON_CHECK message="pcreunicodewarning" />
</FEEDBACK>
</PCREUNICODE>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
<FEEDBACK>
<ON_CHECK message="mbstringrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="required">
<FEEDBACK>
<ON_ERROR message="opensslrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="tokenizer" level="optional">
<FEEDBACK>
<ON_CHECK message="tokenizerrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlrpc" level="optional">
<FEEDBACK>
<ON_CHECK message="xmlrpcrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="soap" level="optional">
<FEEDBACK>
<ON_CHECK message="soaprecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="ctype" level="required">
<FEEDBACK>
<ON_ERROR message="ctyperequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zip" level="required">
<FEEDBACK>
<ON_ERROR message="ziprequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zlib" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="gd" level="required">
<FEEDBACK>
<ON_ERROR message="gdrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="dom" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xml" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlreader" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="intl" level="required">
<FEEDBACK>
<ON_ERROR message="intlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" level="required"/>
<PHP_EXTENSION name="fileinfo" level="required"/>
</PHP_EXTENSIONS>
<PHP_SETTINGS>
<PHP_SETTING name="memory_limit" value="96M" level="required">
<FEEDBACK>
<ON_ERROR message="settingmemorylimit" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="file_uploads" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="settingfileuploads" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="opcache.enable" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="opcacherecommended" />
</FEEDBACK>
</PHP_SETTING>
</PHP_SETTINGS>
<CUSTOM_CHECKS>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_storage_engine" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbstorageengine" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="question/engine/upgrade/upgradelib.php" function="quiz_attempts_upgraded" level="required">
<FEEDBACK>
<ON_ERROR message="quizattemptsupgradedmessage" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_slasharguments" level="optional">
<FEEDBACK>
<ON_CHECK message="slashargumentswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_tables_row_format" level="optional">
<FEEDBACK>
<ON_CHECK message="unsupporteddbtablerowformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_unoconv_version" level="optional">
<FEEDBACK>
<ON_CHECK message="unoconvwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
<FEEDBACK>
<ON_CHECK message="libcurlwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_format" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbfileformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_per_table" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbfilepertable" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_large_prefix" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddblargeprefix" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_is_https" level="optional">
<FEEDBACK>
<ON_CHECK message="ishttpswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_incomplete_unicode_support" level="optional">
<FEEDBACK>
<ON_CHECK message="incompleteunicodesupport" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_sixtyfour_bits" level="optional">
<FEEDBACK>
<ON_CHECK message="sixtyfourbitswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="3.7" requires="3.2">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mariadb" version="5.5.31" />
<VENDOR name="mysql" version="5.6" />
<VENDOR name="postgres" version="9.4" />
<VENDOR name="mssql" version="10.0" />
<VENDOR name="oracle" version="11.2" />
</DATABASE>
<PHP version="7.1.0" level="required">
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
<ON_CHECK message="pcreunicodewarning" />
</FEEDBACK>
</PCREUNICODE>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
<FEEDBACK>
<ON_CHECK message="mbstringrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="required">
<FEEDBACK>
<ON_ERROR message="opensslrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="tokenizer" level="optional">
<FEEDBACK>
<ON_CHECK message="tokenizerrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlrpc" level="optional">
<FEEDBACK>
<ON_CHECK message="xmlrpcrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="soap" level="optional">
<FEEDBACK>
<ON_CHECK message="soaprecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="ctype" level="required">
<FEEDBACK>
<ON_ERROR message="ctyperequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zip" level="required">
<FEEDBACK>
<ON_ERROR message="ziprequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zlib" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="gd" level="required">
<FEEDBACK>
<ON_ERROR message="gdrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="dom" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xml" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlreader" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="intl" level="required">
<FEEDBACK>
<ON_ERROR message="intlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" level="required"/>
<PHP_EXTENSION name="fileinfo" level="required"/>
</PHP_EXTENSIONS>
<PHP_SETTINGS>
<PHP_SETTING name="memory_limit" value="96M" level="required">
<FEEDBACK>
<ON_ERROR message="settingmemorylimit" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="file_uploads" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="settingfileuploads" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="opcache.enable" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="opcacherecommended" />
</FEEDBACK>
</PHP_SETTING>
</PHP_SETTINGS>
<CUSTOM_CHECKS>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_storage_engine" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbstorageengine" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="question/engine/upgrade/upgradelib.php" function="quiz_attempts_upgraded" level="required">
<FEEDBACK>
<ON_ERROR message="quizattemptsupgradedmessage" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_slasharguments" level="optional">
<FEEDBACK>
<ON_CHECK message="slashargumentswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_tables_row_format" level="optional">
<FEEDBACK>
<ON_CHECK message="unsupporteddbtablerowformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_unoconv_version" level="optional">
<FEEDBACK>
<ON_CHECK message="unoconvwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
<FEEDBACK>
<ON_CHECK message="libcurlwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_format" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbfileformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_per_table" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbfilepertable" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_large_prefix" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddblargeprefix" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_is_https" level="optional">
<FEEDBACK>
<ON_CHECK message="ishttpswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_incomplete_unicode_support" level="optional">
<FEEDBACK>
<ON_CHECK message="incompleteunicodesupport" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_sixtyfour_bits" level="optional">
<FEEDBACK>
<ON_CHECK message="sixtyfourbitswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
</COMPATIBILITY_MATRIX>
+4 -3
View File
@@ -40,8 +40,9 @@ if ($unregistration && \core\hub\registration::is_registered()) {
if ($siteunregistrationform->is_cancelled()) {
redirect(new moodle_url('/admin/registration/index.php'));
} else if ($data = $siteunregistrationform->get_data()) {
if (\core\hub\registration::unregister($data->unpublishalladvertisedcourses,
$data->unpublishalluploadedcourses)) {
\core\hub\registration::unregister($data->unpublishalladvertisedcourses,
$data->unpublishalluploadedcourses);
if (!\core\hub\registration::is_registered()) {
redirect(new moodle_url('/admin/registration/index.php'));
}
}
@@ -110,7 +111,7 @@ if (\core\hub\registration::is_registered()) {
echo $OUTPUT->heading(get_string('registerwithmoodleorg', 'admin'));
}
$renderer = $PAGE->get_renderer('core', 'register');
$renderer = $PAGE->get_renderer('core', 'admin');
echo $renderer->moodleorg_registration_message();
$siteregistrationform->display();
-41
View File
@@ -1,41 +0,0 @@
<?php
///////////////////////////////////////////////////////////////////////////
// //
// This file is part of Moodle - http://moodle.org/ //
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
// //
// Moodle is free software: you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation, either version 3 of the License, or //
// (at your option) any later version. //
// //
// Moodle is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. //
// //
///////////////////////////////////////////////////////////////////////////
/**
* Registration renderer.
* @package moodle
* @subpackage registration
* @copyright 2010 Moodle Pty Ltd (http://moodle.com)
* @author Jerome Mouneyrac
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class core_register_renderer extends plugin_renderer_base {
/**
* Display message about the benefits of registering on Moodle.org
*
* @return string
*/
public function moodleorg_registration_message() {
return format_text(get_string('registermoodlenet', 'admin'), FORMAT_HTML, ['noclean' => true]);
}
}
+10 -1
View File
@@ -1990,7 +1990,7 @@ class core_admin_renderer extends plugin_renderer_base {
if (empty($CFG->docroot) or $environment_result->plugin) {
$report = get_string($stringtouse, 'admin', $rec);
} else {
$report = $this->doc_link(join($linkparts, '/'), get_string($stringtouse, 'admin', $rec));
$report = $this->doc_link(join($linkparts, '/'), get_string($stringtouse, 'admin', $rec), true);
}
// Enclose report text in div so feedback text will be displayed underneath it.
$report = html_writer::div($report);
@@ -2084,4 +2084,13 @@ class core_admin_renderer extends plugin_renderer_base {
return $this->warning(get_string('legacylogginginuse'));
}
}
/**
* Display message about the benefits of registering on Moodle.org
*
* @return string
*/
public function moodleorg_registration_message() {
return format_text(get_string('registermoodlenet', 'admin'), FORMAT_HTML, ['noclean' => true]);
}
}
+459
View File
@@ -0,0 +1,459 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Privacy Subsystem implementation for core_role.
*
* @package core_role
* @copyright 2018 Carlos Escobedo <carlos@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_role\privacy;
defined('MOODLE_INTERNAL') || die();
use \core_privacy\local\metadata\collection;
use \core_privacy\local\request\contextlist;
use \core_privacy\local\request\approved_contextlist;
use \core_privacy\local\request\transform;
use \core_privacy\local\request\writer;
use \core_privacy\local\request\userlist;
use \core_privacy\local\request\approved_userlist;
/**
* Privacy provider for core_role.
*
* @copyright 2018 Carlos Escobedo <carlos@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class provider implements
\core_privacy\local\metadata\provider,
\core_privacy\local\request\subsystem\provider,
\core_privacy\local\request\subsystem\plugin_provider,
\core_privacy\local\request\user_preference_provider,
\core_privacy\local\request\core_userlist_provider {
/**
* Get information about the user data stored by this plugin.
*
* @param collection $collection An object for storing metadata.
* @return collection The metadata.
*/
public static function get_metadata(collection $collection) : collection {
$rolecapabilities = [
'roleid' => 'privacy:metadata:role_capabilities:roleid',
'capability' => 'privacy:metadata:role_capabilities:capability',
'permission' => 'privacy:metadata:role_capabilities:permission',
'timemodified' => 'privacy:metadata:role_capabilities:timemodified',
'modifierid' => 'privacy:metadata:role_capabilities:modifierid'
];
$roleassignments = [
'roleid' => 'privacy:metadata:role_assignments:roleid',
'userid' => 'privacy:metadata:role_assignments:userid',
'timemodified' => 'privacy:metadata:role_assignments:timemodified',
'modifierid' => 'privacy:metadata:role_assignments:modifierid',
'component' => 'privacy:metadata:role_assignments:component',
'itemid' => 'privacy:metadata:role_assignments:itemid'
];
$collection->add_database_table('role_capabilities', $rolecapabilities,
'privacy:metadata:role_capabilities:tableexplanation');
$collection->add_database_table('role_assignments', $roleassignments,
'privacy:metadata:role_assignments:tableexplanation');
$collection->add_user_preference('definerole_showadvanced',
'privacy:metadata:preference:showadvanced');
return $collection;
}
/**
* Export all user preferences for the plugin.
*
* @param int $userid The userid of the user whose data is to be exported.
*/
public static function export_user_preferences(int $userid) {
$showadvanced = get_user_preferences('definerole_showadvanced', null, $userid);
if ($showadvanced !== null) {
writer::export_user_preference('core_role',
'definerole_showadvanced',
transform::yesno($showadvanced),
get_string('privacy:metadata:preference:showadvanced', 'core_role')
);
}
}
/**
* Return all contexts for this userid.
*
* @param int $userid The user ID.
* @return contextlist The list of context IDs.
*/
public static function get_contexts_for_userid(int $userid) : contextlist {
global $DB;
$contextlist = new contextlist();
// The role_capabilities table contains user data.
$contexts = [
CONTEXT_SYSTEM,
CONTEXT_USER,
CONTEXT_COURSECAT,
CONTEXT_COURSE,
CONTEXT_MODULE,
CONTEXT_BLOCK
];
list($insql, $inparams) = $DB->get_in_or_equal($contexts, SQL_PARAMS_NAMED);
$sql = "SELECT ctx.id
FROM {context} ctx
JOIN {role_capabilities} rc
ON rc.contextid = ctx.id
AND ((ctx.contextlevel {$insql} AND rc.modifierid = :modifierid)
OR (ctx.contextlevel = :contextlevel AND ctx.instanceid = :userid))";
$params = [
'modifierid' => $userid,
'contextlevel' => CONTEXT_USER,
'userid' => $userid
];
$params += $inparams;
$contextlist->add_from_sql($sql, $params);
// The role_assignments table contains user data.
$contexts = [
CONTEXT_SYSTEM,
CONTEXT_USER,
CONTEXT_COURSECAT,
CONTEXT_COURSE,
CONTEXT_MODULE,
CONTEXT_BLOCK
];
list($insql, $inparams) = $DB->get_in_or_equal($contexts, SQL_PARAMS_NAMED);
$params = [
'userid' => $userid,
'modifierid' => $userid
];
$params += $inparams;
$sql = "SELECT ctx.id
FROM {role_assignments} ra
JOIN {context} ctx
ON ctx.id = ra.contextid
AND ctx.contextlevel {$insql}
WHERE (ra.userid = :userid
OR ra.modifierid = :modifierid)
AND ra.component != 'tool_cohortroles'";
$contextlist->add_from_sql($sql, $params);
return $contextlist;
}
/**
* Get the list of users within a specific context.
*
* @param userlist $userlist The userlist containing the list of users who have data in this context/plugin combination.
*/
public static function get_users_in_context(userlist $userlist) {
if (empty($userlist)) {
return;
}
$context = $userlist->get_context();
// Include users who created or modified role capabilities.
$sql = "SELECT modifierid as userid
FROM {role_capabilities}
WHERE contextid = :contextid";
$params = [
'contextid' => $context->id
];
$userlist->add_from_sql('userid', $sql, $params);
// Include users that have a role assigned to them.
$sql = "SELECT userid
FROM {role_assignments}
WHERE contextid = :contextid";
$userlist->add_from_sql('userid', $sql, $params);
// Include users who created or modified the role assignment.
// Differentiate and exclude special cases where tool_cohortroles adds records through the
// "Assign user roles to cohort" feature into the role_assignments table.
// These records should be separately processed in tool_cohortroles.
$sql = "SELECT modifierid as userid
FROM {role_assignments}
WHERE contextid = :contextid
AND component != 'tool_cohortroles'";
$userlist->add_from_sql('userid', $sql, $params);
}
/**
* Export all user data for the specified user, in the specified contexts.
*
* @param approved_contextlist $contextlist The list of approved contexts for a user.
*/
public static function export_user_data(approved_contextlist $contextlist) {
global $DB;
if (empty($contextlist)) {
return;
}
$rolesnames = self::get_roles_name();
$userid = $contextlist->get_user()->id;
$ctxfields = \context_helper::get_preload_record_columns_sql('ctx');
list($insql, $inparams) = $DB->get_in_or_equal($contextlist->get_contextids(), SQL_PARAMS_NAMED);
// Role Assignments export data.
$contexts = [
CONTEXT_SYSTEM,
CONTEXT_USER,
CONTEXT_COURSECAT,
CONTEXT_COURSE,
CONTEXT_MODULE,
CONTEXT_BLOCK
];
list($inctxsql, $ctxparams) = $DB->get_in_or_equal($contexts, SQL_PARAMS_NAMED);
$sql = "SELECT ra.id, ra.contextid, ra.roleid, ra.userid, ra.timemodified, ra.modifierid, $ctxfields
FROM {role_assignments} ra
JOIN {context} ctx
ON ctx.id = ra.contextid
AND ctx.contextlevel {$inctxsql}
AND (ra.userid = :userid OR ra.modifierid = :modifierid)
AND ra.component != 'tool_cohortroles'
JOIN {role} r
ON r.id = ra.roleid
WHERE ctx.id {$insql}";
$params = ['userid' => $userid, 'modifierid' => $userid];
$params += $inparams;
$params += $ctxparams;
$assignments = $DB->get_recordset_sql($sql, $params);
foreach ($assignments as $assignment) {
\context_helper::preload_from_record($assignment);
$alldata[$assignment->contextid][$rolesnames[$assignment->roleid]][] = (object)[
'timemodified' => transform::datetime($assignment->timemodified),
'userid' => transform::user($assignment->userid),
'modifierid' => transform::user($assignment->modifierid)
];
}
$assignments->close();
if (!empty($alldata)) {
array_walk($alldata, function($roledata, $contextid) {
$context = \context::instance_by_id($contextid);
array_walk($roledata, function($data, $rolename) use ($context) {
writer::with_context($context)->export_data(
[get_string('privacy:metadata:role_assignments', 'core_role'), $rolename],
(object)$data);
});
});
unset($alldata);
}
// Role Capabilities export data.
$strpermissions = self::get_permissions_name();
$contexts = [
CONTEXT_SYSTEM,
CONTEXT_USER,
CONTEXT_COURSECAT,
CONTEXT_COURSE,
CONTEXT_MODULE,
CONTEXT_BLOCK
];
list($inctxsql, $ctxparams) = $DB->get_in_or_equal($contexts, SQL_PARAMS_NAMED);
$sql = "SELECT rc.id, rc.contextid, rc.capability, rc.permission, rc.timemodified, rc.roleid, $ctxfields
FROM {context} ctx
JOIN {role_capabilities} rc
ON rc.contextid = ctx.id
AND ((ctx.contextlevel {$inctxsql} AND rc.modifierid = :modifierid)
OR (ctx.contextlevel = :contextlevel AND ctx.instanceid = :userid))
WHERE ctx.id {$insql}";
$params = [
'modifierid' => $userid,
'contextlevel' => CONTEXT_USER,
'userid' => $userid
];
$params += $inparams;
$params += $ctxparams;
$capabilities = $DB->get_recordset_sql($sql, $params);
foreach ($capabilities as $capability) {
\context_helper::preload_from_record($capability);
$alldata[$capability->contextid][$rolesnames[$capability->roleid]][] = (object)[
'timemodified' => transform::datetime($capability->timemodified),
'capability' => $capability->capability,
'permission' => $strpermissions[$capability->permission]
];
}
$capabilities->close();
if (!empty($alldata)) {
array_walk($alldata, function($capdata, $contextid) {
$context = \context::instance_by_id($contextid);
array_walk($capdata, function($data, $rolename) use ($context) {
writer::with_context($context)->export_data(
[get_string('privacy:metadata:role_capabilities', 'core_role'), $rolename],
(object)$data);
});
});
}
}
/**
* Exports the data relating to tool_cohortroles component on role assignments by
* Assign user roles to cohort feature.
*
* @param int $userid The user ID.
*/
public static function export_user_role_to_cohort(int $userid) {
global $DB;
$rolesnames = self::get_roles_name();
$sql = "SELECT ra.id, ra.contextid, ra.roleid, ra.userid, ra.timemodified, ra.modifierid, r.id as roleid
FROM {role_assignments} ra
JOIN {context} ctx
ON ctx.id = ra.contextid
AND ctx.contextlevel = :contextlevel
AND ra.component = 'tool_cohortroles'
JOIN {role} r
ON r.id = ra.roleid
WHERE ctx.instanceid = :instanceid
OR ra.userid = :userid";
$params = ['userid' => $userid, 'instanceid' => $userid, 'contextlevel' => CONTEXT_USER];
$assignments = $DB->get_recordset_sql($sql, $params);
foreach ($assignments as $assignment) {
$alldata[$assignment->contextid][$rolesnames[$assignment->roleid]][] = (object)[
'timemodified' => transform::datetime($assignment->timemodified),
'userid' => transform::user($assignment->userid),
'modifierid' => transform::user($assignment->modifierid)
];
}
$assignments->close();
if (!empty($alldata)) {
array_walk($alldata, function($roledata, $contextid) {
$context = \context::instance_by_id($contextid);
array_walk($roledata, function($data, $rolename) use ($context) {
writer::with_context($context)->export_related_data(
[get_string('privacy:metadata:role_cohortroles', 'core_role'), $rolename], 'cohortroles',
(object)$data);
});
});
}
}
/**
* Delete all user data for this context.
*
* @param \context $context The context to delete data for.
*/
public static function delete_data_for_all_users_in_context(\context $context) {
global $DB;
// Don't remove data from role_capabilities.
// Because this data affects the whole Moodle, there are override capabilities.
// Don't belong to the modifier user.
// Remove data from role_assignments.
$DB->delete_records('role_assignments', ['contextid' => $context->id]);
}
/**
* Delete multiple users within a single context.
*
* @param approved_userlist $userlist The approved context and user information to delete information for.
*/
public static function delete_data_for_users(approved_userlist $userlist) {
global $DB;
// Don't remove data from role_capabilities.
// Because this data affects the whole Moodle, there are override capabilities.
// Don't belong to the modifier user.
$context = $userlist->get_context();
$userids = $userlist->get_userids();
if (empty($userids)) {
return;
}
list($usersql, $userparams) = $DB->get_in_or_equal($userids, SQL_PARAMS_NAMED);
$params = ['contextid' => $context->id] + $userparams;
// Remove data from role_assignments.
$DB->delete_records_select('role_assignments',
"contextid = :contextid AND userid {$usersql}", $params);
}
/**
* Delete all user data for this user only.
*
* @param approved_contextlist $contextlist The list of approved contexts for a user.
*/
public static function delete_data_for_user(approved_contextlist $contextlist) {
global $DB;
// Don't remove data from role_capabilities.
// Because this data affects the whole Moodle, there are override capabilities.
// Don't belong to the modifier user.
// Remove data from role_assignments.
if (empty($contextlist->count())) {
return;
}
$userid = $contextlist->get_user()->id;
$contextids = $contextlist->get_contextids();
list($contextsql, $contextparams) = $DB->get_in_or_equal($contextids, SQL_PARAMS_NAMED);
$params = ['userid' => $userid] + $contextparams;
// Only delete the roles assignments where the user is assigned in all contexts.
$DB->delete_records_select('role_assignments',
"userid = :userid AND contextid {$contextsql}", $params);
}
/**
* Delete user entries in role_assignments related to the feature
* Assign user roles to cohort feature.
*
* @param int $userid The user ID.
*/
public static function delete_user_role_to_cohort(int $userid) {
global $DB;
// Delete entries where userid is a mentor by tool_cohortroles.
$DB->delete_records('role_assignments', ['userid' => $userid, 'component' => 'tool_cohortroles']);
}
/**
* Get all the localised roles name in a simple array.
*
* @return array Array of name of the roles by roleid.
*/
protected static function get_roles_name() {
$roles = role_fix_names(get_all_roles(), \context_system::instance(), ROLENAME_ORIGINAL);
$rolesnames = array();
foreach ($roles as $role) {
$rolesnames[$role->id] = $role->localname;
}
return $rolesnames;
}
/**
* Get all the permissions name in a simple array.
*
* @return array Array of permissions name.
*/
protected static function get_permissions_name() {
$strpermissions = array(
CAP_INHERIT => get_string('inherit', 'role'),
CAP_ALLOW => get_string('allow', 'role'),
CAP_PREVENT => get_string('prevent', 'role'),
CAP_PROHIBIT => get_string('prohibit', 'role')
);
return $strpermissions;
}
}
+747
View File
@@ -0,0 +1,747 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Privacy test for core_role
*
* @package core_role
* @category test
* @copyright 2018 Carlos Escobedo <carlos@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
use \core_role\privacy\provider;
use \core_privacy\local\request\approved_contextlist;
use \core_privacy\local\request\writer;
use \core_privacy\tests\provider_testcase;
use \core_privacy\local\request\transform;
use \tool_cohortroles\api;
use \core_privacy\local\request\approved_userlist;
/**
* Privacy test for core_role
*
* @copyright 2018 Carlos Escobedo <carlos@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class core_role_privacy_testcase extends provider_testcase {
/**
* Test to check export_user_preferences.
* returns user preferences data.
*/
public function test_export_user_preferences() {
$this->resetAfterTest();
$this->setAdminUser();
$user = $this->getDataGenerator()->create_user();
$this->setUser($user);
$showadvanced = 1;
set_user_preference('definerole_showadvanced', $showadvanced);
provider::export_user_preferences($user->id);
$writer = writer::with_context(\context_system::instance());
$prefs = $writer->get_user_preferences('core_role');
$this->assertEquals(transform::yesno($showadvanced), transform::yesno($prefs->definerole_showadvanced->value));
$this->assertEquals(get_string('privacy:metadata:preference:showadvanced', 'core_role'),
$prefs->definerole_showadvanced->description);
}
/**
* Check all contexts are returned if there is any user data for this user.
*/
public function test_get_contexts_for_userid() {
global $DB;
$this->resetAfterTest();
$this->setAdminUser();
$user = $this->getDataGenerator()->create_user();
$this->assertEmpty(provider::get_contexts_for_userid($user->id));
$user2 = $this->getDataGenerator()->create_user();
$usercontext2 = \context_user::instance($user2->id);
$course = $this->getDataGenerator()->create_course();
$course2 = $this->getDataGenerator()->create_course();
$coursecat = $this->getDataGenerator()->create_category();
$cm = $this->getDataGenerator()->create_module('chat', ['course' => $course->id]);
$cmcontext = \context_module::instance($cm->cmid);
$page = $this->getDataGenerator()->create_module('page', array('course' => $course->id));
$cmcontext2 = \context_module::instance($page->cmid);
$coursecontext = \context_course::instance($course->id);
$coursecontext2 = \context_course::instance($course2->id);
$coursecatcontext = \context_coursecat::instance($coursecat->id);
$systemcontext = \context_system::instance();
$block = $this->getDataGenerator()->create_block('online_users');
$blockcontext = \context_block::instance($block->id);
$student = $DB->get_record('role', array('shortname' => 'student'), '*', MUST_EXIST);
$manager = $DB->get_record('role', array('shortname' => 'manager'), '*', MUST_EXIST);
// Role assignments, where the user is assigned.
role_assign($student->id, $user->id, $cmcontext2->id);
role_assign($student->id, $user->id, $coursecontext2->id);
role_assign($student->id, $user->id, $blockcontext->id);
role_assign($manager->id, $user->id, $usercontext2->id);
// Role assignments, where the user makes assignments.
$this->setUser($user);
role_assign($student->id, $user2->id, $coursecontext->id);
role_assign($manager->id, $user2->id, $coursecatcontext->id);
role_assign($manager->id, $user2->id, $systemcontext->id);
// Role capabilities.
$this->setUser($user);
$result = assign_capability('moodle/backup:backupcourse', CAP_ALLOW, $student->id, $cmcontext->id);
$contextlist = provider::get_contexts_for_userid($user->id)->get_contextids();
$this->assertCount(8, $contextlist);
$this->assertTrue(in_array($cmcontext->id, $contextlist));
}
/**
* Test that user data is exported correctly.
*/
public function test_export_user_data() {
global $DB;
$this->resetAfterTest();
$this->setAdminUser();
$user = $this->getDataGenerator()->create_user();
$user2 = $this->getDataGenerator()->create_user();
$usercontext2 = \context_user::instance($user2->id);
$course = $this->getDataGenerator()->create_course();
$course2 = $this->getDataGenerator()->create_course();
$coursecat = $this->getDataGenerator()->create_category();
$cm = $this->getDataGenerator()->create_module('chat', ['course' => $course->id]);
$cmcontext = \context_module::instance($cm->cmid);
$page = $this->getDataGenerator()->create_module('page', array('course' => $course->id));
$cmcontext2 = \context_module::instance($page->cmid);
$coursecontext = \context_course::instance($course->id);
$coursecontext2 = \context_course::instance($course2->id);
$coursecatcontext = \context_coursecat::instance($coursecat->id);
$systemcontext = \context_system::instance();
$block = $this->getDataGenerator()->create_block('online_users');
$blockcontext = \context_block::instance($block->id);
$student = $DB->get_record('role', array('shortname' => 'student'), '*', MUST_EXIST);
$manager = $DB->get_record('role', array('shortname' => 'manager'), '*', MUST_EXIST);
$rolesnames = self::get_roles_name();
$subcontextstudent = [
get_string('privacy:metadata:role_assignments', 'core_role'),
$rolesnames[$student->id]
];
$subcontextmanager = [
get_string('privacy:metadata:role_assignments', 'core_role'),
$rolesnames[$manager->id]
];
$subcontextrc = [
get_string('privacy:metadata:role_capabilities', 'core_role'),
$rolesnames[$student->id]
];
// Test over role assignments.
// Where the user is assigned.
role_assign($student->id, $user->id, $cmcontext2->id);
role_assign($student->id, $user->id, $coursecontext2->id);
role_assign($student->id, $user->id, $blockcontext->id);
role_assign($manager->id, $user->id, $usercontext2->id);
// Where the user makes assignments.
$this->setUser($user);
role_assign($manager->id, $user2->id, $coursecatcontext->id);
role_assign($manager->id, $user2->id, $systemcontext->id);
// Test overridable roles in module, course, category, user, system and block.
assign_capability('moodle/backup:backupactivity', CAP_ALLOW, $student->id, $cmcontext->id, true);
assign_capability('moodle/backup:backupcourse', CAP_ALLOW, $student->id, $coursecontext->id, true);
assign_capability('moodle/category:manage', CAP_ALLOW, $student->id, $coursecatcontext->id, true);
assign_capability('moodle/backup:backupcourse', CAP_ALLOW, $student->id, $systemcontext->id, true);
assign_capability('moodle/block:edit', CAP_ALLOW, $student->id, $blockcontext->id, true);
assign_capability('moodle/competency:evidencedelete', CAP_ALLOW, $student->id, $usercontext2->id, true);
// Retrieve the user's context ids.
$contextlist = provider::get_contexts_for_userid($user->id);
$approvedcontextlist = new approved_contextlist($user, 'core_role', $contextlist->get_contextids());
$strpermissions = array(
CAP_INHERIT => get_string('inherit', 'role'),
CAP_ALLOW => get_string('allow', 'role'),
CAP_PREVENT => get_string('prevent', 'role'),
CAP_PROHIBIT => get_string('prohibit', 'role')
);
// Retrieve role capabilities and role assignments.
provider::export_user_data($approvedcontextlist);
foreach ($contextlist as $context) {
$writer = writer::with_context($context);
$this->assertTrue($writer->has_any_data());
if ($context->contextlevel == CONTEXT_MODULE) {
if ($data = $writer->get_data($subcontextstudent)) {
$this->assertEquals($user->id, reset($data)->userid);
}
if ($data = $writer->get_data($subcontextrc)) {
$this->assertEquals('moodle/backup:backupactivity', reset($data)->capability);
$this->assertEquals($strpermissions[CAP_ALLOW], reset($data)->permission);
}
}
if ($context->contextlevel == CONTEXT_COURSE) {
if ($data = $writer->get_data($subcontextstudent)) {
$this->assertEquals($user->id, reset($data)->userid);
}
if ($data = $writer->get_data($subcontextrc)) {
$this->assertEquals('moodle/backup:backupcourse', reset($data)->capability);
}
}
if ($context->contextlevel == CONTEXT_COURSECAT) {
if ($data = $writer->get_data($subcontextmanager)) {
$this->assertEquals($user->id, reset($data)->modifierid);
}
if ($data = $writer->get_data($subcontextrc)) {
$this->assertEquals('moodle/category:manage', reset($data)->capability);
}
}
if ($context->contextlevel == CONTEXT_SYSTEM) {
if ($data = $writer->get_data($subcontextmanager)) {
$this->assertEquals($user->id, reset($data)->modifierid);
}
if ($data = $writer->get_data($subcontextrc)) {
$this->assertEquals('moodle/backup:backupcourse', reset($data)->capability);
}
}
if ($context->contextlevel == CONTEXT_BLOCK) {
if ($data = $writer->get_data($subcontextstudent)) {
$this->assertEquals($user->id, reset($data)->userid);
}
if ($data = $writer->get_data($subcontextrc)) {
$this->assertEquals('moodle/block:edit', reset($data)->capability);
}
}
if ($context->contextlevel == CONTEXT_USER) {
if ($data = $writer->get_data($subcontextmanager)) {
$this->assertEquals($user->id, reset($data)->userid);
}
if ($data = $writer->get_data($subcontextrc)) {
$this->assertEquals('moodle/competency:evidencedelete', reset($data)->capability);
}
}
}
}
/**
* Test for provider::delete_data_for_all_users_in_context().
*/
public function test_delete_data_for_all_users_in_context() {
global $DB;
$this->resetAfterTest();
$this->setAdminUser();
$user = $this->getDataGenerator()->create_user();
$user2 = $this->getDataGenerator()->create_user();
$usercontext2 = \context_user::instance($user2->id);
$user3 = $this->getDataGenerator()->create_user();
$course = $this->getDataGenerator()->create_course();
$coursecontext = \context_course::instance($course->id);
$coursecat = $this->getDataGenerator()->create_category();
$coursecatcontext = \context_coursecat::instance($coursecat->id);
$systemcontext = \context_system::instance();
$cm = $this->getDataGenerator()->create_module('chat', ['course' => $course->id]);
$cmcontext = \context_module::instance($cm->cmid);
$student = $DB->get_record('role', array('shortname' => 'student'), '*', MUST_EXIST);
$manager = $DB->get_record('role', array('shortname' => 'manager'), '*', MUST_EXIST);
$block = $this->getDataGenerator()->create_block('online_users');
$blockcontext = \context_block::instance($block->id);
// Role assignments CONTEXT_COURSE.
role_assign($student->id, $user->id, $coursecontext->id);
role_assign($student->id, $user2->id, $coursecontext->id);
role_assign($student->id, $user3->id, $coursecontext->id);
$count = $DB->count_records('role_assignments', ['contextid' => $coursecontext->id]);
$this->assertEquals(3, $count);
// Role assignments CONTEXT_COURSECAT.
role_assign($student->id, $user2->id, $coursecatcontext->id);
role_assign($student->id, $user3->id, $coursecatcontext->id);
$count = $DB->count_records('role_assignments', ['contextid' => $coursecatcontext->id]);
$this->assertEquals(2, $count);
// Role assignments CONTEXT_SYSTEM.
role_assign($student->id, $user->id, $systemcontext->id);
$count = $DB->count_records('role_assignments', ['contextid' => $systemcontext->id]);
$this->assertEquals(1, $count);
// Role assignments CONTEXT_MODULE.
role_assign($student->id, $user->id, $cmcontext->id);
$count = $DB->count_records('role_assignments', ['contextid' => $cmcontext->id]);
$this->assertEquals(1, $count);
// Role assigments CONTEXT_BLOCK.
role_assign($student->id, $user->id, $blockcontext->id);
$count = $DB->count_records('role_assignments', ['contextid' => $blockcontext->id]);
$this->assertEquals(1, $count);
// Role assigments CONTEXT_USER.
role_assign($manager->id, $user->id, $usercontext2->id);
$count = $DB->count_records('role_assignments', ['contextid' => $usercontext2->id]);
$this->assertEquals(1, $count);
// Delete data based on CONTEXT_COURSE context.
provider::delete_data_for_all_users_in_context($coursecontext);
// After deletion, the role_assignments entries for this context should have been deleted.
$count = $DB->count_records('role_assignments', ['contextid' => $coursecontext->id]);
$this->assertEquals(0, $count);
// Check it is not removing data on other contexts.
$count = $DB->count_records('role_assignments', ['contextid' => $coursecatcontext->id]);
$this->assertEquals(2, $count);
$count = $DB->count_records('role_assignments', ['contextid' => $systemcontext->id]);
$this->assertEquals(1, $count);
$count = $DB->count_records('role_assignments', ['contextid' => $cmcontext->id]);
$this->assertEquals(1, $count);
// Delete data based on CONTEXT_COURSECAT context.
provider::delete_data_for_all_users_in_context($coursecatcontext);
// After deletion, the role_assignments entries for this context should have been deleted.
$count = $DB->count_records('role_assignments', ['contextid' => $coursecatcontext->id]);
$this->assertEquals(0, $count);
// Delete data based on CONTEXT_SYSTEM context.
provider::delete_data_for_all_users_in_context($systemcontext);
// After deletion, the role_assignments entries for this context should have been deleted.
$count = $DB->count_records('role_assignments', ['contextid' => $systemcontext->id]);
$this->assertEquals(0, $count);
// Delete data based on CONTEXT_MODULE context.
provider::delete_data_for_all_users_in_context($cmcontext);
// After deletion, the role_assignments entries for this context should have been deleted.
$count = $DB->count_records('role_assignments', ['contextid' => $cmcontext->id]);
$this->assertEquals(0, $count);
// Delete data based on CONTEXT_BLOCK context.
provider::delete_data_for_all_users_in_context($usercontext2);
// After deletion, the role_assignments entries for this context should have been deleted.
$count = $DB->count_records('role_assignments', ['contextid' => $usercontext2->id]);
$this->assertEquals(0, $count);
}
/**
* Test for provider::delete_data_for_user().
*/
public function test_delete_data_for_user() {
global $DB;
$this->resetAfterTest();
$this->setAdminUser();
$user = $this->getDataGenerator()->create_user();
$user2 = $this->getDataGenerator()->create_user();
$usercontext2 = \context_user::instance($user2->id);
$user3 = $this->getDataGenerator()->create_user();
$usercontext3 = \context_user::instance($user3->id);
$course = $this->getDataGenerator()->create_course();
$course2 = $this->getDataGenerator()->create_course();
$course3 = $this->getDataGenerator()->create_course();
$coursecontext = \context_course::instance($course->id);
$coursecontext2 = \context_course::instance($course2->id);
$coursecontext3 = \context_course::instance($course3->id);
$coursecat = $this->getDataGenerator()->create_category();
$coursecatcontext = \context_coursecat::instance($coursecat->id);
$systemcontext = \context_system::instance();
$cm = $this->getDataGenerator()->create_module('chat', ['course' => $course->id]);
$cmcontext = \context_module::instance($cm->cmid);
$student = $DB->get_record('role', array('shortname' => 'student'), '*', MUST_EXIST);
$manager = $DB->get_record('role', array('shortname' => 'manager'), '*', MUST_EXIST);
$block = $this->getDataGenerator()->create_block('online_users');
$blockcontext = \context_block::instance($block->id);
// Role assignments, Where the user is assigned.
role_assign($student->id, $user->id, $coursecontext->id);
role_assign($student->id, $user->id, $coursecontext2->id);
role_assign($student->id, $user->id, $coursecatcontext->id);
role_assign($student->id, $user->id, $cmcontext->id);
role_assign($student->id, $user->id, $systemcontext->id);
role_assign($student->id, $user->id, $blockcontext->id);
role_assign($manager->id, $user->id, $usercontext2->id);
role_assign($manager->id, $user->id, $usercontext3->id);
$count = $DB->count_records('role_assignments', ['userid' => $user->id]);
$this->assertEquals(8, $count);
// Role assignments, where the user makes assignments.
$this->setUser($user);
role_assign($student->id, $user2->id, $coursecontext3->id);
role_assign($student->id, $user3->id, $coursecontext3->id);
$count = $DB->count_records('role_assignments', ['modifierid' => $user->id]);
$this->assertEquals(2, $count);
$contextlist = provider::get_contexts_for_userid($user->id);
$approvedcontextlist = new approved_contextlist($user, 'core_role', $contextlist->get_contextids());
provider::delete_data_for_user($approvedcontextlist);
// After deletion, the role_assignments assigned to the user should have been deleted.
$count = $DB->count_records('role_assignments', ['userid' => $user->id]);
$this->assertEquals(0, $count);
// After deletion, the role_assignments assigned by the user should not have been deleted.
$count = $DB->count_records('role_assignments', ['modifierid' => $user->id]);
$this->assertEquals(2, $count);
}
/**
* Export for a user with a key against a script where no instance is specified.
*/
public function test_export_user_role_to_cohort() {
global $DB;
$this->resetAfterTest();
$this->setAdminUser();
// Assign user roles to cohort.
$user = $this->getDataGenerator()->create_user();
$contextuser = \context_user::instance($user->id);
$teacher = $DB->get_record('role', array('shortname' => 'teacher'), '*', MUST_EXIST);
$cohort = $this->getDataGenerator()->create_cohort();
$userassignover = $this->getDataGenerator()->create_user();
$contextuserassignover = \context_user::instance($userassignover->id);
cohort_add_member($cohort->id, $userassignover->id);
$this->setAdminUser();
$params = (object) array(
'userid' => $user->id,
'roleid' => $teacher->id,
'cohortid' => $cohort->id
);
api::create_cohort_role_assignment($params);
api::sync_all_cohort_roles();
$rolesnames = self::get_roles_name();
$subcontextteacher = [
get_string('privacy:metadata:role_cohortroles', 'core_role'),
$rolesnames[$teacher->id]
];
// Test User is assigned role teacher to cohort.
provider::export_user_role_to_cohort($user->id);
$writer = writer::with_context($contextuserassignover);
$this->assertTrue($writer->has_any_data());
$exported = $writer->get_related_data($subcontextteacher, 'cohortroles');
$this->assertEquals($user->id, reset($exported)->userid);
// Test User is member of a cohort which User2 is assigned to role to this cohort.
$user2 = $this->getDataGenerator()->create_user();
$cohort2 = $this->getDataGenerator()->create_cohort();
cohort_add_member($cohort2->id, $user->id);
$params = (object) array(
'userid' => $user2->id,
'roleid' => $teacher->id,
'cohortid' => $cohort2->id
);
api::create_cohort_role_assignment($params);
api::sync_all_cohort_roles();
provider::export_user_role_to_cohort($user->id);
$writer = writer::with_context($contextuser);
$this->assertTrue($writer->has_any_data());
$exported = $writer->get_related_data($subcontextteacher, 'cohortroles');
$this->assertEquals($user2->id, reset($exported)->userid);
}
/**
* Test for provider::delete_user_role_to_cohort().
*/
public function test_delete_user_role_to_cohort() {
global $DB;
$this->resetAfterTest();
$this->setAdminUser();
// Assign user roles to cohort.
$user = $this->getDataGenerator()->create_user();
$user2 = $this->getDataGenerator()->create_user();
$user3 = $this->getDataGenerator()->create_user();
$user4 = $this->getDataGenerator()->create_user();
$teacher = $DB->get_record('role', array('shortname' => 'teacher'), '*', MUST_EXIST);
$cohort = $this->getDataGenerator()->create_cohort();
cohort_add_member($cohort->id, $user2->id);
cohort_add_member($cohort->id, $user3->id);
cohort_add_member($cohort->id, $user4->id);
$this->setAdminUser();
$params = (object) array(
'userid' => $user->id,
'roleid' => $teacher->id,
'cohortid' => $cohort->id
);
api::create_cohort_role_assignment($params);
api::sync_all_cohort_roles();
$count = $DB->count_records('role_assignments', ['userid' => $user->id, 'component' => 'tool_cohortroles']);
$this->assertEquals(3, $count);
provider::delete_user_role_to_cohort($user->id);
$count = $DB->count_records('role_assignments', ['userid' => $user->id, 'component' => 'tool_cohortroles']);
$this->assertEquals(0, $count);
}
/**
* Test that only users within a course context are fetched.
*/
public function test_get_users_in_context() {
global $DB;
$this->resetAfterTest();
$component = 'core_role';
$this->setAdminUser();
$admin = \core_user::get_user_by_username('admin');
// Create user1.
$user1 = $this->getDataGenerator()->create_user();
$usercontext1 = \context_user::instance($user1->id);
// Create user2.
$user2 = $this->getDataGenerator()->create_user();
$usercontext2 = \context_user::instance($user2->id);
// Create course1.
$course1 = $this->getDataGenerator()->create_course();
$coursecontext1 = \context_course::instance($course1->id);
// Create course category.
$coursecat = $this->getDataGenerator()->create_category();
$coursecatcontext = \context_coursecat::instance($coursecat->id);
// Create chat module.
$cm = $this->getDataGenerator()->create_module('chat', ['course' => $course1->id]);
$cmcontext = \context_module::instance($cm->cmid);
$systemcontext = \context_system::instance();
// Create a block.
$block = $this->getDataGenerator()->create_block('online_users');
$blockcontext = \context_block::instance($block->id);
$studentrole = $DB->get_record('role', array('shortname' => 'student'), '*', MUST_EXIST);
$managerrole = $DB->get_record('role', array('shortname' => 'manager'), '*', MUST_EXIST);
// Role assignments CONTEXT_COURSE.
role_assign($studentrole->id, $user1->id, $coursecontext1->id);
role_assign($studentrole->id, $user2->id, $coursecontext1->id);
// Role assignments CONTEXT_COURSECAT.
role_assign($studentrole->id, $user2->id, $coursecatcontext->id);
// Role assignments CONTEXT_SYSTEM.
role_assign($studentrole->id, $user1->id, $systemcontext->id);
// Role assignments CONTEXT_MODULE.
role_assign($studentrole->id, $user2->id, $cmcontext->id);
// Role assigments CONTEXT_BLOCK.
role_assign($studentrole->id, $user1->id, $blockcontext->id);
// Role assigments CONTEXT_USER.
role_assign($managerrole->id, $user1->id, $usercontext2->id);
// Role capabilities.
$this->setUser($user1);
assign_capability('moodle/backup:backupcourse', CAP_ALLOW, $studentrole->id, $cmcontext->id);
// The user list for usercontext1 should not return any users.
$userlist1 = new \core_privacy\local\request\userlist($usercontext1, $component);
provider::get_users_in_context($userlist1);
$this->assertCount(0, $userlist1);
// The user list for usercontext2 should user1 and admin (role creator).
$userlist2 = new \core_privacy\local\request\userlist($usercontext2, $component);
provider::get_users_in_context($userlist2);
$this->assertCount(2, $userlist2);
$expected = [
$user1->id,
$admin->id
];
$this->assertEquals($expected, $userlist2->get_userids(), '', 0.0, 10, true);
// The user list for coursecontext1 should user1, user2 and admin (role creator).
$userlist3 = new \core_privacy\local\request\userlist($coursecontext1, $component);
provider::get_users_in_context($userlist3);
$this->assertCount(3, $userlist3);
$expected = [
$user1->id,
$user2->id,
$admin->id
];
$this->assertEquals($expected, $userlist3->get_userids(), '', 0.0, 10, true);
// The user list for coursecatcontext should user2 and admin (role creator).
$userlist4 = new \core_privacy\local\request\userlist($coursecatcontext, $component);
provider::get_users_in_context($userlist4);
$this->assertCount(2, $userlist4);
$expected = [
$user2->id,
$admin->id
];
$this->assertEquals($expected, $userlist4->get_userids(), '', 0.0, 10, true);
// The user list for systemcontext should user1 and admin (role creator).
$userlist6 = new \core_privacy\local\request\userlist($systemcontext, $component);
provider::get_users_in_context($userlist6);
$this->assertCount(2, $userlist6);
$expected = [
$user1->id,
$admin->id
];
$this->assertEquals($expected, $userlist6->get_userids(), '', 0.0, 10, true);
// The user list for cmcontext should user1, user2 and admin (role creator).
$userlist7 = new \core_privacy\local\request\userlist($cmcontext, $component);
provider::get_users_in_context($userlist7);
$this->assertCount(3, $userlist7);
$expected = [
$user1->id,
$user2->id,
$admin->id
];
$this->assertEquals($expected, $userlist7->get_userids(), '', 0.0, 10, true);
// The user list for blockcontext should user1 and admin (role creator).
$userlist8 = new \core_privacy\local\request\userlist($blockcontext, $component);
provider::get_users_in_context($userlist8);
$this->assertCount(2, $userlist8);
$expected = [
$user1->id,
$admin->id
];
$this->assertEquals($expected, $userlist8->get_userids(), '', 0.0, 10, true);
}
/**
* Test that data for users in approved userlist is deleted.
*/
public function test_delete_data_for_users() {
global $DB;
$this->resetAfterTest();
$component = 'core_role';
$this->setAdminUser();
$admin = \core_user::get_user_by_username('admin');
// Create user1.
$user1 = $this->getDataGenerator()->create_user();
// Create user2.
$user2 = $this->getDataGenerator()->create_user();
$usercontext2 = \context_user::instance($user2->id);
// Create course1.
$course1 = $this->getDataGenerator()->create_course();
$coursecontext1 = \context_course::instance($course1->id);
// Create course category.
$coursecat = $this->getDataGenerator()->create_category();
$coursecatcontext = \context_coursecat::instance($coursecat->id);
// Create chat module.
$cm = $this->getDataGenerator()->create_module('chat', ['course' => $course1->id]);
$cmcontext = \context_module::instance($cm->cmid);
$systemcontext = \context_system::instance();
// Create a block.
$block = $this->getDataGenerator()->create_block('online_users');
$blockcontext = \context_block::instance($block->id);
$studentrole = $DB->get_record('role', array('shortname' => 'student'), '*', MUST_EXIST);
$managerrole = $DB->get_record('role', array('shortname' => 'manager'), '*', MUST_EXIST);
// Role assignments CONTEXT_COURSE.
role_assign($studentrole->id, $user1->id, $coursecontext1->id);
role_assign($studentrole->id, $user2->id, $coursecontext1->id);
// Role assignments CONTEXT_COURSECAT.
role_assign($studentrole->id, $user2->id, $coursecatcontext->id);
// Role assignments CONTEXT_SYSTEM.
role_assign($studentrole->id, $user1->id, $systemcontext->id);
// Role assignments CONTEXT_MODULE.
role_assign($studentrole->id, $user2->id, $cmcontext->id);
// Role assigments CONTEXT_BLOCK.
role_assign($studentrole->id, $user1->id, $blockcontext->id);
// Role assigments CONTEXT_USER.
role_assign($managerrole->id, $user1->id, $usercontext2->id);
// Role capabilities.
$this->setUser($user1);
assign_capability('moodle/backup:backupcourse', CAP_ALLOW, $studentrole->id, $cmcontext->id);
// The user list for usercontext2 should user1 and admin (role creator).
$userlist1 = new \core_privacy\local\request\userlist($usercontext2, $component);
provider::get_users_in_context($userlist1);
$this->assertCount(2, $userlist1);
// The user list for coursecontext1 should user1, user2 and admin (role creator).
$userlist2 = new \core_privacy\local\request\userlist($coursecontext1, $component);
provider::get_users_in_context($userlist2);
$this->assertCount(3, $userlist2);
// The user list for coursecatcontext should user2 and admin (role creator).
$userlist3 = new \core_privacy\local\request\userlist($coursecatcontext, $component);
provider::get_users_in_context($userlist3);
$this->assertCount(2, $userlist3);
// The user list for systemcontext should user1 and admin (role creator).
$userlist4 = new \core_privacy\local\request\userlist($systemcontext, $component);
provider::get_users_in_context($userlist4);
$this->assertCount(2, $userlist4);
// The user list for cmcontext should user1, user2 and admin (role creator).
$userlist5 = new \core_privacy\local\request\userlist($cmcontext, $component);
provider::get_users_in_context($userlist5);
$this->assertCount(3, $userlist5);
// The user list for blockcontext should user1 and admin (role creator).
$userlist6 = new \core_privacy\local\request\userlist($blockcontext, $component);
provider::get_users_in_context($userlist6);
$this->assertCount(2, $userlist6);
// Convert $userlist1 into an approved_contextlist.
$approvedlist1 = new approved_userlist($usercontext2, $component, $userlist1->get_userids());
// Delete using delete_data_for_user.
provider::delete_data_for_users($approvedlist1);
// Re-fetch users in usercontext2.
$userlist1 = new \core_privacy\local\request\userlist($usercontext2, $component);
provider::get_users_in_context($userlist1);
$this->assertCount(0, $userlist1);
// Convert $userlist2 into an approved_contextlist.
$approvedlist2 = new approved_userlist($coursecontext1, $component, $userlist2->get_userids());
// Delete using delete_data_for_user.
provider::delete_data_for_users($approvedlist2);
// Re-fetch users in coursecontext1.
$userlist2 = new \core_privacy\local\request\userlist($coursecontext1, $component);
provider::get_users_in_context($userlist2);
$this->assertCount(0, $userlist2);
// Convert $userlist3 into an approved_contextlist.
$approvedlist3 = new approved_userlist($coursecatcontext, $component, $userlist3->get_userids());
// Delete using delete_data_for_user.
provider::delete_data_for_users($approvedlist3);
// Re-fetch users in coursecatcontext.
$userlist3 = new \core_privacy\local\request\userlist($coursecatcontext, $component);
provider::get_users_in_context($userlist3);
$this->assertCount(0, $userlist3);
// Convert $userlist4 into an approved_contextlist.
$approvedlist4 = new approved_userlist($systemcontext, $component, $userlist4->get_userids());
// Delete using delete_data_for_user.
provider::delete_data_for_users($approvedlist4);
// Re-fetch users in systemcontext.
$userlist4 = new \core_privacy\local\request\userlist($systemcontext, $component);
provider::get_users_in_context($userlist4);
// The data from role_capabilities should still be present. The user list should return the admin user.
$this->assertCount(1, $userlist4);
$expected = [$admin->id];
$this->assertEquals($expected, $userlist4->get_userids());
// Convert $userlist5 into an approved_contextlist.
$approvedlist5 = new approved_userlist($cmcontext, $component, $userlist5->get_userids());
// Delete using delete_data_for_user.
provider::delete_data_for_users($approvedlist5);
// Re-fetch users in cmcontext.
$userlist5 = new \core_privacy\local\request\userlist($cmcontext, $component);
provider::get_users_in_context($userlist5);
// The data from role_capabilities should still be present. The user list should return user1.
$this->assertCount(1, $userlist5);
$expected = [$user1->id];
$this->assertEquals($expected, $userlist5->get_userids());
// Convert $userlist6 into an approved_contextlist.
$approvedlist6 = new approved_userlist($blockcontext, $component, $userlist6->get_userids());
// Delete using delete_data_for_user.
provider::delete_data_for_users($approvedlist6);
// Re-fetch users in blockcontext.
$userlist6 = new \core_privacy\local\request\userlist($blockcontext, $component);
provider::get_users_in_context($userlist6);
$this->assertCount(0, $userlist6);
}
/**
* Supoort function to get all the localised roles name
* in a simple array for testing.
*
* @return array Array of name of the roles by roleid.
*/
protected static function get_roles_name() {
$roles = role_fix_names(get_all_roles(), \context_system::instance(), ROLENAME_ORIGINAL);
$rolesnames = array();
foreach ($roles as $role) {
$rolesnames[$role->id] = $role->localname;
}
return $rolesnames;
}
}
+86 -57
View File
@@ -28,85 +28,112 @@ admin_externalpage_setup('searchareas');
$areaid = optional_param('areaid', null, PARAM_ALPHAEXT);
$action = optional_param('action', null, PARAM_ALPHA);
$indexingenabled = \core_search\manager::is_indexing_enabled(); // This restricts many of the actions on this page.
// Get a search manager instance, which we'll need for display and to handle some actions.
try {
$searchmanager = \core_search\manager::instance();
} catch (core_search\engine_exception $searchmanagererror) {
// Continue, we return an error later depending on the requested action.
// In action cases, well throw this exception below. In non-action cases, we produce a lang string error.
}
echo $OUTPUT->header();
// Handle all the actions.
if ($action) {
require_sesskey();
// If dealing with an areaid, we need to check that the area exists.
if ($areaid) {
// We need to check that the area exists.
$area = \core_search\manager::get_search_area($areaid);
if ($area === false) {
throw new moodle_exception('invalidrequest');
}
}
// All actions but enable/disable need the search engine to be ready.
if ($action !== 'enable' && $action !== 'disable') {
if (!empty($searchmanagererror)) {
throw $searchmanagererror;
// All the indexing actions.
if (in_array($action, ['delete', 'indexall', 'reindexall', 'deleteall'])) {
// All of these actions require that indexing is enabled.
if ($indexingenabled) {
// For all of these actions, we strictly need a manager instance.
if (isset($searchmanagererror)) {
throw $searchmanagererror;
}
switch ($action) {
case 'delete':
$searchmanager->delete_index($areaid);
\core\notification::success(get_string('searchindexdeleted', 'admin'));
break;
case 'indexall':
$searchmanager->index();
\core\notification::success(get_string('searchindexupdated', 'admin'));
break;
case 'reindexall':
$searchmanager->index(true);
\core\notification::success(get_string('searchreindexed', 'admin'));
break;
case 'deleteall':
$searchmanager->delete_index();
\core\notification::success(get_string('searchalldeleted', 'admin'));
break;
default:
break;
}
// Redirect back to the main page after taking action.
redirect(new moodle_url('/admin/searchareas.php'));
}
} else if (in_array($action, ['enable', 'disable'])) {
switch ($action) {
case 'enable':
$area->set_enabled(true);
\core\notification::success(get_string('searchareaenabled', 'admin'));
break;
case 'disable':
$area->set_enabled(false);
core\notification::success(get_string('searchareadisabled', 'admin'));
break;
default:
break;
}
}
switch ($action) {
case 'enable':
$area->set_enabled(true);
echo $OUTPUT->notification(get_string('searchareaenabled', 'admin'), \core\output\notification::NOTIFY_SUCCESS);
break;
case 'disable':
$area->set_enabled(false);
echo $OUTPUT->notification(get_string('searchareadisabled', 'admin'), \core\output\notification::NOTIFY_SUCCESS);
break;
case 'delete':
$search = \core_search\manager::instance();
$search->delete_index($areaid);
echo $OUTPUT->notification(get_string('searchindexdeleted', 'admin'), \core\output\notification::NOTIFY_SUCCESS);
break;
case 'indexall':
$searchmanager->index();
echo $OUTPUT->notification(get_string('searchindexupdated', 'admin'), \core\output\notification::NOTIFY_SUCCESS);
break;
case 'reindexall':
$searchmanager->index(true);
echo $OUTPUT->notification(get_string('searchreindexed', 'admin'), \core\output\notification::NOTIFY_SUCCESS);
break;
case 'deleteall':
$searchmanager->delete_index();
echo $OUTPUT->notification(get_string('searchalldeleted', 'admin'), \core\output\notification::NOTIFY_SUCCESS);
break;
default:
throw new moodle_exception('invalidaction');
break;
redirect(new moodle_url('/admin/searchareas.php'));
} else {
// Invalid action.
throw new moodle_exception('invalidaction');
}
}
$searchareas = \core_search\manager::get_search_areas_list();
if (empty($searchmanagererror)) {
$areasconfig = $searchmanager->get_areas_config($searchareas);
// Display.
if (isset($searchmanager) && $indexingenabled) {
\core\notification::info(get_string('indexinginfo', 'admin'));
} else if (isset($searchmanager)) {
$params = (object) [
'url' => (new moodle_url("/admin/settings.php?section=manageglobalsearch#admin-searchindexwhendisabled"))->out(false)
];
\core\notification::error(get_string('indexwhendisabledfullnotice', 'search', $params));
} else {
$areasconfig = false;
}
if (!empty($searchmanagererror)) {
// In non-action cases, init errors are translated and displayed to the user as error notifications.
$errorstr = get_string($searchmanagererror->errorcode, $searchmanagererror->module, $searchmanagererror->a);
echo $OUTPUT->notification($errorstr, \core\output\notification::NOTIFY_ERROR);
} else {
echo $OUTPUT->notification(get_string('indexinginfo', 'admin'), \core\output\notification::NOTIFY_INFO);
\core\notification::error($errorstr);
}
echo $OUTPUT->header();
$table = new html_table();
$table->id = 'core-search-areas';
$table->head = [
get_string('searcharea', 'search'),
get_string('enable'),
get_string('newestdocindexed', 'admin'),
get_string('searchlastrun', 'admin'),
get_string('searchindexactions', 'admin')
];
$table->head = array(get_string('searcharea', 'search'), get_string('enable'), get_string('newestdocindexed', 'admin'),
get_string('searchlastrun', 'admin'), get_string('searchindexactions', 'admin'));
$searchareas = \core_search\manager::get_search_areas_list();
$areasconfig = isset($searchmanager) ? $searchmanager->get_areas_config($searchareas) : false;
foreach ($searchareas as $area) {
$areaid = $area->get_area_id();
$columns = array(new html_table_cell($area->get_visible_name()));
@@ -116,7 +143,7 @@ foreach ($searchareas as $area) {
new pix_icon('t/hide', get_string('disable'), 'moodle', array('title' => '', 'class' => 'iconsmall')),
null, array('title' => get_string('disable')));
if ($areasconfig) {
if ($areasconfig && $indexingenabled) {
$columns[] = $areasconfig[$areaid]->lastindexrun;
if ($areasconfig[$areaid]->indexingstart) {
@@ -135,7 +162,11 @@ foreach ($searchareas as $area) {
$columns[] = html_writer::link(admin_searcharea_action_url('delete', $areaid), 'Delete index');
} else {
$blankrow = new html_table_cell(get_string('searchnotavailable', 'admin'));
if (!$areasconfig) {
$blankrow = new html_table_cell(get_string('searchnotavailable', 'admin'));
} else {
$blankrow = new html_table_cell(get_string('indexwhendisabledshortnotice', 'search'));
}
$blankrow->colspan = 3;
$columns[] = $blankrow;
}
@@ -154,10 +185,7 @@ foreach ($searchareas as $area) {
}
// Cross-search area tasks.
$options = array();
if (!empty($searchmanagererror)) {
$options['disabled'] = true;
}
$options = (isset($searchmanager) && $indexingenabled) ? [] : ['disabled' => true];
echo $OUTPUT->box_start('search-areas-actions');
echo $OUTPUT->single_button(admin_searcharea_action_url('indexall'), get_string('searchupdateindex', 'admin'), 'get', $options);
echo $OUTPUT->single_button(admin_searcharea_action_url('reindexall'), get_string('searchreindexindex', 'admin'), 'get', $options);
@@ -165,6 +193,7 @@ echo $OUTPUT->single_button(admin_searcharea_action_url('deleteall'), get_string
echo $OUTPUT->box_end();
echo html_writer::table($table);
echo $OUTPUT->footer();
/**
+2 -1
View File
@@ -38,7 +38,8 @@ if (!($settingspage->check_access())) {
$statusmsg = '';
$errormsg = '';
if ($data = data_submitted() and confirm_sesskey()) {
// Form is submitted with changed settings. Do not want to execute when modifying a block.
if ($data = data_submitted() and confirm_sesskey() and isset($data->action) and $data->action == 'save-settings') {
$count = admin_write_settings($data);
// Regardless of whether any setting change was written (a positive count), check validation errors for those that didn't.
+1 -1
View File
@@ -199,7 +199,7 @@ preferences,moodle|/user/preferences.php|preferences',
// "documentation" settingpage
$temp = new admin_settingpage('documentation', new lang_string('moodledocs'));
$temp->add(new admin_setting_configtext('docroot', new lang_string('docroot', 'admin'), new lang_string('configdocroot', 'admin'), 'http://docs.moodle.org', PARAM_URL));
$temp->add(new admin_setting_configtext('docroot', new lang_string('docroot', 'admin'), new lang_string('configdocroot', 'admin'), 'https://docs.moodle.org', PARAM_URL));
$ltemp = array('' => get_string('forceno'));
$ltemp += get_string_manager()->get_list_of_translations(true);
$temp->add(new admin_setting_configselect('doclang', get_string('doclang', 'admin'), get_string('configdoclang', 'admin'), '', $ltemp));
+3 -1
View File
@@ -28,7 +28,9 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
$ADMIN->add('development', $temp);
// "Profiling" settingpage (conditionally if the 'xhprof' extension is available only).
$xhprofenabled = extension_loaded('xhprof') || extension_loaded('tideways');
$xhprofenabled = extension_loaded('tideways_xhprof');
$xhprofenabled = $xhprofenabled || extension_loaded('tideways');
$xhprofenabled = $xhprofenabled || extension_loaded('xhprof');
$temp = new admin_settingpage('profiling', new lang_string('profiling', 'admin'), 'moodle/site:config', !$xhprofenabled);
// Main profiling switch.
$temp->add(new admin_setting_configcheckbox('profilingenabled', new lang_string('profilingenabled', 'admin'), new lang_string('profilingenabled_help', 'admin'), false));
-80
View File
@@ -1,80 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Adds privacy and policies links to admin tree.
*
* @package core_privacy
* @copyright 2018 Marina Glancy
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
if ($hassiteconfig) {
// Privacy settings.
$temp = new admin_settingpage('privacysettings', new lang_string('privacysettings', 'admin'));
$options = array(
0 => get_string('no'),
1 => get_string('yes')
);
$url = new moodle_url('/admin/settings.php?section=supportcontact');
$url = $url->out();
$setting = new admin_setting_configselect('agedigitalconsentverification',
new lang_string('agedigitalconsentverification', 'admin'),
new lang_string('agedigitalconsentverification_desc', 'admin', $url), 0, $options);
$setting->set_force_ltr(true);
$temp->add($setting);
$setting = new admin_setting_agedigitalconsentmap('agedigitalconsentmap',
new lang_string('ageofdigitalconsentmap', 'admin'),
new lang_string('ageofdigitalconsentmap_desc', 'admin'),
// See {@link https://gdpr-info.eu/art-8-gdpr/}.
implode(PHP_EOL, [
'*, 16',
'AT, 14',
'CZ, 13',
'DE, 14',
'DK, 13',
'ES, 13',
'FI, 15',
'GB, 13',
'HU, 14',
'IE, 13',
'LT, 16',
'LU, 16',
'NL, 16',
'PL, 13',
'SE, 13',
]),
PARAM_RAW
);
$temp->add($setting);
$ADMIN->add('privacy', $temp);
// Policy settings.
$temp = new admin_settingpage('policysettings', new lang_string('policysettings', 'admin'));
$temp->add(new admin_settings_sitepolicy_handler_select('sitepolicyhandler', new lang_string('sitepolicyhandler', 'core_admin'),
new lang_string('sitepolicyhandler_desc', 'core_admin')));
$temp->add(new admin_setting_configtext('sitepolicy', new lang_string('sitepolicy', 'core_admin'),
new lang_string('sitepolicy_help', 'core_admin'), '', PARAM_RAW));
$temp->add(new admin_setting_configtext('sitepolicyguest', new lang_string('sitepolicyguest', 'core_admin'),
new lang_string('sitepolicyguest_help', 'core_admin'), (isset($CFG->sitepolicy) ? $CFG->sitepolicy : ''), PARAM_RAW));
$ADMIN->add('privacy', $temp);
}
-1
View File
@@ -29,7 +29,6 @@ $ADMIN->add('root', new admin_category('badges', new lang_string('badges'), empt
$ADMIN->add('root', new admin_category('location', new lang_string('location','admin')));
$ADMIN->add('root', new admin_category('language', new lang_string('language')));
$ADMIN->add('root', new admin_category('modules', new lang_string('plugins', 'admin')));
$ADMIN->add('root', new admin_category('privacy', new lang_string('privacyandpolicies', 'admin')));
$ADMIN->add('root', new admin_category('security', new lang_string('security','admin')));
$ADMIN->add('root', new admin_category('appearance', new lang_string('appearance','admin')));
$ADMIN->add('root', new admin_category('frontpage', new lang_string('frontpage','admin')));
+46
View File
@@ -4,6 +4,7 @@
$ADMIN->add('users', new admin_category('accounts', new lang_string('accounts', 'admin')));
$ADMIN->add('users', new admin_category('roles', new lang_string('permissions', 'role')));
$ADMIN->add('users', new admin_category('privacy', new lang_string('privacyandpolicies', 'admin')));
if ($hassiteconfig
or has_capability('moodle/user:create', $systemcontext)
@@ -209,3 +210,48 @@ if ($hassiteconfig
$ADMIN->add('roles', new admin_externalpage('checkpermissions', new lang_string('checkglobalpermissions', 'role'), "$CFG->wwwroot/$CFG->admin/roles/check.php?contextid=".$systemcontext->id, array('moodle/role:assign', 'moodle/role:safeoverride', 'moodle/role:override', 'moodle/role:manage')));
} // end of speedup
// Privacy settings.
if ($hassiteconfig) {
$temp = new admin_settingpage('privacysettings', new lang_string('privacysettings', 'admin'));
$options = array(
0 => get_string('no'),
1 => get_string('yes')
);
$url = new moodle_url('/admin/settings.php?section=supportcontact');
$url = $url->out();
$setting = new admin_setting_configselect('agedigitalconsentverification',
new lang_string('agedigitalconsentverification', 'admin'),
new lang_string('agedigitalconsentverification_desc', 'admin', $url), 0, $options);
$setting->set_force_ltr(true);
$temp->add($setting);
// See {@link https://gdpr-info.eu/art-8-gdpr/}.
$ageofdigitalconsentmap = implode(PHP_EOL, [
'*, 16',
'AT, 14',
'ES, 14',
'US, 13'
]);
$setting = new admin_setting_agedigitalconsentmap('agedigitalconsentmap',
new lang_string('ageofdigitalconsentmap', 'admin'),
new lang_string('ageofdigitalconsentmap_desc', 'admin'),
$ageofdigitalconsentmap,
PARAM_RAW
);
$temp->add($setting);
$ADMIN->add('privacy', $temp);
// Policy settings.
$temp = new admin_settingpage('policysettings', new lang_string('policysettings', 'admin'));
$temp->add(new admin_settings_sitepolicy_handler_select('sitepolicyhandler', new lang_string('sitepolicyhandler', 'core_admin'),
new lang_string('sitepolicyhandler_desc', 'core_admin')));
$temp->add(new admin_setting_configtext('sitepolicy', new lang_string('sitepolicy', 'core_admin'),
new lang_string('sitepolicy_help', 'core_admin'), '', PARAM_RAW));
$temp->add(new admin_setting_configtext('sitepolicyguest', new lang_string('sitepolicyguest', 'core_admin'),
new lang_string('sitepolicyguest_help', 'core_admin'), (isset($CFG->sitepolicy) ? $CFG->sitepolicy : ''), PARAM_RAW));
$ADMIN->add('privacy', $temp);
}
+1
View File
@@ -40,6 +40,7 @@
<div class="settingsform clearfix">
{{#params}}
<input type="hidden" name="{{name}}" value="{{value}}">
<input type="hidden" name="action" value="save-settings">
{{/params}}
<input type="hidden" name="sesskey" value="{{sesskey}}">
<input type="hidden" name="return" value="{{return}}">
@@ -0,0 +1,46 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Privacy Subsystem implementation for tool_analytics.
*
* @package tool_analytics
* @copyright 2018 Zig Tan <zig@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_analytics\privacy;
defined('MOODLE_INTERNAL') || die();
/**
* Privacy Subsystem for tool_analytics implementing null_provider.
*
* @copyright 2018 Zig Tan <zig@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class provider implements \core_privacy\local\metadata\null_provider {
/**
* Get the language string identifier with the component's language
* file to explain why this plugin stores no data.
*
* @return string
*/
public static function get_reason() : string {
return 'privacy:metadata';
}
}
@@ -92,3 +92,4 @@ $string['trainmodels'] = 'Train models';
$string['viewlog'] = 'Log';
$string['weeksenddateautomaticallyset'] = 'End date automatically set based on start date and the number of sections';
$string['weeksenddatedefault'] = 'End date automatically calculated from the course start date.';
$string['privacy:metadata'] = 'The Analytic models plugin does not store any personal data.';
@@ -0,0 +1,73 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Privacy Subsystem implementation for tool_assignmentupgrade.
*
* @package tool_assignmentupgrade
* @copyright 2018 Zig Tan <zig@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_assignmentupgrade\privacy;
use core_privacy\local\metadata\collection;
use core_privacy\local\request\writer;
defined('MOODLE_INTERNAL') || die();
/**
* Privacy Subsystem for tool_assignmentupgrade implementing metadata, plugin, and user_preference providers.
*
* @copyright 2018 Zig Tan <zig@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class provider implements
\core_privacy\local\metadata\provider,
\core_privacy\local\request\user_preference_provider {
/**
* Returns meta data about this system.
*
* @param collection $collection The initialised collection to add items to.
* @return collection A listing of user data stored through this system.
*/
public static function get_metadata(collection $collection) : collection {
$collection->add_user_preference(
'tool_assignmentupgrade_perpage',
'privacy:metadata:preference:perpage'
);
return $collection;
}
/**
* Export all user preferences for the plugin.
*
* @param int $userid The userid of the user whose data is to be exported.
*/
public static function export_user_preferences(int $userid) {
$perpage = get_user_preferences('tool_assignmentupgrade_perpage', null, $userid);
if ($perpage !== null) {
writer::export_user_preference(
'tool_assignmentupgrade',
'perpage',
$perpage,
get_string('privacy:metadata:preference:perpage', 'tool_assignmentupgrade')
);
}
}
}
@@ -58,3 +58,4 @@ $string['upgradeallconfirm'] = 'Upgrade all assignments?';
$string['upgradeprogress'] = 'Upgrade assignment {$a->current} of {$a->total}';
$string['upgradesingle'] = 'Upgrade single assignment';
$string['viewcourse'] = 'View the course with the converted assignment';
$string['privacy:metadata:preference:perpage'] = 'The assignment upgrade records per page preference set for the user.';
@@ -0,0 +1,75 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Privacy tests for tool_assignmentupgrade.
*
* @package tool_assignmentupgrade
* @category test
* @copyright 2018 Zig Tan <zig@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
use \core_privacy\tests\provider_testcase;
use \core_privacy\local\request\writer;
use \tool_assignmentupgrade\privacy\provider;
/**
* Unit tests for tool_assignmentupgrade/classes/privacy/policy
*
* @copyright 2018 Zig Tan <zig@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class tool_assignmentupgrade_privacy_testcase extends provider_testcase {
/**
* Overriding setUp() function to always reset after tests.
*/
public function setUp() {
$this->resetAfterTest(true);
}
/**
* Test for provider::test_export_user_preferences().
*/
public function test_export_user_preferences() {
// Test setup.
$user = $this->getDataGenerator()->create_user();
$this->setUser($user);
// Add a user home page preference for the User.
set_user_preference('tool_assignmentupgrade_perpage', '100', $user);
// Test the user preference exists.
$params = [
'userid' => $user->id,
'name' => 'tool_assignmentupgrade_perpage'
];
// Test the user preferences export contains 1 user preference record for the User.
provider::export_user_preferences($user->id);
$contextuser = context_user::instance($user->id);
$writer = writer::with_context($contextuser);
$this->assertTrue($writer->has_any_data());
$exportedpreferences = $writer->get_user_preferences('tool_assignmentupgrade');
$this->assertCount(1, (array) $exportedpreferences);
$this->assertEquals('100', $exportedpreferences->perpage->value);
}
}
@@ -0,0 +1,46 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Privacy Subsystem implementation for tool_availabilityconditions.
*
* @package tool_availabilityconditions
* @copyright 2018 Zig Tan <zig@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_availabilityconditions\privacy;
defined('MOODLE_INTERNAL') || die();
/**
* Privacy Subsystem for tool_availabilityconditions implementing null_provider.
*
* @copyright 2018 Zig Tan <zig@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class provider implements \core_privacy\local\metadata\null_provider {
/**
* Get the language string identifier with the component's language
* file to explain why this plugin stores no data.
*
* @return string
*/
public static function get_reason() : string {
return 'privacy:metadata';
}
}
@@ -24,3 +24,4 @@
$string['manageplugins'] = 'Manage restrictions';
$string['pluginname'] = 'Availability condition management';
$string['privacy:metadata'] = 'The Availability condition management plugin does not store any personal data.';
@@ -0,0 +1,46 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Privacy Subsystem implementation for tool_behat.
*
* @package tool_behat
* @copyright 2018 Zig Tan <zig@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_behat\privacy;
defined('MOODLE_INTERNAL') || die();
/**
* Privacy Subsystem for tool_behat implementing null_provider.
*
* @copyright 2018 Zig Tan <zig@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class provider implements \core_privacy\local\metadata\null_provider {
/**
* Get the language string identifier with the component's language
* file to explain why this plugin stores no data.
*
* @return string
*/
public static function get_reason() : string {
return 'privacy:metadata';
}
}
+11
View File
@@ -109,6 +109,17 @@ require_once(__DIR__ . '/../../../../lib/behat/lib.php');
require_once(__DIR__ . '/../../../../lib/behat/classes/behat_command.php');
require_once(__DIR__ . '/../../../../lib/behat/classes/behat_config_manager.php');
// Remove error handling overrides done in config.php. This is consistent with admin/tool/behat/cli/util_single_run.php.
$CFG->debug = (E_ALL | E_STRICT);
$CFG->debugdisplay = 1;
error_reporting($CFG->debug);
ini_set('display_errors', '1');
ini_set('log_errors', '1');
// Import the necessary libraries.
require_once($CFG->libdir . '/setuplib.php');
require_once($CFG->libdir . '/behat/classes/util.php');
// For drop option check if parallel site.
if ((empty($options['parallel'])) && ($options['drop']) || $options['updatesteps']) {
$options['parallel'] = behat_config_manager::get_behat_run_config_value('parallel');
+7 -6
View File
@@ -23,30 +23,31 @@
*/
$string['aim'] = 'This administration tool helps developers and test writers to create .feature files describing Moodle\'s functionalities and run them automatically. Step definitions available for use in .feature files are listed below.';
$string['allavailablesteps'] = 'All the available steps definitions';
$string['allavailablesteps'] = 'All available step definitions';
$string['errorbehatcommand'] = 'Error running behat CLI command. Try running "{$a} --help" manually from CLI to find out more about the problem.';
$string['errorcomposer'] = 'Composer dependencies are not installed.';
$string['errordataroot'] = '$CFG->behat_dataroot is not set or is invalid.';
$string['errorsetconfig'] = '$CFG->behat_dataroot, $CFG->behat_prefix and $CFG->behat_wwwroot need to be set in config.php.';
$string['erroruniqueconfig'] = '$CFG->behat_dataroot, $CFG->behat_prefix and $CFG->behat_wwwroot values need to be different than $CFG->dataroot, $CFG->prefix, $CFG->wwwroot, $CFG->phpunit_dataroot and $CFG->phpunit_prefix values.';
$string['fieldvalueargument'] = 'Field value arguments';
$string['fieldvalueargument_help'] = 'This argument should be completed by a field value, there are many field types, simple ones like checkboxes, selects or textareas or complex ones like date selectors. You can check <a href="http://docs.moodle.org/dev/Acceptance_testing#Providing_values_to_steps" target="_blank">Field values</a> to see the expected field value depending on the field type you provide.';
$string['fieldvalueargument_help'] = 'This argument should be completed by a field value. There are many field types, including simple ones like checkboxes, selects or textareas, or complex ones like date selectors. See the dev documentation <a href="http://docs.moodle.org/dev/Acceptance_testing" target="_blank">Acceptance_testing</a> for details of expected field values.';
$string['giveninfo'] = 'Given. Processes to set up the environment';
$string['infoheading'] = 'Info';
$string['installinfo'] = 'Read {$a} for installation and tests execution info';
$string['newstepsinfo'] = 'Read {$a} for info about how to add new steps definitions';
$string['newstepsinfo'] = 'Read {$a} for info about how to add new step definitions';
$string['newtestsinfo'] = 'Read {$a} for info about how to write new tests';
$string['nostepsdefinitions'] = 'There aren\'t steps definitions matching this filters';
$string['nostepsdefinitions'] = 'There aren\'t any step definitions matching this filter';
$string['pluginname'] = 'Acceptance testing';
$string['stepsdefinitionscomponent'] = 'Area';
$string['stepsdefinitionscontains'] = 'Contains';
$string['stepsdefinitionsfilters'] = 'Steps definitions';
$string['stepsdefinitionsfilters'] = 'Step definitions';
$string['stepsdefinitionstype'] = 'Type';
$string['theninfo'] = 'Then. Checkings to ensure the outcomes are the expected ones';
$string['unknownexceptioninfo'] = 'There was a problem with Selenium or your browser. Please ensure you are using the latest version of Selenium. Error:';
$string['viewsteps'] = 'Filter';
$string['wheninfo'] = 'When. Actions that provokes an event';
$string['wheninfo'] = 'When. Action that provokes an event';
$string['wrongbehatsetup'] = 'Something is wrong with the behat setup and so step definitions cannot be listed: <b>{$a->errormsg}</b><br/><br/>Please check:<ul>
<li>$CFG->behat_dataroot, $CFG->behat_prefix and $CFG->behat_wwwroot are set in config.php with different values from $CFG->dataroot, $CFG->prefix and $CFG->wwwroot.</li>
<li>You ran "{$a->behatinit}" from your Moodle root directory.</li>
<li>Dependencies are installed in vendor/ and {$a->behatcommand} file has execution permissions.</li></ul>';
$string['privacy:metadata'] = 'The Acceptance testing plugin does not store any personal data.';
@@ -11,7 +11,7 @@ Feature: List the system steps definitions
@javascript
Scenario: Accessing the list
Then I should see "Steps definitions"
Then I should see "Step definitions"
And I should not see "There aren't steps definitions matching this filter"
@javascript
@@ -0,0 +1,46 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Privacy Subsystem implementation for tool_capability.
*
* @package tool_capability
* @copyright 2018 Zig Tan <zig@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_capability\privacy;
defined('MOODLE_INTERNAL') || die();
/**
* Privacy Subsystem for tool_capability implementing null_provider.
*
* @copyright 2018 Zig Tan <zig@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class provider implements \core_privacy\local\metadata\null_provider {
/**
* Get the language string identifier with the component's language
* file to explain why this plugin stores no data.
*
* @return string
*/
public static function get_reason() : string {
return 'privacy:metadata';
}
}
@@ -34,3 +34,4 @@ $string['pluginname'] = 'Capability overview';
$string['reportforcapability'] = 'Report for capability \'{$a}\'';
$string['reportsettings'] = 'Report settings';
$string['roleslabel'] = 'Roles:';
$string['privacy:metadata'] = 'The Capability overview plugin does not store any personal data.';
@@ -0,0 +1,328 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Privacy Subsystem implementation for tool_cohortroles.
*
* @package tool_cohortroles
* @copyright 2018 Zig Tan <zig@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_cohortroles\privacy;
use core_privacy\local\metadata\collection;
use core_privacy\local\request\approved_contextlist;
use core_privacy\local\request\context;
use core_privacy\local\request\contextlist;
use core_privacy\local\request\transform;
use core_privacy\local\request\writer;
use core_privacy\local\request\userlist;
use \core_privacy\local\request\approved_userlist;
defined('MOODLE_INTERNAL') || die();
/**
* Privacy Subsystem for tool_cohortroles implementing metadata and plugin providers.
*
* @copyright 2018 Zig Tan <zig@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class provider implements
\core_privacy\local\metadata\provider,
\core_privacy\local\request\core_userlist_provider,
\core_privacy\local\request\plugin\provider {
/**
* Returns meta data about this system.
*
* @param collection $collection The initialised collection to add items to.
* @return collection A listing of user data stored through this system.
*/
public static function get_metadata(collection $collection) : collection {
// The tool_cohortroles plugin utilises the mdl_tool_cohortroles table.
$collection->add_database_table(
'tool_cohortroles',
[
'id' => 'privacy:metadata:tool_cohortroles:id',
'cohortid' => 'privacy:metadata:tool_cohortroles:cohortid',
'roleid' => 'privacy:metadata:tool_cohortroles:roleid',
'userid' => 'privacy:metadata:tool_cohortroles:userid',
'timecreated' => 'privacy:metadata:tool_cohortroles:timecreated',
'timemodified' => 'privacy:metadata:tool_cohortroles:timemodified',
'usermodified' => 'privacy:metadata:tool_cohortroles:usermodified'
],
'privacy:metadata:tool_cohortroles'
);
return $collection;
}
/**
* Get the list of contexts that contain user information for the specified user.
*
* @param int $userid The user to search.
* @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin.
*/
public static function get_contexts_for_userid(int $userid) : contextlist {
$contextlist = new contextlist();
// When we process user deletions and expiries, we always delete from the user context.
// As a result the cohort role assignments would be deleted, which has a knock-on effect with courses
// as roles may change and data may be removed earlier than it should be.
// Retrieve the context associated with tool_cohortroles records.
$sql = "SELECT DISTINCT c.contextid
FROM {tool_cohortroles} tc
JOIN {cohort} c
ON tc.cohortid = c.id
JOIN {context} ctx
ON ctx.id = c.contextid
WHERE tc.userid = :userid
AND (ctx.contextlevel = :contextlevel1
OR ctx.contextlevel = :contextlevel2)";
$params = [
'userid' => $userid,
'contextlevel1' => CONTEXT_SYSTEM,
'contextlevel2' => CONTEXT_COURSECAT
];
$contextlist->add_from_sql($sql, $params);
return $contextlist;
}
/**
* Get the list of users within a specific context.
*
* @param userlist $userlist The userlist containing the list of users who have data in this context/plugin combination.
*/
public static function get_users_in_context(userlist $userlist) {
$context = $userlist->get_context();
// When we process user deletions and expiries, we always delete from the user context.
// As a result the cohort role assignments would be deleted, which has a knock-on effect with courses
// as roles may change and data may be removed earlier than it should be.
$allowedcontextlevels = [
CONTEXT_SYSTEM,
CONTEXT_COURSECAT
];
if (!in_array($context->contextlevel, $allowedcontextlevels)) {
return;
}
$sql = "SELECT tc.userid as userid
FROM {tool_cohortroles} tc
JOIN {cohort} c
ON tc.cohortid = c.id
WHERE c.contextid = :contextid";
$params = [
'contextid' => $context->id
];
$userlist->add_from_sql('userid', $sql, $params);
}
/**
* Export all user data for the specified user, in the specified contexts.
*
* @param approved_contextlist $contextlist The approved contexts to export information for.
*/
public static function export_user_data(approved_contextlist $contextlist) {
global $DB;
// Remove contexts different from SYSTEM or COURSECAT.
$contextids = array_reduce($contextlist->get_contexts(), function($carry, $context) {
if ($context->contextlevel == CONTEXT_SYSTEM || $context->contextlevel == CONTEXT_COURSECAT) {
$carry[] = $context->id;
}
return $carry;
}, []);
if (empty($contextids)) {
return;
}
$userid = $contextlist->get_user()->id;
list($contextsql, $contextparams) = $DB->get_in_or_equal($contextids, SQL_PARAMS_NAMED);
// Retrieve the tool_cohortroles records created for the user.
$sql = "SELECT cr.id as cohortroleid,
c.name as cohortname,
c.idnumber as cohortidnumber,
c.description as cohortdescription,
c.contextid as contextid,
r.shortname as roleshortname,
cr.userid as userid,
cr.timecreated as timecreated,
cr.timemodified as timemodified
FROM {tool_cohortroles} cr
JOIN {cohort} c ON c.id = cr.cohortid
JOIN {role} r ON r.id = cr.roleid
WHERE cr.userid = :userid
AND c.contextid {$contextsql}";
$params = ['userid' => $userid] + $contextparams;
$cohortroles = $DB->get_records_sql($sql, $params);
foreach ($cohortroles as $cohortrole) {
// The tool_cohortroles data export is organised in:
// {User Context}/Cohort roles management/{cohort name}/{role shortname}/data.json.
$subcontext = [
get_string('pluginname', 'tool_cohortroles'),
$cohortrole->cohortname,
$cohortrole->roleshortname
];
$data = (object) [
'cohortname' => $cohortrole->cohortname,
'cohortidnumber' => $cohortrole->cohortidnumber,
'cohortdescription' => $cohortrole->cohortdescription,
'roleshortname' => $cohortrole->roleshortname,
'userid' => transform::user($cohortrole->userid),
'timecreated' => transform::datetime($cohortrole->timecreated),
'timemodified' => transform::datetime($cohortrole->timemodified)
];
$context = \context::instance_by_id($cohortrole->contextid);
writer::with_context($context)->export_data($subcontext, $data);
}
}
/**
* Delete all data for all users in the specified context.
*
* @param context $context The specific context to delete data for.
*/
public static function delete_data_for_all_users_in_context(\context $context) {
global $DB;
// When we process user deletions and expiries, we always delete from the user context.
// As a result the cohort role assignments would be deleted, which has a knock-on effect with courses
// as roles may change and data may be removed earlier than it should be.
$allowedcontextlevels = [
CONTEXT_SYSTEM,
CONTEXT_COURSECAT
];
if (!in_array($context->contextlevel, $allowedcontextlevels)) {
return;
}
$cohortids = $DB->get_fieldset_select('cohort', 'id', 'contextid = :contextid',
['contextid' => $context->id]);
// Delete the tool_cohortroles records created in the specific context.
$DB->delete_records_list('tool_cohortroles', 'cohortid', $cohortids);
}
/**
* Delete multiple users within a single context.
*
* @param approved_userlist $userlist The approved context and user information to delete information for.
*/
public static function delete_data_for_users(approved_userlist $userlist) {
global $DB;
// When we process user deletions and expiries, we always delete from the user context.
// As a result the cohort role assignments would be deleted, which has a knock-on effect with courses
// as roles may change and data may be removed earlier than it should be.
$userids = $userlist->get_userids();
if (empty($userids)) {
return;
}
$context = $userlist->get_context();
$allowedcontextlevels = [
CONTEXT_SYSTEM,
CONTEXT_COURSECAT
];
if (!in_array($context->contextlevel, $allowedcontextlevels)) {
return;
}
$cohortids = $DB->get_fieldset_select('cohort', 'id', 'contextid = :contextid',
['contextid' => $context->id]);
if (empty($cohortids)) {
return;
}
list($cohortsql, $cohortparams) = $DB->get_in_or_equal($cohortids, SQL_PARAMS_NAMED);
list($usersql, $userparams) = $DB->get_in_or_equal($userids, SQL_PARAMS_NAMED);
$params = $cohortparams + $userparams;
$select = "cohortid {$cohortsql} AND userid {$usersql}";
// Delete the tool_cohortroles records created in the specific context for an approved list of users.
$DB->delete_records_select('tool_cohortroles', $select, $params);
}
/**
* Delete all user data for the specified user, in the specified contexts.
*
* @param approved_contextlist $contextlist The approved contexts and user information to delete information for.
*/
public static function delete_data_for_user(approved_contextlist $contextlist) {
global $DB;
// When we process user deletions and expiries, we always delete from the user context.
// As a result the cohort role assignments would be deleted, which has a knock-on effect with courses
// as roles may change and data may be removed earlier than it should be.
// Remove contexts different from SYSTEM or COURSECAT.
$contextids = array_reduce($contextlist->get_contexts(), function($carry, $context) {
if ($context->contextlevel == CONTEXT_SYSTEM || $context->contextlevel == CONTEXT_COURSECAT) {
$carry[] = $context->id;
}
return $carry;
}, []);
if (empty($contextids)) {
return;
}
$userid = $contextlist->get_user()->id;
list($contextsql, $contextparams) = $DB->get_in_or_equal($contextids, SQL_PARAMS_NAMED);
$selectcontext = "contextid {$contextsql}";
// Get the cohorts in the specified contexts.
$cohortids = $DB->get_fieldset_select('cohort', 'id', $selectcontext, $contextparams);
if (empty($cohortids)) {
return;
}
list($cohortsql, $cohortparams) = $DB->get_in_or_equal($cohortids, SQL_PARAMS_NAMED);
$selectcohort = "cohortid {$cohortsql} AND userid = :userid";
$params = ['userid' => $userid] + $cohortparams;
// Delete the tool_cohortroles records created for the userid.
$DB->delete_records_select('tool_cohortroles', $selectcohort, $params);
}
}
@@ -42,3 +42,11 @@ $string['selectrole'] = 'Select role';
$string['selectusers'] = 'Select users to assign role';
$string['taskname'] = 'Sync cohort role assignments';
$string['thisuserroles'] = 'Roles assigned relative to this user';
$string['privacy:metadata:tool_cohortroles'] = 'The Cohort roles management plugin stores user cohort role mappings.';
$string['privacy:metadata:tool_cohortroles:id'] = 'The ID of the cohort role mapping record';
$string['privacy:metadata:tool_cohortroles:cohortid'] = 'The ID of the cohort';
$string['privacy:metadata:tool_cohortroles:roleid'] = 'The ID of the role';
$string['privacy:metadata:tool_cohortroles:userid'] = 'The ID of the user';
$string['privacy:metadata:tool_cohortroles:timecreated'] = 'The time when the cohort role mapping was created';
$string['privacy:metadata:tool_cohortroles:timemodified'] = 'The time when the cohort role mapping was modified';
$string['privacy:metadata:tool_cohortroles:usermodified'] = 'The ID of the user who last modified the cohort role mapping';
@@ -0,0 +1,379 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Unit tests for the tool_cohortroles implementation of the privacy API.
*
* @package tool_cohortroles
* @category test
* @copyright 2018 Zig Tan <zig@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
global $CFG;
use \core_privacy\local\request\writer;
use \core_privacy\local\request\approved_contextlist;
use \tool_cohortroles\api;
use \tool_cohortroles\privacy\provider;
use core_privacy\local\request\approved_userlist;
/**
* Unit tests for the tool_cohortroles implementation of the privacy API.
*
* @copyright 2018 Zig Tan <zig@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class tool_cohortroles_privacy_testcase extends \core_privacy\tests\provider_testcase {
/**
* Overriding setUp() function to always reset after tests.
*/
public function setUp() {
$this->resetAfterTest(true);
}
/**
* Test for provider::get_contexts_for_userid().
*/
public function test_get_contexts_for_userid() {
global $DB;
// Test setup.
$user = $this->getDataGenerator()->create_user();
$this->setUser($user);
$this->setAdminUser();
// Create course category.
$coursecategory = $this->getDataGenerator()->create_category();
$coursecategoryctx = \context_coursecat::instance($coursecategory->id);
$systemctx = context_system::instance();
// Create course.
$course = $this->getDataGenerator()->create_course();
$coursectx = \context_course::instance($course->id);
$this->setup_test_scenario_data($user->id, $systemctx, 1);
$this->setup_test_scenario_data($user->id, $coursecategoryctx, 1, 'Sausage roll 2',
'sausageroll2');
$this->setup_test_scenario_data($user->id, $coursectx, 1, 'Sausage roll 3',
'sausageroll3');
// Test the User's assigned cohortroles matches 3.
$cohortroles = $DB->get_records('tool_cohortroles', ['userid' => $user->id]);
$this->assertCount(3, $cohortroles);
// Test the User's retrieved contextlist returns only the system and course category context.
$contextlist = provider::get_contexts_for_userid($user->id);
$contexts = $contextlist->get_contexts();
$this->assertCount(2, $contexts);
$contextlevels = array_column($contexts, 'contextlevel');
$expected = [
CONTEXT_SYSTEM,
CONTEXT_COURSECAT
];
// Test the User's contexts equal the system and course category context.
$this->assertEquals($expected, $contextlevels, '', 0, 10, true);
}
/**
* Test for provider::export_user_data().
*/
public function test_export_user_data() {
// Test setup.
$user = $this->getDataGenerator()->create_user();
$this->setUser($user);
$this->setAdminUser();
// Create course category.
$coursecategory = $this->getDataGenerator()->create_category();
$coursecategoryctx = \context_coursecat::instance($coursecategory->id);
$systemctx = context_system::instance();
// Create course.
$course = $this->getDataGenerator()->create_course();
$coursectx = \context_course::instance($course->id);
$this->setup_test_scenario_data($user->id, $systemctx, 1);
$this->setup_test_scenario_data($user->id, $coursecategoryctx, 1, 'Sausage roll 2',
'sausageroll2');
$this->setup_test_scenario_data($user->id, $coursectx, 1, 'Sausage roll 3',
'sausageroll3');
// Test the User's retrieved contextlist contains two contexts.
$contextlist = provider::get_contexts_for_userid($user->id);
$contexts = $contextlist->get_contexts();
$this->assertCount(2, $contexts);
// Add a system, course category and course context to the approved context list.
$approvedcontextids = [
$systemctx->id,
$coursecategoryctx->id,
$coursectx->id
];
// Retrieve the User's tool_cohortroles data.
$approvedcontextlist = new approved_contextlist($user, 'tool_cohortroles', $approvedcontextids);
provider::export_user_data($approvedcontextlist);
// Test the tool_cohortroles data is exported at the system context level.
$writer = writer::with_context($systemctx);
$this->assertTrue($writer->has_any_data());
// Test the tool_cohortroles data is exported at the course category context level.
$writer = writer::with_context($coursecategoryctx);
$this->assertTrue($writer->has_any_data());
// Test the tool_cohortroles data is not exported at the course context level.
$writer = writer::with_context($coursectx);
$this->assertFalse($writer->has_any_data());
}
/**
* Test for provider::delete_data_for_all_users_in_context().
*/
public function test_delete_data_for_all_users_in_context() {
global $DB;
// Test setup.
$user = $this->getDataGenerator()->create_user();
$this->setUser($user);
$this->setAdminUser();
// Create course category.
$coursecategory = $this->getDataGenerator()->create_category();
$coursecategoryctx = \context_coursecat::instance($coursecategory->id);
$systemctx = context_system::instance();
$this->setup_test_scenario_data($user->id, $systemctx, 1);
$this->setup_test_scenario_data($user->id, $coursecategoryctx, 1, 'Sausage roll 2',
'sausageroll2');
// Test the User's assigned cohortroles matches 2.
$cohortroles = $DB->get_records('tool_cohortroles', ['userid' => $user->id]);
$this->assertCount(2, $cohortroles);
// Test the User's retrieved contextlist contains two contexts.
$contextlist = provider::get_contexts_for_userid($user->id);
$contexts = $contextlist->get_contexts();
$this->assertCount(2, $contexts);
// Make sure the user data is only being deleted in within the system and course category context.
$usercontext = context_user::instance($user->id);
// Delete all the User's records in mdl_tool_cohortroles table by the user context.
provider::delete_data_for_all_users_in_context($usercontext);
// Test the cohort roles records in mdl_tool_cohortroles table is still present.
$cohortroles = $DB->get_records('tool_cohortroles', ['userid' => $user->id]);
$this->assertCount(2, $cohortroles);
// Delete all the User's records in mdl_tool_cohortroles table by the specified system context.
provider::delete_data_for_all_users_in_context($systemctx);
// The user data in the system context should be deleted.
// Test the User's retrieved contextlist contains one context (course category).
$contextlist = provider::get_contexts_for_userid($user->id);
$contexts = $contextlist->get_contexts();
$this->assertCount(1, $contexts);
// Delete all the User's records in mdl_tool_cohortroles table by the specified course category context.
provider::delete_data_for_all_users_in_context($coursecategoryctx);
// Test the cohort roles records in mdl_tool_cohortroles table is equals zero.
$cohortroles = $DB->get_records('tool_cohortroles', ['userid' => $user->id]);
$this->assertCount(0, $cohortroles);
$contextlist = provider::get_contexts_for_userid($user->id);
$contexts = $contextlist->get_contexts();
$this->assertCount(0, $contexts);
}
/**
* Test for provider::delete_data_for_user().
*/
public function test_delete_data_for_user() {
global $DB;
// Test setup.
$user = $this->getDataGenerator()->create_user();
$this->setUser($user);
$this->setAdminUser();
// Create course category.
$coursecategory = $this->getDataGenerator()->create_category();
$coursecategoryctx = \context_coursecat::instance($coursecategory->id);
$systemctx = context_system::instance();
$this->setup_test_scenario_data($user->id, $systemctx, 1);
$this->setup_test_scenario_data($user->id, $coursecategoryctx, 1, 'Sausage roll 2',
'sausageroll2');
// Test the User's assigned cohortroles matches 2.
$cohortroles = $DB->get_records('tool_cohortroles', ['userid' => $user->id]);
$this->assertCount(2, $cohortroles);
// Test the User's retrieved contextlist contains two contexts.
$contextlist = provider::get_contexts_for_userid($user->id);
$contexts = $contextlist->get_contexts();
$this->assertCount(2, $contexts);
// Make sure the user data is only being deleted in within the system and the course category contexts.
$usercontext = context_user::instance($user->id);
// Delete all the User's records in mdl_tool_cohortroles table by the specified approved context list.
$approvedcontextlist = new approved_contextlist($user, 'tool_cohortroles', [$usercontext->id]);
provider::delete_data_for_user($approvedcontextlist);
// Test the cohort roles records in mdl_tool_cohortroles table are still present.
$cohortroles = $DB->get_records('tool_cohortroles', ['userid' => $user->id]);
$this->assertCount(2, $cohortroles);
// Delete all the User's records in mdl_tool_cohortroles table by the specified approved context list.
$approvedcontextlist = new approved_contextlist($user, 'tool_cohortroles', $contextlist->get_contextids());
provider::delete_data_for_user($approvedcontextlist);
// Test the records in mdl_tool_cohortroles table is equals zero.
$cohortroles = $DB->get_records('tool_cohortroles', ['userid' => $user->id]);
$this->assertCount(0, $cohortroles);
}
/**
* Test that only users within a course context are fetched.
*/
public function test_get_users_in_context() {
$component = 'tool_cohortroles';
// Create a user.
$user = $this->getDataGenerator()->create_user();
$usercontext = context_user::instance($user->id);
// Create course category.
$coursecategory = $this->getDataGenerator()->create_category();
$coursecategoryctx = \context_coursecat::instance($coursecategory->id);
$systemctx = context_system::instance();
$this->setAdminUser();
$userlist = new \core_privacy\local\request\userlist($systemctx, $component);
provider::get_users_in_context($userlist);
$this->assertCount(0, $userlist);
$this->setup_test_scenario_data($user->id, $systemctx, 1);
$this->setup_test_scenario_data($user->id, $coursecategoryctx, 1, 'Sausage roll 2',
'sausageroll2');
// The list of users within the system context should contain user.
provider::get_users_in_context($userlist);
$this->assertCount(1, $userlist);
$this->assertTrue(in_array($user->id, $userlist->get_userids()));
// The list of users within the course category context should contain user.
$userlist = new \core_privacy\local\request\userlist($coursecategoryctx, $component);
provider::get_users_in_context($userlist);
$this->assertCount(1, $userlist);
$this->assertTrue(in_array($user->id, $userlist->get_userids()));
// The list of users within the user context should be empty.
$userlist2 = new \core_privacy\local\request\userlist($usercontext, $component);
provider::get_users_in_context($userlist2);
$this->assertCount(0, $userlist2);
}
/**
* Test that data for users in approved userlist is deleted.
*/
public function test_delete_data_for_users() {
$component = 'tool_cohortroles';
// Create user1.
$user1 = $this->getDataGenerator()->create_user();
// Create user2.
$user2 = $this->getDataGenerator()->create_user();
// Create user3.
$user3 = $this->getDataGenerator()->create_user();
$usercontext3 = context_user::instance($user3->id);
// Create course category.
$coursecategory = $this->getDataGenerator()->create_category();
$coursecategoryctx = \context_coursecat::instance($coursecategory->id);
$systemctx = context_system::instance();
$this->setAdminUser();
$this->setup_test_scenario_data($user1->id, $systemctx, 1);
$this->setup_test_scenario_data($user2->id, $systemctx, 1, 'Sausage roll 2',
'sausageroll2');
$this->setup_test_scenario_data($user3->id, $coursecategoryctx, 1, 'Sausage roll 3',
'sausageroll3');
$userlist1 = new \core_privacy\local\request\userlist($systemctx, $component);
provider::get_users_in_context($userlist1);
$this->assertCount(2, $userlist1);
$this->assertTrue(in_array($user1->id, $userlist1->get_userids()));
$this->assertTrue(in_array($user2->id, $userlist1->get_userids()));
// Convert $userlist1 into an approved_contextlist.
$approvedlist1 = new approved_userlist($systemctx, $component, [$user1->id]);
// Delete using delete_data_for_user.
provider::delete_data_for_users($approvedlist1);
// Re-fetch users in systemcontext.
$userlist1 = new \core_privacy\local\request\userlist($systemctx, $component);
provider::get_users_in_context($userlist1);
// The user data of user1in systemcontext should be deleted.
// The user data of user2 in systemcontext should be still present.
$this->assertCount(1, $userlist1);
$this->assertTrue(in_array($user2->id, $userlist1->get_userids()));
// Convert $userlist1 into an approved_contextlist in the user context.
$approvedlist2 = new approved_userlist($usercontext3, $component, $userlist1->get_userids());
// Delete using delete_data_for_user.
provider::delete_data_for_users($approvedlist2);
// Re-fetch users in systemcontext.
$userlist1 = new \core_privacy\local\request\userlist($systemctx, $component);
provider::get_users_in_context($userlist1);
// The user data in systemcontext should not be deleted.
$this->assertCount(1, $userlist1);
}
/**
* Helper function to setup tool_cohortroles records for testing a specific user.
*
* @param int $userid The ID of the user used for testing.
* @param int $nocohortroles The number of tool_cohortroles to create for the user.
* @param string $rolename The name of the role to be created.
* @param string $roleshortname The short name of the role to be created.
* @throws \core_competency\invalid_persistent_exception
* @throws coding_exception
*/
protected function setup_test_scenario_data($userid, $context, $nocohortroles, $rolename = 'Sausage Roll',
$roleshortname = 'sausageroll') {
$roleid = create_role($rolename, $roleshortname, 'mmmm');
$result = new \stdClass();
$result->contextid = $context->id;
for ($c = 0; $c < $nocohortroles; $c++) {
$cohort = $this->getDataGenerator()->create_cohort($result);
$params = (object)array(
'userid' => $userid,
'roleid' => $roleid,
'cohortid' => $cohort->id
);
api::create_cohort_role_assignment($params);
}
}
}
@@ -0,0 +1,46 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Privacy Subsystem implementation for tool_customlang.
*
* @package tool_customlang
* @copyright 2018 Zig Tan <zig@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_customlang\privacy;
defined('MOODLE_INTERNAL') || die();
/**
* Privacy Subsystem for tool_customlang implementing null_provider.
*
* @copyright 2018 Zig Tan <zig@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class provider implements \core_privacy\local\metadata\null_provider {
/**
* Get the language string identifier with the component's language
* file to explain why this plugin stores no data.
*
* @return string
*/
public static function get_reason() : string {
return 'privacy:metadata';
}
}
@@ -30,7 +30,7 @@ $string['checkin'] = 'Save strings to language pack';
$string['checkout'] = 'Open language pack for editing';
$string['checkoutdone'] = 'Language pack loaded';
$string['checkoutinprogress'] = 'Loading language pack';
$string['confirmcheckin'] = 'You are about to save modifications to your local language pack. This will export the customised strings from the translator into you Moodle data directory and Moodle will start using the modified strings. Press \'Continue\' to proceed with saving.';
$string['confirmcheckin'] = 'You are about to save modifications to your local language pack. This will export the customised strings from the translator into your site data directory and your site will start using the modified strings. Press \'Continue\' to proceed with saving.';
$string['customlang:edit'] = 'Edit local translation';
$string['customlang:view'] = 'View local translation';
$string['filter'] = 'Filter strings';
@@ -59,3 +59,4 @@ $string['placeholderwarning'] = 'string contains a placeholder';
$string['pluginname'] = 'Language customisation';
$string['savecheckin'] = 'Save changes to the language pack';
$string['savecontinue'] = 'Apply changes and continue editing';
$string['privacy:metadata'] = 'The Language customisation plugin does not store any personal data.';
+6 -4
View File
@@ -134,11 +134,13 @@ class tool_customlang_renderer extends plugin_renderer_base {
$output .= html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'translatorsubmitted', 'value'=>1));
$output .= html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'sesskey', 'value'=>sesskey()));
$output .= html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'p', 'value'=>$translator->currentpage));
$save1 = html_writer::empty_tag('input', array('type'=>'submit', 'name'=>'savecontinue', 'value'=>get_string('savecontinue', 'tool_customlang')));
$save2 = html_writer::empty_tag('input', array('type'=>'submit', 'name'=>'savecheckin', 'value'=>get_string('savecheckin', 'tool_customlang')));
$output .= html_writer::tag('fieldset', $save1.$save2, array('class'=>'buttonsbar'));
$save1 = html_writer::empty_tag('input', array('type' => 'submit', 'name' => 'savecontinue',
'value' => get_string('savecontinue', 'tool_customlang'), 'class' => 'btn btn-secondary'));
$save2 = html_writer::empty_tag('input', array('type' => 'submit', 'name' => 'savecheckin',
'value' => get_string('savecheckin', 'tool_customlang'), 'class' => 'btn btn-secondary'));
$output .= html_writer::tag('fieldset', $save1 . ' ' . $save2, array('class' => 'buttonsbar'));
$output .= html_writer::table($table);
$output .= html_writer::tag('fieldset', $save1.$save2, array('class'=>'buttonsbar'));
$output .= html_writer::tag('fieldset', $save1 . ' ' . $save2, array('class' => 'buttonsbar'));
$output .= html_writer::end_tag('div');
$output .= html_writer::end_tag('form');
+1
View File
@@ -0,0 +1 @@
define(["jquery","core/str","core/ajax","core/notification","core/modal_factory","core/modal_events","core/fragment"],function(a,b,c,d,e,f,g){var h={CATEGORY_LINK:'[data-add-element="category"]'},i=function(a){this.contextId=a;var c=[{key:"addcategory",component:"tool_dataprivacy"},{key:"save",component:"admin"}];this.strings=b.get_strings(c),this.registerEventListeners()};return i.prototype.contextId=0,i.prototype.strings=0,i.prototype.registerEventListeners=function(){var b=a(h.CATEGORY_LINK);b.on("click",function(){return this.strings.then(function(a){e.create({type:e.types.SAVE_CANCEL,title:a[0],body:""},b).done(function(b){this.setupFormModal(b,a[1])}.bind(this))}.bind(this)).fail(d.exception)}.bind(this))},i.prototype.getBody=function(a){var b=null;return"undefined"!=typeof a&&(b={jsonformdata:JSON.stringify(a)}),g.loadFragment("tool_dataprivacy","addcategory_form",this.contextId,b)},i.prototype.setupFormModal=function(a,b){a.setLarge(),a.setSaveButtonText(b),a.getRoot().on(f.hidden,this.destroy.bind(this)),a.setBody(this.getBody()),a.getRoot().on(f.save,this.submitForm.bind(this)),a.getRoot().on("submit","form",this.submitFormAjax.bind(this)),this.modal=a,a.show()},i.prototype.submitForm=function(a){a.preventDefault(),this.modal.getRoot().find("form").submit()},i.prototype.submitFormAjax=function(a){a.preventDefault();var b=this.modal.getRoot().find("form").serialize();c.call([{methodname:"tool_dataprivacy_create_category_form",args:{jsonformdata:JSON.stringify(b)},done:function(a){a.validationerrors?this.modal.setBody(this.getBody(b)):this.close()}.bind(this),fail:d.exception}])},i.prototype.close=function(){this.destroy(),document.location.reload()},i.prototype.destroy=function(){Y.use("moodle-core-formchangechecker",function(){M.core_formchangechecker.reset_form_dirty_state()}),this.modal.destroy()},i.prototype.removeListeners=function(){a(h.CATEGORY_LINK).off("click")},{getInstance:function(a){return new i(a)}}});
+1
View File
@@ -0,0 +1 @@
define(["jquery","core/str","core/ajax","core/notification","core/modal_factory","core/modal_events","core/fragment"],function(a,b,c,d,e,f,g){var h={PURPOSE_LINK:'[data-add-element="purpose"]'},i=function(a){this.contextId=a;var c=[{key:"addpurpose",component:"tool_dataprivacy"},{key:"save",component:"admin"}];this.strings=b.get_strings(c),this.registerEventListeners()};return i.prototype.contextId=0,i.prototype.strings=0,i.prototype.registerEventListeners=function(){var b=a(h.PURPOSE_LINK);b.on("click",function(){return this.strings.then(function(a){e.create({type:e.types.SAVE_CANCEL,title:a[0],body:""},b).done(function(b){this.setupFormModal(b,a[1])}.bind(this))}.bind(this)).fail(d.exception)}.bind(this))},i.prototype.getBody=function(a){var b=null;return"undefined"!=typeof a&&(b={jsonformdata:JSON.stringify(a)}),g.loadFragment("tool_dataprivacy","addpurpose_form",this.contextId,b)},i.prototype.setupFormModal=function(a,b){a.setLarge(),a.setSaveButtonText(b),a.getRoot().on(f.hidden,this.destroy.bind(this)),a.setBody(this.getBody()),a.getRoot().on(f.save,this.submitForm.bind(this)),a.getRoot().on("submit","form",this.submitFormAjax.bind(this)),this.modal=a,a.show()},i.prototype.submitForm=function(a){a.preventDefault(),this.modal.getRoot().find("form").submit()},i.prototype.submitFormAjax=function(a){a.preventDefault();var b=this.modal.getRoot().find("form").serialize();c.call([{methodname:"tool_dataprivacy_create_purpose_form",args:{jsonformdata:JSON.stringify(b)},done:function(a){a.validationerrors?this.modal.setBody(this.getBody(b)):this.close()}.bind(this),fail:d.exception}])},i.prototype.close=function(){this.destroy(),document.location.reload()},i.prototype.destroy=function(){Y.use("moodle-core-formchangechecker",function(){M.core_formchangechecker.reset_form_dirty_state()}),this.modal.destroy()},i.prototype.removeListeners=function(){a(h.PURPOSE_LINK).off("click")},{getInstance:function(a){return new i(a)}}});
@@ -0,0 +1 @@
define(["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events"],function(a,b,c,d,e,f){var g={DELETE:'[data-action="deletecategory"]'},h=function(){this.registerEvents()};return h.prototype.registerEvents=function(){a(g.DELETE).click(function(g){g.preventDefault();var h=a(this).data("id"),i=a(this).data("name"),j=[{key:"deletecategory",component:"tool_dataprivacy"},{key:"deletecategorytext",component:"tool_dataprivacy",param:i},{key:"delete"}];d.get_strings(j).then(function(d){var g=d[0],i=d[1],j=d[2];return e.create({title:g,body:i,type:e.types.SAVE_CANCEL}).then(function(d){return d.setSaveButtonText(j),d.getRoot().on(f.save,function(){var d={methodname:"tool_dataprivacy_delete_category",args:{id:h}};b.call([d])[0].done(function(b){b.result?a('tr[data-categoryid="'+h+'"]').remove():c.addNotification({message:b.warnings[0].message,type:"error"})}).fail(c.exception)}),d.getRoot().on(f.hidden,function(){d.destroy()}),d})}).done(function(a){a.show()}).fail(c.exception)})},{init:function(){return new h}}});
+1
View File
@@ -0,0 +1 @@
define(["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events"],function(a,b,c,d,e,f){function g(a){var g=[{key:"confirm",component:"moodle"},{key:"confirmcontextdeletion",component:"tool_dataprivacy"}],h="tool_dataprivacy_confirm_contexts_for_deletion",i="";d.get_strings(g).then(function(a){i=a[0];var b=a[1];return e.create({title:i,body:b,type:e.types.SAVE_CANCEL})}).then(function(d){return d.setSaveButtonText(i),d.getRoot().on(f.save,function(){var d={ids:a},e={methodname:h,args:d};b.call([e])[0].done(function(a){a.result?window.location.reload():c.addNotification({message:a.warnings[0].message,type:"error"})}).fail(c.exception)}),d.getRoot().on(f.hidden,function(){d.destroy()}),d}).done(function(a){a.show()}).fail(c.exception)}var h={MARK_FOR_DELETION:'[data-action="markfordeletion"]',SELECT_ALL:'[data-action="selectall"]'},i={SELECTCONTEXT:".selectcontext"},j=function(){this.registerEvents()};return j.prototype.registerEvents=function(){a(h.MARK_FOR_DELETION).click(function(b){b.preventDefault();var c=[];a(i.SELECTCONTEXT).each(function(){var b=a(this);b.is(":checked")&&c.push(b.val())}),g(c)}),a(h.SELECT_ALL).change(function(b){b.preventDefault();var c=a(this);c.is(":checked")?a(i.SELECTCONTEXT).attr("checked","checked"):a(i.SELECTCONTEXT).removeAttr("checked")})},j});
+1
View File
@@ -0,0 +1 @@
define(["jquery","core/str","core/ajax","core/notification","core/templates","core/modal_factory","core/modal_events","core/fragment","tool_dataprivacy/add_purpose","tool_dataprivacy/add_category"],function(a,b,c,d,e,f,g,h,i,j){var k={TREE_NODES:"[data-context-tree-node=1]",FORM_CONTAINER:"#context-form-container"},l=function(a,b,c){this.systemContextId=a,this.currentContextLevel=b,this.currentContextId=c,this.init()};return l.prototype.systemContextId=0,l.prototype.currentContextLevel=0,l.prototype.currentContextId=0,l.prototype.addpurpose=null,l.prototype.addcategory=null,l.prototype.init=function(){this.addpurpose=i.getInstance(this.systemContextId),this.addcategory=j.getInstance(this.systemContextId);var a=[{key:"changessaved",component:"moodle"},{key:"contextpurposecategorysaved",component:"tool_dataprivacy"},{key:"noblockstoload",component:"tool_dataprivacy"},{key:"noactivitiestoload",component:"tool_dataprivacy"},{key:"nocoursestoload",component:"tool_dataprivacy"}];this.strings=b.get_strings(a),this.registerEventListeners(),this.currentContextId?this.loadForm("context_form",[this.currentContextId],this.submitContextFormAjax.bind(this)):this.loadForm("contextlevel_form",[this.currentContextLevel],this.submitContextLevelFormAjax.bind(this))},l.prototype.registerEventListeners=function(){a(k.TREE_NODES).on("click",function(b){b.preventDefault();var c=a(b.currentTarget);a(k.TREE_NODES).removeClass("active"),c.addClass("active");var d=c.data("contextlevel"),e=c.data("contextid");if(d)window.history.pushState({},null,"?contextlevel="+d),this.addpurpose.removeListeners(),this.addcategory.removeListeners(),this.currentContextLevel=d,this.loadForm("contextlevel_form",[this.currentContextLevel],this.submitContextLevelFormAjax.bind(this));else if(e)window.history.pushState({},null,"?contextid="+e),this.addpurpose.removeListeners(),this.addcategory.removeListeners(),this.currentContextId=e,this.loadForm("context_form",[this.currentContextId],this.submitContextFormAjax.bind(this));else{var f=c.data("expandcontextid"),g=c.data("expandelement"),h=c.data("expanded");g&&(h?this.collapse(c):!c.data("loaded")&&f&&g?(c.find("> i").removeClass("fa-plus"),c.find("> i").addClass("fa-circle-o-notch fa-spin"),this.loadExtra(c,f,g)):this.expand(c))}}.bind(this))},l.prototype.removeListeners=function(){a(k.TREE_NODES).off("click")},l.prototype.loadForm=function(b,c,f){this.clearForm();var g=h.loadFragment("tool_dataprivacy",b,this.systemContextId,c);g.done(function(b,c){a(k.FORM_CONTAINER).html(b),e.runTemplateJS(c),this.addpurpose.registerEventListeners(),this.addcategory.registerEventListeners(),a(k.FORM_CONTAINER).on("submit","form",f)}.bind(this)).fail(d.exception)},l.prototype.clearForm=function(){Y.use("moodle-core-formchangechecker",function(){M.core_formchangechecker.reset_form_dirty_state()}),a(k.FORM_CONTAINER).off("submit","form")},l.prototype.submitForm=function(b){b.preventDefault(),a(k.FORM_CONTAINER).find("form").submit()},l.prototype.submitContextLevelFormAjax=function(a){this.submitFormAjax(a,"tool_dataprivacy_set_contextlevel_form")},l.prototype.submitContextFormAjax=function(a){this.submitFormAjax(a,"tool_dataprivacy_set_context_form")},l.prototype.submitFormAjax=function(b,e){b.preventDefault();var f=a(k.FORM_CONTAINER).find("form").serialize();return this.strings.then(function(a){c.call([{methodname:e,args:{jsonformdata:JSON.stringify(f)},done:function(){d.alert(a[0],a[1])},fail:d.exception}])})["catch"](d.exception)},l.prototype.loadExtra=function(a,b,f){c.call([{methodname:"tool_dataprivacy_tree_extra_branches",args:{contextid:b,element:f},done:function(b){return 0==b.branches.length?void this.noElements(a,f):void e.render("tool_dataprivacy/context_tree_branches",b).then(function(b){a.after(b),this.removeListeners(),this.registerEventListeners(),this.expand(a),a.data("loaded",1)}.bind(this)).fail(d.exception)}.bind(this),fail:d.exception}])},l.prototype.noElements=function(a,b){a.data("expandcontextid",""),a.data("expandelement",""),this.strings.then(function(c){var d=2;"module"==b?d=3:"course"==b&&(d=4),a.text(c[d])}).fail(d.exception)},l.prototype.collapse=function(a){a.data("expanded",0),a.siblings("nav").addClass("hidden"),a.find("> i").removeClass("fa-minus"),a.find("> i").addClass("fa-plus")},l.prototype.expand=function(a){a.data("expanded",1),a.siblings("nav").removeClass("hidden"),a.find("> i").removeClass("fa-plus"),a.find("> i").removeClass("fa-circle-o-notch fa-spin"),a.find("> i").addClass("fa-minus")},{init:function(a,b,c){return new l(a,b,c)}}});
@@ -0,0 +1 @@
define(["jquery","core/notification","core/custom_interaction_events","core/modal","core/modal_registry","tool_dataprivacy/events"],function(a,b,c,d,e,f){var g=!1,h={APPROVE_BUTTON:'[data-action="approve"]',DENY_BUTTON:'[data-action="deny"]',COMPLETE_BUTTON:'[data-action="complete"]'},i=function(a){d.call(this,a)};return i.TYPE="tool_dataprivacy-data_request",i.prototype=Object.create(d.prototype),i.prototype.constructor=i,i.prototype.registerEventListeners=function(){d.prototype.registerEventListeners.call(this),this.getModal().on(c.events.activate,h.APPROVE_BUTTON,function(b,c){var d=a.Event(f.approve);this.getRoot().trigger(d,this),d.isDefaultPrevented()||(this.hide(),c.originalEvent.preventDefault())}.bind(this)),this.getModal().on(c.events.activate,h.DENY_BUTTON,function(b,c){var d=a.Event(f.deny);this.getRoot().trigger(d,this),d.isDefaultPrevented()||(this.hide(),c.originalEvent.preventDefault())}.bind(this)),this.getModal().on(c.events.activate,h.COMPLETE_BUTTON,function(b,c){var d=a.Event(f.complete);this.getRoot().trigger(d,this),d.isDefaultPrevented()||(this.hide(),c.originalEvent.preventDefault())}.bind(this))},g||(e.register(i.TYPE,i,"tool_dataprivacy/data_request_modal"),g=!0),i});
@@ -0,0 +1 @@
define(["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events","core/templates"],function(a,b,c,d,e,f,g){function h(b,d,h,j,k,l,m,n){null!==h&&l.forEach(function(a){a.id===h&&(a.selected=!0)}),null!==j&&m.forEach(function(a){a.id===j&&(a.selected=!0)});var o={contextlevel:d,categoryoptions:l,purposeoptions:m};null!==n&&n.length&&(null===k?o.newactivitydefaults=!0:n.forEach(function(a){k===a.name&&(a.selected=!0)}),o.modemodule=!0,o.activityoptions=n),e.create({title:b,body:g.render("tool_dataprivacy/category_purpose_form",o),type:e.types.SAVE_CANCEL,large:!0}).then(function(b){return b.getRoot().on(f.save,function(){var b=a("#activity"),c="undefined"!=typeof b?b.val():null,d=a("#override"),e="undefined"!=typeof d&&d.is(":checked");i(a("#contextlevel").val(),a("#category").val(),a("#purpose").val(),c,e)}),b.getRoot().on(f.hidden,function(){b.destroy()}),b.show(),b})["catch"](c.exception)}function i(a,c,d,e,f){var g={methodname:"tool_dataprivacy_set_context_defaults",args:{contextlevel:a,category:c,purpose:d,override:f,activity:e}};b.call([g])[0].done(function(a){a.result&&window.location.reload()})}var j={EDIT_LEVEL_DEFAULTS:'[data-action="edit-level-defaults"]',NEW_ACTIVITY_DEFAULTS:'[data-action="new-activity-defaults"]',EDIT_ACTIVITY_DEFAULTS:'[data-action="edit-activity-defaults"]',DELETE_ACTIVITY_DEFAULTS:'[data-action="delete-activity-defaults"]'},k=-1,l=function(){this.registerEvents()};return l.prototype.registerEvents=function(){a(j.EDIT_LEVEL_DEFAULTS).click(function(e){e.preventDefault();var f=a(this),g=f.data("contextlevel"),i=f.data("category"),j=f.data("purpose"),k=[{methodname:"tool_dataprivacy_get_category_options",args:{}},{methodname:"tool_dataprivacy_get_purpose_options",args:{}}],l=b.call(k),m=d.get_string("editdefaults","tool_dataprivacy",a("#defaults-header").text());a.when(l[0],l[1],m).then(function(a,b,c){var d=a.options,e=b.options;return h(c,g,i,j,null,d,e,null),!0})["catch"](c.exception)}),a(j.NEW_ACTIVITY_DEFAULTS).click(function(e){e.preventDefault();var f=a(this),g=f.data("contextlevel"),i=[{methodname:"tool_dataprivacy_get_category_options",args:{}},{methodname:"tool_dataprivacy_get_purpose_options",args:{}},{methodname:"tool_dataprivacy_get_activity_options",args:{nodefaults:!0}}],j=b.call(i),k=d.get_string("addnewdefaults","tool_dataprivacy");a.when(j[0],j[1],j[2],k).then(function(a,b,c,d){var e=a.options,f=b.options,i=c.options;return h(d,g,null,null,null,e,f,i),!0})["catch"](c.exception)}),a(j.EDIT_ACTIVITY_DEFAULTS).click(function(e){e.preventDefault();var f=a(this),g=f.data("contextlevel"),i=f.data("category"),j=f.data("purpose"),k=f.data("activityname"),l=[{methodname:"tool_dataprivacy_get_category_options",args:{}},{methodname:"tool_dataprivacy_get_purpose_options",args:{}},{methodname:"tool_dataprivacy_get_activity_options",args:{}}],m=b.call(l),n=d.get_string("editmoduledefaults","tool_dataprivacy");a.when(m[0],m[1],m[2],n).then(function(a,b,c,d){var e=a.options,f=b.options,l=c.options;return h(d,g,i,j,k,e,f,l),!0})["catch"](c.exception)}),a(j.DELETE_ACTIVITY_DEFAULTS).click(function(b){b.preventDefault();var h=a(this),j=h.data("contextlevel"),l=h.data("activityname"),m=h.data("activitydisplayname"),n=k,o=k;e.create({title:d.get_string("deletedefaults","tool_dataprivacy",m),body:g.render("tool_dataprivacy/delete_activity_defaults",{activityname:m}),type:e.types.SAVE_CANCEL,large:!0}).then(function(a){return a.setSaveButtonText(d.get_string("delete")),a.getRoot().on(f.save,function(){i(j,n,o,l,!1)}),a.getRoot().on(f.hidden,function(){a.destroy()}),a.show(),!0})["catch"](c.exception)})},{init:function(){return new l}}});
@@ -0,0 +1 @@
define(["jquery"],function(a){var b={PURPOSE_SELECT:"#id_purposeid",RETENTION_FIELD_BOOST:"#id_error_retention_current",RETENTION_FIELD_CLEAN:"#fitem_id_retention_current [data-fieldtype=static]"},c=function(a){this.purposeRetentionPeriods=a,this.registerEventListeners()},d=function(){a(b.PURPOSE_SELECT).off("change")};return c.prototype.purposeRetentionPeriods=[],c.prototype.registerEventListeners=function(){a(b.PURPOSE_SELECT).on("change",function(c){var d=a(c.currentTarget).val(),e=this.purposeRetentionPeriods[d],f=a(b.RETENTION_FIELD_CLEAN);if(f.length>0)f.text(e);else{var g=a(b.RETENTION_FIELD_BOOST),h=g.siblings();h.length>0&&h.text(e)}}.bind(this))},{init:function(a){return d(),new c(a)}}});
+1
View File
@@ -0,0 +1 @@
define([],function(){return{approve:"tool_dataprivacy-data_request:approve",bulkApprove:"tool_dataprivacy-data_request:bulk_approve",deny:"tool_dataprivacy-data_request:deny",bulkDeny:"tool_dataprivacy-data_request:bulk_deny",complete:"tool_dataprivacy-data_request:complete"}});
@@ -0,0 +1 @@
define(["jquery","core/url","core/str"],function(a,b,c){var d=a('<img alt="" src="'+b.imageUrl("t/expanded")+'"/>'),e=a('<img alt="" src="'+b.imageUrl("t/collapsed")+'"/>');return{expandCollapse:function(a,b){a.hasClass("hide")?(a.removeClass("hide"),a.addClass("visible"),a.attr("aria-expanded",!0),b.find(":header i.fa").removeClass("fa-plus-square"),b.find(":header i.fa").addClass("fa-minus-square"),b.find(":header img.icon").attr("src",d.attr("src"))):(a.removeClass("visible"),a.addClass("hide"),a.attr("aria-expanded",!1),b.find(":header i.fa").removeClass("fa-minus-square"),b.find(":header i.fa").addClass("fa-plus-square"),b.find(":header img.icon").attr("src",e.attr("src")))},expandCollapseAll:function(b){var f="visible"==b?"hide":"visible",g="visible"==b,h="visible"==b?"fa-plus-square":"fa-minus-square",i="visible"==b?"fa-minus-square":"fa-plus-square",j="visible"==b?d.attr("src"):e.attr("src");a("."+f).each(function(){a(this).removeClass(f),a(this).addClass(b),a(this).attr("aria-expanded",g)}),a(".tool_dataprivacy-expand-all").data("visibilityState",f),c.get_string(f,"tool_dataprivacy").then(function(b){a(".tool_dataprivacy-expand-all").html(b)})["catch"](Notification.exception),a(":header i.fa").each(function(){a(this).removeClass(h),a(this).addClass(i)}),a(":header img.icon").each(function(){a(this).attr("src",j)})}}});
@@ -0,0 +1 @@
define(["jquery","core/ajax","core/templates"],function(a,b,c){return{processResults:function(b,c){var d=[];return a.each(c,function(a,b){d.push({value:b.id,label:b._label})}),d},transport:function(d,e,f,g){var h;h=b.call([{methodname:"tool_dataprivacy_get_users",args:{query:e}}]),h[0].then(function(b){var d=[],e=0;return a.each(b,function(a,b){d.push(c.render("tool_dataprivacy/form-user-selector-suggestion",b))}),a.when.apply(a.when,d).then(function(){var c=arguments;a.each(b,function(a,b){b._label=c[e],e++}),f(b)})}).fail(g)}}});
@@ -0,0 +1 @@
define(["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events","core/templates"],function(a,b,c,d,e,f,g){function h(a){var e={methodname:"tool_dataprivacy_contact_dpo",args:{message:a}},f="success";b.call([e])[0].then(function(a){return a.result?d.get_string("requestsubmitted","tool_dataprivacy"):(f="error",a.warnings.join("<br>"))}).done(function(a){c.addNotification({message:a,type:f})}).fail(c.exception)}var i={CANCEL_REQUEST:'[data-action="cancel"]',CONTACT_DPO:'[data-action="contactdpo"]'},j=function(){this.registerEvents()};return j.prototype.registerEvents=function(){a(i.CANCEL_REQUEST).click(function(g){g.preventDefault();var h=a(this).data("requestid"),i=[{key:"cancelrequest",component:"tool_dataprivacy"},{key:"cancelrequestconfirmation",component:"tool_dataprivacy"}];d.get_strings(i).then(function(a){var d=a[0],g=a[1];return e.create({title:d,body:g,type:e.types.SAVE_CANCEL}).then(function(a){return a.setSaveButtonText(d),a.getRoot().on(f.save,function(){var a={requestid:h},d={methodname:"tool_dataprivacy_cancel_data_request",args:a};b.call([d])[0].done(function(a){a.result?window.location.reload():c.addNotification({message:a.warnings[0].message,type:"error"})}).fail(c.exception)}),a.getRoot().on(f.hidden,function(){a.destroy()}),a})}).done(function(a){a.show()}).fail(c.exception)}),a(i.CONTACT_DPO).click(function(b){b.preventDefault();var i=a(this).data("replytoemail"),j=[{key:"contactdataprotectionofficer",component:"tool_dataprivacy"},{key:"send",component:"tool_dataprivacy"}],k="";d.get_strings(j).then(function(a){var b=a[0];k=a[1];var c={replytoemail:i};return e.create({title:b,body:g.render("tool_dataprivacy/contact_dpo",c),type:e.types.SAVE_CANCEL,large:!0})}).done(function(b){b.setSaveButtonText(k),b.getRoot().on(f.save,function(b){var c=a("#message").val().trim();0===c.length?(b.preventDefault(),a('[data-region="messageinput"]').addClass("has-danger notifyproblem"),a("#id_error_message").removeAttr("hidden")):h(c)}),b.getRoot().on(f.hidden,function(){b.destroy()}),b.show()}).fail(c.exception)})},{init:function(){return new j}}});
@@ -0,0 +1 @@
define(["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events"],function(a,b,c,d,e,f){var g={DELETE:'[data-action="deletepurpose"]'},h=function(){this.registerEvents()};return h.prototype.registerEvents=function(){a(g.DELETE).click(function(g){g.preventDefault();var h=a(this).data("id"),i=a(this).data("name"),j=[{key:"deletepurpose",component:"tool_dataprivacy"},{key:"deletepurposetext",component:"tool_dataprivacy",param:i},{key:"delete"}];d.get_strings(j).then(function(d){var g=d[0],i=d[1],j=d[2];return e.create({title:g,body:i,type:e.types.SAVE_CANCEL}).then(function(d){return d.setSaveButtonText(j),d.getRoot().on(f.save,function(){var d={methodname:"tool_dataprivacy_delete_purpose",args:{id:h}};b.call([d])[0].done(function(b){b.result?a('tr[data-purposeid="'+h+'"]').remove():c.addNotification({message:b.warnings[0].message,type:"error"})}).fail(c.exception)}),d.getRoot().on(f.hidden,function(){d.destroy()}),d})}).done(function(a){a.show()}).fail(c.exception)})},{init:function(){return new h}}});
@@ -0,0 +1 @@
define(["jquery","core/form-autocomplete","core/str","core/notification"],function(a,b,c,d){var e={REQUEST_FILTERS:"#request-filters"},f=function(){var f=[{key:"filter",component:"moodle"},{key:"nofiltersapplied",component:"moodle"}];c.get_strings(f).then(function(a){var c=a[0],d=a[1];return b.enhance(e.REQUEST_FILTERS,!1,"",c,!1,!0,d,!0)}).fail(d.exception);var g=a(e.REQUEST_FILTERS).val();a(e.REQUEST_FILTERS).on("change",function(){var b=a(this).val();g.join(",")!==b.join(",")&&(0===b.length&&a("#filters-cleared").val(1),a(this.form).submit())})};return{init:function(){f()}}});
@@ -0,0 +1 @@
define(["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events","core/templates","tool_dataprivacy/data_request_modal","tool_dataprivacy/events"],function(a,b,c,d,e,f,g,h,i){function j(a){return{wsfunction:"tool_dataprivacy_approve_data_request",wsparams:{requestid:a}}}function k(a){return{wsfunction:"tool_dataprivacy_bulk_approve_data_requests",wsparams:{requestids:a}}}function l(a){return{wsfunction:"tool_dataprivacy_deny_data_request",wsparams:{requestid:a}}}function m(a){return{wsfunction:"tool_dataprivacy_bulk_deny_data_requests",wsparams:{requestids:a}}}function n(a){return{wsfunction:"tool_dataprivacy_mark_complete",wsparams:{requestid:a}}}function o(a,b){var g=[];switch(a){case i.approve:g=[{key:"approverequest",component:"tool_dataprivacy"},{key:"confirmapproval",component:"tool_dataprivacy"}];break;case i.bulkApprove:g=[{key:"bulkapproverequests",component:"tool_dataprivacy"},{key:"confirmbulkapproval",component:"tool_dataprivacy"}];break;case i.deny:g=[{key:"denyrequest",component:"tool_dataprivacy"},{key:"confirmdenial",component:"tool_dataprivacy"}];break;case i.bulkDeny:g=[{key:"bulkdenyrequests",component:"tool_dataprivacy"},{key:"confirmbulkdenial",component:"tool_dataprivacy"}];break;case i.complete:g=[{key:"markcomplete",component:"tool_dataprivacy"},{key:"confirmcompletion",component:"tool_dataprivacy"}]}var h="";d.get_strings(g).then(function(a){h=a[0];var b=a[1];return e.create({title:h,body:b,type:e.types.SAVE_CANCEL})}).then(function(a){a.setSaveButtonText(h),a.getRoot().on(f.save,function(){p(b.wsfunction,b.wsparams)}),a.getRoot().on(f.hidden,function(){a.destroy()}),a.show()})["catch"](c.exception)}function p(a,d){var e={methodname:a,args:d};b.call([e])[0].done(function(a){a.result?window.location.reload():c.addNotification({message:a.warnings[0].message,type:"error"})}).fail(c.exception)}var q={APPROVE_REQUEST:'[data-action="approve"]',DENY_REQUEST:'[data-action="deny"]',VIEW_REQUEST:'[data-action="view"]',MARK_COMPLETE:'[data-action="complete"]',CHANGE_BULK_ACTION:'[id="bulk-action"]',CONFIRM_BULK_ACTION:'[id="confirm-bulk-action"]',SELECT_ALL:'[data-action="selectall"]'},r={APPROVE:1,DENY:2},s={SELECT_REQUEST:".selectrequests"},t=function(){this.registerEvents()};return t.prototype.registerEvents=function(){a(q.VIEW_REQUEST).click(function(d){d.preventDefault();var k=a(this).data("requestid"),m={requestid:k},n={methodname:"tool_dataprivacy_get_data_request",args:m},q=b.call([n]);a.when(q[0]).then(function(a){return a.result?a.result:(c.addNotification({message:a.warnings[0].message,type:"error"}),!1)}).then(function(a){var b=g.render("tool_dataprivacy/request_details",a),c={approvedeny:a.approvedeny,canmarkcomplete:a.canmarkcomplete};return e.create({title:a.typename,body:b,type:h.TYPE,large:!0,templateContext:c})}).then(function(a){a.getRoot().on(i.approve,function(){o(i.approve,j(k))}),a.getRoot().on(i.deny,function(){o(i.deny,l(k))}),a.getRoot().on(i.complete,function(){var a={requestid:k};p("tool_dataprivacy_mark_complete",a)}),a.getRoot().on(f.hidden,function(){a.destroy()}),a.show()})["catch"](c.exception)}),a(q.APPROVE_REQUEST).click(function(b){b.preventDefault();var c=a(this).data("requestid");o(i.approve,j(c))}),a(q.DENY_REQUEST).click(function(b){b.preventDefault();var c=a(this).data("requestid");o(i.deny,l(c))}),a(q.MARK_COMPLETE).click(function(b){b.preventDefault();var c=a(this).data("requestid");o(i.complete,n(c))}),a(q.CONFIRM_BULK_ACTION).click(function(){var b=[],e="",f={},g=[{key:"selectbulkaction",component:"tool_dataprivacy"},{key:"selectdatarequests",component:"tool_dataprivacy"},{key:"ok"}],h=parseInt(a("#bulk-action").val());if(h!=r.APPROVE&&h!=r.DENY)return void d.get_strings(g).done(function(a){c.alert("",a[0],a[2])}).fail(c.exception);if(a(".selectrequests:checked").each(function(){b.push(a(this).val())}),b.length<1)return void d.get_strings(g).done(function(a){c.alert("",a[1],a[2])}).fail(c.exception);switch(h){case r.APPROVE:e=i.bulkApprove,f=k(b);break;case r.DENY:e=i.bulkDeny,f=m(b)}o(e,f)}),a(q.SELECT_ALL).change(function(b){b.preventDefault();var c=a(this).is(":checked");a(s.SELECT_REQUEST).prop("checked",c)})},t});
@@ -0,0 +1,172 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Module to add categories.
*
* @module tool_dataprivacy/add_category
* @package tool_dataprivacy
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define(['jquery', 'core/str', 'core/ajax', 'core/notification', 'core/modal_factory', 'core/modal_events', 'core/fragment'],
function($, Str, Ajax, Notification, ModalFactory, ModalEvents, Fragment) {
var SELECTORS = {
CATEGORY_LINK: '[data-add-element="category"]',
};
var AddCategory = function(contextId) {
this.contextId = contextId;
var stringKeys = [
{
key: 'addcategory',
component: 'tool_dataprivacy'
},
{
key: 'save',
component: 'admin'
}
];
this.strings = Str.get_strings(stringKeys);
this.registerEventListeners();
};
/**
* @var {int} contextId
* @private
*/
AddCategory.prototype.contextId = 0;
/**
* @var {Promise}
* @private
*/
AddCategory.prototype.strings = 0;
AddCategory.prototype.registerEventListeners = function() {
var trigger = $(SELECTORS.CATEGORY_LINK);
trigger.on('click', function() {
return this.strings.then(function(strings) {
ModalFactory.create({
type: ModalFactory.types.SAVE_CANCEL,
title: strings[0],
body: '',
}, trigger).done(function(modal) {
this.setupFormModal(modal, strings[1]);
}.bind(this));
}.bind(this))
.fail(Notification.exception);
}.bind(this));
};
/**
* @method getBody
* @param {Object} formdata
* @private
* @return {Promise}
*/
AddCategory.prototype.getBody = function(formdata) {
var params = null;
if (typeof formdata !== "undefined") {
params = {jsonformdata: JSON.stringify(formdata)};
}
// Get the content of the modal.
return Fragment.loadFragment('tool_dataprivacy', 'addcategory_form', this.contextId, params);
};
AddCategory.prototype.setupFormModal = function(modal, saveText) {
modal.setLarge();
modal.setSaveButtonText(saveText);
// We want to reset the form every time it is opened.
modal.getRoot().on(ModalEvents.hidden, this.destroy.bind(this));
modal.setBody(this.getBody());
// We catch the modal save event, and use it to submit the form inside the modal.
// Triggering a form submission will give JS validation scripts a chance to check for errors.
modal.getRoot().on(ModalEvents.save, this.submitForm.bind(this));
// We also catch the form submit event and use it to submit the form with ajax.
modal.getRoot().on('submit', 'form', this.submitFormAjax.bind(this));
this.modal = modal;
modal.show();
};
/**
* This triggers a form submission, so that any mform elements can do final tricks before the form submission is processed.
*
* @method submitForm
* @param {Event} e Form submission event.
* @private
*/
AddCategory.prototype.submitForm = function(e) {
e.preventDefault();
this.modal.getRoot().find('form').submit();
};
AddCategory.prototype.submitFormAjax = function(e) {
// We don't want to do a real form submission.
e.preventDefault();
// Convert all the form elements values to a serialised string.
var formData = this.modal.getRoot().find('form').serialize();
Ajax.call([{
methodname: 'tool_dataprivacy_create_category_form',
args: {jsonformdata: JSON.stringify(formData)},
done: function(data) {
if (data.validationerrors) {
this.modal.setBody(this.getBody(formData));
} else {
this.close();
}
}.bind(this),
fail: Notification.exception
}]);
};
AddCategory.prototype.close = function() {
this.destroy();
document.location.reload();
};
AddCategory.prototype.destroy = function() {
Y.use('moodle-core-formchangechecker', function() {
M.core_formchangechecker.reset_form_dirty_state();
});
this.modal.destroy();
};
AddCategory.prototype.removeListeners = function() {
$(SELECTORS.CATEGORY_LINK).off('click');
};
return /** @alias module:tool_dataprivacy/add_category */ {
getInstance: function(contextId) {
return new AddCategory(contextId);
}
};
}
);
@@ -0,0 +1,173 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Module to add purposes.
*
* @module tool_dataprivacy/add_purpose
* @package tool_dataprivacy
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define(['jquery', 'core/str', 'core/ajax', 'core/notification', 'core/modal_factory', 'core/modal_events', 'core/fragment'],
function($, Str, Ajax, Notification, ModalFactory, ModalEvents, Fragment) {
var SELECTORS = {
PURPOSE_LINK: '[data-add-element="purpose"]',
};
var AddPurpose = function(contextId) {
this.contextId = contextId;
var stringKeys = [
{
key: 'addpurpose',
component: 'tool_dataprivacy'
},
{
key: 'save',
component: 'admin'
}
];
this.strings = Str.get_strings(stringKeys);
this.registerEventListeners();
};
/**
* @var {int} contextId
* @private
*/
AddPurpose.prototype.contextId = 0;
/**
* @var {Promise}
* @private
*/
AddPurpose.prototype.strings = 0;
AddPurpose.prototype.registerEventListeners = function() {
var trigger = $(SELECTORS.PURPOSE_LINK);
trigger.on('click', function() {
return this.strings.then(function(strings) {
ModalFactory.create({
type: ModalFactory.types.SAVE_CANCEL,
title: strings[0],
body: '',
}, trigger).done(function(modal) {
this.setupFormModal(modal, strings[1]);
}.bind(this));
}.bind(this))
.fail(Notification.exception);
}.bind(this));
};
/**
* @method getBody
* @param {Object} formdata
* @private
* @return {Promise}
*/
AddPurpose.prototype.getBody = function(formdata) {
var params = null;
if (typeof formdata !== "undefined") {
params = {jsonformdata: JSON.stringify(formdata)};
}
// Get the content of the modal.
return Fragment.loadFragment('tool_dataprivacy', 'addpurpose_form', this.contextId, params);
};
AddPurpose.prototype.setupFormModal = function(modal, saveText) {
modal.setLarge();
modal.setSaveButtonText(saveText);
// We want to reset the form every time it is opened.
modal.getRoot().on(ModalEvents.hidden, this.destroy.bind(this));
modal.setBody(this.getBody());
// We catch the modal save event, and use it to submit the form inside the modal.
// Triggering a form submission will give JS validation scripts a chance to check for errors.
modal.getRoot().on(ModalEvents.save, this.submitForm.bind(this));
// We also catch the form submit event and use it to submit the form with ajax.
modal.getRoot().on('submit', 'form', this.submitFormAjax.bind(this));
this.modal = modal;
modal.show();
};
/**
* This triggers a form submission, so that any mform elements can do final tricks before the form submission is processed.
*
* @method submitForm
* @param {Event} e Form submission event.
* @private
*/
AddPurpose.prototype.submitForm = function(e) {
e.preventDefault();
this.modal.getRoot().find('form').submit();
};
AddPurpose.prototype.submitFormAjax = function(e) {
// We don't want to do a real form submission.
e.preventDefault();
// Convert all the form elements values to a serialised string.
var formData = this.modal.getRoot().find('form').serialize();
Ajax.call([{
methodname: 'tool_dataprivacy_create_purpose_form',
args: {jsonformdata: JSON.stringify(formData)},
done: function(data) {
if (data.validationerrors) {
this.modal.setBody(this.getBody(formData));
} else {
this.close();
}
}.bind(this),
fail: Notification.exception
}]);
};
AddPurpose.prototype.close = function() {
this.destroy();
document.location.reload();
};
AddPurpose.prototype.destroy = function() {
Y.use('moodle-core-formchangechecker', function() {
M.core_formchangechecker.reset_form_dirty_state();
});
this.modal.destroy();
};
AddPurpose.prototype.removeListeners = function() {
$(SELECTORS.PURPOSE_LINK).off('click');
};
return /** @alias module:tool_dataprivacy/add_purpose */ {
getInstance: function(contextId) {
return new AddPurpose(contextId);
}
};
}
);
@@ -0,0 +1,132 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* AMD module for categories actions.
*
* @module tool_dataprivacy/categoriesactions
* @package tool_dataprivacy
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define([
'jquery',
'core/ajax',
'core/notification',
'core/str',
'core/modal_factory',
'core/modal_events'],
function($, Ajax, Notification, Str, ModalFactory, ModalEvents) {
/**
* List of action selectors.
*
* @type {{DELETE: string}}
*/
var ACTIONS = {
DELETE: '[data-action="deletecategory"]',
};
/**
* CategoriesActions class.
*/
var CategoriesActions = function() {
this.registerEvents();
};
/**
* Register event listeners.
*/
CategoriesActions.prototype.registerEvents = function() {
$(ACTIONS.DELETE).click(function(e) {
e.preventDefault();
var id = $(this).data('id');
var categoryname = $(this).data('name');
var stringkeys = [
{
key: 'deletecategory',
component: 'tool_dataprivacy'
},
{
key: 'deletecategorytext',
component: 'tool_dataprivacy',
param: categoryname
},
{
key: 'delete'
}
];
Str.get_strings(stringkeys).then(function(langStrings) {
var title = langStrings[0];
var confirmMessage = langStrings[1];
var buttonText = langStrings[2];
return ModalFactory.create({
title: title,
body: confirmMessage,
type: ModalFactory.types.SAVE_CANCEL
}).then(function(modal) {
modal.setSaveButtonText(buttonText);
// Handle save event.
modal.getRoot().on(ModalEvents.save, function() {
var request = {
methodname: 'tool_dataprivacy_delete_category',
args: {'id': id}
};
Ajax.call([request])[0].done(function(data) {
if (data.result) {
$('tr[data-categoryid="' + id + '"]').remove();
} else {
Notification.addNotification({
message: data.warnings[0].message,
type: 'error'
});
}
}).fail(Notification.exception);
});
// Handle hidden event.
modal.getRoot().on(ModalEvents.hidden, function() {
// Destroy when hidden.
modal.destroy();
});
return modal;
});
}).done(function(modal) {
modal.show();
}).fail(Notification.exception);
});
};
return /** @alias module:tool_dataprivacy/categoriesactions */ {
// Public variables and functions.
/**
* Initialise the module.
*
* @method init
* @return {CategoriesActions}
*/
'init': function() {
return new CategoriesActions();
}
};
});
@@ -0,0 +1,156 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Request actions.
*
* @module tool_dataprivacy/data_deletion
* @package tool_dataprivacy
* @copyright 2018 Jun Pataleta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define([
'jquery',
'core/ajax',
'core/notification',
'core/str',
'core/modal_factory',
'core/modal_events'],
function($, Ajax, Notification, Str, ModalFactory, ModalEvents) {
/**
* List of action selectors.
*
* @type {{MARK_FOR_DELETION: string}}
* @type {{SELECT_ALL: string}}
*/
var ACTIONS = {
MARK_FOR_DELETION: '[data-action="markfordeletion"]',
SELECT_ALL: '[data-action="selectall"]',
};
/**
* List of selectors.
*
* @type {{SELECTCONTEXT: string}}
*/
var SELECTORS = {
SELECTCONTEXT: '.selectcontext',
};
/**
* DataDeletionActions class.
*/
var DataDeletionActions = function() {
this.registerEvents();
};
/**
* Register event listeners.
*/
DataDeletionActions.prototype.registerEvents = function() {
$(ACTIONS.MARK_FOR_DELETION).click(function(e) {
e.preventDefault();
var selectedIds = [];
$(SELECTORS.SELECTCONTEXT).each(function() {
var checkbox = $(this);
if (checkbox.is(':checked')) {
selectedIds.push(checkbox.val());
}
});
showConfirmation(selectedIds);
});
$(ACTIONS.SELECT_ALL).change(function(e) {
e.preventDefault();
var selectallnone = $(this);
if (selectallnone.is(':checked')) {
$(SELECTORS.SELECTCONTEXT).attr('checked', 'checked');
} else {
$(SELECTORS.SELECTCONTEXT).removeAttr('checked');
}
});
};
/**
* Show the confirmation dialogue.
*
* @param {Array} ids The array of expired context record IDs.
*/
function showConfirmation(ids) {
var keys = [
{
key: 'confirm',
component: 'moodle'
},
{
key: 'confirmcontextdeletion',
component: 'tool_dataprivacy'
}
];
var wsfunction = 'tool_dataprivacy_confirm_contexts_for_deletion';
var modalTitle = '';
Str.get_strings(keys).then(function(langStrings) {
modalTitle = langStrings[0];
var confirmMessage = langStrings[1];
return ModalFactory.create({
title: modalTitle,
body: confirmMessage,
type: ModalFactory.types.SAVE_CANCEL
});
}).then(function(modal) {
modal.setSaveButtonText(modalTitle);
// Handle save event.
modal.getRoot().on(ModalEvents.save, function() {
// Confirm the request.
var params = {
'ids': ids
};
var request = {
methodname: wsfunction,
args: params
};
Ajax.call([request])[0].done(function(data) {
if (data.result) {
window.location.reload();
} else {
Notification.addNotification({
message: data.warnings[0].message,
type: 'error'
});
}
}).fail(Notification.exception);
});
// Handle hidden event.
modal.getRoot().on(ModalEvents.hidden, function() {
// Destroy when hidden.
modal.destroy();
});
return modal;
}).done(function(modal) {
modal.show();
}).fail(Notification.exception);
}
return DataDeletionActions;
});
@@ -0,0 +1,318 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Request actions.
*
* @module tool_dataprivacy/data_registry
* @package tool_dataprivacy
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define(['jquery', 'core/str', 'core/ajax', 'core/notification', 'core/templates', 'core/modal_factory',
'core/modal_events', 'core/fragment', 'tool_dataprivacy/add_purpose', 'tool_dataprivacy/add_category'],
function($, Str, Ajax, Notification, Templates, ModalFactory, ModalEvents, Fragment, AddPurpose, AddCategory) {
var SELECTORS = {
TREE_NODES: '[data-context-tree-node=1]',
FORM_CONTAINER: '#context-form-container',
};
var DataRegistry = function(systemContextId, initContextLevel, initContextId) {
this.systemContextId = systemContextId;
this.currentContextLevel = initContextLevel;
this.currentContextId = initContextId;
this.init();
};
/**
* @var {int} systemContextId
* @private
*/
DataRegistry.prototype.systemContextId = 0;
/**
* @var {int} currentContextLevel
* @private
*/
DataRegistry.prototype.currentContextLevel = 0;
/**
* @var {int} currentContextId
* @private
*/
DataRegistry.prototype.currentContextId = 0;
/**
* @var {AddPurpose} addpurpose
* @private
*/
DataRegistry.prototype.addpurpose = null;
/**
* @var {AddCategory} addcategory
* @private
*/
DataRegistry.prototype.addcategory = null;
DataRegistry.prototype.init = function() {
// Add purpose and category modals always at system context.
this.addpurpose = AddPurpose.getInstance(this.systemContextId);
this.addcategory = AddCategory.getInstance(this.systemContextId);
var stringKeys = [
{
key: 'changessaved',
component: 'moodle'
}, {
key: 'contextpurposecategorysaved',
component: 'tool_dataprivacy'
}, {
key: 'noblockstoload',
component: 'tool_dataprivacy'
}, {
key: 'noactivitiestoload',
component: 'tool_dataprivacy'
}, {
key: 'nocoursestoload',
component: 'tool_dataprivacy'
}
];
this.strings = Str.get_strings(stringKeys);
this.registerEventListeners();
// Load the default context level form.
if (this.currentContextId) {
this.loadForm('context_form', [this.currentContextId], this.submitContextFormAjax.bind(this));
} else {
this.loadForm('contextlevel_form', [this.currentContextLevel], this.submitContextLevelFormAjax.bind(this));
}
};
DataRegistry.prototype.registerEventListeners = function() {
$(SELECTORS.TREE_NODES).on('click', function(ev) {
ev.preventDefault();
var trigger = $(ev.currentTarget);
// Active node.
$(SELECTORS.TREE_NODES).removeClass('active');
trigger.addClass('active');
var contextLevel = trigger.data('contextlevel');
var contextId = trigger.data('contextid');
if (contextLevel) {
// Context level level.
window.history.pushState({}, null, '?contextlevel=' + contextLevel);
// Remove previous add purpose and category listeners to avoid memory leaks.
this.addpurpose.removeListeners();
this.addcategory.removeListeners();
// Load the context level form.
this.currentContextLevel = contextLevel;
this.loadForm('contextlevel_form', [this.currentContextLevel], this.submitContextLevelFormAjax.bind(this));
} else if (contextId) {
// Context instance level.
window.history.pushState({}, null, '?contextid=' + contextId);
// Remove previous add purpose and category listeners to avoid memory leaks.
this.addpurpose.removeListeners();
this.addcategory.removeListeners();
// Load the context level form.
this.currentContextId = contextId;
this.loadForm('context_form', [this.currentContextId], this.submitContextFormAjax.bind(this));
} else {
// Expandable nodes.
var expandContextId = trigger.data('expandcontextid');
var expandElement = trigger.data('expandelement');
var expanded = trigger.data('expanded');
// Extra checking that there is an expandElement because we remove it after loading 0 branches.
if (expandElement) {
if (!expanded) {
if (trigger.data('loaded') || !expandContextId || !expandElement) {
this.expand(trigger);
} else {
trigger.find('> i').removeClass('fa-plus');
trigger.find('> i').addClass('fa-circle-o-notch fa-spin');
this.loadExtra(trigger, expandContextId, expandElement);
}
} else {
this.collapse(trigger);
}
}
}
}.bind(this));
};
DataRegistry.prototype.removeListeners = function() {
$(SELECTORS.TREE_NODES).off('click');
};
DataRegistry.prototype.loadForm = function(fragmentName, fragmentArgs, formSubmitCallback) {
this.clearForm();
var fragment = Fragment.loadFragment('tool_dataprivacy', fragmentName, this.systemContextId, fragmentArgs);
fragment.done(function(html, js) {
$(SELECTORS.FORM_CONTAINER).html(html);
Templates.runTemplateJS(js);
this.addpurpose.registerEventListeners();
this.addcategory.registerEventListeners();
// We also catch the form submit event and use it to submit the form with ajax.
$(SELECTORS.FORM_CONTAINER).on('submit', 'form', formSubmitCallback);
}.bind(this)).fail(Notification.exception);
};
DataRegistry.prototype.clearForm = function() {
// For the previously loaded form.
Y.use('moodle-core-formchangechecker', function() {
M.core_formchangechecker.reset_form_dirty_state();
});
// Remove previous listeners.
$(SELECTORS.FORM_CONTAINER).off('submit', 'form');
};
/**
* This triggers a form submission, so that any mform elements can do final tricks before the form submission is processed.
*
* @method submitForm
* @param {Event} e Form submission event.
* @private
*/
DataRegistry.prototype.submitForm = function(e) {
e.preventDefault();
$(SELECTORS.FORM_CONTAINER).find('form').submit();
};
DataRegistry.prototype.submitContextLevelFormAjax = function(e) {
this.submitFormAjax(e, 'tool_dataprivacy_set_contextlevel_form');
};
DataRegistry.prototype.submitContextFormAjax = function(e) {
this.submitFormAjax(e, 'tool_dataprivacy_set_context_form');
};
DataRegistry.prototype.submitFormAjax = function(e, saveMethodName) {
// We don't want to do a real form submission.
e.preventDefault();
// Convert all the form elements values to a serialised string.
var formData = $(SELECTORS.FORM_CONTAINER).find('form').serialize();
return this.strings.then(function(strings) {
Ajax.call([{
methodname: saveMethodName,
args: {jsonformdata: JSON.stringify(formData)},
done: function() {
Notification.alert(strings[0], strings[1]);
},
fail: Notification.exception
}]);
return;
}).catch(Notification.exception);
};
DataRegistry.prototype.loadExtra = function(parentNode, expandContextId, expandElement) {
Ajax.call([{
methodname: 'tool_dataprivacy_tree_extra_branches',
args: {
contextid: expandContextId,
element: expandElement,
},
done: function(data) {
if (data.branches.length == 0) {
this.noElements(parentNode, expandElement);
return;
}
Templates.render('tool_dataprivacy/context_tree_branches', data)
.then(function(html) {
parentNode.after(html);
this.removeListeners();
this.registerEventListeners();
this.expand(parentNode);
parentNode.data('loaded', 1);
return;
}.bind(this))
.fail(Notification.exception);
}.bind(this),
fail: Notification.exception
}]);
};
DataRegistry.prototype.noElements = function(node, expandElement) {
node.data('expandcontextid', '');
node.data('expandelement', '');
this.strings.then(function(strings) {
// 2 = blocks, 3 = activities, 4 = courses (although courses is not likely really).
var key = 2;
if (expandElement == 'module') {
key = 3;
} else if (expandElement == 'course') {
key = 4;
}
node.text(strings[key]);
return;
}).fail(Notification.exception);
};
DataRegistry.prototype.collapse = function(node) {
node.data('expanded', 0);
node.siblings('nav').addClass('hidden');
node.find('> i').removeClass('fa-minus');
node.find('> i').addClass('fa-plus');
};
DataRegistry.prototype.expand = function(node) {
node.data('expanded', 1);
node.siblings('nav').removeClass('hidden');
node.find('> i').removeClass('fa-plus');
// Also remove the spinning one if data was just loaded.
node.find('> i').removeClass('fa-circle-o-notch fa-spin');
node.find('> i').addClass('fa-minus');
};
return /** @alias module:tool_dataprivacy/data_registry */ {
/**
* Initialise the page.
*
* @param {Number} systemContextId
* @param {Number} initContextLevel
* @param {Number} initContextId
* @return {DataRegistry}
*/
init: function(systemContextId, initContextLevel, initContextId) {
return new DataRegistry(systemContextId, initContextLevel, initContextId);
}
};
}
);
@@ -0,0 +1,96 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Request actions.
*
* @module tool_dataprivacy/data_request_modal
* @package tool_dataprivacy
* @copyright 2018 Jun Pataleta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define(['jquery', 'core/notification', 'core/custom_interaction_events', 'core/modal', 'core/modal_registry',
'tool_dataprivacy/events'],
function($, Notification, CustomEvents, Modal, ModalRegistry, DataPrivacyEvents) {
var registered = false;
var SELECTORS = {
APPROVE_BUTTON: '[data-action="approve"]',
DENY_BUTTON: '[data-action="deny"]',
COMPLETE_BUTTON: '[data-action="complete"]'
};
/**
* Constructor for the Modal.
*
* @param {object} root The root jQuery element for the modal
*/
var ModalDataRequest = function(root) {
Modal.call(this, root);
};
ModalDataRequest.TYPE = 'tool_dataprivacy-data_request';
ModalDataRequest.prototype = Object.create(Modal.prototype);
ModalDataRequest.prototype.constructor = ModalDataRequest;
/**
* Set up all of the event handling for the modal.
*
* @method registerEventListeners
*/
ModalDataRequest.prototype.registerEventListeners = function() {
// Apply parent event listeners.
Modal.prototype.registerEventListeners.call(this);
this.getModal().on(CustomEvents.events.activate, SELECTORS.APPROVE_BUTTON, function(e, data) {
var approveEvent = $.Event(DataPrivacyEvents.approve);
this.getRoot().trigger(approveEvent, this);
if (!approveEvent.isDefaultPrevented()) {
this.hide();
data.originalEvent.preventDefault();
}
}.bind(this));
this.getModal().on(CustomEvents.events.activate, SELECTORS.DENY_BUTTON, function(e, data) {
var denyEvent = $.Event(DataPrivacyEvents.deny);
this.getRoot().trigger(denyEvent, this);
if (!denyEvent.isDefaultPrevented()) {
this.hide();
data.originalEvent.preventDefault();
}
}.bind(this));
this.getModal().on(CustomEvents.events.activate, SELECTORS.COMPLETE_BUTTON, function(e, data) {
var completeEvent = $.Event(DataPrivacyEvents.complete);
this.getRoot().trigger(completeEvent, this);
if (!completeEvent.isDefaultPrevented()) {
this.hide();
data.originalEvent.preventDefault();
}
}.bind(this));
};
// Automatically register with the modal registry the first time this module is imported so that you can create modals
// of this type using the modal factory.
if (!registered) {
ModalRegistry.register(ModalDataRequest.TYPE, ModalDataRequest, 'tool_dataprivacy/data_request_modal');
registered = true;
}
return ModalDataRequest;
});
@@ -0,0 +1,315 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* AMD module for data registry defaults actions.
*
* @module tool_dataprivacy/defaultsactions
* @package tool_dataprivacy
* @copyright 2018 Jun Pataleta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define([
'jquery',
'core/ajax',
'core/notification',
'core/str',
'core/modal_factory',
'core/modal_events',
'core/templates'],
function($, Ajax, Notification, Str, ModalFactory, ModalEvents, Templates) {
/**
* List of action selectors.
*
* @type {{EDIT_LEVEL_DEFAULTS: string}}
* @type {{NEW_ACTIVITY_DEFAULTS: string}}
* @type {{EDIT_ACTIVITY_DEFAULTS: string}}
* @type {{DELETE_ACTIVITY_DEFAULTS: string}}
*/
var ACTIONS = {
EDIT_LEVEL_DEFAULTS: '[data-action="edit-level-defaults"]',
NEW_ACTIVITY_DEFAULTS: '[data-action="new-activity-defaults"]',
EDIT_ACTIVITY_DEFAULTS: '[data-action="edit-activity-defaults"]',
DELETE_ACTIVITY_DEFAULTS: '[data-action="delete-activity-defaults"]'
};
/** @type {{INHERIT: Number}} **/
var INHERIT = -1;
/**
* DefaultsActions class.
*/
var DefaultsActions = function() {
this.registerEvents();
};
/**
* Register event listeners.
*/
DefaultsActions.prototype.registerEvents = function() {
$(ACTIONS.EDIT_LEVEL_DEFAULTS).click(function(e) {
e.preventDefault();
var button = $(this);
var contextLevel = button.data('contextlevel');
var category = button.data('category');
var purpose = button.data('purpose');
// Get options.
var requests = [
{methodname: 'tool_dataprivacy_get_category_options', args: {}},
{methodname: 'tool_dataprivacy_get_purpose_options', args: {}}
];
var promises = Ajax.call(requests);
var titlePromise = Str.get_string('editdefaults', 'tool_dataprivacy', $('#defaults-header').text());
$.when(promises[0], promises[1], titlePromise).then(function(categoryResponse, purposeResponse, title) {
var categories = categoryResponse.options;
var purposes = purposeResponse.options;
showDefaultsFormModal(title, contextLevel, category, purpose, null, categories, purposes, null);
return true;
}).catch(Notification.exception);
});
$(ACTIONS.NEW_ACTIVITY_DEFAULTS).click(function(e) {
e.preventDefault();
var button = $(this);
var contextLevel = button.data('contextlevel');
// Get options.
var requests = [
{methodname: 'tool_dataprivacy_get_category_options', args: {}},
{methodname: 'tool_dataprivacy_get_purpose_options', args: {}},
{methodname: 'tool_dataprivacy_get_activity_options', args: {'nodefaults': true}}
];
var promises = Ajax.call(requests);
var titlePromise = Str.get_string('addnewdefaults', 'tool_dataprivacy');
$.when(promises[0], promises[1], promises[2], titlePromise).then(
function(categoryResponse, purposeResponse, activityResponse, title) {
var categories = categoryResponse.options;
var purposes = purposeResponse.options;
var activities = activityResponse.options;
showDefaultsFormModal(title, contextLevel, null, null, null, categories, purposes, activities);
return true;
}).catch(Notification.exception);
}
);
$(ACTIONS.EDIT_ACTIVITY_DEFAULTS).click(function(e) {
e.preventDefault();
var button = $(this);
var contextLevel = button.data('contextlevel');
var category = button.data('category');
var purpose = button.data('purpose');
var activity = button.data('activityname');
// Get options.
var requests = [
{methodname: 'tool_dataprivacy_get_category_options', args: {}},
{methodname: 'tool_dataprivacy_get_purpose_options', args: {}},
{methodname: 'tool_dataprivacy_get_activity_options', args: {}}
];
var promises = Ajax.call(requests);
var titlePromise = Str.get_string('editmoduledefaults', 'tool_dataprivacy');
$.when(promises[0], promises[1], promises[2], titlePromise).then(
function(categoryResponse, purposeResponse, activityResponse, title) {
var categories = categoryResponse.options;
var purposes = purposeResponse.options;
var activities = activityResponse.options;
showDefaultsFormModal(title, contextLevel, category, purpose, activity, categories, purposes, activities);
return true;
}).catch(Notification.exception);
}
);
$(ACTIONS.DELETE_ACTIVITY_DEFAULTS).click(function(e) {
e.preventDefault();
var button = $(this);
var contextLevel = button.data('contextlevel');
var activity = button.data('activityname');
var activityDisplayName = button.data('activitydisplayname');
// Set category and purpose to inherit (-1).
var category = INHERIT;
var purpose = INHERIT;
ModalFactory.create({
title: Str.get_string('deletedefaults', 'tool_dataprivacy', activityDisplayName),
body: Templates.render('tool_dataprivacy/delete_activity_defaults', {"activityname": activityDisplayName}),
type: ModalFactory.types.SAVE_CANCEL,
large: true
}).then(function(modal) {
modal.setSaveButtonText(Str.get_string('delete'));
// Handle save event.
modal.getRoot().on(ModalEvents.save, function() {
setContextDefaults(contextLevel, category, purpose, activity, false);
});
// Handle hidden event.
modal.getRoot().on(ModalEvents.hidden, function() {
// Destroy when hidden.
modal.destroy();
});
modal.show();
return true;
}).catch(Notification.exception);
});
};
/**
* Prepares and renders the modal for setting the defaults for the given context level/plugin.
*
* @param {String} title The modal's title.
* @param {Number} contextLevel The context level to set defaults for.
* @param {Number} category The current category ID.
* @param {Number} purpose The current purpose ID.
* @param {String} activity The plugin name of the activity. Optional.
* @param {Array} categoryOptions The list of category options.
* @param {Array} purposeOptions The list of purpose options.
* @param {Array} activityOptions The list of activity options. Optional.
*/
function showDefaultsFormModal(title, contextLevel, category, purpose, activity,
categoryOptions, purposeOptions, activityOptions) {
if (category !== null) {
categoryOptions.forEach(function(currentValue) {
if (currentValue.id === category) {
currentValue.selected = true;
}
});
}
if (purpose !== null) {
purposeOptions.forEach(function(currentValue) {
if (currentValue.id === purpose) {
currentValue.selected = true;
}
});
}
var templateContext = {
"contextlevel": contextLevel,
"categoryoptions": categoryOptions,
"purposeoptions": purposeOptions
};
// Check the activityOptions parameter that was passed.
if (activityOptions !== null && activityOptions.length) {
// Check the activity parameter that was passed.
if (activity === null) {
// We're setting a new defaults for a module.
templateContext.newactivitydefaults = true;
} else {
// Edit mode. Set selection.
activityOptions.forEach(function(currentValue) {
if (activity === currentValue.name) {
currentValue.selected = true;
}
});
}
templateContext.modemodule = true;
templateContext.activityoptions = activityOptions;
}
ModalFactory.create({
title: title,
body: Templates.render('tool_dataprivacy/category_purpose_form', templateContext),
type: ModalFactory.types.SAVE_CANCEL,
large: true
}).then(function(modal) {
// Handle save event.
modal.getRoot().on(ModalEvents.save, function() {
var activity = $('#activity');
var activityVal = typeof activity !== 'undefined' ? activity.val() : null;
var override = $('#override');
var overrideVal = typeof override !== 'undefined' ? override.is(':checked') : false;
setContextDefaults($('#contextlevel').val(), $('#category').val(), $('#purpose').val(), activityVal, overrideVal);
});
// Handle hidden event.
modal.getRoot().on(ModalEvents.hidden, function() {
// Destroy when hidden.
modal.destroy();
});
modal.show();
return modal;
}).catch(Notification.exception);
}
/**
* Calls a the tool_dataprivacy_set_context_defaults WS function.
*
* @param {Number} contextLevel The context level.
* @param {Number} category The category ID.
* @param {Number} purpose The purpose ID.
* @param {String} activity The plugin name of the activity module.
* @param {Boolean} override Whether to override custom instances.
*/
function setContextDefaults(contextLevel, category, purpose, activity, override) {
var request = {
methodname: 'tool_dataprivacy_set_context_defaults',
args: {
'contextlevel': contextLevel,
'category': category,
'purpose': purpose,
'override': override,
'activity': activity
}
};
Ajax.call([request])[0].done(function(data) {
if (data.result) {
window.location.reload();
}
});
}
return /** @alias module:tool_dataprivacy/defaultsactions */ {
// Public variables and functions.
/**
* Initialise the module.
*
* @method init
* @return {DefaultsActions}
*/
'init': function() {
return new DefaultsActions();
}
};
});
@@ -0,0 +1,92 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Module to update the displayed retention period.
*
* @module tool_dataprivacy/effective_retention_period
* @package tool_dataprivacy
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define(['jquery'],
function($) {
var SELECTORS = {
PURPOSE_SELECT: '#id_purposeid',
RETENTION_FIELD_BOOST: '#id_error_retention_current',
RETENTION_FIELD_CLEAN: '#fitem_id_retention_current [data-fieldtype=static]',
};
/**
* Constructor for the retention period display.
*
* @param {Array} purposeRetentionPeriods Associative array of purposeids with effective retention period at this context
*/
var EffectiveRetentionPeriod = function(purposeRetentionPeriods) {
this.purposeRetentionPeriods = purposeRetentionPeriods;
this.registerEventListeners();
};
/**
* Removes the current 'change' listeners.
*
* Useful when a new form is loaded.
*/
var removeListeners = function() {
$(SELECTORS.PURPOSE_SELECT).off('change');
};
/**
* @var {Array} purposeRetentionPeriods
* @private
*/
EffectiveRetentionPeriod.prototype.purposeRetentionPeriods = [];
/**
* Add purpose change listeners.
*
* @method registerEventListeners
*/
EffectiveRetentionPeriod.prototype.registerEventListeners = function() {
$(SELECTORS.PURPOSE_SELECT).on('change', function(ev) {
var selected = $(ev.currentTarget).val();
var selectedPurpose = this.purposeRetentionPeriods[selected];
var cleanSelector = $(SELECTORS.RETENTION_FIELD_CLEAN);
if (cleanSelector.length > 0) {
cleanSelector.text(selectedPurpose);
} else {
var boostSelector = $(SELECTORS.RETENTION_FIELD_BOOST);
var retentionField = boostSelector.siblings();
if (retentionField.length > 0) {
retentionField.text(selectedPurpose);
}
}
}.bind(this));
};
return /** @alias module:tool_dataprivacy/effective_retention_period */ {
init: function(purposeRetentionPeriods) {
// Remove previously attached listeners.
removeListeners();
return new EffectiveRetentionPeriod(purposeRetentionPeriods);
}
};
}
);
+33
View File
@@ -0,0 +1,33 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Contain the events the data privacy tool can fire.
*
* @module tool_dataprivacy/events
* @class events
* @package tool_dataprivacy
* @copyright 2018 Jun Pataleta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define([], function() {
return {
approve: 'tool_dataprivacy-data_request:approve',
bulkApprove: 'tool_dataprivacy-data_request:bulk_approve',
deny: 'tool_dataprivacy-data_request:deny',
bulkDeny: 'tool_dataprivacy-data_request:bulk_deny',
complete: 'tool_dataprivacy-data_request:complete'
};
});
@@ -0,0 +1,88 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Potential user selector module.
*
* @module tool_dataprivacy/expand_contract
* @class page-expand-contract
* @package tool_dataprivacy
* @copyright 2018 Adrian Greeve
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define(['jquery', 'core/url', 'core/str'], function($, url, str) {
var expandedImage = $('<img alt="" src="' + url.imageUrl('t/expanded') + '"/>');
var collapsedImage = $('<img alt="" src="' + url.imageUrl('t/collapsed') + '"/>');
return /** @alias module:tool_dataprivacy/expand-collapse */ {
/**
* Expand or collapse a selected node.
*
* @param {object} targetnode The node that we want to expand / collapse
* @param {object} thisnode The node that was clicked.
*/
expandCollapse: function(targetnode, thisnode) {
if (targetnode.hasClass('hide')) {
targetnode.removeClass('hide');
targetnode.addClass('visible');
targetnode.attr('aria-expanded', true);
thisnode.find(':header i.fa').removeClass('fa-plus-square');
thisnode.find(':header i.fa').addClass('fa-minus-square');
thisnode.find(':header img.icon').attr('src', expandedImage.attr('src'));
} else {
targetnode.removeClass('visible');
targetnode.addClass('hide');
targetnode.attr('aria-expanded', false);
thisnode.find(':header i.fa').removeClass('fa-minus-square');
thisnode.find(':header i.fa').addClass('fa-plus-square');
thisnode.find(':header img.icon').attr('src', collapsedImage.attr('src'));
}
},
/**
* Expand or collapse all nodes on this page.
*
* @param {string} nextstate The next state to change to.
*/
expandCollapseAll: function(nextstate) {
var currentstate = (nextstate == 'visible') ? 'hide' : 'visible';
var ariaexpandedstate = (nextstate == 'visible') ? true : false;
var iconclassnow = (nextstate == 'visible') ? 'fa-plus-square' : 'fa-minus-square';
var iconclassnext = (nextstate == 'visible') ? 'fa-minus-square' : 'fa-plus-square';
var imagenow = (nextstate == 'visible') ? expandedImage.attr('src') : collapsedImage.attr('src');
$('.' + currentstate).each(function() {
$(this).removeClass(currentstate);
$(this).addClass(nextstate);
$(this).attr('aria-expanded', ariaexpandedstate);
});
$('.tool_dataprivacy-expand-all').data('visibilityState', currentstate);
str.get_string(currentstate, 'tool_dataprivacy').then(function(langString) {
$('.tool_dataprivacy-expand-all').html(langString);
return;
}).catch(Notification.exception);
$(':header i.fa').each(function() {
$(this).removeClass(iconclassnow);
$(this).addClass(iconclassnext);
});
$(':header img.icon').each(function() {
$(this).attr('src', imagenow);
});
}
};
});
@@ -0,0 +1,76 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Potential user selector module.
*
* @module tool_dataprivacy/form-user-selector
* @class form-user-selector
* @package tool_dataprivacy
* @copyright 2018 Jun Pataleta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define(['jquery', 'core/ajax', 'core/templates'], function($, Ajax, Templates) {
return /** @alias module:tool_dataprivacy/form-user-selector */ {
processResults: function(selector, results) {
var users = [];
$.each(results, function(index, user) {
users.push({
value: user.id,
label: user._label
});
});
return users;
},
transport: function(selector, query, success, failure) {
var promise;
promise = Ajax.call([{
methodname: 'tool_dataprivacy_get_users',
args: {
query: query
}
}]);
promise[0].then(function(results) {
var promises = [],
i = 0;
// Render the label.
$.each(results, function(index, user) {
promises.push(Templates.render('tool_dataprivacy/form-user-selector-suggestion', user));
});
// Apply the label to the results.
return $.when.apply($.when, promises).then(function() {
var args = arguments;
$.each(results, function(index, user) {
user._label = args[i];
i++;
});
success(results);
return;
});
}).fail(failure);
}
};
});
@@ -0,0 +1,221 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* AMD module to enable users to manage their own data requests.
*
* @module tool_dataprivacy/myrequestactions
* @package tool_dataprivacy
* @copyright 2018 Jun Pataleta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define([
'jquery',
'core/ajax',
'core/notification',
'core/str',
'core/modal_factory',
'core/modal_events',
'core/templates'],
function($, Ajax, Notification, Str, ModalFactory, ModalEvents, Templates) {
/**
* List of action selectors.
*
* @type {{CANCEL_REQUEST: string}}
* @type {{CONTACT_DPO: string}}
*/
var ACTIONS = {
CANCEL_REQUEST: '[data-action="cancel"]',
CONTACT_DPO: '[data-action="contactdpo"]',
};
/**
* MyRequestActions class.
*/
var MyRequestActions = function() {
this.registerEvents();
};
/**
* Register event listeners.
*/
MyRequestActions.prototype.registerEvents = function() {
$(ACTIONS.CANCEL_REQUEST).click(function(e) {
e.preventDefault();
var requestId = $(this).data('requestid');
var stringkeys = [
{
key: 'cancelrequest',
component: 'tool_dataprivacy'
},
{
key: 'cancelrequestconfirmation',
component: 'tool_dataprivacy'
}
];
Str.get_strings(stringkeys).then(function(langStrings) {
var title = langStrings[0];
var confirmMessage = langStrings[1];
return ModalFactory.create({
title: title,
body: confirmMessage,
type: ModalFactory.types.SAVE_CANCEL
}).then(function(modal) {
modal.setSaveButtonText(title);
// Handle save event.
modal.getRoot().on(ModalEvents.save, function() {
// Cancel the request.
var params = {
'requestid': requestId
};
var request = {
methodname: 'tool_dataprivacy_cancel_data_request',
args: params
};
Ajax.call([request])[0].done(function(data) {
if (data.result) {
window.location.reload();
} else {
Notification.addNotification({
message: data.warnings[0].message,
type: 'error'
});
}
}).fail(Notification.exception);
});
// Handle hidden event.
modal.getRoot().on(ModalEvents.hidden, function() {
// Destroy when hidden.
modal.destroy();
});
return modal;
});
}).done(function(modal) {
// Show the modal!
modal.show();
}).fail(Notification.exception);
});
$(ACTIONS.CONTACT_DPO).click(function(e) {
e.preventDefault();
var replyToEmail = $(this).data('replytoemail');
var keys = [
{
key: 'contactdataprotectionofficer',
component: 'tool_dataprivacy'
},
{
key: 'send',
component: 'tool_dataprivacy'
},
];
var sendButtonText = '';
Str.get_strings(keys).then(function(langStrings) {
var modalTitle = langStrings[0];
sendButtonText = langStrings[1];
var context = {
'replytoemail': replyToEmail
};
return ModalFactory.create({
title: modalTitle,
body: Templates.render('tool_dataprivacy/contact_dpo', context),
type: ModalFactory.types.SAVE_CANCEL,
large: true
});
}).done(function(modal) {
modal.setSaveButtonText(sendButtonText);
// Handle send event.
modal.getRoot().on(ModalEvents.save, function(e) {
var message = $('#message').val().trim();
if (message.length === 0) {
e.preventDefault();
// Show validation error when the message is empty.
$('[data-region="messageinput"]').addClass('has-danger notifyproblem');
$('#id_error_message').removeAttr('hidden');
} else {
// Send the message.
sendMessageToDPO(message);
}
});
// Handle hidden event.
modal.getRoot().on(ModalEvents.hidden, function() {
// Destroy when hidden.
modal.destroy();
});
// Show the modal!
modal.show();
}).fail(Notification.exception);
});
};
/**
* Send message to the Data Protection Officer.
*
* @param {String} message The message to send.
*/
function sendMessageToDPO(message) {
var request = {
methodname: 'tool_dataprivacy_contact_dpo',
args: {
message: message
}
};
var requestType = 'success';
Ajax.call([request])[0].then(function(data) {
if (data.result) {
return Str.get_string('requestsubmitted', 'tool_dataprivacy');
}
requestType = 'error';
return data.warnings.join('<br>');
}).done(function(message) {
Notification.addNotification({
message: message,
type: requestType
});
}).fail(Notification.exception);
}
return /** @alias module:tool_dataprivacy/myrequestactions */ {
// Public variables and functions.
/**
* Initialise the unified user filter.
*
* @method init
* @return {MyRequestActions}
*/
'init': function() {
return new MyRequestActions();
}
};
});
@@ -0,0 +1,132 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* AMD module for purposes actions.
*
* @module tool_dataprivacy/purposesactions
* @package tool_dataprivacy
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define([
'jquery',
'core/ajax',
'core/notification',
'core/str',
'core/modal_factory',
'core/modal_events'],
function($, Ajax, Notification, Str, ModalFactory, ModalEvents) {
/**
* List of action selectors.
*
* @type {{DELETE: string}}
*/
var ACTIONS = {
DELETE: '[data-action="deletepurpose"]',
};
/**
* PurposesActions class.
*/
var PurposesActions = function() {
this.registerEvents();
};
/**
* Register event listeners.
*/
PurposesActions.prototype.registerEvents = function() {
$(ACTIONS.DELETE).click(function(e) {
e.preventDefault();
var id = $(this).data('id');
var purposename = $(this).data('name');
var stringkeys = [
{
key: 'deletepurpose',
component: 'tool_dataprivacy'
},
{
key: 'deletepurposetext',
component: 'tool_dataprivacy',
param: purposename
},
{
key: 'delete'
}
];
Str.get_strings(stringkeys).then(function(langStrings) {
var title = langStrings[0];
var confirmMessage = langStrings[1];
var buttonText = langStrings[2];
return ModalFactory.create({
title: title,
body: confirmMessage,
type: ModalFactory.types.SAVE_CANCEL
}).then(function(modal) {
modal.setSaveButtonText(buttonText);
// Handle save event.
modal.getRoot().on(ModalEvents.save, function() {
var request = {
methodname: 'tool_dataprivacy_delete_purpose',
args: {'id': id}
};
Ajax.call([request])[0].done(function(data) {
if (data.result) {
$('tr[data-purposeid="' + id + '"]').remove();
} else {
Notification.addNotification({
message: data.warnings[0].message,
type: 'error'
});
}
}).fail(Notification.exception);
});
// Handle hidden event.
modal.getRoot().on(ModalEvents.hidden, function() {
// Destroy when hidden.
modal.destroy();
});
return modal;
});
}).done(function(modal) {
modal.show();
}).fail(Notification.exception);
});
};
return /** @alias module:tool_dataprivacy/purposesactions */ {
// Public variables and functions.
/**
* Initialise the module.
*
* @method init
* @return {PurposesActions}
*/
'init': function() {
return new PurposesActions();
}
};
});
@@ -0,0 +1,84 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* JS module for the data requests filter.
*
* @module tool_dataprivacy/request_filter
* @package tool_dataprivacy
* @copyright 2018 Jun Pataleta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define(['jquery', 'core/form-autocomplete', 'core/str', 'core/notification'], function($, Autocomplete, Str, Notification) {
/**
* Selectors.
*
* @access private
* @type {{REQUEST_FILTERS: string}}
*/
var SELECTORS = {
REQUEST_FILTERS: '#request-filters'
};
/**
* Init function.
*
* @method init
* @private
*/
var init = function() {
var stringkeys = [
{
key: 'filter',
component: 'moodle'
},
{
key: 'nofiltersapplied',
component: 'moodle'
}
];
Str.get_strings(stringkeys).then(function(langstrings) {
var placeholder = langstrings[0];
var noSelectionString = langstrings[1];
return Autocomplete.enhance(SELECTORS.REQUEST_FILTERS, false, '', placeholder, false, true, noSelectionString, true);
}).fail(Notification.exception);
var last = $(SELECTORS.REQUEST_FILTERS).val();
$(SELECTORS.REQUEST_FILTERS).on('change', function() {
var current = $(this).val();
// Prevent form from submitting unnecessarily, eg. on blur when no filter is selected.
if (last.join(',') !== current.join(',')) {
// If we're submitting without filters, set the hidden input 'filters-cleared' to 1.
if (current.length === 0) {
$('#filters-cleared').val(1);
}
$(this.form).submit();
}
});
};
return /** @alias module:core/form-autocomplete */ {
/**
* Initialise the unified user filter.
*
* @method init
*/
init: function() {
init();
}
};
});
@@ -0,0 +1,441 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Request actions.
*
* @module tool_dataprivacy/requestactions
* @package tool_dataprivacy
* @copyright 2018 Jun Pataleta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define([
'jquery',
'core/ajax',
'core/notification',
'core/str',
'core/modal_factory',
'core/modal_events',
'core/templates',
'tool_dataprivacy/data_request_modal',
'tool_dataprivacy/events'],
function($, Ajax, Notification, Str, ModalFactory, ModalEvents, Templates, ModalDataRequest, DataPrivacyEvents) {
/**
* List of action selectors.
*
* @type {{APPROVE_REQUEST: string}}
* @type {{DENY_REQUEST: string}}
* @type {{VIEW_REQUEST: string}}
* @type {{MARK_COMPLETE: string}}
* @type {{CHANGE_BULK_ACTION: string}}
* @type {{CONFIRM_BULK_ACTION: string}}
* @type {{SELECT_ALL: string}}
*/
var ACTIONS = {
APPROVE_REQUEST: '[data-action="approve"]',
DENY_REQUEST: '[data-action="deny"]',
VIEW_REQUEST: '[data-action="view"]',
MARK_COMPLETE: '[data-action="complete"]',
CHANGE_BULK_ACTION: '[id="bulk-action"]',
CONFIRM_BULK_ACTION: '[id="confirm-bulk-action"]',
SELECT_ALL: '[data-action="selectall"]'
};
/**
* List of available bulk actions.
*
* @type {{APPROVE: number}}
* @type {{DENY: number}}
*/
var BULK_ACTIONS = {
APPROVE: 1,
DENY: 2
};
/**
* List of selectors.
*
* @type {{SELECT_REQUEST: string}}
*/
var SELECTORS = {
SELECT_REQUEST: '.selectrequests'
};
/**
* RequestActions class.
*/
var RequestActions = function() {
this.registerEvents();
};
/**
* Register event listeners.
*/
RequestActions.prototype.registerEvents = function() {
$(ACTIONS.VIEW_REQUEST).click(function(e) {
e.preventDefault();
var requestId = $(this).data('requestid');
// Cancel the request.
var params = {
'requestid': requestId
};
var request = {
methodname: 'tool_dataprivacy_get_data_request',
args: params
};
var promises = Ajax.call([request]);
$.when(promises[0]).then(function(data) {
if (data.result) {
return data.result;
}
// Fail.
Notification.addNotification({
message: data.warnings[0].message,
type: 'error'
});
return false;
}).then(function(data) {
var body = Templates.render('tool_dataprivacy/request_details', data);
var templateContext = {
approvedeny: data.approvedeny,
canmarkcomplete: data.canmarkcomplete
};
return ModalFactory.create({
title: data.typename,
body: body,
type: ModalDataRequest.TYPE,
large: true,
templateContext: templateContext
});
}).then(function(modal) {
// Handle approve event.
modal.getRoot().on(DataPrivacyEvents.approve, function() {
showConfirmation(DataPrivacyEvents.approve, approveEventWsData(requestId));
});
// Handle deny event.
modal.getRoot().on(DataPrivacyEvents.deny, function() {
showConfirmation(DataPrivacyEvents.deny, denyEventWsData(requestId));
});
// Handle send event.
modal.getRoot().on(DataPrivacyEvents.complete, function() {
var params = {
'requestid': requestId
};
handleSave('tool_dataprivacy_mark_complete', params);
});
// Handle hidden event.
modal.getRoot().on(ModalEvents.hidden, function() {
// Destroy when hidden.
modal.destroy();
});
// Show the modal!
modal.show();
return;
}).catch(Notification.exception);
});
$(ACTIONS.APPROVE_REQUEST).click(function(e) {
e.preventDefault();
var requestId = $(this).data('requestid');
showConfirmation(DataPrivacyEvents.approve, approveEventWsData(requestId));
});
$(ACTIONS.DENY_REQUEST).click(function(e) {
e.preventDefault();
var requestId = $(this).data('requestid');
showConfirmation(DataPrivacyEvents.deny, denyEventWsData(requestId));
});
$(ACTIONS.MARK_COMPLETE).click(function(e) {
e.preventDefault();
var requestId = $(this).data('requestid');
showConfirmation(DataPrivacyEvents.complete, completeEventWsData(requestId));
});
$(ACTIONS.CONFIRM_BULK_ACTION).click(function() {
var requestIds = [];
var actionEvent = '';
var wsdata = {};
var bulkActionKeys = [
{
key: 'selectbulkaction',
component: 'tool_dataprivacy'
},
{
key: 'selectdatarequests',
component: 'tool_dataprivacy'
},
{
key: 'ok'
}
];
var bulkaction = parseInt($('#bulk-action').val());
if (bulkaction != BULK_ACTIONS.APPROVE && bulkaction != BULK_ACTIONS.DENY) {
Str.get_strings(bulkActionKeys).done(function(langStrings) {
Notification.alert('', langStrings[0], langStrings[2]);
}).fail(Notification.exception);
return;
}
$(".selectrequests:checked").each(function() {
requestIds.push($(this).val());
});
if (requestIds.length < 1) {
Str.get_strings(bulkActionKeys).done(function(langStrings) {
Notification.alert('', langStrings[1], langStrings[2]);
}).fail(Notification.exception);
return;
}
switch (bulkaction) {
case BULK_ACTIONS.APPROVE:
actionEvent = DataPrivacyEvents.bulkApprove;
wsdata = bulkApproveEventWsData(requestIds);
break;
case BULK_ACTIONS.DENY:
actionEvent = DataPrivacyEvents.bulkDeny;
wsdata = bulkDenyEventWsData(requestIds);
}
showConfirmation(actionEvent, wsdata);
});
$(ACTIONS.SELECT_ALL).change(function(e) {
e.preventDefault();
var selectAll = $(this).is(':checked');
$(SELECTORS.SELECT_REQUEST).prop('checked', selectAll);
});
};
/**
* Return the webservice data for the approve request action.
*
* @param {Number} requestId The ID of the request.
* @return {Object}
*/
function approveEventWsData(requestId) {
return {
'wsfunction': 'tool_dataprivacy_approve_data_request',
'wsparams': {'requestid': requestId}
};
}
/**
* Return the webservice data for the bulk approve request action.
*
* @param {Array} requestIds The array of request ID's.
* @return {Object}
*/
function bulkApproveEventWsData(requestIds) {
return {
'wsfunction': 'tool_dataprivacy_bulk_approve_data_requests',
'wsparams': {'requestids': requestIds}
};
}
/**
* Return the webservice data for the deny request action.
*
* @param {Number} requestId The ID of the request.
* @return {Object}
*/
function denyEventWsData(requestId) {
return {
'wsfunction': 'tool_dataprivacy_deny_data_request',
'wsparams': {'requestid': requestId}
};
}
/**
* Return the webservice data for the bulk deny request action.
*
* @param {Array} requestIds The array of request ID's.
* @return {Object}
*/
function bulkDenyEventWsData(requestIds) {
return {
'wsfunction': 'tool_dataprivacy_bulk_deny_data_requests',
'wsparams': {'requestids': requestIds}
};
}
/**
* Return the webservice data for the complete request action.
*
* @param {Number} requestId The ID of the request.
* @return {Object}
*/
function completeEventWsData(requestId) {
return {
'wsfunction': 'tool_dataprivacy_mark_complete',
'wsparams': {'requestid': requestId}
};
}
/**
* Show the confirmation dialogue.
*
* @param {String} action The action name.
* @param {Object} wsdata Object containing ws data.
*/
function showConfirmation(action, wsdata) {
var keys = [];
switch (action) {
case DataPrivacyEvents.approve:
keys = [
{
key: 'approverequest',
component: 'tool_dataprivacy'
},
{
key: 'confirmapproval',
component: 'tool_dataprivacy'
}
];
break;
case DataPrivacyEvents.bulkApprove:
keys = [
{
key: 'bulkapproverequests',
component: 'tool_dataprivacy'
},
{
key: 'confirmbulkapproval',
component: 'tool_dataprivacy'
}
];
break;
case DataPrivacyEvents.deny:
keys = [
{
key: 'denyrequest',
component: 'tool_dataprivacy'
},
{
key: 'confirmdenial',
component: 'tool_dataprivacy'
}
];
break;
case DataPrivacyEvents.bulkDeny:
keys = [
{
key: 'bulkdenyrequests',
component: 'tool_dataprivacy'
},
{
key: 'confirmbulkdenial',
component: 'tool_dataprivacy'
}
];
break;
case DataPrivacyEvents.complete:
keys = [
{
key: 'markcomplete',
component: 'tool_dataprivacy'
},
{
key: 'confirmcompletion',
component: 'tool_dataprivacy'
}
];
break;
}
var modalTitle = '';
Str.get_strings(keys).then(function(langStrings) {
modalTitle = langStrings[0];
var confirmMessage = langStrings[1];
return ModalFactory.create({
title: modalTitle,
body: confirmMessage,
type: ModalFactory.types.SAVE_CANCEL
});
}).then(function(modal) {
modal.setSaveButtonText(modalTitle);
// Handle save event.
modal.getRoot().on(ModalEvents.save, function() {
handleSave(wsdata.wsfunction, wsdata.wsparams);
});
// Handle hidden event.
modal.getRoot().on(ModalEvents.hidden, function() {
// Destroy when hidden.
modal.destroy();
});
modal.show();
return;
}).catch(Notification.exception);
}
/**
* Calls a web service function and reloads the page on success and shows a notification.
* Displays an error notification, otherwise.
*
* @param {String} wsfunction The web service function to call.
* @param {Object} params The parameters for the web service functoon.
*/
function handleSave(wsfunction, params) {
// Confirm the request.
var request = {
methodname: wsfunction,
args: params
};
Ajax.call([request])[0].done(function(data) {
if (data.result) {
// On success, reload the page so that the data request table will be updated.
// TODO: Probably in the future, better to reload the table or the target data request via AJAX.
window.location.reload();
} else {
// Add the notification.
Notification.addNotification({
message: data.warnings[0].message,
type: 'error'
});
}
}).fail(Notification.exception);
}
return RequestActions;
});
+42
View File
@@ -0,0 +1,42 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This page lets users manage categories.
*
* @package tool_dataprivacy
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(__DIR__ . '/../../../config.php');
require_login(null, false);
$url = new moodle_url("/admin/tool/dataprivacy/categories.php");
$title = get_string('editcategories', 'tool_dataprivacy');
\tool_dataprivacy\page_helper::setup($url, $title, 'dataregistry');
$output = $PAGE->get_renderer('tool_dataprivacy');
echo $output->header();
echo $output->heading($title);
$categories = \tool_dataprivacy\api::get_categories();
$renderable = new \tool_dataprivacy\output\categories($categories);
echo $output->render($renderable);
echo $output->footer();
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,91 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Class for loading/storing data categories from the DB.
*
* @package tool_dataprivacy
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_dataprivacy;
defined('MOODLE_INTERNAL') || die();
require_once($CFG->dirroot . '/' . $CFG->admin . '/tool/dataprivacy/lib.php');
/**
* Class for loading/storing data categories from the DB.
*
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class category extends \core\persistent {
/**
* Database table.
*/
const TABLE = 'tool_dataprivacy_category';
/**
* Return the definition of the properties of this model.
*
* @return array
*/
protected static function define_properties() {
return array(
'name' => array(
'type' => PARAM_TEXT,
'description' => 'The category name.',
),
'description' => array(
'type' => PARAM_RAW,
'description' => 'The category description.',
'null' => NULL_ALLOWED,
'default' => '',
),
'descriptionformat' => array(
'choices' => array(FORMAT_HTML, FORMAT_MOODLE, FORMAT_PLAIN, FORMAT_MARKDOWN),
'type' => PARAM_INT,
'default' => FORMAT_HTML
),
);
}
/**
* Is this category used?.
*
* @return null
*/
public function is_used() {
if (\tool_dataprivacy\contextlevel::is_category_used($this->get('id')) ||
\tool_dataprivacy\context_instance::is_category_used($this->get('id'))) {
return true;
}
$pluginconfig = get_config('tool_dataprivacy');
$levels = \context_helper::get_all_levels();
foreach ($levels as $level => $classname) {
list($unused, $categoryvar) = \tool_dataprivacy\data_registry::var_names_from_context($classname);
if (!empty($pluginconfig->{$categoryvar}) && $pluginconfig->{$categoryvar} == $this->get('id')) {
return true;
}
}
return false;
}
}
@@ -0,0 +1,116 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Class for loading/storing context instances data from the DB.
*
* @package tool_dataprivacy
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_dataprivacy;
defined('MOODLE_INTERNAL') || die();
/**
* Class for loading/storing context instances data from the DB.
*
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class context_instance extends \core\persistent {
/**
* Database table.
*/
const TABLE = 'tool_dataprivacy_ctxinstance';
/**
* Not set value.
*/
const NOTSET = 0;
/**
* Inherit value.
*/
const INHERIT = -1;
/**
* Return the definition of the properties of this model.
*
* @return array
*/
protected static function define_properties() {
return array(
'contextid' => array(
'type' => PARAM_INT,
'description' => 'The context id.',
),
'purposeid' => array(
'type' => PARAM_INT,
'description' => 'The purpose id.',
'null' => NULL_ALLOWED,
),
'categoryid' => array(
'type' => PARAM_INT,
'description' => 'The category id.',
'null' => NULL_ALLOWED,
),
);
}
/**
* Returns an instance by contextid.
*
* @param mixed $contextid
* @param mixed $exception
* @return null
*/
public static function get_record_by_contextid($contextid, $exception = true) {
global $DB;
if (!$record = $DB->get_record(self::TABLE, array('contextid' => $contextid))) {
if (!$exception) {
return false;
} else {
throw new \dml_missing_record_exception(self::TABLE);
}
}
return new static(0, $record);
}
/**
* Is the provided purpose used by any context instance?
*
* @param int $purposeid
* @return bool
*/
public static function is_purpose_used($purposeid) {
global $DB;
return $DB->record_exists(self::TABLE, array('purposeid' => $purposeid));
}
/**
* Is the provided category used by any context instance?
*
* @param int $categoryid
* @return bool
*/
public static function is_category_used($categoryid) {
global $DB;
return $DB->record_exists(self::TABLE, array('categoryid' => $categoryid));
}
}
@@ -0,0 +1,140 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Class for loading/storing context level data from the DB.
*
* @package tool_dataprivacy
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_dataprivacy;
defined('MOODLE_INTERNAL') || die();
/**
* Class for loading/storing context level data from the DB.
*
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class contextlevel extends \core\persistent {
/**
* Database table.
*/
const TABLE = 'tool_dataprivacy_ctxlevel';
/**
* Return the definition of the properties of this model.
*
* @return array
*/
protected static function define_properties() {
return array(
'contextlevel' => array(
'type' => PARAM_INT,
'description' => 'The context level.',
),
'purposeid' => array(
'type' => PARAM_INT,
'description' => 'The purpose id.',
),
'categoryid' => array(
'type' => PARAM_INT,
'description' => 'The category id.',
),
);
}
/**
* Returns an instance by contextlevel.
*
* @param mixed $contextlevel
* @param mixed $exception
* @return null
*/
public static function get_record_by_contextlevel($contextlevel, $exception = true) {
global $DB;
$cache = \cache::make('tool_dataprivacy', 'contextlevel');
if ($data = $cache->get($contextlevel)) {
return new static(0, $data);
}
if (!$record = $DB->get_record(self::TABLE, array('contextlevel' => $contextlevel))) {
if (!$exception) {
return false;
} else {
throw new \dml_missing_record_exception(self::TABLE);
}
}
return new static(0, $record);
}
/**
* Is the provided purpose used by any contextlevel?
*
* @param int $purposeid
* @return bool
*/
public static function is_purpose_used($purposeid) {
global $DB;
return $DB->record_exists(self::TABLE, array('purposeid' => $purposeid));
}
/**
* Is the provided category used by any contextlevel?
*
* @param int $categoryid
* @return bool
*/
public static function is_category_used($categoryid) {
global $DB;
return $DB->record_exists(self::TABLE, array('categoryid' => $categoryid));
}
/**
* Adds the new record to the cache.
*
* @return null
*/
protected function after_create() {
$cache = \cache::make('tool_dataprivacy', 'contextlevel');
$cache->set($this->get('contextlevel'), $this->to_record());
}
/**
* Updates the cache record.
*
* @param bool $result
* @return null
*/
protected function after_update($result) {
$cache = \cache::make('tool_dataprivacy', 'contextlevel');
$cache->set($this->get('contextlevel'), $this->to_record());
}
/**
* Removes unnecessary stuff from db.
*
* @return null
*/
protected function before_delete() {
$cache = \cache::make('tool_dataprivacy', 'contextlevel');
$cache->delete($this->get('contextlevel'));
}
}
@@ -0,0 +1,64 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Contains the contextlist persistent.
*
* @package tool_dataprivacy
* @copyright 2018 Jake Dallimore <jrhdallimore@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_dataprivacy;
defined('MOODLE_INTERNAL') || die();
use core\persistent;
/**
* The contextlist persistent.
*
* @copyright 2018 Jake Dallimore <jrhdallimore@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class contextlist extends persistent {
/** The table name this persistent object maps to. */
const TABLE = 'tool_dataprivacy_contextlist';
/**
* Return the definition of the properties of this model.
*
* @return array
*/
protected static function define_properties() {
return [
'component' => [
'type' => PARAM_TEXT
]
];
}
/**
* Create a new contextlist persistent from an instance of \core_privacy\local\request\contextlist.
*
* @param \core_privacy\local\request\contextlist $contextlist the core privacy contextlist.
* @return contextlist a contextlist persistent.
*/
public static function from_contextlist(\core_privacy\local\request\contextlist $contextlist) : contextlist {
$contextlistpersistent = new contextlist();
return $contextlistpersistent->set('component', $contextlist->get_component());
}
}
@@ -0,0 +1,74 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Contains the contextlist_context persistent.
*
* @package tool_dataprivacy
* @copyright 2018 Jake Dallimore <jrhdallimore@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_dataprivacy;
defined('MOODLE_INTERNAL') || die();
use core\persistent;
/**
* The contextlist_context persistent.
*
* @copyright 2018 Jake Dallimore <jrhdallimore@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class contextlist_context extends persistent {
/** The table name this persistent object maps to. */
const TABLE = 'tool_dataprivacy_ctxlst_ctx';
/** This context is pending approval. */
const STATUS_PENDING = 0;
/** This context has been approved. */
const STATUS_APPROVED = 1;
/** This context has been rejected. */
const STATUS_REJECTED = 2;
/**
* Return the definition of the properties of this model.
*
* @return array
*/
protected static function define_properties() {
return [
'contextid' => [
'type' => PARAM_INT
],
'contextlistid' => [
'type' => PARAM_INT
],
'status' => [
'choices' => [
self::STATUS_PENDING,
self::STATUS_APPROVED,
self::STATUS_REJECTED,
],
'default' => self::STATUS_PENDING,
'type' => PARAM_INT
]
];
}
}
@@ -0,0 +1,357 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Data registry business logic methods. Mostly internal stuff.
*
* All methods should be considered part of the internal tool_dataprivacy API
* unless something different is specified.
*
* @package tool_dataprivacy
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_dataprivacy;
use coding_exception;
use core\persistent;
defined('MOODLE_INTERNAL') || die();
require_once($CFG->libdir . '/coursecatlib.php');
/**
* Data registry business logic methods. Mostly internal stuff.
*
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class data_registry {
/**
* Returns purpose and category var names from a context class name
*
* @param string $classname The context level's class.
* @param string $pluginname The name of the plugin associated with the context level.
* @return string[]
*/
public static function var_names_from_context($classname, $pluginname = '') {
$pluginname = trim($pluginname);
if (!empty($pluginname)) {
$categoryvar = $classname . '_' . $pluginname . '_category';
$purposevar = $classname . '_' . $pluginname . '_purpose';
} else {
$categoryvar = $classname . '_category';
$purposevar = $classname . '_purpose';
}
return [
$purposevar,
$categoryvar
];
}
/**
* Returns the default purpose id and category id for the provided context level.
*
* The caller code is responsible of checking that $contextlevel is an integer.
*
* @param int $contextlevel The context level.
* @param string $pluginname The name of the plugin associated with the context level.
* @return int[]|false[]
*/
public static function get_defaults($contextlevel, $pluginname = '') {
$classname = \context_helper::get_class_for_level($contextlevel);
list($purposevar, $categoryvar) = self::var_names_from_context($classname, $pluginname);
$purposeid = get_config('tool_dataprivacy', $purposevar);
$categoryid = get_config('tool_dataprivacy', $categoryvar);
if (!empty($pluginname)) {
list($purposevar, $categoryvar) = self::var_names_from_context($classname);
// If the plugin-level doesn't have a default purpose set, try the context level.
if ($purposeid == false) {
$purposeid = get_config('tool_dataprivacy', $purposevar);
}
// If the plugin-level doesn't have a default category set, try the context level.
if ($categoryid == false) {
$categoryid = get_config('tool_dataprivacy', $categoryvar);
}
}
if (empty($purposeid)) {
$purposeid = context_instance::NOTSET;
}
if (empty($categoryid)) {
$categoryid = context_instance::NOTSET;
}
return [$purposeid, $categoryid];
}
/**
* Are data registry defaults set?
*
* At least the system defaults need to be set.
*
* @return bool
*/
public static function defaults_set() {
list($purposeid, $categoryid) = self::get_defaults(CONTEXT_SYSTEM);
if (empty($purposeid) || empty($categoryid)) {
return false;
}
return true;
}
/**
* Returns all site categories that are visible to the current user.
*
* @return \coursecat[]
*/
public static function get_site_categories() {
global $DB;
if (method_exists('\coursecat', 'get_all')) {
$categories = \coursecat::get_all(['returnhidden' => true]);
} else {
// Fallback (to be removed once this gets integrated into master).
$ids = $DB->get_fieldset_select('course_categories', 'id', '');
$categories = \coursecat::get_many($ids);
}
foreach ($categories as $key => $category) {
if (!$category->is_uservisible()) {
unset($categories[$key]);
}
}
return $categories;
}
/**
* Returns the roles assigned to the provided level.
*
* Important to note that it returns course-level assigned roles
* if the provided context level is below course.
*
* @param \context $context
* @return array
*/
public static function get_subject_scope(\context $context) {
if ($contextcourse = $context->get_course_context(false)) {
// Below course level we look at module or block level roles + course-assigned roles.
$courseroles = get_roles_with_assignment_on_context($contextcourse);
$roles = $courseroles + get_roles_with_assignment_on_context($context);
} else {
// We list category + system for others (we don't work with user instances so no need to work about them).
$roles = get_roles_used_in_context($context);
}
return array_map(function($role) {
if ($role->name) {
return $role->name;
} else {
return $role->shortname;
}
}, $roles);
}
/**
* Returns the effective value given a context instance
*
* @param \context $context
* @param string $element 'category' or 'purpose'
* @param int|false $forcedvalue Use this value as if this was this context instance value.
* @return persistent|false It return a 'purpose' instance or a 'category' instance, depending on $element
*/
public static function get_effective_context_value(\context $context, $element, $forcedvalue = false) {
global $DB;
if ($element !== 'purpose' && $element !== 'category') {
throw new coding_exception('Only \'purpose\' and \'category\' are supported.');
}
$fieldname = $element . 'id';
if (!empty($forcedvalue) && ($forcedvalue == context_instance::INHERIT)) {
// Do not include the current context when calculating the value.
// This has the effect that an inheritted value is calculated.
$parentcontextids = $context->get_parent_context_ids(false);
} else if (!empty($forcedvalue) && ($forcedvalue != context_instance::NOTSET)) {
return self::get_element_instance($element, $forcedvalue);
} else {
// Fetch all parent contexts, including self.
$parentcontextids = $context->get_parent_context_ids(true);
}
list($insql, $inparams) = $DB->get_in_or_equal($parentcontextids, SQL_PARAMS_NAMED);
$inparams['contextmodule'] = CONTEXT_MODULE;
if ('purpose' === $element) {
$elementjoin = 'LEFT JOIN {tool_dataprivacy_purpose} ele ON ctxins.purposeid = ele.id';
$elementfields = purpose::get_sql_fields('ele', 'ele');
} else {
$elementjoin = 'LEFT JOIN {tool_dataprivacy_category} ele ON ctxins.categoryid = ele.id';
$elementfields = category::get_sql_fields('ele', 'ele');
}
$contextfields = \context_helper::get_preload_record_columns_sql('ctx');
$fields = implode(', ', ['ctx.id', 'm.name AS modname', $contextfields, $elementfields]);
$sql = "SELECT $fields
FROM {context} ctx
LEFT JOIN {tool_dataprivacy_ctxinstance} ctxins ON ctx.id = ctxins.contextid
LEFT JOIN {course_modules} cm ON ctx.contextlevel = :contextmodule AND ctx.instanceid = cm.id
LEFT JOIN {modules} m ON m.id = cm.module
{$elementjoin}
WHERE ctx.id {$insql}
ORDER BY ctx.path DESC";
$contextinstances = $DB->get_records_sql($sql, $inparams);
// Check whether this context is a user context, or a child of a user context.
// All children of a User context share the same context and cannot be set individually.
foreach ($contextinstances as $record) {
\context_helper::preload_from_record($record);
$parent = \context::instance_by_id($record->id, false);
if ($parent->contextlevel == CONTEXT_USER) {
// Use the context level value for the user.
return self::get_effective_contextlevel_value(CONTEXT_USER, $element);
}
}
foreach ($contextinstances as $record) {
$parent = \context::instance_by_id($record->id, false);
$checkcontextlevel = false;
if (empty($record->eleid)) {
$checkcontextlevel = true;
}
if (!empty($forcedvalue) && context_instance::NOTSET == $forcedvalue) {
$checkcontextlevel = true;
}
if ($checkcontextlevel) {
// Check for a value at the contextlevel
$forplugin = empty($record->modname) ? '' : $record->modname;
list($purposeid, $categoryid) = self::get_effective_default_contextlevel_purpose_and_category(
$parent->contextlevel, false, false, $forplugin);
$instancevalue = $$fieldname;
if (context_instance::NOTSET != $instancevalue && context_instance::INHERIT != $instancevalue) {
// There is an actual value. Return it.
return self::get_element_instance($element, $instancevalue);
}
} else {
$elementclass = "\\tool_dataprivacy\\{$element}";
$instance = new $elementclass(null, $elementclass::extract_record($record, 'ele'));
$instance->validate();
return $instance;
}
}
throw new coding_exception('Something went wrong, system defaults should be set and we should already have a value.');
}
/**
* Returns the effective value for a context level.
*
* Note that this is different from the effective default context level
* (see get_effective_default_contextlevel_purpose_and_category) as this is returning
* the value set in the data registry, not in the defaults page.
*
* @param int $contextlevel
* @param string $element 'category' or 'purpose'
* @return \tool_dataprivacy\purpose|false
*/
public static function get_effective_contextlevel_value($contextlevel, $element) {
if ($element !== 'purpose' && $element !== 'category') {
throw new coding_exception('Only \'purpose\' and \'category\' are supported.');
}
$fieldname = $element . 'id';
if ($contextlevel != CONTEXT_SYSTEM && $contextlevel != CONTEXT_USER) {
throw new \coding_exception('Only context_system and context_user values can be retrieved, no other context levels ' .
'have a purpose or a category.');
}
list($purposeid, $categoryid) = self::get_effective_default_contextlevel_purpose_and_category($contextlevel);
// Note: The $$fieldname points to either $purposeid, or $categoryid.
if (context_instance::NOTSET != $$fieldname && context_instance::INHERIT != $$fieldname) {
// There is a specific value set.
return self::get_element_instance($element, $$fieldname);
}
throw new coding_exception('Something went wrong, system defaults should be set and we should already have a value.');
}
/**
* Returns the effective default purpose and category for a context level.
*
* @param int $contextlevel
* @param int|bool $forcedpurposevalue Use this value as if this was this context level purpose.
* @param int|bool $forcedcategoryvalue Use this value as if this was this context level category.
* @param string $component The name of the component to check.
* @return int[]
*/
public static function get_effective_default_contextlevel_purpose_and_category($contextlevel, $forcedpurposevalue = false,
$forcedcategoryvalue = false, $component = '') {
// Get the defaults for this context level.
list($purposeid, $categoryid) = self::get_defaults($contextlevel, $component);
// Honour forced values.
if ($forcedpurposevalue) {
$purposeid = $forcedpurposevalue;
}
if ($forcedcategoryvalue) {
$categoryid = $forcedcategoryvalue;
}
if ($contextlevel == CONTEXT_USER) {
// Only user context levels inherit from a parent context level.
list($parentpurposeid, $parentcategoryid) = self::get_defaults(CONTEXT_SYSTEM);
if (context_instance::INHERIT == $purposeid || context_instance::NOTSET == $purposeid) {
$purposeid = (int)$parentpurposeid;
}
if (context_instance::INHERIT == $categoryid || context_instance::NOTSET == $categoryid) {
$categoryid = $parentcategoryid;
}
}
return [$purposeid, $categoryid];
}
/**
* Returns an instance of the provided element.
*
* @throws \coding_exception
* @param string $element The element name 'purpose' or 'category'
* @param int $id The element id
* @return \core\persistent
*/
private static function get_element_instance($element, $id) {
if ($element !== 'purpose' && $element !== 'category') {
throw new coding_exception('No other elements than purpose and category are allowed');
}
$classname = '\tool_dataprivacy\\' . $element;
return new $classname($id);
}
}
@@ -0,0 +1,291 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Class for loading/storing data requests from the DB.
*
* @package tool_dataprivacy
* @copyright 2018 Jun Pataleta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_dataprivacy;
defined('MOODLE_INTERNAL') || die();
use core\persistent;
/**
* Class for loading/storing competencies from the DB.
*
* @copyright 2018 Jun Pataleta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class data_request extends persistent {
/** The table name this persistent object maps to. */
const TABLE = 'tool_dataprivacy_request';
/** Data request created manually. */
const DATAREQUEST_CREATION_MANUAL = 0;
/** Data request created automatically. */
const DATAREQUEST_CREATION_AUTO = 1;
/**
* Return the definition of the properties of this model.
*
* @return array
*/
protected static function define_properties() {
return [
'type' => [
'choices' => [
api::DATAREQUEST_TYPE_EXPORT,
api::DATAREQUEST_TYPE_DELETE,
api::DATAREQUEST_TYPE_OTHERS,
],
'type' => PARAM_INT
],
'comments' => [
'type' => PARAM_TEXT,
'default' => ''
],
'commentsformat' => [
'choices' => [
FORMAT_HTML,
FORMAT_MOODLE,
FORMAT_PLAIN,
FORMAT_MARKDOWN
],
'type' => PARAM_INT,
'default' => FORMAT_PLAIN
],
'userid' => [
'default' => 0,
'type' => PARAM_INT
],
'requestedby' => [
'default' => 0,
'type' => PARAM_INT
],
'status' => [
'default' => api::DATAREQUEST_STATUS_PENDING,
'choices' => [
api::DATAREQUEST_STATUS_PENDING,
api::DATAREQUEST_STATUS_PREPROCESSING,
api::DATAREQUEST_STATUS_AWAITING_APPROVAL,
api::DATAREQUEST_STATUS_APPROVED,
api::DATAREQUEST_STATUS_PROCESSING,
api::DATAREQUEST_STATUS_COMPLETE,
api::DATAREQUEST_STATUS_CANCELLED,
api::DATAREQUEST_STATUS_REJECTED,
api::DATAREQUEST_STATUS_DOWNLOAD_READY,
api::DATAREQUEST_STATUS_EXPIRED,
api::DATAREQUEST_STATUS_DELETED,
],
'type' => PARAM_INT
],
'dpo' => [
'default' => 0,
'type' => PARAM_INT,
'null' => NULL_ALLOWED
],
'dpocomment' => [
'default' => '',
'type' => PARAM_TEXT,
'null' => NULL_ALLOWED
],
'dpocommentformat' => [
'choices' => [
FORMAT_HTML,
FORMAT_MOODLE,
FORMAT_PLAIN,
FORMAT_MARKDOWN
],
'type' => PARAM_INT,
'default' => FORMAT_PLAIN
],
'creationmethod' => [
'default' => self::DATAREQUEST_CREATION_MANUAL,
'choices' => [
self::DATAREQUEST_CREATION_MANUAL,
self::DATAREQUEST_CREATION_AUTO
],
'type' => PARAM_INT
],
];
}
/**
* Determines whether a completed data export request has expired.
* The response will be valid regardless of the expiry scheduled task having run.
*
* @param data_request $request the data request object whose expiry will be checked.
* @return bool true if the request has expired.
*/
public static function is_expired(data_request $request) {
$result = false;
// Only export requests expire.
if ($request->get('type') == api::DATAREQUEST_TYPE_EXPORT) {
switch ($request->get('status')) {
// Expired requests are obviously expired.
case api::DATAREQUEST_STATUS_EXPIRED:
$result = true;
break;
// Complete requests are expired if the expiry time has elapsed.
case api::DATAREQUEST_STATUS_DOWNLOAD_READY:
$expiryseconds = get_config('tool_dataprivacy', 'privacyrequestexpiry');
if ($expiryseconds > 0 && time() >= ($request->get('timemodified') + $expiryseconds)) {
$result = true;
}
break;
}
}
return $result;
}
/**
* Fetch completed data requests which are due to expire.
*
* @param int $userid Optional user ID to filter by.
*
* @return array Details of completed requests which are due to expire.
*/
public static function get_expired_requests($userid = 0) {
global $DB;
$expiryseconds = get_config('tool_dataprivacy', 'privacyrequestexpiry');
$expirytime = strtotime("-{$expiryseconds} second");
$table = self::TABLE;
$sqlwhere = 'type = :export_type AND status = :completestatus AND timemodified <= :expirytime';
$params = array(
'export_type' => api::DATAREQUEST_TYPE_EXPORT,
'completestatus' => api::DATAREQUEST_STATUS_DOWNLOAD_READY,
'expirytime' => $expirytime,
);
$sort = 'id';
$fields = 'id, userid';
// Filter by user ID if specified.
if ($userid > 0) {
$sqlwhere .= ' AND (userid = :userid OR requestedby = :requestedby)';
$params['userid'] = $userid;
$params['requestedby'] = $userid;
}
return $DB->get_records_select_menu($table, $sqlwhere, $params, $sort, $fields, 0, 2000);
}
/**
* Expire a given set of data requests.
* Update request status and delete the files.
*
* @param array $expiredrequests [requestid => userid]
*
* @return void
*/
public static function expire($expiredrequests) {
global $DB;
$ids = array_keys($expiredrequests);
if (count($ids) > 0) {
list($insql, $inparams) = $DB->get_in_or_equal($ids);
$initialparams = array(api::DATAREQUEST_STATUS_EXPIRED, time());
$params = array_merge($initialparams, $inparams);
$update = "UPDATE {" . self::TABLE . "}
SET status = ?, timemodified = ?
WHERE id $insql";
if ($DB->execute($update, $params)) {
$fs = get_file_storage();
foreach ($expiredrequests as $id => $userid) {
$usercontext = \context_user::instance($userid);
$fs->delete_area_files($usercontext->id, 'tool_dataprivacy', 'export', $id);
}
}
}
}
/**
* Whether this request is in a state appropriate for reset/resubmission.
*
* Note: This does not check whether any other completed requests exist for this user.
*
* @return bool
*/
public function is_resettable() : bool {
if (api::DATAREQUEST_TYPE_OTHERS == $this->get('type')) {
// It is not possible to reset 'other' reqeusts.
return false;
}
$resettable = [
api::DATAREQUEST_STATUS_AWAITING_APPROVAL => true,
api::DATAREQUEST_STATUS_APPROVED => true,
api::DATAREQUEST_STATUS_REJECTED => true,
];
return isset($resettable[$this->get('status')]);
}
/**
* Whether this request is 'active'.
*
* @return bool
*/
public function is_active() : bool {
$active = [
api::DATAREQUEST_STATUS_AWAITING_APPROVAL => true,
api::DATAREQUEST_STATUS_APPROVED => true,
];
return isset($active[$this->get('status')]);
}
/**
* Reject this request and resubmit it as a fresh request.
*
* Note: This does not check whether any other completed requests exist for this user.
*
* @return self
*/
public function resubmit_request() : data_request {
if ($this->is_active()) {
$this->set('status', api::DATAREQUEST_STATUS_REJECTED)->save();
}
if (!$this->is_resettable()) {
throw new \moodle_exception('cannotreset', 'tool_dataprivacy');
}
$currentdata = $this->to_record();
unset($currentdata->id);
$clone = api::create_data_request($this->get('userid'), $this->get('type'));
$clone->set('comments', $this->get('comments'));
$clone->set('dpo', $this->get('dpo'));
$clone->set('requestedby', $this->get('requestedby'));
$clone->save();
return $clone;
}
}
@@ -0,0 +1,63 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Event observers supported by this module.
*
* @package tool_dataprivacy
* @copyright 2018 Mihail Geshoski <mihail@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_dataprivacy\event;
use \tool_dataprivacy\api;
use \tool_dataprivacy\data_request;
defined('MOODLE_INTERNAL') || die();
/**
* Event observers supported by this module.
*
* @package tool_dataprivacy
* @copyright 2018 Mihail Geshoski <mihail@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class user_deleted_observer {
/**
* Create user data deletion request when the user is deleted.
*
* @param \core\event\user_deleted $event
*/
public static function create_delete_data_request(\core\event\user_deleted $event) {
// Automatic creation of deletion requests must be enabled.
if (get_config('tool_dataprivacy', 'automaticdeletionrequests')) {
$requesttypes = [api::DATAREQUEST_TYPE_DELETE];
$requeststatuses = [api::DATAREQUEST_STATUS_COMPLETE, api::DATAREQUEST_STATUS_DELETED];
$hasongoingdeleterequests = api::has_ongoing_request($event->objectid, $requesttypes[0]);
$hascompleteddeleterequest = (api::get_data_requests_count($event->objectid, $requeststatuses,
$requesttypes) > 0) ? true : false;
if (!$hasongoingdeleterequests && !$hascompleteddeleterequest) {
api::create_data_request($event->objectid, $requesttypes[0],
get_string('datarequestcreatedupondelete', 'tool_dataprivacy'),
data_request::DATAREQUEST_CREATION_AUTO);
}
}
}
}
@@ -0,0 +1,378 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Class that represents an expired context.
*
* @package tool_dataprivacy
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_dataprivacy;
use dml_exception;
defined('MOODLE_INTERNAL') || die();
/**
* Class that represents an expired context.
*
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class expired_context extends \core\persistent {
/**
* Database table.
*/
const TABLE = 'tool_dataprivacy_ctxexpired';
/**
* Expired contexts with no delete action scheduled.
*/
const STATUS_EXPIRED = 0;
/**
* Expired contexts approved for deletion.
*/
const STATUS_APPROVED = 1;
/**
* Already processed expired contexts.
*/
const STATUS_CLEANED = 2;
/**
* Return the definition of the properties of this model.
*
* @return array
*/
protected static function define_properties() {
return [
'contextid' => [
'type' => PARAM_INT,
'description' => 'The context id.',
],
'defaultexpired' => [
'type' => PARAM_INT,
'description' => 'Whether to default retention period for the purpose has been reached',
'default' => 1,
],
'expiredroles' => [
'type' => PARAM_TEXT,
'description' => 'This list of roles to include during deletion',
'default' => '',
],
'unexpiredroles' => [
'type' => PARAM_TEXT,
'description' => 'This list of roles to exclude during deletion',
'default' => '',
],
'status' => [
'choices' => [
self::STATUS_EXPIRED,
self::STATUS_APPROVED,
self::STATUS_CLEANED,
],
'type' => PARAM_INT,
'description' => 'The deletion status of the context.',
],
];
}
/**
* Returns expired_contexts instances that match the provided level and status.
*
* @param int $contextlevel The context level filter criterion.
* @param bool $status The expired context record's status.
* @param string $sort The sort column. Must match the column name in {tool_dataprivacy_ctxexpired} table
* @param int $offset The query offset.
* @param int $limit The query limit.
* @return expired_context[]
* @throws dml_exception
*/
public static function get_records_by_contextlevel($contextlevel = null, $status = false, $sort = 'timecreated',
$offset = 0, $limit = 0) {
global $DB;
$sql = "SELECT expiredctx.*
FROM {" . self::TABLE . "} expiredctx
JOIN {context} ctx
ON ctx.id = expiredctx.contextid";
$params = [];
$conditions = [];
if (!empty($contextlevel)) {
$conditions[] = "ctx.contextlevel = :contextlevel";
$params['contextlevel'] = intval($contextlevel);
}
if ($status !== false) {
$conditions[] = "expiredctx.status = :status";
$params['status'] = intval($status);
}
if (!empty($conditions)) {
$sql .= ' WHERE ' . implode(' AND ', $conditions);
}
$sql .= " ORDER BY expiredctx.{$sort}";
$records = $DB->get_records_sql($sql, $params, $offset, $limit);
// We return class instances.
$instances = array();
foreach ($records as $key => $record) {
$instances[$key] = new static(0, $record);
}
return $instances;
}
/**
* Returns the number of expired_contexts instances that match the provided level and status.
*
* @param int $contextlevel
* @param bool $status
* @return int
* @throws dml_exception
*/
public static function get_record_count_by_contextlevel($contextlevel = null, $status = false) {
global $DB;
$sql = "SELECT COUNT(1)
FROM {" . self::TABLE . "} expiredctx
JOIN {context} ctx
ON ctx.id = expiredctx.contextid";
$conditions = [];
$params = [];
if (!empty($contextlevel)) {
$conditions[] = "ctx.contextlevel = :contextlevel";
$params['contextlevel'] = intval($contextlevel);
}
if ($status !== false) {
$sql .= " AND expiredctx.status = :status";
$params['status'] = intval($status);
}
if (!empty($conditions)) {
$sql .= ' WHERE ' . implode(' AND ', $conditions);
}
return $DB->count_records_sql($sql, $params);
}
/**
* Set the list of role IDs for either expiredroles, or unexpiredroles.
*
* @param string $field
* @param int[] $roleids
* @return expired_context
*/
protected function set_roleids_for(string $field, array $roleids) : expired_context {
$roledata = json_encode($roleids);
$this->raw_set($field, $roledata);
return $this;
}
/**
* Get the list of role IDs for either expiredroles, or unexpiredroles.
*
* @param string $field
* @return int[]
*/
protected function get_roleids_for(string $field) {
$value = $this->raw_get($field);
if (empty($value)) {
return [];
}
return json_decode($value);
}
/**
* Set the list of unexpired role IDs.
*
* @param int[] $roleids
* @return expired_context
*/
protected function set_unexpiredroles(array $roleids) : expired_context {
$this->set_roleids_for('unexpiredroles', $roleids);
return $this;
}
/**
* Add a set of role IDs to the list of expired role IDs.
*
* @param int[] $roleids
* @return expired_context
*/
public function add_expiredroles(array $roleids) : expired_context {
$existing = $this->get('expiredroles');
$newvalue = array_merge($existing, $roleids);
$this->set('expiredroles', $newvalue);
return $this;
}
/**
* Add a set of role IDs to the list of unexpired role IDs.
*
* @param int[] $roleids
* @return unexpired_context
*/
public function add_unexpiredroles(array $roleids) : expired_context {
$existing = $this->get('unexpiredroles');
$newvalue = array_merge($existing, $roleids);
$this->set('unexpiredroles', $newvalue);
return $this;
}
/**
* Set the list of expired role IDs.
*
* @param int[] $roleids
* @return expired_context
*/
protected function set_expiredroles(array $roleids) : expired_context {
$this->set_roleids_for('expiredroles', $roleids);
return $this;
}
/**
* Get the list of expired role IDs.
*
* @return int[]
*/
protected function get_expiredroles() {
return $this->get_roleids_for('expiredroles');
}
/**
* Get the list of unexpired role IDs.
*
* @return int[]
*/
protected function get_unexpiredroles() {
return $this->get_roleids_for('unexpiredroles');
}
/**
* Create a new expired_context based on the context, and expiry_info object.
*
* @param \context $context
* @param expiry_info $info
* @param boolean $save
* @return expired_context
*/
public static function create_from_expiry_info(\context $context, expiry_info $info, bool $save = true) : expired_context {
$record = (object) [
'contextid' => $context->id,
'status' => self::STATUS_EXPIRED,
'defaultexpired' => (int) $info->is_default_expired(),
];
$expiredcontext = new static(0, $record);
$expiredcontext->set('expiredroles', $info->get_expired_roles());
$expiredcontext->set('unexpiredroles', $info->get_unexpired_roles());
if ($save) {
$expiredcontext->save();
}
return $expiredcontext;
}
/**
* Update the expired_context from an expiry_info object which relates to this context.
*
* @param expiry_info $info
* @return $this
*/
public function update_from_expiry_info(expiry_info $info) : expired_context {
$save = false;
// Compare the expiredroles.
$thisexpired = $this->get('expiredroles');
$infoexpired = $info->get_expired_roles();
sort($thisexpired);
sort($infoexpired);
if ($infoexpired != $thisexpired) {
$this->set('expiredroles', $infoexpired);
$save = true;
}
// Compare the unexpiredroles.
$thisunexpired = $this->get('unexpiredroles');
$infounexpired = $info->get_unexpired_roles();
sort($thisunexpired);
sort($infounexpired);
if ($infounexpired != $thisunexpired) {
$this->set('unexpiredroles', $infounexpired);
$save = true;
}
if (empty($this->get('defaultexpired')) == $info->is_default_expired()) {
$this->set('defaultexpired', (int) $info->is_default_expired());
$save = true;
}
if ($save) {
$this->set('status', self::STATUS_EXPIRED);
$this->save();
}
return $this;
}
/**
* Check whether this expired_context record is in a state ready for deletion to actually take place.
*
* @return bool
*/
public function can_process_deletion() : bool {
return ($this->get('status') == self::STATUS_APPROVED);
}
/**
* Check whether this expired_context record has already been cleaned.
*
* @return bool
*/
public function is_complete() : bool {
return ($this->get('status') == self::STATUS_CLEANED);
}
/**
* Whether this context has 'fully' expired.
* That is to say that the default retention period has been reached, and that there are no unexpired roles.
*
* @return bool
*/
public function is_fully_expired() : bool {
return $this->get('defaultexpired') && empty($this->get('unexpiredroles'));
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,207 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Expiry Data.
*
* @package tool_dataprivacy
* @copyright 2018 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_dataprivacy;
use core_privacy\manager;
defined('MOODLE_INTERNAL') || die();
/**
* Expiry Data.
*
* @copyright 2018 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class expiry_info {
/** @var bool Whether this context is fully expired */
protected $fullyexpired = false;
/** @var bool Whether the default expiry value of this purpose has been reached */
protected $defaultexpiryreached = false;
/** @var bool Whether the default purpose is protected */
protected $defaultprotected = false;
/** @var int[] List of expires roles */
protected $expired = [];
/** @var int[] List of unexpires roles */
protected $unexpired = [];
/** @var int[] List of unexpired roles which are also protected */
protected $protectedroles = [];
/**
* Constructor for the expiry_info class.
*
* @param bool $default Whether the default expiry period for this context has been reached.
* @param bool $defaultprotected Whether the default expiry is protected.
* @param int[] $expired A list of roles in this context which have explicitly expired.
* @param int[] $unexpired A list of roles in this context which have not yet expired.
* @param int[] $protectedroles A list of unexpired roles in this context which are protected.
*/
public function __construct(bool $default, bool $defaultprotected, array $expired, array $unexpired, array $protectedroles) {
$this->defaultexpiryreached = $default;
$this->defaultprotected = $defaultprotected;
$this->expired = $expired;
$this->unexpired = $unexpired;
$this->protectedroles = $protectedroles;
}
/**
* Whether this context has 'fully' expired.
* That is to say that the default retention period has been reached, and that there are no unexpired roles.
*
* @return bool
*/
public function is_fully_expired() : bool {
return $this->defaultexpiryreached && empty($this->unexpired);
}
/**
* Whether any part of this context has expired.
*
* @return bool
*/
public function is_any_expired() : bool {
if ($this->is_fully_expired()) {
return true;
}
if (!empty($this->get_expired_roles())) {
return true;
}
if ($this->is_default_expired()) {
return true;
}
return false;
}
/**
* Get the list of explicitly expired role IDs.
* Note: This does not list roles which have been expired via the default retention policy being reached.
*
* @return int[]
*/
public function get_expired_roles() : array {
if ($this->is_default_expired()) {
return [];
}
return $this->expired;
}
/**
* Check whether the specified role is explicitly expired.
* Note: This does not list roles which have been expired via the default retention policy being reached.
*
* @param int $roleid
* @return bool
*/
public function is_role_expired(int $roleid) : bool {
return false !== array_search($roleid, $this->expired);
}
/**
* Whether the default retention policy has been reached.
*
* @return bool
*/
public function is_default_expired() : bool {
return $this->defaultexpiryreached;
}
/**
* Whether the default purpose is protected.
*
* @return bool
*/
public function is_default_protected() : bool {
return $this->defaultprotected;
}
/**
* Get the list of unexpired role IDs.
*
* @return int[]
*/
public function get_unexpired_roles() : array {
return $this->unexpired;
}
/**
* Get the list of unexpired protected roles.
*
* @return int[]
*/
public function get_unexpired_protected_roles() : array {
return array_keys(array_filter($this->protectedroles));
}
/**
* Get a list of all overridden roles which are unprotected.
* @return int[]
*/
public function get_unprotected_overridden_roles() : array {
$allroles = array_merge($this->expired, $this->unexpired);
return array_diff($allroles, $this->protectedroles);
}
/**
* Merge this expiry_info object with another belonging to a child context in order to set the 'safest' heritage.
*
* It is not possible to delete any part of a context that is not deleted by a parent.
* So if a course's retention policy has been reached, then only parts where the children have also expired can be
* deleted.
*
* @param expiry_info $child The child record to merge with.
* @return $this
*/
public function merge_with_child(expiry_info $child) : expiry_info {
if ($child->is_fully_expired()) {
return $this;
}
// If the child is not fully expired, then none of the parents can be either.
$this->fullyexpired = false;
// Remove any role in this node which is not expired in the child.
foreach ($this->expired as $key => $roleid) {
if (!$child->is_role_expired($roleid)) {
unset($this->expired[$key]);
}
}
array_merge($this->unexpired, $child->get_unexpired_roles());
if (!$child->is_default_expired()) {
$this->defaultexpiryreached = false;
}
return $this;
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,79 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Class for exporting data category.
*
* @package tool_dataprivacy
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_dataprivacy\external;
defined('MOODLE_INTERNAL') || die();
use core\external\persistent_exporter;
use tool_dataprivacy\category;
use tool_dataprivacy\context_instance;
/**
* Class for exporting field data.
*
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class category_exporter extends persistent_exporter {
/**
* Defines the persistent class.
*
* @return string
*/
protected static function define_class() {
return \tool_dataprivacy\category::class;
}
/**
* Returns a list of objects that are related.
*
* @return array
*/
protected static function define_related() {
return array(
'context' => 'context',
);
}
/**
* Utility function that fetches a category name from the given ID.
*
* @param int $categoryid The category ID. Could be INHERIT (false, -1), NOT_SET (0), or the actual ID.
* @return string The purpose name.
*/
public static function get_name($categoryid) {
global $PAGE;
if ($categoryid === false || $categoryid == context_instance::INHERIT) {
return get_string('inherit', 'tool_dataprivacy');
} else if ($categoryid == context_instance::NOTSET) {
return get_string('notset', 'tool_dataprivacy');
} else {
$purpose = new category($categoryid);
$output = $PAGE->get_renderer('tool_dataprivacy');
$exporter = new self($purpose, ['context' => \context_system::instance()]);
$data = $exporter->export($output);
return $data->name;
}
}
}
@@ -0,0 +1,45 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Class for exporting context instance.
*
* @package tool_dataprivacy
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_dataprivacy\external;
defined('MOODLE_INTERNAL') || die();
use core\external\persistent_exporter;
/**
* Class for exporting context instance.
*
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class context_instance_exporter extends persistent_exporter {
/**
* Defines the persistent class.
*
* @return string
*/
protected static function define_class() {
return \tool_dataprivacy\context_instance::class;
}
}
@@ -0,0 +1,201 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Class for exporting user evidence with all competencies.
*
* @package tool_dataprivacy
* @copyright 2018 Jun Pataleta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_dataprivacy\external;
defined('MOODLE_INTERNAL') || die();
use coding_exception;
use core\external\persistent_exporter;
use core_user;
use core_user\external\user_summary_exporter;
use dml_exception;
use moodle_exception;
use renderer_base;
use tool_dataprivacy\api;
use tool_dataprivacy\data_request;
use tool_dataprivacy\local\helper;
/**
* Class for exporting user evidence with all competencies.
*
* @copyright 2018 Jun Pataleta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class data_request_exporter extends persistent_exporter {
/**
* Class definition.
*
* @return string
*/
protected static function define_class() {
return data_request::class;
}
/**
* Related objects definition.
*
* @return array
*/
protected static function define_related() {
return [
'context' => 'context',
];
}
/**
* Other properties definition.
*
* @return array
*/
protected static function define_other_properties() {
return [
'foruser' => [
'type' => user_summary_exporter::read_properties_definition(),
],
'requestedbyuser' => [
'type' => user_summary_exporter::read_properties_definition(),
'optional' => true
],
'dpouser' => [
'type' => user_summary_exporter::read_properties_definition(),
'optional' => true
],
'messagehtml' => [
'type' => PARAM_RAW,
'optional' => true
],
'typename' => [
'type' => PARAM_TEXT,
],
'typenameshort' => [
'type' => PARAM_TEXT,
],
'statuslabel' => [
'type' => PARAM_TEXT,
],
'statuslabelclass' => [
'type' => PARAM_TEXT,
],
'canreview' => [
'type' => PARAM_BOOL,
'optional' => true,
'default' => false
],
'approvedeny' => [
'type' => PARAM_BOOL,
'optional' => true,
'default' => false
],
'canmarkcomplete' => [
'type' => PARAM_BOOL,
'optional' => true,
'default' => false
],
];
}
/**
* Assign values to the defined other properties.
*
* @param renderer_base $output The output renderer object.
* @return array
* @throws coding_exception
* @throws dml_exception
* @throws moodle_exception
*/
protected function get_other_values(renderer_base $output) {
$values = [];
$foruserid = $this->persistent->get('userid');
$user = core_user::get_user($foruserid, '*', MUST_EXIST);
$userexporter = new user_summary_exporter($user);
$values['foruser'] = $userexporter->export($output);
$requestedbyid = $this->persistent->get('requestedby');
if ($requestedbyid != $foruserid) {
$user = core_user::get_user($requestedbyid, '*', MUST_EXIST);
$userexporter = new user_summary_exporter($user);
$values['requestedbyuser'] = $userexporter->export($output);
} else {
$values['requestedbyuser'] = $values['foruser'];
}
if (!empty($this->persistent->get('dpo'))) {
$dpoid = $this->persistent->get('dpo');
$user = core_user::get_user($dpoid, '*', MUST_EXIST);
$userexporter = new user_summary_exporter($user);
$values['dpouser'] = $userexporter->export($output);
}
$values['messagehtml'] = text_to_html($this->persistent->get('comments'));
$requesttype = $this->persistent->get('type');
$values['typename'] = helper::get_request_type_string($requesttype);
$values['typenameshort'] = helper::get_shortened_request_type_string($requesttype);
$values['canreview'] = false;
$values['approvedeny'] = false;
$values['statuslabel'] = helper::get_request_status_string($this->persistent->get('status'));
switch ($this->persistent->get('status')) {
case api::DATAREQUEST_STATUS_PENDING:
$values['statuslabelclass'] = 'label-info';
// Request can be manually completed for general enquiry requests.
$values['canmarkcomplete'] = $requesttype == api::DATAREQUEST_TYPE_OTHERS;
break;
case api::DATAREQUEST_STATUS_PREPROCESSING:
$values['statuslabelclass'] = 'label-default';
break;
case api::DATAREQUEST_STATUS_AWAITING_APPROVAL:
$values['statuslabelclass'] = 'label-info';
// DPO can review the request once it's ready.
$values['canreview'] = true;
// Whether the DPO can approve or deny the request.
$values['approvedeny'] = in_array($requesttype, [api::DATAREQUEST_TYPE_EXPORT, api::DATAREQUEST_TYPE_DELETE]);
break;
case api::DATAREQUEST_STATUS_APPROVED:
$values['statuslabelclass'] = 'label-info';
break;
case api::DATAREQUEST_STATUS_PROCESSING:
$values['statuslabelclass'] = 'label-info';
break;
case api::DATAREQUEST_STATUS_COMPLETE:
case api::DATAREQUEST_STATUS_DOWNLOAD_READY:
case api::DATAREQUEST_STATUS_DELETED:
$values['statuslabelclass'] = 'label-success';
break;
case api::DATAREQUEST_STATUS_CANCELLED:
$values['statuslabelclass'] = 'label-warning';
break;
case api::DATAREQUEST_STATUS_REJECTED:
$values['statuslabelclass'] = 'label-important';
break;
case api::DATAREQUEST_STATUS_EXPIRED:
$values['statuslabelclass'] = 'label-default';
break;
}
return $values;
}
}
@@ -0,0 +1,63 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Class for exporting an object containing a name and a description.
*
* @package tool_dataprivacy
* @copyright 2018 Jun Pataleta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_dataprivacy\external;
defined('MOODLE_INTERNAL') || die();
use core\external\exporter;
/**
* Class that exports an object containing a name and a description.
*
* @copyright 2018 Jun Pataleta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class name_description_exporter extends exporter {
/**
* Returns a list of objects that are related.
*
* @return array
*/
protected static function define_related() {
return array(
'context' => 'context',
);
}
/**
* Return the list of properties.
*
* @return array
*/
protected static function define_properties() {
return [
'name' => [
'type' => PARAM_TEXT,
],
'description' => [
'type' => PARAM_TEXT,
],
];
}
}
@@ -0,0 +1,161 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Class for exporting data purpose.
*
* @package tool_dataprivacy
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_dataprivacy\external;
defined('MOODLE_INTERNAL') || die();
use coding_exception;
use core\external\persistent_exporter;
use Exception;
use renderer_base;
use tool_dataprivacy\context_instance;
use tool_dataprivacy\purpose;
/**
* Class for exporting field data.
*
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class purpose_exporter extends persistent_exporter {
/**
* Defines the persistent class.
*
* @return string
*/
protected static function define_class() {
return purpose::class;
}
/**
* Returns a list of objects that are related.
*
* @return array
*/
protected static function define_related() {
return array(
'context' => 'context',
);
}
/**
* Return the list of additional properties.
*
* @return array
*/
protected static function define_other_properties() {
return [
'formattedretentionperiod' => [
'type' => PARAM_TEXT
],
'formattedlawfulbases' => [
'type' => name_description_exporter::read_properties_definition(),
'multiple' => true
],
'formattedsensitivedatareasons' => [
'type' => name_description_exporter::read_properties_definition(),
'multiple' => true,
'optional' => true
],
'roleoverrides' => [
'type' => PARAM_TEXT
],
];
}
/**
* Return other properties.
*
* @param renderer_base $output
* @return array
* @throws coding_exception
* @throws Exception
*/
protected function get_other_values(renderer_base $output) {
$values = [];
$formattedbases = [];
$lawfulbases = explode(',', $this->persistent->get('lawfulbases'));
if (!empty($lawfulbases)) {
foreach ($lawfulbases as $basis) {
if (empty(trim($basis))) {
continue;
}
$formattedbases[] = (object)[
'name' => get_string($basis . '_name', 'tool_dataprivacy'),
'description' => get_string($basis . '_description', 'tool_dataprivacy')
];
}
}
$values['formattedlawfulbases'] = $formattedbases;
$formattedsensitivereasons = [];
$sensitivereasons = explode(',', $this->persistent->get('sensitivedatareasons'));
if (!empty($sensitivereasons)) {
foreach ($sensitivereasons as $reason) {
if (empty(trim($reason))) {
continue;
}
$formattedsensitivereasons[] = (object)[
'name' => get_string($reason . '_name', 'tool_dataprivacy'),
'description' => get_string($reason . '_description', 'tool_dataprivacy')
];
}
}
$values['formattedsensitivedatareasons'] = $formattedsensitivereasons;
$retentionperiod = $this->persistent->get('retentionperiod');
if ($retentionperiod) {
$formattedtime = \tool_dataprivacy\api::format_retention_period(new \DateInterval($retentionperiod));
} else {
$formattedtime = get_string('retentionperiodnotdefined', 'tool_dataprivacy');
}
$values['formattedretentionperiod'] = $formattedtime;
$values['roleoverrides'] = !empty($this->persistent->get_purpose_overrides());
return $values;
}
/**
* Utility function that fetches a purpose name from the given ID.
*
* @param int $purposeid The purpose ID. Could be INHERIT (false, -1), NOT_SET (0), or the actual ID.
* @return string The purpose name.
*/
public static function get_name($purposeid) {
global $PAGE;
if ($purposeid === false || $purposeid == context_instance::INHERIT) {
return get_string('inherit', 'tool_dataprivacy');
} else if ($purposeid == context_instance::NOTSET) {
return get_string('notset', 'tool_dataprivacy');
} else {
$purpose = new purpose($purposeid);
$output = $PAGE->get_renderer('tool_dataprivacy');
$exporter = new self($purpose, ['context' => \context_system::instance()]);
$data = $exporter->export($output);
return $data->name;
}
}
}
@@ -0,0 +1,63 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* An implementation of a userlist which has been filtered and approved.
*
* @package tool_dataprivacy
* @copyright 2018 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_dataprivacy;
defined('MOODLE_INTERNAL') || die();
/**
* An implementation of a userlist which can be filtered by role.
*
* @copyright 2018 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class filtered_userlist extends \core_privacy\local\request\approved_userlist {
/**
* Apply filters to only remove users in the expireduserids list, and to remove any who are in the unexpired list.
* The unexpired list wins where a user is in both lists.
*
* @param int[] $expireduserids The list of userids for users who should be expired.
* @param int[] $unexpireduserids The list of userids for those users who should not be expired.
* @return $this
*/
public function apply_expired_context_filters(array $expireduserids, array $unexpireduserids) : filtered_userlist {
// The current userlist content.
$userids = $this->get_userids();
if (!empty($expireduserids)) {
// Now remove any not on the list of expired users.
$userids = array_intersect($userids, $expireduserids);
}
if (!empty($unexpireduserids)) {
// Remove any on the list of unexpiredusers users.
$userids = array_diff($userids, $unexpireduserids);
}
$this->set_userids($userids);
return $this;
}
}
@@ -0,0 +1,67 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file contains the form add/update a data category.
*
* @package tool_dataprivacy
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_dataprivacy\form;
defined('MOODLE_INTERNAL') || die();
use core\form\persistent;
/**
* Data category form.
*
* @package tool_dataprivacy
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class category extends persistent {
/**
* @var The persistent class.
*/
protected static $persistentclass = 'tool_dataprivacy\\category';
/**
* Define the form - called by parent constructor
*/
public function definition() {
$mform = $this->_form;
$mform->addElement('text', 'name', get_string('name'), 'maxlength="100"');
$mform->setType('name', PARAM_TEXT);
$mform->addRule('name', get_string('required'), 'required', null, 'server');
$mform->addRule('name', get_string('maximumchars', '', 100), 'maxlength', 100, 'server');
$mform->addElement('editor', 'description', get_string('description'), null, ['autosave' => false]);
$mform->setType('description', PARAM_CLEANHTML);
if (!empty($this->_customdata['showbuttons'])) {
if (!$this->get_persistent()->get('id')) {
$savetext = get_string('add');
} else {
$savetext = get_string('savechanges');
}
$this->add_action_buttons(true, $savetext);
}
}
}
@@ -0,0 +1,226 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file contains the form add/update context instance data.
*
* @package tool_dataprivacy
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_dataprivacy\form;
defined('MOODLE_INTERNAL') || die();
use tool_dataprivacy\api;
use tool_dataprivacy\data_registry;
use tool_dataprivacy\purpose;
/**
* Context instance data form.
*
* @package tool_dataprivacy
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class context_instance extends \core\form\persistent {
/**
* @var The persistent class.
*/
protected static $persistentclass = 'tool_dataprivacy\\context_instance';
/**
* Define the form - called by parent constructor
*/
public function definition() {
$this->_form->setDisableShortforms();
$this->_form->addElement('header', 'contextname', $this->_customdata['contextname']);
$subjectscope = implode(', ', $this->_customdata['subjectscope']);
if (empty($subjectscope)) {
$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);
$this->_form->addElement('hidden', 'contextid');
$this->_form->setType('contextid', PARAM_INT);
parent::add_action_buttons(false, get_string('savechanges'));
}
/**
* Adds purpose and category selectors.
*
* @param int $contextlevel Apply this context level defaults. False for no defaults.
* @return null
*/
protected function add_purpose_category($contextlevel = false) {
$mform = $this->_form;
$addcategorytext = $this->get_add_element_content(get_string('addcategory', 'tool_dataprivacy'));
$categoryselect = $mform->createElement('select', 'categoryid', null, $this->_customdata['categories']);
$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);
$addpurposetext = $this->get_add_element_content(get_string('addpurpose', 'tool_dataprivacy'));
$purposeselect = $mform->createElement('select', 'purposeid', null, $this->_customdata['purposes']);
$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');
}
}
/**
* Returns the 'add' label.
*
* It depends on the theme in use.
*
* @param string $label
* @return \renderable|string
*/
private function get_add_element_content($label) {
global $PAGE, $OUTPUT;
$bs4 = false;
$theme = $PAGE->theme;
if ($theme->name === 'boost') {
$bs4 = true;
} else {
foreach ($theme->parents as $basetheme) {
if ($basetheme === 'boost') {
$bs4 = true;
}
}
}
if (!$bs4) {
return $label;
}
return $OUTPUT->pix_icon('e/insert', $label);
}
/**
* Returns the customdata array for the provided context instance.
*
* @param \context $context
* @return array
*/
public static function get_context_instance_customdata(\context $context) {
$persistent = \tool_dataprivacy\context_instance::get_record_by_contextid($context->id, false);
if (!$persistent) {
$persistent = new \tool_dataprivacy\context_instance();
$persistent->set('contextid', $context->id);
}
$purposes = [];
foreach (api::get_purposes() as $purpose) {
$purposes[$purpose->get('id')] = $purpose;
}
$purposeoptions = \tool_dataprivacy\output\data_registry_page::purpose_options($purposes);
$categoryoptions = \tool_dataprivacy\output\data_registry_page::category_options(api::get_categories());
$customdata = [
'context' => $context,
'subjectscope' => data_registry::get_subject_scope($context),
'contextname' => $context->get_context_name(),
'persistent' => $persistent,
'purposes' => $purposeoptions,
'categories' => $categoryoptions,
];
$effectivepurpose = api::get_effective_context_purpose($context);
if ($effectivepurpose) {
$customdata['currentretentionperiod'] = self::get_retention_display_text($effectivepurpose, $context->contextlevel,
$context);
$customdata['purposeretentionperiods'] = [];
foreach (array_keys($purposeoptions) as $optionvalue) {
if (isset($purposes[$optionvalue])) {
$purpose = $purposes[$optionvalue];
} else {
// Get the effective purpose if $optionvalue would be the selected value.
$purpose = api::get_effective_context_purpose($context, $optionvalue);
}
$retentionperiod = self::get_retention_display_text(
$purpose,
$context->contextlevel,
$context
);
$customdata['purposeretentionperiods'][$optionvalue] = $retentionperiod;
}
}
return $customdata;
}
/**
* Returns the purpose display text.
*
* @param purpose $effectivepurpose
* @param int $retentioncontextlevel
* @param \context $context The context, just for displaying (filters) purposes.
* @return string
*/
protected static function get_retention_display_text(purpose $effectivepurpose, $retentioncontextlevel, \context $context) {
global $PAGE;
$renderer = $PAGE->get_renderer('tool_dataprivacy');
$exporter = new \tool_dataprivacy\external\purpose_exporter($effectivepurpose, ['context' => $context]);
$exportedpurpose = $exporter->export($renderer);
switch ($retentioncontextlevel) {
case CONTEXT_COURSE:
case CONTEXT_MODULE:
case CONTEXT_BLOCK:
$str = get_string('effectiveretentionperiodcourse', 'tool_dataprivacy',
$exportedpurpose->formattedretentionperiod);
break;
case CONTEXT_USER:
$str = get_string('effectiveretentionperioduser', 'tool_dataprivacy',
$exportedpurpose->formattedretentionperiod);
break;
default:
$str = $exportedpurpose->formattedretentionperiod;
}
return $str;
}
}
@@ -0,0 +1,124 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file contains the form add/update context level data.
*
* @package tool_dataprivacy
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_dataprivacy\form;
defined('MOODLE_INTERNAL') || die();
use core\form\persistent;
use tool_dataprivacy\api;
use tool_dataprivacy\data_registry;
/**
* Context level data form.
*
* @package tool_dataprivacy
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class contextlevel extends context_instance {
/**
* @var The persistent class.
*/
protected static $persistentclass = 'tool_dataprivacy\\contextlevel';
/**
* Define the form - called by parent constructor
*/
public function definition() {
$this->_form->setDisableShortforms();
$this->_form->addElement('header', 'contextlevelname', $this->_customdata['contextlevelname']);
$this->add_purpose_category();
$this->_form->addElement('hidden', 'contextlevel');
$this->_form->setType('contextlevel', PARAM_INT);
parent::add_action_buttons(false, get_string('savechanges'));
}
/**
* Returns the customdata array for the provided context level.
*
* @param int $contextlevel
* @return array
*/
public static function get_contextlevel_customdata($contextlevel) {
$persistent = \tool_dataprivacy\contextlevel::get_record_by_contextlevel($contextlevel, false);
if (!$persistent) {
$persistent = new \tool_dataprivacy\contextlevel();
$persistent->set('contextlevel', $contextlevel);
}
$includeinherit = true;
if ($contextlevel == CONTEXT_SYSTEM) {
// Nothing to inherit from Site level.
$includeinherit = false;
}
$includenotset = true;
if ($contextlevel == CONTEXT_SYSTEM || $contextlevel == CONTEXT_USER) {
// No 'not set' value for system and user because we do not have defaults for them.
$includenotset = false;
}
$purposeoptions = \tool_dataprivacy\output\data_registry_page::purpose_options(
api::get_purposes(), $includenotset, $includeinherit);
$categoryoptions = \tool_dataprivacy\output\data_registry_page::category_options(
api::get_categories(), $includenotset, $includeinherit);
$customdata = [
'contextlevel' => $contextlevel,
'contextlevelname' => get_string('contextlevelname' . $contextlevel, 'tool_dataprivacy'),
'persistent' => $persistent,
'purposes' => $purposeoptions,
'categories' => $categoryoptions,
];
$effectivepurpose = api::get_effective_contextlevel_purpose($contextlevel);
if ($effectivepurpose) {
$customdata['currentretentionperiod'] = self::get_retention_display_text($effectivepurpose, $contextlevel,
\context_system::instance());
$customdata['purposeretentionperiods'] = [];
foreach ($purposeoptions as $optionvalue => $unused) {
// Get the effective purpose if $optionvalue would be the selected value.
list($purposeid, $unused) = data_registry::get_effective_default_contextlevel_purpose_and_category($contextlevel,
$optionvalue);
$purpose = new \tool_dataprivacy\purpose($purposeid);
$retentionperiod = self::get_retention_display_text(
$purpose,
$contextlevel,
\context_system::instance()
);
$customdata['purposeretentionperiods'][$optionvalue] = $retentionperiod;
}
}
return $customdata;
}
}
@@ -0,0 +1,574 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file contains the form add/update a data purpose.
*
* @package tool_dataprivacy
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_dataprivacy\form;
defined('MOODLE_INTERNAL') || die();
use core\form\persistent;
/**
* Data purpose form.
*
* @package tool_dataprivacy
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class purpose extends persistent {
/**
* @var string The persistent class.
*/
protected static $persistentclass = 'tool_dataprivacy\\purpose';
/**
* @var array The list of current overrides.
*/
protected $existingoverrides = [];
/**
* Define the form - called by parent constructor
*/
public function definition() {
$mform = $this->_form;
$mform->addElement('text', 'name', get_string('name'), 'maxlength="100"');
$mform->setType('name', PARAM_TEXT);
$mform->addRule('name', get_string('required'), 'required', null, 'server');
$mform->addRule('name', get_string('maximumchars', '', 100), 'maxlength', 100, 'server');
$mform->addElement('editor', 'description', get_string('description'), null, ['autosave' => false]);
$mform->setType('description', PARAM_CLEANHTML);
// Field for selecting lawful bases (from GDPR Article 6.1).
$this->add_field($this->get_lawful_base_field());
$mform->addRule('lawfulbases', get_string('required'), 'required', null, 'server');
// Optional field for selecting reasons for collecting sensitive personal data (from GDPR Article 9.2).
$this->add_field($this->get_sensitive_base_field());
$this->add_field($this->get_retention_period_fields());
$this->add_field($this->get_protected_field());
$this->add_override_fields();
if (!empty($this->_customdata['showbuttons'])) {
if (!$this->get_persistent()->get('id')) {
$savetext = get_string('add');
} else {
$savetext = get_string('savechanges');
}
$this->add_action_buttons(true, $savetext);
}
}
/**
* Add a fieldset to the current form.
*
* @param \stdClass $data
*/
protected function add_field(\stdClass $data) {
foreach ($data->fields as $field) {
$this->_form->addElement($field);
}
if (!empty($data->helps)) {
foreach ($data->helps as $fieldname => $helpdata) {
$help = array_merge([$fieldname], $helpdata);
call_user_func_array([$this->_form, 'addHelpButton'], $help);
}
}
if (!empty($data->types)) {
foreach ($data->types as $fieldname => $type) {
$this->_form->setType($fieldname, $type);
}
}
if (!empty($data->rules)) {
foreach ($data->rules as $fieldname => $ruledata) {
$rule = array_merge([$fieldname], $ruledata);
call_user_func_array([$this->_form, 'addRule'], $rule);
}
}
if (!empty($data->defaults)) {
foreach ($data->defaults as $fieldname => $default) {
$this->_form($fieldname, $default);
}
}
}
/**
* Handle addition of relevant repeated element fields for role overrides.
*/
protected function add_override_fields() {
$purpose = $this->get_persistent();
if (empty($purpose->get('id'))) {
// It is not possible to use repeated elements in a modal form yet.
return;
}
$fields = [
$this->get_role_override_id('roleoverride_'),
$this->get_role_field('roleoverride_'),
$this->get_retention_period_fields('roleoverride_'),
$this->get_protected_field('roleoverride_'),
$this->get_lawful_base_field('roleoverride_'),
$this->get_sensitive_base_field('roleoverride_'),
];
$options = [
'type' => [],
'helpbutton' => [],
];
// Start by adding the title.
$overrideelements = [
$this->_form->createElement('header', 'roleoverride', get_string('roleoverride', 'tool_dataprivacy')),
$this->_form->createElement(
'static',
'roleoverrideoverview',
'',
get_string('roleoverrideoverview', 'tool_dataprivacy')
),
];
foreach ($fields as $fielddata) {
foreach ($fielddata->fields as $field) {
$overrideelements[] = $field;
}
if (!empty($fielddata->helps)) {
foreach ($fielddata->helps as $name => $help) {
if (!isset($options[$name])) {
$options[$name] = [];
}
$options[$name]['helpbutton'] = $help;
}
}
if (!empty($fielddata->types)) {
foreach ($fielddata->types as $name => $type) {
if (!isset($options[$name])) {
$options[$name] = [];
}
$options[$name]['type'] = $type;
}
}
if (!empty($fielddata->rules)) {
foreach ($fielddata->rules as $name => $rule) {
if (!isset($options[$name])) {
$options[$name] = [];
}
$options[$name]['rule'] = $rule;
}
}
if (!empty($fielddata->defaults)) {
foreach ($fielddata->defaults as $name => $default) {
if (!isset($options[$name])) {
$options[$name] = [];
}
$options[$name]['default'] = $default;
}
}
if (!empty($fielddata->advanceds)) {
foreach ($fielddata->advanceds as $name => $advanced) {
if (!isset($options[$name])) {
$options[$name] = [];
}
$options[$name]['advanced'] = $advanced;
}
}
}
$this->existingoverrides = $purpose->get_purpose_overrides();
$existingoverridecount = count($this->existingoverrides);
$this->repeat_elements(
$overrideelements,
$existingoverridecount,
$options,
'overrides',
'addoverride',
1,
get_string('addroleoverride', 'tool_dataprivacy')
);
}
/**
* Converts fields.
*
* @param \stdClass $data
* @return \stdClass
*/
public function filter_data_for_persistent($data) {
$data = parent::filter_data_for_persistent($data);
$classname = static::$persistentclass;
$properties = $classname::properties_definition();
$data = (object) array_filter((array) $data, function($value, $key) use ($properties) {
return isset($properties[$key]);
}, ARRAY_FILTER_USE_BOTH);
return $data;
}
/**
* Get the field for the role name.
*
* @param string $prefix The prefix to apply to the field
* @return \stdClass
*/
protected function get_role_override_id(string $prefix = '') : \stdClass {
$fieldname = "{$prefix}id";
$fielddata = (object) [
'fields' => [],
];
$fielddata->fields[] = $this->_form->createElement('hidden', $fieldname);
$fielddata->types[$fieldname] = PARAM_INT;
return $fielddata;
}
/**
* Get the field for the role name.
*
* @param string $prefix The prefix to apply to the field
* @return \stdClass
*/
protected function get_role_field(string $prefix = '') : \stdClass {
$fieldname = "{$prefix}roleid";
$fielddata = (object) [
'fields' => [],
'helps' => [],
];
$roles = [
'' => get_string('none'),
];
foreach (role_get_names() as $roleid => $role) {
$roles[$roleid] = $role->localname;
}
$fielddata->fields[] = $this->_form->createElement('select', $fieldname, get_string('role'),
$roles,
[
'multiple' => false,
]
);
$fielddata->helps[$fieldname] = ['role', 'tool_dataprivacy'];
$fielddata->defaults[$fieldname] = null;
return $fielddata;
}
/**
* Get the mform field for lawful bases.
*
* @param string $prefix The prefix to apply to the field
* @return \stdClass
*/
protected function get_lawful_base_field(string $prefix = '') : \stdClass {
$fieldname = "{$prefix}lawfulbases";
$data = (object) [
'fields' => [],
];
$bases = [];
foreach (\tool_dataprivacy\purpose::GDPR_ART_6_1_ITEMS as $article) {
$key = 'gdpr_art_6_1_' . $article;
$bases[$key] = get_string("{$key}_name", 'tool_dataprivacy');
}
$data->fields[] = $this->_form->createElement('autocomplete', $fieldname, get_string('lawfulbases', 'tool_dataprivacy'),
$bases,
[
'multiple' => true,
]
);
$data->helps = [
$fieldname => ['lawfulbases', 'tool_dataprivacy'],
];
$data->advanceds = [
$fieldname => true,
];
return $data;
}
/**
* Get the mform field for sensitive bases.
*
* @param string $prefix The prefix to apply to the field
* @return \stdClass
*/
protected function get_sensitive_base_field(string $prefix = '') : \stdClass {
$fieldname = "{$prefix}sensitivedatareasons";
$data = (object) [
'fields' => [],
];
$bases = [];
foreach (\tool_dataprivacy\purpose::GDPR_ART_9_2_ITEMS as $article) {
$key = 'gdpr_art_9_2_' . $article;
$bases[$key] = get_string("{$key}_name", 'tool_dataprivacy');
}
$data->fields[] = $this->_form->createElement(
'autocomplete',
$fieldname,
get_string('sensitivedatareasons', 'tool_dataprivacy'),
$bases,
[
'multiple' => true,
]
);
$data->helps = [
$fieldname => ['sensitivedatareasons', 'tool_dataprivacy'],
];
$data->advanceds = [
$fieldname => true,
];
return $data;
}
/**
* Get the retention period fields.
*
* @param string $prefix The name of the main field, and prefix for the subfields.
* @return \stdClass
*/
protected function get_retention_period_fields(string $prefix = '') : \stdClass {
$prefix = "{$prefix}retentionperiod";
$data = (object) [
'fields' => [],
'types' => [],
];
$number = $this->_form->createElement('text', "{$prefix}number", null, ['size' => 8]);
$data->types["{$prefix}number"] = PARAM_INT;
$unitoptions = [
'Y' => get_string('years'),
'M' => strtolower(get_string('months')),
'D' => strtolower(get_string('days'))
];
$unit = $this->_form->createElement('select', "{$prefix}unit", '', $unitoptions);
$data->fields[] = $this->_form->createElement(
'group',
$prefix,
get_string('retentionperiod', 'tool_dataprivacy'),
[
'number' => $number,
'unit' => $unit,
],
null,
false
);
return $data;
}
/**
* Get the mform field for the protected flag.
*
* @param string $prefix The prefix to apply to the field
* @return \stdClass
*/
protected function get_protected_field(string $prefix = '') : \stdClass {
$fieldname = "{$prefix}protected";
return (object) [
'fields' => [
$this->_form->createElement(
'advcheckbox',
$fieldname,
get_string('protected', 'tool_dataprivacy'),
get_string('protectedlabel', 'tool_dataprivacy')
),
],
];
}
/**
* Converts data to data suitable for storage.
*
* @param \stdClass $data
* @return \stdClass
*/
protected static function convert_fields(\stdClass $data) {
$data = parent::convert_fields($data);
if (!empty($data->lawfulbases) && is_array($data->lawfulbases)) {
$data->lawfulbases = implode(',', $data->lawfulbases);
}
if (!empty($data->sensitivedatareasons) && is_array($data->sensitivedatareasons)) {
$data->sensitivedatareasons = implode(',', $data->sensitivedatareasons);
}
// A single value.
$data->retentionperiod = 'P' . $data->retentionperiodnumber . $data->retentionperiodunit;
unset($data->retentionperiodnumber);
unset($data->retentionperiodunit);
return $data;
}
/**
* Get the default data.
*
* @return \stdClass
*/
protected function get_default_data() {
$data = parent::get_default_data();
return $this->convert_existing_data_to_values($data);
}
/**
* Normalise any values stored in existing data.
*
* @param \stdClass $data
* @return \stdClass
*/
protected function convert_existing_data_to_values(\stdClass $data) : \stdClass {
$data->lawfulbases = explode(',', $data->lawfulbases);
if (!empty($data->sensitivedatareasons)) {
$data->sensitivedatareasons = explode(',', $data->sensitivedatareasons);
}
// Convert the single properties into number and unit.
$strlen = strlen($data->retentionperiod);
$data->retentionperiodnumber = substr($data->retentionperiod, 1, $strlen - 2);
$data->retentionperiodunit = substr($data->retentionperiod, $strlen - 1);
unset($data->retentionperiod);
return $data;
}
/**
* Fetch the role override data from the list of submitted data.
*
* @param \stdClass $data The complete set of processed data
* @return \stdClass[] The list of overrides
*/
public function get_role_overrides_from_data(\stdClass $data) {
$overrides = [];
if (!empty($data->overrides)) {
$searchkey = 'roleoverride_';
for ($i = 0; $i < $data->overrides; $i++) {
$overridedata = (object) [];
foreach ((array) $data as $fieldname => $value) {
if (strpos($fieldname, $searchkey) !== 0) {
continue;
}
$overridefieldname = substr($fieldname, strlen($searchkey));
$overridedata->$overridefieldname = $value[$i];
}
if (empty($overridedata->roleid) || empty($overridedata->retentionperiodnumber)) {
// Skip this one.
// There is no value and it will be delete.
continue;
}
$override = static::convert_fields($overridedata);
$overrides[$i] = $override;
}
}
return $overrides;
}
/**
* Define extra validation mechanims.
*
* @param stdClass $data Data to validate.
* @param array $files Array of files.
* @param array $errors Currently reported errors.
* @return array of additional errors, or overridden errors.
*/
protected function extra_validation($data, $files, array &$errors) {
$overrides = $this->get_role_overrides_from_data($data);
// Check role overrides to ensure that:
// - roles are unique; and
// - specifeid retention periods are numeric.
$seenroleids = [];
foreach ($overrides as $id => $override) {
$override->purposeid = 0;
$persistent = new \tool_dataprivacy\purpose_override($override->id, $override);
if (isset($seenroleids[$persistent->get('roleid')])) {
$errors["roleoverride_roleid[{$id}]"] = get_string('duplicaterole');
}
$seenroleids[$persistent->get('roleid')] = true;
$errors = array_merge($errors, $persistent->get_errors());
}
return $errors;
}
/**
* Load in existing data as form defaults. Usually new entry defaults are stored directly in
* form definition (new entry form); this function is used to load in data where values
* already exist and data is being edited (edit entry form).
*
* @param stdClass $data
*/
public function set_data($data) {
$purpose = $this->get_persistent();
$count = 0;
foreach ($this->existingoverrides as $override) {
$overridedata = $this->convert_existing_data_to_values($override->to_record());
foreach ($overridedata as $key => $value) {
$keyname = "roleoverride_{$key}[{$count}]";
$data->$keyname = $value;
}
$count++;
}
parent::set_data($data);
}
}
@@ -0,0 +1,105 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Filter selector field.
*
* @package tool_dataprivacy
* @copyright 2018 Jun Pataleta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_dataprivacy\form;
defined('MOODLE_INTERNAL') || die();
use MoodleQuickForm_autocomplete;
global $CFG;
require_once($CFG->libdir . '/form/autocomplete.php');
/**
* Form field type for choosing a user on the data request creation form.
*
* @package tool_dataprivacy
* @copyright 2018 Jun Pataleta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class request_user_autocomplete extends MoodleQuickForm_autocomplete {
/**
* Constructor.
*
* @param string $elementname Element name
* @param mixed $elementlabel Label(s) for an element
* @param array $options Options to control the element's display
* Valid options are:
* - multiple bool Whether or not the field accepts more than one values.
*/
public function __construct($elementname = null, $elementlabel = null, $options = array()) {
$validattributes = array(
'ajax' => 'tool_dataprivacy/form-user-selector',
);
if (!empty($options['multiple'])) {
$validattributes['multiple'] = 'multiple';
}
parent::__construct($elementname, $elementlabel, array(), $validattributes);
}
/**
* Set the value of this element.
*
* @param string|array $value The value to set.
* @return boolean
*/
public function setValue($value) {
global $DB;
$values = (array) $value;
$ids = [];
foreach ($values as $onevalue) {
if (!empty($onevalue) && (!$this->optionExists($onevalue)) &&
($onevalue !== '_qf__force_multiselect_submission')) {
array_push($ids, $onevalue);
}
}
if (empty($ids)) {
return $this->setSelected([]);
}
$toselect = [];
list($insql, $inparams) = $DB->get_in_or_equal($ids, SQL_PARAMS_NAMED);
$allusernames = get_all_user_name_fields(true);
// Exclude admins and guest user.
$excludedusers = array_keys(get_admins()) + [guest_user()->id];
$sort = 'firstname ASC';
$fields = 'id, email, ' . $allusernames;
// Fetch the selected users, exclude the admins and guest users.
$users = get_users(true, '', true, $excludedusers, $sort, '', '', 0, 30, $fields, "id $insql", $inparams);
foreach ($users as $user) {
$userdata = (object)[
'name' => fullname($user),
'email' => $user->email
];
$this->addOption(get_string('nameemail', 'tool_dataprivacy', $userdata), $user->id);
array_push($toselect, $user->id);
}
return $this->setSelected($toselect);
}
}
@@ -0,0 +1,251 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Collection of helper functions for the data privacy tool.
*
* @package tool_dataprivacy
* @copyright 2018 Jun Pataleta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_dataprivacy\local;
defined('MOODLE_INTERNAL') || die();
use coding_exception;
use moodle_exception;
use tool_dataprivacy\api;
use tool_dataprivacy\data_request;
/**
* Class containing helper functions for the data privacy tool.
*
* @copyright 2018 Jun Pataleta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class helper {
/** The default number of results to be shown per page. */
const DEFAULT_PAGE_SIZE = 20;
/** Filter constant associated with the request type filter. */
const FILTER_TYPE = 1;
/** Filter constant associated with the request status filter. */
const FILTER_STATUS = 2;
/** Filter constant associated with the request creation filter. */
const FILTER_CREATION = 3;
/** The request filters preference key. */
const PREF_REQUEST_FILTERS = 'tool_dataprivacy_request-filters';
/** The number of data request records per page preference key. */
const PREF_REQUEST_PERPAGE = 'tool_dataprivacy_request-perpage';
/**
* Retrieves the human-readable text value of a data request type.
*
* @param int $requesttype The request type.
* @return string
* @throws coding_exception
* @throws moodle_exception
*/
public static function get_request_type_string($requesttype) {
$types = self::get_request_types();
if (!isset($types[$requesttype])) {
throw new moodle_exception('errorinvalidrequesttype', 'tool_dataprivacy');
}
return $types[$requesttype];
}
/**
* Retrieves the human-readable shortened text value of a data request type.
*
* @param int $requesttype The request type.
* @return string
* @throws coding_exception
* @throws moodle_exception
*/
public static function get_shortened_request_type_string($requesttype) {
$types = self::get_request_types_short();
if (!isset($types[$requesttype])) {
throw new moodle_exception('errorinvalidrequesttype', 'tool_dataprivacy');
}
return $types[$requesttype];
}
/**
* Returns the key value-pairs of request type code and their string value.
*
* @return array
*/
public static function get_request_types() {
return [
api::DATAREQUEST_TYPE_EXPORT => get_string('requesttypeexport', 'tool_dataprivacy'),
api::DATAREQUEST_TYPE_DELETE => get_string('requesttypedelete', 'tool_dataprivacy'),
api::DATAREQUEST_TYPE_OTHERS => get_string('requesttypeothers', 'tool_dataprivacy'),
];
}
/**
* Returns the key value-pairs of request type code and their shortened string value.
*
* @return array
*/
public static function get_request_types_short() {
return [
api::DATAREQUEST_TYPE_EXPORT => get_string('requesttypeexportshort', 'tool_dataprivacy'),
api::DATAREQUEST_TYPE_DELETE => get_string('requesttypedeleteshort', 'tool_dataprivacy'),
api::DATAREQUEST_TYPE_OTHERS => get_string('requesttypeothersshort', 'tool_dataprivacy'),
];
}
/**
* Retrieves the human-readable value of a data request status.
*
* @param int $status The request status.
* @return string
* @throws moodle_exception
*/
public static function get_request_status_string($status) {
$statuses = self::get_request_statuses();
if (!isset($statuses[$status])) {
throw new moodle_exception('errorinvalidrequeststatus', 'tool_dataprivacy');
}
return $statuses[$status];
}
/**
* Returns the key value-pairs of request status code and string value.
*
* @return array
*/
public static function get_request_statuses() {
return [
api::DATAREQUEST_STATUS_PENDING => get_string('statuspending', 'tool_dataprivacy'),
api::DATAREQUEST_STATUS_PREPROCESSING => get_string('statuspreprocessing', 'tool_dataprivacy'),
api::DATAREQUEST_STATUS_AWAITING_APPROVAL => get_string('statusawaitingapproval', 'tool_dataprivacy'),
api::DATAREQUEST_STATUS_APPROVED => get_string('statusapproved', 'tool_dataprivacy'),
api::DATAREQUEST_STATUS_PROCESSING => get_string('statusprocessing', 'tool_dataprivacy'),
api::DATAREQUEST_STATUS_COMPLETE => get_string('statuscomplete', 'tool_dataprivacy'),
api::DATAREQUEST_STATUS_DOWNLOAD_READY => get_string('statusready', 'tool_dataprivacy'),
api::DATAREQUEST_STATUS_EXPIRED => get_string('statusexpired', 'tool_dataprivacy'),
api::DATAREQUEST_STATUS_CANCELLED => get_string('statuscancelled', 'tool_dataprivacy'),
api::DATAREQUEST_STATUS_REJECTED => get_string('statusrejected', 'tool_dataprivacy'),
api::DATAREQUEST_STATUS_DELETED => get_string('statusdeleted', 'tool_dataprivacy'),
];
}
/**
* Retrieves the human-readable value of a data request creation method.
*
* @param int $creation The request creation method.
* @return string
* @throws moodle_exception
*/
public static function get_request_creation_method_string($creation) {
$creationmethods = self::get_request_creation_methods();
if (!isset($creationmethods[$creation])) {
throw new moodle_exception('errorinvalidrequestcreationmethod', 'tool_dataprivacy');
}
return $creationmethods[$creation];
}
/**
* Returns the key value-pairs of request creation method code and string value.
*
* @return array
*/
public static function get_request_creation_methods() {
return [
data_request::DATAREQUEST_CREATION_MANUAL => get_string('creationmanual', 'tool_dataprivacy'),
data_request::DATAREQUEST_CREATION_AUTO => get_string('creationauto', 'tool_dataprivacy'),
];
}
/**
* Get the users that a user can make data request for.
*
* E.g. User having a parent role and has the 'tool/dataprivacy:makedatarequestsforchildren' capability.
* @param int $userid The user's ID.
* @return array
*/
public static function get_children_of_user($userid) {
global $DB;
// Get users that the user has role assignments to.
$allusernames = get_all_user_name_fields(true, 'u');
$sql = "SELECT u.id, $allusernames
FROM {role_assignments} ra, {context} c, {user} u
WHERE ra.userid = :userid
AND ra.contextid = c.id
AND c.instanceid = u.id
AND c.contextlevel = :contextlevel";
$params = [
'userid' => $userid,
'contextlevel' => CONTEXT_USER
];
// The final list of users that we will return.
$finalresults = [];
// Our prospective list of users.
if ($candidates = $DB->get_records_sql($sql, $params)) {
foreach ($candidates as $key => $child) {
$childcontext = \context_user::instance($child->id);
if (has_capability('tool/dataprivacy:makedatarequestsforchildren', $childcontext, $userid)) {
$finalresults[$key] = $child;
}
}
}
return $finalresults;
}
/**
* Get options for the data requests filter.
*
* @return array
* @throws coding_exception
*/
public static function get_request_filter_options() {
$filters = [
self::FILTER_TYPE => (object)[
'name' => get_string('requesttype', 'tool_dataprivacy'),
'options' => self::get_request_types_short()
],
self::FILTER_STATUS => (object)[
'name' => get_string('requeststatus', 'tool_dataprivacy'),
'options' => self::get_request_statuses()
],
self::FILTER_CREATION => (object)[
'name' => get_string('requestcreation', 'tool_dataprivacy'),
'options' => self::get_request_creation_methods()
],
];
$options = [];
foreach ($filters as $category => $filtercategory) {
foreach ($filtercategory->options as $key => $name) {
$option = (object)[
'category' => $filtercategory->name,
'name' => $name
];
$options["{$category}:{$key}"] = get_string('filteroption', 'tool_dataprivacy', $option);
}
}
return $options;
}
}
@@ -0,0 +1,76 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Class \tool_dataprivacy\manager_observer.
*
* @package tool_dataprivacy
* @copyright 2018 Marina Glancy
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_dataprivacy;
defined('MOODLE_INTERNAL') || die();
/**
* A failure observer for the \core_privacy\manager.
*
* @package tool_dataprivacy
* @copyright 2018 Marina Glancy
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class manager_observer implements \core_privacy\manager_observer {
/**
* Notifies all DPOs that an exception occurred.
*
* @param \Throwable $e
* @param string $component
* @param string $interface
* @param string $methodname
* @param array $params
*/
public function handle_component_failure($e, $component, $interface, $methodname, array $params) {
// Get the list of the site Data Protection Officers.
$dpos = api::get_site_dpos();
$messagesubject = get_string('exceptionnotificationsubject', 'tool_dataprivacy');
$a = (object)[
'fullmethodname' => \core_privacy\manager::get_provider_classname_for_component($component) . '::' . $methodname,
'component' => $component,
'message' => $e->getMessage(),
'backtrace' => $e->getTraceAsString()
];
$messagebody = get_string('exceptionnotificationbody', 'tool_dataprivacy', $a);
// Email the data request to the Data Protection Officer(s)/Admin(s).
foreach ($dpos as $dpo) {
$message = new \core\message\message();
$message->courseid = SITEID;
$message->component = 'tool_dataprivacy';
$message->name = 'notifyexceptions';
$message->userfrom = \core_user::get_noreply_user();
$message->subject = $messagesubject;
$message->fullmessageformat = FORMAT_HTML;
$message->notification = 1;
$message->userto = $dpo;
$message->fullmessagehtml = $messagebody;
$message->fullmessage = html_to_text($messagebody);
// Send message.
message_send($message);
}
}
}
@@ -0,0 +1,181 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Class containing helper methods for processing data requests.
*
* @package tool_dataprivacy
* @copyright 2018 Adrian Greeve
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_dataprivacy;
defined('MOODLE_INTERNAL') || die();
/**
* Class containing helper methods for processing data requests.
*
* @copyright 2018 Adrian Greeve
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class metadata_registry {
/**
* Returns plugin types / plugins and the user data that it stores in a format that can be sent to a template.
*
* @return array An array with all of the plugin types / plugins and the user data they store.
*/
public function get_registry_metadata() {
$manager = new \core_privacy\manager();
$manager->set_observer(new \tool_dataprivacy\manager_observer());
$pluginman = \core_plugin_manager::instance();
$contributedplugins = $this->get_contrib_list();
$metadata = $manager->get_metadata_for_components();
$fullyrichtree = $this->get_full_component_list();
foreach ($fullyrichtree as $branch => $leaves) {
$plugintype = $leaves['plugin_type'];
$plugins = array_map(function($component) use ($manager, $metadata, $contributedplugins, $plugintype, $pluginman) {
// Use the plugin name for the plugins, ignore for core subsystems.
$internaldata = ($plugintype == 'core') ? ['component' => $component] :
['component' => $pluginman->plugin_name($component)];
$internaldata['raw_component'] = $component;
if ($manager->component_is_compliant($component)) {
$internaldata['compliant'] = true;
if (isset($metadata[$component])) {
$collection = $metadata[$component]->get_collection();
$internaldata = $this->format_metadata($collection, $component, $internaldata);
} else if ($manager->is_empty_subsystem($component)) {
// This is an unused subsystem.
// Use the generic string.
$internaldata['nullprovider'] = get_string('privacy:subsystem:empty', 'core_privacy');
} else {
// Call get_reason for null provider.
$internaldata['nullprovider'] = get_string($manager->get_null_provider_reason($component), $component);
}
} else {
$internaldata['compliant'] = false;
}
// Check to see if we are an external plugin.
// Plugin names can contain _ characters, limit to 2 to just remove initial plugintype.
$componentshortname = explode('_', $component, 2);
$shortname = array_pop($componentshortname);
if (isset($contributedplugins[$plugintype][$shortname])) {
$internaldata['external'] = true;
}
// Additional interface checks.
if (!$manager->is_empty_subsystem($component)) {
$classname = $manager->get_provider_classname_for_component($component);
if (class_exists($classname)) {
$componentclass = new $classname();
// Check if the interface is deprecated.
if ($componentclass instanceof \core_privacy\local\deprecated) {
$internaldata['deprecated'] = true;
}
// Check that the core_userlist_provider is implemented for all user data providers.
if ($componentclass instanceof \core_privacy\local\request\core_user_data_provider
&& !$componentclass instanceof \core_privacy\local\request\core_userlist_provider) {
$internaldata['userlistnoncompliance'] = true;
}
// Check that any type of userlist_provider is implemented for all shared data providers.
if ($componentclass instanceof \core_privacy\local\request\shared_data_provider
&& !$componentclass instanceof \core_privacy\local\request\userlist_provider) {
$internaldata['userlistnoncompliance'] = true;
}
}
}
return $internaldata;
}, $leaves['plugins']);
$fullyrichtree[$branch]['plugin_type_raw'] = $plugintype;
// We're done using the plugin type. Convert it to a readable string.
$fullyrichtree[$branch]['plugin_type'] = $pluginman->plugintype_name($plugintype);
$fullyrichtree[$branch]['plugins'] = $plugins;
}
return $fullyrichtree;
}
/**
* Formats the metadata for use with a template.
*
* @param array $collection The collection associated with the component that we want to expand and format.
* @param string $component The component that we are dealing in
* @param array $internaldata The array to add the formatted metadata to.
* @return array The internal data array with the formatted metadata.
*/
protected function format_metadata($collection, $component, $internaldata) {
foreach ($collection as $collectioninfo) {
$privacyfields = $collectioninfo->get_privacy_fields();
$fields = '';
if (!empty($privacyfields)) {
$fields = array_map(function($key, $field) use ($component) {
return [
'field_name' => $key,
'field_summary' => get_string($field, $component)
];
}, array_keys($privacyfields), $privacyfields);
}
// Can the metadata types be located somewhere else besides core?
$items = explode('\\', get_class($collectioninfo));
$type = array_pop($items);
$typedata = [
'name' => $collectioninfo->get_name(),
'type' => $type,
'fields' => $fields,
'summary' => get_string($collectioninfo->get_summary(), $component)
];
if (strpos($type, 'subsystem_link') === 0 || strpos($type, 'plugintype_link') === 0) {
$typedata['link'] = true;
}
$internaldata['metadata'][] = $typedata;
}
return $internaldata;
}
/**
* Return the full list of components.
*
* @return array An array of plugin types which contain plugin data.
*/
protected function get_full_component_list() {
global $CFG;
$list = \core_component::get_component_list();
$list['core']['core'] = "{$CFG->dirroot}/lib";
$formattedlist = [];
foreach ($list as $plugintype => $plugin) {
$formattedlist[] = ['plugin_type' => $plugintype, 'plugins' => array_keys($plugin)];
}
return $formattedlist;
}
/**
* Returns a list of contributed plugins installed on the system.
*
* @return array A list of contributed plugins installed.
*/
protected function get_contrib_list() {
return array_map(function($plugins) {
return array_filter($plugins, function($plugindata) {
return !$plugindata->is_standard();
});
}, \core_plugin_manager::instance()->get_plugins());
}
}
@@ -0,0 +1,88 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Categories renderable.
*
* @package tool_dataprivacy
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_dataprivacy\output;
defined('MOODLE_INTERNAL') || die();
use renderable;
use renderer_base;
use stdClass;
use templatable;
use tool_dataprivacy\external\category_exporter;
/**
* Class containing the categories page renderable.
*
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class categories extends crud_element implements renderable, templatable {
/** @var array $categories All system categories. */
protected $categories = [];
/**
* Construct this renderable.
*
* @param \tool_dataprivacy\category[] $categories
*/
public function __construct($categories) {
$this->categories = $categories;
}
/**
* Export this data so it can be used as the context for a mustache template.
*
* @param renderer_base $output
* @return stdClass
*/
public function export_for_template(renderer_base $output) {
global $PAGE;
$context = \context_system::instance();
$PAGE->requires->js_call_amd('tool_dataprivacy/categoriesactions', 'init');
$PAGE->requires->js_call_amd('tool_dataprivacy/add_category', 'getInstance', [$context->id]);
$data = new stdClass();
// Navigation links.
$data->navigation = [];
$navigationlinks = $this->get_navigation();
foreach ($navigationlinks as $navlink) {
$data->navigation[] = $navlink->export_for_template($output);
}
$data->categories = [];
foreach ($this->categories as $category) {
$exporter = new category_exporter($category, ['context' => \context_system::instance()]);
$exportedcategory = $exporter->export($output);
$actionmenu = $this->action_menu('category', $exportedcategory, $category);
$exportedcategory->actions = $actionmenu->export_for_template($output);
$data->categories[] = $exportedcategory;
}
return $data;
}
}
@@ -0,0 +1,92 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Abstract renderer for independent renderable elements.
*
* @package tool_dataprivacy
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_dataprivacy\output;
defined('MOODLE_INTERNAL') || die();
use renderable;
use renderer_base;
use stdClass;
use templatable;
use tool_dataprivacy\external\purpose_exporter;
use tool_dataprivacy\external\category_exporter;
/**
* Abstract renderer for independent renderable elements.
*
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
abstract class crud_element {
/**
* Returns the top navigation buttons.
*
* @return \action_link[]
*/
protected final function get_navigation() {
$back = new \action_link(
new \moodle_url('/admin/tool/dataprivacy/dataregistry.php'),
get_string('back'),
null,
['class' => 'btn btn-default']
);
return [$back];
}
/**
* Adds an action menu for the provided element
*
* @param string $elementname 'purpose' or 'category'.
* @param \stdClass $exported
* @param \core\persistent $persistent
* @return \action_menu
*/
protected final function action_menu($elementname, $exported, $persistent) {
// Just in case, we are doing funny stuff below.
$elementname = clean_param($elementname, PARAM_ALPHA);
// Actions.
$actionmenu = new \action_menu();
$actionmenu->set_menu_trigger(get_string('actions'));
$actionmenu->set_owner_selector($elementname . '-' . $exported->id . '-actions');
$actionmenu->set_alignment(\action_menu::TL, \action_menu::BL);
$url = new \moodle_url('/admin/tool/dataprivacy/edit' . $elementname . '.php',
['id' => $exported->id]);
$link = new \action_menu_link_secondary($url, new \pix_icon('t/edit',
get_string('edit')), get_string('edit'));
$actionmenu->add($link);
if (!$persistent->is_used()) {
$url = new \moodle_url('#');
$attrs = ['data-id' => $exported->id, 'data-action' => 'delete' . $elementname, 'data-name' => $exported->name];
$link = new \action_menu_link_secondary($url, new \pix_icon('t/delete',
get_string('delete')), get_string('delete'), $attrs);
$actionmenu->add($link);
}
return $actionmenu;
}
}
@@ -0,0 +1,94 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Class containing data for a user's data requests.
*
* @package tool_dataprivacy
* @copyright 2018 Jun Pataleta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_dataprivacy\output;
defined('MOODLE_INTERNAL') || die();
use coding_exception;
use moodle_exception;
use moodle_url;
use renderable;
use renderer_base;
use single_select;
use stdClass;
use templatable;
use tool_dataprivacy\data_request;
use tool_dataprivacy\local\helper;
/**
* Class containing data for a user's data requests.
*
* @copyright 2018 Jun Pataleta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class data_deletion_page implements renderable, templatable {
/** @var data_request[] $requests List of data requests. */
protected $filter = null;
/** @var data_request[] $requests List of data requests. */
protected $expiredcontextstable = [];
/**
* Construct this renderable.
*
* @param \tool_dataprivacy\data_request[] $filter
* @param expired_contexts_table $expiredcontextstable
*/
public function __construct($filter, expired_contexts_table $expiredcontextstable) {
$this->filter = $filter;
$this->expiredcontextstable = $expiredcontextstable;
}
/**
* Export this data so it can be used as the context for a mustache template.
*
* @param renderer_base $output
* @return stdClass
* @throws coding_exception
* @throws moodle_exception
*/
public function export_for_template(renderer_base $output) {
$data = new stdClass();
$url = new moodle_url('/admin/tool/dataprivacy/datadeletion.php');
$options = [
CONTEXT_USER => get_string('user'),
CONTEXT_COURSE => get_string('course'),
CONTEXT_MODULE => get_string('activitiesandresources', 'tool_dataprivacy'),
CONTEXT_BLOCK => get_string('blocks'),
];
$filterselector = new single_select($url, 'filter', $options, $this->filter, null);
$data->filter = $filterselector->export_for_template($output);
ob_start();
$this->expiredcontextstable->out(helper::DEFAULT_PAGE_SIZE, true);
$expiredcontexts = ob_get_contents();
ob_end_clean();
$data->expiredcontexts = $expiredcontexts;
$data->existingcontexts = $this->expiredcontextstable->rawdata ? true : false;
return $data;
}
}

Some files were not shown because too many files have changed in this diff Show More