Compare commits

..

509 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7) cf687f4357 Moodle release 3.7.6 2020-05-09 20:05:35 +02:00
Eloy Lafuente (stronk7) e32ae38439 weekly release 3.7.5+ 2020-05-08 13:29:56 +02:00
Eloy Lafuente (stronk7) 4e09dc64b7 Merge branch 'install_37_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_37_STABLE 2020-05-08 13:29:53 +02:00
Jake Dallimore fcefa38092 Merge branch 'MDL-51694-37' of https://github.com/MartinGauk/moodle into MOODLE_37_STABLE 2020-05-08 11:23:23 +08:00
Eloy Lafuente (stronk7) 61f218ae47 Merge branch 'MDL-68443-xmldb-path-validation-MOODLE_37_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_37_STABLE 2020-05-07 19:17:11 +02:00
Paul Holden 6bafc320c0 MDL-68415 core: test attachments in email_to_user from allowed paths. 2020-05-07 18:41:18 +02:00
fujiwara a22a46a689 MDL-68415 email: Fix attachment in email_to_user() 2020-05-07 18:41:12 +02:00
Jake Dallimore 9e6f90f1cf Merge branch 'MDL-62403-37' of git://github.com/lameze/moodle into MOODLE_37_STABLE 2020-05-07 14:20:12 +08:00
Simey Lameze 62ed52fdc4 MDL-62403 portfolio: add upgrade notes for google docs 2020-05-07 13:05:44 +08:00
Ryan Wyllie ad45df4dc2 MDL-62403 portfolio: create directories for google drive export
I've modified the Google Drive portfolio export so that it creates a
root directory in Drive for all of the files in the export. This allows
each export to be contained from each other to help with clashing file
names.

Additionally, the paths for the exported files will now be created in
Drive so that exported files are in the correct directory structure.
This is important for forum posts exports which assume a certain
directory structure in the export.
2020-05-07 12:43:15 +08:00
Andrew Nicols c65e8a5900 Merge branch 'MDL-68556-37-pluginscheckcss' of git://github.com/mudrd8mz/moodle into MOODLE_37_STABLE 2020-05-07 09:17:03 +08:00
Paul Holden 796a7ea458 MDL-68410 mod_scorm: safer status operator comparison. 2020-05-07 09:03:24 +08:00
Ferran Recio 3c5d8d6602 MDL-68430 filter_mathjaxloader: update default CDN to 2.7.8 2020-05-06 11:13:42 +02:00
Jun Pataleta 2ad366c869 Merge branch 'MDL-68402_37' of https://github.com/timhunt/moodle into MOODLE_37_STABLE 2020-05-06 17:04:44 +08:00
Tim Hunt 55ba3eece2 MDL-68402 accesslib: fix coding style of loops 2020-05-06 09:58:54 +01:00
Tim Hunt fb990d26d4 MDL-68402 accesslib: Modernise coding style in the functions changed 2020-05-06 09:58:54 +01:00
Tim Hunt 96dbdc2ad9 MDL-68402 accesslib: fix get_with_capability_join logic
In fact, rather than fix the old logic, I noticed that the correct
logic was already implemented in get_users_by_capability. So, I
refactored to extract the working version into a function, which it
turns out can have exactly the same API as get_with_capability_join,
which was convenient.
2020-05-06 09:58:53 +01:00
Jake Dallimore d976ae38f5 Merge branch 'MDL-68293-37' of git://github.com/jleyva/moodle into MOODLE_37_STABLE 2020-05-06 12:54:08 +08:00
Jun Pataleta 675c0451f9 Merge branch 'MDL-68301-37' of git://github.com/bmbrands/moodle into MOODLE_37_STABLE 2020-05-06 10:33:01 +08:00
Andrew Nicols f5e8e0b08a Merge branch 'MDL-63609-37' of https://github.com/paulholden/moodle into MOODLE_37_STABLE 2020-05-06 08:52:19 +08:00
AMOS bot c9da87aa50 Automatically generated installer lang files 2020-05-06 00:13:21 +00:00
Eloy Lafuente (stronk7) c070acd2eb weekly release 3.7.5+ 2020-05-05 19:05:35 +02:00
Eloy Lafuente (stronk7) 647aa0625f Merge branch 'install_37_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_37_STABLE 2020-05-05 19:05:33 +02:00
Bas Brands a4e65c3276 MDL-68266 core_message: disable custom switches for behat testing 2020-05-05 14:23:53 +02:00
Jun Pataleta 225e176962 Merge branch 'MDL-68266-37' of git://github.com/andrewnicols/moodle into MOODLE_37_STABLE 2020-05-05 09:26:18 +08:00
Bas Brands 75b5301c9a MDL-68266 theme_boost: behat enable custom switches 2020-05-05 09:12:50 +08:00
AMOS bot 6d780ff6d5 Automatically generated installer lang files 2020-05-05 00:11:41 +00:00
Eloy Lafuente (stronk7) 5ed7751049 Merge branch 'MDL-52904-37' of git://github.com/junpataleta/moodle into MOODLE_37_STABLE 2020-05-04 22:32:25 +02:00
Martin Gauk 8d21ca65d4 MDL-51694 core_grades: use transactions when deleting 2020-05-04 12:47:39 +00:00
Jun Pataleta 20644f8c6a Merge branch 'MDL-68266-37' of git://github.com/bmbrands/moodle into MOODLE_37_STABLE 2020-05-04 17:24:43 +08:00
Bas Brands 22c36cd1b6 MDL-68266 core_course: accessibility improvements for course management
- added commit of Moodle 3.7 hardcoding the highlight border width
that was not calculated because of a scssphp bug
2020-05-04 10:57:57 +02:00
Sara Arjona 014fd48298 Merge branch 'MDL-68315-MOODLE_37_STABLE' of https://github.com/kabalin/moodle into MOODLE_37_STABLE 2020-05-04 10:37:36 +02:00
Andrew Nicols 6006347f62 Merge branch 'MDL-68266-37' of git://github.com/bmbrands/moodle into MOODLE_37_STABLE 2020-05-04 15:33:49 +08:00
Bas Brands fc1d54365e MDL-68266 core_course: accessibility improvements for course managent
colour contrast improvements
use custom checkboxes
use accessible colour for text-muted
2020-05-04 09:12:22 +02:00
David Saylor 41536c1586 MDL-52904 completion: reference context in cron query
Co-authored-by: Barbara Lawrence <blawrence@harlow-college.ac.uk>
2020-05-04 09:58:16 +08:00
Jun Pataleta 5b52f17db3 MDL-52904 completion: Unit tests for daily completion task 2020-05-04 09:58:16 +08:00
Andrew Nicols a44b5cbd84 Merge branch 'MDL-68509-37' of https://github.com/Dagefoerde/moodle into MOODLE_37_STABLE 2020-05-03 19:56:25 +08:00
Eloy Lafuente (stronk7) 3eca8fedf0 weekly release 3.7.5+ 2020-05-02 16:36:34 +02:00
Eloy Lafuente (stronk7) 6136ba0221 Merge branch 'install_37_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_37_STABLE 2020-05-02 16:36:32 +02:00
Andrew Nicols 9a6874fee7 Merge branch 'MDL-68492-m37' of https://github.com/sammarshallou/moodle into MOODLE_37_STABLE 2020-05-01 12:08:02 +08:00
Andrew Nicols d5483a9d21 Merge branch 'MOODLE_37_MDL-67540' of https://github.com/golenkovm/moodle into MOODLE_37_STABLE 2020-05-01 11:21:39 +08:00
Andrew Nicols e4079005ef Merge branch 'MDL-57680_37' of https://github.com/timhunt/moodle into MOODLE_37_STABLE 2020-05-01 11:07:39 +08:00
Eloy Lafuente (stronk7) 9c077351e5 Merge branch 'MDL-68427-37' of git://github.com/andrewnicols/moodle into MOODLE_37_STABLE 2020-04-30 23:35:42 +02:00
Jun Pataleta abe082493e Merge branch 'MDL-68404-37' of git://github.com/lucaboesch/moodle into MOODLE_37_STABLE 2020-04-30 13:32:43 +08:00
Jun Pataleta 5ea56fd371 Merge branch 'MDL-68309-37' of https://github.com/snake/moodle into MOODLE_37_STABLE 2020-04-30 09:56:30 +08:00
AMOS bot 2cd1ef8c97 Automatically generated installer lang files 2020-04-30 00:12:04 +00:00
Eloy Lafuente (stronk7) 35cf368176 Merge branch 'MDL-68434-37-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_37_STABLE 2020-04-29 22:53:01 +02:00
David Mudrák ed3a03b439 MDL-68434 lang: Use the updated terminology in the tests 2020-04-29 17:48:28 +02:00
David Mudrák 0b7412e092 MDL-68556 admin: Fix some minor styling issues on the plugins check page
The patch fixes missing space around elements and some other minor
visual issues detected. This was a good opportunity to get rid of custom
CSS rules and use the native bootstrap classes and utilities.
2020-04-29 14:53:15 +02:00
Helen Foster 3f19c3cfb4 MDL-68434 lang: Import fixed English strings (en_fix)
Significant string changes:

* pluginnamesummary,qtype_ddimageortext and
  pluginnamesummary,qtype_ddmarker - Note about the question type not
  being accessible to visually impaired users
2020-04-28 15:52:21 +02:00
Andrew Nicols 2c2232ce23 Merge branch 'MDL66035' of https://github.com/jwalits/moodle into MOODLE_37_STABLE 2020-04-28 20:04:56 +08:00
Luca Bösch 1bd4817843 MDL-68404 gradingform_rubric: Style "Add level" button. 2020-04-28 14:01:45 +02:00
Andrew Nicols 5673b3b48a Merge branch 'MDL-68445_37' of https://github.com/stronk7/moodle into MOODLE_37_STABLE 2020-04-28 18:31:34 +08:00
Eloy Lafuente (stronk7) 686468bae6 weekly release 3.7.5+ 2020-04-28 11:15:24 +02:00
Eloy Lafuente (stronk7) 30d3dad3bb Merge branch 'install_37_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_37_STABLE 2020-04-28 11:15:22 +02:00
Andrew Nicols 4fa12efce0 Merge branch 'MDL-68525-37' of git://github.com/andrewnicols/moodle into MOODLE_37_STABLE 2020-04-28 10:23:51 +02:00
Eloy Lafuente (stronk7) 38f595a0df MDL-68525 behat: chrome/switches caps not allowed in Chrome > 81
Now we need to use extra_capabilities/chromeOptions/args instead

The former was deprecated long ago, it seems that Chrome 81 has
stopped accepting it. The later seems to be working at very least
since Chrome 76 (haven't gone further back).
2020-04-28 12:32:18 +08:00
Eloy Lafuente (stronk7) cdaae17f19 Merge branch 'MDL-68393-37-availableupdateui' of git://github.com/mudrd8mz/moodle into MOODLE_37_STABLE 2020-04-27 18:09:59 +02:00
Eloy Lafuente (stronk7) 6a0f3a8736 Merge branch 'MDL-65967-37' of https://github.com/danielneis/moodle into MOODLE_37_STABLE 2020-04-27 17:31:38 +02:00
AMOS bot 201946c82c Automatically generated installer lang files 2020-04-27 00:11:37 +00:00
Jwalit Shah 9950de034a MDL-66035 message: Restore missing message preferences files 2020-04-27 09:49:06 +10:00
Tim Hunt e43a539e10 MDL-57680 form autocomplete: extend Behat tests 2020-04-26 15:12:12 +01:00
Tim Hunt 80474ee9e8 MDL-57680 form autocomplete: fix triggering change event 2020-04-26 14:33:55 +01:00
Tim Hunt cce1fe41a6 MDL-57680 form autocomplete: let singleselects be cleared.
This was already working after ajax had refreshed the choices, it was just
broken on first page load.
2020-04-26 14:30:19 +01:00
Mikhail Golenkov ae0d7f7089 MDL-67540 quiz: Start transaction before selecting existing slots.
Co-authored-by: Conn <conn@cmrwarwicker.com>
2020-04-26 10:56:03 +10:00
Thiagolivramento 77d5634729 MDL-65967 tool_recyclebin: add recycle bin link to category edit menu 2020-04-24 17:09:12 -03:00
Eloy Lafuente (stronk7) f2d2912241 MDL-68445 behat: Bump to 3.6.x
composer.lock generated with PHP 7.1, following:

https://docs.moodle.org/dev/Composer#How_to_prepare_and_submit_composer_changes

Also, ensure Symfony/Process > 4.0 compatibility
(needed for parallel runs)
2020-04-24 15:57:17 +02:00
sam marshall 28de453200 MDL-68492 Behat: Use faster direct link steps in lib/tests/behat 2020-04-24 12:07:15 +01:00
sam marshall d571624920 MDL-68492 Behat: Direct URL links for courses, activities 2020-04-24 12:07:15 +01:00
Shamim Rezaie 12659cd7f1 MDL-68509 core_ddl: Keep databasemeta cache after dropping temptables
Backport of MDL-58584 (934c2ee + 94e2509)
2020-04-24 11:06:37 +02:00
Jun Pataleta 84e737e3dd weekly release 3.7.5+ 2020-04-24 09:41:07 +08:00
Jun Pataleta 64f54e0dc4 Merge branch 'install_37_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_37_STABLE 2020-04-24 09:41:05 +08:00
Eloy Lafuente (stronk7) 06188c7eb6 Merge branch 'MDL-67886_37' of https://github.com/stronk7/moodle into MOODLE_37_STABLE 2020-04-23 16:06:35 +02:00
Eloy Lafuente (stronk7) c40fde2eae MDL-67886 phpunit: Make tests cross-db
The suggested SQL in some of the assertions was not cross-db
but db-dependent. Now we just keep that part out from the
assertions, because it's not important to verify the
errors that are being asserted.
2020-04-23 12:35:30 +02:00
AMOS bot 22ec8c83b5 Automatically generated installer lang files 2020-04-23 00:14:44 +00:00
Eloy Lafuente (stronk7) b2507972df Merge branch 'MDL-67886_37' of git://github.com/mdjnelson/moodle into MOODLE_37_STABLE 2020-04-23 01:37:35 +02:00
Mark Nelson f524ec2aaa MDL-67886 core: check_database_schema() checks for missing indexes 2020-04-22 23:20:18 +02:00
Jun Pataleta 050cede6d8 Merge branch 'MDL-68392_37' of https://github.com/stronk7/moodle into MOODLE_37_STABLE 2020-04-22 11:09:20 +08:00
Paul Holden ac1fc5575a MDL-63609 media_videojs: support Youtube URL start time. 2020-04-21 14:45:37 +01:00
Jun Pataleta 3870922e61 Merge branch 'MDL-68339_37' of https://github.com/stronk7/moodle into MOODLE_37_STABLE 2020-04-20 21:52:40 +08:00
AMOS bot 9673018068 Automatically generated installer lang files 2020-04-19 00:13:25 +00:00
Brendan Heywood f98f08c00a MDL-68443 xmldb: Improve path validation on view_xml action 2020-04-18 20:51:56 +10:00
Eloy Lafuente (stronk7) 22120a505a MDL-68339 message: move array_key_exists() to property_exists()
Towards PHP 7.4 compliance:

array_key_exists(): Using array_key_exists() on objects is
deprecated. Use isset() or property_exists() instead
2020-04-16 20:28:37 +02:00
Eloy Lafuente (stronk7) 5466990ffc weekly release 3.7.5+ 2020-04-16 19:34:19 +02:00
Eloy Lafuente (stronk7) ae77ba7af5 Merge branch 'install_37_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_37_STABLE 2020-04-16 19:34:13 +02:00
Juan Leyva 3291f83c81 MDL-68293 mobile: Update language strings to mention new app plans
We need to update different language strings to let our site admins know about the new app restrictions
(for both features and user devices able to receive notifications)
2020-04-16 12:54:11 +02:00
Andrew Nicols 5963365517 MDL-68427 core: Correct previous/next page in paging bar 2020-04-16 14:41:59 +08:00
Adrian Greeve 3f7b3abaa9 Merge branch 'MDL-68196-37' of git://github.com/rezaies/moodle into MOODLE_37_STABLE 2020-04-16 10:58:06 +08:00
Shamim Rezaie a1d6d0ceb2 MDL-68196 core: not expand autocomplete elements too soon on IE 2020-04-16 12:23:49 +10:00
Eloy Lafuente (stronk7) 78f3ac2a67 Merge branch 'MDL-66849-M37' of https://github.com/ised-isde-canada/moodle into MOODLE_37_STABLE 2020-04-16 01:03:02 +02:00
Eloy Lafuente (stronk7) 9ff01f7cb5 Merge branch 'MDL-68323-37' of git://github.com/marinaglancy/moodle into MOODLE_37_STABLE 2020-04-16 00:54:07 +02:00
Eloy Lafuente (stronk7) a4c62ac8c1 Merge branch 'MDL-68279-37' of https://github.com/paulholden/moodle into MOODLE_37_STABLE 2020-04-16 00:33:32 +02:00
Eloy Lafuente (stronk7) fa07a148ef Merge branch 'MDL-68189-m37' of https://github.com/NeillM/moodle into MOODLE_37_STABLE 2020-04-16 00:19:04 +02:00
Eloy Lafuente (stronk7) 4c94e4947a Merge branch 'MDL-68280-37' of https://github.com/paulholden/moodle into MOODLE_37_STABLE 2020-04-16 00:10:56 +02:00
Sara Arjona 8484ab9ec9 Merge branch 'MDL-67751-37' of https://github.com/paulholden/moodle into MOODLE_37_STABLE 2020-04-15 17:57:23 +02:00
Jun Pataleta 56e572a73e Merge branch 'MDL-66200-MOODLE_37_STABLE_gradebook_csv_import' of https://github.com/jwalits/moodle into MOODLE_37_STABLE 2020-04-15 23:18:09 +08:00
Paul Holden 94de68f9b8 MDL-67751 course: include inline folders in list of resources. 2020-04-15 13:59:36 +01:00
Eloy Lafuente (stronk7) 89d61861a6 Merge branch 'MDL-67499-37' of git://github.com/paulholden/moodle into MOODLE_37_STABLE 2020-04-15 12:49:57 +02:00
Bas Brands f8f1a2dd86 MDL-68301 theme_boost: move course format css
this reduces duplication of css in format_topic
and format_weeks
2020-04-15 09:53:14 +02:00
Michael Milette 8039c06800 MDL-66849 output: Remove custom menu title when not specified 2020-04-14 22:20:48 -04:00
Jun Pataleta b59c6dbd51 Merge branch 'MDL-68405-37' of git://github.com/andrewnicols/moodle into MOODLE_37_STABLE 2020-04-14 16:08:58 +08:00
Andrew Nicols 7ab1221629 MDL-68405 js: Ensure correct exit code for gherkinlint 2020-04-14 15:09:48 +08:00
AMOS bot 9818289b15 Automatically generated installer lang files 2020-04-11 00:12:01 +00:00
AMOS bot 274e050ab4 Automatically generated installer lang files 2020-04-11 00:12:01 +00:00
David Mudrák f9aa942b2c MDL-68393 admin: Fix some minor styling issues on the notifications page
The patch makes the available update information elements more
distinguishable, the Download button more prominent, and the Check for
available update button better aligned. It reduces the space between
multiple available Moodle updates, too.
2020-04-10 14:41:36 +02:00
Eloy Lafuente (stronk7) d4b9e6613f Merge branch 'MDL-67919-37' of git://github.com/sarjona/moodle into MOODLE_37_STABLE 2020-04-10 11:58:49 +02:00
Eloy Lafuente (stronk7) 7098d7cb9f Merge branch 'MDL-67910-37' of git://github.com/sarjona/moodle into MOODLE_37_STABLE 2020-04-10 11:46:18 +02:00
Luca Bösch 945469f0e1 MDL-68392 travis: Fix validation warnings and infos
Can verify that this file passes the validation @
https://config.travis-ci.com/explore
2020-04-10 00:14:47 +02:00
Jwalit Shah 0470c9cc4e MDL-66200 gradebook: check selected feedback option when importing data 2020-04-09 10:59:46 +10:00
Sara Arjona 1ea8b348dd weekly release 3.7.5+ 2020-04-08 16:24:43 +02:00
Sara Arjona a65a5570a3 Merge branch 'install_37_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_37_STABLE 2020-04-08 16:24:40 +02:00
Andrew Nicols da15ac0233 Merge branch 'MDL-68148-37' of git://github.com/rezaies/moodle into MOODLE_37_STABLE 2020-04-08 11:24:29 +08:00
Shamim Rezaie 07091e866d MDL-68148 user: remove the noscript tag
The submit button remains deactive if js is disabled. So having a
noscript tag to output a submit button here does not make sense.
2020-04-08 11:55:11 +10:00
Shamim Rezaie 37d34c2aa4 MDL-68148 user: fixed stray end tag (input) 2020-04-08 11:44:46 +10:00
Shamim Rezaie 4934b00dca MDL-68148 core_user: avoid multiple enrol buttons with the same id 2020-04-08 11:44:45 +10:00
Shamim Rezaie 0f4e00f527 MDL-68148 core_user: set the fullname column as the header column
ref: https://www.w3.org/WAI/tutorials/tables/
2020-04-08 11:44:45 +10:00
Shamim Rezaie d8ba1a5db5 MDL-68148 output: type attribute is unnecessary for javascript resources 2020-04-08 11:44:44 +10:00
Shamim Rezaie 1a5c2aea69 MDL-68148 core: remove cellspacing
The cellspacing attribute of <table> is not supported in HTML5.
So the removed line did not have any effect since ages ago.
2020-04-08 11:44:43 +10:00
AMOS bot e2df259a6a Automatically generated installer lang files 2020-04-08 00:11:20 +00:00
AMOS bot c7c4882929 Automatically generated installer lang files 2020-04-08 00:11:19 +00:00
Sara Arjona bd3600a28e Merge branch 'MDL-40081-37' of https://github.com/paulholden/moodle into MOODLE_37_STABLE 2020-04-07 15:10:25 +02:00
Sara Arjona 88955a1984 Merge branch 'MOODLE_37_MDL-68223' of https://github.com/golenkovm/moodle into MOODLE_37_STABLE 2020-04-07 13:43:17 +02:00
Sara Arjona 795069eb94 Merge branch 'MOODLE_37_MDL-65700' of https://github.com/golenkovm/moodle into MOODLE_37_STABLE 2020-04-07 13:34:35 +02:00
Mikhail Golenkov e061d00010 MDL-65700 javascript: Add MDN and URL polyfills. 2020-04-07 20:57:46 +10:00
Sara Arjona b6e8c88f0b Merge branch 'MDL-65539-m37' of https://github.com/NeillM/moodle into MOODLE_37_STABLE 2020-04-06 16:42:24 +02:00
Paul Holden c96e66a40a MDL-40081 completion: clean up criteria records for deleted courses. 2020-04-06 12:22:03 +01:00
Paul Holden 23e71ce7a5 MDL-67499 restore: account for deleted user truncated email/username. 2020-04-06 12:10:00 +01:00
Eloy Lafuente (stronk7) a7c8680ec3 MDL-67499 restore: add 100% cov. to restore_dbops::precheck_user()
Supports multiple mails to be tested.

So we can perform changes to it and also some related stuff,
like delete_user() with confidence.
2020-04-06 11:48:44 +01:00
Paul Holden 2c6df5b7f0 MDL-67499 user: truncate long username/email during user deletion. 2020-04-06 11:48:44 +01:00
Paul Holden 316575d3b3 MDL-68280 user: fix PHP notice for unknown user invalid login token. 2020-04-06 11:46:26 +01:00
Paul Holden 9a856f83fe MDL-68279 admin: filter site fullname when sending test email. 2020-04-06 11:41:34 +01:00
Sara Arjona c7c98440cf Merge branch 'MDL-68239-37' of https://github.com/NinaHerrmann/moodle into MOODLE_37_STABLE 2020-04-06 10:19:32 +02:00
Jake Dallimore 1674e5f87c MDL-68309 overrides: clarify inactive overrides help string 2020-04-06 07:41:36 +08:00
Sara Arjona 98af061024 MDL-67919 dataprivacy: Fix behat error when contacting DPO 2020-04-03 19:49:00 +02:00
Ruslan Kabalin b71d42cfb4 MDL-68315 formslib: Fix completion attribute in course form element.
This fixes 'onlywithcompletion' attribute in course form element.
2020-04-03 16:12:44 +01:00
n_herr03 337d0eb9e8 MDL-68239 mod_data: make required icon in multimenu visible 2020-04-03 12:20:24 +02:00
Neill Magill 316d6c9de5 MDL-65539 dragdrop: Ignore drag proxy in keyboard menu
Before this change the node that is displayed during a the last mouse
drag and drop would be listed in a keyboard drag and drop if it was
the container node of one of the types of node being moved in this action.

If a node is inside a node with the .yui3-dd-proxy class then it is
one of the proxy elements used to display the dragged content during
mouse drag and drop so we will start ignoring it.
2020-04-03 08:39:31 +01:00
Neill Magill 3e32822706 MDL-65539 dragdrop: Allow sections and blocks to move to the top
Before this change sections and blocks could not be moved to be the
top item when using keyboard drag and drop.

They can now be moved to the top in one action.

The way they move using keyboard drag and drop has changed when they
are below the item they are dropped on, not instead of appearing
below it they will be placed above it.
2020-04-03 08:39:31 +01:00
Neill Magill 8314f2e9a2 MDL-65539 dragdrop: Allow direction detection when using keyboard
Before this change keyboard drag and drop could not detect the
direction of movement, this meant that an item would only be placed
below an item or at the top of a container item.

This change means that extending modules can declare
detectkeyboarddirection to true. This will mean that when an item is
moved it's position will be determined by the direction of travel as
it would be when dragging using the mouse.

If detectkeyboarddirection is true then:

* If you move an item upwards it will be placed before the item
  selected in the drop menu
* If you move a item downwards it will be placed after the item
  selected in the drop menu
* The item above the one being dragged will now be displayed on
  the drop menu

If detectkeyboarddirection is false there will be no change in
behaviour.
2020-04-03 08:39:31 +01:00
Neill Magill ffe5f336d3 MDL-65539 course: Keyboad drag and drop should not break page
Before this change keyboard drag and drop of sections would alter
the structure of the page.

This occured because in this case the dragnode was the original node
2020-04-03 08:39:30 +01:00
Neill Magill 1c45c9200a MDL-65539 formats: Section labels not updated during move
Before this change when moving a section via drag and drop the
aria-label for the section was not being updated neither was the
title on the drag handle.

The result was the the drop menu on keyboard drag and drop displayed
the wrong information after a section was moved.
2020-04-03 08:39:30 +01:00
Neill Magill 6c8328eb4e MDL-68189 course: Section name change should display in DD menu
Before this patch if a section was renamed inline the old name was
still displayed in the keyboard drag and drop menu until the page
was refreshed.

This change ensures that the two places that section names were not
updated in get changed after an inline update to the name.
2020-04-03 08:38:51 +01:00
Sara Arjona 08a62243c5 weekly release 3.7.5+ 2020-04-02 16:51:11 +02:00
Sara Arjona 4feb95d263 Merge branch 'install_37_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_37_STABLE 2020-04-02 16:51:09 +02:00
Marina Glancy e3e5bdfbe4 MDL-68323 core: add --max-lint-warnings option to grunt 2020-04-02 13:56:25 +02:00
Luca Bösch c074850dc4 MDL-67672 user: Display name in user menu as elsewhere. 2020-04-02 00:17:57 +02:00
Eloy Lafuente (stronk7) 5bfbbb34be Merge branch 'MDL-68265-37' of git://github.com/andrewnicols/moodle into MOODLE_37_STABLE 2020-04-01 23:29:31 +02:00
Eloy Lafuente (stronk7) da231a51e0 Merge branch 'MDL-68193_37' of git://github.com/mdjnelson/moodle into MOODLE_37_STABLE 2020-04-01 23:22:43 +02:00
Mark Nelson 47fe981b8e MDL-68193 core: added new database_text_field_content_replaced event 2020-04-01 20:44:33 +02:00
Eloy Lafuente (stronk7) a4087a6cab Merge branch 'MDL-67995-37' of git://github.com/cescobedo/moodle into MOODLE_37_STABLE 2020-04-01 19:11:58 +02:00
Jake Dallimore 965a8fdfc4 Merge branch 'MDL-67672-37' of git://github.com/lucaboesch/moodle into MOODLE_37_STABLE 2020-04-01 16:43:52 +08:00
Sara Arjona ac3c2ec5ba Merge branch 'MDL-68281_37' of https://github.com/stronk7/moodle into MOODLE_37_STABLE 2020-04-01 09:25:38 +02:00
Sara Arjona 68a72085f2 Merge branch 'MDL-68277_37' of https://github.com/timhunt/moodle into MOODLE_37_STABLE 2020-04-01 09:14:57 +02:00
Luca Bösch 1131d828f2 MDL-67672 user: Display name in user menu as elsewhere. 2020-04-01 09:03:30 +02:00
Sara Arjona a7b6456475 Merge branch 'MDL-58964-37' of git://github.com/abias/moodle into MOODLE_37_STABLE 2020-03-31 19:14:05 +02:00
Eloy Lafuente (stronk7) b9a527603d Merge branch 'MDL-64494-37' of git://github.com/bmbrands/moodle into MOODLE_37_STABLE 2020-03-31 18:59:40 +02:00
Bas Brands 1e66dd6de0 MDL-64494 theme_boost: accessible theme colours 2020-03-31 18:55:08 +02:00
Sara Arjona 74b8e6a751 Merge branch 'MDL-66245-37' of git://github.com/junpataleta/moodle into MOODLE_37_STABLE 2020-03-31 15:09:22 +02:00
Sara Arjona c137a7d306 MDL-67910 behat: PendingJS improvements for deleteevent modal 2020-03-31 08:43:20 +02:00
Jake Dallimore 7051341ba6 Merge branch 'MDL-68144-37' of git://github.com/lucaboesch/moodle into MOODLE_37_STABLE 2020-03-31 13:59:59 +08:00
Luca Bösch 1db8e1bab4 MDL-68144 mod_folder: make top margins less dominant for folder content 2020-03-31 07:39:17 +02:00
Eloy Lafuente (stronk7) 1da6538756 Merge branch 'MDL-68269-37' of git://github.com/rezaies/moodle into MOODLE_37_STABLE 2020-03-30 22:54:26 +02:00
Eloy Lafuente (stronk7) 5d580ac95c Merge branch 'MDL-68049-37' of https://github.com/spvickers/moodle into MOODLE_37_STABLE 2020-03-30 16:24:15 +02:00
Andrew Nicols f76355db90 Merge branch 'MDL-52319-37-environmentxml' of git://github.com/mudrd8mz/moodle into MOODLE_37_STABLE 2020-03-30 16:55:01 +08:00
Shamim Rezaie 1cdf348ac5 MDL-68269 form: fieldset in group elements should be full width 2020-03-30 18:34:35 +11:00
cescobedo 91e4d8f3d8 MDL-67995 format_singleactivity: Fix dropwdown type of activity 2020-03-30 08:27:10 +02:00
Mikhail Golenkov f8c7167b5d MDL-68223 assign: Fix selection of comment text. 2020-03-30 15:00:36 +11:00
Andrew Nicols 94ec80ae18 MDL-68265 core_question: Switch question import to request dir 2020-03-30 08:14:46 +08:00
Andrew Nicols 6e1a330c81 MDL-68265 mod_lesson: Switch question import to request dir 2020-03-30 08:14:46 +08:00
AMOS bot 752bd12fd4 Automatically generated installer lang files 2020-03-29 00:11:53 +00:00
Eloy Lafuente (stronk7) 6d7e1cfecb MDL-68281 unit test: Include required class
Also, add missing line break, that I did not see 1 week ago.
2020-03-28 16:27:48 +01:00
AMOS bot daa86448e9 Automatically generated installer lang files 2020-03-28 00:11:46 +00:00
Tim Hunt 6536a3ff9b MDL-68277 qtype_essay: answer area in reviews should be right size
The answer box size is set by teachers and provides a useful
visual cue how long a response was expected. Therefore, it is
useful to keep the space at least that size in quiz reviews, etc.
2020-03-27 14:11:45 +00:00
Jake Dallimore 604b2a3b58 weekly release 3.7.5+ 2020-03-27 09:18:33 +08:00
Jake Dallimore 4e3837eda1 Merge branch 'install_37_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_37_STABLE 2020-03-27 09:18:32 +08:00
Eloy Lafuente (stronk7) 3b7037656e Merge branch 'MDL-64429-37' of https://github.com/paulholden/moodle into MOODLE_37_STABLE 2020-03-26 18:38:57 +01:00
Paul Holden fb6cdb3a9f MDL-64429 tool_usertours: upgrade step to fix existing tours sortorder. 2020-03-26 16:48:51 +00:00
Eloy Lafuente (stronk7) 3e718aff10 Merge branch 'MDL-68183-37-mysqlpwdresetsql' of git://github.com/mudrd8mz/moodle into MOODLE_37_STABLE 2020-03-26 01:18:34 +01:00
Eloy Lafuente (stronk7) 95fce73f16 Merge branch 'MDL-63865-37' of https://github.com/paulholden/moodle into MOODLE_37_STABLE 2020-03-26 00:32:15 +01:00
Eloy Lafuente (stronk7) 07dbce000c Merge branch 'MDL-67442_37' of https://github.com/jonof/moodle into MOODLE_37_STABLE 2020-03-26 00:08:10 +01:00
Jun Pataleta 9b82b174d0 Merge branch 'MDL-68149_37' of https://github.com/timhunt/moodle into MOODLE_37_STABLE 2020-03-26 00:09:28 +08:00
Jun Pataleta 5d117508d8 Merge branch 'MDL-67024-37' of git://github.com/farhan6318/moodle into MOODLE_37_STABLE 2020-03-25 08:34:12 +08:00
Eloy Lafuente (stronk7) 02d491fe99 Merge branch 'MDL-67731-37' of https://github.com/paulholden/moodle into MOODLE_37_STABLE 2020-03-25 00:06:22 +01:00
Jake Dallimore 72c744dd22 Merge branch 'MDL-68135-37' of git://github.com/rezaies/moodle into MOODLE_37_STABLE 2020-03-24 12:11:13 +08:00
AMOS bot 58fe4d2cbd Automatically generated installer lang files 2020-03-24 00:11:12 +00:00
Alexander Bias 49361f9a24 MDL-58964 navigation: Reindex array when element is removed 2020-03-23 21:37:00 +01:00
David Mudrák 129c9d4093 MDL-52319 upgrade: Better report the environment checks in CLI scripts
Before we did not display the source of the environment check failure
(whether it was a core check or a plugin) and there was a missing space
before the "Error" status.
2020-03-23 11:27:38 +01:00
Tim Hunt 8475b74d0c MDL-52319 install: Fix some coding style issues 2020-03-23 11:27:38 +01:00
Tim Hunt f246d30831 MDL-52319 upgrade: Also run environment checks if plugins need upgrades
Also perform the environment checks if a plugin triggers the upgrade.
Core upgrade and CLI upgrade was doing this already.
2020-03-23 11:27:38 +01:00
AMOS bot 50f32f791b Automatically generated installer lang files 2020-03-23 00:12:19 +00:00
Paul Holden 88779cc689 MDL-64429 tool_usertours: ensure tour sortorder can't move out of range. 2020-03-22 20:04:08 +00:00
Paul Holden f8f3286267 MDL-63865 tool_dataprivacy: unit test for plugin privacy provider. 2020-03-22 20:00:00 +00:00
Paul Holden b167974308 MDL-67731 backup: fix async restores in progress table listing. 2020-03-22 19:57:46 +00:00
Farhan Karmali 20ecbc885f MDL-67024 Lib: Check if user->mnethostid is set before using it 2020-03-20 11:59:29 +05:30
Adrian Greeve 4980533b75 weekly release 3.7.5+ 2020-03-20 13:35:46 +08:00
Alexander Bias b6d5a6c619 MDL-58964 navigation: Add class attributes to Boost flat navigation 2020-03-19 20:49:45 +01:00
Stephen Vickers 50e3ae359b MDL-68049 mod_lti: Fix link-level memberships service
Fix cause of 404 error
Ensure personal name and email fields are included
Add ext_user_username field when being passed in LTI messages
2020-03-19 11:26:06 +00:00
Adrian Greeve cf65056e46 Merge branch 'MDL-68081-MOODLE_37_STABLE' of https://github.com/kritisingh1/moodle into MOODLE_37_STABLE 2020-03-19 11:29:03 +08:00
Adrian Greeve 6c47187329 Merge branch 'MDL-68014-37' of git://github.com/peterRd/moodle into MOODLE_37_STABLE 2020-03-19 11:06:09 +08:00
Jun Pataleta a471a106c4 Merge branch 'MDL-68108-37' of git://github.com/crazyserver/moodle into MOODLE_37_STABLE 2020-03-18 22:59:34 +08:00
Pau Ferrer Ocaña 5ce5abcd67 MDL-68108 formslib: Add element password inline template 2020-03-18 08:46:04 +01:00
Adrian Greeve 73aac2ea23 Merge branch 'MDL-67901-37' of git://github.com/bmbrands/moodle into MOODLE_37_STABLE 2020-03-18 10:01:16 +08:00
David Mudrák e8ae8a8a76 MDL-68183 auth: Fix the performance of get_complete_user_data search
When searching for the user by a case-insensitive field (email address
is the only one supported now), the performance may be very poor as the
DB cannot use the index due to the LOWER() operation and the full
sequential scan of all the user records is performed. On some DBs such
as MySQL, this can be significantly improved by pre-filtering the users
with accent-insensitive search.

So we first perform accent-insensitive search for potential candidates
in a subselect, which can use the index. Only then we perform the
additional accent-sensitive search on this limited set or records.
2020-03-17 14:52:25 +01:00
David Mudrák 39901e1577 MDL-68183 auth: Fix the performance of signup_validate_data search query
When searching for other users with the same email address, we perform
the case-insensitive and accent-sensitive search. That may be expensive
as some DBs such as MySQL cannot use the index in that case. Instead,
sequential scan of all the user records is performed and the comparison
uses the LOWER function to filter the matching records. This leads to
significant performance heavy queries which in turn represent a surface
for DoS attacks.

For that reason, we first perform accent-insensitive search for
potential candidates in a subselect, which can use the index. Only then
we perform the additional accent-sensitive search on this limited set or
records.
2020-03-17 14:52:25 +01:00
David Mudrák 7a87e8a911 MDL-68183 auth: Fix the performance of forgotten password user search
When searching for the user matching the given email address, we perform
the case-insensitive and accent-sensitive search. That may be expensive
as some DBs such as MySQL cannot use the index in that case. Instead,
sequential scan of all the user records is performed and the comparison
uses the LOWER function to filter the matching records. This leads to
significant performance heavy queries which in turn represent a surface
for DoS attacks.

For that reason, we first perform accent-insensitive search for
potential candidates, which can use the index. Only then we perform the
additional accent-sensitive search on this limited set or records.
2020-03-17 14:52:24 +01:00
Adrian Greeve 5fd324e17e Merge branch 'MDL-67970-37' of git://github.com/rezaies/moodle into MOODLE_37_STABLE 2020-03-17 15:26:10 +08:00
Shamim Rezaie 50889d5519 MDL-67970 output: use fieldset in core/chooser instead of label 2020-03-17 18:20:43 +11:00
Shamim Rezaie 1cc8177b73 MDL-67970 core: remove unnecessary roles
- The navigation role is unnecessary for element nav
- The textbox role is unnecessary for element textarea
2020-03-17 18:20:43 +11:00
Shamim Rezaie 8b33494324 MDL-67970 output: replace new-sections attribute with data-new-sections
new-sections is not a valid attribute name for the a element.
Replaced that with data-new-sections
2020-03-17 18:20:43 +11:00
Shamim Rezaie 8e2494b4b2 MDL-67970 output: fixed duplicate id attribute
action_menu::export_for_template generates the id attributes and send it
to core/action_menu_trigger template as part of the attributes variable.
2020-03-17 18:20:43 +11:00
Shamim Rezaie 941a4c10cd MDL-67970 search: fixed stray end tag (input) 2020-03-17 18:20:43 +11:00
Adrian Greeve 853fc48867 Merge branch 'MDL-67981_37' of https://github.com/timhunt/moodle into MOODLE_37_STABLE 2020-03-17 11:33:40 +08:00
Jonathon Fowler 4ca4651f20 MDL-67442 assign: expand/contract text works in all browsers now 2020-03-16 08:59:49 +10:00
kritisingh1 36223fbee8 MDL-68081 Groups: Fixes string error in member removal function 2020-03-14 23:19:53 +05:30
Victor Deniz Falcon 9d08ae36e9 weekly release 3.7.5+ 2020-03-12 14:22:14 +00:00
Victor Deniz Falcon ed34ac0a7c Merge branch 'install_37_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_37_STABLE 2020-03-12 14:22:09 +00:00
Eloy Lafuente (stronk7) ea02bf99d7 Merge branch 'MDL-66607-37' of git://github.com/andrewnicols/moodle into MOODLE_37_STABLE 2020-03-12 10:10:58 +01:00
Eloy Lafuente (stronk7) 52491c6cc7 Merge branch 'MDL-68125-regression-MOODLE_37_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_37_STABLE 2020-03-12 01:19:51 +01:00
Brendan Heywood 5c39f8969d MDL-68125 core: Fixed $CFG->reverseproxyignore install regression 2020-03-12 09:54:35 +11:00
Eloy Lafuente (stronk7) c86fa207a2 Merge branch 'MDL-68061-37' of git://github.com/mickhawkins/moodle into MOODLE_37_STABLE 2020-03-11 22:56:39 +01:00
Tim Hunt 631b1f77f0 MDL-68149 qtype_match: correctly distinguish 0 and 0.0 answers
Also added a test for backup & restore (which was working).
2020-03-11 13:45:15 +00:00
Tim Hunt ec67d8b676 MDL-68149 qtype_match: Updatey tests to follow make_question() pattern 2020-03-11 13:45:13 +00:00
Andrew Nicols 9ceb49dca0 MDL-66607 message: Add pendingJS checks 2020-03-11 20:46:00 +08:00
Andrew Nicols 147087cdd2 MDL-66607 message: Resolve race conditions in message deletion process
This commit makes several changes:
1) Explicitly stop polling for messages when a conversation is deleted;
2) Check for deleted conversations when displaying new messages;
3) Do not add a new empty conversation; and
4) Introduce pendingJS checks to ensure that Behat waits for messags to finish rendering.
2020-03-11 20:43:25 +08:00
Andrew Nicols 9800e5ca6f Merge branch 'MDL-68146_37' of https://github.com/stronk7/moodle into MOODLE_37_STABLE 2020-03-11 11:52:26 +08:00
Eloy Lafuente (stronk7) ab0f20b63b MDL-68146 forms: remove duped help and advanced icons in checkboxes
They are exceptionally shown later, after the checkbox text already.

This is a fix for the regression introduced by MDL-63424.
2020-03-10 23:04:50 +01:00
Eloy Lafuente (stronk7) 739a18df53 Merge branch 'MDL-65724-37-3' of git://github.com/peterRd/moodle into MOODLE_37_STABLE 2020-03-10 13:51:36 +01:00
Eloy Lafuente (stronk7) bb66bd562f Merge branch 'MDL-67189-37' of git://github.com/dpalou/moodle into MOODLE_37_STABLE 2020-03-10 11:30:49 +01:00
Shamim Rezaie 3aba5ed0ce MDL-68135 output: remove the presentation role from user pic
"presentation" is not a valid role for the img element.
Moreover, it doesn't make sense to have both role="presentation" and
aria-hidden="true" for an element at the same time.
For more info please see:
https://timwright.org/blog/2016/11/19/difference-rolepresentation-aria-hiddentrue/
2020-03-10 19:06:18 +11:00
Dani Palou 3ec126df58 MDL-67189 external: Add test to catch PHP exceptions 2020-03-10 08:32:24 +01:00
Dani Palou 59964c5c95 MDL-67189 external: Catch Throwable in call_external_function 2020-03-10 08:32:24 +01:00
Eloy Lafuente (stronk7) 61e4180191 Merge branch 'MDL-67827-37' of git://github.com/andrewnicols/moodle into MOODLE_37_STABLE 2020-03-09 20:36:29 +01:00
Sara Arjona 23739a476a Merge branch 'MDL-66671-m37-master' of https://github.com/dthies/moodle into MOODLE_37_STABLE 2020-03-09 18:49:25 +01:00
Sara Arjona 8f39f26b9e Merge branch 'MDL-67968-37' of git://github.com/rezaies/moodle into MOODLE_37_STABLE 2020-03-09 18:17:14 +01:00
Sara Arjona 012dde7fe7 Merge branch 'MDL-67902-37' of git://github.com/rezaies/moodle into MOODLE_37_STABLE 2020-03-09 15:06:58 +01:00
Andrew Nicols 1d77fbd497 MDL-67827 behat: Pending JS improvements for dialogues 2020-03-09 08:31:21 +08:00
Andrew Nicols d3ce732601 MDL-67827 behat: Add missing exception use 2020-03-09 08:31:21 +08:00
AMOS bot 838193097d Automatically generated installer lang files 2020-03-09 00:12:02 +00:00
Tim Hunt 0c90bc8cd3 MDL-67981 questions: avoid errors deleting contextless questions 2020-03-06 18:05:33 +00:00
Shamim Rezaie 80011bdf57 MDL-67968 calendar: use aria-label instead of the abbr tag 2020-03-07 04:19:54 +11:00
Shamim Rezaie 17c23edcd1 MDL-67968 calendar: explain weekday abbreviations 2020-03-07 04:19:09 +11:00
Shamim Rezaie 6f0b92e97c MDL-67968 form: not to put empty label when no label is available 2020-03-07 04:19:09 +11:00
Shamim Rezaie e0f6182508 MDL-67968 question: do not display sr-only legends
.accesshide was removed because:
 1. It was only kept in case it's still used somewhere, in a custom form
 field for instance.
 2. It was broken since 3.5 where we integrated
 https://github.com/bmbrands/moodle/compare/ab65b87f3d...MDL-62419-master
 So it's been ages that the reason mentioned on point 1 was not being
 satisfied
2020-03-07 04:19:09 +11:00
Shamim Rezaie d1084b4c26 MDL-67968 form: grouped element label fix 2020-03-07 04:19:09 +11:00
Sara Arjona 805361d871 Moodle release 3.7.5 2020-03-06 12:34:06 +01:00
Peter 2e3d05e591 MDL-65724 core: Force restore to use the settings from the plan
When importing use the import settings.
2020-03-06 14:20:43 +08:00
AMOS bot 8d68b0b251 Automatically generated installer lang files 2020-03-06 00:10:59 +00:00
Peter Dias 5b8b45410c MDL-68014 lti: Remove alt text for image 2020-03-06 07:56:55 +08:00
Sara Arjona efc431ba0d weekly release 3.7.4+ 2020-03-05 17:31:24 +01:00
Sara Arjona 9df4aa7210 Merge branch 'install_37_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_37_STABLE 2020-03-05 17:31:20 +01:00
Michael Hawkins 8481609ba4 MDL-67861 core: Fix getremoteaddr unit test to match new proxy setup 2020-03-05 14:39:55 +08:00
Brendan Heywood 194406e923 MDL-67861 core: Added $CFG->reverseproxyignore IP subnet list
If your server is behind multiple reverse proxies that append to the
X-Forwarded-For header then you will need to specify a comma separated
list of ip addresses or subnets of the reverse proxies to be ignored
in order to find the users correct IP address.
2020-03-05 01:27:48 +01:00
Brendan Heywood c4665bcf95 MDL-67861 libraries: Refactor is_ip_in_subnet_list in ip_utils 2020-03-05 01:27:48 +01:00
Brendan Heywood c70d7d0386 MDL-67861 admin: Default $CFG->getremoteaddrconf to only use REMOTE_ADDR 2020-03-05 01:27:48 +01:00
Brendan Heywood 4a3a673d1e MDL-67861 core: Use last ip in X-Forwarded-For list 2020-03-05 01:27:48 +01:00
Andrew Nicols 31260f8667 MDL-65106 theme_classic: Remove unused variable 2020-03-05 08:17:03 +08:00
Andrew Nicols cb3deb89c1 Merge branch 'MDL-65106-37' of git://github.com/bmbrands/moodle into MOODLE_37_STABLE 2020-03-05 08:16:45 +08:00
Eloy Lafuente (stronk7) b21aad0837 Merge branch 'MDL-62768-37' of https://github.com/paulholden/moodle into MOODLE_37_STABLE 2020-03-04 18:37:28 +01:00
Bas Brands 43b11cfc9e MDL-67901 type_multichoice: clear my choice accessibility
Improve the accessibility for the clear my choice option. The
extra radio input controlling the reset feature was removed and
resetting the choice is now controlled by JavaScript.
This fixes the missing label reported in Accessibility audit and W3C
validation of the reset link

By this change this issue also fixes MDL-67280
2020-03-04 17:04:18 +01:00
Sara Arjona 8ba10c6666 Merge branch 'MDL-67767-37' of git://github.com/dpalou/moodle into MOODLE_37_STABLE 2020-03-04 15:05:07 +01:00
Dani Palou b7b45f8c0b MDL-67767 tool_mobile: Allow using more characters in forcedurlscheme 2020-03-04 14:25:25 +01:00
Sara Arjona a2ff87ba44 Merge branch 'MDL-67863-37' of git://github.com/bmbrands/moodle into MOODLE_37_STABLE 2020-03-04 14:06:34 +01:00
Sara Arjona 53a3991927 Merge branch 'MDL-67969-37' of git://github.com/rezaies/moodle into MOODLE_37_STABLE 2020-03-04 12:58:27 +01:00
Marina Glancy 6b502fbc2b MDL-56287 gradereport_history: Separate groups queries improved 2020-03-04 11:47:33 +01:00
Jun Pataleta 8509f1feb4 MDL-56287 gradereport_history: Show users from groups that can be viewed 2020-03-04 11:47:33 +01:00
Eloy Lafuente (stronk7) b692832347 Merge branch 'MDL-67641-37' of git://github.com/dpalou/moodle into MOODLE_37_STABLE 2020-03-04 10:48:05 +01:00
Sara Arjona a5a6a9c91c Merge branch 'MDL-68008-37' of git://github.com/ferranrecio/moodle into MOODLE_37_STABLE 2020-03-04 08:41:43 +01:00
Dani Palou 25c09b1b1d MDL-67641 auth: Fix shortname type in get_signup_settings WS 2020-03-04 08:12:13 +01:00
AMOS bot f00ddea3fc Automatically generated installer lang files 2020-03-04 00:11:19 +00:00
Eloy Lafuente (stronk7) 4caf331102 Merge branch 'MDL-67728-37' of git://github.com/crazyserver/moodle into MOODLE_37_STABLE 2020-03-03 19:50:26 +01:00
Eloy Lafuente (stronk7) 0705bb0c07 Merge branch 'MDL-67971-37' of git://github.com/sarjona/moodle into MOODLE_37_STABLE 2020-03-03 19:02:38 +01:00
Sara Arjona 4748f89945 Merge branch 'MDL-67993-37' of git://github.com/lameze/moodle into MOODLE_37_STABLE 2020-03-03 18:06:50 +01:00
Ferran Recio f0abaec208 MDL-68008 tool_capability: shows multiple contexts when overrides exists 2020-03-03 17:54:26 +01:00
Sara Arjona 2933c4e061 Merge branch 'MDL-68048-37-behatnotfound' of git://github.com/mudrd8mz/moodle into MOODLE_37_STABLE 2020-03-03 17:02:11 +01:00
Sara Arjona b808efac50 Merge branch 'MDL-68060-37-huburlcompare' of git://github.com/mudrd8mz/moodle into MOODLE_37_STABLE 2020-03-03 13:10:24 +01:00
Sara Arjona 0df30e445f Merge branch 'MDL-67891-37' of https://github.com/paulholden/moodle into MOODLE_37_STABLE 2020-03-03 12:48:35 +01:00
Bas Brands d4f03eb0b1 MDL-65106 theme_classic: set custom navigationitem icon 2020-03-03 11:53:48 +01:00
Sara Arjona 635b4db751 Merge branch 'MDL-63316-37' of https://github.com/azito122/moodle into MOODLE_37_STABLE 2020-03-03 11:11:05 +01:00
Sara Arjona 1821997b7c Merge branch 'MDL-67945-37' of git://github.com/ferranrecio/moodle into MOODLE_37_STABLE 2020-03-03 10:10:58 +01:00
Sara Arjona a97fde462d Merge branch 'MDL-67749-37' of git://github.com/dpalou/moodle into MOODLE_37_STABLE 2020-03-03 09:30:50 +01:00
Adrian Hutchinson 9bcfb74256 MDL-67988 mod_lti: remove padding from JWS base64url encoding 2020-03-02 14:01:36 +01:00
Paul Holden c0fdc91ea3 MDL-67891 tool_cohortroles: move upgrade step inside plugin.
The step added in MDL-67458 was added to core, which broke the upgrade
process if this plugin had been uninstalled prior.
2020-03-02 08:50:27 +00:00
Sara Arjona da1d1af843 MDL-67971 core_badges: review issuer URL 2020-03-02 08:02:40 +01:00
Andrew Zito 85d5216840 MDL-63316 participants: lastname sort for participants table 2020-02-28 14:33:27 -05:00
Daniel Thies 2337123e89 MDL-66671 enrol_lti: Skip grade sync when cm deleted 2020-02-28 09:29:32 -06:00
Eloy Lafuente (stronk7) 95eb7d8343 weekly release 3.7.4+ 2020-02-28 12:22:35 +01:00
Bas Brands 720a26266a MDL-67863 theme_boost: change keyboard tab order
Move navdrawer up in the dom for a more logical tab order
Hide navdrawer links for tab / screenreader when navdrawer is closed
2020-02-27 17:12:47 +01:00
Michael Hawkins 1187f828b7 MDL-68061 gradereport_history: Restrict per page config value to int 2020-02-27 15:44:49 +08:00
Eloy Lafuente (stronk7) 37906d63f9 Merge branch 'MDL-67865-37' of git://github.com/rezaies/moodle into MOODLE_37_STABLE 2020-02-26 23:37:10 +01:00
Eloy Lafuente (stronk7) 870e202546 Merge branch 'MDL-64686-37' of git://github.com/lucaboesch/moodle into MOODLE_37_STABLE 2020-02-26 23:27:44 +01:00
Eloy Lafuente (stronk7) 50a72fbcd6 Merge branch 'MDL-67758-37' of git://github.com/dpalou/moodle into MOODLE_37_STABLE 2020-02-26 17:36:07 +01:00
Claude Vervoort b3172cc0fd MDL-67132 mod_lti: document new param
(amended to move the upgrade.txt info to correct 3.7.5)
2020-02-26 17:29:21 +01:00
Claude Vervoort dc39cee4f9 MDL-67132 mod_lti: call grade api to trigger course total computation 2020-02-26 17:27:33 +01:00
Eloy Lafuente (stronk7) f05ff7a66d Merge branch 'MDL-67979-37-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_37_STABLE 2020-02-26 17:13:47 +01:00
Anthony Forth cb2a49009c MDL-67945 enrol: missing $DB in edit_instance_form 2020-02-26 16:37:14 +01:00
David Mudrák b541ee20fb MDL-68060 registration: Improve the sites directory location check
This allows to define the custom HUB_MOODLEORGHUBURL with HTTP Basic
Auth credentials so that the registration features can be tested against
our staging site.
2020-02-26 10:59:27 +01:00
Jun Pataleta c975694cf5 Merge branch 'MOODLE_37_MDL-67980' of https://github.com/golenkovm/moodle into MOODLE_37_STABLE 2020-02-26 14:30:30 +08:00
Shamim Rezaie 8c39267d92 MDL-67969 lib: Fix duplicate blockinstanceid for fake blocks 2020-02-26 16:38:52 +11:00
Shamim Rezaie 45f1ddae59 MDL-67902 calendar: keyboard users should be able to toggle day popover 2020-02-26 16:35:59 +11:00
Shamim Rezaie a45fa24362 MDL-67902 calendar: informative aria label for event days in mini cals 2020-02-26 16:35:59 +11:00
Shamim Rezaie e127e819e6 MDL-67902 calendar: informative aria label for event days in calendar 2020-02-26 16:35:59 +11:00
Shamim Rezaie ce5337c902 MDL-67902 calendar: Fix label of the course filter in calendar 2020-02-26 16:35:59 +11:00
David Balch b74030550e MDL-67993 roles: Fix pix_icon() calls. 2020-02-26 12:15:42 +08:00
Eloy Lafuente (stronk7) 2cfcae67a0 Merge branch 'MDL-67644-37' of git://github.com/dpalou/moodle into MOODLE_37_STABLE 2020-02-26 00:10:24 +01:00
Eloy Lafuente (stronk7) dbb784d1ab Merge branch 'MDL-67806-37' of git://github.com/dpalou/moodle into MOODLE_37_STABLE 2020-02-25 23:58:17 +01:00
Paul Holden be941e5a05 MDL-62768 tool_policy: add page title & breadcrumb navigation. 2020-02-25 22:06:04 +00:00
Paul Holden 87080161e0 MDL-62768 tool_dataprivacy: add page breadcrumbs to navigation. 2020-02-25 21:36:46 +00:00
Helen Foster 62931543fb MDL-67979 lang: Import fixed English strings (en_fix)
Significant string changes:

* configcustommenuitems,core_admin - corrected example
* custommenuitems_desc,tool_mobile - fallback behaviour of custom menu
  items in the app
2020-02-25 12:24:44 +01:00
Eloy Lafuente (stronk7) 3cb6a5a3b2 Merge branch 'MDL-67862-37' of git://github.com/junpataleta/moodle into MOODLE_37_STABLE 2020-02-25 12:09:58 +01:00
Eloy Lafuente (stronk7) 765aef276c Merge branch 'MDL-67364-37' of git://github.com/mickhawkins/moodle into MOODLE_37_STABLE 2020-02-25 12:05:57 +01:00
David Mudrák 2da65dae97 MDL-68048 behat: Fix the ElementNotFoundException message wording
The exception class itself adds the "not found" to the error message.
2020-02-25 11:55:59 +01:00
Mikhail Golenkov 4be6148785 MDL-67980 tasks: Sort ad-hoc tasks by nextruntime. 2020-02-24 09:36:57 +11:00
Pau Ferrer Ocaña 5e4ffd0559 MDL-67728 behat: Increase app start timeout 2020-02-21 12:45:58 +01:00
Pau Ferrer Ocaña 99d5aff09b MDL-67728 behat: Improve behat app selectors 2020-02-21 12:45:58 +01:00
Luca Bösch ae31e9dfa8 MDL-64686 theme: align course search form for small screens sizes. 2020-02-21 06:35:11 +01:00
Jun Pataleta d077ffd3a5 weekly release 3.7.4+ 2020-02-21 11:03:08 +08:00
Jun Pataleta c61f9a4484 Merge branch 'install_37_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_37_STABLE 2020-02-21 11:02:29 +08:00
Eloy Lafuente (stronk7) 37ef74572d Merge branch 'MDL-67727-37' of git://github.com/crazyserver/moodle into MOODLE_37_STABLE 2020-02-20 16:13:02 +01:00
Luke Tucker d08e7b7e8a MDL-50455: tool_capability: Use static cache when loading context data 2020-02-20 00:30:16 +01:00
Eloy Lafuente (stronk7) 4441cfe9ce Merge branch 'MDL-67942-37' of https://github.com/HuongNV13/moodle into MOODLE_37_STABLE 2020-02-19 19:18:58 +01:00
Eloy Lafuente (stronk7) 9dd7ac3bc3 Merge branch 'MDL-67947_37' of https://github.com/timhunt/moodle into MOODLE_37_STABLE 2020-02-19 17:48:50 +01:00
Tim Hunt 2a912052bc MDL-67947 questions: questions_in_use should ask all components
Previously it was only checking mods.
2020-02-19 11:56:31 +00:00
Dani Palou addc07be5a MDL-67749 ws: Set private token when reset or manual create token 2020-02-19 12:05:05 +01:00
Huong Nguyen 6aaa78f044 MDL-67942 Quiz: Quiz attempt report delete_selected_attempts issue 2020-02-19 15:36:38 +07:00
Eloy Lafuente (stronk7) 6ffe3ecc9f Merge branch 'MDL-67471_37' of https://github.com/t-schroeder/moodle into MOODLE_37_STABLE 2020-02-18 23:54:55 +01:00
Eloy Lafuente (stronk7) c4b472700b Merge branch 'MDL-61390-37' of git://github.com/junpataleta/moodle into MOODLE_37_STABLE 2020-02-18 19:06:39 +01:00
Eloy Lafuente (stronk7) 414a461e41 Merge branch 'MDL-67953-37' of git://github.com/andrewnicols/moodle into MOODLE_37_STABLE 2020-02-18 18:07:45 +01:00
Shamim Rezaie 952d572921 MDL-67865 output: Fix id of the dropdown trigger 2020-02-18 16:20:15 +11:00
Andrew Nicols fc01f863d3 MDL-67953 grunt: Spawn new process for gherkinlint
Gherkinlint stores the list of processed features for duplicate
detection in an Object which is statically defined.
This causes it to bleed between runs.

To alleviate this we must spawn a new process.

Prior to this patchset we were calling a new Gherkinlint process which
had the same effect anyway.
2020-02-18 08:24:13 +08:00
Eloy Lafuente (stronk7) 1b43f6b06d Merge branch 'MDL-61389-37' of git://github.com/junpataleta/moodle into MOODLE_37_STABLE 2020-02-17 23:30:17 +01:00
Eloy Lafuente (stronk7) 86f297c7c2 Merge branch 'MDL-67817-m37-master' of https://github.com/dthies/moodle into MOODLE_37_STABLE 2020-02-17 22:09:39 +01:00
Tim Schroeder 21bac71bef MDL-67471 message: fixed mark_notification_read with messaging disabled 2020-02-17 09:16:57 +01:00
Jun Pataleta b400040cff MDL-61390 mod_forum: Create template for forum search results 2020-02-17 15:58:16 +08:00
Jun Pataleta 0846b4af08 MDL-61389 mod_forum: Descriptive aria-label for "Discuss this topic" 2020-02-17 15:52:20 +08:00
AMOS bot d927703799 Automatically generated installer lang files 2020-02-16 00:11:18 +00:00
Daniel Thies 8fedcb49a5 MDL-67817 core_date: Add test for timezone localization strings 2020-02-14 11:54:55 -06:00
Daniel Thies 0c9fe38643 MDL-67817 core_lang: Update timezone strings 2020-02-14 11:54:55 -06:00
Sara Arjona 5c7966eacf weekly release 3.7.4+ 2020-02-14 12:12:07 +01:00
Sara Arjona 0ee03dd15a Merge branch 'install_37_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_37_STABLE 2020-02-14 12:12:05 +01:00
Jun Pataleta 6dbf1dee71 Merge branch 'MDL-67965-37' of git://github.com/andrewnicols/moodle into MOODLE_37_STABLE 2020-02-14 13:25:01 +08:00
Andrew Nicols a884eea913 MDL-67965 behat: Get theme-specific context classes correctly 2020-02-14 10:15:49 +08:00
Michael Hawkins b41b74aacb MDL-67364 output: Add unit testing for editor_scss_to_css 2020-02-13 22:53:31 +08:00
Michael Hawkins fa0e63f9da MDL-67364 output: Allow child themes to use parent editor_scss config
This still allows child themes to override editor_scss, but will fall
back to what the parent is using if they do not specify it. This
negates the need for every child them to have the config duplicated
in order to utilise it.
2020-02-13 22:53:31 +08:00
Pau Ferrer Ocaña 306eaa606f MDL-67727 behat: Reset ionic app properly 2020-02-13 08:37:22 +01:00
Andrew Nicols 9ff79ab562 MDL-67953 grunt: Work around spawn length limits 2020-02-13 14:21:49 +08:00
Eloy Lafuente (stronk7) 4011bfc71f Merge branch 'MDL-67876_37' of https://github.com/timhunt/moodle into MOODLE_37_STABLE 2020-02-12 15:49:47 +01:00
Dani Palou dedb1592cb MDL-67644 tool_mobile: Add OAuth 2 providers in disabled features 2020-02-12 14:13:19 +01:00
Tim Hunt 603e31b820 MDL-67876 forms: not all field types need validation JS 2020-02-12 10:04:20 +00:00
Eloy Lafuente (stronk7) 3dab17b872 Merge branch 'MDL-67532-37' of https://github.com/paulholden/moodle into MOODLE_37_STABLE 2020-02-11 23:08:18 +01:00
Sara Arjona e81b6194e6 Merge branch 'MDL-59303-37' of https://github.com/paulholden/moodle into MOODLE_37_STABLE 2020-02-11 13:52:41 +01:00
Sara Arjona b54c18392f Merge branch 'MDL-66847-37' of git://github.com/lucaboesch/moodle into MOODLE_37_STABLE 2020-02-11 12:28:56 +01:00
Sara Arjona 7960af6567 Merge branch 'MDL-66834-MOODLE_37_STABLE' of https://github.com/kepeter/moodle into MOODLE_37_STABLE 2020-02-11 11:54:31 +01:00
Sara Arjona f24cc998f0 Merge branch 'mdl67142-moodle37' of https://github.com/AngadSethi/moodle into MOODLE_37_STABLE 2020-02-11 10:19:10 +01:00
Sara Arjona 07265da01c Merge branch 'MDL-67894-37' of https://github.com/grabs/moodle into MOODLE_37_STABLE 2020-02-11 08:20:49 +01:00
Dani Palou 6b2bbcbb0e MDL-67758 airnotifier: Send wwwroot to airnotifier 2020-02-10 11:55:52 +01:00
Dani Palou c1bc5df576 MDL-67806 tool_mobile: Add Dark mode option in disabled features
We must allow site admins to remotely disable that feature in the app
2020-02-10 11:53:52 +01:00
Jun Pataleta 750218868a MDL-66245 privacy: Encode each part of the data URL instead of the whole 2020-02-10 16:57:10 +08:00
Jun Pataleta 18aabbd5d5 MDL-67862 message: Render dialogue header only when necessary 2020-02-10 13:16:19 +08:00
Angad Sethi 4f5e2fc266 MDL-67142 quiz: fixed error when deleting saved questions long-name-quiz
An error was showing up while deleting questions
(in the question_save_from_deletion method) which had been saved
and which belonged to a quiz with a super long name, not exceeding 255
characters, as the 'name' field in 'question_categories' table had a
max size of 255 characters. The shorten_text function was used to
shorten the string to 255 characters and a unit test was added with
the name test_question_save_from_deletion_quiz_with_long_name to test
the patch.
2020-02-08 19:49:57 +05:30
AMOS bot ba801e68d7 Automatically generated installer lang files 2020-02-08 00:12:03 +00:00
Andreas Grabs fbd65fabb2 MDL-67894 mod_feedback: database error on show responses 2020-02-07 18:48:24 +01:00
Paul Holden ee0f61cde4 MDL-59303 auth_shibboleth: consistent readme URL. 2020-02-07 14:25:35 +00:00
Luca Bösch 5779862ee7 MDL-66847 webservice: Correct breadcrumb + title for ws documentation. 2020-02-07 14:38:35 +01:00
Paul Holden 9a49f51b15 MDL-67532 badges: better default for new badge language. 2020-02-07 09:47:13 +00:00
Sara Arjona 59f947667a weekly release 3.7.4+ 2020-02-07 09:44:52 +01:00
Sara Arjona 6733f41ed1 Merge branch 'install_37_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_37_STABLE 2020-02-07 09:44:49 +01:00
Brendan Heywood 867d9497f3 MDL-67726 tool_phpunit: add missing input escaping 2020-02-06 19:45:50 +01:00
Andrew Nicols a9895627a4 Merge branch 'MDL-67175-37' of git://github.com/ferranrecio/moodle into MOODLE_37_STABLE 2020-02-06 10:21:33 +08:00
Eloy Lafuente (stronk7) 1a75be0645 Merge branch 'MDL-67832_37' of https://github.com/timhunt/moodle into MOODLE_37_STABLE
(fixed a couple of typos in the merge commit)
2020-02-06 00:03:16 +01:00
Eloy Lafuente (stronk7) 53c3b1bacc Merge branch 'MDL-67732-37' of https://github.com/paulholden/moodle into MOODLE_37_STABLE 2020-02-05 20:05:58 +01:00
Eloy Lafuente (stronk7) 730714bc78 Merge branch 'MDL-67830_37' of https://github.com/timhunt/moodle into MOODLE_37_STABLE 2020-02-05 19:08:25 +01:00
Tim Hunt 4a0abc17d4 MDL-67876 forms: scroll to any invalid element if form cannot submit 2020-02-05 12:22:12 +00:00
Andrew Nicols 7eaadb4bdb Merge branch 'MDL-49103-37' of git://github.com/sarjona/moodle into MOODLE_37_STABLE 2020-02-05 13:52:36 +08:00
Eloy Lafuente (stronk7) 2f88edd0c9 Merge branch 'MDL-67842_37' of https://github.com/timhunt/moodle into MOODLE_37_STABLE 2020-02-04 22:46:37 +01:00
Eloy Lafuente (stronk7) 03721f06fb Merge branch 'MDL-63424-37' of git://github.com/lucaboesch/moodle into MOODLE_37_STABLE 2020-02-04 19:28:53 +01:00
Eloy Lafuente (stronk7) c0b25af986 Merge branch 'MDL-66875-37' of git://github.com/lucaboesch/moodle into MOODLE_37_STABLE 2020-02-04 19:02:41 +01:00
Sara Arjona d869324747 MDL-49103 badges: bake badges with iTXt chunk instead of tEXt
The final OB 1.0 specification changed the baking badges method
from tEXt to iTXt. Besides, the iTXt chunk should be a signed
assertion or the raw JSON (instead of the assertion URL).
This has been changed in order to make Moodle OB compliant.

Yuliya Bozhko, thanks for the patch! :-)
2020-02-04 18:49:55 +01:00
Ferran Recio 1b1cf1b950 MDL-67175 mod_scorm: fixing js eslint errors 2020-02-04 12:37:31 +01:00
Sam Hemelryk d66d85a4d7 MDL-67175 mod_scorm: sync XHR requests use sendBeacon when available
Totara reference TL-22621 (original code by Sam Hemelryk)
https://github.com/moodle/moodle/commit/2add402f8183c50bc1238ef2da5ea9cd06cb1dd9
2020-02-04 12:37:31 +01:00
Brendan Cox 67d4f4ea65 MDL-67175 session: set SameSite=None for Chrome 78 and above
Totara reference TL-22311 (original code by Brendan Cox and Sam Hemelryk)
https://github.com/moodle/moodle/commit/a3f4de2b7efe66de6617a67ce7c87f2862e76ac6
2020-02-04 12:37:15 +01:00
Andrew Nicols fe1b4bee20 Merge branch 'MDL-60126-37-3' of git://github.com/mihailges/moodle into MOODLE_37_STABLE 2020-02-04 14:40:48 +08:00
Peter 6292c6299b MDL-60126 competency: Unit tests 2020-02-04 08:55:51 +08:00
Simey Lameze 22177c5c3e MDL-60126 core: upgrade step to clean user comp 2020-02-04 08:55:42 +08:00
Simey Lameze 9f2e264fd8 MDL-60126 competency: delete content upon user delete 2020-02-04 08:40:31 +08:00
AMOS bot e1b1a447b5 Automatically generated installer lang files 2020-02-04 00:11:23 +00:00
Peter Eliyahu Kornfeld eaf2d6a809 MDL-66834 Questions: add transaction, move trigger 2020-02-03 12:26:36 +02:00
Tim Hunt a8e2b5cea1 MDL-67842 questions: Cannot remove the idnumber from a question 2020-02-03 09:49:50 +00:00
Tim Hunt 7fda2e9bac MDL-67832 quiz: fix lots of PHPdoc in attemptlib.php 2020-01-31 19:09:44 +00:00
Paul Holden ea01c38f2c MDL-67732 group: observe viewfullnames capability.
Backport from MDL-67245.
2020-01-31 16:48:15 +00:00
Eloy Lafuente (stronk7) ee0a8161dd weekly release 3.7.4+ 2020-01-30 16:11:20 +01:00
Eloy Lafuente (stronk7) 8adff28414 Merge branch 'install_37_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_37_STABLE 2020-01-30 16:11:17 +01:00
Jun Pataleta 020810aea0 Merge branch 'MDL-67353_reset_37' of https://github.com/stronk7/moodle into MOODLE_37_STABLE 2020-01-30 12:35:00 +08:00
Eloy Lafuente (stronk7) 56930d1d67 MDL-67353 course: move form tearDown() to reset_all_data()
We are already cleaning all sort of caches, statics, singletons
there and it's better to ensure they are always reset to avoid
myterious failures @ distance.
2020-01-30 00:02:03 +01:00
Michelle Melton 2ec76277dc MDL-64169 course: fix padding when display on one section per page
(amended to keep the $o.= consistent with surrounding code)
2020-01-29 22:36:16 +01:00
Tim Hunt bfff57b297 MDL-67830 quiz: notice in grade details redirect script 2020-01-29 18:35:17 +00:00
Jun Pataleta 5e7c5b9cec Merge branch 'MDL-67626_37' of git://github.com/adpe/moodle into MOODLE_37_STABLE 2020-01-29 21:36:41 +08:00
Adrian Greeve caa236c415 Merge branch 'MDL-67768-37-componentdirs' of git://github.com/mudrd8mz/moodle into MOODLE_37_STABLE 2020-01-29 10:04:13 +08:00
Eloy Lafuente (stronk7) 52a77683aa Merge branch 'MDL-67472-37' of git://github.com/bmbrands/moodle into MOODLE_37_STABLE 2020-01-28 22:59:36 +01:00
Eloy Lafuente (stronk7) 6afb3736f8 Merge branch 'MDL-52189_37' of https://github.com/jonof/moodle into MOODLE_37_STABLE 2020-01-28 22:45:34 +01:00
Eloy Lafuente (stronk7) 96582b63db Merge branch 'MDL-67447-37-autocomplete' of git://github.com/mudrd8mz/moodle into MOODLE_37_STABLE 2020-01-28 22:24:43 +01:00
Eloy Lafuente (stronk7) a5e149a1b7 Merge branch 'MDL-67722-37' of git://github.com/mickhawkins/moodle into MOODLE_37_STABLE 2020-01-28 20:13:52 +01:00
Eloy Lafuente (stronk7) 7cf3a406ff Merge branch 'MDL-57755_37' of https://github.com/t-schroeder/moodle into MOODLE_37_STABLE 2020-01-28 10:35:07 +01:00
David Mudrák 25d1533b27 MDL-67768 core: Add some common dirs to core_component::$ignoreddirs
The core_component::$ignoreddirs lists all directories that are reserved
and cannot be used as valid plugin names. This is particularly important
for some plugin types such as 'webservice' that share the same root
location as the core subsystem of the same name.
2020-01-28 10:34:38 +01:00
Adrian Greeve 462c6e9e2c Merge branch 'MDL-67740-37-behatstepsfilter' of git://github.com/mudrd8mz/moodle into MOODLE_37_STABLE 2020-01-28 15:08:59 +08:00
Adrian Greeve 1db5a1205e Merge branch 'MOODLE_37_MDL-67746' of https://github.com/golenkovm/moodle into MOODLE_37_STABLE 2020-01-28 13:14:55 +08:00
AMOS bot c3c7b02867 Automatically generated installer lang files 2020-01-28 00:11:49 +00:00
Adrian Greeve 7d1af3ec1d Merge branch 'MDL-67691_37' of https://github.com/stronk7/moodle into MOODLE_37_STABLE 2020-01-28 07:54:31 +08:00
Eloy Lafuente (stronk7) 5efefd458e Merge branch 'MDL-64531-37-questiondeletejson' of git://github.com/mudrd8mz/moodle into MOODLE_37_STABLE 2020-01-27 17:08:20 +01:00
Eloy Lafuente (stronk7) ebc198cfb8 Merge branch 'MDL-67577-37' of git://github.com/bmbrands/moodle into MOODLE_37_STABLE 2020-01-27 16:20:26 +01:00
Eloy Lafuente (stronk7) 1c348b2e8d Merge branch 'm37_MDL-67414_Add_PostgreSQL_12x_Support' of https://github.com/scara/moodle into MOODLE_37_STABLE 2020-01-27 12:16:27 +01:00
Bas Brands f18444a5d1 MDL-67577 core_message: navbar_output order
* moved the logic from core_message_popup_render_navbar_output to
message_popup_render_navbar_output in message/output/popup/lib.php

* using float: left instead of float: right in theme
2020-01-27 12:15:26 +01:00
Tim Schroeder 6fd48eff30 MDL-57755 message: fix notificaiton read status when messaging disabled 2020-01-27 09:17:31 +01:00
Matteo Scaramuccia 68082ac364 MDL-67414 adodb: Backport upstream fix for PostgreSQL 12.x
Upstream: https://github.com/ADOdb/ADOdb/commit/a4876f100602c2ce4760bb72d3050f73387adcca
          pgsql: stop using obsolete pg_attrdef.adsrc column
2020-01-26 09:42:24 +01:00
Matteo Scaramuccia 9edebd4951 MDL-67414 database: Fixed PostgreSQL 12.x support 2020-01-26 09:42:24 +01:00
David Mudrák adfe298af8 MDL-67447 form: Fix the duplicate autocomplete selection node
When the autocomplete selection is updated, the content of the selection
wrapper is replaced with the new list of selected items. We must replace
only the content of the selection wrapper and not to nest it into
itself.
2020-01-25 05:45:39 +01:00
AMOS bot cd6c7e0068 Automatically generated installer lang files 2020-01-25 00:11:49 +00:00
Luca Bösch d11806d957 MDL-66875 calendar: allow the use of day, mon and year again. 2020-01-25 01:01:45 +01:00
Luca Bösch 6a5c1ab6f8 MDL-63424 form: allow checkboxes to have req icon. 2020-01-24 17:38:11 +01:00
Eloy Lafuente (stronk7) e453665f7d MDL-67353 filters: fix filterlib tests
- move resetAfterTest() to test units.
- remove setUp(), moving code to remove_all_filters_from_config().
- remove class properties, moving to return values of own setup_xxx() methods.
2020-01-24 11:27:05 +01:00
Eloy Lafuente (stronk7) 3f73b4f487 MDL-67353 favourites: Random DB id matching solved
Depending on the tests executed it was possible to arrive
to favourites tests with 2 "concepts" (say userid and contextid,
or userid and itemid) having the same ID.

Then, the array_diff() operations used by some mock stuff in the
tests wrongly was returning matches by value, ultimately causing
the test to fail.

Now, the matching is performed using array_diff_assoc() that takes
keys into considation when performing the match.
2020-01-24 11:27:05 +01:00
Andrew Nicols 4dbc8e7655 MDL-67353 course: Fix more broken unit tests 2020-01-24 11:27:05 +01:00
Andrew Nicols 1fb38c5cf6 MDL-67353 course: Fix broken unit test 2020-01-24 11:27:05 +01:00
David Mudrák 71b452912a MDL-67740 behat: Show info as collapsed at the acceptance testing page
The static information with the links to Behat documentation is quite
long an irrelevant for experienced developers returning to this page. No
need to waste the prominent screen place with it - better to offer it
only when needed via collapsible form section.
2020-01-24 10:44:40 +01:00
David Mudrák 1c9edf3920 MDL-67740 behat: Improve the layout of the acceptance testing page
- The CSS contains more specific selectors.
- Make use of the whole screen width for the list of found steps.
- Visually distinguish found steps from each other.
- Make it look less like a unicorn rainbow.
2020-01-24 10:44:39 +01:00
David Mudrák c4f7a4bc62 MDL-67740 behat: Fix the name of the class in the inline documentation
The said class is provided by the moodlehq/behat-extension composer
package and was renamed as a part of upgrade to Behat 3.0.x (MDL-46891).
2020-01-24 10:44:39 +01:00
David Mudrák 9d72d1a9e6 MDL-67740 behat: Allow multiple words filter at acceptance testing page
Because of the too strict input param type, the form did not allow to
search for Behat steps containing the given phrase. The patch sets the
param type to match the one in the form definition, and makes sure that
the submitted value can be safely used as a CLI script argument.
2020-01-24 10:44:38 +01:00
Mikhail Golenkov 198b653bf7 MDL-67746 Tasks: Cleanup task logs in chunks. 2020-01-24 13:59:04 +11:00
Adrian Greeve 77a359ca7b weekly release 3.7.4+ 2020-01-24 10:17:27 +08:00
Adrian Greeve bf1e44117b Merge branch 'install_37_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_37_STABLE 2020-01-24 10:17:18 +08:00
Eloy Lafuente (stronk7) f8df624e37 Merge branch 'MDL-51225-37' of git://github.com/junpataleta/moodle into MOODLE_37_STABLE 2020-01-23 11:14:27 +01:00
Jun Pataleta 704c30b1fb MDL-51225 mod_forum: Revert @javascript tag removal
Put back the removed  @javascript tag to prevent random goutte
fails.
2020-01-23 15:32:59 +08:00
Jun Pataleta a178e09bfb Merge branch 'MDL-65952_m37' of https://github.com/fabiendallet/moodle into MOODLE_37_STABLE 2020-01-23 10:43:32 +08:00
Jun Pataleta 48096011e3 Merge branch 'MDL-66897-37-1' of git://github.com/mihailges/moodle into MOODLE_37_STABLE 2020-01-22 23:16:56 +08:00
Mihail Geshoski 7ef572d39e MDL-66897 mod_assign: Properly display error messages in quick grading 2020-01-22 13:52:08 +08:00
Adrian Greeve 75ab679716 Merge branch 'MDL-67653_37' of https://github.com/timhunt/moodle into MOODLE_37_STABLE 2020-01-22 11:05:17 +08:00
Adrian Greeve 2dc1afe547 Merge branch 'MDL-67660-37-v2' of https://github.com/TobiGa/moodle into MOODLE_37_STABLE 2020-01-22 10:43:24 +08:00
Jun Pataleta 115f4461ce Merge branch 'MDL-67684-37' of git://github.com/andrewnicols/moodle into MOODLE_37_STABLE 2020-01-22 10:37:34 +08:00
Colin Campbell c0cf6abf34 MDL-52189 file: skip deleting temp files that appear during cleanup 2020-01-22 12:07:57 +10:00
Adrian Greeve ff6ea1e369 Merge branch 'MDL-67656-37' of git://github.com/andrewnicols/moodle into MOODLE_37_STABLE 2020-01-22 09:47:01 +08:00
Eloy Lafuente (stronk7) c5c42e96d2 Merge branch 'MDL-66858_37' of https://github.com/stronk7/moodle into MOODLE_37_STABLE 2020-01-22 01:57:39 +01:00
Michael Milette 39fd21e4ff MDL-66858 master: Enable <header> tags in Atto editor.
(amended to add the src/editor/js/clean.js
file that was originally missing)
2020-01-22 00:12:55 +01:00
Eloy Lafuente (stronk7) 49f70858e9 Merge branch 'MDL-51225-37' of git://github.com/junpataleta/moodle into MOODLE_37_STABLE 2020-01-21 23:40:32 +01:00
Adrian Greeve 64d75c9a1a Merge branch 'MDL-66237-37' of git://github.com/mickhawkins/moodle into MOODLE_37_STABLE 2020-01-21 11:24:01 +08:00
Jun Pataleta 695499c681 Merge branch 'MDL-66108-37' of https://github.com/paulholden/moodle into MOODLE_37_STABLE 2020-01-21 09:50:47 +08:00
Eloy Lafuente (stronk7) d8c3b7e662 Merge branch 'MDL-66024-37' of https://github.com/paulholden/moodle into MOODLE_37_STABLE 2020-01-20 22:48:42 +01:00
Eloy Lafuente (stronk7) 6adc5e89b0 Merge branch 'MDL-66220-37' of git://github.com/junpataleta/moodle into MOODLE_37_STABLE 2020-01-20 22:34:34 +01:00
Eloy Lafuente (stronk7) c9eeb1a7c1 Merge branch 'MDL-66712-37-selfautounenrol' of git://github.com/mudrd8mz/moodle into MOODLE_37_STABLE 2020-01-20 22:29:11 +01:00
Eloy Lafuente (stronk7) 68e4a7dac8 Merge branch 'MDL-65884-37' of https://github.com/paulholden/moodle into MOODLE_37_STABLE 2020-01-20 20:37:00 +01:00
David Mudrák 73bbb3e7a8 MDL-64531 course: Add Behat test for deleting a quiz with own questions
Teachers can delete Quiz activities that have a question in their own
context via AJAX request with the course recycle bin disabled. This used
to lead to "Unexpected token < in JSON" because of the extra HTML in the
output.
2020-01-20 18:19:45 +01:00
Tim Hunt d00045e8f5 MDL-64531 course: course_delete_module shouldn't output during AJAX
Committer's note: This change was originally part of a bigger patchset
submitted by the author. This is a stripped-down version that does not
use phpunit tests for the new behaviour.
2020-01-20 18:07:25 +01:00
Eloy Lafuente (stronk7) 7a8b3702e3 Merge branch 'MDL-67724-37' of git://github.com/junpataleta/moodle into MOODLE_37_STABLE 2020-01-20 10:53:37 +01:00
Sara Arjona 887f9c3fc6 Merge branch 'MDL-67312-37' of git://github.com/lameze/moodle into MOODLE_37_STABLE 2020-01-20 08:05:16 +01:00
Adrian Greeve 28b0d9256f Merge branch 'MDL-67583-37' of https://github.com/KietChan/moodle into MOODLE_37_STABLE 2020-01-20 13:40:27 +08:00
Simey Lameze 2e6729e923 MDL-67312 core_user: clean subs events on user deletion 2020-01-20 08:54:32 +08:00
Simey Lameze d3a2788437 MDL-67312 calendar: upgrade step to delete orphaned events 2020-01-20 08:54:30 +08:00
Simey Lameze c04559ccb6 MDL-67312 core: change db upgrade step to use get_fieldset_sql 2020-01-20 08:52:59 +08:00
Eloy Lafuente (stronk7) a6e4fbe122 MDL-67691 behat: inform about the_following_exist() removal
behat_data_generators::the_following_exist() has been removed, please use
behat_data_generators::the_following_entities_exist() instead.

See MDL-67691 for more info.
2020-01-20 00:13:01 +01:00
Adrian Perez c1ed11df7a MDL-67626 assign: fix view full/view summary control in IE 2020-01-18 14:16:30 +01:00
AMOS bot 1edd36e905 Automatically generated installer lang files 2020-01-18 00:10:56 +00:00
fdallet 91aee9939b MDL-65952 mod_scorm: Fix unwanted changes to require status 2020-01-17 17:25:03 +01:00
Paul Holden a585ee9432 MDL-66108 course: fix false positives when bulk moving categories. 2020-01-17 16:19:26 +00:00
Jun Pataleta bb0acb3e9c MDL-67724 mod_glossary: Improve Behat test
Improve the "Glossary entries are not always editable" scenario by:
* No need to use the @javascript tag
* The maxediting time can be set to a lower value to
reduce the overall wait time.
2020-01-17 17:48:06 +08:00
Tobias Garske 02f08b16c5 MDL-67660 core_message: Messages search change input focus 2020-01-17 09:39:11 +01:00
Michael Hawkins e206c3b8f2 MDL-67722 mod_forum: Reduce wait time on time limit expires behat test 2020-01-17 15:46:56 +08:00
Jun Pataleta 3246d41cb2 MDL-51225 mod_forum: Use can_view_post to determine whether to show post
Use \mod_forum\local\managers\capability::can_view_post() to
consistently determine whether a forum post will be rendered in the
recent activity block.
This helps the recent activity block to provide a more consistent
behaviour with the forum's discussion view itself.
2020-01-17 14:51:47 +08:00
Jun Pataleta 8594f5e8ae MDL-51225 mod_forum: Create behat tests for forum recent activity 2020-01-17 14:45:36 +08:00
Jun Pataleta c0842ca500 MDL-51225 mod_forum: New behat step for creating question discussion 2020-01-17 14:45:36 +08:00
AMOS bot c670210a1d Automatically generated installer lang files 2020-01-17 00:12:28 +00:00
Sara Arjona fd908d09fd weekly release 3.7.4+ 2020-01-16 17:19:15 +01:00
Sara Arjona d859e8774c Merge branch 'install_37_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_37_STABLE 2020-01-16 17:19:13 +01:00
David Mudrák a86318bd92 MDL-66712 enrol: Fix the reported days of inactivity on unenrolment
There were two problems here. Firstly, the $days was not correctly
calculated due to missing parentheses. Secondly, the sentence had
grammar issues.
2020-01-16 13:44:31 +01:00
Jun Pataleta 77b19b828b MDL-66220 mod_forum: Prevent from replying to a post the user can't see 2020-01-16 15:06:25 +08:00
Jun Pataleta d046109d4d MDL-66220 mod_forum: Cache result of forum_user_can_see_post()
* Cache the result of this function to avoid doing multiple DB calls
for the same post when loading posts in a discussion.
2020-01-16 15:06:25 +08:00
Jun Pataleta bc8d03c68d MDL-66220 mod_forum: Additional unit test for can_reply_to_post 2020-01-16 15:06:25 +08:00
Andrew Nicols f394d9efae Merge branch 'wip-MDL-66918-37stable' of https://github.com/Beedell/moodle into MOODLE_37_STABLE 2020-01-16 11:44:38 +08:00
Eloy Lafuente (stronk7) b67c73c86b Merge branch 'MDL-67625-37' of git://github.com/lucaboesch/moodle into MOODLE_37_STABLE 2020-01-16 00:27:06 +01:00
Sara Arjona 9941fbdae4 Merge branch 'MDL-67617-37' of git://github.com/lucaboesch/moodle into MOODLE_37_STABLE 2020-01-15 12:43:19 +01:00
Sara Arjona aa23048889 Merge branch 'MDL-67638-37' of https://github.com/nguyenphuctien/moodle into MOODLE_37_STABLE 2020-01-15 12:20:00 +01:00
Andrew Nicols c4b8e4ca14 Merge branch 'MDL-67486-swap-cron-lock-MOODLE_37_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_37_STABLE 2020-01-15 13:54:26 +08:00
Mark Johnson e5ec4988b6 MDL-67674 Cache: Lock rebuilding of the course category tree cache 2020-01-15 00:02:22 +01:00
Sara Arjona 35ce17025a Merge branch 'MDL-65573-37-2' of git://github.com/peterRd/moodle into MOODLE_37_STABLE 2020-01-14 12:20:59 +01:00
Andrew Nicols fc1ddb3289 Merge branch 'MDL-66721-37' of git://github.com/bmbrands/moodle into MOODLE_37_STABLE 2020-01-14 14:10:39 +08:00
Andrew Nicols 85b9cf9ce4 MDL-67684 core: Add missing li tag 2020-01-14 08:47:20 +08:00
Andrew Nicols 05bb501b4f Merge branch 'MDL-35971-37' of git://github.com/junpataleta/moodle into MOODLE_37_STABLE 2020-01-14 08:33:48 +08:00
AMOS bot 116d41cdfd Automatically generated installer lang files 2020-01-14 00:10:31 +00:00
Peter a5cff8a55b MDL-65573 mod_forum: Set userid properly after split
* Set the discussion's userid properly when splitting a discussion.
* Update step to correct existing incorrect records.
2020-01-14 07:42:19 +08:00
Eloy Lafuente (stronk7) 06e0263936 Merge branch 'MDL-65649-37' of https://github.com/paulholden/moodle into MOODLE_37_STABLE 2020-01-13 18:57:02 +01:00
Eloy Lafuente (stronk7) de98c397f3 Merge branch 'MDL-65987-37' of git://github.com/andrewnicols/moodle into MOODLE_37_STABLE 2020-01-13 18:42:26 +01:00
Sara Arjona f091f67f81 Merge branch 'MDL-59817-37' of git://github.com/andrewnicols/moodle into MOODLE_37_STABLE 2020-01-13 14:27:01 +01:00
Kiet Chan 7cfbdd0422 MDL-67583 themes: Popover placement should react to scroll event 2020-01-13 17:27:31 +07:00
Bas Brands 089100fdb3 MDL-67472 theme_boost: configurable sass variable for drawer bgcolour 2020-01-13 09:16:44 +01:00
Tien Nguyen Phuc 68e85534a8 MDL-67638 Course: update course timemodified on bulk category move 2020-01-13 10:41:36 +07:00
Andrew Nicols 0f41a0280d Merge branch 'MDL-67204-37' of https://github.com/mwehr/moodle into MOODLE_37_STABLE 2020-01-13 08:54:46 +08:00
Brendan Heywood fd9466fceb MDL-67486 cron: Improve throughput by holding cron lock for less time 2020-01-12 00:48:25 +11:00
Tim Hunt 6cb1f99459 MDL-67653 questions: prevent the flag flickering as the page loads 2020-01-10 14:28:34 +00:00
Andrew Nicols 8bc3576bb3 MDL-59817 atto_accessibilitychecker: Handle transparency properly
Some browsers, notably Firefox, do not return the computed style for
background colour in a computed RGB format. Instead they return the RGBA
where the alpha channel is set to fully transparent.

To solve this we need to work up the hierarchy and compute the
background colour for each parent node until we reach full alpha (1).

We can use a standard calculation to approximate the value for the
resultant element background by multiplying the alpha of the current
transparent (or semi-transparent) node with the R, G, or B channel in
question, and that of the parent node's background colour.

There are cases where this will not be 100% accurate - notably where
there is some additional content in addition to the parent background,
but this gives us a reasoable approximation for the majority of cases.
Additionally the code has never considered the full set of node content
when calculating this information.
2020-01-10 15:26:51 +08:00
Andrew Nicols 4158b39809 MDL-67656 behat: Removed nested spin 2020-01-10 13:40:32 +08:00
Andrew Nicols c7afe02401 MDL-67656 behat: Fix usleep call in spin 2020-01-10 13:40:31 +08:00
Luca Bösch 37524fa1e6 MDL-67625 quiz: only section titles should be large when editing. 2020-01-09 17:23:02 +01:00
Luca Bösch 44c7386d16 MDL-67617 gradereport_singleview: Style the form element with bs classes 2020-01-09 17:22:09 +01:00
Mario Wehr c3f4abed6f MDL-67204 assign task: Use lastruntime from task_scheduled 2020-01-09 17:12:34 +01:00
John Beedell 2acb24d84e MDL-66918 behat: Behat app step failing 2020-01-09 15:59:25 +00:00
Jun Pataleta 6783597dc0 MDL-35971 mod_forum: Add proper discussion list table description 2020-01-08 15:45:47 +08:00
Paul Holden 8c3f81aa69 MDL-66237 message_popup: Get redirecturl from notification contexturl 2020-01-07 11:24:37 +08:00
Bas Brands 3dd509b06b MDL-66721 core_chooser: height correction for chooser modal 2020-01-06 10:13:19 +01:00
Luca Bösch da1a4189e1 MDL-65987 mod_forum: Add string 'Advanced' for the advanced editor.
AMOS BEGIN
    CPY [advanced,moodle],[showadvancededitor,moodle]
   AMOS END
2020-01-06 09:41:23 +08:00
Paul Holden 213abaaf97 MDL-65649 backup: ensure valid course URL for async mode. 2019-12-09 23:34:37 +00:00
Paul Holden 9e9c0912e3 MDL-66024 tool_uploadcourse: validate shortname/fullname field length. 2019-12-05 23:11:14 +00:00
Paul Holden ad7d0f05de MDL-65884 filters: update exclusive separator characters for tags.
The previous characters mangled the output of filtered text, exhibited
in the activity names filter for activities named '-' (single hyphen).
2019-06-12 17:10:21 +01:00
451 changed files with 10124 additions and 3732 deletions
+1
View File
@@ -65,6 +65,7 @@ lib/validateurlsyntax.php
lib/amd/src/popper.js
lib/geopattern-php/
lib/php-jwt/
lib/mdn-polyfills/
media/player/videojs/amd/src/video-lazy.js
media/player/videojs/amd/src/Youtube-lazy.js
media/player/videojs/videojs/
+1
View File
@@ -66,6 +66,7 @@ lib/validateurlsyntax.php
lib/amd/src/popper.js
lib/geopattern-php/
lib/php-jwt/
lib/mdn-polyfills/
media/player/videojs/amd/src/video-lazy.js
media/player/videojs/amd/src/Youtube-lazy.js
media/player/videojs/videojs/
+3 -3
View File
@@ -2,8 +2,6 @@
# process (which uses our internal CI system) this file is here for the benefit
# of community developers git clones - see MDL-51458.
sudo: required
# We currently disable Travis notifications entirely until https://github.com/travis-ci/travis-ci/issues/4976
# is fixed.
notifications:
@@ -11,6 +9,8 @@ notifications:
language: php
os: linux
dist: xenial
services:
@@ -41,7 +41,7 @@ env:
# Perform an upgrade test too.
- DB=pgsql TASK=UPGRADE
matrix:
jobs:
# Enable fast finish.
# This will fail the build if a single job fails (except those in allow_failures).
# It will not stop the jobs from running.
+30 -13
View File
@@ -112,7 +112,13 @@ module.exports = function(grunt) {
eslint: {
// Even though warnings dont stop the build we don't display warnings by default because
// at this moment we've got too many core warnings.
options: {quiet: !grunt.option('show-lint-warnings')},
// To display warnings call: grunt eslint --show-lint-warnings
// To fail on warnings call: grunt eslint --max-lint-warnings=0
// Also --max-lint-warnings=-1 can be used to display warnings but not fail.
options: {
quiet: (!grunt.option('show-lint-warnings')) && (typeof grunt.option('max-lint-warnings') === 'undefined'),
maxWarnings: ((typeof grunt.option('max-lint-warnings') !== 'undefined') ? grunt.option('max-lint-warnings') : -1)
},
amd: {src: amdSrc},
// Check YUI module source files.
yui: {src: ['**/yui/src/**/*.js', '!*/**/yui/src/*/meta/*.js']}
@@ -151,6 +157,9 @@ module.exports = function(grunt) {
tasks: ['yui']
},
gherkinlint: {
options: {
nospawn: false,
},
files: ['**/tests/behat/*.feature'],
tasks: ['gherkinlint']
}
@@ -293,19 +302,27 @@ module.exports = function(grunt) {
};
tasks.gherkinlint = function() {
var done = this.async(),
options = grunt.config('gherkinlint.options');
const done = this.async();
const options = grunt.config('gherkinlint.options');
var args = grunt.file.expand(options.files);
args.unshift(path.normalize(__dirname + '/node_modules/.bin/gherkin-lint'));
grunt.util.spawn({
cmd: 'node',
args: args,
opts: {stdio: 'inherit', env: process.env}
}, function(error, result, code) {
// Propagate the exit code.
done(code === 0);
});
// Grab the gherkin-lint linter and required scaffolding.
const linter = require('gherkin-lint/src/linter.js');
const featureFinder = require('gherkin-lint/src/feature-finder.js');
const configParser = require('gherkin-lint/src/config-parser.js');
const formatter = require('gherkin-lint/src/formatters/stylish.js');
// Run the linter.
const results = linter.lint(
featureFinder.getFeatureFiles(grunt.file.expand(options.files)),
configParser.getConfiguration(configParser.defaultConfigFileName)
);
// Print the results out uncondtionally.
formatter.printResults(results);
// Report on the results.
// The done function takes a bool whereby a falsey statement causes the task to fail.
done(results.every(result => result.errors.length === 0));
};
tasks.startup = function() {
+25 -8
View File
@@ -226,7 +226,7 @@ if (!core_tables_exist()) {
}
if (empty($confirmrelease)) {
require_once($CFG->libdir.'/environmentlib.php');
list($envstatus, $environment_results) = check_moodle_environment(normalize_version($release), ENV_SELECT_RELEASE);
list($envstatus, $environmentresults) = check_moodle_environment(normalize_version($release), ENV_SELECT_RELEASE);
$strcurrentrelease = get_string('currentrelease');
$PAGE->navbar->add($strcurrentrelease);
@@ -235,7 +235,7 @@ if (!core_tables_exist()) {
$PAGE->set_cacheable(false);
$output = $PAGE->get_renderer('core', 'admin');
echo $output->install_environment_page($maturity, $envstatus, $environment_results, $release);
echo $output->install_environment_page($maturity, $envstatus, $environmentresults, $release);
die();
}
@@ -358,9 +358,9 @@ if (!$cache and $version > $CFG->version) { // upgrade
echo $output->upgrade_confirm_page($a->newversion, $maturity, $testsite);
die();
} else if (empty($confirmrelease)){
} else if (empty($confirmrelease)) {
require_once($CFG->libdir.'/environmentlib.php');
list($envstatus, $environment_results) = check_moodle_environment($release, ENV_SELECT_RELEASE);
list($envstatus, $environmentresults) = check_moodle_environment($release, ENV_SELECT_RELEASE);
$strcurrentrelease = get_string('currentrelease');
$PAGE->navbar->add($strcurrentrelease);
@@ -368,7 +368,7 @@ if (!$cache and $version > $CFG->version) { // upgrade
$PAGE->set_heading($strcurrentrelease);
$PAGE->set_cacheable(false);
echo $output->upgrade_environment_page($release, $envstatus, $environment_results);
echo $output->upgrade_environment_page($release, $envstatus, $environmentresults);
die();
} else if (empty($confirmplugins)) {
@@ -533,7 +533,10 @@ if (!$cache and $branch <> $CFG->branch) { // Update the branch
if (!$cache and moodle_needs_upgrading()) {
$PAGE->set_url(new moodle_url($PAGE->url, array('confirmplugincheck' => $confirmplugins)));
$PAGE->set_url(new moodle_url($PAGE->url, array(
'confirmrelease' => $confirmrelease,
'confirmplugincheck' => $confirmplugins,
)));
check_upgrade_key($upgradekeyhash);
@@ -543,7 +546,21 @@ if (!$cache and moodle_needs_upgrading()) {
$pluginman = core_plugin_manager::instance();
$output = $PAGE->get_renderer('core', 'admin');
if (!$confirmplugins) {
if (empty($confirmrelease)) {
require_once($CFG->libdir . '/environmentlib.php');
list($envstatus, $environmentresults) = check_moodle_environment($release, ENV_SELECT_RELEASE);
$strcurrentrelease = get_string('currentrelease');
$PAGE->navbar->add($strcurrentrelease);
$PAGE->set_title($strcurrentrelease);
$PAGE->set_heading($strcurrentrelease);
$PAGE->set_cacheable(false);
echo $output->upgrade_environment_page($release, $envstatus, $environmentresults);
die();
} else if (!$confirmplugins) {
$strplugincheck = get_string('plugincheck');
$PAGE->navbar->add($strplugincheck);
@@ -802,7 +819,7 @@ $SESSION->admin_critical_warning = ($insecuredataroot==INSECURE_DATAROOT_ERROR);
$adminroot = admin_get_root();
// Check if there are any new admin settings which have still yet to be set
if (any_new_admin_settings($adminroot)){
if (any_new_admin_settings($adminroot)) {
redirect('upgradesettings.php');
}
+1 -1
View File
@@ -83,7 +83,7 @@ if (($form = data_submitted()) && confirm_sesskey()) {
}
} else {
$newsettings = array();
if (array_key_exists($componentprovidersetting, $form)) {
if (property_exists($form, $componentprovidersetting)) {
// We must be processing loggedin or loggedoff checkboxes.
// Store defained comma-separated processors as setting value.
// Using array_filter eliminates elements set to 0 above.
+1 -1
View File
@@ -45,7 +45,7 @@ $error = optional_param('error', '', PARAM_ALPHANUM);
admin_externalpage_setup('registrationmoodleorg');
if ($url !== HUB_MOODLEORGHUBURL) {
if (parse_url($url, PHP_URL_HOST) !== parse_url(HUB_MOODLEORGHUBURL, PHP_URL_HOST)) {
// Allow other plugins to confirm registration on custom hubs. Plugins implementing this
// callback need to redirect or exit. See https://docs.moodle.org/en/Hub_registration .
$callbacks = get_plugins_with_function('hub_registration');
+1 -1
View File
@@ -39,7 +39,7 @@ $token = optional_param('token', '', PARAM_TEXT);
admin_externalpage_setup('registrationmoodleorg');
if ($url !== HUB_MOODLEORGHUBURL) {
if (parse_url($url, PHP_URL_HOST) !== parse_url(HUB_MOODLEORGHUBURL, PHP_URL_HOST)) {
// Allow other plugins to renew registration on custom hubs. Plugins implementing this
// callback need to redirect or exit. See https://docs.moodle.org/en/Hub_registration .
$callbacks = get_plugins_with_function('hub_registration');
+49 -40
View File
@@ -361,14 +361,15 @@ class core_admin_renderer extends plugin_renderer_base {
$output = '';
if ($checker->enabled()) {
$output .= $this->container_start('checkforupdates');
$output .= $this->container_start('checkforupdates mb-4');
$output .= $this->single_button(
new moodle_url($reloadurl, array('fetchupdates' => 1)),
get_string('checkforupdates', 'core_plugin')
);
if ($timefetched = $checker->get_last_timefetched()) {
$timefetched = userdate($timefetched, get_string('strftimedatetime', 'core_langconfig'));
$output .= $this->container(get_string('checkforupdateslast', 'core_plugin', $timefetched), 'lasttimefetched');
$output .= $this->container(get_string('checkforupdateslast', 'core_plugin', $timefetched),
'lasttimefetched small text-muted mt-1');
}
$output .= $this->container_end();
}
@@ -823,7 +824,7 @@ class core_admin_renderer extends plugin_renderer_base {
}
}
$updateinfo .= $this->container_start('checkforupdates');
$updateinfo .= $this->container_start('checkforupdates mt-1');
$fetchurl = new moodle_url('/admin/index.php', array('fetchupdates' => 1, 'sesskey' => sesskey(), 'cache' => 0));
$updateinfo .= $this->single_button($fetchurl, get_string('checkforupdates', 'core_plugin'));
if ($fetch) {
@@ -912,7 +913,7 @@ class core_admin_renderer extends plugin_renderer_base {
*/
protected function moodle_available_update_info(\core\update\info $updateinfo) {
$boxclasses = 'moodleupdateinfo';
$boxclasses = 'moodleupdateinfo mb-2';
$info = array();
if (isset($updateinfo->release)) {
@@ -932,7 +933,8 @@ class core_admin_renderer extends plugin_renderer_base {
}
if (isset($updateinfo->download)) {
$info[] = html_writer::link($updateinfo->download, get_string('download'), array('class' => 'info download'));
$info[] = html_writer::link($updateinfo->download, get_string('download'),
array('class' => 'info download btn btn-secondary'));
}
if (isset($updateinfo->url)) {
@@ -940,9 +942,9 @@ class core_admin_renderer extends plugin_renderer_base {
array('class' => 'info more'));
}
$box = $this->output->box_start($boxclasses);
$box .= $this->output->box(implode(html_writer::tag('span', ' ', array('class' => 'separator')), $info), '');
$box .= $this->output->box_end();
$box = $this->output->container_start($boxclasses);
$box .= $this->output->container(implode(html_writer::tag('span', ' | ', array('class' => 'separator')), $info), '');
$box .= $this->output->container_end();
return $box;
}
@@ -1054,7 +1056,7 @@ class core_admin_renderer extends plugin_renderer_base {
$displayname = new html_table_cell(
$icon.
html_writer::span($plugin->displayname, 'pluginname').
html_writer::div($plugin->get_dir(), 'plugindir')
html_writer::div($plugin->get_dir(), 'plugindir text-muted small')
);
$versiondb = new html_table_cell($plugin->versiondb);
@@ -1089,7 +1091,7 @@ class core_admin_renderer extends plugin_renderer_base {
break;
case core_plugin_manager::PLUGIN_STATUS_NODB:
case core_plugin_manager::PLUGIN_STATUS_UPTODATE:
$statusclass .= $dependenciesok ? '' : 'badge-warning';
$statusclass .= $dependenciesok ? 'badge-light' : 'badge-warning';
break;
}
$status = html_writer::span(get_string('status_' . $statuscode, 'core_plugin'), $statusclass);
@@ -1099,7 +1101,7 @@ class core_admin_renderer extends plugin_renderer_base {
new moodle_url($this->page->url, array('abortinstall' => $plugin->component)),
get_string('cancelinstallone', 'core_plugin'),
'post',
array('class' => 'actionbutton cancelinstallone')
array('class' => 'actionbutton cancelinstallone d-block mt-1')
);
}
@@ -1108,7 +1110,7 @@ class core_admin_renderer extends plugin_renderer_base {
new moodle_url($this->page->url, array('abortupgrade' => $plugin->component)),
get_string('cancelupgradeone', 'core_plugin'),
'post',
array('class' => 'actionbutton cancelupgradeone')
array('class' => 'actionbutton cancelupgradeone d-block mt-1')
);
}
@@ -1178,7 +1180,7 @@ class core_admin_renderer extends plugin_renderer_base {
}
}
$out .= $this->output->container_start('actions');
$out .= $this->output->container_start('actions mb-2');
$installableupdates = $pluginman->filter_installable($pluginman->available_updates());
if ($installableupdates) {
@@ -1186,7 +1188,7 @@ class core_admin_renderer extends plugin_renderer_base {
new moodle_url($this->page->url, array('installupdatex' => 1)),
get_string('updateavailableinstallall', 'core_admin', count($installableupdates)),
'post',
array('class' => 'singlebutton updateavailableinstallall')
array('class' => 'singlebutton updateavailableinstallall mr-1')
);
}
@@ -1195,7 +1197,7 @@ class core_admin_renderer extends plugin_renderer_base {
new moodle_url($this->page->url, array('abortinstallx' => 1)),
get_string('cancelinstallall', 'core_plugin', count($installabortable)),
'post',
array('class' => 'singlebutton cancelinstallall')
array('class' => 'singlebutton cancelinstallall mr-1')
);
}
@@ -1204,15 +1206,17 @@ class core_admin_renderer extends plugin_renderer_base {
new moodle_url($this->page->url, array('abortupgradex' => 1)),
get_string('cancelupgradeall', 'core_plugin', count($upgradeabortable)),
'post',
array('class' => 'singlebutton cancelupgradeall')
array('class' => 'singlebutton cancelupgradeall mr-1')
);
}
$out .= html_writer::div(html_writer::link(new moodle_url($this->page->url, array('showallplugins' => 0)),
get_string('plugincheckattention', 'core_plugin')).' '.html_writer::span($sumattention, 'badge'));
get_string('plugincheckattention', 'core_plugin')).' '.html_writer::span($sumattention, 'badge badge-light'),
'btn btn-link mr-1');
$out .= html_writer::div(html_writer::link(new moodle_url($this->page->url, array('showallplugins' => 1)),
get_string('plugincheckall', 'core_plugin')).' '.html_writer::span($sumtotal, 'badge'));
get_string('plugincheckall', 'core_plugin')).' '.html_writer::span($sumtotal, 'badge badge-light'),
'btn btn-link mr-1');
$out .= $this->output->container_end(); // End of .actions container.
$out .= $this->output->container_end(); // End of #plugins-check-info container.
@@ -1280,12 +1284,13 @@ class core_admin_renderer extends plugin_renderer_base {
}
}
$out = $this->output->container_start('plugins-check-dependencies');
$out = $this->output->container_start('plugins-check-dependencies mb-4');
if ($unavailable or $unknown) {
$out .= $this->output->heading(get_string('misdepsunavail', 'core_plugin'));
if ($unknown) {
$out .= $this->output->notification(get_string('misdepsunknownlist', 'core_plugin', implode($unknown, ', ')));
$out .= $this->output->render((new \core\output\notification(get_string('misdepsunknownlist', 'core_plugin',
implode(', ', $unknown))))->set_show_closebutton(false));
}
if ($unavailable) {
$unavailablelist = array();
@@ -1299,18 +1304,18 @@ class core_admin_renderer extends plugin_renderer_base {
}
$unavailablelist[] = $unavailablelistitem;
}
$out .= $this->output->notification(get_string('misdepsunavaillist', 'core_plugin',
implode($unavailablelist, ', ')));
$out .= $this->output->render((new \core\output\notification(get_string('misdepsunavaillist', 'core_plugin',
implode(', ', $unavailablelist))))->set_show_closebutton(false));
}
$out .= $this->output->container_start('plugins-check-dependencies-actions');
$out .= $this->output->container_start('plugins-check-dependencies-actions mb-4');
$out .= ' '.html_writer::link(new moodle_url('/admin/tool/installaddon/'),
get_string('dependencyuploadmissing', 'core_plugin'));
get_string('dependencyuploadmissing', 'core_plugin'), array('class' => 'btn btn-secondary'));
$out .= $this->output->container_end(); // End of .plugins-check-dependencies-actions container.
}
if ($available) {
$out .= $this->output->heading(get_string('misdepsavail', 'core_plugin'));
$out .= $this->output->container_start('plugins-check-dependencies-actions');
$out .= $this->output->container_start('plugins-check-dependencies-actions mb-2');
$installable = $pluginman->filter_installable($available);
if ($installable) {
@@ -1318,12 +1323,13 @@ class core_admin_renderer extends plugin_renderer_base {
new moodle_url($this->page->url, array('installdepx' => 1)),
get_string('dependencyinstallmissing', 'core_plugin', count($installable)),
'post',
array('class' => 'singlebutton dependencyinstallmissing')
array('class' => 'singlebutton dependencyinstallmissing d-inline-block mr-1')
);
}
$out .= html_writer::div(html_writer::link(new moodle_url('/admin/tool/installaddon/'),
get_string('dependencyuploadmissing', 'core_plugin')), 'dependencyuploadmissing');
get_string('dependencyuploadmissing', 'core_plugin'), array('class' => 'btn btn-link')),
'dependencyuploadmissing d-inline-block mr-1');
$out .= $this->output->container_end(); // End of .plugins-check-dependencies-actions container.
@@ -1364,7 +1370,7 @@ class core_admin_renderer extends plugin_renderer_base {
if ($CFG->branch == str_replace('.', '', $moodle->release)) {
$supportedmoodles[] = html_writer::span($moodle->release, 'badge badge-success');
} else {
$supportedmoodles[] = html_writer::span($moodle->release, 'label');
$supportedmoodles[] = html_writer::span($moodle->release, 'badge badge-light');
}
}
@@ -1378,7 +1384,7 @@ class core_admin_renderer extends plugin_renderer_base {
}
$info = html_writer::div(
get_string('requiredby', 'core_plugin', implode(', ', $requriedby)),
'requiredby'
'requiredby mb-1'
);
} else {
$info = '';
@@ -1389,35 +1395,36 @@ class core_admin_renderer extends plugin_renderer_base {
$info .= html_writer::div(
html_writer::link('https://moodle.org/plugins/view.php?plugin='.$plugin->component,
get_string('misdepinfoplugin', 'core_plugin')),
'misdepinfoplugin'
'misdepinfoplugin d-inline-block mr-3 mb-1'
);
$info .= html_writer::div(
html_writer::link('https://moodle.org/plugins/pluginversion.php?id='.$plugin->version->id,
get_string('misdepinfoversion', 'core_plugin')),
'misdepinfoversion'
'misdepinfoversion d-inline-block mr-3 mb-1'
);
$info .= html_writer::div(html_writer::link($plugin->version->downloadurl, get_string('download')), 'misdepdownload');
$info .= html_writer::div(html_writer::link($plugin->version->downloadurl, get_string('download')),
'misdepdownload d-inline-block mr-3 mb-1');
if ($pluginman->is_remote_plugin_installable($plugin->component, $plugin->version->version, $reason)) {
$info .= $this->output->single_button(
new moodle_url($this->page->url, array('installdep' => $plugin->component)),
get_string('dependencyinstall', 'core_plugin'),
'post',
array('class' => 'singlebutton dependencyinstall')
array('class' => 'singlebutton dependencyinstall mr-3 mb-1')
);
} else {
$reasonhelp = $this->info_remote_plugin_not_installable($reason);
if ($reasonhelp) {
$info .= html_writer::div($reasonhelp, 'reasonhelp dependencyinstall');
$info .= html_writer::div($reasonhelp, 'reasonhelp dependencyinstall d-inline-block mr-3 mb-1');
}
}
$info .= $this->output->container_end(); // End of .actions container.
$table->data[] = array(
html_writer::div($plugin->name, 'name').' '.html_writer::div($plugin->component, 'component'),
html_writer::div($plugin->name, 'name').' '.html_writer::div($plugin->component, 'component text-muted small'),
$plugin->version->release,
$plugin->version->version,
implode($supportedmoodles, ' '),
@@ -1463,7 +1470,7 @@ class core_admin_renderer extends plugin_renderer_base {
foreach ($pluginman->resolve_requirements($plugin, $version) as $reqname => $reqinfo) {
if ($reqname === 'core') {
if ($reqinfo->status == $pluginman::REQUIREMENT_STATUS_OK) {
$class = 'requires-ok';
$class = 'requires-ok text-muted';
$label = '';
} else {
$class = 'requires-failed';
@@ -1480,7 +1487,7 @@ class core_admin_renderer extends plugin_renderer_base {
if ($reqinfo->status == $pluginman::REQUIREMENT_STATUS_OK) {
$label = '';
$class = 'requires-ok';
$class = 'requires-ok text-muted';
} else if ($reqinfo->status == $pluginman::REQUIREMENT_STATUS_MISSING) {
if ($reqinfo->availability == $pluginman::REQUIREMENT_AVAILABLE) {
@@ -1534,13 +1541,14 @@ class core_admin_renderer extends plugin_renderer_base {
return '';
}
$out = html_writer::tag('ul', implode("\n", $requires));
$out = html_writer::tag('ul', implode("\n", $requires), array('class' => 'm-0'));
if ($displayuploadlink) {
$out .= html_writer::div(
html_writer::link(
new moodle_url('/admin/tool/installaddon/'),
get_string('dependencyuploadmissing', 'core_plugin')
get_string('dependencyuploadmissing', 'core_plugin'),
array('class' => 'btn btn-secondary btn-sm m-1')
),
'dependencyuploadmissing'
);
@@ -1550,7 +1558,8 @@ class core_admin_renderer extends plugin_renderer_base {
$out .= html_writer::div(
html_writer::link(
new moodle_url($this->page->url, array('sesskey' => sesskey(), 'fetchupdates' => 1)),
get_string('checkforupdates', 'core_plugin')
get_string('checkforupdates', 'core_plugin'),
array('class' => 'btn btn-secondary btn-sm m-1')
),
'checkforupdates'
);
+4 -1
View File
@@ -97,7 +97,10 @@ $options = array(
GETREMOTEADDR_SKIP_HTTP_CLIENT_IP => 'HTTP_X_FORWARDED_FOR, REMOTE_ADDR',
GETREMOTEADDR_SKIP_HTTP_X_FORWARDED_FOR => 'HTTP_CLIENT, REMOTE_ADDR',
GETREMOTEADDR_SKIP_HTTP_X_FORWARDED_FOR|GETREMOTEADDR_SKIP_HTTP_CLIENT_IP => 'REMOTE_ADDR');
$temp->add(new admin_setting_configselect('getremoteaddrconf', new lang_string('getremoteaddrconf', 'admin'), new lang_string('configgetremoteaddrconf', 'admin'), 0, $options));
$temp->add(new admin_setting_configselect('getremoteaddrconf', new lang_string('getremoteaddrconf', 'admin'),
new lang_string('configgetremoteaddrconf', 'admin'),
GETREMOTEADDR_SKIP_HTTP_X_FORWARDED_FOR|GETREMOTEADDR_SKIP_HTTP_CLIENT_IP, $options));
$temp->add(new admin_setting_configtext('reverseproxyignore', new lang_string('reverseproxyignore', 'admin'), new lang_string('configreverseproxyignore', 'admin'), ''));
$temp->add(new admin_setting_heading('webproxy', new lang_string('webproxy', 'admin'), new lang_string('webproxyinfo', 'admin')));
$temp->add(new admin_setting_configtext('proxyhost', new lang_string('proxyhost', 'admin'), new lang_string('configproxyhost', 'admin'), '', PARAM_HOST));
+2 -1
View File
@@ -46,7 +46,8 @@ if ($data) {
$emailuser->email = $data->recipient;
$emailuser->id = -99;
$subject = get_string('testoutgoingmailconf_subject', 'admin', $SITE->fullname);
$subject = get_string('testoutgoingmailconf_subject', 'admin',
format_string($SITE->fullname, true, ['context' => context_system::instance()]));
$messagetext = get_string('testoutgoingmailconf_message', 'admin');
// Manage Moodle debugging options.
+1 -1
View File
@@ -32,7 +32,7 @@ require_once($CFG->libdir . '/behat/classes/behat_config_manager.php');
// systems, but let's allow room for expansion.
core_php_time_limit::raise(300);
$filter = optional_param('filter', '', PARAM_ALPHANUMEXT);
$filter = optional_param('filter', '', PARAM_NOTAGS);
$type = optional_param('type', false, PARAM_ALPHAEXT);
$component = optional_param('component', '', PARAM_ALPHAEXT);
+2 -2
View File
@@ -55,13 +55,13 @@ class tool_behat {
// The loaded steps depends on the component specified.
behat_config_manager::update_config_file($component, false);
// The Moodle\BehatExtension\HelpPrinter\MoodleDefinitionsPrinter will parse this search format.
// The Moodle\BehatExtension\Definition\Printer\ConsoleDefinitionInformationPrinter will parse this search format.
if ($type) {
$filter .= '&&' . $type;
}
if ($filter) {
$filteroption = ' -d "' . $filter . '"';
$filteroption = ' -d ' . escapeshellarg($filter);
} else {
$filteroption = ' -di';
}
+8 -17
View File
@@ -44,13 +44,9 @@ class tool_behat_renderer extends plugin_renderer_base {
global $CFG;
require_once($CFG->libdir . '/behat/classes/behat_selectors.php');
$html = $this->generic_info();
// Form.
ob_start();
$form->display();
$html .= ob_get_contents();
ob_end_clean();
$html = $this->output->header();
$html .= $this->output->heading(get_string('pluginname', 'tool_behat'));
$html .= $form->render();
if (empty($stepsdefinitions)) {
$stepsdefinitions = get_string('nostepsdefinitions', 'tool_behat');
@@ -128,7 +124,9 @@ class tool_behat_renderer extends plugin_renderer_base {
*/
public function render_error($msg) {
$html = $this->generic_info();
$html = $this->output->header();
$html .= $this->output->heading(get_string('pluginname', 'tool_behat'));
$html .= $this->generic_info();
$a = new stdClass();
$a->errormsg = $msg;
@@ -153,13 +151,7 @@ class tool_behat_renderer extends plugin_renderer_base {
*
* @return string
*/
protected function generic_info() {
$title = get_string('pluginname', 'tool_behat');
// Header.
$html = $this->output->header();
$html .= $this->output->heading($title);
public function generic_info() {
// Info.
$installurl = behat_command::DOCS_URL;
@@ -175,8 +167,7 @@ class tool_behat_renderer extends plugin_renderer_base {
);
// List of steps.
$html .= $this->output->box_start();
$html .= html_writer::tag('h3', get_string('infoheading', 'tool_behat'));
$html = $this->output->box_start();
$html .= html_writer::tag('div', get_string('aim', 'tool_behat'));
$html .= html_writer::start_tag('div');
$html .= html_writer::start_tag('ul');
@@ -40,8 +40,14 @@ class steps_definitions_form extends moodleform {
* @return void
*/
public function definition() {
global $PAGE;
$mform = $this->_form;
$output = $PAGE->get_renderer('tool_behat');
$mform->addElement('header', 'info', get_string('infoheading', 'tool_behat'));
$mform->setExpanded('info', false);
$mform->addElement('html', $output->generic_info());
$mform->addElement('header', 'filters', get_string('stepsdefinitionsfilters', 'tool_behat'));
+20 -14
View File
@@ -1,25 +1,31 @@
.steps-definitions {
border-style: solid;
border-width: 1px;
border-color: #bbb;
padding: 5px;
margin: auto;
width: 50%;
#page-admin-tool-behat-index .steps-definitions {
margin: 1rem auto;
}
.steps-definitions .step {
margin: 10px 0 10px 0;
#page-admin-tool-behat-index .steps-definitions .step {
margin: 1rem 0 0 0;
border: 1px solid #eee;
padding: 1rem;
}
.steps-definitions .stepdescription {
color: #bf8c12;
#page-admin-tool-behat-index .steps-definitions .stepdescription {
font-style: italic;
}
.steps-definitions .steptype {
#page-admin-tool-behat-index .steps-definitions .stepcontent {
margin: 1rem 0;
}
#page-admin-tool-behat-index .steps-definitions .steptype {
color: #1467a6;
margin-right: 5px;
margin-right: 1ex;
}
.steps-definitions .stepregex {
#page-admin-tool-behat-index .steps-definitions .stepapipath {
font-family: monospace;
font-size: smaller;
}
#page-admin-tool-behat-index .steps-definitions .stepregex {
color: #060;
}
@@ -26,3 +26,11 @@ Feature: List the system steps definitions
Given I set the field "Contains" to "homepage"
When I press "Filter"
Then I should see "Opens Moodle homepage."
@javascript
Scenario: Filtering by the multiple words pattern
Given I set the field "Contains" to "should exist"
When I press "Filter"
Then I should not see "There aren't steps definitions matching this filter"
And I should see "Checks the provided element and selector type exists in the current page."
And I should see "Checks that an element and selector type exists in another element and selector type on the current page."
+14 -4
View File
@@ -75,6 +75,7 @@ class tool_capability_renderer extends plugin_renderer_base {
* @return string
*/
public function capability_comparison_table(array $capabilities, $contextid, array $roles) {
static $capabilitycontexts = array();
$strpermissions = $this->get_permission_strings();
$permissionclasses = $this->get_permission_classes();
@@ -92,8 +93,13 @@ class tool_capability_renderer extends plugin_renderer_base {
}
$table->data = array();
$childcontextsids = [];
foreach ($capabilities as $capability) {
$contexts = tool_capability_calculate_role_data($capability, $roles);
if (empty($capabilitycontexts[$capability])) {
$capabilitycontexts[$capability] = tool_capability_calculate_role_data($capability, $roles);
}
$contexts = $capabilitycontexts[$capability];
$captitle = new html_table_cell(get_capability_string($capability) . html_writer::span($capability));
$captitle->header = true;
@@ -111,6 +117,10 @@ class tool_capability_renderer extends plugin_renderer_base {
}
$table->data[] = $row;
if (!empty($contexts[$contextid]->children)) {
$childcontextsids = array_merge($childcontextsids, $contexts[$contextid]->children);
$childcontextsids = array_unique($childcontextsids);
}
}
// Start the list item, and print the context name as a link to the place to make changes.
@@ -127,9 +137,9 @@ class tool_capability_renderer extends plugin_renderer_base {
$html = $this->output->heading(html_writer::link($url, $context->get_context_name(), ['title' => $title]), 3);
$html .= html_writer::table($table);
// If there are any child contexts, print them recursively.
if (!empty($contexts[$contextid]->children)) {
foreach ($contexts[$contextid]->children as $childcontextid) {
$html .= $this->capability_comparison_table($capabilities, $childcontextid, $roles, true);
if (!empty($childcontextsids)) {
foreach ($childcontextsids as $childcontextid) {
$html .= $this->capability_comparison_table($capabilities, $childcontextid, $roles);
}
}
return $html;
@@ -0,0 +1,97 @@
@tool @tool_capability
Feature: Show capabilities for multiple contexts
In order to check roles capabilities
As an admin
I need to be able to see capability overrides on several contexts
Background:
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
| Course 2 | C2 | 0 |
And the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| enrol/category:config | Allow | student | Course | C1 |
| enrol/cohort:unenrol | Allow | student | Course | C2 |
And I log in as "admin"
And I navigate to "Users > Permissions > Capability overview" in site administration
Scenario: Show capabilities table with one capability with overrides
When I set the following fields to these values:
| Capability: | enrol/category:config |
| Roles: | Student |
And I click on "Get the overview" "button"
Then I should see "System"
And I should see "Category: Miscellaneous"
And I should see "Course: Course 1"
And I should not see "Course: Course 2"
Scenario: Show capabilities table with one capability without overrides
When I set the following fields to these values:
| Capability: | enrol/cohort:config |
| Roles: | Student |
And I click on "Get the overview" "button"
Then I should see "System"
And I should not see "Category: Miscellaneous"
And I should not see "Course: Course 1"
And I should not see "Course: Course 2"
Scenario: Show capabilities table with two capabilities, 1st without overrides and 2nd with
When I set the following fields to these values:
| Capability: | enrol/category:synchronised, enrol/category:config |
| Roles: | Student |
And I click on "Get the overview" "button"
Then I should see "System"
And I should see "Category: Miscellaneous"
And I should see "Course: Course 1"
And I should not see "Course: Course 2"
Scenario: Show capabilities table with two capabilities, 1st with overrides and 2nd without
When I set the following fields to these values:
| Capability: | enrol/category:config, enrol/cohort:config |
| Roles: | Student |
And I click on "Get the overview" "button"
Then I should see "System"
And I should see "Category: Miscellaneous"
And I should see "Course: Course 1"
And I should not see "Course: Course 2"
Scenario: Show capabilities table with two capabilities, none with overrides
When I set the following fields to these values:
| Capability: | enrol/category:synchronised, enrol/cohort:config |
| Roles: | Student |
And I click on "Get the overview" "button"
Then I should see "System"
And I should not see "Category: Miscellaneous"
And I should not see "Course: Course 1"
And I should not see "Course: Course 2"
Scenario: Show capabilities table with capability with override and no role selected
When I set the following fields to these values:
| Capability: | enrol/category:config |
| Roles: | |
And I click on "Get the overview" "button"
Then I should see "System"
And I should see "Category: Miscellaneous"
And I should see "Course: Course 1"
And I should not see "Course: Course 2"
Scenario: Show capabilities table with capability without override and no role selected
When I set the following fields to these values:
| Capability: | enrol/cohort:config |
| Roles: | |
And I click on "Get the overview" "button"
Then I should see "System"
And I should not see "Category: Miscellaneous"
And I should not see "Course: Course 1"
And I should not see "Course: Course 2"
Scenario: Show capabilities table with capability with two overrides on different contexts
When I set the following fields to these values:
| Capability: | enrol/category:config, enrol/cohort:unenrol |
| Roles: | |
And I click on "Get the overview" "button"
Then I should see "System"
And I should see "Category: Miscellaneous"
And I should see "Course: Course 1"
And I should see "Course: Course 2"
+45
View File
@@ -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/>.
/**
* Plugin upgrade code
*
* @package tool_cohortroles
* @copyright 2020 Paul Holden <paulh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Function to upgrade tool_cohortroles.
*
* @param int $oldversion the version we are upgrading from
* @return bool result
*/
function xmldb_tool_cohortroles_upgrade($oldversion) {
global $DB;
if ($oldversion < 2019052001) {
// Delete any tool_cohortroles mappings for roles which no longer exist.
$DB->delete_records_select('tool_cohortroles', 'roleid NOT IN (SELECT id FROM {role})');
// Cohortroles savepoint reached.
upgrade_plugin_savepoint(true, 2019052001, 'tool', 'cohortroles');
}
return true;
}
+1 -1
View File
@@ -25,7 +25,7 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2019052000; // The current plugin version (Date: YYYYMMDDXX).
$plugin->version = 2019052001; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2019051100; // Requires this Moodle version.
$plugin->component = 'tool_cohortroles'; // Full name of the plugin (used for diagnostics).
+1 -1
View File
@@ -1 +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}}});
define(["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events","core/templates","core/pending"],function(a,b,c,d,e,f,g,h){function i(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 j={CANCEL_REQUEST:'[data-action="cancel"]',CONTACT_DPO:'[data-action="contactdpo"]'},k=function(){this.registerEvents()};return k.prototype.registerEvents=function(){a(j.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(j.CONTACT_DPO).click(function(b){var j=new h("dataprivacy/crud:initModal:contactdpo");b.preventDefault();var k=a(this).data("replytoemail"),l=[{key:"contactdataprotectionofficer",component:"tool_dataprivacy"},{key:"send",component:"tool_dataprivacy"}],m="";d.get_strings(l).then(function(a){var b=a[0];m=a[1];var c={replytoemail:k};return e.create({title:b,body:g.render("tool_dataprivacy/contact_dpo",c),type:e.types.SAVE_CANCEL,large:!0})}).then(function(b){b.setSaveButtonText(m),b.show(),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")):i(c)}),b.getRoot().on(f.hidden,function(){b.destroy()})}).then(j.resolve)["catch"](c.exception)})},{init:function(){return new k}}});
@@ -28,8 +28,9 @@ define([
'core/str',
'core/modal_factory',
'core/modal_events',
'core/templates'],
function($, Ajax, Notification, Str, ModalFactory, ModalEvents, Templates) {
'core/templates',
'core/pending'],
function($, Ajax, Notification, Str, ModalFactory, ModalEvents, Templates, Pending) {
/**
* List of action selectors.
@@ -118,6 +119,7 @@ function($, Ajax, Notification, Str, ModalFactory, ModalEvents, Templates) {
});
$(ACTIONS.CONTACT_DPO).click(function(e) {
var pendingPromise = new Pending('dataprivacy/crud:initModal:contactdpo');
e.preventDefault();
var replyToEmail = $(this).data('replytoemail');
@@ -146,9 +148,12 @@ function($, Ajax, Notification, Str, ModalFactory, ModalEvents, Templates) {
type: ModalFactory.types.SAVE_CANCEL,
large: true
});
}).done(function(modal) {
}).then(function(modal) {
modal.setSaveButtonText(sendButtonText);
// Show the modal!
modal.show();
// Handle send event.
modal.getRoot().on(ModalEvents.save, function(e) {
var message = $('#message').val().trim();
@@ -169,9 +174,9 @@ function($, Ajax, Notification, Str, ModalFactory, ModalEvents, Templates) {
modal.destroy();
});
// Show the modal!
modal.show();
}).fail(Notification.exception);
return;
}).then(pendingPromise.resolve)
.catch(Notification.exception);
});
};
+9 -1
View File
@@ -45,13 +45,22 @@ if ($manage) {
$context = context_system::instance();
// Make sure the user has the proper capability.
require_capability('tool/dataprivacy:managedatarequests', $context);
navigation_node::override_active_url($returnurl);
} else {
// For the case where a user makes request for themselves (or for their children if they are the parent).
$returnurl = new moodle_url($CFG->wwwroot . '/admin/tool/dataprivacy/mydatarequests.php');
$context = context_user::instance($USER->id);
}
$PAGE->set_context($context);
if (!$manage && $profilenode = $PAGE->settingsnav->find('myprofile', null)) {
$profilenode->make_active();
}
$title = get_string('createnewdatarequest', 'tool_dataprivacy');
$PAGE->navbar->add($title);
// If contactdataprotectionofficer is disabled, send the user back to the profile page, or the privacy policy page.
// That is, unless you have sufficient capabilities to perform this on behalf of a user.
if (!$manage && !\tool_dataprivacy\api::can_contact_dpo()) {
@@ -100,7 +109,6 @@ if ($data = $mform->get_data()) {
redirect($returnurl, $redirectmessage);
}
$title = get_string('createnewdatarequest', 'tool_dataprivacy');
$PAGE->set_heading($SITE->fullname);
$PAGE->set_title($title);
echo $OUTPUT->header();
+7 -1
View File
@@ -42,6 +42,13 @@ if (isguestuser()) {
$usercontext = context_user::instance($USER->id);
$PAGE->set_context($usercontext);
if ($profilenode = $PAGE->settingsnav->find('myprofile', null)) {
$profilenode->make_active();
}
$title = get_string('datarequests', 'tool_dataprivacy');
$PAGE->navbar->add($title);
// Return URL.
$params = ['id' => $USER->id];
if ($courseid) {
@@ -49,7 +56,6 @@ if ($courseid) {
}
$returnurl = new moodle_url('/user/profile.php', $params);
$title = get_string('datarequests', 'tool_dataprivacy');
$PAGE->set_heading($title);
$PAGE->set_title($title);
echo $OUTPUT->header();
+3 -9
View File
@@ -27,12 +27,10 @@ require_once('../../../config.php');
$requestid = required_param('requestid', PARAM_INT);
$confirm = optional_param('confirm', null, PARAM_INT);
$PAGE->set_url(new moodle_url('/admin/tool/dataprivacy/resubmitrequest.php', ['requestid' => $requestid]));
$url = new moodle_url('/admin/tool/dataprivacy/resubmitrequest.php', ['requestid' => $requestid]);
$title = get_string('resubmitrequestasnew', 'tool_dataprivacy');
require_login();
$PAGE->set_context(\context_system::instance());
require_capability('tool/dataprivacy:managedatarequests', $PAGE->context);
\tool_dataprivacy\page_helper::setup($url, $title, 'datarequests', 'tool/dataprivacy:managedatarequests');
$manageurl = new moodle_url('/admin/tool/dataprivacy/datarequests.php');
@@ -53,10 +51,6 @@ if (null !== $confirm && confirm_sesskey()) {
redirect($manageurl, get_string('resubmittedrequest', 'tool_dataprivacy', $stringparams));
}
$heading = get_string('resubmitrequest', 'tool_dataprivacy', $stringparams);
$PAGE->set_title($heading);
$PAGE->set_heading($heading);
echo $OUTPUT->header();
$confirmstring = get_string('confirmrequestresubmit', 'tool_dataprivacy', $stringparams);
+7
View File
@@ -34,6 +34,13 @@ $PAGE->set_context($context);
$PAGE->set_title($title);
$PAGE->set_heading($SITE->fullname);
// If user is logged in, then use profile navigation in breadcrumbs.
if ($profilenode = $PAGE->settingsnav->find('myprofile', null)) {
$profilenode->make_active();
}
$PAGE->navbar->add($title);
$output = $PAGE->get_renderer('tool_dataprivacy');
echo $output->header();
$summarypage = new \tool_dataprivacy\output\summary_page();
@@ -0,0 +1,187 @@
<?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/>.
/**
* Tests for the plugin privacy provider
*
* @package tool_dataprivacy
* @copyright 2020 Paul Holden <paulh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
use core_privacy\local\request\userlist;
use core_privacy\local\request\writer;
use core_privacy\tests\provider_testcase;
use tool_dataprivacy\api;
use tool_dataprivacy\local\helper;
use tool_dataprivacy\privacy\provider;
/**
* Privacy provider tests
*
* @package tool_dataprivacy
* @copyright 2020 Paul Holden <paulh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class tool_dataprivacy_privacy_provider_testcase extends provider_testcase {
/**
* Test provider get_contexts_for_userid method
*
* @return void
*/
public function test_get_contexts_for_userid() {
$this->resetAfterTest();
$user = $this->getDataGenerator()->create_user();
$context = context_user::instance($user->id);
// Returned context list should contain a single item.
$contextlist = $this->get_contexts_for_userid($user->id, 'tool_dataprivacy');
$this->assertCount(1, $contextlist);
// We should have the user context of our test user.
$this->assertSame($context, $contextlist->current());
}
/**
* Test provider get_users_in_context method
*
* @return void
*/
public function test_get_users_in_context() {
$this->resetAfterTest();
$user = $this->getDataGenerator()->create_user();
$context = context_user::instance($user->id);
$userlist = new userlist($context, 'tool_dataprivacy');
provider::get_users_in_context($userlist);
$this->assertEquals([$user->id], $userlist->get_userids());
}
/**
* Test provider get_users_in_context method for a non-user context
*
* @return void
*/
public function test_get_users_in_context_non_user_context() {
$context = context_system::instance();
$userlist = new userlist($context, 'tool_dataprivacy');
provider::get_users_in_context($userlist);
$this->assertEmpty($userlist);
}
/**
* Test provider export_user_data method
*
* @return void
*/
public function test_export_user_data() {
$this->resetAfterTest();
$user = $this->getDataGenerator()->create_user();
$context = context_user::instance($user->id);
$this->setUser($user);
// Create an export request, approve it.
$requestexport = api::create_data_request($user->id, api::DATAREQUEST_TYPE_EXPORT,
'Please export my stuff');
api::update_request_status($requestexport->get('id'), api::DATAREQUEST_STATUS_APPROVED);
// Create a deletion request, reject it.
$requestdelete = api::create_data_request($user->id, api::DATAREQUEST_TYPE_DELETE);
api::update_request_status($requestdelete->get('id'), api::DATAREQUEST_STATUS_REJECTED, 0, 'Nope');
$this->export_context_data_for_user($user->id, $context, 'tool_dataprivacy');
/** @var \core_privacy\tests\request\content_writer $writer */
$writer = writer::with_context($context);
$this->assertTrue($writer->has_any_data());
/** @var stdClass[] $data */
$data = (array) $writer->get_data([
get_string('privacyandpolicies', 'admin'),
get_string('datarequests', 'tool_dataprivacy'),
]);
$this->assertCount(2, $data);
$strs = get_strings(['requesttypeexportshort', 'requesttypedeleteshort',
'statusapproved', 'statusrejected', 'creationmanual'], 'tool_dataprivacy');
// First item is the approved export request.
$this->assertEquals($strs->requesttypeexportshort, $data[0]->type);
$this->assertEquals($strs->statusapproved, $data[0]->status);
$this->assertEquals($strs->creationmanual, $data[0]->creationmethod);
$this->assertEquals($requestexport->get('comments'), $data[0]->comments);
$this->assertEmpty($data[0]->dpocomment);
$this->assertNotEmpty($data[0]->timecreated);
// Next is the rejected deletion request.
$this->assertEquals($strs->requesttypedeleteshort, $data[1]->type);
$this->assertEquals($strs->statusrejected, $data[1]->status);
$this->assertEquals($strs->creationmanual, $data[1]->creationmethod);
$this->assertEmpty($data[1]->comments);
$this->assertContains('Nope', $data[1]->dpocomment);
$this->assertNotEmpty($data[1]->timecreated);
}
/**
* Test class export_user_preferences method
*
* @return void
*/
public function test_export_user_preferences() {
$this->resetAfterTest();
$user = $this->getDataGenerator()->create_user();
$this->setUser($user);
// Set filters preference.
$filters = [
helper::FILTER_TYPE . ':' . api::DATAREQUEST_TYPE_EXPORT,
helper::FILTER_STATUS . ':' . api::DATAREQUEST_STATUS_PENDING,
];
set_user_preference(helper::PREF_REQUEST_FILTERS, json_encode($filters), $user);
// Set paging preference.
set_user_preference(helper::PREF_REQUEST_PERPAGE, 6, $user);
provider::export_user_preferences($user->id);
/** @var \core_privacy\tests\request\content_writer $writer */
$writer = writer::with_context(context_system::instance());
$this->assertTrue($writer->has_any_data());
/** @var stdClass[] $preferences */
$preferences = (array) $writer->get_user_preferences('tool_dataprivacy');
$this->assertCount(2, $preferences);
$this->assertEquals((object) [
'value' => '1:1, 2:0',
'description' => 'Type: Export, Status: Pending',
], $preferences[helper::PREF_REQUEST_FILTERS]);
$this->assertEquals(6, $preferences[helper::PREF_REQUEST_PERPAGE]->value);
}
}
@@ -24,7 +24,7 @@
$string['classname'] = 'Class name';
$string['component'] = 'Component';
$string['configmessageinboundhost'] = 'The address of the server that Moodle should check mail against. To specify a non-default port, use [server]:[port], for example mail.example.com:587. If a port isn\'t specified, the default port for the type of mail server will be used.';
$string['configmessageinboundhost'] = 'The address of the server that Moodle should check mail against. To specify a non-default port, use [server]:[port], for example mail.example.com:993. If a port isn\'t specified, the default port for the type of mail server will be used.';
$string['defaultexpiration'] = 'Default address expiry period';
$string['defaultexpiration_help'] = 'When an email address is generated by the handler, it can be set to automatically expire after a period of time, so that it can no longer be used. It is advisable to set an expiry period.';
$string['description'] = 'Description';
+30
View File
@@ -49,6 +49,8 @@ class api {
const LOGIN_VIA_EMBEDDED_BROWSER = 3;
/** @var int seconds an auto-login key will expire. */
const LOGIN_KEY_TTL = 60;
/** @var string URL of the Moodle Apps Portal */
const MOODLE_APPS_PORTAL_URL = 'https://apps.moodle.com';
/**
* Returns a list of Moodle plugins supporting the mobile app.
@@ -346,6 +348,7 @@ class api {
*/
public static function get_features_list() {
global $CFG;
require_once($CFG->libdir . '/authlib.php');
$general = new lang_string('general');
$mainmenu = new lang_string('mainmenu', 'tool_mobile');
@@ -355,6 +358,7 @@ class api {
$user = new lang_string('user');
$files = new lang_string('files');
$remoteaddons = new lang_string('remoteaddons', 'tool_mobile');
$identityproviders = new lang_string('oauth2identityproviders', 'tool_mobile');
$availablemods = core_plugin_manager::instance()->get_plugins_of_type('mod');
$coursemodules = array();
@@ -421,6 +425,7 @@ class api {
'NoDelegate_CoreTag' => new lang_string('tags'),
'$mmLoginEmailSignup' => new lang_string('startsignup'),
'NoDelegate_ResponsiveMainMenuItems' => new lang_string('responsivemainmenuitems', 'tool_mobile'),
'NoDelegate_DarkMode' => new lang_string('darkmode', 'tool_mobile'),
),
"$mainmenu" => array(
'$mmSideMenuDelegate_mmaFrontpage' => new lang_string('sitehome'),
@@ -473,6 +478,31 @@ class api {
$features["$remoteaddons"] = $remoteaddonslist;
}
// Display OAuth 2 identity providers.
if (is_enabled_auth('oauth2')) {
$identityproviderslist = array();
$idps = \auth_plugin_base::get_identity_providers(['oauth2']);
foreach ($idps as $idp) {
// Only add identity providers that have an ID.
$id = isset($idp['url']) ? $idp['url']->get_param('id') : null;
if ($id != null) {
$identityproviderslist['NoDelegate_IdentityProvider_' . $id] = $idp['name'];
}
}
if (!empty($identityproviderslist)) {
$features["$identityproviders"] = array();
if (count($identityproviderslist) > 1) {
// Include an option to disable them all.
$features["$identityproviders"]['NoDelegate_IdentityProviders'] = new lang_string('all');
}
$features["$identityproviders"] = array_merge($features["$identityproviders"], $identityproviderslist);
}
}
return $features;
}
@@ -45,12 +45,16 @@ $string['custommenuitems_desc'] = 'Additional items can be added to the app\'s m
Link-opening methods are: app (for linking to an activity supported by the app), inappbrowser (for opening a link in a browser without leaving the app), browser (for opening the link in the device default browser outside the app) and embedded (for displaying the link in an iframe in a new page in the app).
When items are missing a translation for a given language, they will use other languages as fallback unless "_only" is appended to the language code.
For example:
<pre>
App help|https://someurl.xyz/help|inappbrowser
My grades|https://someurl.xyz/local/mygrades/index.php|embedded|en
Mis calificaciones|https://someurl.xyz/local/mygrades/index.php|embedded|es
You will only see this in English|https://someurl.xyz/english|browser|en_only
</pre>';
$string['darkmode'] = 'Dark mode';
$string['disabledfeatures'] = 'Disabled features';
$string['disabledfeatures_desc'] = 'Select here the features you want to disable in the Mobile app for your site. Please note that some features listed here could be already disabled via other site settings. You will have to log out and log in again in the app to see the changes.';
$string['displayerrorswarning'] = 'Display debug messages (debugdisplay) is enabled. It should be disabled.';
@@ -84,6 +88,8 @@ $string['mobilecssurl'] = 'CSS';
$string['mobilefeatures'] = 'Mobile features';
$string['mobilenotificationsdisabledwarning'] = 'Mobile notifications are not enabled. They should be enabled in Notification settings.';
$string['mobilesettings'] = 'Mobile settings';
$string['moodleappsportalfeatureswarning'] = 'Please note that some features may be restricted depending on your Moodle app subscription. For details, visit the <a href="{$a}" target="_blank">Moodle Apps Portal</a>.';
$string['oauth2identityproviders'] = 'OAuth 2 identity providers';
$string['offlineuse'] = 'Offline use';
$string['pluginname'] = 'Moodle app tools';
$string['pluginnotenabledorconfigured'] = 'Plugin not enabled or configured.';
+7 -1
View File
@@ -30,10 +30,16 @@ require_once($CFG->libdir . '/externallib.php');
$serviceshortname = required_param('service', PARAM_ALPHANUMEXT);
$passport = required_param('passport', PARAM_RAW); // Passport send from the app to validate the response URL.
$urlscheme = optional_param('urlscheme', 'moodlemobile', PARAM_ALPHANUM); // The URL scheme the app supports.
$urlscheme = optional_param('urlscheme', 'moodlemobile', PARAM_NOTAGS); // The URL scheme the app supports.
$confirmed = optional_param('confirmed', false, PARAM_BOOL); // If we are being redirected after user confirmation.
$oauthsso = optional_param('oauthsso', 0, PARAM_INT); // Id of the OpenID issuer (for OAuth direct SSO).
// Validate that the urlscheme is valid.
if (!preg_match('/^[a-zA-Z][a-zA-Z0-9-\+\.]*$/', $urlscheme)) {
throw new moodle_exception('Invalid parameter: the value of urlscheme isn\'t valid. ' .
'It should start with a letter and can only contain letters, numbers and the characters "." "+" "-".');
}
// Check web services enabled.
if (!$CFG->enablewebservices) {
throw new moodle_exception('enablewsdescription', 'webservice');
+11 -1
View File
@@ -50,6 +50,12 @@ if ($hassiteconfig) {
// Show only mobile settings if the mobile service is enabled.
if (!empty($CFG->enablemobilewebservice)) {
// General notification about limited features due to app restrictions.
$notify = new \core\output\notification(
get_string('moodleappsportalfeatureswarning', 'tool_mobile', tool_mobile\api::MOODLE_APPS_PORTAL_URL),
\core\output\notification::NOTIFY_WARNING);
$featuresnotice = $OUTPUT->render($notify);
// Type of login.
$temp = new admin_settingpage('mobileauthentication', new lang_string('mobileauthentication', 'tool_mobile'));
$options = array(
@@ -63,13 +69,15 @@ if ($hassiteconfig) {
$temp->add(new admin_setting_configtext('tool_mobile/forcedurlscheme',
new lang_string('forcedurlscheme_key', 'tool_mobile'),
new lang_string('forcedurlscheme', 'tool_mobile'), '', PARAM_ALPHANUM));
new lang_string('forcedurlscheme', 'tool_mobile'), '', PARAM_NOTAGS));
$ADMIN->add('mobileapp', $temp);
// Appearance related settings.
$temp = new admin_settingpage('mobileappearance', new lang_string('mobileappearance', 'tool_mobile'));
$temp->add(new admin_setting_heading('tool_mobile/moodleappsportalfeaturesappearance', '', $featuresnotice));
$temp->add(new admin_setting_configtext('mobilecssurl', new lang_string('mobilecssurl', 'tool_mobile'),
new lang_string('configmobilecssurl', 'tool_mobile'), '', PARAM_URL));
@@ -102,6 +110,8 @@ if ($hassiteconfig) {
// Features related settings.
$temp = new admin_settingpage('mobilefeatures', new lang_string('mobilefeatures', 'tool_mobile'));
$temp->add(new admin_setting_heading('tool_mobile/moodleappsportalfeatures', '', $featuresnotice));
$temp->add(new admin_setting_heading('tool_mobile/logout',
new lang_string('logout'), ''));
+6 -5
View File
@@ -131,11 +131,12 @@ if ($execute) {
tool_phpunit_problem('Can not create configuration file');
}
}
$configdir = escapeshellarg($configdir);
// no cleanup of path - this is tricky because we can not use escapeshellarg and friends for escaping,
// this is from admin user so PARAM_PATH must be enough
chdir($CFG->dirroot);
passthru("php $CFG->admin/tool/phpunit/cli/util.php --run -c $configdir $testclass $testpath", $code);
$configdir = escapeshellarg($configdir);
$cleanclass = escapeshellarg($testclass);
$cleanpath = escapeshellarg($testpath);
passthru("php $CFG->admin/tool/phpunit/cli/util.php --run -c $configdir $cleanclass $cleanpath", $code);
chdir($oldcwd);
echo '</pre>';
@@ -146,7 +147,7 @@ if ($execute) {
}
echo $OUTPUT->box_start('generalbox boxwidthwide boxaligncenter');
echo '<form method="get" action="webrunner.php">';
echo '<form method="post" action="webrunner.php">';
echo '<fieldset class="invisiblefieldset">';
echo '<label for="testpath">Test one file</label> ';
echo '<input type="text" id="testpath" name="testpath" value="'.s($testpath).'" size="50" /> (all test cases from webrunner.xml if empty)';
+15 -1
View File
@@ -39,15 +39,29 @@ if ($userid != $USER->id) {
if (!has_capability('tool/policy:acceptbehalf', $context)) {
require_capability('tool/policy:viewacceptances', $context);
}
$user = core_user::get_user($userid);
$PAGE->navigation->extend_for_user($user);
}
$title = get_string('policiesagreements', 'tool_policy');
$PAGE->set_context($context);
$PAGE->set_pagelayout('standard');
$PAGE->set_url(new moodle_url('/admin/tool/policy/user.php', ['userid' => $userid]));
$PAGE->set_title($title);
if ($userid == $USER->id &&
($profilenode = $PAGE->settingsnav->find('myprofile', null))) {
$profilenode->make_active();
}
$PAGE->navbar->add($title);
$output = $PAGE->get_renderer('tool_policy');
echo $output->header();
echo $output->heading(get_string('policiesagreements', 'tool_policy'));
echo $output->heading($title);
$acceptances = new \tool_policy\output\acceptances($userid, $returnurl);
echo $output->render($acceptances);
$PAGE->requires->js_call_amd('tool_policy/acceptmodal', 'getInstance', [context_system::instance()->id]);
@@ -127,3 +127,36 @@ Feature: Basic recycle bin functionality
And I press "Yes"
And I should see "Recycle bin has been emptied"
And I should see "There are no items in the recycle bin."
@javascript
Scenario: Show recycle bin on category action menu
Given I log in as "admin"
And I navigate to "Courses > Manage courses and categories" in site administration
And I click on "Actions menu" "link"
And I click on "Recycle bin" "link"
Then I should see "There are no items in the recycle bin."
@javascript
Scenario: Not show recycle bin empty on category action menu whit autohide enable
Given I log in as "admin"
And the following config values are set as admin:
| categorybinenable | 0 | tool_recyclebin |
And I navigate to "Courses > Manage courses and categories" in site administration
And I click on "Actions menu" "link"
Then I should not see "Recycle bin"
@javascript
Scenario: Show recycle bin not empty on category action menu whit autohide enable
Given I log in as "admin"
And the following config values are set as admin:
| autohide | 1 | tool_recyclebin |
And I navigate to "Courses > Manage courses and categories" in site administration
And I click on "Actions menu" "link"
Then I should not see "Recycle bin"
And I click on "delete" action for "Course 2" in management course listing
And I press "Delete"
And I should see "Deleting C2"
And I should see "C2 has been completely deleted"
And I press "Continue"
When I click on "Actions menu" "link"
Then I should see "Recycle bin"
+2 -2
View File
@@ -100,9 +100,9 @@ if (!$problems) {
$count = $problem->racount;
$edit = array();
$aurl = new moodle_url('/admin/roles/define.php', array('roleid'=>$problem->roleid, 'action'=>'edit'));
$edit[] = html_writer::link($aurl, $OUTPUT->pix_icon('t/edit', 'core', get_string('edit')));
$edit[] = html_writer::link($aurl, $OUTPUT->pix_icon('t/edit', get_string('edit')));
$aurl = new moodle_url($PAGE->url, array('roleid'=>$problem->roleid, 'contextlevel'=>$problem->contextlevel, 'action'=>'delete'));
$edit[] = html_writer::link($aurl, $OUTPUT->pix_icon('t/delete', 'core', get_string('delete')));
$edit[] = html_writer::link($aurl, $OUTPUT->pix_icon('t/delete', get_string('delete')));
$data[] = array($levelname, $rolename, $count, implode('&nbsp;', $edit));
}
$table = new html_table();
@@ -412,6 +412,12 @@ class tool_uploadcourse_course {
$this->error('invalidshortname', new lang_string('invalidshortname', 'tool_uploadcourse'));
return false;
}
// Ensure we don't overflow the maximum length of the shortname field.
if (core_text::strlen($this->shortname) > 255) {
$this->error('invalidshortnametoolong', new lang_string('invalidshortnametoolong', 'tool_uploadcourse', 255));
return false;
}
}
$exists = $this->exists();
@@ -479,6 +485,12 @@ class tool_uploadcourse_course {
return false;
}
// Ensure we don't overflow the maximum length of the fullname field.
if (!empty($coursedata['fullname']) && core_text::strlen($coursedata['fullname']) > 254) {
$this->error('invalidfullnametoolong', new lang_string('invalidfullnametoolong', 'tool_uploadcourse', 254));
return false;
}
// If the course does not exist, or will be forced created.
if (!$exists || $mode === tool_uploadcourse_processor::MODE_CREATE_ALL) {
@@ -93,6 +93,8 @@ $string['invalideupdatemode'] = 'Invalid update mode selected';
$string['invalidvisibilitymode'] = 'Invalid visible mode';
$string['invalidroles'] = 'Invalid role names: {$a}';
$string['invalidshortname'] = 'Invalid shortname';
$string['invalidfullnametoolong'] = 'The fullname field is limited to {$a} characters';
$string['invalidshortnametoolong'] = 'The shortname field is limited to {$a} characters';
$string['missingmandatoryfields'] = 'Missing value for mandatory fields: {$a}';
$string['missingshortnamenotemplate'] = 'Missing shortname and shortname template not set';
$string['mode'] = 'Upload mode';
@@ -82,6 +82,37 @@ class tool_uploadcourse_course_testcase extends advanced_testcase {
$this->assertArrayHasKey('invalidshortname', $co->get_errors());
}
public function test_invalid_shortname_too_long() {
$this->resetAfterTest();
$mode = tool_uploadcourse_processor::MODE_CREATE_NEW;
$updatemode = tool_uploadcourse_processor::UPDATE_NOTHING;
$upload = new tool_uploadcourse_course($mode, $updatemode, [
'category' => 1,
'fullname' => 'New course',
'shortname' => str_repeat('X', 2000),
]);
$this->assertFalse($upload->prepare());
$this->assertArrayHasKey('invalidshortnametoolong', $upload->get_errors());
}
public function test_invalid_fullname_too_long() {
$this->resetAfterTest();
$mode = tool_uploadcourse_processor::MODE_CREATE_NEW;
$updatemode = tool_uploadcourse_processor::UPDATE_NOTHING;
$upload = new tool_uploadcourse_course($mode, $updatemode, [
'category' => 1,
'fullname' => str_repeat('X', 2000),
]);
$this->assertFalse($upload->prepare());
$this->assertArrayHasKey('invalidfullnametoolong', $upload->get_errors());
}
public function test_invalid_visibility() {
$this->resetAfterTest(true);
$mode = tool_uploadcourse_processor::MODE_CREATE_NEW;
+10
View File
@@ -720,6 +720,13 @@ class manager {
* @param int $direction
*/
protected static function _move_tour(tour $tour, $direction) {
// We can't move the first tour higher, nor the last tour any lower.
if (($tour->is_first_tour() && $direction == helper::MOVE_UP) ||
($tour->is_last_tour() && $direction == helper::MOVE_DOWN)) {
return;
}
$currentsortorder = $tour->get_sortorder();
$targetsortorder = $currentsortorder + $direction;
@@ -848,6 +855,9 @@ class manager {
}
$existingtourrecords->close();
// Ensure we correct the sortorder in any existing tours, prior to adding latest shipped tours.
helper::reset_tour_sortorder();
foreach (array_reverse($shippedtours) as $filename => $version) {
$filepath = $CFG->dirroot . "/{$CFG->admin}/tool/usertours/tours/" . $filename;
$tourjson = file_get_contents($filepath);
+7
View File
@@ -64,5 +64,12 @@ function xmldb_tool_usertours_upgrade($oldversion) {
// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.
if ($oldversion < 2019052001) {
// Updating shipped tours will fix broken sortorder records in existing tours.
manager::update_shipped_tours();
upgrade_plugin_savepoint(true, 2019052001, 'tool', 'usertours');
}
return true;
}
@@ -122,6 +122,83 @@ class tool_usertours_manager_testcase extends advanced_testcase {
$rcm->invokeArgs($manager, $arguments);
}
/**
* Data provider for test_move_tour
*
* @return array
*/
public function move_tour_provider() {
$alltours = [
['name' => 'Tour 1'],
['name' => 'Tour 2'],
['name' => 'Tour 3'],
];
return [
'Move up' => [
$alltours,
'Tour 2',
\tool_usertours\helper::MOVE_UP,
0,
],
'Move down' => [
$alltours,
'Tour 2',
\tool_usertours\helper::MOVE_DOWN,
2,
],
'Move up (first)' => [
$alltours,
'Tour 1',
\tool_usertours\helper::MOVE_UP,
0,
],
'Move down (last)' => [
$alltours,
'Tour 3',
\tool_usertours\helper::MOVE_DOWN,
2,
],
];
}
/**
* Test moving tours (changing sortorder)
*
* @dataProvider move_tour_provider
*
* @param array $alltours
* @param string $movetourname
* @param int $direction
* @param int $expectedsortorder
* @return void
*/
public function test_move_tour($alltours, $movetourname, $direction, $expectedsortorder) {
global $DB;
$this->resetAfterTest();
// Clear out existing tours so ours are the only ones, otherwise we can't predict the sortorder.
$DB->delete_records('tool_usertours_tours');
foreach ($alltours as $tourconfig) {
$this->helper_create_tour((object) $tourconfig);
}
// Load our tour to move.
$record = $DB->get_record('tool_usertours_tours', ['name' => $movetourname]);
$tour = \tool_usertours\tour::load_from_record($record);
// Call protected method via reflection.
$class = new ReflectionClass(\tool_usertours\manager::class);
$method = $class->getMethod('_move_tour');
$method->setAccessible(true);
$method->invokeArgs(null, [$tour, $direction]);
// Assert expected sortorder.
$this->assertEquals($expectedsortorder, $tour->get_sortorder());
}
/**
* Data Provider for get_matching_tours tests.
*
+1 -1
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2019052000; // The current module version (Date: YYYYMMDDXX).
$plugin->version = 2019052001; // The current module version (Date: YYYYMMDDXX).
$plugin->requires = 2019051100; // Requires this Moodle version.
$plugin->component = 'tool_usertours'; // Full name of the plugin (used for diagnostics).
@@ -68,13 +68,13 @@ class view_xml extends XMLDBAction {
// Get the file parameter
$file = required_param('file', PARAM_PATH);
$file = $CFG->dirroot . $file;
// File must be under $CFG->wwwroot and
// under one db directory (simple protection)
if (substr($file, 0, strlen($CFG->dirroot)) == $CFG->dirroot &&
substr(dirname($file), -2, 2) == 'db') {
$fullpath = $CFG->dirroot . $file;
// File param must start with / and end with /db/install.xml to be safe.
if (substr($file, 0, 1) == '/' &&
substr($file, -15, 15) == '/db/install.xml') {
// Everything is ok. Load the file to memory
$this->output = file_get_contents($file);
$this->output = file_get_contents($fullpath);
} else {
// Switch to HTML and error
$this->does_generate = ACTION_GENERATE_HTML;
+1 -1
View File
@@ -149,7 +149,7 @@ class auth_email_external extends external_api {
new external_single_structure(
array(
'id' => new external_value(PARAM_INT, 'Profile field id', VALUE_OPTIONAL),
'shortname' => new external_value(PARAM_ALPHANUM, 'Password policy', VALUE_OPTIONAL),
'shortname' => new external_value(PARAM_ALPHANUMEXT, 'Profile field shortname', VALUE_OPTIONAL),
'name' => new external_value(PARAM_TEXT, 'Profield field name', VALUE_OPTIONAL),
'datatype' => new external_value(PARAM_ALPHANUMEXT, 'Profield field datatype', VALUE_OPTIONAL),
'description' => new external_value(PARAM_RAW, 'Profield field description', VALUE_OPTIONAL),
+2 -1
View File
@@ -263,7 +263,8 @@ class auth_plugin_shibboleth extends auth_plugin_base {
global $OUTPUT;
if (!isset($this->config->user_attribute) || empty($this->config->user_attribute)) {
echo $OUTPUT->notification(get_string("shib_not_set_up_error", "auth_shibboleth"), 'notifyproblem');
echo $OUTPUT->notification(get_string("shib_not_set_up_error", "auth_shibboleth",
(new moodle_url('/auth/shibboleth/README.txt'))->out()), 'notifyproblem');
return;
}
if ($this->config->convert_data and $this->config->convert_data != '' and !is_readable($this->config->convert_data)) {
+3 -2
View File
@@ -32,8 +32,9 @@
$shibbolethauth = get_auth_plugin('shibboleth');
// Check whether Shibboleth is configured properly
$readmeurl = (new moodle_url('/auth/shibboleth/README.txt'))->out();
if (empty($pluginconfig->user_attribute)) {
print_error('shib_not_set_up_error', 'auth_shibboleth');
print_error('shib_not_set_up_error', 'auth_shibboleth', '', $readmeurl);
}
/// If we can find the Shibboleth attribute, save it in session and return to main login page
@@ -91,7 +92,7 @@
elseif (!empty($_SERVER['HTTP_SHIB_APPLICATION_ID']) || !empty($_SERVER['Shib-Application-ID'])) {
print_error('shib_no_attributes_error', 'auth_shibboleth' , '', '\''.$pluginconfig->user_attribute.'\', \''.$pluginconfig->field_map_firstname.'\', \''.$pluginconfig->field_map_lastname.'\' and \''.$pluginconfig->field_map_email.'\'');
} else {
print_error('shib_not_set_up_error', 'auth_shibboleth');
print_error('shib_not_set_up_error', 'auth_shibboleth', '', $readmeurl);
}
+3 -3
View File
@@ -28,7 +28,7 @@ $string['auth_shib_auth_method_description'] = 'Provide a name for the Shibbolet
$string['auth_shib_auth_logo'] = 'Authentication method logo';
$string['auth_shib_auth_logo_description'] = 'Provide a logo for the Shibboleth authentication method that is familiar to your users. This could be the logo of your Shibboleth federation, e.g. <tt>SWITCHaai Login</tt> or <tt>InCommon Login</tt> or similar.';
$string['auth_shib_contact_administrator'] = 'In case you are not associated with the given organizations and you need access to a course on this server, please contact the <a href="mailto:{$a}">Moodle Administrator</a>.';
$string['auth_shibbolethdescription'] = 'Using this method users are created and authenticated using Shibboleth. For set-up details, see the <a href="../auth/shibboleth/README.txt">Shibboleth README</a>.';
$string['auth_shibbolethdescription'] = 'Using this method users are created and authenticated using Shibboleth. For set-up details, see the <a href="{$a}">Shibboleth README</a>.';
$string['auth_shibboleth_errormsg'] = 'Please select the organization you are member of!';
$string['auth_shibboleth_login'] = 'Shibboleth login';
$string['auth_shibboleth_login_long'] = 'Login to Moodle via Shibboleth';
@@ -36,7 +36,7 @@ $string['auth_shibboleth_manual_login'] = 'Manual login';
$string['auth_shibboleth_select_member'] = 'I\'m a member of ...';
$string['auth_shibboleth_select_organization'] = 'For authentication via Shibboleth, please select your organisation from the drop-down menu:';
$string['auth_shib_convert_data'] = 'Data modification API';
$string['auth_shib_convert_data_description'] = 'You can use this API to further modify the data provided by Shibboleth. Read the <a href="../auth/shibboleth/README.txt">README</a> for further instructions.';
$string['auth_shib_convert_data_description'] = 'You can use this API to further modify the data provided by Shibboleth. Read the <a href="{$a}">README</a> for further instructions.';
$string['auth_shib_convert_data_warning'] = 'The file does not exist or is not readable by the webserver process!';
$string['auth_shib_changepasswordurl'] = 'Password-change URL';
$string['auth_shib_idp_list'] = 'Identity providers';
@@ -57,6 +57,6 @@ $string['auth_shib_username_description'] = 'Name of the webserver Shibboleth en
$string['shib_invalid_account_error'] = 'You seem to be Shibboleth authenticated but Moodle has no valid account for your username. Your account may not exist or it may have been suspended.';
$string['shib_no_attributes_error'] = 'You seem to be Shibboleth authenticated but Moodle didn\'t receive any user attributes. Please check that your Identity Provider releases the necessary attributes ({$a}) to the Service Provider Moodle is running on or inform the webmaster of this server.';
$string['shib_not_all_attributes_error'] = 'Moodle needs certain Shibboleth attributes which are not present in your case. The attributes are: {$a}<br />Please contact the webmaster of this server or your Identity Provider.';
$string['shib_not_set_up_error'] = 'Shibboleth authentication doesn\'t seem to be set up correctly because no Shibboleth environment variables are present for this page. Please consult the <a href="README.txt">README</a> for further instructions on how to set up Shibboleth authentication or contact the webmaster of this Moodle installation.';
$string['shib_not_set_up_error'] = 'Shibboleth authentication doesn\'t seem to be set up correctly because no Shibboleth environment variables are present for this page. Please consult the <a href="{$a}">README</a> for further instructions on how to set up Shibboleth authentication or contact the webmaster of this Moodle installation.';
$string['pluginname'] = 'Shibboleth';
$string['privacy:metadata'] = 'The Shibboleth authentication plugin does not store any personal data.';
+3 -2
View File
@@ -30,8 +30,9 @@ if ($ADMIN->fulltree) {
require_once($CFG->dirroot.'/auth/shibboleth/classes/admin_setting_special_idp_configtextarea.php');
// Introductory explanation.
$readmeurl = (new moodle_url('/auth/shibboleth/README.txt'))->out();
$settings->add(new admin_setting_heading('auth_shibboleth/pluginname', '',
new lang_string('auth_shibbolethdescription', 'auth_shibboleth')));
new lang_string('auth_shibbolethdescription', 'auth_shibboleth', $readmeurl)));
// Username.
$settings->add(new admin_setting_configtext('auth_shibboleth/user_attribute', get_string('username'),
@@ -40,7 +41,7 @@ if ($ADMIN->fulltree) {
// COnvert Data configuration file.
$settings->add(new admin_setting_configfile('auth_shibboleth/convert_data',
get_string('auth_shib_convert_data', 'auth_shibboleth'),
get_string('auth_shib_convert_data_description', 'auth_shibboleth'), ''));
get_string('auth_shib_convert_data_description', 'auth_shibboleth', $readmeurl), ''));
// WAYF.
$settings->add(new auth_shibboleth_admin_setting_special_wayf_select());
-1
View File
@@ -91,7 +91,6 @@ class core_backup_external extends external_api {
require_capability('moodle/backup:backupactivity', $context);
} else {
require_capability('moodle/backup:backupcourse', $context);
$instanceid = $course->id;
}
$results = array();
+46
View File
@@ -955,6 +955,52 @@ class core_backup_moodle2_testcase extends advanced_testcase {
$this->assertEquals('', $requests[2]->searcharea);
}
/**
* Test restoring courses based on the backup plan. Primarily used with
* the import functionality
*/
public function test_restore_course_using_plan_defaults() {
global $DB, $CFG, $USER;
$this->resetAfterTest(true);
$this->setAdminUser();
$CFG->enableglobalsearch = true;
// Set admin config setting so that activities are not restored by default.
set_config('restore_general_activities', 0, 'restore');
// Create a course.
$generator = $this->getDataGenerator();
$course = $generator->create_course();
$course2 = $generator->create_course();
$course3 = $generator->create_course();
// Add a forum.
$forum = $generator->create_module('forum', ['course' => $course->id]);
// Backup course...
$CFG->backup_file_logger_level = backup::LOG_NONE;
$bc = new backup_controller(backup::TYPE_1COURSE, $course->id,
backup::FORMAT_MOODLE, backup::INTERACTIVE_NO, backup::MODE_IMPORT,
$USER->id);
$backupid = $bc->get_backupid();
$bc->execute_plan();
$bc->destroy();
// Restore it on top of course2 (should duplicate the forum).
$rc = new restore_controller($backupid, $course2->id,
backup::INTERACTIVE_NO, backup::MODE_IMPORT, $USER->id,
backup::TARGET_EXISTING_ADDING, null);
$this->assertTrue($rc->execute_precheck());
$rc->execute_plan();
$rc->destroy();
// Get the forums now on the old course.
$modinfo = get_fast_modinfo($course2->id);
$forums = $modinfo->get_instances_of('forum');
$this->assertCount(0, $forums);
}
/**
* The Question category hierarchical structure was changed in Moodle 3.5.
* From 3.5, all question categories in each context are a child of a single top level question category for that context.
+2 -2
View File
@@ -55,9 +55,11 @@ require_capability('moodle/restore:restorecourse', $context);
if (is_null($course)) {
$coursefullname = $SITE->fullname;
$courseshortname = $SITE->shortname;
$courseurl = new moodle_url('/');
} else {
$coursefullname = $course->fullname;
$courseshortname = $course->shortname;
$courseurl = course_get_url($course->id);
}
// Show page header.
@@ -173,7 +175,6 @@ if ($restore->get_stage() != restore_ui::STAGE_PROCESS) {
\core\task\manager::queue_adhoc_task($asynctask);
// Add ajax progress bar and initiate ajax via a template.
$courseurl = new moodle_url('/course/view.php', array('id' => $course->id));
$restoreurl = new moodle_url('/backup/restorefile.php', array('contextid' => $contextid));
$progresssetup = array(
'backupid' => $restoreid,
@@ -182,7 +183,6 @@ if ($restore->get_stage() != restore_ui::STAGE_PROCESS) {
'restoreurl' => $restoreurl->out()
);
echo $renderer->render_from_template('core/async_backup_status', $progresssetup);
}
$restore->destroy();
@@ -282,7 +282,14 @@ abstract class restore_controller_dbops extends restore_dbops {
if ($plan->setting_exists($settingname)) {
$setting = $plan->get_setting($settingname);
$value = self::get_setting_default($config, $setting);
$locked = (get_config('restore', $config . '_locked') == true);
$locked = (get_config('restore',$config . '_locked') == true);
// Use the original value when this is an import and the setting is unlocked.
if ($controller->get_mode() == backup::MODE_IMPORT && $controller->get_interactive()) {
if (!$uselocks || !$locked) {
$value = $setting->get_value();
}
}
// We can only update the setting if it isn't already locked by config or permission.
if ($setting->get_status() != base_setting::LOCKED_BY_CONFIG
+15 -10
View File
@@ -1371,7 +1371,9 @@ abstract class restore_dbops {
// Note: for DB deleted users md5(username) is stored *sometimes* in the email field,
// hence we are looking there for usernames if not empty. See delete_user()
// If match by id and mnethost and user is deleted in DB and
// match by username LIKE 'backup_email.%' or by non empty email = md5(username) => ok, return target user
// match by username LIKE 'substring(backup_email).%' where the substr length matches the retained data in the
// username field (100 - (timestamp + 1) characters), or by non empty email = md5(username) => ok, return target user.
$usernamelookup = core_text::substr($user->email, 0, 89) . '.%';
if ($rec = $DB->get_record_sql("SELECT *
FROM {user} u
WHERE id = ?
@@ -1384,13 +1386,14 @@ abstract class restore_dbops {
AND email = ?
)
)",
array($user->id, $user->mnethostid, $user->email.'.%', md5($user->username)))) {
array($user->id, $user->mnethostid, $usernamelookup, md5($user->username)))) {
return $rec; // Matching user, deleted in DB found, return it
}
// 1D - Handle users deleted in backup file and "alive" in DB
// If match by id and mnethost and user is deleted in backup file
// and match by email = email_without_time(backup_email) => ok, return target user
// and match by substring(email) = email_without_time(backup_email) where the substr length matches the retained data
// in the username field (100 - (timestamp + 1) characters) => ok, return target user.
if ($user->deleted) {
// Note: for DB deleted users email is stored in username field, hence we
// are looking there for emails. See delete_user()
@@ -1400,7 +1403,7 @@ abstract class restore_dbops {
FROM {user} u
WHERE id = ?
AND mnethostid = ?
AND UPPER(email) = UPPER(?)",
AND " . $DB->sql_substr('UPPER(email)', 1, 89) . " = UPPER(?)",
array($user->id, $user->mnethostid, $trimemail))) {
return $rec; // Matching user, deleted in backup file found, return it
}
@@ -1447,7 +1450,8 @@ abstract class restore_dbops {
// Note: for DB deleted users md5(username) is stored *sometimes* in the email field,
// hence we are looking there for usernames if not empty. See delete_user()
// 2B1 - If match by mnethost and user is deleted in DB and not empty email = md5(username) and
// (by username LIKE 'backup_email.%' or non-zero firstaccess) => ok, return target user
// (by username LIKE 'substring(backup_email).%' or non-zero firstaccess) => ok, return target user.
$usernamelookup = core_text::substr($user->email, 0, 89) . '.%';
if ($rec = $DB->get_record_sql("SELECT *
FROM {user} u
WHERE mnethostid = ?
@@ -1461,14 +1465,15 @@ abstract class restore_dbops {
AND firstaccess = ?
)
)",
array($user->mnethostid, md5($user->username), $user->email.'.%', $user->firstaccess))) {
array($user->mnethostid, md5($user->username), $usernamelookup, $user->firstaccess))) {
return $rec; // Matching user found, return it
}
// 2B2 - If match by mnethost and user is deleted in DB and
// username LIKE 'backup_email.%' and non-zero firstaccess) => ok, return target user
// username LIKE 'substring(backup_email).%' and non-zero firstaccess) => ok, return target user
// (this covers situations where md5(username) wasn't being stored so we require both
// the email & non-zero firstaccess to match)
$usernamelookup = core_text::substr($user->email, 0, 89) . '.%';
if ($rec = $DB->get_record_sql("SELECT *
FROM {user} u
WHERE mnethostid = ?
@@ -1476,13 +1481,13 @@ abstract class restore_dbops {
AND UPPER(username) LIKE UPPER(?)
AND firstaccess != 0
AND firstaccess = ?",
array($user->mnethostid, $user->email.'.%', $user->firstaccess))) {
array($user->mnethostid, $usernamelookup, $user->firstaccess))) {
return $rec; // Matching user found, return it
}
// 2C - Handle users deleted in backup file and "alive" in DB
// If match mnethost and user is deleted in backup file
// and match by email = email_without_time(backup_email) and non-zero firstaccess=> ok, return target user
// and match by substring(email) = email_without_time(backup_email) and non-zero firstaccess=> ok, return target user.
if ($user->deleted) {
// Note: for DB deleted users email is stored in username field, hence we
// are looking there for emails. See delete_user()
@@ -1491,7 +1496,7 @@ abstract class restore_dbops {
if ($rec = $DB->get_record_sql("SELECT *
FROM {user} u
WHERE mnethostid = ?
AND UPPER(email) = UPPER(?)
AND " . $DB->sql_substr('UPPER(email)', 1, 89) . " = UPPER(?)
AND firstaccess != 0
AND firstaccess = ?",
array($user->mnethostid, $trimemail, $user->firstaccess))) {
@@ -119,4 +119,246 @@ class restore_dbops_testcase extends advanced_testcase {
$this->assertSame('Table "backup_ids_temp" does not exist', $e->getMessage());
}
}
/**
* Data provider for {@link test_precheck_user()}
*/
public function precheck_user_provider() {
$emailmultiplier = [
'shortmail' => 'normalusername@example.com',
'longmail' => str_repeat('a', 100) // It's not validated, hence any string is ok.
];
$providercases = [];
foreach ($emailmultiplier as $emailk => $email) {
// Get the related cases.
$cases = $this->precheck_user_cases($email);
// Rename them (keys).
foreach ($cases as $key => $case) {
$providercases[$key . ' - ' . $emailk] = $case;
}
}
return $providercases;
}
/**
* Get all the cases implemented in {@link restore_dbops::precheck_users()}
*
* @param string $email
*/
private function precheck_user_cases($email) {
global $CFG;
$baseuserarr = [
'username' => 'normalusername',
'email' => $email,
'mnethostid' => $CFG->mnet_localhost_id,
'firstaccess' => 123456789,
'deleted' => 0,
'forceemailcleanup' => false, // Hack to force the DB record to have empty mail.
'forceduplicateadminallowed' => false]; // Hack to enable import_general_duplicate_admin_allowed.
return [
// Cases with samesite = true.
'samesite match existing (1A)' => [
'dbuser' => $baseuserarr,
'backupuser' => $baseuserarr,
'samesite' => true,
'outcome' => 'match'
],
'samesite match existing anon (1B)' => [
'dbuser' => array_merge($baseuserarr, [
'username' => 'anon01']),
'backupuser' => array_merge($baseuserarr, [
'id' => -1, 'username' => 'anon01', 'firstname' => 'anonfirstname01',
'lastname' => 'anonlastname01', 'email' => 'anon01@doesntexist.invalid']),
'samesite' => true,
'outcome' => 'match'
],
'samesite match existing deleted in db, alive in backup, by db username (1C)' => [
'dbuser' => array_merge($baseuserarr, [
'deleted' => 1]),
'backupuser' => array_merge($baseuserarr, [
'username' => 'this_wont_match']),
'samesite' => true,
'outcome' => 'match'
],
'samesite match existing deleted in db, alive in backup, by db email (1C)' => [
'dbuser' => array_merge($baseuserarr, [
'deleted' => 1]),
'backupuser' => array_merge($baseuserarr, [
'email' => 'this_wont_match']),
'samesite' => true,
'outcome' => 'match'
],
'samesite match existing alive in db, deleted in backup (1D)' => [
'dbuser' => $baseuserarr,
'backupuser' => array_merge($baseuserarr, [
'deleted' => 1]),
'samesite' => true,
'outcome' => 'match'
],
'samesite conflict (1E)' => [
'dbuser' => $baseuserarr,
'backupuser' => array_merge($baseuserarr, ['id' => -1]),
'samesite' => true,
'outcome' => false
],
'samesite create user (1F)' => [
'dbuser' => $baseuserarr,
'backupuser' => array_merge($baseuserarr, [
'username' => 'newusername']),
'samesite' => false,
'outcome' => true
],
// Cases with samesite = false.
'no samesite match existing, by db email (2A1)' => [
'dbuser' => $baseuserarr,
'backupuser' => array_merge($baseuserarr, [
'firstaccess' => 0]),
'samesite' => false,
'outcome' => 'match'
],
'no samesite match existing, by db firstaccess (2A1)' => [
'dbuser' => $baseuserarr,
'backupuser' => array_merge($baseuserarr, [
'email' => 'this_wont_match@example.con']),
'samesite' => false,
'outcome' => 'match'
],
'no samesite match existing anon (2A1 too)' => [
'dbuser' => array_merge($baseuserarr, [
'username' => 'anon01']),
'backupuser' => array_merge($baseuserarr, [
'id' => -1, 'username' => 'anon01', 'firstname' => 'anonfirstname01',
'lastname' => 'anonlastname01', 'email' => 'anon01@doesntexist.invalid']),
'samesite' => false,
'outcome' => 'match'
],
'no samesite match dupe admin (2A2)' => [
'dbuser' => array_merge($baseuserarr, [
'username' => 'admin_old_site_id',
'forceduplicateadminallowed' => true]),
'backupuser' => array_merge($baseuserarr, [
'username' => 'admin']),
'samesite' => false,
'outcome' => 'match'
],
'no samesite match existing deleted in db, alive in backup, by db username (2B1)' => [
'dbuser' => array_merge($baseuserarr, [
'deleted' => 1]),
'backupuser' => array_merge($baseuserarr, [
'firstaccess' => 0]),
'samesite' => false,
'outcome' => 'match'
],
'no samesite match existing deleted in db, alive in backup, by db firstaccess (2B1)' => [
'dbuser' => array_merge($baseuserarr, [
'deleted' => 1]),
'backupuser' => array_merge($baseuserarr, [
'mail' => 'this_wont_match']),
'samesite' => false,
'outcome' => 'match'
],
'no samesite match existing deleted in db, alive in backup (2B2)' => [
'dbuser' => array_merge($baseuserarr, [
'deleted' => 1,
'forceemailcleanup' => true]),
'backupuser' => $baseuserarr,
'samesite' => false,
'outcome' => 'match'
],
'no samesite match existing alive in db, deleted in backup (2C)' => [
'dbuser' => $baseuserarr,
'backupuser' => array_merge($baseuserarr, [
'deleted' => 1]),
'samesite' => false,
'outcome' => 'match'
],
'no samesite conflict (2D)' => [
'dbuser' => $baseuserarr,
'backupuser' => array_merge($baseuserarr, [
'email' => 'anotheruser@example.com', 'firstaccess' => 0]),
'samesite' => false,
'outcome' => false
],
'no samesite create user (2E)' => [
'dbuser' => $baseuserarr,
'backupuser' => array_merge($baseuserarr, [
'username' => 'newusername']),
'samesite' => false,
'outcome' => true
],
];
}
/**
* Test restore precheck_user method
*
* @dataProvider precheck_user_provider
* @covers restore_dbops::precheck_user()
*
* @param array $dbuser
* @param array $backupuser
* @param bool $samesite
* @param mixed $outcome
**/
public function test_precheck_user($dbuser, $backupuser, $samesite, $outcome) {
global $DB;
$this->resetAfterTest();
$dbuser = (object)$dbuser;
$backupuser = (object)$backupuser;
$siteid = null;
// If the backup user must be deleted, simulate it (by temp inserting to DB, deleting and fetching it back).
if ($backupuser->deleted) {
$backupuser->id = $DB->insert_record('user', array_merge((array)$backupuser, ['deleted' => 0]));
delete_user($backupuser);
$backupuser = $DB->get_record('user', ['id' => $backupuser->id]);
$DB->delete_records('user', ['id' => $backupuser->id]);
unset($backupuser->id);
}
// Create the db user, normally.
$dbuser->id = $DB->insert_record('user', array_merge((array)$dbuser, ['deleted' => 0]));
$backupuser->id = $backupuser->id ?? $dbuser->id;
// We may want to enable the import_general_duplicate_admin_allowed setting and look for old admin records.
if ($dbuser->forceduplicateadminallowed) {
set_config('import_general_duplicate_admin_allowed', true, 'backup');
$siteid = 'old_site_id';
}
// If the DB user must be deleted, do it and fetch it back.
if ($dbuser->deleted) {
delete_user($dbuser);
// We may want to clean the mail field (old behavior, not containing the current md5(username).
if ($dbuser->forceemailcleanup) {
$DB->set_field('user', 'email', '', ['id' => $dbuser->id]);
}
}
// Get the dbuser record, because we may have changed it above.
$dbuser = $DB->get_record('user', ['id' => $dbuser->id]);
$method = (new ReflectionClass('restore_dbops'))->getMethod('precheck_user');
$method->setAccessible(true);
$result = $method->invoke(null, $backupuser, $samesite, $siteid);
if (is_bool($result)) {
$this->assertSame($outcome, $result);
} else {
$outcome = $dbuser; // Outcome is not bool, matching found, so it must be the dbuser,
// Just check ids, it means the expected match has been found in database.
$this->assertSame($outcome->id, $result->id);
}
}
}
+10 -3
View File
@@ -305,10 +305,17 @@ class async_helper {
$tabledata = array();
// Get relevant backup ids based on context instance id.
$select = 'itemid = ? AND execution = ? AND status < ? AND status > ?';
$params = array($instanceid, backup::EXECUTION_DELAYED, backup::STATUS_FINISHED_ERR, backup::STATUS_NEED_PRECHECK);
$backups = $DB->get_records_select('backup_controllers', $select, $params, 'timecreated DESC', 'id, backupid, timecreated');
$select = 'itemid = :itemid AND execution = :execution AND status < :status1 AND status > :status2 ' .
'AND operation = :operation';
$params = [
'itemid' => $instanceid,
'execution' => backup::EXECUTION_DELAYED,
'status1' => backup::STATUS_FINISHED_ERR,
'status2' => backup::STATUS_NEED_PRECHECK,
'operation' => 'backup',
];
$backups = $DB->get_records_select('backup_controllers', $select, $params, 'timecreated DESC', 'id, backupid, timecreated');
foreach ($backups as $backup) {
$bc = \backup_controller::load_controller($backup->backupid); // Get the backup controller.
$filename = $bc->get_plan()->get_setting('filename')->get_value();
+4 -4
View File
@@ -199,7 +199,7 @@ class core_badges_assertion {
$class['criteria'] = $this->_url->out(false); // Currently issued badge URL.
if ($issued) {
if ($this->_obversion == OPEN_BADGES_V2) {
$issuerurl = new moodle_url('/badges/badge_json.php', array('id' => $this->get_badge_id(), 'action' => 0));
$issuerurl = new moodle_url('/badges/issuer_json.php', array('id' => $this->get_badge_id()));
} else {
$issuerurl = new moodle_url('/badges/assertion.php', array('b' => $this->_data->uniquehash, 'action' => 0));
}
@@ -233,7 +233,8 @@ class core_badges_assertion {
$issuer['email'] = $CFG->badges_defaultissuercontact;
}
} else {
$issuer = badges_get_default_issuer();
$badge = new badge($this->get_badge_id());
$issuer = $badge->get_badge_issuer();
}
}
$this->embed_data_badge_version2($issuer, OPEN_BADGES_V2_TYPE_ISSUER);
@@ -341,8 +342,7 @@ class core_badges_assertion {
'/badges/badge_json.php',
array('id' => $this->get_badge_id())
);
$issuerurl = new moodle_url('/badges/badge_json.php', array('id' => $this->get_badge_id(), 'action' => 0,
'obversion' => $this->_obversion));
$issuerurl = new moodle_url('/badges/issuer_json.php', ['id' => $this->get_badge_id()]);
// For assertion.
if ($type == OPEN_BADGES_V2_TYPE_ASSERTION) {
$json['@context'] = OPEN_BADGES_V2_CONTEXT;
+2 -2
View File
@@ -929,12 +929,12 @@ class badge {
*/
public function get_badge_issuer() {
$issuer = array();
$issuerurl = new moodle_url('/badges/badge_json.php', array('id' => $this->id, 'action' => 0));
$issuer['name'] = $this->issuername;
$issuer['url'] = $this->issuerurl;
$issuer['email'] = $this->issuercontact;
$issuer['@context'] = OPEN_BADGES_V2_CONTEXT;
$issuer['id'] = $this->issuerurl;
$issueridurl = new moodle_url('/badges/issuer_json.php', array('id' => $this->id));
$issuer['id'] = $issueridurl->out(false);
$issuer['type'] = OPEN_BADGES_V2_TYPE_ISSUER;
return $issuer;
}
+12 -2
View File
@@ -49,7 +49,6 @@ class badge extends moodleform {
$mform = $this->_form;
$badge = (isset($this->_customdata['badge'])) ? $this->_customdata['badge'] : false;
$action = $this->_customdata['action'];
$languages = get_string_manager()->get_list_of_languages();
$mform->addElement('header', 'badgedetails', get_string('badgedetails', 'badges'));
$mform->addElement('text', 'name', get_string('name'), array('size' => '70'));
@@ -61,6 +60,8 @@ class badge extends moodleform {
$mform->addElement('text', 'version', get_string('version', 'badges'), array('size' => '70'));
$mform->setType('version', PARAM_TEXT);
$mform->addHelpButton('version', 'version', 'badges');
$languages = get_string_manager()->get_list_of_languages();
$mform->addElement('select', 'language', get_string('language'), $languages);
$mform->addHelpButton('language', 'language', 'badges');
@@ -157,7 +158,16 @@ class badge extends moodleform {
$mform->setType('action', PARAM_TEXT);
if ($action == 'new') {
$mform->setDefault('language', $CFG->lang);
// Try to set default badge language to that of current language, or it's parent.
$language = current_language();
if (isset($languages[$language])) {
$defaultlanguage = $language;
} else {
// Calling get_parent_language returns an empty string instead of 'en'.
$defaultlanguage = get_parent_language($language) ?: 'en';
}
$mform->setDefault('language', $defaultlanguage);
$this->add_action_buttons(true, get_string('createbutton', 'badges'));
} else {
// Add hidden fields.
+52
View File
@@ -0,0 +1,52 @@
<?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/>.
/**
* Serve Issuer JSON for related badge or default Issuer if no badge is defined.
*
* @package core
* @subpackage badges
* @copyright 2020 Sara Arjona <sara@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('AJAX_SCRIPT', true);
define('NO_MOODLE_COOKIES', true); // No need for a session here.
require_once(__DIR__ . '/../config.php');
require_once($CFG->libdir . '/badgeslib.php');
$id = optional_param('id', null, PARAM_INT);
if (empty($id)) {
// Get the default issuer for this site.
$json = badges_get_default_issuer();
} else {
// Get the issuer for this badge.
$badge = new badge($id);
if ($badge->status != BADGE_STATUS_INACTIVE) {
$json = $badge->get_badge_issuer();
} else {
// The badge doen't exist or not accessible for the users.
header("HTTP/1.0 410 Gone");
$badgeurl = new moodle_url('/badges/issuer_json.php', array('id' => $id));
$json = ['id' => $badgeurl->out()];
$json['error'] = get_string('error:relatedbadgedoesntexist', 'badges');
}
}
echo $OUTPUT->header();
echo json_encode($json);
+41 -5
View File
@@ -114,23 +114,59 @@ class PNG_MetaDataHandler
* @param string $value Currently an assertion URL that is added to an image metadata.
*
* @return string $result File content with a new chunk as a string. Can be used in file_put_contents() to write to a file.
* @throws \moodle_exception when unsupported chunk type is defined.
*/
public function add_chunks($type, $key, $value) {
if (strlen($key) > 79) {
debugging('Key is too big');
}
// tEXt Textual data.
// Keyword: 1-79 bytes (character string)
// Null separator: 1 byte
// Text: n bytes (character string)
$data = $key . "\0" . $value;
$dataparts = [];
if ($type === 'iTXt') {
// International textual data (iTXt).
// Keyword: 1-79 bytes (character string).
$dataparts[] = $key;
// Null separator: 1 byte.
$dataparts[] = "\x00";
// Compression flag: 1 byte
// A value of 0 means no compression.
$dataparts[] = "\x00";
// Compression method: 1 byte
// If compression is disabled, the method should also be 0.
$dataparts[] = "\x00";
// Language tag: 0 or more bytes (character string)
// When there is no language specified leave empty.
// Null separator: 1 byte.
$dataparts[] = "\x00";
// Translated keyword: 0 or more bytes
// When there is no translation specified, leave empty.
// Null separator: 1 byte.
$dataparts[] = "\x00";
// Text: 0 or more bytes.
$dataparts[] = $value;
} else if ($type === 'tEXt') {
// Textual data (tEXt).
// Keyword: 1-79 bytes (character string).
$dataparts[] = $key;
// Null separator: 1 byte.
$dataparts[] = "\0";
// Text: n bytes (character string).
$dataparts[] = $value;
} else {
throw new \moodle_exception('Unsupported chunk type: ' . $type);
}
$data = implode($dataparts);
$crc = pack("N", crc32($type . $data));
$len = pack("N", strlen($data));
// Chunk format: length + type + data + CRC.
// CRC is a CRC-32 computed over the chunk type and chunk data.
$newchunk = $len . $type . $data . $crc;
$this->_chunks[$type] = $data;
$result = substr($this->_contents, 0, $this->_size - 12)
. $newchunk
@@ -52,8 +52,8 @@ class block_activity_modules extends block_list {
$archetypes = array();
foreach($modinfo->cms as $cm) {
// Exclude activities which are not visible or have no link (=label)
if (!$cm->uservisible or !$cm->has_view()) {
// Exclude activities that aren't visible or have no view link (e.g. label). Account for folder being displayed inline.
if (!$cm->uservisible || (!$cm->has_view() && strcmp($cm->modname, 'folder') !== 0)) {
continue;
}
if (array_key_exists($cm->modname, $modfullnames)) {
+8 -5
View File
@@ -37,11 +37,14 @@ $string['privacy:metadata'] = 'The File cache cachestore plugin stores data brie
$string['prescan'] = 'Prescan directory';
$string['prescan_help'] = 'If enabled the directory is scanned when the cache is first used and requests for files are first checked against the scan data. This can help if you have a slow file system and are finding that file operations are causing you a bottle neck.';
$string['singledirectory'] = 'Single directory store';
$string['singledirectory_help'] = 'If enabled files (cached items) will be stored in a single directory rather than being broken up into multiple directories.<br />
Enabling this will speed up file interactions but comes at the cost of increased risk of hitting file system limitations.<br />
It is advisable to only turn this on if the following is true:<br />
- If you know the number of items in the cache is going to be small enough that it won\'t cause issues on the file system you are running with.<br />
- The data being cached is not expensive to generate. If it is then sticking with the default may still be the better option as it reduces the chance of issues.';
$string['singledirectory_help'] = 'If enabled files (cached items) will be stored in a single directory rather than being broken up into multiple directories.
Enabling this will speed up file interactions but comes at the cost of increased risk of hitting file system limitations.
It is advisable to only turn this on if the following is true:
* If you know the number of items in the cache is going to be small enough that it won\'t cause issues on the file system you are running with.
* The data being cached is not expensive to generate. If it is then sticking with the default may still be the better option as it reduces the chance of issues.';
/**
* This is is like the file store, but designed for siutations where:
+1 -1
View File
@@ -1 +1 @@
define(["jquery","core/str","core/notification","core/custom_interaction_events","core/modal","core/modal_registry","core/modal_factory","core/modal_events","core_calendar/modal_event_form","core_calendar/repository","core_calendar/events","core_calendar/modal_delete","core_calendar/selectors"],function(a,b,c,d,e,f,g,h,i,j,k,l,m){function n(d,e,f){var i=[{key:"deleteevent",component:"calendar"}];f=parseInt(f,10);var m,n=f>1;n?(i.push({key:"confirmeventseriesdelete",component:"calendar",param:{name:e,count:f}}),m=g.create({type:l.TYPE})):(i.push({key:"confirmeventdelete",component:"calendar",param:e}),m=g.create({type:g.types.SAVE_CANCEL})),m.then(function(a){a.show()}).fail(c.exception);var o=b.get_strings(i),p=a.when(o,m).then(function(b,e){return e.setTitle(b[0]),e.setBody(b[1]),n||e.setSaveButtonText(b[0]),e.getRoot().on(h.save,function(){j.deleteEvent(d,!1).then(function(){a("body").trigger(k.deleted,[d,!1])})["catch"](c.exception)}),e.getRoot().on(k.deleteAll,function(){j.deleteEvent(d,!0).then(function(){a("body").trigger(k.deleted,[d,!0])})["catch"](c.exception)}),e}).fail(c.exception);return p}function o(b){b.on("click",m.actions.remove,function(b){var c=a(this).closest(m.eventItem),d=c.data("eventId"),e=c.data("eventTitle"),f=c.data("eventCount");n(d,e,f),b.preventDefault()})}function p(b,d){return d.then(function(c){a("body").on(k.editEvent,function(a,d){var e=b.find(m.wrapper);c.setEventId(d),c.setContextId(e.data("contextId")),c.show(),a.stopImmediatePropagation()})}).fail(c.exception),d}var q=function(b){var d=g.create({type:i.TYPE,large:!0});return b.on("click",m.actions.create,function(a){d.then(function(a){var c=b.find(m.wrapper),d=c.data("categoryid");"undefined"!=typeof d&&a.setCategoryId(d);var e=b.find(m.today),f=b.find(m.day);!e.length&&f.length&&a.setStartTime(f.data("newEventTimestamp")),a.setContextId(c.data("contextId")),a.setCourseId(c.data("courseid")),a.show()}).fail(c.exception),a.preventDefault()}),b.on("click",m.actions.edit,function(b){b.preventDefault();var e=a(b.currentTarget),f=e.closest(m.wrapper),g=e.closest(m.eventItem);d.then(function(a){a.setEventId(g.data("eventId")),a.setContextId(f.data("contextId")),a.show(),b.stopImmediatePropagation()}).fail(c.exception)}),d};return{registerRemove:o,registerEditListeners:p,registerEventFormModal:q}});
define(["jquery","core/str","core/notification","core/custom_interaction_events","core/modal","core/modal_registry","core/modal_factory","core/modal_events","core_calendar/modal_event_form","core_calendar/repository","core_calendar/events","core_calendar/modal_delete","core_calendar/selectors","core/pending"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){function o(d,e,f){var i=[{key:"deleteevent",component:"calendar"}];f=parseInt(f,10);var m,o=f>1;o?(i.push({key:"confirmeventseriesdelete",component:"calendar",param:{name:e,count:f}}),m=g.create({type:l.TYPE})):(i.push({key:"confirmeventdelete",component:"calendar",param:e}),m=g.create({type:g.types.SAVE_CANCEL}));var p=b.get_strings(i),q=a.when(p,m).then(function(b,e){return e.setTitle(b[0]),e.setBody(b[1]),o||e.setSaveButtonText(b[0]),e.show(),e.getRoot().on(h.save,function(){var b=new n("calendar/crud:initModal:deletedevent");j.deleteEvent(d,!1).then(function(){a("body").trigger(k.deleted,[d,!1])}).then(b.resolve)["catch"](c.exception)}),e.getRoot().on(k.deleteAll,function(){var b=new n("calendar/crud:initModal:deletedallevent");j.deleteEvent(d,!0).then(function(){a("body").trigger(k.deleted,[d,!0])}).then(b.resolve)["catch"](c.exception)}),e})["catch"](c.exception);return q}function p(b){b.on("click",m.actions.remove,function(b){var c=a(this).closest(m.eventItem),d=c.data("eventId"),e=c.data("eventTitle"),f=c.data("eventCount");o(d,e,f),b.preventDefault()})}function q(b,d){return d.then(function(c){a("body").on(k.editEvent,function(a,d){var e=b.find(m.wrapper);c.setEventId(d),c.setContextId(e.data("contextId")),c.show(),a.stopImmediatePropagation()})}).fail(c.exception),d}var r=function(b){var d=g.create({type:i.TYPE,large:!0});return b.on("click",m.actions.create,function(a){d.then(function(a){var c=b.find(m.wrapper),d=c.data("categoryid");"undefined"!=typeof d&&a.setCategoryId(d);var e=b.find(m.today),f=b.find(m.day);!e.length&&f.length&&a.setStartTime(f.data("newEventTimestamp")),a.setContextId(c.data("contextId")),a.setCourseId(c.data("courseid")),a.show()}).fail(c.exception),a.preventDefault()}),b.on("click",m.actions.edit,function(b){b.preventDefault();var e=a(b.currentTarget),f=e.closest(m.wrapper),g=e.closest(m.eventItem);d.then(function(a){a.setEventId(g.data("eventId")),a.setContextId(f.data("contextId")),a.show(),b.stopImmediatePropagation()}).fail(c.exception)}),d};return{registerRemove:p,registerEditListeners:q,registerEventFormModal:r}});
+1 -1
View File
@@ -20,7 +20,7 @@
* components by listening for and responding to different events
* triggered within the calendar UI.
*
* @module core_calendar/calendar
* @module core_calendar/calendar_mini
* @package core_calendar
* @copyright 2017 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+10 -9
View File
@@ -35,6 +35,7 @@ define([
'core_calendar/events',
'core_calendar/modal_delete',
'core_calendar/selectors',
'core/pending',
],
function(
$,
@@ -49,7 +50,8 @@ function(
CalendarRepository,
CalendarEvents,
ModalDelete,
CalendarSelectors
CalendarSelectors,
Pending
) {
/**
@@ -101,13 +103,6 @@ function(
);
}
deletePromise.then(function(deleteModal) {
deleteModal.show();
return;
})
.fail(Notification.exception);
var stringsPromise = Str.get_strings(deleteStrings);
var finalPromise = $.when(stringsPromise, deletePromise)
@@ -118,27 +113,33 @@ function(
deleteModal.setSaveButtonText(strings[0]);
}
deleteModal.show();
deleteModal.getRoot().on(ModalEvents.save, function() {
var pendingPromise = new Pending('calendar/crud:initModal:deletedevent');
CalendarRepository.deleteEvent(eventId, false)
.then(function() {
$('body').trigger(CalendarEvents.deleted, [eventId, false]);
return;
})
.then(pendingPromise.resolve)
.catch(Notification.exception);
});
deleteModal.getRoot().on(CalendarEvents.deleteAll, function() {
var pendingPromise = new Pending('calendar/crud:initModal:deletedallevent');
CalendarRepository.deleteEvent(eventId, true)
.then(function() {
$('body').trigger(CalendarEvents.deleted, [eventId, true]);
return;
})
.then(pendingPromise.resolve)
.catch(Notification.exception);
});
return deleteModal;
})
.fail(Notification.exception);
.catch(Notification.exception);
return finalPromise;
}
+26
View File
@@ -126,6 +126,10 @@ class day_exporter extends exporter {
'type' => PARAM_URL,
'optional' => true,
],
'viewdaylinktitle' => [
'type' => PARAM_RAW,
'optional' => true,
],
'events' => [
'type' => calendar_event_exporter::read_properties_definition(),
'multiple' => true,
@@ -183,6 +187,10 @@ class day_exporter extends exporter {
'viewdaylink' => $this->url->out(false),
];
if ($viewdaylinktitle = $this->get_view_link_title()) {
$return['viewdaylinktitle'] = $viewdaylinktitle;
}
$cache = $this->related['cache'];
$eventexporters = array_map(function($event) use ($cache, $output) {
@@ -267,4 +275,22 @@ class day_exporter extends exporter {
'time' => $this->calendar->time,
]);
}
/**
* Get the title for view link.
*
* @return string
*/
protected function get_view_link_title() {
$title = null;
$userdate = userdate($this->data[0], get_string('strftimedayshort'));
if ($this->data['istoday']) {
$title = get_string('todayplustitle', 'calendar', $userdate);
} else if (count($this->related['events'])) {
$title = get_string('eventsfor', 'calendar', $userdate);
}
return $title;
}
}
+7 -3
View File
@@ -292,12 +292,16 @@ class core_calendar_renderer extends plugin_renderer_base {
$courseurl = new moodle_url($returnurl);
$courseurl->remove_params('course');
if ($label === null) {
if (empty($label)) {
$label = get_string('listofcourses');
$labelclass = 'sr-only';
} else {
$labelclass = 'mr-1';
}
$select = html_writer::label($label, 'course', false, ['class' => 'mr-1']);
$select .= html_writer::select($courseoptions, 'course', $selected, false, ['class' => 'cal_courses_flt']);
$select = html_writer::label($label, 'course', false, ['class' => $labelclass]);
$select .= html_writer::select($courseoptions, 'course', $selected, false,
['class' => 'cal_courses_flt', 'id' => 'course']);
return $select;
}
@@ -33,10 +33,11 @@
}} data-container="body"{{!
}} data-toggle="popover"{{!
}} data-html="true"{{!
}} data-trigger="hover"{{!
}} data-trigger="hover focus"{{!
}} data-placement="top"{{!
}} data-title="{{$title}}{{title}}{{/title}}"{{!
}} data-alternate="{{$nocontent}}{{/nocontent}}"{{!
}} aria-label="{{viewdaylinktitle}}"{{!
}}>{{$day}}{{day}}{{/day}}</a>
<div class="hidden">
{{$content}}{{/content}}
+3 -5
View File
@@ -47,7 +47,7 @@
<thead>
<tr>
{{# daynames }}
<th class="header text-xs-center">
<th class="header text-xs-center" aria-label="{{fullname}}">
{{shortname}}
</th>
{{/ daynames }}
@@ -73,7 +73,7 @@
data-new-event-timestamp="{{neweventtimestamp}}">
<div class="d-none d-md-block hidden-phone text-xs-center">
{{#hasevents}}
<a data-action="view-day-link" href="{{viewdaylink}}" class="day" title="{{viewdaylinktitle}}">{{mday}}</a>
<a data-action="view-day-link" href="{{viewdaylink}}" class="day" aria-label="{{viewdaylinktitle}}">{{mday}}</a>
{{/hasevents}}
{{^hasevents}}
{{mday}}
@@ -121,12 +121,10 @@
</div>
<div class="d-md-none hidden-desktop hidden-tablet">
{{#hasevents}}
<a data-action="view-day-link" href="{{viewdaylink}}" class="day" title="{{viewdaylinktitle}}">{{mday}}</a>
<a data-action="view-day-link" href="{{viewdaylink}}" class="day" aria-label="{{viewdaylinktitle}}">{{mday}}</a>
{{/hasevents}}
{{^hasevents}}
<div data-region="day-content">
{{mday}}
</div>
{{/hasevents}}
</div>
</td>
+2 -2
View File
@@ -77,8 +77,8 @@
<thead>
<tr>
{{# daynames }}
<th class="header text-xs-center" scope="col">
<abbr title="{{fullname}}">{{shortname}}</abbr>
<th class="header text-xs-center" scope="col" aria-label="{{fullname}}">
{{shortname}}
</th>
{{/ daynames }}
</tr>
+1 -1
View File
@@ -15,7 +15,7 @@
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template calendar/calendar_threemonth
@template calendar/threemonth_month
Calendar view to show three months as a block.
+12
View File
@@ -52,11 +52,23 @@ require_once($CFG->dirroot.'/calendar/lib.php');
$categoryid = optional_param('category', null, PARAM_INT);
$courseid = optional_param('course', SITEID, PARAM_INT);
$view = optional_param('view', 'upcoming', PARAM_ALPHA);
$day = optional_param('cal_d', 0, PARAM_INT);
$mon = optional_param('cal_m', 0, PARAM_INT);
$year = optional_param('cal_y', 0, PARAM_INT);
$time = optional_param('time', 0, PARAM_INT);
$lookahead = optional_param('lookahead', null, PARAM_INT);
$url = new moodle_url('/calendar/view.php');
// If a day, month and year were passed then convert it to a timestamp. If these were passed
// then we can assume the day, month and year are passed as Gregorian, as no where in core
// should we be passing these values rather than the time. This is done for BC.
if (!empty($day) && !empty($mon) && !empty($year)) {
if (checkdate($mon, $day, $year)) {
$time = make_timestamp($year, $mon, $day);
}
}
if (empty($time)) {
$time = time();
}
+34
View File
@@ -4777,6 +4777,40 @@ class api {
$DB->delete_records(template_cohort::TABLE, array('cohortid' => $cohort->id));
}
/**
* Action to perform when a user is deleted.
*
* @param int $userid The user id.
*/
public static function hook_user_deleted($userid) {
global $DB;
$usercompetencies = $DB->get_records(user_competency::TABLE, ['userid' => $userid], '', 'id');
foreach ($usercompetencies as $usercomp) {
$DB->delete_records(evidence::TABLE, ['usercompetencyid' => $usercomp->id]);
}
$DB->delete_records(user_competency::TABLE, ['userid' => $userid]);
$DB->delete_records(user_competency_course::TABLE, ['userid' => $userid]);
$DB->delete_records(user_competency_plan::TABLE, ['userid' => $userid]);
// Delete any associated files.
$fs = get_file_storage();
$context = context_user::instance($userid);
$userevidences = $DB->get_records(user_evidence::TABLE, ['userid' => $userid], '', 'id');
foreach ($userevidences as $userevidence) {
$DB->delete_records(user_evidence_competency::TABLE, ['userevidenceid' => $userevidence->id]);
$DB->delete_records(user_evidence::TABLE, ['id' => $userevidence->id]);
$fs->delete_area_files($context->id, 'core_competency', 'userevidence', $userevidence->id);
}
$userplans = $DB->get_records(plan::TABLE, ['userid' => $userid], '', 'id');
foreach ($userplans as $userplan) {
$DB->delete_records(plan_competency::TABLE, ['planid' => $userplan->id]);
$DB->delete_records(plan::TABLE, ['id' => $userplan->id]);
}
}
/**
* Manually grade a user competency.
*
+43
View File
@@ -207,4 +207,47 @@ class core_competency_hooks_testcase extends advanced_testcase {
$this->assertEquals(1, \core_competency\template_cohort::count_records(array('templateid' => $t1->get('id'))));
$this->assertEquals(0, \core_competency\template_cohort::count_records(array('templateid' => $t2->get('id'))));
}
public function test_hook_user_deleted() {
$this->resetAfterTest();
$dg = $this->getDataGenerator();
$ccg = $dg->get_plugin_generator('core_competency');
$u1 = $dg->create_user();
$framework = $ccg->create_framework();
$comp1 = $ccg->create_competency(['competencyframeworkid' => $framework->get('id')]);
$comp2 = $ccg->create_competency(['competencyframeworkid' => $framework->get('id')]);
$c1 = $dg->create_course();
$cc1a = $ccg->create_course_competency(['competencyid' => $comp1->get('id'), 'courseid' => $c1->id]);
$cc1b = $ccg->create_course_competency(['competencyid' => $comp2->get('id'), 'courseid' => $c1->id]);
$assign1a = $dg->create_module('assign', ['course' => $c1]);
$assign1b = $dg->create_module('assign', ['course' => $c1]);
$cmc1a = $ccg->create_course_module_competency(['competencyid' => $comp1->get('id'), 'cmid' => $assign1a->cmid]);
$cmc1b = $ccg->create_course_module_competency(['competencyid' => $comp1->get('id'), 'cmid' => $assign1b->cmid]);
$ucc1a = $ccg->create_user_competency_course(['competencyid' => $comp1->get('id'), 'courseid' => $c1->id,
'userid' => $u1->id]);
$ucc1b = $ccg->create_user_competency_course(['competencyid' => $comp2->get('id'), 'courseid' => $c1->id,
'userid' => $u1->id]);
$c2 = $dg->create_course();
$cc2a = $ccg->create_course_competency(['competencyid' => $comp1->get('id'), 'courseid' => $c2->id]);
$cc2b = $ccg->create_course_competency(['competencyid' => $comp2->get('id'), 'courseid' => $c2->id]);
$assign2a = $dg->create_module('assign', ['course' => $c2]);
$assign2b = $dg->create_module('assign', ['course' => $c2]);
$cmc2a = $ccg->create_course_module_competency(['competencyid' => $comp1->get('id'), 'cmid' => $assign2a->cmid]);
$cmc2b = $ccg->create_course_module_competency(['competencyid' => $comp1->get('id'), 'cmid' => $assign2b->cmid]);
$ucc2a = $ccg->create_user_competency_course(['competencyid' => $comp1->get('id'), 'courseid' => $c2->id,
'userid' => $u1->id]);
$ucc2b = $ccg->create_user_competency_course(['competencyid' => $comp2->get('id'), 'courseid' => $c2->id,
'userid' => $u1->id]);
reset_course_userdata((object) ['id' => $c1->id, 'reset_competency_ratings' => true]);
delete_user($u1);
// Assert the records don't exist anymore.
$this->assertEquals(0, user_competency_course::count_records(['courseid' => $c1->id, 'userid' => $u1->id]));
}
}
+1 -1
View File
@@ -13,7 +13,7 @@
"require-dev": {
"phpunit/phpunit": "7.5.*",
"phpunit/dbunit": "4.0.*",
"moodlehq/behat-extension": "3.37.3",
"moodlehq/behat-extension": "3.37.4",
"mikey179/vfsstream": "^1.6",
"instaclick/php-webdriver": "dev-local as 1.x-dev"
}
Generated
+756 -402
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
define(["jquery"],function(a){var b=function(b){var d=a(this);if("sectionname"===d.data("itemtype")){var e=M.course.format.get_config(),f=d.closest("."+e.section_class);c(f,b.ajaxreturn.value)}},c=function(a,b){a.attr("aria-label",b),a.find(".hidden.sectionname").text(b)};a("body").on("updated",".inplaceeditable",b)});
+1 -1
View File
@@ -569,7 +569,7 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
str.get_string('numberweeks').done(function(strNumberSections) {
var trigger = $(SELECTOR.ADDSECTIONS),
modalTitle = trigger.attr('data-add-sections'),
newSections = trigger.attr('new-sections');
newSections = trigger.attr('data-new-sections');
var modalBody = $('<div><label for="add_section_numsections"></label> ' +
'<input id="add_section_numsections" type="number" min="1" max="' + newSections + '" value="1"></div>');
modalBody.find('label').html(strNumberSections);
+56
View File
@@ -0,0 +1,56 @@
// 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/>.
/**
* Define listeners related to sections.
*
* @module core_course/sectionlistener
* @package core_course
* @copyright 2020 University of Nottingham
* @author Neill Magill <neill.magill@nottingham.ac.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define(['jquery'], function($) {
/**
* Processes an updated event.
*
* We only want to handle events related to a section, and not activities.
*
* @param {Event} e The updated event
*/
var processUpdatedEvent = function(e) {
var editable = $(this);
if (editable.data('itemtype') === 'sectionname') {
var config = M.course.format.get_config();
// A section name got updated.
var section = editable.closest('.' + config.section_class);
updateSectionName(section, e.ajaxreturn.value);
}
// Ignore other types of inplace updates, for example activity name changes.
};
/**
* Updates the name of the section in places outside of the inplace editable field.
*
* @param {jQuery} section The section that was updated.
* @param {String} newname The new name for the section.
*/
var updateSectionName = function(section, newname) {
section.attr('aria-label', newname);
section.find('.hidden.sectionname').text(newname);
};
$('body').on('updated', '.inplaceeditable', processUpdatedEvent);
});
+38 -7
View File
@@ -717,13 +717,49 @@ class core_course_category implements renderable, cacheable_object, IteratorAggr
* @return mixed
*/
protected static function get_tree($id) {
global $DB;
$coursecattreecache = cache::make('core', 'coursecattree');
$rv = $coursecattreecache->get($id);
if ($rv !== false) {
return $rv;
}
// Might need to rebuild the tree. Put a lock in place to ensure other requests don't try and do this in parallel.
$lockfactory = \core\lock\lock_config::get_lock_factory('core_coursecattree');
$lock = $lockfactory->get_lock('core_coursecattree_cache',
course_modinfo::COURSE_CACHE_LOCK_WAIT, course_modinfo::COURSE_CACHE_LOCK_EXPIRY);
if ($lock === false) {
// Couldn't get a lock to rebuild the tree.
return [];
}
$rv = $coursecattreecache->get($id);
if ($rv !== false) {
// Tree was built while we were waiting for the lock.
$lock->release();
return $rv;
}
// Re-build the tree.
try {
$all = self::rebuild_coursecattree_cache_contents();
$coursecattreecache->set_many($all);
} finally {
$lock->release();
}
if (array_key_exists($id, $all)) {
return $all[$id];
}
// Requested non-existing category.
return array();
}
/**
* Rebuild the course category tree as an array, including an extra "countall" field.
*
* @return array
* @throws coding_exception
* @throws dml_exception
* @throws moodle_exception
*/
private static function rebuild_coursecattree_cache_contents() : array {
global $DB;
$sql = "SELECT cc.id, cc.parent, cc.visible
FROM {course_categories} cc
ORDER BY cc.sortorder";
@@ -760,12 +796,7 @@ class core_course_category implements renderable, cacheable_object, IteratorAggr
}
// We must add countall to all in case it was the requested ID.
$all['countall'] = $count;
$coursecattreecache->set_many($all);
if (array_key_exists($id, $all)) {
return $all[$id];
}
// Requested non-existing category.
return array();
return $all;
}
/**
@@ -68,6 +68,17 @@ class course_handler extends \core_customfield\handler {
return self::$singleton;
}
/**
* Run reset code after unit tests to reset the singleton usage.
*/
public static function reset_caches(): void {
if (!PHPUNIT_TEST) {
throw new \coding_exception('This feature is only intended for use in unit tests');
}
static::$singleton = null;
}
/**
* The current user can configure custom fields on this component.
*
+20
View File
@@ -330,6 +330,26 @@ class helper {
'string' => new \lang_string('restorecourse', 'admin')
);
}
// Recyclebyn.
if (\tool_recyclebin\category_bin::is_enabled()) {
$categorybin = new \tool_recyclebin\category_bin($category->id);
if ($categorybin->can_view()) {
$autohide = get_config('tool_recyclebin', 'autohide');
if ($autohide) {
$items = $categorybin->get_items();
} else {
$items = [];
}
if (!$autohide || !empty($items)) {
$pluginname = get_string('pluginname', 'tool_recyclebin');
$actions['recyclebin'] = [
'url' => new \moodle_url('/admin/tool/recyclebin/index.php', ['contextid' => $category->get_context()->id]),
'icon' => new \pix_icon('trash', $pluginname, 'tool_recyclebin'),
'string' => $pluginname
];
}
}
}
return $actions;
}
+41 -20
View File
@@ -208,17 +208,18 @@ class core_course_management_renderer extends plugin_renderer_base {
}
$courseicon = $this->output->pix_icon('i/course', get_string('courses'));
$bcatinput = array(
'id' => 'categorylistitem' . $category->id,
'type' => 'checkbox',
'name' => 'bcat[]',
'value' => $category->id,
'class' => 'bulk-action-checkbox',
'aria-label' => get_string('bulkactionselect', 'moodle', $text),
'class' => 'bulk-action-checkbox custom-control-input',
'data-action' => 'select'
);
$checkboxclass = '';
if (!$category->can_resort_subcategories() && !$category->has_manage_capability()) {
// Very very hardcoded here.
$bcatinput['style'] = 'visibility:hidden';
$checkboxclass = 'd-none';
}
$viewcaturl = new moodle_url('/course/management.php', array('categoryid' => $category->id));
@@ -260,8 +261,14 @@ class core_course_management_renderer extends plugin_renderer_base {
$html = html_writer::start_tag('li', $attributes);
$html .= html_writer::start_div('clearfix');
$html .= html_writer::start_div('float-left ba-checkbox');
$html .= html_writer::empty_tag('input', $bcatinput).'&nbsp;';
$html .= html_writer::start_div('float-left ' . $checkboxclass);
$html .= html_writer::start_div('custom-control custom-checkbox mr-1 ');
$html .= html_writer::empty_tag('input', $bcatinput);
$html .= html_writer::tag('label', '', array(
'aria-label' => get_string('bulkactionselect', 'moodle', $text),
'class' => 'custom-control-label',
'for' => 'categorylistitem' . $category->id));
$html .= html_writer::end_div();
$html .= html_writer::end_div();
$html .= $icon;
if ($hasactions) {
@@ -275,7 +282,7 @@ class core_course_management_renderer extends plugin_renderer_base {
$html .= html_writer::link($viewcaturl, $text, $textattributes);
$html .= html_writer::start_div('float-right d-flex');
if ($category->idnumber) {
$html .= html_writer::tag('span', s($category->idnumber), array('class' => 'dimmed idnumber'));
$html .= html_writer::tag('span', s($category->idnumber), array('class' => 'text-muted idnumber'));
}
if ($hasactions) {
$html .= $this->category_listitem_actions($category, $actions);
@@ -285,7 +292,7 @@ class core_course_management_renderer extends plugin_renderer_base {
html_writer::span($category->get_courses_count()) .
html_writer::span(get_string('courses'), 'accesshide', array('id' => $countid)) .
$courseicon,
'course-count dimmed',
'course-count text-muted',
array('aria-labelledby' => $countid)
);
$html .= html_writer::end_div();
@@ -574,7 +581,7 @@ class core_course_management_renderer extends plugin_renderer_base {
$a->total = $totalcourses;
$str = get_string('showingxofycourses', 'moodle', $a);
}
$html .= html_writer::div($str, 'listing-pagination-totals dimmed');
$html .= html_writer::div($str, 'listing-pagination-totals text-muted');
}
if ($viewmode !== 'default') {
@@ -609,16 +616,18 @@ class core_course_management_renderer extends plugin_renderer_base {
);
$bulkcourseinput = array(
'id' => 'courselistitem' . $course->id,
'type' => 'checkbox',
'name' => 'bc[]',
'value' => $course->id,
'class' => 'bulk-action-checkbox',
'aria-label' => get_string('bulkactionselect', 'moodle', $text),
'class' => 'bulk-action-checkbox custom-control-input',
'data-action' => 'select'
);
$checkboxclass = '';
if (!$category->has_manage_capability()) {
// Very very hardcoded here.
$bulkcourseinput['style'] = 'visibility:hidden';
$checkboxclass = 'd-none';
}
$viewcourseurl = new moodle_url($this->page->url, array('courseid' => $course->id));
@@ -631,13 +640,19 @@ class core_course_management_renderer extends plugin_renderer_base {
$html .= html_writer::div($this->output->pix_icon('i/move_2d', get_string('dndcourse')), 'float-left drag-handle');
}
$html .= html_writer::start_div('ba-checkbox float-left');
$html .= html_writer::empty_tag('input', $bulkcourseinput).'&nbsp;';
$html .= html_writer::start_div('float-left ' . $checkboxclass);
$html .= html_writer::start_div('custom-control custom-checkbox mr-1 ');
$html .= html_writer::empty_tag('input', $bulkcourseinput);
$html .= html_writer::tag('label', '', array(
'aria-label' => get_string('bulkactionselect', 'moodle', $text),
'class' => 'custom-control-label',
'for' => 'courselistitem' . $course->id));
$html .= html_writer::end_div();
$html .= html_writer::end_div();
$html .= html_writer::link($viewcourseurl, $text, array('class' => 'float-left coursename'));
$html .= html_writer::start_div('float-right');
if ($course->idnumber) {
$html .= html_writer::tag('span', s($course->idnumber), array('class' => 'dimmed idnumber'));
$html .= html_writer::tag('span', s($course->idnumber), array('class' => 'text-muted idnumber'));
}
$html .= $this->course_listitem_actions($category, $course);
$html .= html_writer::end_div();
@@ -1123,7 +1138,7 @@ class core_course_management_renderer extends plugin_renderer_base {
$a->total = $totalcourses;
$str = get_string('showingxofycourses', 'moodle', $a);
}
$html .= html_writer::div($str, 'listing-pagination-totals dimmed');
$html .= html_writer::div($str, 'listing-pagination-totals text-muted');
}
if ($totalcourses < $perpage) {
@@ -1186,10 +1201,10 @@ class core_course_management_renderer extends plugin_renderer_base {
if (core_course_category::get($course->category)->can_move_courses_out_of()) {
$bulkcourseinput = array(
'type' => 'checkbox',
'id' => 'coursesearchlistitem' . $course->id,
'name' => 'bc[]',
'value' => $course->id,
'class' => 'bulk-action-checkbox',
'aria-label' => get_string('bulkactionselect', 'moodle', $text),
'class' => 'bulk-action-checkbox custom-control-input',
'data-action' => 'select'
);
}
@@ -1200,14 +1215,20 @@ class core_course_management_renderer extends plugin_renderer_base {
$html .= html_writer::start_div('clearfix');
$html .= html_writer::start_div('float-left');
if ($bulkcourseinput) {
$html .= html_writer::empty_tag('input', $bulkcourseinput).'&nbsp;';
$html .= html_writer::start_div('custom-control custom-checkbox mr-1');
$html .= html_writer::empty_tag('input', $bulkcourseinput);
$html .= html_writer::tag('label', '', array(
'aria-label' => get_string('bulkactionselect', 'moodle', $text),
'class' => 'custom-control-label',
'for' => 'coursesearchlistitem' . $course->id));
$html .= html_writer::end_div();
}
$html .= html_writer::end_div();
$html .= html_writer::link($viewcourseurl, $text, array('class' => 'float-left coursename'));
$html .= html_writer::tag('span', $categoryname, array('class' => 'float-left categoryname'));
$html .= html_writer::tag('span', $categoryname, array('class' => 'float-left ml-3 text-muted'));
$html .= html_writer::start_div('float-right');
$html .= $this->search_listitem_actions($course);
$html .= html_writer::tag('span', s($course->idnumber), array('class' => 'dimmed idnumber'));
$html .= html_writer::tag('span', s($course->idnumber), array('class' => 'text-muted idnumber'));
$html .= html_writer::end_div();
$html .= html_writer::end_div();
$html .= html_writer::end_tag('li');
+3 -3
View File
@@ -514,7 +514,7 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
// Output section activities summary:
$o = '';
$o.= html_writer::start_tag('div', array('class' => 'section-summary-activities mdl-right'));
$o.= html_writer::start_tag('div', array('class' => 'section-summary-activities pr-2 mdl-right'));
foreach ($sectionmods as $mod) {
$o.= html_writer::start_tag('span', array('class' => 'activity-count'));
$o.= $mod['name'].': '.$mod['count'];
@@ -528,7 +528,7 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
$a->complete = $complete;
$a->total = $total;
$o.= html_writer::start_tag('div', array('class' => 'section-summary-activities mdl-right'));
$o.= html_writer::start_tag('div', array('class' => 'section-summary-activities pr-2 mdl-right'));
$o.= html_writer::tag('span', get_string('progresstotal', 'completion', $a), array('class' => 'activity-count'));
$o.= html_writer::end_tag('div');
}
@@ -1006,7 +1006,7 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
$icon = $this->output->pix_icon('t/add', '');
$newsections = $maxsections - $lastsection;
echo html_writer::link($url, $icon . $straddsections,
array('class' => 'add-sections', 'data-add-sections' => $straddsections, 'new-sections' => $newsections));
array('class' => 'add-sections', 'data-add-sections' => $straddsections, 'data-new-sections' => $newsections));
echo html_writer::end_tag('div');
}
}
+2 -2
View File
@@ -154,9 +154,9 @@ class format_singleactivity extends format_base {
if ($fetchtypes) {
$availabletypes = $this->get_supported_activities();
if ($this->course) {
if ($this->courseid) {
// The course exists. Test against the course.
$testcontext = context_course::instance($this->course->id);
$testcontext = context_course::instance($this->courseid);
} else if ($this->categoryid) {
// The course does not exist yet, but we have a category ID that we can test against.
$testcontext = context_coursecat::instance($this->categoryid);
@@ -0,0 +1,27 @@
@format @format_singleactivity
Feature: Edit format course to Single Activity format
In order to set the format course to single activity course
As a teacher
I need to edit the course settings and see the dropdown type activity
Scenario: Edit a format course as a teacher
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | summary | format |
| Course 1 | C1 | <p>Course summary</p> | topics |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And I log in as "teacher1"
And I am on "Course 1" course homepage
When I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| Course full name | My first course |
| Course short name | myfirstcourse |
| Format | Single activity format |
And I press "Update format"
Then I should see "Forum" in the "Type of activity" "field"
And I press "Save and display"
And I should see "Adding a new Forum"
+7 -5
View File
@@ -48,6 +48,7 @@ M.course.format.swap_sections = function(Y, node1, node2) {
* Process sections after ajax response
*
* @param {YUI} Y YUI3 instance
* @param {NodeList} sectionlist of sections
* @param {array} response ajax response
* @param {string} sectionfrom first affected section
* @param {string} sectionto last affected section
@@ -76,13 +77,14 @@ M.course.format.process_sections = function(Y, sectionlist, response, sectionfro
// Update section title.
var content = Y.Node.create('<span>' + response.sectiontitles[i] + '</span>');
sectionlist.item(i).all('.'+CSS.SECTIONNAME).setHTML(content);
// Update move icon.
ele = sectionlist.item(i).one(SELECTORS.SECTIONLEFTSIDE);
str = ele.getAttribute('alt');
// Update the drag handle.
ele = sectionlist.item(i).one(SELECTORS.SECTIONLEFTSIDE).ancestor('.section-handle');
str = ele.getAttribute('title');
stridx = str.lastIndexOf(' ');
newstr = str.substr(0, stridx +1) + i;
ele.setAttribute('alt', newstr);
ele.setAttribute('title', newstr); // For FireFox as 'alt' is not refreshed.
ele.setAttribute('title', newstr);
// Update the aria-label for the section.
sectionlist.item(i).setAttribute('aria-label', content.get('innerText').trim());
}
}
}
+1
View File
@@ -59,3 +59,4 @@ if (!empty($displaysection)) {
// Include course format js module
$PAGE->requires->js('/course/format/topics/format.js');
$PAGE->requires->js_call_amd('core_course/sectionlistener');
-34
View File
@@ -1,34 +0,0 @@
.course-content ul.topics {
margin: 0;
list-style: none;
}
.course-content ul.topics li.section .content {
margin: 0 40px;
}
.course-content ul.topics li.section .left,
.course-content ul.topics li.section .right {
width: 40px;
padding: 0 6px;
}
.course-content ul.topics li.section .left {
padding-top: 22px;
text-align: right;
}
.jsenabled .course-content ul.topics li.section .left,
.jsenabled .course-content ul.topics li.section .right {
width: auto;
}
.course-content ul.topics li.section .left .section-handle img.icon {
padding: 0;
vertical-align: baseline;
}
.course-content ul.topics li.section .section_action_menu .textmenu,
.course-content ul.topics li.section .section_action_menu .menu-action-text {
white-space: nowrap;
}
+7 -5
View File
@@ -48,6 +48,7 @@ M.course.format.swap_sections = function(Y, node1, node2) {
* Process sections after ajax response
*
* @param {YUI} Y YUI3 instance
* @param {NodeList} sectionlist of sections
* @param {array} response ajax response
* @param {string} sectionfrom first affected section
* @param {string} sectionto last affected section
@@ -77,13 +78,14 @@ M.course.format.process_sections = function(Y, sectionlist, response, sectionfro
var content = Y.Node.create('<span>' + response.sectiontitles[i] + '</span>');
sectionlist.item(i).all('.'+CSS.SECTIONNAME).setHTML(content);
// Update move icon.
ele = sectionlist.item(i).one(SELECTORS.SECTIONLEFTSIDE);
str = ele.getAttribute('alt');
// Update the drag handle.
ele = sectionlist.item(i).one(SELECTORS.SECTIONLEFTSIDE).ancestor('.section-handle');
str = ele.getAttribute('title');
stridx = str.lastIndexOf(' ');
newstr = str.substr(0, stridx +1) + i;
ele.setAttribute('alt', newstr);
ele.setAttribute('title', newstr); // For FireFox as 'alt' is not refreshed.
ele.setAttribute('title', newstr);
// Update the aria-label for the section.
sectionlist.item(i).setAttribute('aria-label', content.get('innerText').trim());
// Remove the current class as section has been moved.
sectionlist.item(i).removeClass('current');
+1
View File
@@ -50,3 +50,4 @@ if (!empty($displaysection)) {
}
$PAGE->requires->js('/course/format/weeks/format.js');
$PAGE->requires->js_call_amd('core_course/sectionlistener');
-34
View File
@@ -1,34 +0,0 @@
.course-content ul.weeks {
margin: 0;
list-style: none;
}
.course-content ul.weeks li.section .content {
margin: 0 40px;
}
.course-content ul.weeks li.section .left,
.course-content ul.weeks li.section .right {
width: 40px;
padding: 0 6px;
}
.course-content ul.weeks li.section .left {
padding-top: 22px;
text-align: right;
}
.jsenabled .course-content ul.weeks li.section .left,
.jsenabled .course-content ul.weeks li.section .right {
width: auto;
}
.course-content ul.weeks li.section .left .section-handle img.icon {
padding: 0;
vertical-align: baseline;
}
.course-content ul.weeks li.section .section_action_menu .textmenu,
.course-content ul.weeks li.section .section_action_menu .menu-action-text {
white-space: nowrap;
}
+4 -1
View File
@@ -1144,7 +1144,9 @@ function course_delete_module($cmid, $async = false) {
}
// Delete activity context questions and question categories.
question_delete_activity($cm);
$showinfo = !defined('AJAX_SCRIPT') || AJAX_SCRIPT == '0';
question_delete_activity($cm, $showinfo);
// Call the delete_instance function, if it returns false throw an exception.
if (!$deleteinstancefunction($cm->instance)) {
@@ -2202,6 +2204,7 @@ function move_courses($courseids, $categoryid) {
foreach ($dbcourses as $dbcourse) {
$course = new stdClass();
$course->id = $dbcourse->id;
$course->timemodified = time();
$course->category = $category->id;
$course->sortorder = $category->sortorder + MAX_COURSES_IN_CATEGORY - $i++;
if ($category->visible == 0) {
+2 -1
View File
@@ -316,7 +316,8 @@ if ($action !== false && confirm_sesskey()) {
$notificationsfail[] = get_string('movecategoryownparent', 'error', $cattomove->get_formatted_name());
continue;
}
if (strpos($movetocat->path, $cattomove->path) === 0) {
// Don't allow user to move selected category into one of it's own sub-categories.
if (strpos($movetocat->path, $cattomove->path . '/') === 0) {
$notificationsfail[] = get_string('movecategoryparentconflict', 'error', $cattomove->get_formatted_name());
continue;
}
+5 -6
View File
@@ -74,11 +74,8 @@ foreach ($modinfo->cms as $cm) {
if (!in_array($cm->modname, $availableresources)) {
continue;
}
if (!$cm->uservisible) {
continue;
}
if (!$cm->has_view()) {
// Exclude label and similar
// Exclude activities that aren't visible or have no view link (e.g. label). Account for folder being displayed inline.
if (!$cm->uservisible || (!$cm->has_view() && strcmp($cm->modname, 'folder') !== 0)) {
continue;
}
$cms[$cm->id] = $cm;
@@ -140,9 +137,11 @@ foreach ($cms as $cm) {
}
$class = $cm->visible ? '' : 'class="dimmed"'; // hidden modules are dimmed
$url = $cm->url ?: new moodle_url("/mod/{$cm->modname}/view.php", ['id' => $cm->id]);
$table->data[] = array (
$printsection,
"<a $class $extra href=\"".$cm->url."\">".$icon.$cm->get_formatted_name()."</a>",
"<a $class $extra href=\"" . $url ."\">" . $icon . $cm->get_formatted_name() . "</a>",
$intro);
}
+1 -1
View File
@@ -17,7 +17,7 @@
<form action="{{searchurl}}" id="{{id}}" method="get" class="form-inline">
<fieldset class="coursesearchbox invisiblefieldset">
<label for="{{inputid}}">{{#str}}searchcourses{{/str}}</label>
<input id="{{inputid}}" name="search" type="text" size="{{inputsize}}" value="{{value}}" class="form-control">
<input id="{{inputid}}" name="search" type="text" size="{{inputsize}}" value="{{value}}" class="form-control mb-1 mb-sm-0">
<button class="btn btn-secondary" type="submit">{{#str}}go{{/str}}</button>
{{#helpicon}}
{{>core/help_icon}}
@@ -48,6 +48,8 @@ Y.extend(DRAGSECTION, M.core.dragdrop, {
this.groups = [CSS.SECTIONDRAGGABLE];
this.samenodeclass = M.course.format.get_sectionwrapperclass();
this.parentnodeclass = M.course.format.get_containerclass();
// Detect the direction of travel.
this.detectkeyboarddirection = true;
// Check if we are in single section mode
if (Y.Node.one('.' + CSS.JUMPMENU)) {
@@ -147,6 +149,14 @@ Y.extend(DRAGSECTION, M.core.dragdrop, {
drag_start: function(e) {
// Get our drag object
var drag = e.target;
// This is the node that the user started to drag.
var node = drag.get('node');
// This is the container node that will follow the mouse around,
// or during a keyboard drag and drop the original node.
var dragnode = drag.get('dragNode');
if (node === dragnode) {
return;
}
// Creat a dummy structure of the outer elemnents for clean styles application
var containernode = Y.Node.create('<' + M.course.format.get_containernode() +
'></' + M.course.format.get_containernode() + '>');
@@ -155,10 +165,10 @@ Y.extend(DRAGSECTION, M.core.dragdrop, {
'></' + M.course.format.get_sectionwrappernode() + '>');
sectionnode.addClass(M.course.format.get_sectionwrapperclass());
sectionnode.setStyle('margin', 0);
sectionnode.setContent(drag.get('node').get('innerHTML'));
sectionnode.setContent(node.get('innerHTML'));
containernode.appendChild(sectionnode);
drag.get('dragNode').setContent(containernode);
drag.get('dragNode').addClass(CSS.COURSECONTENT);
dragnode.setContent(containernode);
dragnode.addClass(CSS.COURSECONTENT);
},
drag_dropmiss: function(e) {
@@ -431,6 +441,11 @@ Y.extend(DRAGRESOURCE, M.core.dragdrop, {
drag_start: function(e) {
// Get our drag object
var drag = e.target;
if (drag.get('dragNode') === drag.get('node')) {
// We do not want to modify the contents of the real node.
// They will be the same during a keyboard drag and drop.
return;
}
drag.get('dragNode').setContent(drag.get('node').get('innerHTML'));
drag.get('dragNode').all('img.iconsmall').setStyle('vertical-align', 'baseline');
},

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