Compare commits

..

521 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7) 22984eaecc Moodle release 3.5.18 2021-05-08 16:40:32 +02:00
Eloy Lafuente (stronk7) ed00c49c6f weekly release 3.5.17+ 2021-05-07 16:54:38 +02:00
Eloy Lafuente (stronk7) 7a4476b834 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2021-05-07 16:54:37 +02:00
Sara Arjona cd827ebe23 Merge branch 'MDL-71420_35' of https://github.com/stronk7/moodle into MOODLE_35_STABLE 2021-05-06 17:59:12 +02:00
Sara Arjona b76287f846 Merge branch 'MDL-71390-35' of git://github.com/marinaglancy/moodle into MOODLE_35_STABLE 2021-05-06 08:04:25 +02:00
AMOS bot 2231902a45 Automatically generated installer lang files 2021-05-06 00:07:39 +00:00
Eloy Lafuente (stronk7) 01403722a8 MDL-71420 environment: Lower sodium requirement to recommended 2021-05-05 23:06:31 +02:00
Víctor Déniz e1c1dfc748 Merge branch 'MDL-71460-35' of git://github.com/peterRd/moodle into MOODLE_35_STABLE 2021-05-05 10:57:44 +01:00
Peter Dias 32ded92858 MDL-71460 hub: Use checkboxes instead of dropdowns
Change the yes/no dropdowns to a checkbox. Defaults to unchecked.
2021-05-05 09:57:15 +08:00
AMOS bot 14d9570a54 Automatically generated installer lang files 2021-05-04 00:07:39 +00:00
Huong Nguyen 821ee3f6d3 MDL-70720 Quiz: Improve capability checks when fetching users' best grades 2021-05-03 23:04:46 +01:00
Marina Glancy b3261d7e47 MDL-71390 core: raise max_input_vars requirement for Moodle 3.11 2021-05-03 13:31:02 +02:00
Shamim Rezaie ac7c3878f6 MDL-69028 repository: Put a rate limit on draft file uploads 2021-04-30 14:21:24 +02:00
Paul Holden acf717ab77 MDL-71130 quiz_grading: escape user idnumber on display. 2021-04-30 14:21:24 +02:00
David Mudrák ddd7021adb MDL-70804 mnet: Use proper DML method to get records from the table
This improves the code and avoids the risk of SQL injection through the
malicious XML-RPC request from the MNet peer.
2021-04-30 14:21:24 +02:00
Víctor Déniz 05b03a44f4 weekly release 3.5.17+ 2021-04-30 12:54:18 +01:00
Víctor Déniz ab62531857 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2021-04-30 12:54:16 +01:00
Paul Holden a33058ebb3 MDL-70763 core: export preferences for correct user.
Ensure we are using the ID of the given user rather than falling
back to that of the current user during privacy export.
2021-04-28 12:30:28 +02:00
Paul Holden dea05d9284 MDL-70763 quiz_overview: export preferences for correct user. 2021-04-28 12:30:23 +02:00
Paul Holden 821342fac5 MDL-70763 gradereport_grader: export preferences for correct user. 2021-04-28 12:30:17 +02:00
AMOS bot b73d600ac5 Automatically generated installer lang files 2021-04-20 00:07:35 +00:00
AMOS bot 5b401c9055 Automatically generated installer lang files 2021-04-18 00:07:32 +00:00
AMOS bot 79a4c28dd5 Automatically generated installer lang files 2021-04-15 00:07:45 +00:00
AMOS bot 25c337f3d8 Automatically generated installer lang files 2021-04-14 00:07:38 +00:00
AMOS bot a3af71d840 Automatically generated installer lang files 2021-04-09 00:07:39 +00:00
AMOS bot 993674fd6f Automatically generated installer lang files 2021-04-06 00:07:46 +00:00
AMOS bot 84ac02e9f3 Automatically generated installer lang files 2021-04-04 00:07:44 +00:00
AMOS bot d42e0c1b05 Automatically generated installer lang files 2021-04-02 00:07:33 +00:00
AMOS bot 6ba2b1502b Automatically generated installer lang files 2021-04-01 00:07:35 +00:00
AMOS bot 225873e47e Automatically generated installer lang files 2021-03-29 00:07:33 +00:00
AMOS bot 758823c80e Automatically generated installer lang files 2021-03-28 00:07:30 +00:00
AMOS bot 5185c03fa7 Automatically generated installer lang files 2021-03-25 00:07:37 +00:00
Víctor Déniz 79d4f46efd weekly release 3.5.17+ 2021-03-24 14:20:48 +00:00
Víctor Déniz 290e0f7de5 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2021-03-24 14:20:47 +00:00
Chris Brown d49ba78dbd MDL-71139 trademark: Improve the trademark messaging 2021-03-22 12:01:53 +08:00
AMOS bot b891579e99 Automatically generated installer lang files 2021-03-18 00:07:32 +00:00
AMOS bot e43abfe8b8 Automatically generated installer lang files 2021-03-13 00:07:34 +00:00
Sara Arjona efd261ab7d weekly release 3.5.17+ 2021-03-11 17:18:54 +01:00
Sara Arjona ee02ba0623 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2021-03-11 17:18:53 +01:00
Eloy Lafuente (stronk7) 54f6d895a8 Merge branch 'MDL-70726-3.5' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_35_STABLE 2021-03-11 00:13:18 +01:00
AMOS bot 1a0c9fd279 Automatically generated installer lang files 2021-03-10 00:07:27 +00:00
Thong Bui 82066dbce7 MDL-70726 behat: should_not_exist function does not work correctly 2021-03-08 18:56:34 +07:00
AMOS bot 9aca8183fe Automatically generated installer lang files 2021-03-07 00:07:28 +00:00
Eloy Lafuente (stronk7) 5a1b6a9d50 Moodle release 3.5.17 2021-03-06 18:03:45 +01:00
AMOS bot c252deeda9 Automatically generated installer lang files 2021-03-06 00:07:29 +00:00
Sara Arjona d640a60f96 weekly release 3.5.16+ 2021-03-05 16:01:44 +01:00
Sara Arjona cf6c8a5acd Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2021-03-05 16:01:43 +01:00
Jun Pataleta cddd41f5fd MDL-69680 tool_dataprivacy: Adjust expected size of downloaded data
Adjusting due to the upgrade for jQuery to 3.5.1
2021-03-04 12:46:55 +08:00
Ilya Tregubov 98aa5b1ac3 MDL-69680 lib: Replace deprecated jQuery functions 2021-03-04 12:46:55 +08:00
Ilya Tregubov bb2179cbb7 MDL-69680 lib: Update jQuery version in Moodle files 2021-03-04 12:46:55 +08:00
Ilya Tregubov 96006635fc MDL-69680 lib: Upgrade jQuery lib to 3.5.1 2021-03-04 12:46:55 +08:00
Ilya Tregubov 75b5b6d5b9 MDL-70767 feedback: Prevent xss in feedback answer text. 2021-03-03 23:09:59 +01:00
Paul Holden d54ab79285 MDL-65552 block_activity_results: correct Behat tests for idnumbers.
Teachers can see user idnumber fields only when they are configured
identity fields. Students cannot.
2021-03-03 23:14:25 +08:00
Marina Glancy 21f1221056 MDL-65552 user: escape idnumber and email in table_sql 2021-03-03 23:14:25 +08:00
Paul Holden 551680435a MDL-65552 user: escape idnumber field on output.
This commit also corrects parameter definition of the field to
match core_user.
2021-03-03 23:14:25 +08:00
Paul Holden dbab6200d5 MDL-65552 user: escape extra/email user fields.
This commit has been backported from the changes in MDL-66762.
2021-03-03 23:14:25 +08:00
AMOS bot a2267a3c5b Automatically generated installer lang files 2021-03-03 00:07:28 +00:00
Paul Holden c13f7f9a6b MDL-70822 enrol: respect capability to view other users profile.
When retrieving courses of another user via web services, we should
respect the capability to view that users profile in a given course.
2021-03-02 16:41:28 +01:00
Sander Wind acfb9efa25 MDL-70668 auth: Fix secret validation during user confirmation
Co-authored-by: Michael Hawkins <michaelh@moodle.com>
2021-03-02 16:41:28 +01:00
Peter Dias 420983c00d MDL-59293 block_onlineusers: Update behat tests 2021-03-02 16:38:05 +01:00
Peter Dias 4414c75992 MDL-59293 block_onlineusers: Check whether current user can view online users
- Removed block from site admin.
- Blocked guest from viewuserlist cap
2021-03-02 16:38:05 +01:00
AMOS bot fd29b873cb Automatically generated installer lang files 2021-03-02 00:07:26 +00:00
Sara Arjona 61bc167f53 Merge branch 'MDL-68735_35' of https://github.com/stronk7/moodle into MOODLE_35_STABLE 2021-03-01 16:20:56 +01:00
AMOS bot 1ca90a1695 Automatically generated installer lang files 2021-03-01 00:07:29 +00:00
AMOS bot 8e2798ff18 Automatically generated installer lang files 2021-02-28 00:07:26 +00:00
AMOS bot 0ac84efc5a Automatically generated installer lang files 2021-02-27 00:07:33 +00:00
AMOS bot a39608dd0d Automatically generated installer lang files 2021-02-25 00:07:30 +00:00
AMOS bot df9a771afd Automatically generated installer lang files 2021-02-22 00:07:29 +00:00
AMOS bot 01ab57bd28 Automatically generated installer lang files 2021-02-19 00:07:41 +00:00
AMOS bot cec29305f2 Automatically generated installer lang files 2021-02-17 00:07:36 +00:00
AMOS bot 85477f7928 Automatically generated installer lang files 2021-02-16 00:07:32 +00:00
Eloy Lafuente (stronk7) 8ead95fabe MDL-68735 env: Moodle 3.8.x, 3.9.x and 3.10.x do not support PHP 8.0 2021-02-13 12:51:51 +01:00
AMOS bot 176eb618fc Automatically generated installer lang files 2021-02-13 00:07:40 +00:00
AMOS bot 5c4359353f Automatically generated installer lang files 2021-02-11 00:07:32 +00:00
AMOS bot 468ee496ca Automatically generated installer lang files 2021-02-04 00:07:38 +00:00
AMOS bot 82990d7a3f Automatically generated installer lang files 2021-02-01 00:07:36 +00:00
AMOS bot 6804470b3f Automatically generated installer lang files 2021-01-31 00:07:32 +00:00
AMOS bot 413b603923 Automatically generated installer lang files 2021-01-27 00:07:36 +00:00
AMOS bot 6c557376fc Automatically generated installer lang files 2021-01-23 00:07:34 +00:00
AMOS bot 5060d6edc2 Automatically generated installer lang files 2021-01-17 00:07:34 +00:00
Eloy Lafuente (stronk7) bbf242efb0 Moodle release 3.5.16 2021-01-16 16:58:14 +01:00
Sara Arjona 2ecd91a0f2 weekly release 3.5.15+ 2021-01-15 08:25:54 +01:00
Sara Arjona ba997dd6a0 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2021-01-15 08:25:52 +01:00
Sara Arjona 5642f070db Merge branch 'MDL-69308_35' of https://github.com/stronk7/moodle into MOODLE_35_STABLE 2021-01-14 12:04:50 +01:00
AMOS bot 9c77b530df Automatically generated installer lang files 2021-01-14 00:07:31 +00:00
Eloy Lafuente (stronk7) 4191c518b2 MDL-69308 environment: Apply agreed changes
- PHP 7.3 required.
- Moodle 3.6 required.
- SQL*Server 2017 (aka, 14.0) required.
- Sodium PHP extension required.
2021-01-13 19:31:22 +01:00
Eloy Lafuente (stronk7) 1130c3c417 MDL-69308 environment: 3.11 base information
This is a direct copy of the 3.10 branch to have
the changes under control in next commits.
2021-01-13 19:31:17 +01:00
Mihail Geshoski f123859059 MDL-68486 auth_shibboleth: Reset convert_data if it uses dataroot file
Upgrade step that resets the 'Data modification API' (convert_data)
setting to its default value if this setting is currently configured
to use a file located within the $CFG->dataroot directory.
2021-01-13 12:36:45 +08:00
Mihail Geshoski ecc79c2241 MDL-68486 auth_shibboleth: Prevent using dataroot files in convert_data
Prevents configuring the 'Data modification API' (convert_data) setting
to use files located within the $CFG->dataroot directory as it exposes
the site to security risks.
2021-01-13 12:36:45 +08:00
AMOS bot 18a4d9349c Automatically generated installer lang files 2021-01-13 00:07:32 +00:00
AMOS bot 93692e074a Automatically generated installer lang files 2021-01-12 00:07:41 +00:00
AMOS bot 157e786818 Automatically generated installer lang files 2021-01-11 00:08:46 +00:00
AMOS bot 70a6cc1bd1 Automatically generated installer lang files 2021-01-09 00:07:36 +00:00
Michael Hawkins 6c241fb61e MDL-69911 core: Clean content passed through TeX filter 2021-01-08 05:21:26 +01:00
Ferran Recio fa6dc6a983 MDL-67782 message: fix messages max length 2021-01-08 05:21:26 +01:00
Jun Pataleta f85895edb5 weekly release 3.5.15+ 2021-01-08 12:15:02 +08:00
Jun Pataleta cbf63fe289 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2021-01-08 12:15:00 +08:00
AMOS bot 93e5e866c7 Automatically generated installer lang files 2021-01-08 00:07:31 +00:00
Eloy Lafuente (stronk7) 902e58214b Merge branch 'MDL-70584-35' of git://github.com/marinaglancy/moodle into MOODLE_35_STABLE 2021-01-07 23:31:42 +01:00
Marina Glancy 2a8cb44f05 MDL-70584 core_iplookup: increase tolerance in test 2021-01-07 16:36:17 +01:00
AMOS bot 4d80c59921 Automatically generated installer lang files 2020-12-27 00:07:33 +00:00
AMOS bot 6816b2e4d8 Automatically generated installer lang files 2020-12-24 00:07:36 +00:00
Eloy Lafuente (stronk7) c33ce32022 weekly release 3.5.15+ 2020-12-23 20:24:38 +01:00
Eloy Lafuente (stronk7) 4aca8df6ab Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2020-12-23 20:24:35 +01:00
AMOS bot 1f0d1abf15 Automatically generated installer lang files 2020-12-22 00:07:32 +00:00
Sara Arjona aaf1110d92 Merge branch 'MDL-69107-35-2' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2020-12-18 15:23:13 +01:00
Sara Arjona f4a5746e57 weekly release 3.5.15+ 2020-12-17 15:52:57 +01:00
Sara Arjona 752dafa55c Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2020-12-17 15:52:55 +01:00
Andrew Nicols a242d3e3ba MDL-69107 behat: Update field normalisation 2020-12-17 07:50:25 +08:00
Andrew Nicols 16a42b3f11 MDL-69107 user: Fix autocomplete usages 2020-12-16 23:11:57 +08:00
Andrew Nicols 28b3bf9d3e MDL-69107 form_autocomplete: Rewrite item selection
The form_autocomplete is essentially a custom element. Unfortunately the
`setValue()` function in Mink has undesired actions so it is necessary
to write our own handling for it.

The standard Mink `setValue()` function focuses the element, sets a
value, and then blurs the element. In the case of the autocomplete this
can cause the autocomplete suggestions list to be closed in some
situations. Instead of using the setValue we click, and type the value,
but do not immediately blur.
2020-12-16 23:11:57 +08:00
AMOS bot 2acc32ab82 Automatically generated installer lang files 2020-12-15 00:07:32 +00:00
Sara Arjona ec05eeadb2 Merge branch 'MDL-70397-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2020-12-14 17:13:06 +01:00
AMOS bot 15e8eee42e Automatically generated installer lang files 2020-12-13 00:07:32 +00:00
AMOS bot c88858d3bd Automatically generated installer lang files 2020-12-12 00:07:40 +00:00
AMOS bot a1d6fd2a13 Merge branch 'MOODLE_35_STABLE' into install_35_STABLE 2020-12-12 00:07:39 +00:00
AMOS bot 300a3bd363 Automatically generated installer lang files 2020-12-11 00:07:40 +00:00
Víctor Déniz 8c732857bc weekly release 3.5.15+ 2020-12-10 21:10:14 +00:00
Víctor Déniz e33c67eb35 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2020-12-10 21:10:08 +00:00
Jake Dallimore d1667406d7 Merge branch 'MDL-70151-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2020-12-09 14:47:18 +08:00
AMOS bot 45ef3ffd66 Automatically generated installer lang files 2020-12-08 00:07:30 +00:00
AMOS bot 37551217f2 Automatically generated installer lang files 2020-12-06 00:07:36 +00:00
Andrew Nicols d1f1b69a57 MDL-70397 behat: Prevent browser restarting after initial start 2020-12-04 20:36:31 +08:00
Jake Dallimore c4a024d9fc weekly release 3.5.15+ 2020-12-04 08:43:00 +08:00
Jake Dallimore e42fd050f9 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2020-12-04 08:42:58 +08:00
Adrian Greeve 8044f8a71a Merge branch 'MDL-70167-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2020-12-03 09:54:38 +08:00
AMOS bot a89035fcb3 Automatically generated installer lang files 2020-12-03 00:07:35 +00:00
AMOS bot 17d3aa1dff Automatically generated installer lang files 2020-12-02 00:07:31 +00:00
AMOS bot cc5e92929a Automatically generated installer lang files 2020-12-01 00:07:37 +00:00
Sara Arjona ff962e0e48 weekly release 3.5.15+ 2020-11-27 07:50:54 +01:00
Sara Arjona babb99fbd9 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2020-11-27 07:50:51 +01:00
AMOS bot ee5424df55 Automatically generated installer lang files 2020-11-27 06:21:16 +00:00
Sara Arjona fb6126adb2 Merge branch 'MDL-70276_35' of https://github.com/stronk7/moodle into MOODLE_35_STABLE 2020-11-26 15:05:10 +01:00
Eloy Lafuente (stronk7) eb7930a5f4 MDL-70276 github actions: First cut, phpunit and grunt checks
First working version, supports phpunit (using build matrix):

- php70 (lowest), running mysql.
- php72 (highest), running postgres.

Also verifies that the branch has been "gruntified" and there
isn't any missing change (build js/css files).

TODO: Verify the remaining checks currently in .travis.yml, namely:
 - CITEST
 - Add caching
 - Better health-check for DB images.
 - Support from the tracker (satus badges and enable check).
 - Support from CiBoT (status and enable check).
 - Consider moving both the common setup (git, composer...)
   and the database (mysql, postgres) to own actions for
   easier tweaking.
2020-11-26 00:28:10 +01:00
Sara Arjona 2166675df5 Merge branch 'MDL-70265_35' of https://github.com/stronk7/moodle into MOODLE_35_STABLE 2020-11-25 15:47:21 +01:00
Andrew Nicols ec31b667b2 Merge branch 'MDL-67668_35' of git://github.com/stronk7/moodle into MOODLE_35_STABLE 2020-11-24 07:37:48 +08:00
Eloy Lafuente (stronk7) a757acbc40 MDL-67668 behat: Remove recursion added in transition to trait 2020-11-23 20:24:25 +01:00
Eloy Lafuente (stronk7) 25e17b9b5d MDL-70265 travis: Completely remove the UPGRADE check
It was broken since ages ago, see MDL-64874, so no sense
to keep it eating minutes for nothing.
2020-11-23 14:27:26 +01:00
Adrian Greeve 8688e7aff5 Merge branch 'MDL-67668-35-2' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2020-11-23 15:34:08 +08:00
Andrew Nicols f82ba2ed50 MDL-70151 assign: Fix bulk change for behat
Behat does not play well with confirmation dialogues and in some
situations it does not wait for the page to reload before starting the
next step.

This change adds a pending_js call which is only resolved if the cancel
button was pressed, otherwise it remains in-progress until the page
reloads resetting the entire state of it.
2020-11-23 11:12:43 +08:00
Andrew Nicols a1dff55d44 MDL-70167 behat: Rewrite attribute check steps
This commit updates the following steps to use the
`the_attribute_of_should_be_set` step under the hood:
- the [element] [type] should be disabled
- the [element] [type] should be enabled
- the [element] [type] should be readonly
- the [element] [type] should not be readonly

This reduces unnecssary code duplication.
2020-11-23 11:07:41 +08:00
Andrew Nicols b0f7f0c808 MDL-70167 behat: Boolean attributes should either exist or not 2020-11-23 11:07:39 +08:00
Andrew Nicols eca105902f MDL-67668 behat: Update tests for inplace editable field type 2020-11-23 09:00:46 +08:00
Andrew Nicols 1f4d891995 MDL-67668 behat: Add inplace editable field type
This commit promotes the Inplace Editable field to a first-class form
element by introducing a new partial selector for inplace editable
fields, and teaching the field manager how to recognise these, then
introducing a new field type which can handle setting values for this
field.
2020-11-23 09:00:46 +08:00
Andrew Nicols 534a7a869e MDL-67668 behat: Share behat_behat functionality with forms
Behat form fields are implemented in a way completely isolated from the
rest of the Behat Context system. Whereas regular step definitions have
access to execute steps, to call `find`, check for JS running, and other
related functionality, the Moodle implementation of a field type does
not have any access to this.

By moving the core functionality of behat_base to a new trait, and the
constants to a new interface, the functionality can also be used in
behat form fields in the same way as elsewhere.
2020-11-23 09:00:46 +08:00
Andrew Nicols 14a019dfee MDL-67668 behat: Correct js pending check
Pending checks should only run when JS is running, but some uses were
not apply this check.
2020-11-23 09:00:46 +08:00
Andrew Nicols 99b6bd212a MDL-67668 behat: Support NodeElement when fetching node in container
This is similar to change made in MDL-69136 to allow an already-fetched
NodeElement to be provided to the get_node_in_container() function and
makes it easier to be deterministic when writing steps.
2020-11-23 09:00:46 +08:00
Eloy Lafuente (stronk7) 75a69bae10 MDL-70265 travis: Only run highest phpunit if configured via env
By default only lowest php version will be executed, and only pgsql.

This default behavior can be changed with a new variable:

MOODLE_PHP = [all]
MOODLE_DATABASE = [pgsql | mysqli | all]
2020-11-21 11:28:16 +01:00
Eloy Lafuente (stronk7) 08707e95d2 weekly release 3.5.15+ 2020-11-20 23:16:52 +01:00
Eloy Lafuente (stronk7) 870f2a938b Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2020-11-20 23:16:50 +01:00
Jake Dallimore 5a6729743f Merge branch 'MDL-70148-35-fix' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2020-11-20 13:59:52 +08:00
Andrew Nicols 806a85f19d MDL-70148 behat: Remove user menu test
This test is unreliable because we are unable to wait for pending JS. On
slower systems it can take a while for the relevant JS to load, and the
step to start working.

This issue only affects 3.5.
2020-11-20 13:56:36 +08:00
Jake Dallimore 4e6a3cedf6 Merge branch 'MDL-70148-35-fix' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2020-11-20 09:51:40 +08:00
Andrew Nicols e32b77b7a3 MDL-70148 behat: Use key_press for autocomplete escape
In Moodle 3.5 dialogues are focused too frequently and active focus is
often wrong. This means that the dialogue has focus after selecting an
element in a form autocomplete element. As a result, pressing the escape
key causes the dialogue to be closed.

The older `key_press` call is sufficient to close the autocomplete in
the cases where this is needed, but will not cuase the dialogue to be
closed.
2020-11-20 09:03:09 +08:00
Andrew Nicols 938d0763f6 MDL-70148 behat: Wait after opening the user menu
The version of Boost used in Moodle 3.5 does not have any pendingJS
checks and it is not possible to add them.

We need to use the poor-person's alternative and fall back to a short
wait to allow the menu to open before interacting with it.

This may still allow for failures on extremely slow systems but the risk
is extremely minimal.
2020-11-20 08:53:05 +08:00
Sara Arjona 11312f9ea4 Merge branch 'MDL-70148_35' of git://github.com/stronk7/moodle into MOODLE_35_STABLE 2020-11-19 13:22:02 +01:00
Eloy Lafuente (stronk7) 938dc74b3b MDL-70148 behat: Added missing step definition that was lost in backport 2020-11-19 12:57:00 +01:00
Sam Hemelryk 9b983fb849 MDL-68896 mod_scorm: improved sendBeacon use when unloading 2020-11-18 09:50:27 +08:00
Eloy Lafuente (stronk7) 9a065268c6 Merge branch 'MDL-70148-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2020-11-17 23:13:46 +01:00
Andrew Nicols 6f8a609708 MDL-70148 gradereport_grader: Improve reliability of keyboard usage
In some browsers the ajax grade select does not properly update the
grade after setting values. The previous solution was to press the
[enter] key, but doing this with the new key type step opens the select
box again. This is what happens when a real user presses enter on the
select.

This is the last possible field in the report, so pressing the tab key
to move to the next gradable element does not work.

The solution uses a shift-tab to move the focus away to the previous
gradale element. In this case it must also be moved to an earlier step
because the previously selected value must be checked in the Then
section of the test and if it is selected then its value cannot be
checked.
2020-11-17 15:16:15 +08:00
Andrew Nicols d22e6dc827 MDL-70148 qtype: Update qtype steps to new key interaction
Note: The ddmarker question type was previously getting the number of
keypresses wrong. This was because it was using both keyDown/keyUp, and
also keyPress. As a result each keypress was essentially happening two
times.
2020-11-17 15:16:15 +08:00
Andrew Nicols 33b875ccd0 MDL-70148 behat: Update steps for keyboard 2020-11-17 15:16:15 +08:00
Andrew Nicols 8aadb679dc MDL-70148 behat: Add steps to send keys without an element 2020-11-17 15:14:43 +08:00
AMOS bot 276b1bcda8 Automatically generated installer lang files 2020-11-11 00:07:58 +00:00
AMOS bot 05abfdab8d Automatically generated installer lang files 2020-11-09 00:08:07 +00:00
Eloy Lafuente (stronk7) 30b0cfafc3 Moodle release 3.5.15 2020-11-07 16:47:52 +01:00
AMOS bot c4bece6ed7 Automatically generated installer lang files 2020-11-07 00:08:02 +00:00
AMOS bot a92ed6b506 Automatically generated installer lang files 2020-11-06 00:10:12 +00:00
Eloy Lafuente (stronk7) c52dbb8dfc weekly release 3.5.14+ 2020-11-05 12:16:10 +01:00
Mihail Geshoski 619b23000a MDL-67837 backup: Add unit tests 2020-10-30 13:51:25 +01:00
Mihail Geshoski f651fc4c8a MDL-67837 backup: Verify caps before unenrolling users on course restore 2020-10-30 13:51:25 +01:00
Juan Leyva 182561953b MDL-67015 mod_data: Prevent users adding entries to other groups 2020-10-30 13:51:25 +01:00
Ferran Recio bd1220dbe5 MDL-69378 tool_uploadcourse: fix enrolment methods uploads 2020-10-30 13:51:25 +01:00
Peter Dias a3eb28f51d MDL-56310 restore: Confirm user has permission to change capabilities 2020-10-30 13:51:25 +01:00
Eloy Lafuente (stronk7) 83ce477051 weekly release 3.5.14+ 2020-10-30 13:48:57 +01:00
Eloy Lafuente (stronk7) 535836fdbd Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2020-10-30 13:48:55 +01:00
AMOS bot c7f15300f3 Automatically generated installer lang files 2020-10-30 00:09:59 +00:00
Jun Pataleta 5716a2c454 Merge branch 'MDL-69815-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2020-10-28 14:18:34 +08:00
Andrew Nicols 373b0fe431 MDL-69815 core: Bump Node to v14.15.0 (LTS/Fermium) 2020-10-28 09:34:31 +08:00
AMOS bot b9ce8595cb Automatically generated installer lang files 2020-10-22 00:08:14 +00:00
AMOS bot ccc8e283a8 Automatically generated installer lang files 2020-10-11 00:08:41 +00:00
Sara Arjona da3b20ce14 weekly release 3.5.14+ 2020-10-09 11:12:01 +02:00
Sara Arjona 9a279bae03 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2020-10-09 11:11:58 +02:00
Victor Deniz Falcon ed815ecf42 MDL-52407 travis: use Travis default notifications(email) 2020-10-07 16:37:52 +08:00
AMOS bot 2689b415bf Automatically generated installer lang files 2020-10-07 00:07:58 +00:00
Sara Arjona 9c22c9c0e8 weekly release 3.5.14+ 2020-10-02 13:43:32 +02:00
AMOS bot 18e0228d64 Automatically generated installer lang files 2020-09-26 00:08:11 +00:00
AMOS bot 89e28a26f4 Automatically generated installer lang files 2020-09-23 00:07:24 +00:00
AMOS bot 4ff8b8354f Automatically generated installer lang files 2020-09-22 00:07:24 +00:00
AMOS bot 4bf24f8869 Automatically generated installer lang files 2020-09-16 00:07:22 +00:00
AMOS bot fd31818cd9 Automatically generated installer lang files 2020-09-13 00:08:03 +00:00
AMOS bot 9fa3fc8fa6 Automatically generated installer lang files 2020-09-12 00:07:46 +00:00
Jun Pataleta 598064e4d9 Moodle release 3.5.14 2020-09-11 10:41:46 +08:00
Sara Arjona a96a428c7d weekly release 3.5.13+ 2020-09-10 08:52:13 +02:00
Michael Hawkins 4e64550116 MDL-69340 tag: Correct the filter input HTML in the tag manager 2020-09-03 17:21:37 +02:00
Andrew Nicols f330e8146f MDL-68974 calendar: Use page context for block check 2020-09-03 17:21:37 +02:00
Andrew Nicols 5b0902eb06 MDL-68974 blocks: Check permission before generating content 2020-09-03 17:21:37 +02:00
Mihail Geshoski 9aa9e5f1e6 MDL-65115 repository: Prevent unzipping if it will exceed allowed quota 2020-09-03 17:21:37 +02:00
Mihail Geshoski c718c85046 MDL-65115 core_files: Add get_total_content_size() in stored_file class
New function get_total_content_size() is introduced in the stored_file
class. The puprose of this function is to calculate and return the
total size (in bytes) of the content of an archive file.
2020-09-03 17:21:37 +02:00
Andrew Nicols fe6dc7ff41 MDL-68974 admin: Unit tests for context parent/child test 2020-09-03 17:21:37 +02:00
Andrew Nicols 9a1d611089 MDL-68974 admin: Unit tests for loginas 2020-09-03 17:21:37 +02:00
Andrew Nicols 393e43991f MDL-68974 admin: Prevent login as outside of the desired context 2020-09-03 17:21:37 +02:00
Sara Arjona e72e2edba5 weekly release 3.5.13+ 2020-09-03 17:09:31 +02:00
Noel De Martin 783f714bbe MDL-69360 behat: Fix js ready checks for non-moodle sites 2020-09-03 10:53:04 +08:00
Sara Arjona d986d964b3 weekly release 3.5.13+ 2020-08-27 17:36:37 +02:00
Sara Arjona 7f1103b12d Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2020-08-27 17:36:35 +02:00
AMOS bot ef1938e622 Automatically generated installer lang files 2020-08-27 00:07:30 +00:00
Adrian Greeve 15fd9288ae Merge branch 'MDL-69419-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2020-08-27 08:04:31 +08:00
Andrew Nicols 26b09187b8 MDL-69419 core: Task reset tests cannot use random test times
If a scheduled task which uses a 'R' field is picked, then the reset of
updated task times will not necessarily be correctly determined as the
randomisation is picked during reset.

This can lead to some random test failures.

Actively specifying a test which does not make use of the 'R' random
field time addresses this issue.
2020-08-27 07:30:57 +08:00
AMOS bot f3e7a7f813 Automatically generated installer lang files 2020-08-26 00:07:49 +00:00
AMOS bot 5a9347a0d3 Automatically generated installer lang files 2020-08-22 00:08:16 +00:00
Eloy Lafuente (stronk7) 738c06f7f2 weekly release 3.5.13+ 2020-08-21 20:43:05 +02:00
Andrew Nicols 25cfc3c9f2 Merge branch 'MDL-67415_35' of https://github.com/stronk7/moodle into MOODLE_35_STABLE 2020-08-20 08:32:28 +08:00
Andrew Nicols 5dd88c28d7 Merge branch 'MDL-69271_35' of https://github.com/stronk7/moodle into MOODLE_35_STABLE 2020-08-20 07:37:24 +08:00
Eloy Lafuente (stronk7) 90426f3906 Merge branch 'MDL-69273-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2020-08-18 11:00:14 +02:00
Andrew Nicols 357073866e MDL-69273 travis: Use exttests for https too 2020-08-18 07:50:48 +08:00
Andrew Nicols 3e144d2a0b MDL-69273 travis: Move exttests check to after_script
The result of the final command `script` phase determines the build
result.

The cleanup belongs in the `after_script` phase.
2020-08-18 07:40:14 +08:00
Eloy Lafuente (stronk7) 879dad536b MDL-67415 environment: change requirements
- mysql requirement up to 5.7
- postgres requirement up to 9.6
2020-08-13 01:35:28 +02:00
Eloy Lafuente (stronk7) d80294e172 MDL-67415 environment: 3.10 base information
This is a direct copy of the 3.9 branch to have
changes under control easier for next commits.
2020-08-13 01:35:26 +02:00
Eloy Lafuente (stronk7) 256926ba71 MDL-69271 auth_ldap: Don't assume any ordering, just verify matches
Both ldap or the DB can return information in a non-consistent
ordering leading to events to be generated in different order.

And current tests are, right now, assuming a given order.

Note this is a rare random, but it's happening, so better
fix it, see the issue for some more details.

So we just do the tests ordering immune, verifying that all the
expected events have been triggered and done. Irrespectively of their order.
2020-07-30 17:44:27 +02:00
Victor Deniz Falcon 4423aca97f weekly release 3.5.13+ 2020-07-30 12:53:48 +01:00
Eloy Lafuente (stronk7) a5a9583f4d Merge branch 'MDL-69319-35' of https://github.com/snake/moodle into MOODLE_35_STABLE 2020-07-29 01:22:57 +02:00
Eloy Lafuente (stronk7) fd4c40c893 weekly release 3.5.13+ 2020-07-29 01:05:09 +02:00
Eloy Lafuente (stronk7) 15ceddf963 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2020-07-29 01:05:07 +02:00
AMOS bot d1479874a9 Automatically generated installer lang files 2020-07-27 00:07:57 +00:00
AMOS bot 44ef640fb0 Automatically generated installer lang files 2020-07-27 00:07:57 +00:00
AMOS bot 04a448a2ab Automatically generated installer lang files 2020-07-25 00:08:23 +00:00
AMOS bot b00782a63b Automatically generated installer lang files 2020-07-23 00:08:16 +00:00
Adrian Greeve 45008c77e8 Merge branch 'MDL-69138-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2020-07-22 16:51:59 +08:00
Andrew Nicols 2612f3771d MDL-69138 behat: Update session->visit() to use visit step 2020-07-22 15:51:23 +08:00
Andrew Nicols 5f72b91962 MDL-69138 behat: Add "I visit :localurl" step 2020-07-22 15:51:23 +08:00
Adrian Greeve 565a4974e3 Merge branch 'MDL-67657-35' of git://github.com/abgreeve/moodle into MOODLE_35_STABLE 2020-07-22 11:01:49 +08:00
Adrian Greeve bbe8f2b9a7 MDL-67657 behat: Update to remove void return types. 2020-07-22 10:44:56 +08:00
Jake Dallimore 5724c6a382 MDL-69319 mod_lti: style and docs changes in external tests 2020-07-22 09:50:59 +08:00
Jake Dallimore b07642e882 MDL-69319 mod_lti: replace try/catch with expectException in ext tests 2020-07-22 09:50:57 +08:00
Jake Dallimore b77d0239b9 MDL-69319 mod_lti: remove unused vars from externallib_test 2020-07-22 09:45:45 +08:00
Jake Dallimore 654c27eece MDL-69319 mod_lti: move test data generation out of common setup 2020-07-22 09:44:47 +08:00
Eloy Lafuente (stronk7) f0f4003c9a Merge branch 'MDL-69160-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2020-07-21 23:30:08 +02:00
Adrian Greeve 6a5085ce04 Merge branch 'MDL-67657-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2020-07-21 14:51:06 +08:00
Jake Dallimore 2700ab11c7 MDL-69319 mod_lti: call clean_returnvalue in external tests 2020-07-20 15:12:17 +08:00
Eloy Lafuente (stronk7) c9585b3ed9 Merge branch 'MDL-69278-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2020-07-18 11:56:44 +02:00
Sara Arjona f4b63de27b weekly release 3.5.13+ 2020-07-16 21:28:21 +02:00
Andrew Nicols 9ab2003217 MDL-67657 behat: Open course with editing using URL
This is a huge performance improvement for behat.

The current set of steps loads the page
It then looks for the Classic/Clean version of the settings menu
If it fails to find it looks for the Boost Cog
Then it clicks the "Turn editing on" button

This can take a substantial period.

We do not actually need to run these steps as we are able to jump
straight to the URL. We already have access to the sesskey value
required to do this.

There is not loss in testing functionality because the actual testing of
the Turn editing functionality is tested in other places sufficiently.
2020-07-16 11:06:43 +08:00
Andrew Nicols 970ffe0417 MDL-67657 behat: Convert existing uses of executeScript 2020-07-16 11:06:31 +08:00
Andrew Nicols 7b24d50738 MDL-67657 behat: Add wrapper for JS execution 2020-07-16 11:05:32 +08:00
Andrew Nicols d377bf6b78 MDL-69278 behat: Correct variable name 2020-07-16 08:30:49 +08:00
Andrew Nicols 1126438d1a MDL-69278 behat: Mark tests as failed when unable to start Session 2020-07-16 08:30:45 +08:00
Charles Fulton 6805a7ae33 MDL-69074 admin: ensure consistent default for getremoteaddrconf 2020-07-15 19:06:30 +02:00
Sara Arjona 50d41b6804 Merge branch 'MDL-69068-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2020-07-15 12:20:57 +02:00
Andrew Nicols 75a54d45b6 MDL-69068 behat: Allow singular, pivotted data generators 2020-07-15 15:27:31 +08:00
Andrew Nicols 63e098d9e9 MDL-69068 behat: New step to support singular generators 2020-07-15 15:25:27 +08:00
Andrew Nicols f752683a47 MDL-69160 workshop: Ensure steps are chained 2020-07-13 14:22:31 +08:00
Andrew Nicols f14cb06317 MDL-69160 behat: Add form field setter step 2020-07-13 14:22:31 +08:00
Eloy Lafuente (stronk7) f4d5e50005 Moodle release 3.5.13 2020-07-12 12:12:37 +02:00
AMOS bot 63492d72ff Automatically generated installer lang files 2020-07-10 19:53:20 +00:00
Eloy Lafuente (stronk7) 6059688bb8 weekly release 3.5.12+ 2020-07-10 20:21:55 +02:00
Eloy Lafuente (stronk7) e5da091061 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2020-07-10 20:21:49 +02:00
Jake Dallimore cab24c1838 Merge branch 'MDL-69232-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2020-07-10 15:11:26 +08:00
Andrew Nicols dde44877bc MDL-69232 behat: Simplify hooks
The behat hooks were needlessly complicated which made them much harder
to read, and understand, leading to bugs during development.

These have been significantly simplified to favour clarity over
overloading.
2020-07-10 08:40:30 +08:00
Andrew Nicols 7db4a93901 MDL-69232 behat: Make selenium start more fault tolerant
The session was previously only started once, but has now been moved to
restart between each test. Because of this the `$session->start()` is
now called more frequently which exposes a pre-existing issue whereby
Selenium will periodically fail to start.

When the session was only started at the beginning of the test, and at
occasional other times, it made sense to always stop the test runner
because it signified an issue with obtaining the session at all.

Since the session is restarted more frequently, and now between every
test, it no longer makes sense to do this. The test should only be
_stopped_ if the first attempt to obtain the Session fails. Once a
Session has been retrieved at least once it no longer makes sense to
assume that the failure was a configuration failure, but a connection
failure. Therefore subsequent tests should be attempted.
2020-07-10 08:40:29 +08:00
Jake Dallimore 5e5de409b5 Merge branch 'MDL-69135-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2020-07-09 10:39:46 +08:00
Michael Hawkins a5d8388b33 MDL-68426 theme: Set a limit on paths length in yui_combo
The maximum paths length is now consistent with the YUI loader.
This fix also removes any duplicate paths, so each file is only ever
fetched once.
2020-07-09 10:24:22 +08:00
Andrew Nicols f74f0c5c10 MDL-69232 behat: Add debugging information to Selenium fails 2020-07-09 09:51:27 +08:00
Andrew Nicols 84d08b1651 MDL-69232 behat: Move suite tests to BeforeSuite hook 2020-07-09 09:51:26 +08:00
Eloy Lafuente (stronk7) 71433c086b Merge branch 'MDL-69134-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2020-07-08 20:53:51 +02:00
Andrew Nicols a449ad1ae0 Merge branch 'm35_MDL-66322_Travis_Run_Using_Docker_ExtTests' of https://github.com/scara/moodle into MOODLE_35_STABLE 2020-07-08 12:23:08 +08:00
Andrew Nicols e3f5f18813 MDL-69134 competencies: Behat fails randomly opening dialogues 2020-07-08 09:22:09 +08:00
Matteo Scaramuccia d2a670ec68 MDL-66322 travis: Configure a local copy of 'exttests' 2020-07-07 22:10:20 +02:00
Víctor Déniz Falcón 75baf79c47 MDL-69093 enrol_manual: added check for allowed roles a user can assign 2020-07-06 04:51:43 +02:00
Jake Dallimore a8265dc500 Merge branch 'MDL-69136-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2020-07-06 10:45:48 +08:00
AMOS bot 999f67d464 Automatically generated installer lang files 2020-07-06 00:08:57 +00:00
Eloy Lafuente (stronk7) 7ff7e29b85 weekly release 3.5.12+ 2020-07-03 18:41:11 +02:00
Eloy Lafuente (stronk7) c847b6d725 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2020-07-03 18:41:06 +02:00
Jake Dallimore cd227ab8ec Merge branch 'MDL-69149-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2020-07-02 11:58:11 +08:00
AMOS bot 476c26b2db Automatically generated installer lang files 2020-07-02 00:08:39 +00:00
Eloy Lafuente (stronk7) 1ac49204f8 Merge branch 'MDL-69072-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2020-07-01 23:24:52 +02:00
Andrew Nicols 53dde4e6a8 MDL-69136 behat: Improve reliability of navigation steps 2020-06-29 11:36:36 +08:00
Andrew Nicols 261c5a765f MDL-69136 behat: Support find on a NodeElement 2020-06-29 11:36:30 +08:00
Andrew Nicols 56ff846bbb MDL-69072 behat: Remove restart_browser_after feature
This is no longer required as the Mink session is restarted after every
test regardless.
2020-06-29 11:05:53 +08:00
Andrew Nicols 71fda60d39 MDL-69072 mod_scorm: Stop mink reset after tests
This is now done for all scenarios. It is no longer necessary to do so
specifically for mod_scorm.
2020-06-26 21:17:22 +08:00
Andrew Nicols 62064c3c86 MDL-69072 behat: Relaunch browser session between scenarios 2020-06-26 21:17:22 +08:00
Andrew Nicols 9c4055943e MDL-69149 core_grade: Correct xpath attribute selector 2020-06-26 19:59:56 +08:00
Andrew Nicols 2dc0582f5e MDL-69135 core_calendar: PendingJS for event filtering 2020-06-26 07:58:36 +08:00
Eloy Lafuente (stronk7) a8dd761083 weekly release 3.5.12+ 2020-06-25 18:06:09 +02:00
Eloy Lafuente (stronk7) 8c82cc367c Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2020-06-25 18:06:04 +02:00
Andrew Nicols 7556fc7c1d MDL-66568 behat: Reset theme CSS between scenarios 2020-06-24 17:12:06 +02:00
Andrew Nicols 0c595030cc MDL-66568 behat: Support building of themes for behat 2020-06-24 17:11:22 +02:00
Andrew Nicols 47ee1ee0d8 MDL-66568 core_output: Return built theme CSS 2020-06-24 17:11:03 +02:00
AMOS bot 3c36b02b17 Automatically generated installer lang files 2020-06-21 00:07:48 +00:00
Sara Arjona 220732372a weekly release 3.5.12+ 2020-06-18 14:13:46 +02:00
Sara Arjona 9691a7b331 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2020-06-18 14:13:44 +02:00
Víctor Déniz Falcón 6bd1059042 Merge branch 'MDL-69049-35' of git://github.com/junpataleta/moodle into MOODLE_35_STABLE 2020-06-16 17:47:36 +01:00
Jun Pataleta a6e3b62bbb MDL-69049 tool_dataprivacy: Add possibly missing comment format columns
The earlier CONTRIB plugin versions of the tool (<33.2.0, <34.2.0) were
missing the following columns in the data requests table:
* commentsformat
* dpocommentformat
And the upgrade scripts for the merged tool failed in
Moodle 3.3.8+/3.3.0+ failed to add these columns.
So a site which uses the CONTRIB plugin and eventually upgrading to 3.9
will encounter an error during upgrade because of the missing
dpocommentformat column.
2020-06-15 23:46:40 +08:00
AMOS bot 0788bf7d62 Automatically generated installer lang files 2020-06-06 00:07:48 +00:00
AMOS bot 04658e6111 Automatically generated installer lang files 2020-05-30 00:07:44 +00:00
Sara Arjona 6604114571 weekly release 3.5.12+ 2020-05-29 12:52:35 +02:00
Sara Arjona 2d553d9a11 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2020-05-29 12:52:33 +02:00
Jun Pataleta 64ff6f4e12 Merge branch 'MDL-68750-master-fix' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2020-05-29 16:54:57 +08:00
Andrew Nicols d6efe5c428 MDL-68750 tool_usertours: Amend tourstep template for missing markup 2020-05-29 16:43:09 +08:00
AMOS bot 9a01bf5dac Automatically generated installer lang files 2020-05-29 00:08:11 +00:00
Jun Pataleta 2ad7c452fa Merge branch 'MDL-68750-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2020-05-27 11:24:52 +08:00
Eloy Lafuente (stronk7) dabe4c6a8a weekly release 3.5.12+ 2020-05-26 22:52:11 +02:00
Andrew Nicols 68b632949d MDL-68750 core_tag: Add missing confirmation dialogue title 2020-05-26 12:58:00 +08:00
Andrew Nicols 24ec2b70d4 MDL-68750 behat: Correct dialogue selector 2020-05-26 12:58:00 +08:00
Andrew Nicols c85a85e1d6 Merge branch 'MDL-68658_35' of https://github.com/stronk7/moodle into MOODLE_35_STABLE 2020-05-25 15:50:07 +08:00
Eloy Lafuente (stronk7) 47890d6b75 MDL-68658 phpunit: Ensure that the configured proxy is applied always
Previously, if the RSS feed (extests) was being served locally,
CFG->proxybypass was applied and causing the test to fail (proxy
ignored).

In that exact test we need the configured proxy to be applied
always, because the test is exaclty about detecting the problem
when a wrong proxy is used.
2020-05-22 17:07:19 +02:00
Victor Deniz Falcon 184523e238 weekly release 3.5.12+ 2020-05-22 14:21:59 +01:00
Victor Deniz Falcon 61e908f935 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2020-05-22 14:21:55 +01:00
Adrian Greeve 3f86f7028c Merge branch 'MDL-68733_35' of https://github.com/timhunt/moodle into MOODLE_35_STABLE 2020-05-21 08:33:31 +08:00
AMOS bot 269569f55a Automatically generated installer lang files 2020-05-21 00:07:43 +00:00
AMOS bot 0e253a518f Automatically generated installer lang files 2020-05-20 00:07:53 +00:00
Tim Hunt b10488d134 MDL-68733 quiz editing: behat test for altering random question tags 2020-05-19 20:33:42 +01:00
Bence Molnar e4f5c4127b MDL-68733 quiz editing: be more careful deleting random question tags 2020-05-19 20:32:50 +01:00
Sara Arjona cf15e751c2 weekly release 3.5.12+ 2020-05-19 17:54:38 +02:00
Sara Arjona 492e9c9d54 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2020-05-19 17:54:34 +02:00
AMOS bot 094c79b550 Automatically generated installer lang files 2020-05-19 00:07:45 +00:00
Sara Arjona c2707068a0 Merge branch 'MDL-68728-35-2' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2020-05-18 20:23:18 +02:00
Andrew Nicols e260a4f35e MDL-68728 calendar: Pending promises for event summary 2020-05-18 13:59:10 +08:00
AMOS bot 2b2f40f423 Automatically generated installer lang files 2020-05-18 00:08:11 +00:00
AMOS bot 7961c01b98 Automatically generated installer lang files 2020-05-17 00:07:38 +00:00
Eloy Lafuente (stronk7) 98b0636874 weekly release 3.5.12+ 2020-05-15 11:06:44 +02:00
Jonathon Fowler 4b28673d1f MDL-68631 cron: ensure the cron user is reset between scheduled tasks 2020-05-13 09:32:31 +08:00
Sara Arjona d349c4d0da weekly release 3.5.12+ 2020-05-12 14:16:53 +02:00
Jun Pataleta 06544c7721 Merge branch 'MDL-66109-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2020-05-12 00:02:54 +08:00
Andrew Nicols 0255dcd2f4 MDL-66109 js: Built file changes from new Node version 2020-05-11 10:54:06 +08:00
Andrew Nicols 1e1576a246 MDL-66109 js: Remove unit on zero size 2020-05-11 10:54:06 +08:00
Andrew Nicols 8e8c8d86cc MDL-66109 js: Upgrade to latest stable version of NodeJS
Version 14.0.0 has just been released as stable, and will make its way
to an LTS release which will be supported until 30th April 2023.

At time of writing it is the "Current stable" release and will remain in
this phase until 20th October 2020, at whciih point it will transition
to LTS status.
2020-05-11 10:54:06 +08:00
Eloy Lafuente (stronk7) 035ec42e9f Moodle release 3.5.12 2020-05-09 20:05:26 +02:00
Eloy Lafuente (stronk7) b10116c72c weekly release 3.5.11+ 2020-05-08 13:29:45 +02:00
Eloy Lafuente (stronk7) fabbaee93a Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2020-05-08 13:29:42 +02:00
Paul Holden 041ecef9fe MDL-68410 mod_scorm: safer status operator comparison. 2020-05-07 09:04:10 +08:00
AMOS bot 977a542c89 Automatically generated installer lang files 2020-05-06 00:13:37 +00:00
Ferran Recio 9306db49a4 MDL-68430 filter_mathjaxloader: update default CDN to 2.7.8 2020-05-05 16:17:31 +02:00
AMOS bot dc4ab86218 Automatically generated installer lang files 2020-05-05 00:11:55 +00:00
AMOS bot 8f1c6d1220 Automatically generated installer lang files 2020-04-30 00:12:18 +00:00
AMOS bot e76269f9cb Automatically generated installer lang files 2020-04-27 00:11:51 +00:00
AMOS bot afb0530bb6 Automatically generated installer lang files 2020-04-23 00:14:58 +00:00
AMOS bot 31fcc3c3ab Automatically generated installer lang files 2020-04-19 00:13:39 +00:00
Eloy Lafuente (stronk7) b3228c00da weekly release 3.5.11+ 2020-04-16 19:34:00 +02:00
Eloy Lafuente (stronk7) 1fec48ab2e Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2020-04-16 19:33:55 +02:00
AMOS bot 6183e9ddd3 Automatically generated installer lang files 2020-04-11 00:12:16 +00:00
AMOS bot 1543ab4674 Automatically generated installer lang files 2020-04-11 00:12:15 +00:00
Eloy Lafuente (stronk7) 3b1275cae4 Merge branch 'MDL-67919-35' of git://github.com/sarjona/moodle into MOODLE_35_STABLE 2020-04-10 12:03:53 +02:00
Eloy Lafuente (stronk7) 7f6770c339 Merge branch 'MDL-67910-35' of git://github.com/sarjona/moodle into MOODLE_35_STABLE 2020-04-10 11:48:47 +02:00
AMOS bot 4e17f43808 Automatically generated installer lang files 2020-04-08 00:11:33 +00:00
AMOS bot f9c16916dc Automatically generated installer lang files 2020-04-08 00:11:33 +00:00
Sara Arjona 86c3578bce MDL-67919 dataprivacy: Fix behat error when contacting DPO 2020-04-03 19:49:41 +02:00
Sara Arjona 701377f9ab weekly release 3.5.11+ 2020-04-02 16:51:23 +02:00
Sara Arjona 5a6d92259b Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2020-04-02 16:51:21 +02:00
Sara Arjona 2f96412939 Merge branch 'MDL-66245-35' of git://github.com/junpataleta/moodle into MOODLE_35_STABLE 2020-03-31 15:10:00 +02:00
Sara Arjona 71a15d2c3b MDL-67910 behat: PendingJS improvements for deleteevent modal 2020-03-31 08:46:33 +02:00
AMOS bot c5470497c3 Automatically generated installer lang files 2020-03-29 00:12:08 +00:00
AMOS bot ccf8697cd9 Automatically generated installer lang files 2020-03-28 00:12:01 +00:00
AMOS bot 73b73ac55c Automatically generated installer lang files 2020-03-24 00:11:25 +00:00
AMOS bot 30df6463d7 Automatically generated installer lang files 2020-03-23 00:12:33 +00:00
Victor Deniz Falcon 8682e0f076 weekly release 3.5.11+ 2020-03-12 14:22:33 +00:00
Victor Deniz Falcon aa7b52f84b Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2020-03-12 14:22:28 +00:00
Eloy Lafuente (stronk7) 3add914c7c Merge branch 'MDL-68125-regression-MOODLE_35_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_35_STABLE 2020-03-12 01:20:12 +01:00
Brendan Heywood e6bd5804b9 MDL-68125 core: Fixed $CFG->reverseproxyignore install regression 2020-03-12 09:55:21 +11:00
Eloy Lafuente (stronk7) b2882f8ac3 Merge branch 'MDL-67827-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2020-03-09 20:36:47 +01:00
Andrew Nicols 5169acea00 MDL-67827 behat: Pending JS improvements for dialogues 2020-03-09 08:31:21 +08:00
Andrew Nicols e133eec60b MDL-67827 behat: Add missing exception use 2020-03-09 08:31:21 +08:00
AMOS bot 094c860a2e Automatically generated installer lang files 2020-03-09 00:12:16 +00:00
Sara Arjona d3f01844da Moodle release 3.5.11 2020-03-06 12:34:16 +01:00
AMOS bot 7f2a97e632 Automatically generated installer lang files 2020-03-06 00:11:15 +00:00
Sara Arjona 2a512be9f6 weekly release 3.5.10+ 2020-03-05 17:31:40 +01:00
Sara Arjona 3b643e9cad Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2020-03-05 17:31:37 +01:00
Michael Hawkins cc446ad1ec MDL-67861 core: Fix getremoteaddr unit test to match new proxy setup 2020-03-05 14:41:46 +08:00
Brendan Heywood 7251f154ef 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:13:12 +01:00
Brendan Heywood e6e07e0960 MDL-67861 libraries: Refactor is_ip_in_subnet_list in ip_utils 2020-03-05 01:13:04 +01:00
Brendan Heywood 51d52d273c MDL-67861 admin: Default $CFG->getremoteaddrconf to only use REMOTE_ADDR 2020-03-05 01:11:10 +01:00
Brendan Heywood 67c44ebd2e MDL-67861 core: Use last ip in X-Forwarded-For list 2020-03-05 01:11:09 +01:00
Marina Glancy eeaf8e0e62 MDL-56287 gradereport_history: Separate groups queries improved 2020-03-04 11:48:01 +01:00
Jun Pataleta 651a6bf5fa MDL-56287 gradereport_history: Show users from groups that can be viewed 2020-03-04 11:48:01 +01:00
AMOS bot 7135dc455a Automatically generated installer lang files 2020-03-04 00:11:33 +00:00
AMOS bot c6b033233f Automatically generated installer lang files 2020-02-16 00:11:32 +00:00
Sara Arjona cd7201ad49 weekly release 3.5.10+ 2020-02-14 12:12:18 +01:00
Sara Arjona 15a4027603 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2020-02-14 12:12:15 +01:00
Jun Pataleta d6eb0134af Merge branch 'MDL-67965-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2020-02-14 13:24:44 +08:00
Andrew Nicols 7505c8ce76 MDL-67965 behat: Get theme-specific context classes correctly 2020-02-14 11:36:08 +08:00
Jun Pataleta aeb959f07c MDL-66245 privacy: Encode each part of the data URL instead of the whole 2020-02-10 16:57:49 +08:00
AMOS bot 90e5c2b889 Automatically generated installer lang files 2020-02-08 00:12:18 +00:00
Sara Arjona 84a9a24b96 weekly release 3.5.10+ 2020-02-07 09:45:01 +01:00
Sara Arjona 78255acbf9 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2020-02-07 09:44:59 +01:00
Brendan Heywood 34af3ee683 MDL-67726 tool_phpunit: add missing input escaping 2020-02-06 19:46:18 +01:00
Andrew Nicols ae422c191c Merge branch 'MDL-67175-35' of git://github.com/ferranrecio/moodle into MOODLE_35_STABLE 2020-02-06 10:22:49 +08:00
Ferran Recio 8e77498176 MDL-67175 mod_scorm: fixing js eslint errors 2020-02-04 12:37:31 +01:00
Sam Hemelryk 89fb92a551 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 a624a36856 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
AMOS bot 56cfcc65cb Automatically generated installer lang files 2020-02-04 00:11:37 +00:00
Eloy Lafuente (stronk7) efb7b7d668 weekly release 3.5.10+ 2020-01-30 16:11:06 +01:00
Eloy Lafuente (stronk7) 2f5e4bc739 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2020-01-30 16:11:03 +01:00
Eloy Lafuente (stronk7) f21f69f0b8 Merge branch 'MDL-67722-35' of git://github.com/mickhawkins/moodle into MOODLE_35_STABLE 2020-01-28 20:14:20 +01:00
AMOS bot fda8d5d13d Automatically generated installer lang files 2020-01-28 00:12:03 +00:00
Adrian Greeve ea12d48932 Merge branch 'MDL-67691_35' of https://github.com/stronk7/moodle into MOODLE_35_STABLE 2020-01-28 07:56:33 +08:00
AMOS bot 383af5dab9 Automatically generated installer lang files 2020-01-25 00:12:05 +00:00
Adrian Greeve f1cf68fedc weekly release 3.5.10+ 2020-01-24 10:17:02 +08:00
Adrian Greeve 7fdc181bfe Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2020-01-24 10:16:53 +08:00
Adrian Greeve 0422d333a8 Merge branch 'MDL-67656-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2020-01-22 09:49:16 +08:00
Michael Hawkins f857f28d7a MDL-67722 mod_forum: Reduce wait time on time limit expires behat test 2020-01-21 11:40:38 +08:00
Eloy Lafuente (stronk7) c777c77434 Merge branch 'MDL-67724-35' of git://github.com/junpataleta/moodle into MOODLE_35_STABLE 2020-01-20 10:54:00 +01:00
Eloy Lafuente (stronk7) e2d5d5457f 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:15:39 +01:00
AMOS bot 4802739d19 Automatically generated installer lang files 2020-01-18 00:11:10 +00:00
Jun Pataleta 01087d1e45 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:51:34 +08:00
AMOS bot f30469004a Automatically generated installer lang files 2020-01-17 00:12:42 +00:00
AMOS bot e34df5a1c4 Automatically generated installer lang files 2020-01-14 00:10:45 +00:00
Andrew Nicols dd3e9a0c25 MDL-67656 behat: Removed nested spin 2020-01-10 14:36:12 +08:00
Andrew Nicols f246b1c05c MDL-67656 behat: Fix usleep call in spin 2020-01-10 14:36:12 +08:00
Andrew Nicols 2288e60615 Moodle release 3.5.10 2020-01-10 13:03:30 +08:00
Andrew Nicols f951911682 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2020-01-10 13:03:27 +08:00
AMOS bot ad262b981f Automatically generated installer lang files 2020-01-10 00:12:37 +00:00
Sara Arjona da4ffac0c9 weekly release 3.5.9+ 2020-01-09 15:42:57 +01:00
Eloy Lafuente (stronk7) 702c4b4781 Merge branch 'MDL-67469-35' of git://github.com/junpataleta/moodle into MOODLE_35_STABLE 2020-01-07 23:00:29 +01:00
Jake Dallimore fedba1fcc4 weekly release 3.5.9+ 2020-01-03 11:25:21 +08:00
Jake Dallimore de96ddee74 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2020-01-03 11:25:18 +08:00
AMOS bot 7b6a902ccd Automatically generated installer lang files 2020-01-03 00:12:31 +00:00
Adrian Greeve a0a03baad8 Merge branch 'MDL-67599-35' of https://github.com/snake/moodle into MOODLE_35_STABLE 2020-01-02 15:19:39 +08:00
Jake Dallimore e37073a24b MDL-67599 behat: fix behat tests assuming Jan 2020 is a future date 2020-01-02 13:56:16 +08:00
AMOS bot 9f59264afa Automatically generated installer lang files 2020-01-02 00:10:44 +00:00
Eloy Lafuente (stronk7) 7f4be41ed2 Merge branch 'MDL-67593-35' of https://github.com/snake/moodle into MOODLE_35_STABLE 2019-12-31 10:51:22 +01:00
Jake Dallimore 3dec6b78ce MDL-67593 core_iplookup: update lang string describing download process
Let users know they need to register on maxmind before granted download
access.
2019-12-31 15:59:41 +08:00
Jake Dallimore e3e41170fe MDL-67593 core_iplookup: use MaxMind test database in unit tests
Instead of downloading a live database (now not available publicly)
use a local test database.
2019-12-31 15:58:27 +08:00
Jun Pataleta 7c6be5b319 Merge branch 'MDL-63996-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2019-12-31 15:18:41 +08:00
Adrian Greeve 0613e56e69 Merge branch 'MDL-65809-35-onlyenv' of git://github.com/sarjona/moodle into MOODLE_35_STABLE 2019-12-24 14:58:52 +08:00
AMOS bot a3065e8220 Automatically generated installer lang files 2019-12-21 00:11:20 +00:00
Andrew Nicols f496b55189 MDL-63996 core/tags: Pending JS for all tag code 2019-12-18 12:02:54 +08:00
Andrew Nicols 135461b4a9 MDL-63996 behat: Fix multi-tag autocomplete usage 2019-12-18 10:25:57 +08:00
AMOS bot 8253f41405 Automatically generated installer lang files 2019-12-14 00:11:15 +00:00
AMOS bot cf0b79a80f Automatically generated installer lang files 2019-12-13 00:11:32 +00:00
AMOS bot 1a8dc02878 Automatically generated installer lang files 2019-12-11 13:50:31 +00:00
Jun Pataleta 5b3ec84495 MDL-67469 tool_dataprivacy: Put back missing test code
This patch simply brings back the missing test code for
\tool_dataprivacy_api_testcase::test_approve_data_request_non_dpo_user()
2019-12-06 16:11:38 +08:00
AMOS bot 0608b35a7b Automatically generated installer lang files 2019-12-06 00:10:04 +00:00
Sara Arjona abb5f229b1 MDL-65809 environment: mbstring extension required 2019-12-05 14:02:15 +01:00
Sara Arjona e2fd22fadd MDL-65809 environment: PHP 7.2 required 2019-12-05 14:02:15 +01:00
Sara Arjona 18c824af1f MDL-65809 environment: postgres requirement up to 9.5 2019-12-05 14:02:15 +01:00
Sara Arjona 37ce725987 MDL-65809 environment: mariadb requirement up to 10.2 2019-12-05 14:02:15 +01:00
Sara Arjona 8ac6793716 MDL-65809 environment: 3.5 (LTS) required 2019-12-05 14:02:15 +01:00
Sara Arjona 6022706b47 MDL-65809 environment: 3.9 base information
This is a direct copy of the 3.8 branch to have changes
under control easier in next commits.
2019-12-05 14:02:15 +01:00
Eloy Lafuente (stronk7) 250ea6a145 weekly release 3.5.9+ 2019-11-22 00:17:00 +01:00
Andrew Nicols 039096d1b1 Merge branch 'MDL-48024_35' of https://github.com/stronk7/moodle into MOODLE_35_STABLE 2019-11-21 19:45:47 +08:00
Eloy Lafuente (stronk7) 0ca3442925 MDL-48024 quiz: return void is only php >= 71
this branch supports php 70, so taking rid of it
2019-11-21 12:34:50 +01:00
Tim Hunt 1a4626d9fa MDL-48024 behat: allow plugins to have data generators
This extends the step
Given the following "users" exist:
to also support things like
Given the following "mod_quiz > user overrides" exist:

Instructions are on the behat_data_generators and
behat_generator_base classes.
2019-11-21 09:38:37 +08:00
Eloy Lafuente (stronk7) fa0b5768cc Moodle release 3.5.9 2019-11-09 11:57:38 +01:00
Sara Arjona 7b33c5e9ec weekly release 3.5.8+ 2019-11-08 15:39:52 +01:00
Sara Arjona d394a22ee6 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2019-11-08 15:39:50 +01:00
Adrian Greeve 83fe3c44c0 Merge branch 'MDL-67169_35' of https://github.com/stronk7/moodle into MOODLE_35_STABLE 2019-11-08 10:46:34 +08:00
Sara Arjona 282c4224da Merge branch 'MDL-66683-35' of git://github.com/cescobedo/moodle into MOODLE_35_STABLE 2019-11-07 17:41:53 +01:00
cescobedo 1312197a82 MDL-66683 core: Revert MDL-66181 because created regressions
This reverts commit ed080a580f.
This issue reverts the behaviour modified in MDL-66181, as that change
negatively impacted course-creation workflows. As this appears to be
the intended functionality, the Security team has agreed to revert
this change.
2019-11-07 17:31:25 +01:00
Jake Dallimore 5dc6fd3b23 MDL-66257 tool_cohortroles: unit test for users in multiple cohorts 2019-11-07 23:48:43 +08:00
cescobedo b49b76f397 MDL-66257 tool_cohortroles: Unassign the role on removal cohortroles. 2019-11-07 23:48:43 +08:00
Eloy Lafuente (stronk7) a4f4656110 MDL-67169 phpunit: fix clear flaw in unit test provider
Basically the provider is ignoring the CRLF to LF normalization
results and loading the original file again.

This doesn't have any impact normally, because all moodle
files are LF ones and people using other systems have their
git configurations set to work that way (not modify or force LF).

But there may be checkouts out there (for example travis) where
the git configuration by defult is to convert to the OS, causing
windows runs to fail badly there. See the issue for more info
and links.
2019-11-07 13:42:35 +01:00
Jun Pataleta 83bdb872dc MDL-66598 auth_oauth2: OAuth2 upgrade step
This basically does two things:
1. Updates all non-Facebook/Google/Microsoft issuers and sets their
'requireconfirmation' field to 1 so that future OAuth2 logins on these
issuers will always have an email confirmation sent to them.
2. Deletes the linked logins of users with non-Facebook/Google/Microsoft
OAuth2 issuers.
2019-11-07 18:46:05 +08:00
Jun Pataleta 39a83aa250 MDL-66598 auth_oauth2: Add warning messages in confirm emails 2019-11-07 18:46:05 +08:00
Jun Pataleta e70853386d MDL-66598 tool_oauth2: Make account confirmation required by default
* Only Facebook, Google, and Microsoft issuers can optionally offer to
require account confirmation via email. We will require email
confirmation for the rest of the issuers.
2019-11-07 18:46:05 +08:00
AMOS bot 451d514d84 Automatically generated installer lang files 2019-11-06 00:16:53 +00:00
Michael Hawkins 72f5a6e119 MDL-66161 output: Escaping fatal error message and URL strings 2019-11-05 13:51:42 +01:00
Paul Holden 7f624852e4 MDL-66228 mod_lesson: ensure return URL parameters are always local. 2019-11-05 13:51:42 +01:00
Eloy Lafuente (stronk7) 8abe8980d6 weekly release 3.5.8+ 2019-11-05 13:34:17 +01:00
Eloy Lafuente (stronk7) 431c7ba150 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2019-11-05 13:34:14 +01:00
Jake Dallimore 9b632e17d8 Merge branch 'MDL-67009_35' of https://github.com/stronk7/moodle into MOODLE_35_STABLE 2019-11-04 14:57:19 +08:00
AMOS bot b731ea9798 Automatically generated installer lang files 2019-11-02 00:09:46 +00:00
Eloy Lafuente (stronk7) 472b1b095e weekly release 3.5.8+ 2019-10-29 21:01:29 +01:00
Eloy Lafuente (stronk7) 2cddf32f7e Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2019-10-29 21:01:22 +01:00
Jake Dallimore 9b898bf8b4 Merge branch 'MDL-66945_35' of git://github.com/stronk7/moodle into MOODLE_35_STABLE 2019-10-29 14:57:04 +08:00
Andrew Nicols a87d3a64bb MDL-66945 composer: Update behat extension
(using php70 for this branch)

This uses a new version of the moodlehq-behat-extension which ensures
that a node is visible and in the view port before it is clicked on.

This resolves an issue with Firefox on Ubuntu 18.04 whereby the node is
only brought into the viewport instead of clicked on.
2019-10-28 13:44:27 +01:00
AMOS bot 55cd43d397 Automatically generated installer lang files 2019-10-28 00:09:34 +00:00
AMOS bot 9c1462ecfe Automatically generated installer lang files 2019-10-27 00:09:31 +00:00
Eloy Lafuente (stronk7) e22aba78ca weekly release 3.5.8+ 2019-10-25 15:29:30 +02:00
Eloy Lafuente (stronk7) d952f227d0 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2019-10-25 15:29:26 +02:00
Jake Dallimore d80cec9c2b Merge branch 'MOODLE_35_MDL-66973' of https://github.com/golenkovm/moodle into MOODLE_35_STABLE 2019-10-25 11:11:16 +08:00
Eloy Lafuente (stronk7) 77fe56108a MDL-67009 behat: get rid of invalid void type hinting for php70 2019-10-24 10:50:30 +02:00
AMOS bot 03550b7b8f Automatically generated installer lang files 2019-10-24 00:09:42 +00:00
Mikhail Golenkov 274ccc948b MDL-66973 search: Reset Content writer after test. 2019-10-22 09:41:46 +11:00
AMOS bot bc8d5da483 Automatically generated installer lang files 2019-10-19 00:09:35 +00:00
Eloy Lafuente (stronk7) 94bf3e9c78 weekly release 3.5.8+ 2019-10-18 10:31:16 +02:00
Andrew Nicols e92bd648db Merge branch 'MDL-66919_35' of https://github.com/stronk7/moodle into MOODLE_35_STABLE 2019-10-18 08:29:48 +08:00
Eloy Lafuente (stronk7) e4bb1cc603 MDL-66919 behat: fix typo in error message
Also fix a couple of phpdocs that were incorrect.
2019-10-16 00:49:32 +02:00
Eloy Lafuente (stronk7) c2f12aa742 weekly release 3.5.8+ 2019-10-15 22:59:44 +02:00
Jun Pataleta 454af7cf52 Merge branch 'MDL-66821_35' of https://github.com/timhunt/moodle into MOODLE_35_STABLE 2019-10-15 07:35:57 +08:00
Andrew Nicols f73e64f166 Merge branch 'MDL-66335_35' of https://github.com/stronk7/moodle into MOODLE_35_STABLE 2019-10-15 07:32:17 +08:00
Eloy Lafuente (stronk7) 18a738f88f MDL-66335 behat: Avoid double processing the page type
resolve_page_instance_helper() already processes the type, returning
the correct context that should be processing the navigation URL.

With that extra call to parse_page_name() the 2nd call always returns
"core", ultimately leading to tons of behat failures because "core" is
not aware of those (plugin, quiz for now) pages typology.
2019-10-15 00:04:54 +02:00
Eloy Lafuente (stronk7) 493a30cdc2 Merge branch 'MDL-66335_35' of https://github.com/timhunt/moodle into MOODLE_35_STABLE 2019-10-14 19:22:28 +02:00
Eloy Lafuente (stronk7) 65edc59a51 Merge branch 'MDL-66559-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2019-10-14 16:41:29 +02:00
Tim Hunt 28b9209af5 MDL-66335 quiz behat: using the new generic navigation steps
This converts all the navigation to quiz pages when that is not
the thing under test. Also, I decided that the Quiz settings form
belonged to the course, so did not do that here.
2019-10-14 13:20:29 +01:00
Tim Hunt 8b2c91e627 MDL-66335 behat: new step to log in and go straight to a particular page
I did not think thought through if this new URL parameter would be a
potential security hole. The simple cop-out option is to make it only
work on Behat sites for now.
2019-10-14 13:17:11 +01:00
Tim Hunt 8256d18453 MDL-66335 behat: generic step for navigating direct to specific pages 2019-10-14 13:15:27 +01:00
Tim Hunt ab11164395 MDL-66821 question behat: new step for acting on question in the bank
There is a proposed change MDL-66816 which will change the question
bank UI. This will break any Behat tests which uses low-level steps
like

    When I click on "Duplicate" "link" in the "Test question" "table_row"

to perform an action on a question in the question bank. This commit
introduces a new step:

    When I "Duplicate" the "Test question" question in the question bank

This commit also converts all core Behat tests to use the new step.
2019-10-14 12:02:42 +01:00
Andrew Nicols 29933a945f MDL-66559 behat: Register component selectors earlier 2019-10-14 14:24:05 +08:00
Andrew Nicols c7b384ce66 MDL-66559 behat: Update running suite 2019-10-14 14:17:47 +08:00
Jake Dallimore 665e256961 Merge branch 'MDL-66559-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2019-10-14 11:10:56 +08:00
Andrew Nicols 879532b41f MDL-66779 phpunit: Correct component name for core_grades 2019-10-13 02:34:16 +02:00
Eloy Lafuente (stronk7) 4e83a79cd5 weekly release 3.5.8+ 2019-10-11 22:43:20 +02:00
Eloy Lafuente (stronk7) 3ecba892e3 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2019-10-11 22:43:07 +02:00
Tim Hunt b92f4ba9f1 MDL-66559 behat: Documentation for component selectors 2019-10-11 12:58:16 +08:00
Andrew Nicols 6a3a83af93 MDL-66559 behat: Allow per-component selectors and replacements 2019-10-11 12:58:16 +08:00
AMOS bot 6e3a070030 Automatically generated installer lang files 2019-10-11 00:11:51 +00:00
Tim Hunt 5d701a706c MDL-66815 behat: question category generator must find right parent id
This is implemented in a bit of a hacky way, because the only other
alternative would be a large rewrite of the whole class, which is
not feasible for me right now. Note that many other types of thing
that can be generated suffer from the same issue. (E.g. if you ever
wanted to generate two groups with the same name in two different
courses and then add group memebers.)

It is worth doing a special-case fix for question categories, because
way Moodle works, it is inevitable that we end up with many categories
called 'top' in the database.
2019-10-11 00:51:39 +02:00
AMOS bot 612e4d9d02 Automatically generated installer lang files 2019-10-10 00:09:44 +00:00
Jun Pataleta df6f010a86 Merge branch 'MDL-66835_35' of https://github.com/timhunt/moodle into MOODLE_35_STABLE 2019-10-09 20:44:17 +08:00
Tim Hunt bf4904c32b MDL-66835 behat: steps for setting/checking fields in containers 2019-10-09 13:24:03 +01:00
Jun Pataleta 2821f78e6c weekly release 3.5.8+ 2019-09-27 11:12:16 +08:00
Jun Pataleta f904215fa7 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2019-09-27 11:12:15 +08:00
Jun Pataleta 635b605eab Merge branch 'MDL-66262_35' of git://github.com/stronk7/moodle into MOODLE_35_STABLE 2019-09-26 11:34:26 +08:00
Eloy Lafuente (stronk7) 08dd41b304 Merge branch 'MDL-66675-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2019-09-25 20:06:38 +02:00
AMOS bot 04cd0cb2ca Automatically generated installer lang files 2019-09-22 00:09:35 +00:00
Andrew Nicols 5cacda33bb MDL-66675 behat: Fix typo in step function name 2019-09-19 07:30:56 +08:00
Andrew Nicols 864ef22534 MDL-66675 behat: Add option to pause on behat failures 2019-09-19 07:30:55 +08:00
Andrew Nicols f008a03c60 MDL-66675 CLI: Add ANSI formatting options 2019-09-19 07:30:54 +08:00
Eloy Lafuente (stronk7) 8831cc14c7 MDL-66262 env: Moodle 3.6.x and 3.7.x do not support PHP 7.4 2019-09-13 17:44:58 +02:00
Jake Dallimore ebb87a1e63 weekly release 3.5.8+ 2019-09-13 11:30:14 +08:00
Jake Dallimore 93d9b19607 Merge branch 'install_35_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_35_STABLE 2019-09-13 11:30:13 +08:00
Eloy Lafuente (stronk7) 92d04a7913 Merge branch 'MDL-66550-35-2' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2019-09-12 15:32:14 +02:00
Andrew Nicols a5cdde3c79 MDL-66550 admin: The execute wrapper MUST be used in behat 2019-09-12 15:46:04 +08:00
Andrew Nicols d073f5daf0 MDL-66550 theme: Wrap JS calls in pendingJS 2019-09-12 14:59:03 +08:00
AMOS bot 3972ef0a32 Automatically generated installer lang files 2019-09-12 00:09:38 +00:00
Jake Dallimore 01b63287ef Merge branch 'MDL-66550-35-2' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE 2019-09-11 10:42:07 +08:00
Andrew Nicols b3259b51bb MDL-66550 forum: Target fields in a fieldset for behat test 2019-09-10 21:24:20 +08:00
Andrew Nicols b683a48f69 MDL-66550 behat: Transform fields to search in a fieldset 2019-09-10 21:24:20 +08:00
Andrew Nicols 944888a509 MDL-66550 behat: Standardise finding in core functionality 2019-09-10 21:24:20 +08:00
Andrew Nicols 21ac04e12e MDL-66550 behat: Add ability to transform a specific selector 2019-09-10 21:24:15 +08:00
Andrew Nicols ab9b65b6a7 MDL-66550 behat: Normalise selectors better 2019-09-10 21:24:07 +08:00
937 changed files with 14679 additions and 6868 deletions
+71
View File
@@ -0,0 +1,71 @@
<?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/>.
/**
* Template configuraton file for github actions CI/CD.
*
* @package core
* @copyright 2020 onwards Eloy Lafuente (stronk7) {@link https://stronk7.com}
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
// This cannot be used out from a github actions workflow, so just exit.
getenv('GITHUB_WORKFLOW') || die; // phpcs:ignore moodle.Files.MoodleInternal.MoodleInternalGlobalState
unset($CFG);
global $CFG;
$CFG = new stdClass();
$CFG->dbtype = getenv('dbtype');
$CFG->dblibrary = 'native';
$CFG->dbhost = '127.0.0.1';
$CFG->dbname = 'test';
$CFG->dbuser = 'test';
$CFG->dbpass = 'test';
$CFG->prefix = 'm_';
$CFG->dboptions = ['dbcollation' => 'utf8mb4_bin'];
$host = 'localhost';
$CFG->wwwroot = "http://{$host}";
$CFG->dataroot = realpath(dirname(__DIR__)) . '/moodledata';
$CFG->admin = 'admin';
$CFG->directorypermissions = 0777;
// Debug options - possible to be controlled by flag in future.
$CFG->debug = (E_ALL | E_STRICT); // DEBUG_DEVELOPER.
$CFG->debugdisplay = 1;
$CFG->debugstringids = 1; // Add strings=1 to url to get string ids.
$CFG->perfdebug = 15;
$CFG->debugpageinfo = 1;
$CFG->allowthemechangeonurl = 1;
$CFG->passwordpolicy = 0;
$CFG->cronclionly = 0;
$CFG->pathtophp = getenv('pathtophp');
$CFG->phpunit_dataroot = realpath(dirname(__DIR__)) . '/phpunitdata';
$CFG->phpunit_prefix = 't_';
define('TEST_EXTERNAL_FILES_HTTP_URL', 'http://localhost:8080');
define('TEST_EXTERNAL_FILES_HTTPS_URL', 'http://localhost:8080');
define('TEST_SESSION_REDIS_HOST', 'localhost');
define('TEST_CACHESTORE_REDIS_TESTSERVERS', 'localhost');
// TODO: add others (solr, mongodb, memcached, ldap...).
// Too much for now: define('PHPUNIT_LONGTEST', true); // Only leaves a few tests out and they are run later by CI.
require_once(__DIR__ . '/lib/setup.php');
+104
View File
@@ -0,0 +1,104 @@
name: Core
on: [push]
env:
php: 7.2
jobs:
Grunt:
runs-on: ubuntu-18.04
steps:
- name: Checking out code
uses: actions/checkout@v2
- name: Configuring node & npm
shell: bash -l {0}
run: nvm install
- name: Installing node stuff
run: npm install
- name: Running grunt
run: npx grunt
- name: Looking for uncommitted changes
# Add all files to the git index and then run diff --cached to see all changes.
# This ensures that we get the status of all files, including new files.
# We ignore npm-shrinkwrap.json to make the tasks immune to npm changes.
run: |
git add .
git reset -- npm-shrinkwrap.json
git diff --cached --exit-code
PHPUnit:
runs-on: ${{ matrix.os }}
services:
exttests:
image: moodlehq/moodle-exttests
ports:
- 8080:80
redis:
image: redis
ports:
- 6379:6379
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-18.04
php: 7.0
db: mysqli
- os: ubuntu-18.04
php: 7.2
db: pgsql
steps:
- name: Setting up DB mysql
if: ${{ matrix.db == 'mysqli' }}
uses: johanmeiring/mysql-action@tmpfs-patch
with:
collation server: utf8mb4_bin
mysql version: 5.7
mysql database: test
mysql user: test
mysql password: test
use tmpfs: true
- name: Setting up DB pgsql
if: ${{ matrix.db == 'pgsql' }}
uses: m4nu56/postgresql-action@v1
with:
postgresql version: 9.6
postgresql db: test
postgresql user: test
postgresql password: test
- name: Configuring git vars
uses: rlespinasse/github-slug-action@v3.x
- name: Setting up PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mysqli, zip, gd, xmlrpc, soap
coverage: none
- name: Checking out code from ${{ env.GITHUB_REF_SLUG }}
uses: actions/checkout@v2
- name: Setting up PHPUnit
env:
dbtype: ${{ matrix.db }}
run: |
echo "pathtophp=$(which php)" >> $GITHUB_ENV # Inject installed pathtophp to env. The template config needs it.
cp .github/workflows/config-template.php config.php
mkdir ../moodledata
sudo locale-gen en_AU.UTF-8
php admin/tool/phpunit/cli/init.php --no-composer-self-update
- name: Running PHPUnit tests
env:
dbtype: ${{ matrix.db }}
run: vendor/bin/phpunit -v
+1 -1
View File
@@ -1 +1 @@
v8.16.1
v14.15.0
+44 -76
View File
@@ -4,19 +4,16 @@
sudo: required
# We currently disable Travis notifications entirely until https://github.com/travis-ci/travis-ci/issues/4976
# is fixed.
notifications:
email: false
email:
if: env(MOODLE_EMAIL) != no
language: php
dist: trusty
php:
# We only run the highest and lowest supported versions to reduce the load on travis-ci.org.
- 7.2
- 7.0
services:
- docker
addons:
postgresql: "9.6"
@@ -29,49 +26,50 @@ addons:
# services:
# - redis-server
env:
# Although we want to run these jobs and see failures as quickly as possible, we also want to get the slowest job to
# start first so that the total run time is not too high.
#
# We only run MySQL on PHP 7.2, so run that first.
# CI Tests should be second-highest in priority as these only take <= 60 seconds to run under normal circumstances.
# Postgres is significantly is pretty reasonable in its run-time.
# Run unit tests on MySQL
- DB=mysqli TASK=PHPUNIT
# Run CI Tests without running PHPUnit.
- DB=none TASK=CITEST
# Run unit tests on Postgres
- DB=pgsql TASK=PHPUNIT
# 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.
fast_finish: true
include:
# Run grunt/npm install on highest version ('node' is an alias for the latest node.js version.)
- php: 7.2
env: DB=none TASK=GRUNT NVM_VERSION='lts/carbon'
# First all the lowest php ones (7.0)
- php: 7.0
env: DB=none TASK=CITEST
- php: 7.0
env: DB=none TASK=GRUNT NVM_VERSION='lts/carbon'
exclude:
# MySQL - it's just too slow.
# Exclude it on all versions except for 7.2
- env: DB=mysqli TASK=PHPUNIT
- if: env(MOODLE_DATABASE) = "pgsql" OR env(MOODLE_DATABASE) = "all" OR env(MOODLE_DATABASE) IS NOT present
php: 7.0
env: DB=pgsql TASK=PHPUNIT
- if: env(MOODLE_DATABASE) = "mysqli" OR env(MOODLE_DATABASE) = "all"
php: 7.0
env: DB=mysqli TASK=PHPUNIT
- if: env(MOODLE_PHP) = "all"
php: 7.2
env: DB=none TASK=CITEST
- if: env(MOODLE_PHP) = "all"
php: 7.2
env: DB=none TASK=GRUNT NVM_VERSION='lts/carbon'
- if: env(MOODLE_PHP) = "all" AND (env(MOODLE_DATABASE) = "pgsql" OR env(MOODLE_DATABASE) = "all" OR env(MOODLE_DATABASE) IS NOT present)
php: 7.2
env: DB=pgsql TASK=PHPUNIT
- if: env(MOODLE_PHP) = "all" AND (env(MOODLE_DATABASE) = "mysqli" OR env(MOODLE_DATABASE) = "all")
php: 7.2
env: DB=mysqli TASK=PHPUNIT
cache:
directories:
- $HOME/.composer/cache
- $HOME/.npm
before_install:
- docker run -d -p 127.0.0.1:8080:80 --name exttests moodlehq/moodle-exttests
install:
- >
if [ "$DB" = 'mysqli' ];
@@ -122,7 +120,7 @@ install:
before_script:
- phpenv config-rm xdebug.ini
- >
if [ "$TASK" = 'PHPUNIT' -o "$TASK" = 'UPGRADE' ];
if [ "$TASK" = 'PHPUNIT' ];
then
# Copy generic configuration in place.
cp config-dist.php config.php ;
@@ -181,6 +179,11 @@ before_script:
-e "/require_once/i \\\$CFG->phpunit_dataroot = '\/home\/travis\/roots\/phpunit';" \
-e "/require_once/i \\\$CFG->phpunit_prefix = 'p_';" \
config.php ;
# Enable test external resources
sed -i \
-e "/require_once/i \\define('TEST_EXTERNAL_FILES_HTTP_URL', 'http://127.0.0.1:8080');" \
-e "/require_once/i \\define('TEST_EXTERNAL_FILES_HTTPS_URL', 'http://127.0.0.1:8080');" \
config.php ;
# Initialise PHPUnit for Moodle.
php admin/tool/phpunit/cli/init.php
@@ -220,32 +223,6 @@ before_script:
export phpcmd=`which php`;
fi
########################################################################
# Upgrade test
########################################################################
- >
if [ "$TASK" = 'UPGRADE' ];
then
# We need the official upstream.
git remote add upstream https://github.com/moodle/moodle.git;
# Checkout 30 STABLE branch (the first version compatible with PHP 7.x)
git fetch upstream MOODLE_30_STABLE;
git checkout MOODLE_30_STABLE;
# Perform the upgrade
php admin/cli/install_database.php --agree-license --adminpass=Password --adminemail=admin@example.com --fullname="Upgrade test" --shortname=Upgrade;
# Return to the previous commit
git checkout -;
# Perform the upgrade
php admin/cli/upgrade.php --non-interactive --allow-unstable ;
# The local_ci repository can be used to check upgrade savepoints.
git clone https://github.com/moodlehq/moodle-local_ci.git local/ci ;
fi
script:
- >
if [ "$TASK" = 'PHPUNIT' ];
@@ -271,19 +248,10 @@ script:
git diff --cached --exit-code ;
fi
########################################################################
# Upgrade test
########################################################################
after_script:
- >
if [ "$TASK" = 'UPGRADE' ];
if [ "$TASK" = 'PHPUNIT' ];
then
cp local/ci/check_upgrade_savepoints/check_upgrade_savepoints.php ./check_upgrade_savepoints.php
result=`php check_upgrade_savepoints.php`;
# Check if there are problems
count=`echo "$result" | grep -P "ERROR|WARN" | wc -l` ;
if (($count > 0));
then
echo "$result"
exit 1 ;
fi
EXTTESTS_HITS=$(docker logs exttests 2>&1 | grep -Fv -e 'AH00558' -e '[pid 1]' | wc -l)
echo -e "\nTest local resources number of hits: ${EXTTESTS_HITS}.\n"
fi
+1 -1
View File
@@ -2,7 +2,7 @@ MOODLE TRADEMARKS POLICY
========================
The word "Moodle" is trademarked in many countries around the world. The word
was originally an acronym: Modular Object-Oriented Dynamic Learning
was originally coined as an acronym: Modular Object-Oriented Dynamic Learning
Environment. The trademark is owned by Martin Dougiamas, Founder and Director
of Moodle.
+551
View File
@@ -2451,6 +2451,7 @@
<VENDOR name="oracle" version="11.2" />
</DATABASE>
<PHP version="7.0.0" level="required">
<RESTRICT function="restrict_php_version_74" message="unsupportedphpversion74" />
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
@@ -2632,6 +2633,7 @@
<VENDOR name="oracle" version="11.2" />
</DATABASE>
<PHP version="7.1.0" level="required">
<RESTRICT function="restrict_php_version_74" message="unsupportedphpversion74" />
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
@@ -2813,6 +2815,7 @@
<VENDOR name="oracle" version="11.2" />
</DATABASE>
<PHP version="7.1.0" level="required">
<RESTRICT function="restrict_php_version_80" message="unsupportedphpversion80" />
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
@@ -2980,4 +2983,552 @@
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="3.9" requires="3.5">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mariadb" version="10.2.29" />
<VENDOR name="mysql" version="5.6" />
<VENDOR name="postgres" version="9.5" />
<VENDOR name="mssql" version="11.0" />
<VENDOR name="oracle" version="11.2" />
</DATABASE>
<PHP version="7.2.0" level="required">
<RESTRICT function="restrict_php_version_80" message="unsupportedphpversion80" />
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
<ON_CHECK message="pcreunicodewarning" />
</FEEDBACK>
</PCREUNICODE>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="required">
<FEEDBACK>
<ON_ERROR message="mbstringrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="required">
<FEEDBACK>
<ON_ERROR message="opensslrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="tokenizer" level="optional">
<FEEDBACK>
<ON_CHECK message="tokenizerrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlrpc" level="optional">
<FEEDBACK>
<ON_CHECK message="xmlrpcrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="soap" level="optional">
<FEEDBACK>
<ON_CHECK message="soaprecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="ctype" level="required">
<FEEDBACK>
<ON_ERROR message="ctyperequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zip" level="required">
<FEEDBACK>
<ON_ERROR message="ziprequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zlib" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="gd" level="required">
<FEEDBACK>
<ON_ERROR message="gdrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="dom" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xml" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlreader" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="intl" level="required">
<FEEDBACK>
<ON_ERROR message="intlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" level="required"/>
<PHP_EXTENSION name="fileinfo" level="required"/>
</PHP_EXTENSIONS>
<PHP_SETTINGS>
<PHP_SETTING name="memory_limit" value="96M" level="required">
<FEEDBACK>
<ON_ERROR message="settingmemorylimit" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="file_uploads" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="settingfileuploads" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="opcache.enable" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="opcacherecommended" />
</FEEDBACK>
</PHP_SETTING>
</PHP_SETTINGS>
<CUSTOM_CHECKS>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_storage_engine" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbstorageengine" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="question/engine/upgrade/upgradelib.php" function="quiz_attempts_upgraded" level="required">
<FEEDBACK>
<ON_ERROR message="quizattemptsupgradedmessage" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_slasharguments" level="optional">
<FEEDBACK>
<ON_CHECK message="slashargumentswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_tables_row_format" level="optional">
<FEEDBACK>
<ON_CHECK message="unsupporteddbtablerowformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_unoconv_version" level="optional">
<FEEDBACK>
<ON_CHECK message="unoconvwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
<FEEDBACK>
<ON_CHECK message="libcurlwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_format" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbfileformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_per_table" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbfilepertable" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_large_prefix" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddblargeprefix" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_is_https" level="optional">
<FEEDBACK>
<ON_CHECK message="ishttpswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_incomplete_unicode_support" level="optional">
<FEEDBACK>
<ON_CHECK message="incompleteunicodesupport" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_sixtyfour_bits" level="optional">
<FEEDBACK>
<ON_CHECK message="sixtyfourbitswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="3.10" requires="3.5">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mariadb" version="10.2.29" />
<VENDOR name="mysql" version="5.7" />
<VENDOR name="postgres" version="9.6" />
<VENDOR name="mssql" version="11.0" />
<VENDOR name="oracle" version="11.2" />
</DATABASE>
<PHP version="7.2.0" level="required">
<RESTRICT function="restrict_php_version_80" message="unsupportedphpversion80" />
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
<ON_CHECK message="pcreunicodewarning" />
</FEEDBACK>
</PCREUNICODE>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="required">
<FEEDBACK>
<ON_ERROR message="mbstringrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="required">
<FEEDBACK>
<ON_ERROR message="opensslrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="tokenizer" level="optional">
<FEEDBACK>
<ON_CHECK message="tokenizerrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlrpc" level="optional">
<FEEDBACK>
<ON_CHECK message="xmlrpcrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="soap" level="optional">
<FEEDBACK>
<ON_CHECK message="soaprecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="ctype" level="required">
<FEEDBACK>
<ON_ERROR message="ctyperequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zip" level="required">
<FEEDBACK>
<ON_ERROR message="ziprequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zlib" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="gd" level="required">
<FEEDBACK>
<ON_ERROR message="gdrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="dom" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xml" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlreader" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="intl" level="required">
<FEEDBACK>
<ON_ERROR message="intlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" level="required"/>
<PHP_EXTENSION name="fileinfo" level="required"/>
</PHP_EXTENSIONS>
<PHP_SETTINGS>
<PHP_SETTING name="memory_limit" value="96M" level="required">
<FEEDBACK>
<ON_ERROR message="settingmemorylimit" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="file_uploads" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="settingfileuploads" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="opcache.enable" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="opcacherecommended" />
</FEEDBACK>
</PHP_SETTING>
</PHP_SETTINGS>
<CUSTOM_CHECKS>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_storage_engine" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbstorageengine" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="question/engine/upgrade/upgradelib.php" function="quiz_attempts_upgraded" level="required">
<FEEDBACK>
<ON_ERROR message="quizattemptsupgradedmessage" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_slasharguments" level="optional">
<FEEDBACK>
<ON_CHECK message="slashargumentswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_tables_row_format" level="optional">
<FEEDBACK>
<ON_CHECK message="unsupporteddbtablerowformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_unoconv_version" level="optional">
<FEEDBACK>
<ON_CHECK message="unoconvwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
<FEEDBACK>
<ON_CHECK message="libcurlwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_format" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbfileformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_per_table" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbfilepertable" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_large_prefix" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddblargeprefix" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_is_https" level="optional">
<FEEDBACK>
<ON_CHECK message="ishttpswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_incomplete_unicode_support" level="optional">
<FEEDBACK>
<ON_CHECK message="incompleteunicodesupport" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_sixtyfour_bits" level="optional">
<FEEDBACK>
<ON_CHECK message="sixtyfourbitswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="3.11" requires="3.6">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mariadb" version="10.2.29" />
<VENDOR name="mysql" version="5.7" />
<VENDOR name="postgres" version="9.6" />
<VENDOR name="mssql" version="14.0" />
<VENDOR name="oracle" version="11.2" />
</DATABASE>
<PHP version="7.3.0" level="required">
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
<ON_CHECK message="pcreunicodewarning" />
</FEEDBACK>
</PCREUNICODE>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="required">
<FEEDBACK>
<ON_ERROR message="mbstringrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="required">
<FEEDBACK>
<ON_ERROR message="opensslrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="tokenizer" level="optional">
<FEEDBACK>
<ON_CHECK message="tokenizerrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlrpc" level="optional">
<FEEDBACK>
<ON_CHECK message="xmlrpcrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="soap" level="optional">
<FEEDBACK>
<ON_CHECK message="soaprecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="ctype" level="required">
<FEEDBACK>
<ON_ERROR message="ctyperequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zip" level="required">
<FEEDBACK>
<ON_ERROR message="ziprequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zlib" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="gd" level="required">
<FEEDBACK>
<ON_ERROR message="gdrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="dom" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xml" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlreader" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="intl" level="required">
<FEEDBACK>
<ON_ERROR message="intlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" level="required"/>
<PHP_EXTENSION name="fileinfo" level="required"/>
<PHP_EXTENSION name="sodium" level="optional"/>
</PHP_EXTENSIONS>
<PHP_SETTINGS>
<PHP_SETTING name="memory_limit" value="96M" level="required">
<FEEDBACK>
<ON_ERROR message="settingmemorylimit" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="file_uploads" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="settingfileuploads" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="opcache.enable" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="opcacherecommended" />
</FEEDBACK>
</PHP_SETTING>
</PHP_SETTINGS>
<CUSTOM_CHECKS>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_storage_engine" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbstorageengine" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="question/engine/upgrade/upgradelib.php" function="quiz_attempts_upgraded" level="required">
<FEEDBACK>
<ON_ERROR message="quizattemptsupgradedmessage" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_slasharguments" level="optional">
<FEEDBACK>
<ON_CHECK message="slashargumentswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_tables_row_format" level="optional">
<FEEDBACK>
<ON_CHECK message="unsupporteddbtablerowformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_unoconv_version" level="optional">
<FEEDBACK>
<ON_CHECK message="unoconvwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
<FEEDBACK>
<ON_CHECK message="libcurlwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_format" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbfileformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_per_table" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbfilepertable" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_large_prefix" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddblargeprefix" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_is_https" level="optional">
<FEEDBACK>
<ON_CHECK message="ishttpswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_incomplete_unicode_support" level="optional">
<FEEDBACK>
<ON_CHECK message="incompleteunicodesupport" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_sixtyfour_bits" level="optional">
<FEEDBACK>
<ON_CHECK message="sixtyfourbitswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_max_input_vars" level="optional">
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
</COMPATIBILITY_MATRIX>
+4 -1
View File
@@ -98,7 +98,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_DEFAULT, $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));
+5 -29
View File
@@ -48,7 +48,6 @@ class behat_admin extends behat_base {
* @param TableNode $table
*/
public function i_set_the_following_administration_settings_values(TableNode $table) {
if (!$data = $table->getRowsHash()) {
return;
}
@@ -57,17 +56,12 @@ class behat_admin extends behat_base {
// We expect admin block to be visible, otherwise go to homepage.
if (!$this->getSession()->getPage()->find('css', '.block_settings')) {
$this->getSession()->visit($this->locate_path('/'));
$this->wait(self::get_timeout() * 1000, self::PAGE_READY_JS);
$this->execute('behat_forms::i_am_on_homepage');
}
// Search by label.
$searchbox = $this->find_field(get_string('searchinsettings', 'admin'));
$searchbox->setValue($label);
$submitsearch = $this->find('css', 'form.adminsearchform input[type=submit]');
$submitsearch->press();
$this->wait(self::get_timeout() * 1000, self::PAGE_READY_JS);
$this->execute('behat_forms::i_set_the_field_to', [get_string('searchinsettings', 'admin'), $label]);
$this->execute("behat_general::i_click_on_in_the", [get_string('search', 'admin'), 'button', '.block_settings', 'css_element']);
// Admin settings does not use the same DOM structure than other moodle forms
// but we also need to use lib/behat/form_field/* to deal with the different moodle form elements.
@@ -83,35 +77,17 @@ class behat_admin extends behat_base {
"@id=//span[contains(normalize-space(.), $label)]/preceding-sibling::label[1]/@for]";
$fieldnode = $this->find('xpath', $fieldxpath, $exception);
$formfieldtypenode = $this->find('xpath', $fieldxpath . "/ancestor::div[@class='form-setting']" .
"/child::div[contains(concat(' ', @class, ' '), ' form-')]/child::*/parent::div");
} catch (ElementNotFoundException $e) {
// Multi element settings, interacting only the first one.
$fieldxpath = "//*[label[normalize-space(.)= $label]|span[normalize-space(.)= $label]]/" .
"ancestor::div[contains(concat(' ', normalize-space(@class), ' '), ' form-item ')]" .
"/descendant::div[@class='form-group']/descendant::*[self::input | self::textarea | self::select]" .
"[not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')]";
$fieldnode = $this->find('xpath', $fieldxpath);
// It is the same one that contains the type.
$formfieldtypenode = $fieldnode;
}
// Getting the class which contains the field type.
$classes = explode(' ', $formfieldtypenode->getAttribute('class'));
foreach ($classes as $class) {
if (substr($class, 0, 5) == 'form-') {
$type = substr($class, 5);
}
}
// Instantiating the appropiate field type.
$field = behat_field_manager::get_field_instance($type, $fieldnode, $this->getSession());
$field->set_value($value);
$this->find_button(get_string('savechanges'))->press();
$this->execute('behat_forms::i_set_the_field_with_xpath_to', [$fieldxpath, $value]);
$this->execute("behat_general::i_click_on", [get_string('savechanges'), 'button']);
}
}
+6
View File
@@ -164,6 +164,8 @@ if ($options['install']) {
mtrace("Acceptance tests site installed");
}
// Note: Do not build the themes here. This is done during the 'enable' stage.
} else if ($options['drop']) {
// Ensure no tests are running.
test_lock::acquire('behat');
@@ -182,6 +184,10 @@ if ($options['install']) {
// Enable test mode.
behat_util::start_test_mode($options['add-core-features-to-theme'], $options['optimize-runs'], $parallel, $run);
// Themes are only built in the 'enable' command.
behat_util::build_themes();
mtrace("Testing environment themes built");
// This is only displayed once for parallel install.
if (empty($run)) {
// Notify user that 2.5 profile has been converted to 3.5.
@@ -0,0 +1,27 @@
@tool_behat
Feature: Behat steps for interacting with form work
In order to test my Moodle code
As a developer
I need the Behat steps for form elements to work reliably
@javascript
Scenario: Test fields in containers
Given the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
When I log in as "admin"
And I am on "Course 1" course homepage
# Just get to any form.
And I navigate to "Edit settings" in current page administration
And I set the field "Course full name" in the "General" "fieldset" to "Frog"
And I set the following fields in the "Appearance" "fieldset" to these values:
| Show activity reports | Yes |
| Number of announcements | 1 |
Then the field "Show activity reports" in the "Appearance" "fieldset" matches value "Yes"
And the field "Show activity reports" in the "Appearance" "fieldset" does not match value "No"
And the following fields in the "region-main" "region" match these values:
| Course full name | Frog |
| Number of announcements | 1 |
And the following fields in the "region-main" "region" do not match these values:
| Course full name | Course 1 |
| Number of announcements | 5 |
@@ -0,0 +1,30 @@
@tool_behat
Feature: Verify that the inplace editable field works as expected
In order to use behat step definitions
As a test write
I need to ensure that the inplace editable works in forms
Background:
Given the following "course" exists:
| fullname | Course 1 |
| shortname | C1 |
And the following "activities" exist:
| activity | course | name | idnumber |
| forum | C1 | My first forum | forum1 |
| assign | C1 | My first assignment | assign1 |
| quiz | C1 | My first quiz | quiz1 |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
@javascript
Scenario: Using an inplace editable updates the name of an activity
When I set the field "Edit title" in the "My first assignment" "activity" to "Coursework submission"
Then I should see "Coursework submission"
And I should not see "My first assignment"
But I should see "My first forum"
And I should see "My first quiz"
And I set the field "Edit title" in the "Coursework submission" "activity" to "My first assignment"
And I should not see "Coursework submission"
But I should see "My first assignment"
And I should see "My first forum"
And I should see "My first quiz"
@@ -0,0 +1,42 @@
@tool_behat
Feature: Verify that keyboard steps work as expected
In order to use behat step definitions
As a test writer
I need to verify that the keyboard steps work as expected
@javascript
Scenario: Typing keys into a field causes them to be input
Given the following "users" exist:
| username | email | firstname | lastname | password |
| saffronr | saffron.rutledge@example.com | Saffron | Rutledge | flowerpower |
Given I click on "Log in" "link"
And I click on "Username" "field"
When I type "saffronr"
And I press the tab key
And I type "flowerpower"
And I press enter
Then I should see "You are logged in as Saffron Rutledge"
@javascript
Scenario: Using tab changes focus to the next or previous field
Given I click on "Log in" "link"
And I click on "Username" "field"
And the focused element is "Username" "field"
When I press the tab key
Then the focused element is "Password" "field"
And I press the shift tab key
And the focused element is "Username" "field"
@javascript
Scenario: The escape key can be used to close a dialogue
Given the following "course" exists:
| fullname | C1|
| shortname | C1 |
And I log in as "admin"
And I am on "C1" course homepage
And I navigate to course participants
And I press "Enrol users"
And "Enrol users" "dialogue" should be visible
When I press the escape key
Then "Enrol users" "dialogue" should not be visible
+42
View File
@@ -222,6 +222,48 @@ class api {
}
}
// Clean the legacy role assignments which are stale.
$paramsclean['usercontext'] = CONTEXT_USER;
$paramsclean['component'] = 'tool_cohortroles';
$sql = 'SELECT DISTINCT(ra.id), ra.roleid, ra.userid, ra.contextid, ctx.instanceid
FROM {role_assignments} ra
JOIN {context} ctx ON ctx.id = ra.contextid AND ctx.contextlevel = :usercontext
JOIN {cohort_members} cm ON cm.userid = ctx.instanceid
LEFT JOIN {tool_cohortroles} tc ON tc.cohortid = cm.cohortid
AND tc.userid = ra.userid
AND tc.roleid = ra.roleid
WHERE ra.component = :component
AND tc.id is null';
if ($candidatelegacyassignments = $DB->get_records_sql($sql, $paramsclean)) {
$sql = 'SELECT DISTINCT(ra.id)
FROM {role_assignments} ra
JOIN {context} ctx ON ctx.id = ra.contextid AND ctx.contextlevel = :usercontext
JOIN {cohort_members} cm ON cm.userid = ctx.instanceid
JOIN {tool_cohortroles} tc ON tc.cohortid = cm.cohortid AND tc.userid = ra.userid
WHERE ra.component = :component';
if ($currentvalidroleassignments = $DB->get_records_sql($sql, $paramsclean)) {
foreach ($candidatelegacyassignments as $candidate) {
if (!array_key_exists($candidate->id, $currentvalidroleassignments)) {
role_unassign($candidate->roleid, $candidate->userid, $candidate->contextid, 'tool_cohortroles');
$rolesremoved[] = array(
'useridassignedto' => $candidate->userid,
'useridassignedover' => $candidate->instanceid,
'roleid' => $candidate->roleid
);
}
}
} else {
foreach ($candidatelegacyassignments as $candidate) {
role_unassign($candidate->roleid, $candidate->userid, $candidate->contextid, 'tool_cohortroles');
$rolesremoved[] = array(
'useridassignedto' => $candidate->userid,
'useridassignedover' => $candidate->instanceid,
'roleid' => $candidate->roleid
);
}
}
}
return array('rolesadded' => $rolesadded, 'rolesremoved' => $rolesremoved);
}
@@ -103,5 +103,4 @@ class cohort_role_assignment extends persistent {
return true;
}
}
+82 -7
View File
@@ -50,8 +50,6 @@ class tool_cohortroles_api_testcase extends advanced_testcase {
* Setup function- we will create a course and add an assign instance to it.
*/
protected function setUp() {
global $DB;
$this->resetAfterTest(true);
// Create some users.
@@ -133,14 +131,91 @@ class tool_cohortroles_api_testcase extends advanced_testcase {
public function test_delete_cohort_role_assignment() {
$this->setAdminUser();
$params = (object) array(
// Create a cohort role assigment.
$params = (object) [
'userid' => $this->userassignto->id,
'roleid' => $this->roleid,
'cohortid' => $this->cohort->id
);
$result = api::create_cohort_role_assignment($params);
$worked = api::delete_cohort_role_assignment($result->get('id'));
$this->assertTrue($worked);
];
$cohortroleassignment = api::create_cohort_role_assignment($params);
$sync = api::sync_all_cohort_roles();
$rolesadded = [
[
'useridassignedto' => $this->userassignto->id,
'useridassignedover' => $this->userassignover->id,
'roleid' => $this->roleid
]
];
$expected = [
'rolesadded' => $rolesadded,
'rolesremoved' => []
];
$this->assertEquals($sync, $expected);
// Delete the cohort role assigment and confirm the roles are removed.
$result = api::delete_cohort_role_assignment($cohortroleassignment->get('id'));
$this->assertTrue($result);
$sync = api::sync_all_cohort_roles();
$expected = [
'rolesadded' => [],
'rolesremoved' => $rolesadded
];
$this->assertEquals($expected, $sync);
}
/**
* Test case verifying that syncing won't remove role assignments if they are valid for another cohort role assignment.
*/
public function test_delete_cohort_role_assignment_cohorts_having_same_members() {
$this->setAdminUser();
// Create 2 cohorts, with a 1 user (user1) present in both,
// and user2 and user3 members of 1 cohort each.
$cohort1 = $this->getDataGenerator()->create_cohort();
$cohort2 = $this->getDataGenerator()->create_cohort();
$user1 = $this->getDataGenerator()->create_user();
$user2 = $this->getDataGenerator()->create_user();
$user3 = $this->getDataGenerator()->create_user();
cohort_add_member($cohort1->id, $user1->id);
cohort_add_member($cohort1->id, $user2->id);
cohort_add_member($cohort2->id, $user1->id);
cohort_add_member($cohort2->id, $user3->id);
// And a role and a user to assign that role to.
$user4 = $this->getDataGenerator()->create_user(); // A cohort manager, for example.
$roleid = create_role('Role 1', 'myrole', 'test');
// Assign the role for user4 in both cohorts.
$params = (object) [
'userid' => $user4->id,
'roleid' => $roleid,
'cohortid' => $cohort1->id
];
$cohort1roleassignment = api::create_cohort_role_assignment($params);
$params->cohortid = $cohort2->id;
$cohort2roleassignment = api::create_cohort_role_assignment($params);
$sync = api::sync_all_cohort_roles();
// There is no guarantee about the order of roles assigned.
// so confirm we have 3 role assignments, and they are for the users 1, 2 and 3.
$this->assertCount(3, $sync['rolesadded']);
$addedusers = array_column($sync['rolesadded'], 'useridassignedover');
$this->assertContains($user1->id, $addedusers);
$this->assertContains($user2->id, $addedusers);
$this->assertContains($user3->id, $addedusers);
// Remove the role assignment for user4/cohort1.
// Verify only 1 role is unassigned as the others are still valid for the other cohort role assignment.
$result = api::delete_cohort_role_assignment($cohort1roleassignment->get('id'));
$this->assertTrue($result);
$sync = api::sync_all_cohort_roles();
$this->assertCount(0, $sync['rolesadded']);
$this->assertCount(1, $sync['rolesremoved']);
$removedusers = array_column($sync['rolesremoved'], 'useridassignedover');
$this->assertContains($user2->id, $removedusers);
}
public function test_list_cohort_role_assignments() {
+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);
});
};
+23
View File
@@ -276,5 +276,28 @@ function xmldb_tool_dataprivacy_upgrade($oldversion) {
upgrade_plugin_savepoint(true, 2018051415, 'tool', 'dataprivacy');
}
if ($oldversion < 2018051416) {
// Define field commentsformat to be added to tool_dataprivacy_request.
$table = new xmldb_table('tool_dataprivacy_request');
$field = new xmldb_field('commentsformat', XMLDB_TYPE_INTEGER, '2', null, XMLDB_NOTNULL, null, '0', 'comments');
// Conditionally launch add field commentsformat.
if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}
// Define field dpocommentformat to be added to tool_dataprivacy_request.
$field = new xmldb_field('dpocommentformat', XMLDB_TYPE_INTEGER, '2', null, XMLDB_NOTNULL, null, '0', 'dpocomment');
// Conditionally launch add field dpocommentformat.
if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}
// Dataprivacy savepoint reached.
upgrade_plugin_savepoint(true, 2018051416, 'tool', 'dataprivacy');
}
return true;
}
@@ -337,6 +337,11 @@ class tool_dataprivacy_api_testcase extends advanced_testcase {
$datarequest = api::create_data_request($student->id, api::DATAREQUEST_TYPE_EXPORT);
$requestid = $datarequest->get('id');
// Login as a user without DPO role.
$this->setUser($teacher);
$this->expectException(required_capability_exception::class);
api::approve_data_request($requestid);
}
/**
@@ -87,7 +87,7 @@ Feature: Data export from the privacy API
And I reload the page
And I should see "Download ready" in the "Export all of my personal data" "table_row"
And I open the action menu in "Victim User 1" "table_row"
And following "Download" should download between "1" and "130000" bytes
And following "Download" should download between "1" and "144000" bytes
And the following config values are set as admin:
| privacyrequestexpiry | 1 | tool_dataprivacy |
@@ -46,7 +46,7 @@ Feature: Manage data requests
And I open the action menu in "John Doe" "table_row"
And I should see "View the request"
But I should not see "Mark as complete"
And I press key "27" in ".moodle-actionmenu" "css_element"
And I press the escape key
And I open the action menu in "Jane Doe" "table_row"
And I choose "Mark as complete" in the open action menu
And I should see "Do you really want to mark this user enquiry as complete?"
@@ -10,16 +10,12 @@ Feature: Manage data storage purposes
And I open the action menu in "region-main" "region"
And I choose "Purposes" in the open action menu
And I press "Add purpose"
And I set the field "Name" to "Purpose 1"
And I set the field "Description" to "Purpose 1 description"
And I click on ".form-autocomplete-downarrow" "css_element" in the "Lawful bases" "form_row"
And I click on "Contract (GDPR Art. 6.1(b))" "list_item"
And I click on "Legal obligation (GDPR Art 6.1(c))" "list_item"
And I press key "27" in the field "Lawful bases"
And I click on ".form-autocomplete-downarrow" "css_element" in the "Sensitive personal data processing reasons" "form_row"
And I click on "Explicit consent (GDPR Art. 9.2(a))" "list_item"
And I press key "27" in the field "Sensitive personal data processing reasons"
And I set the field "retentionperiodnumber" to "2"
And I set the following fields to these values:
| Name | Purpose 1 |
| Description | Purpose 1 description |
| Lawful bases | Contract (GDPR Art. 6.1(b)),Legal obligation (GDPR Art 6.1(c)) |
| Sensitive personal data processing reasons | Explicit consent (GDPR Art. 9.2(a)) |
| retentionperiodnumber | 2 |
When I press "Save"
Then I should see "Purpose 1" in the "List of data purposes" "table"
And I should see "Contract (GDPR Art. 6.1(b))" in the "Purpose 1" "table_row"
@@ -31,14 +27,13 @@ Feature: Manage data storage purposes
Scenario: Update a data storage purpose
Given I open the action menu in "Purpose 1" "table_row"
And I choose "Edit" in the open action menu
And I set the field "Name" to "Purpose 1 edited"
And I set the field "Description" to "Purpose 1 description edited"
And I click on "Legal obligation (GDPR Art 6.1(c))" "text" in the ".form-autocomplete-selection" "css_element"
And I click on ".form-autocomplete-downarrow" "css_element" in the "Lawful bases" "form_row"
And I click on "Vital interests (GDPR Art. 6.1(d))" "list_item"
And I press key "27" in the field "Lawful bases"
And I set the field "retentionperiodnumber" to "3"
And I click on "protected" "checkbox"
And I set the following fields to these values:
| Name | Purpose 1 edited |
| Description | Purpose 1 description edited |
| Lawful bases | Contract (GDPR Art. 6.1(b)), Vital interests (GDPR Art. 6.1(d)) |
| Sensitive personal data processing reasons | Explicit consent (GDPR Art. 9.2(a)) |
| retentionperiodnumber | 3 |
| protected | 1 |
When I press "Save changes"
Then I should see "Purpose 1 edited" in the "List of data purposes" "table"
And I should see "Purpose 1 description edited" in the "Purpose 1 edited" "table_row"
+1 -1
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die;
$plugin->version = 2018051415;
$plugin->version = 2018051416;
$plugin->requires = 2018050800; // Moodle 3.5dev (Build 2018031600) and upwards.
$plugin->component = 'tool_dataprivacy';
+1 -1
View File
@@ -1 +1 @@
define(["core/yui"],function(a){var b=function(b,c,d,e,f){this.yuiDialogue=null;var g=this;"undefined"==typeof f&&(f=!1),a.use("moodle-core-notification","timers",function(){var h="480px";f&&(h="800px"),g.yuiDialogue=new M.core.dialogue({headerContent:b,bodyContent:c,draggable:!0,visible:!1,center:!0,modal:!0,width:h}),g.yuiDialogue.after("visibleChange",function(b){b.newVal?"undefined"!=typeof d&&a.soon(function(){d(g),g.yuiDialogue.centerDialogue()}):"undefined"!=typeof e&&a.soon(function(){e(g)})}),g.yuiDialogue.show()})};return b.prototype.close=function(){this.yuiDialogue.hide(),this.yuiDialogue.destroy()},b.prototype.getContent=function(){return this.yuiDialogue.bodyNode.getDOMNode()},b});
define(["core/yui"],function(a){var b=function(b,c,d,e,f){M.util.js_pending("tool_lp/dialogue:dialogue"),this.yuiDialogue=null;var g=this;"undefined"==typeof f&&(f=!1),a.use("moodle-core-notification","timers",function(){var h="480px";f&&(h="800px"),g.yuiDialogue=new M.core.dialogue({headerContent:b,bodyContent:c,draggable:!0,visible:!1,center:!0,modal:!0,width:h}),g.yuiDialogue.before("visibleChange",function(){M.util.js_pending("tool_lp/dialogue:before:visibleChange")}),g.yuiDialogue.after("visibleChange",function(b){b.newVal?"undefined"!=typeof d?a.soon(function(){d(g),g.yuiDialogue.centerDialogue(),M.util.js_complete("tool_lp/dialogue:before:visibleChange")}):M.util.js_complete("tool_lp/dialogue:before:visibleChange"):"undefined"!=typeof e?a.soon(function(){e(g),M.util.js_complete("tool_lp/dialogue:before:visibleChange")}):M.util.js_complete("tool_lp/dialogue:before:visibleChange")}),g.yuiDialogue.show(),M.util.js_complete("tool_lp/dialogue:dialogue")})};return b.prototype.close=function(){this.yuiDialogue.hide(),this.yuiDialogue.destroy()},b.prototype.getContent=function(){return this.yuiDialogue.bodyNode.getDOMNode()},b});
+1 -1
View File
@@ -1 +1 @@
define(["jquery","core/notification","core/templates","tool_lp/dialogue","tool_lp/event_base","core/str"],function(a,b,c,d,e,f){var g=function(a){e.prototype.constructor.apply(this,[]),this._ratingOptions=a};return g.prototype=Object.create(e.prototype),g.prototype._popup=null,g.prototype._ratingOptions=null,g.prototype._afterRender=function(){var b=this._find('[data-action="rate"]'),c=this._find('[name="rating"]'),d=this._find('[name="comment"]');this._find('[data-action="cancel"]').click(function(a){a.preventDefault(),this._trigger("cancelled"),this.close()}.bind(this)),c.change(function(){var c=a(this);c.val()?b.prop("disabled",!1):b.prop("disabled",!0)}).change(),b.click(function(a){a.preventDefault();var b=c.val();b&&(this._trigger("rated",{rating:b,note:d.val()}),this.close())}.bind(this))},g.prototype.close=function(){this._popup.close(),this._popup=null},g.prototype.display=function(){return a.when(f.get_string("rate","tool_lp"),this._render()).then(function(a,b){return this._popup=new d(a,b[0],this._afterRender.bind(this)),this._popup}.bind(this))["catch"](b.exception)},g.prototype._find=function(b){return a(this._popup.getContent()).find(b)},g.prototype._render=function(){var a={cangrade:this._canGrade,ratings:this._ratingOptions};return c.render("tool_lp/competency_grader",a)},g});
define(["jquery","core/notification","core/templates","tool_lp/dialogue","tool_lp/event_base","core/str"],function(a,b,c,d,e,f){var g=function(a){e.prototype.constructor.apply(this,[]),this._ratingOptions=a};return g.prototype=Object.create(e.prototype),g.prototype._popup=null,g.prototype._ratingOptions=null,g.prototype._afterRender=function(){var b=this._find('[data-action="rate"]'),c=this._find('[name="rating"]'),d=this._find('[name="comment"]');this._find('[data-action="cancel"]').click(function(a){a.preventDefault(),this._trigger("cancelled"),this.close()}.bind(this)),c.change(function(){var c=a(this);c.val()?b.prop("disabled",!1):b.prop("disabled",!0)}).change(),b.click(function(a){a.preventDefault();var b=c.val();b&&(this._trigger("rated",{rating:b,note:d.val()}),this.close())}.bind(this))},g.prototype.close=function(){this._popup.close(),this._popup=null},g.prototype.display=function(){return M.util.js_pending("tool_lp/grade_dialogue:display"),a.when(f.get_string("rate","tool_lp"),this._render()).then(function(a,b){return this._popup=new d(a,b[0],function(){this._afterRender(),M.util.js_complete("tool_lp/grade_dialogue:display")}.bind(this)),this._popup}.bind(this))["catch"](b.exception)},g.prototype._find=function(b){return a(this._popup.getContent()).find(b)},g.prototype._render=function(){var a={cangrade:this._canGrade,ratings:this._ratingOptions};return c.render("tool_lp/competency_grader",a)},g});
@@ -1 +1 @@
define(["jquery","core/notification","core/ajax","core/log","tool_lp/grade_dialogue","tool_lp/event_base","tool_lp/scalevalues"],function(a,b,c,d,e,f,g){var h=function(b,c,d,e,g,h,i){f.prototype.constructor.apply(this,[]);var j=a(b);if(!j.length)throw new Error("Could not find the trigger");this._scaleId=c,this._competencyId=d,this._userId=e,this._planId=g,this._courseId=h,this._chooseStr=i,this._setUp(),j.click(function(a){a.preventDefault(),this._dialogue.display()}.bind(this)),this._planId?(this._methodName="core_competency_grade_competency_in_plan",this._args={competencyid:this._competencyId,planid:this._planId}):this._courseId?(this._methodName="core_competency_grade_competency_in_course",this._args={competencyid:this._competencyId,courseid:this._courseId,userid:this._userId}):(this._methodName="core_competency_grade_competency",this._args={userid:this._userId,competencyid:this._competencyId})};return h.prototype=Object.create(f.prototype),h.prototype._setUp=function(){var a=[],d=this,f=g.get_values(d._scaleId);f.then(function(b){a.push({value:"",name:d._chooseStr});for(var c=0;c<b.length;c++){var e=b[c];a.push({value:e.id,name:e.name})}return a}).then(function(a){return new e(a)}).then(function(a){return a.on("rated",function(a,e){var f=d._args;f.grade=e.rating,f.note=e.note,c.call([{methodname:d._methodName,args:f,done:function(a){d._trigger("competencyupdated",{args:f,evidence:a})},fail:b.exception}])}),a}).then(function(a){d._dialogue=a}).fail(b.exception)},h.prototype._scaleId=null,h.prototype._competencyId=null,h.prototype._userId=null,h.prototype._planId=null,h.prototype._courseId=null,h.prototype._chooseStr=null,h.prototype._dialogue=null,h});
define(["jquery","core/notification","core/ajax","core/log","tool_lp/grade_dialogue","tool_lp/event_base","tool_lp/scalevalues"],function(a,b,c,d,e,f,g){var h=function(b,c,d,e,g,h,i){f.prototype.constructor.apply(this,[]);var j=a(b);if(!j.length)throw new Error("Could not find the trigger");this._scaleId=c,this._competencyId=d,this._userId=e,this._planId=g,this._courseId=h,this._chooseStr=i,this._setUp(),j.click(function(a){a.preventDefault(),this._dialogue.display()}.bind(this)),this._planId?(this._methodName="core_competency_grade_competency_in_plan",this._args={competencyid:this._competencyId,planid:this._planId}):this._courseId?(this._methodName="core_competency_grade_competency_in_course",this._args={competencyid:this._competencyId,courseid:this._courseId,userid:this._userId}):(this._methodName="core_competency_grade_competency",this._args={userid:this._userId,competencyid:this._competencyId})};return h.prototype=Object.create(f.prototype),h.prototype._setUp=function(){var a=[],d=this;M.util.js_pending("tool_lp/grade_user_competency_inline:_setUp");var f=g.get_values(d._scaleId);f.then(function(b){a.push({value:"",name:d._chooseStr});for(var c=0;c<b.length;c++){var e=b[c];a.push({value:e.id,name:e.name})}return a}).then(function(a){return new e(a)}).then(function(a){return a.on("rated",function(a,e){var f=d._args;f.grade=e.rating,f.note=e.note,c.call([{methodname:d._methodName,args:f,done:function(a){d._trigger("competencyupdated",{args:f,evidence:a})},fail:b.exception}])}),a}).then(function(a){d._dialogue=a,M.util.js_complete("tool_lp/grade_user_competency_inline:_setUp")}).fail(b.exception)},h.prototype._scaleId=null,h.prototype._competencyId=null,h.prototype._userId=null,h.prototype._planId=null,h.prototype._courseId=null,h.prototype._chooseStr=null,h.prototype._dialogue=null,h});
+13
View File
@@ -35,6 +35,8 @@ define(['core/yui'], function(Y) {
* @param {Boolean} wide Specify we want an extra wide dialogue (the size is standard, but wider than the default).
*/
var dialogue = function(title, content, afterShow, afterHide, wide) {
M.util.js_pending('tool_lp/dialogue:dialogue');
this.yuiDialogue = null;
var parent = this;
@@ -59,6 +61,10 @@ define(['core/yui'], function(Y) {
width: width
});
parent.yuiDialogue.before('visibleChange', function() {
M.util.js_pending('tool_lp/dialogue:before:visibleChange');
});
parent.yuiDialogue.after('visibleChange', function(e) {
if (e.newVal) {
// Delay the callback call to the next tick, otherwise it can happen that it is
@@ -67,18 +73,25 @@ define(['core/yui'], function(Y) {
Y.soon(function() {
afterShow(parent);
parent.yuiDialogue.centerDialogue();
M.util.js_complete('tool_lp/dialogue:before:visibleChange');
});
} else {
M.util.js_complete('tool_lp/dialogue:before:visibleChange');
}
} else {
if ((typeof afterHide !== 'undefined')) {
Y.soon(function() {
afterHide(parent);
M.util.js_complete('tool_lp/dialogue:before:visibleChange');
});
} else {
M.util.js_complete('tool_lp/dialogue:before:visibleChange');
}
}
});
parent.yuiDialogue.show();
M.util.js_complete('tool_lp/dialogue:dialogue');
});
};
+5 -1
View File
@@ -102,6 +102,7 @@ define(['jquery',
* @return {Promise}
*/
Grade.prototype.display = function() {
M.util.js_pending('tool_lp/grade_dialogue:display');
return $.when(
Str.get_string('rate', 'tool_lp'),
this._render()
@@ -110,7 +111,10 @@ define(['jquery',
this._popup = new Dialogue(
title,
templateResult[0],
this._afterRender.bind(this)
function() {
this._afterRender();
M.util.js_complete('tool_lp/grade_dialogue:display');
}.bind(this)
);
return this._popup;
@@ -94,6 +94,7 @@ define(['jquery',
var options = [],
self = this;
M.util.js_pending('tool_lp/grade_user_competency_inline:_setUp');
var promise = ScaleValues.get_values(self._scaleId);
promise.then(function(scalevalues) {
options.push({
@@ -134,6 +135,7 @@ define(['jquery',
.then(function(dialogue) {
self._dialogue = dialogue;
M.util.js_complete('tool_lp/grade_user_competency_inline:_setUp');
return;
})
.fail(notification.exception);
+2 -4
View File
@@ -30,7 +30,7 @@ Feature: Manage plearning plan
And I click on ".template-userplans" "css_element" in the "Science template" "table_row"
And I open the autocomplete suggestions list
And I click on "Admin User" item in the autocomplete list
And I press key "27" in the field "Select users to create learning plans for"
And I press the escape key
When I click on "Create learning plans" "button"
Then I should see "A learning plan was created"
And I should see "Admin User" in the "Science template" "table_row"
@@ -53,9 +53,7 @@ Feature: Manage plearning plan
And I follow "Home"
And I navigate to "Competencies > Learning plan templates" in site administration
And I click on ".template-cohorts" "css_element" in the "Science template cohort" "table_row"
And I click on ".form-autocomplete-downarrow" "css_element"
And I click on "cohort plan" item in the autocomplete list
And I press key "27" in the field "Select cohorts to sync"
And I set the field "Select cohorts to sync" to "cohort plan"
When I click on "Add cohorts" "button"
Then I should see "2 learning plans were created."
And I follow "Learning plan templates"
+2 -1
View File
@@ -28,6 +28,7 @@ defined('MOODLE_INTERNAL') || die();
use \tool_monitor\privacy\provider;
use \core_privacy\local\request\approved_contextlist;
use \core_privacy\local\request\approved_userlist;
use \core_privacy\tests\provider_testcase;
/**
* Privacy test for the event monitor
@@ -37,7 +38,7 @@ use \core_privacy\local\request\approved_userlist;
* @copyright 2018 Adrian Greeve <adriangreeve.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class tool_monitor_privacy_testcase extends advanced_testcase {
class tool_monitor_privacy_testcase extends provider_testcase {
/**
* Set up method.
+6 -3
View File
@@ -123,9 +123,12 @@ class issuer extends persistent {
$mform->addElement('checkbox', 'showonloginpage', get_string('issuershowonloginpage', 'tool_oauth2'));
$mform->addHelpButton('showonloginpage', 'issuershowonloginpage', 'tool_oauth2');
// Require confirmation email for new accounts.
$mform->addElement('advcheckbox', 'requireconfirmation', get_string('issuerrequireconfirmation', 'tool_oauth2'));
$mform->addHelpButton('requireconfirmation', 'issuerrequireconfirmation', 'tool_oauth2');
$showrequireconfirm = $this->_customdata['showrequireconfirm'] ?? false;
if ($showrequireconfirm) {
// Require confirmation email for new accounts.
$mform->addElement('advcheckbox', 'requireconfirmation', get_string('issuerrequireconfirmation', 'tool_oauth2'));
$mform->addHelpButton('requireconfirmation', 'issuerrequireconfirmation', 'tool_oauth2');
}
$mform->addElement('hidden', 'sortorder');
$mform->setType('sortorder', PARAM_INT);
+33 -5
View File
@@ -58,7 +58,25 @@ if ($action == 'edit') {
$PAGE->navbar->add(get_string('createnewissuer', 'tool_oauth2'));
}
$mform = new \tool_oauth2\form\issuer(null, ['persistent' => $issuer]);
if (!empty($issuerid)) {
// Show the "Require confirmation email" checkbox for trusted issuers like Google, Facebook and Microsoft.
$likefacebook = $DB->sql_like('url', ':facebook');
$likegoogle = $DB->sql_like('url', ':google');
$likemicrosoft = $DB->sql_like('url', ':microsoft');
$params = [
'issuerid' => $issuerid,
'facebook' => '%facebook%',
'google' => '%google%',
'microsoft' => '%microsoft%',
];
$select = "issuerid = :issuerid AND ($likefacebook OR $likegoogle OR $likemicrosoft)";
// We're querying from the oauth2_endpoint table because the base URLs of FB and Microsoft can be empty in the issuer table.
$showrequireconfirm = $DB->record_exists_select('oauth2_endpoint', $select, $params);
} else {
$showrequireconfirm = optional_param('showrequireconfirm', false, PARAM_BOOL);
}
$mform = new \tool_oauth2\form\issuer(null, ['persistent' => $issuer, 'showrequireconfirm' => $showrequireconfirm]);
}
if ($mform && $mform->is_cancelled()) {
@@ -157,21 +175,31 @@ if ($mform && $mform->is_cancelled()) {
$issuers = core\oauth2\api::get_all_issuers();
echo $renderer->issuers_table($issuers);
// Google template.
$docs = 'admin/tool/oauth2/issuers/google';
$params = ['action' => 'edittemplate', 'type' => 'google', 'sesskey' => sesskey(), 'docslink' => $docs];
$params = ['action' => 'edittemplate', 'type' => 'google', 'sesskey' => sesskey(), 'docslink' => $docs,
'showrequireconfirm' => true];
$addurl = new moodle_url('/admin/tool/oauth2/issuers.php', $params);
echo $renderer->single_button($addurl, get_string('createnewgoogleissuer', 'tool_oauth2'));
// Microsoft template.
$docs = 'admin/tool/oauth2/issuers/microsoft';
$params = ['action' => 'edittemplate', 'type' => 'microsoft', 'sesskey' => sesskey(), 'docslink' => $docs];
$params = ['action' => 'edittemplate', 'type' => 'microsoft', 'sesskey' => sesskey(), 'docslink' => $docs,
'showrequireconfirm' => true];
$addurl = new moodle_url('/admin/tool/oauth2/issuers.php', $params);
echo $renderer->single_button($addurl, get_string('createnewmicrosoftissuer', 'tool_oauth2'));
// Facebook template.
$docs = 'admin/tool/oauth2/issuers/facebook';
$params = ['action' => 'edittemplate', 'type' => 'microsoft', 'sesskey' => sesskey(), 'docslink' => $docs];
$params = ['action' => 'edittemplate', 'type' => 'facebook', 'sesskey' => sesskey(), 'docslink' => $docs];
$params = ['action' => 'edittemplate', 'type' => 'facebook', 'sesskey' => sesskey(), 'docslink' => $docs,
'showrequireconfirm' => true];
$addurl = new moodle_url('/admin/tool/oauth2/issuers.php', $params);
echo $renderer->single_button($addurl, get_string('createnewfacebookissuer', 'tool_oauth2'));
// Generic issuer.
$addurl = new moodle_url('/admin/tool/oauth2/issuers.php', ['action' => 'edit']);
echo $renderer->single_button($addurl, get_string('createnewissuer', 'tool_oauth2'));
echo $OUTPUT->footer();
}
+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)';
@@ -1 +1 @@
define(["jquery","core/ajax","core/notification"],function(a,b,c){return{list:function(b,c){var d=[],e=a(b),f=a(b).data("originaloptionsjson"),g=e.val();a.each(f,function(b,e){return""!==a.trim(c)&&e.label.toLocaleLowerCase().indexOf(c.toLocaleLowerCase())===-1||(a.inArray(e.value,g)>-1||(d.push(e),!0))});var h=new a.Deferred;return h.resolve(d),h.promise()},processResults:function(b,c){var d=[];return a.each(c,function(a,b){d.push({value:b.value,label:b.label})}),d},transport:function(a,b,d){this.list(a,b).then(d)["catch"](c.exception)}}});
define(["jquery","core/ajax","core/notification"],function(a,b,c){return{list:function(b,c){var d=[],e=a(b),f=a(b).data("originaloptionsjson"),g=e.val();a.each(f,function(b,e){return""!==c.trim()&&e.label.toLocaleLowerCase().indexOf(c.toLocaleLowerCase())===-1||(a.inArray(e.value,g)>-1||(d.push(e),!0))});var h=new a.Deferred;return h.resolve(d),h.promise()},processResults:function(b,c){var d=[];return a.each(c,function(a,b){d.push({value:b.value,label:b.label})}),d},transport:function(a,b,d){this.list(a,b).then(d)["catch"](c.exception)}}});
@@ -41,7 +41,7 @@ define(['jquery', 'core/ajax', 'core/notification'], function($, Ajax, Notificat
var selectedFilters = el.val();
$.each(originalOptions, function(index, option) {
// Skip option if it does not contain the query string.
if ($.trim(query) !== '' && option.label.toLocaleLowerCase().indexOf(query.toLocaleLowerCase()) === -1) {
if (query.trim() !== '' && option.label.toLocaleLowerCase().indexOf(query.toLocaleLowerCase()) === -1) {
return true;
}
// Skip filters that have already been selected.
@@ -643,6 +643,6 @@ class acceptances_table extends \table_sql {
}
return ''; // User agreed by themselves.
}
return null;
return parent::other_cols($column, $row);
}
}
+14 -19
View File
@@ -838,36 +838,31 @@ class tool_uploadcourse_course {
unset($method['delete']);
unset($method['disable']);
if (!empty($instance) && $todelete) {
if ($todelete) {
// Remove the enrolment method.
foreach ($instances as $instance) {
if ($instance->enrol == $enrolmethod) {
$plugin = $enrolmentplugins[$instance->enrol];
$plugin->delete_instance($instance);
break;
}
if ($instance) {
$plugin = $enrolmentplugins[$instance->enrol];
$plugin->delete_instance($instance);
}
} else if (!empty($instance) && $todisable) {
// Disable the enrolment.
foreach ($instances as $instance) {
if ($instance->enrol == $enrolmethod) {
$plugin = $enrolmentplugins[$instance->enrol];
$plugin->update_status($instance, ENROL_INSTANCE_DISABLED);
$enrol_updated = true;
break;
}
}
$plugin = $enrolmentplugins[$instance->enrol];
$plugin->update_status($instance, ENROL_INSTANCE_DISABLED);
$enrol_updated = true;
} else {
$plugin = null;
$status = ($todisable) ? ENROL_INSTANCE_DISABLED : ENROL_INSTANCE_ENABLED;
if (empty($instance)) {
$plugin = $enrolmentplugins[$enrolmethod];
$instance = new stdClass();
$instance->id = $plugin->add_default_instance($course);
$instanceid = $plugin->add_default_instance($course);
$instance = $DB->get_record('enrol', ['id' => $instanceid]);
$instance->roleid = $plugin->get_config('roleid');
$instance->status = ENROL_INSTANCE_ENABLED;
$plugin->update_status($instance, $status);
} else {
$plugin = $enrolmentplugins[$instance->enrol];
$plugin->update_status($instance, ENROL_INSTANCE_ENABLED);
$plugin->update_status($instance, $status);
}
// Now update values.
@@ -0,0 +1,114 @@
@tool @tool_uploadcourse @_file_upload
Feature: An admin can update courses enrolments using a CSV file
In order to update courses enrolments using a CSV file
As an admin
I need to be able to upload a CSV file with enrolment methods for the courses
Background:
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And I log in as "admin"
@javascript
Scenario: Creating enrolment method by enable it
Given I am on "Course 1" course homepage
And I navigate to "Users > Enrolment methods" in current page administration
And I click on "Delete" "link" in the "Guest access" "table_row"
And I click on "Continue" "button"
And I should not see "Guest access" in the "generaltable" "table"
And I navigate to "Courses > Upload courses" in site administration
And I upload "admin/tool/uploadcourse/tests/fixtures/enrolment_enable.csv" file to "File" filemanager
And I set the field "Upload mode" to "Only update existing courses"
And I set the field "Update mode" to "Update with CSV data only"
And I set the field "Allow deletes" to "Yes"
And I click on "Preview" "button"
When I click on "Upload courses" "button"
Then I should see "Course updated"
And I am on "Course 1" course homepage
And I navigate to "Users > Enrolment methods" in current page administration
And "Disable" "icon" should exist in the "Guest access" "table_row"
@javascript
Scenario: Creating enrolment method by disabling it
Given I am on "Course 1" course homepage
And I navigate to "Users > Enrolment methods" in current page administration
And I click on "Delete" "link" in the "Guest access" "table_row"
And I click on "Continue" "button"
And I should not see "Guest access" in the "generaltable" "table"
And I navigate to "Courses > Upload courses" in site administration
And I upload "admin/tool/uploadcourse/tests/fixtures/enrolment_disable.csv" file to "File" filemanager
And I set the field "Upload mode" to "Only update existing courses"
And I set the field "Update mode" to "Update with CSV data only"
And I set the field "Allow deletes" to "Yes"
And I click on "Preview" "button"
When I click on "Upload courses" "button"
Then I should see "Course updated"
And I am on "Course 1" course homepage
And I navigate to "Users > Enrolment methods" in current page administration
And "Enable" "icon" should exist in the "Guest access" "table_row"
@javascript
Scenario: Enabling enrolment method
Given I navigate to "Courses > Upload courses" in site administration
And I upload "admin/tool/uploadcourse/tests/fixtures/enrolment_enable.csv" file to "File" filemanager
And I set the field "Upload mode" to "Only update existing courses"
And I set the field "Update mode" to "Update with CSV data only"
And I set the field "Allow deletes" to "Yes"
And I click on "Preview" "button"
When I click on "Upload courses" "button"
Then I should see "Course updated"
And I am on "Course 1" course homepage
And I navigate to "Users > Enrolment methods" in current page administration
And "Disable" "icon" should exist in the "Guest access" "table_row"
@javascript
Scenario: Disable an enrolment method
Given I am on "Course 1" course homepage
And I navigate to "Users > Enrolment methods" in current page administration
And I click on "Enable" "link" in the "Guest access" "table_row"
And "Disable" "icon" should exist in the "Guest access" "table_row"
And I navigate to "Courses > Upload courses" in site administration
And I upload "admin/tool/uploadcourse/tests/fixtures/enrolment_disable.csv" file to "File" filemanager
And I set the field "Upload mode" to "Only update existing courses"
And I set the field "Update mode" to "Update with CSV data only"
And I set the field "Allow deletes" to "Yes"
And I click on "Preview" "button"
When I click on "Upload courses" "button"
Then I should see "Course updated"
And I am on "Course 1" course homepage
And I navigate to "Users > Enrolment methods" in current page administration
And "Enable" "icon" should exist in the "Guest access" "table_row"
@javascript
Scenario: Delete an enrolment method
Given I navigate to "Courses > Upload courses" in site administration
And I upload "admin/tool/uploadcourse/tests/fixtures/enrolment_delete.csv" file to "File" filemanager
And I set the field "Upload mode" to "Only update existing courses"
And I set the field "Update mode" to "Update with CSV data only"
And I set the field "Allow deletes" to "Yes"
And I click on "Preview" "button"
When I click on "Upload courses" "button"
Then I should see "Course updated"
And I am on "Course 1" course homepage
And I navigate to "Users > Enrolment methods" in current page administration
And I should not see "Guest access" in the "generaltable" "table"
@javascript
Scenario: Delete an unexistent enrolment method (nothing should change)
Given I am on "Course 1" course homepage
And I navigate to "Users > Enrolment methods" in current page administration
And I click on "Delete" "link" in the "Guest access" "table_row"
And I click on "Continue" "button"
And I should not see "Guest access" in the "generaltable" "table"
And I navigate to "Courses > Upload courses" in site administration
And I upload "admin/tool/uploadcourse/tests/fixtures/enrolment_delete.csv" file to "File" filemanager
And I set the field "Upload mode" to "Only update existing courses"
And I set the field "Update mode" to "Update with CSV data only"
And I set the field "Allow deletes" to "Yes"
And I click on "Preview" "button"
When I click on "Upload courses" "button"
Then I should see "Course updated"
And I am on "Course 1" course homepage
And I navigate to "Users > Enrolment methods" in current page administration
And I should not see "Guest access" in the "generaltable" "table"
@@ -0,0 +1,2 @@
shortname,category,enrolment_1,enrolment_1_delete
C1,1,guest,1
1 shortname category enrolment_1 enrolment_1_delete
2 C1 1 guest 1
@@ -0,0 +1,2 @@
shortname,category,enrolment_1,enrolment_1_disable
C1,1,guest,1
1 shortname category enrolment_1 enrolment_1_disable
2 C1 1 guest 1
@@ -0,0 +1,2 @@
shortname,category,enrolment_1,enrolment_1_disable
C1,1,guest,0
1 shortname category enrolment_1 enrolment_1_disable
2 C1 1 guest 0
+1 -1
View File
@@ -283,7 +283,7 @@ class admin_uploaduser_form2 extends moodleform {
$mform->setAdvanced('url');
$mform->addElement('text', 'idnumber', get_string('idnumber'), 'maxlength="255" size="25"');
$mform->setType('idnumber', PARAM_NOTAGS);
$mform->setType('idnumber', core_user::get_property_type('idnumber'));
$mform->setForceLtr('idnumber');
$mform->addElement('text', 'institution', get_string('institution'), 'maxlength="255" size="25"');
@@ -45,18 +45,20 @@
}
}}
<div class="modal" data-role="flexitour-step">
<div class="modal" data-region="modal-container" data-role="flexitour-step">
<div class="modal" data-region="modal">
<div data-role="arrow"></div>
<div class="modal-header">
<div class="modal-header" data-region="header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" data-role="end">&times;</button>
<h3 data-placeholder="title"></h3>
<h3 data-region="title" data-placeholder="title"></h3>
</div>
<div class="modal-body" data-placeholder="body"></div>
<div class="modal-footer">
<div class="modal-body" data-region="body" data-placeholder="body"></div>
<div class="modal-footer" data-region="footer">
<div class="btn-group">
<button href="#" class="btn" data-role="previous">{{# str }} previous, moodle {{/ str }}</button>
<button href="#" class="btn btn-primary" data-role="next">{{# str }} next, moodle {{/ str }}</button>
</div>
<button class="btn" data-role="end"> {{# str }} endtour, tool_usertours {{/ str }} </button>
</div>
</div>
</div>
+1 -1
View File
@@ -374,7 +374,7 @@
$row = array ();
$row[] = "<a href=\"../user/view.php?id=$user->id&amp;course=$site->id\">$fullname</a>";
foreach ($extracolumns as $field) {
$row[] = $user->{$field};
$row[] = s($user->{$field});
}
$row[] = $user->city;
$row[] = $user->country;
+2 -4
View File
@@ -178,10 +178,10 @@ class auth_plugin_email extends auth_plugin_base {
if ($user->auth != $this->authtype) {
return AUTH_CONFIRM_ERROR;
} else if ($user->secret == $confirmsecret && $user->confirmed) {
} else if ($user->secret === $confirmsecret && $user->confirmed) {
return AUTH_CONFIRM_ALREADY;
} else if ($user->secret == $confirmsecret) { // They have provided the secret key to get in
} else if ($user->secret === $confirmsecret) { // They have provided the secret key to get in
$DB->set_field("user", "confirmed", 1, array("id"=>$user->id));
if ($wantsurl = get_user_preferences('auth_email_wantsurl', false, $user)) {
@@ -257,5 +257,3 @@ class auth_plugin_email extends auth_plugin_base {
}
}
+1 -1
View File
@@ -49,6 +49,6 @@ class behat_auth_email extends behat_base {
$confirmationpath = $confirmationurl->out_as_local_url(false);
$url = $confirmationpath . '?' . 'data='. $secret .'/'. $username;
$this->getSession()->visit($this->locate_path($url));
$this->execute('behat_general::i_visit', [$url]);
}
}
+2 -2
View File
@@ -598,10 +598,10 @@ class auth_plugin_ldap extends auth_plugin_base {
if ($user->auth != $this->authtype) {
return AUTH_CONFIRM_ERROR;
} else if ($user->secret == $confirmsecret && $user->confirmed) {
} else if ($user->secret === $confirmsecret && $user->confirmed) {
return AUTH_CONFIRM_ALREADY;
} else if ($user->secret == $confirmsecret) { // They have provided the secret key to get in
} else if ($user->secret === $confirmsecret) { // They have provided the secret key to get in
if (!$this->user_activate($username)) {
return AUTH_CONFIRM_FAIL;
}
+19 -8
View File
@@ -79,16 +79,19 @@ class auth_ldap_plugin_testcase extends advanced_testcase {
$o['ou'] = 'users';
ldap_add($connection, 'ou='.$o['ou'].','.$topdn, $o);
$createdusers = array();
for ($i=1; $i<=5; $i++) {
$this->create_ldap_user($connection, $topdn, $i);
$createdusers[] = 'username' . $i;
}
// Set up creators group.
$assignedroles = array('username1', 'username2');
$o = array();
$o['objectClass'] = array('posixGroup');
$o['cn'] = 'creators';
$o['gidNumber'] = 1;
$o['memberUid'] = array('username1', 'username2');
$o['memberUid'] = $assignedroles;
ldap_add($connection, 'cn='.$o['cn'].','.$topdn, $o);
$creatorrole = $DB->get_record('role', array('shortname'=>'coursecreator'));
@@ -145,15 +148,23 @@ class auth_ldap_plugin_testcase extends advanced_testcase {
// Check events, 5 users created with 2 users having roles.
$this->assertCount(7, $events);
foreach ($events as $index => $event) {
$usercreatedindex = array(0, 2, 4, 5, 6);
$roleassignedindex = array (1, 3);
if (in_array($index, $usercreatedindex)) {
$this->assertInstanceOf('\core\event\user_created', $event);
}
if (in_array($index, $roleassignedindex)) {
$this->assertInstanceOf('\core\event\role_assigned', $event);
$username = $DB->get_field('user', 'username', array('id' => $event->relateduserid)); // Get username.
if ($event->eventname === '\core\event\user_created') {
$this->assertContains($username, $createdusers);
unset($events[$index]); // Remove matching event.
} else if ($event->eventname === '\core\event\role_assigned') {
$this->assertContains($username, $assignedroles);
unset($events[$index]); // Remove matching event.
} else {
$this->fail('Unexpected event found: ' . $event->eventname);
}
}
// If all the user_created and role_assigned events have matched
// then the $events array should be now empty.
$this->assertCount(0, $events);
$this->assertEquals(5, $DB->count_records('user', array('auth'=>'ldap')));
$this->assertEquals(2, $DB->count_records('role_assignments'));
+1 -3
View File
@@ -716,9 +716,7 @@ class auth_plugin_mnet extends auth_plugin_base {
foreach($superArray as $subArray) {
$subArray = array_values($subArray);
$instring = "('".implode("', '",$subArray)."')";
$query = "select id, session_id, username from {mnet_session} where username in $instring";
$results = $DB->get_records_sql($query);
$results = $DB->get_records_list('mnet_session', 'username', $subArray, '', 'id, session_id, username');
if ($results == false) {
// We seem to have a username that breaks our query:
+2 -2
View File
@@ -314,10 +314,10 @@ class auth extends \auth_plugin_base {
if ($user->auth != $this->authtype) {
return AUTH_CONFIRM_ERROR;
} else if ($user->secret == $confirmsecret && $user->confirmed) {
} else if ($user->secret === $confirmsecret && $user->confirmed) {
return AUTH_CONFIRM_ALREADY;
} else if ($user->secret == $confirmsecret) { // They have provided the secret key to get in.
} else if ($user->secret === $confirmsecret) { // They have provided the secret key to get in.
$DB->set_field("user", "confirmed", 1, array("id" => $user->id));
return AUTH_CONFIRM_OK;
}
+34
View File
@@ -47,5 +47,39 @@ function xmldb_auth_oauth2_upgrade($oldversion) {
// Automatically generated Moodle v3.5.0 release upgrade line.
// Put any upgrade step following this.
if ($oldversion < 2018051401) {
// Fetch Facebook, Google, and Microsoft issuers. We use the URL field to determine the issuer type as it's the only
// field that contains the keyword that can somewhat let us reliably determine the issuer type.
$likefacebook = $DB->sql_like('oe.url', ':facebook');
$likegoogle = $DB->sql_like('oe.url', ':google');
$likemicrosoft = $DB->sql_like('oe.url', ':microsoft');
$params = [
'facebook' => '%facebook%',
'google' => '%google%',
'microsoft' => '%microsoft%',
];
// We're querying from the oauth2_endpoint table because the base URLs of FB and Microsoft can be empty in the issuer table.
$subsql = "
SELECT DISTINCT oe.issuerid
FROM {oauth2_endpoint} oe
WHERE $likefacebook
OR $likegoogle
OR $likemicrosoft";
// Update non-Facebook/Google/Microsoft issuers and set requireconfirmation to 1.
$updatesql = "
UPDATE {oauth2_issuer}
SET requireconfirmation = 1
WHERE id NOT IN ({$subsql})";
$DB->execute($updatesql, $params);
// Delete linked logins for non-Facebook/Google/Microsoft issuers. They can easily re-link their logins anyway.
$DB->delete_records_select('auth_oauth2_linked_login', "issuerid NOT IN ($subsql)", $params);
upgrade_plugin_savepoint(true, 2018051401, 'auth', 'oauth2');
}
return true;
}
+8 -2
View File
@@ -40,7 +40,10 @@ then cut and paste the address into the address
line at the top of your web browser window.
If you need help, please contact the site administrator,
{$a->admin}';
{$a->admin}
If you did not do this, someone else could be trying to compromise your account.
Please contact the site administrator immediately.';
$string['confirmaccountemailsubject'] = '{$a}: account confirmation';
$string['confirmationinvalid'] = 'The confirmation link is either invalid, or has expired. Please start the login process again to generate a new confirmation email.';
$string['confirmationpending'] = 'This account is pending email confirmation.';
@@ -60,7 +63,10 @@ then cut and paste the address into the address
line at the top of your web browser window.
If you need help, please contact the site administrator,
{$a->admin}';
{$a->admin}
If you did not do this, someone else could be trying to compromise your account.
Please contact the site administrator immediately.';
$string['confirmlinkedloginemailsubject'] = '{$a}: linked login confirmation';
$string['createaccountswarning'] = 'This authentication plugin allows users to create accounts on your site. You may want to enable the setting "authpreventaccountcreation" if you use this plugin.';
$string['createnewlinkedlogin'] = 'Link a new account ({$a})';
+1 -1
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2018051400; // The current plugin version (Date: YYYYMMDDXX).
$plugin->version = 2018051401; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2018050800; // Requires this Moodle version.
$plugin->component = 'auth_oauth2'; // Full name of the plugin (used for diagnostics).
+2 -1
View File
@@ -182,7 +182,8 @@ How to customize the way the Shibboleth user data is used in Moodle
Among the Shibboleth settings in Moodle there is a field that should contain a
path to a php file that can be used as data manipulation hook.
You can use this if you want to further process the way your Shibboleth
attributes are used in Moodle.
attributes are used in Moodle. Due to security reasons this file cannot be
located within the current site data directory ($CFG->dataroot).
Example 1: Your Shibboleth federation uses an attribute that specifies the
user's preferred language, but the content of this attribute is not
@@ -0,0 +1,75 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Special setting for auth_shibboleth convert_data.
*
* @package auth_shibboleth
* @copyright 2020 Mihail Geshoski
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Admin settings class for the convert_data option.
*
* @package auth_shibboleth
* @copyright 2020 Mihail Geshoski
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class auth_shibboleth_admin_setting_convert_data extends admin_setting_configfile {
/**
* Constructor.
*
* @param string $name
* @param string $visiblename
* @param string $description
* @param mixed $defaultdirectory
*/
public function __construct($name, $visiblename, $description, $defaultdirectory) {
parent::__construct($name, $visiblename, $description, $defaultdirectory);
}
/**
* Validate the file path (location).
*
* This method ensures that the file defined as a data modification API exists and is not located in the site
* data directory ($CFG->dataroot). We should prohibit using files from the site data directory as this introduces
* security vulnerabilities.
*
* @param string $filepath The path to the file.
* @return mixed bool true for success or string:error on failure.
*/
public function validate($filepath) {
global $CFG;
if (empty($filepath)) {
return true;
}
// Fail if the file does not exist or it is not readable by the webserver process.
if (!is_readable($filepath)) {
return get_string('auth_shib_convert_data_warning', 'auth_shibboleth');
}
// Fail if the absolute file path matches the currently defined dataroot path.
if (preg_match('/' . preg_quote($CFG->dataroot, '/') . '/', realpath($filepath))) {
return get_string('auth_shib_convert_data_filepath_warning', 'auth_shibboleth');
}
return true;
}
}
+23 -1
View File
@@ -30,7 +30,7 @@ defined('MOODLE_INTERNAL') || die();
* @return bool result
*/
function xmldb_auth_shibboleth_upgrade($oldversion) {
global $CFG, $DB;
global $CFG, $DB, $OUTPUT;
// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.
@@ -51,5 +51,27 @@ function xmldb_auth_shibboleth_upgrade($oldversion) {
// Automatically generated Moodle v3.5.0 release upgrade line.
// Put any upgrade step following this.
if ($oldversion < 2018051401) {
// The 'Data modification API' setting in the Shibboleth authentication plugin can no longer be configured
// to use files located within the site data directory, as it exposes the site to security risks. Therefore,
// we need to find every existing case and reset the 'Data modification API' setting to its default value.
$convertdataconfig = get_config('auth_shibboleth', 'convert_data');
if (preg_match('/' . preg_quote($CFG->dataroot, '/') . '/', realpath($convertdataconfig))) {
set_config('convert_data', '', 'auth_shibboleth');
$warn = 'Your \'Data modification API\' setting in the Shibboleth authentication plugin is currently
configured to use a file located within the current site data directory ($CFG->dataroot). You are no
longer able to use files from within this directory for this purpose as it exposes your site to security
risks. This setting has been reset to its default value. Please reconfigure it by providing a path
to a file which is not located within the site data directory.';
echo $OUTPUT->notification($warn, 'notifyproblem');
}
upgrade_plugin_savepoint(true, 2018051401, 'auth', 'shibboleth');
}
return true;
}
@@ -36,6 +36,7 @@ $string['auth_shibboleth_select_organization'] = 'For authentication via Shibbol
$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_warning'] = 'The file does not exist or is not readable by the webserver process!';
$string['auth_shib_convert_data_filepath_warning'] = 'You cannot use a file that is located within the current site data directory ($CFG->dataroot) as the data modification API.';
$string['auth_shib_changepasswordurl'] = 'Password-change URL';
$string['auth_shib_idp_list'] = 'Identity providers';
$string['auth_shib_idp_list_description'] = 'Provide a list of Identity Provider entityIDs to let the user choose from on the login page.<br />On each line there must be a comma-separated tuple for entityID of the IdP (see the Shibboleth metadata file) and Name of IdP as it shall be displayed in the drop-down list.<br />As an optional third parameter you can add the location of a Shibboleth session initiator that shall be used in case your Moodle installation is part of a multi federation setup.';
+3 -2
View File
@@ -28,6 +28,7 @@ if ($ADMIN->fulltree) {
// We use a couple of custom admin settings since we need to massage the data before it is inserted into the DB.
require_once($CFG->dirroot.'/auth/shibboleth/classes/admin_setting_special_wayf_select.php');
require_once($CFG->dirroot.'/auth/shibboleth/classes/admin_setting_special_idp_configtextarea.php');
require_once($CFG->dirroot.'/auth/shibboleth/classes/admin_setting_special_convert_data_configfile.php');
// Introductory explanation.
$settings->add(new admin_setting_heading('auth_shibboleth/pluginname', '',
@@ -37,8 +38,8 @@ if ($ADMIN->fulltree) {
$settings->add(new admin_setting_configtext('auth_shibboleth/user_attribute', get_string('username'),
get_string('auth_shib_username_description', 'auth_shibboleth'), '', PARAM_RAW));
// COnvert Data configuration file.
$settings->add(new admin_setting_configfile('auth_shibboleth/convert_data',
// Convert Data configuration file.
$settings->add(new auth_shibboleth_admin_setting_convert_data('auth_shibboleth/convert_data',
get_string('auth_shib_convert_data', 'auth_shibboleth'),
get_string('auth_shib_convert_data_description', 'auth_shibboleth'), ''));
+5
View File
@@ -1,6 +1,11 @@
This files describes API changes in /auth/shibboleth/*,
information provided here is intended especially for developers.
=== 3.5.16 ===
* The 'Data modification API' (convert_data) setting can no longer be configured to use files located within the
current site data directory ($CFG->dataroot), as it exposes the site to security risks.
=== 3.5.2 ===
* Moved the public function unserializesession in auth/shibboleth/logout.php to auth/shibboleth/classes/helper.php and
+1 -1
View File
@@ -25,6 +25,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2018051400; // The current plugin version (Date: YYYYMMDDXX)
$plugin->version = 2018051401; // The current plugin version (Date: YYYYMMDDXX)
$plugin->requires = 2018050800; // Requires this Moodle version
$plugin->component = 'auth_shibboleth'; // Full name of the plugin (used for diagnostics)
+10 -2
View File
@@ -42,10 +42,18 @@ class behat_auth extends behat_base {
* Logs in the user. There should exist a user with the same value as username and password.
*
* @Given /^I log in as "(?P<username_string>(?:[^"]|\\")*)"$/
* @param string $username the user to log in as.
* @param moodle_url|null $wantsurl optional, URL to go to after logging in.
*/
public function i_log_in_as($username) {
public function i_log_in_as(string $username, moodle_url $wantsurl = null) {
$loginurl = new moodle_url('/login/index.php');
if ($wantsurl !== null) {
$loginurl->param('wantsurl', $wantsurl->out_as_local_url());
}
// Visit login page.
$this->getSession()->visit($this->locate_path('login/index.php'));
$this->execute('behat_general::i_visit', [$loginurl]);
// Enter username and password.
$this->execute('behat_forms::i_set_the_field_to', array('Username', $this->escape($username)));
+36 -7
View File
@@ -2090,12 +2090,30 @@ class restore_ras_and_caps_structure_step extends restore_structure_step {
$data = (object)$data;
// Check roleid is one of the mapped ones
$newroleid = $this->get_mappingid('role', $data->roleid);
$newrole = $this->get_mapping('role', $data->roleid);
$newroleid = isset($newrole->newitemid) ? $newrole->newitemid : false;
$userid = $this->task->get_userid();
// If newroleid and context are valid assign it via API (it handles dupes and so on)
if ($newroleid && $this->task->get_contextid()) {
// TODO: assign_capability() needs one userid param to be able to specify our restore userid
// TODO: it seems that assign_capability() doesn't check for valid capabilities at all ???
assign_capability($data->capability, $data->permission, $newroleid, $this->task->get_contextid());
if (!$capability = get_capability_info($data->capability)) {
$this->log("Capability '{$data->capability}' was not found!", backup::LOG_WARNING);
} else {
$context = context::instance_by_id($this->task->get_contextid());
$overrideableroles = get_overridable_roles($context, ROLENAME_SHORT);
$safecapability = is_safe_capability($capability);
// Check if the new role is an overrideable role AND if the user performing the restore has the
// capability to assign the capability.
if (in_array($newrole->info['shortname'], $overrideableroles) &&
($safecapability && has_capability('moodle/role:safeoverride', $context, $userid) ||
!$safecapability && has_capability('moodle/role:override', $context, $userid))
) {
assign_capability($data->capability, $data->permission, $newroleid, $this->task->get_contextid());
} else {
$this->log("Insufficient capability to assign capability '{$data->capability}' to role!", backup::LOG_WARNING);
}
}
}
}
}
@@ -2114,11 +2132,22 @@ class restore_default_enrolments_step extends restore_execution_step {
}
$course = $DB->get_record('course', array('id'=>$this->get_courseid()), '*', MUST_EXIST);
// Return any existing course enrolment instances.
$enrolinstances = enrol_get_instances($course->id, false);
if ($enrolinstances) {
// Something already added instances.
// Get the existing enrolment methods in the course.
$enrolmethods = array_map(function($enrolinstance) {
return $enrolinstance->enrol;
}, $enrolinstances);
if ($DB->record_exists('enrol', array('courseid'=>$this->get_courseid(), 'enrol'=>'manual'))) {
// Something already added instances, do not add default instances.
$plugins = enrol_get_plugins(true);
foreach ($plugins as $plugin) {
foreach ($plugins as $pluginname => $plugin) {
// Make sure all default enrolment methods exist in the course.
if (!in_array($pluginname, $enrolmethods)) {
$plugin->course_updated(true, $course, null);
}
$plugin->restore_sync_course($course);
}
+1
View File
@@ -219,6 +219,7 @@ class restore_ui extends base_ui {
$options = array();
$options['keep_roles_and_enrolments'] = $this->get_setting_value('keep_roles_and_enrolments');
$options['keep_groups_and_groupings'] = $this->get_setting_value('keep_groups_and_groupings');
$options['userid'] = $this->controller->get_userid();
restore_dbops::delete_course_content($this->controller->get_courseid(), $options);
}
$this->controller->execute_plan();
+3 -3
View File
@@ -56,7 +56,7 @@ class behat_backup extends behat_base {
// table elements are used, and we need to catch exceptions contantly.
// Go to homepage.
$this->getSession()->visit($this->locate_path('/?redirect=0'));
$this->execute('behat_general::i_visit', ['/?redirect=0']);
$this->execute("behat_general::wait_until_the_page_is_ready");
// Click the course link.
@@ -98,7 +98,7 @@ class behat_backup extends behat_base {
// table elements are used, and we need to catch exceptions contantly.
// Go to homepage.
$this->getSession()->visit($this->locate_path('/?redirect=0'));
$this->execute('behat_general::i_visit', ['/?redirect=0']);
// Click the course link.
$this->execute("behat_general::click_link", $backupcourse);
@@ -134,7 +134,7 @@ class behat_backup extends behat_base {
// table elements are used, and we need to catch exceptions contantly.
// Go to homepage.
$this->getSession()->visit($this->locate_path('/?redirect=0'));
$this->execute('behat_general::i_visit', ['/?redirect=0']);
$this->execute("behat_general::wait_until_the_page_is_ready");
// Click the course link.
@@ -512,6 +512,10 @@ class block_activity_results extends block_base {
$fields = implode(',', $fields);
$users = $DB->get_records_list('user', 'id', $userids, '', $fields);
// If configured to view user idnumber, ensure current user can see it.
$extrafields = get_extra_user_fields($this->context);
$canviewidnumber = (array_search('idnumber', $extrafields) !== false);
// Ready for output!
if ($activity->gradetype == GRADE_TYPE_SCALE) {
// We must display the results using scales.
@@ -537,10 +541,14 @@ class block_activity_results extends block_base {
}
$this->content->text .= '</caption><colgroup class="number" />';
$this->content->text .= '<colgroup class="name" /><colgroup class="grade" /><tbody>';
foreach ($best as $userid => $gradeid) {
switch ($nameformat) {
case B_ACTIVITYRESULTS_NAME_FORMAT_ID:
$thisname = get_string('user').' '.$users[$userid]->idnumber;
$thisname = get_string('user');
if ($canviewidnumber) {
$thisname .= ' ' . s($users[$userid]->idnumber);
}
break;
case B_ACTIVITYRESULTS_NAME_FORMAT_ANON:
$thisname = get_string('user');
@@ -603,7 +611,10 @@ class block_activity_results extends block_base {
foreach ($worst as $userid => $gradeid) {
switch ($nameformat) {
case B_ACTIVITYRESULTS_NAME_FORMAT_ID:
$thisname = get_string('user').' '.$users[$userid]->idnumber;
$thisname = get_string('user');
if ($canviewidnumber) {
$thisname .= ' ' . s($users[$userid]->idnumber);
};
break;
case B_ACTIVITYRESULTS_NAME_FORMAT_ANON:
$thisname = get_string('user');
@@ -139,7 +139,9 @@ Feature: The activity results block displays student high scores
And I should see "70.00" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers
Given I add the "Activity results" block
Given the following config values are set as admin:
| showuseridentity | idnumber,email |
And I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 3 |
@@ -78,7 +78,9 @@ Feature: The activity results block displays students high scores in group as sc
And I should see "Good" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers
Given I add the "Activity results" block
Given the following config values are set as admin:
| showuseridentity | idnumber,email |
And I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 3 |
@@ -110,7 +110,9 @@ Feature: The activity results block displays student in group high scores as sca
And I should see "Good" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers
Given I add the "Activity results" block
Given the following config values are set as admin:
| showuseridentity | idnumber,email |
And I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 3 |
@@ -123,11 +125,13 @@ Feature: The activity results block displays student in group high scores as sca
And I should see "Very good" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
And I log out
# Students cannot see user identity fields.
And I log in as "student1"
And I am on "Course 1" course homepage
And I should see "User S1" in the "Activity results" "block"
And I should see "User" in the "Activity results" "block"
And I should not see "User S1" in the "Activity results" "block"
And I should see "Excellent!" in the "Activity results" "block"
And I should see "User S2" in the "Activity results" "block"
And I should not see "User S2" in the "Activity results" "block"
And I should see "Very good" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using anonymous names
@@ -184,7 +184,9 @@ Feature: The activity results block displays student in separate groups scores
And I should see "90.00" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers
Given I add the "Activity results" block
Given the following config values are set as admin:
| showuseridentity | idnumber,email |
And I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 3 |
@@ -198,11 +200,13 @@ Feature: The activity results block displays student in separate groups scores
And I should see "85.00%" in the "Activity results" "block"
And I should see "75.00%" in the "Activity results" "block"
And I log out
# Students cannot see user identity fields.
And I log in as "student1"
And I am on "Course 1" course homepage
And I should see "User S1" in the "Activity results" "block"
And I should see "User" in the "Activity results" "block"
And I should not see "User S1" in the "Activity results" "block"
And I should see "100.00%" in the "Activity results" "block"
And I should see "User S2" in the "Activity results" "block"
And I should not see "User S2" in the "Activity results" "block"
And I should see "90.00%" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using anonymous names
@@ -168,7 +168,9 @@ Feature: The activity results block displays student in visible groups scores
And I should see "75.00" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers
Given I add the "Activity results" block
Given the following config values are set as admin:
| showuseridentity | idnumber,email |
And I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 3 |
@@ -128,7 +128,9 @@ Feature: The activity results block displays student low scores
And I should see "70.00" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple low scores using ID numbers
Given I add the "Activity results" block
Given the following config values are set as admin:
| showuseridentity | idnumber,email |
And I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 0 |
@@ -79,7 +79,9 @@ Feature: The activity results block displays student low scores as scales
And I should see "Good" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple low scores using ID numbers
Given I add the "Activity results" block
Given the following config values are set as admin:
| showuseridentity | idnumber,email |
And I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 0 |
@@ -108,7 +108,9 @@ Feature: The activity results block displays students in groups low scores as sc
And I should see "Good" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers
Given I add the "Activity results" block
Given the following config values are set as admin:
| showuseridentity | idnumber,email |
And I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 0 |
@@ -120,11 +122,13 @@ Feature: The activity results block displays students in groups low scores as sc
And I should see "Very good" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
And I log out
# Students cannot see user identity fields.
And I log in as "student5"
And I am on "Course 1" course homepage
And I should see "User S5" in the "Activity results" "block"
And I should see "User" in the "Activity results" "block"
And I should not see "User S5" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
And I should see "User S6" in the "Activity results" "block"
And I should not see "User S6" in the "Activity results" "block"
And I should see "Average" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using anonymous names
@@ -178,7 +178,9 @@ Feature: The activity results block displays students in separate groups scores
And I should see "70.00" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple low scores using ID numbers
Given I add the "Activity results" block
Given the following config values are set as admin:
| showuseridentity | idnumber,email |
And I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 0 |
@@ -191,11 +193,13 @@ Feature: The activity results block displays students in separate groups scores
And I should see "85.00%" in the "Activity results" "block"
And I should see "75.00%" in the "Activity results" "block"
And I log out
# Students cannot see user identity fields.
And I log in as "student1"
And I am on "Course 1" course homepage
And I should see "User S1" in the "Activity results" "block"
And I should see "User" in the "Activity results" "block"
And I should not see "User S1" in the "Activity results" "block"
And I should see "100.00%" in the "Activity results" "block"
And I should see "User S2" in the "Activity results" "block"
And I should not see "User S2" in the "Activity results" "block"
And I should see "90.00%" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple low scores using anonymous names
@@ -166,7 +166,9 @@ Feature: The activity results block displays student in visible groups low score
And I should see "75.00" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple low scores using ID numbers
Given I add the "Activity results" block
Given the following config values are set as admin:
| showuseridentity | idnumber,email |
And I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 0 |
@@ -9,9 +9,14 @@ Feature: Random glossary entry block linking to global glossary
| fullname | shortname |
| Course 1 | C1 |
| Course 2 | C2 |
And the following "activities" exist:
| activity | name | intro | course | idnumber | globalglossary | defaultapproval |
| glossary | Tips and Tricks | Frontpage glossary description | C2 | glossary0 | 1 | 1 |
And the following "activity" exists:
| activity | glossary |
| name | Tips and Tricks |
| intro | Frontpage glossary description |
| course | C2 |
| idnumber | glossary0 |
| globalglossary | 1 |
| defaultapproval | 1 |
And the following "users" exist:
| username | firstname | lastname | email |
| student1 | Sam1 | Student1 | student1@example.com |
+19 -2
View File
@@ -88,14 +88,23 @@ class block_online_users extends block_base {
$this->content->text = '<div class="info">'.$usercount.' ('.$periodminutes.')</div>';
// Verify if we can see the list of users, if not just print number of users
if (!has_capability('block/online_users:viewlist', $this->page->context)) {
// Verify if we can see the list of users, if not just print number of users.
// If the current user is not logged in OR it's a guest then don't show any users.
if (!has_capability('block/online_users:viewlist', $this->page->context)
|| isguestuser() || !isloggedin()) {
return $this->content;
}
$userlimit = 50; // We'll just take the most recent 50 maximum.
$initialcount = 0;
if ($users = $onlineusers->get_users($userlimit)) {
require_once($CFG->dirroot . '/user/lib.php');
$initialcount = count($users);
foreach ($users as $user) {
if (!user_can_view_profile($user)) {
unset($users[$user->id]);
continue;
}
$users[$user->id]->fullname = fullname($user);
}
} else {
@@ -137,6 +146,14 @@ class block_online_users extends block_base {
}
$this->content->text .= "</li>\n";
}
if ($initialcount - count($users) > 0) {
$this->content->text .= '<li class="listentry"><div class="otherusers">';
$this->content->text .= html_writer::span(
get_string('otherusers', 'block_online_users', $initialcount - count($users))
);
$this->content->text .= "</div>";
$this->content->text .= "</li>\n";
}
$this->content->text .= '</ul><div class="clearer"><!-- --></div>';
}
+1 -1
View File
@@ -76,7 +76,7 @@ class fetcher {
$timeaccess = ", ul.timeaccess AS lastaccess";
$params = array();
$userfields = \user_picture::fields('u', array('username'));
$userfields = \user_picture::fields('u', array('username', 'deleted'));
// Add this to the SQL to show only group users.
if ($currentgroup !== null) {
+1 -1
View File
@@ -55,7 +55,7 @@ $capabilities = array(
'contextlevel' => CONTEXT_BLOCK,
'archetypes' => array(
'user' => CAP_ALLOW,
'guest' => CAP_ALLOW,
'guest' => CAP_PREVENT,
'student' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
@@ -23,6 +23,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$string['otherusers'] = 'Other Users ({$a})';
$string['configtimetosee'] = 'Number of minutes determining the period of inactivity after which a user is no longer considered to be online.';
$string['nouser'] = 'No online users';
$string['numuser'] = '{$a} online user';
+4
View File
@@ -7,6 +7,10 @@
position: relative;
}
.block_online_users .content .list li.listentry .otherusers {
margin-left: 1.5rem;
}
.block_online_users .content .list li.listentry .user .userpicture {
vertical-align: text-bottom;
}
@@ -1,5 +1,6 @@
@block @block_online_users
Feature: The online users block allow you to see who is currently online on dashboard
There should be some commonality for the users to show up
In order to use the online users block on the dashboard
As a user
I can view the online users block on my dashboard
@@ -10,6 +11,14 @@ Feature: The online users block allow you to see who is currently online on dash
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
| student2 | Student | 2 | student2@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
Scenario: View the online users block on the dashboard and see myself
Given I log in as "teacher1"
@@ -1,14 +1,22 @@
@block @block_online_users
Feature: The online users block allow you to see who is currently online on frontpage
In order to enable the online users block on the front page page
There should be some commonality for the users to show up
In order to enable the online users block on the frontpage
As an admin
I can add the online users block to the front page page
I can add the online users block to the frontpage
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | student1@example.com |
| student2 | Student | 2 | student2@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student2 | C1 | student |
Scenario: View the online users block on the front page and see myself
Given I log in as "admin"
@@ -28,7 +36,8 @@ Feature: The online users block allow you to see who is currently online on fron
And I log out
When I log in as "student1"
And I am on site homepage
Then I should see "Admin User" in the "Online users" "block"
Then I should not see "Admin User" in the "Online users" "block"
And I should see "Other Users (1)" in the "Online users" "block"
And I should see "Student 1" in the "Online users" "block"
And I should see "Student 2" in the "Online users" "block"
And I should see "3 online users" in the "Online users" "block"
@@ -45,7 +54,7 @@ Feature: The online users block allow you to see who is currently online on fron
And I log out
When I log in as "guest"
And I am on site homepage
Then I should see "Admin User" in the "Online users" "block"
And I should see "Student 1" in the "Online users" "block"
And I should see "Student 2" in the "Online users" "block"
Then I should not see "Admin User" in the "Online users" "block"
And I should not see "Student 1" in the "Online users" "block"
And I should not see "Student 2" in the "Online users" "block"
And I should see "3 online users" in the "Online users" "block"
+1 -1
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2018051400; // The current plugin version (Date: YYYYMMDDXX)
$plugin->version = 2018051401; // The current plugin version (Date: YYYYMMDDXX)
$plugin->requires = 2018050800; // Requires this Moodle version
$plugin->component = 'block_online_users'; // Full name of the plugin (used for diagnostics)
@@ -114,12 +114,8 @@ class behat_block_site_main_menu extends behat_base {
protected function get_site_menu_activity_element($element, $selectortype, $activityname) {
$activitynode = $this->get_site_menu_activity_node($activityname);
// Transforming to Behat selector/locator.
list($selector, $locator) = $this->transform_selector($selectortype, $element);
$exception = new ElementNotFoundException($this->getSession(), '"' . $element . '" "' .
$selectortype . '" in "' . $activityname . '" ');
return $this->find($selector, $locator, $exception, $activitynode);
$exception = new ElementNotFoundException($this->getSession(), "'{$element}' '{$selectortype}' in '${activityname}'");
return $this->find($selectortype, $element, $exception, $activitynode);
}
/**
@@ -154,4 +150,17 @@ class behat_block_site_main_menu extends behat_base {
$xpath = "//*[contains(concat(' ',normalize-space(@class),' '),' block_site_main_menu ')]//li[contains(., $activityname)]";
$this->execute('behat_action_menu::i_open_the_action_menu_in', [$xpath, 'xpath_element']);
}
/**
* Return the list of partial named selectors.
*
* @return array
*/
public static function get_partial_named_selectors(): array {
return [
new behat_component_named_selector('Activity', [
"//*[contains(concat(' ',normalize-space(@class),' '),' block_site_main_menu ')]//li[contains(., %locator%)]"
]),
];
}
}
@@ -6,15 +6,16 @@ Feature: Edit activities in main menu block
@javascript
Scenario: Edit name of acitivity in-place in site main menu block
Given I log in as "admin"
Given the following "activity" exists:
| activity | forum |
| course | Acceptance test site |
| name | My forum name |
| idnumber | forum |
And I log in as "admin"
And I am on site homepage
And I navigate to "Turn editing on" node in "Front page settings"
And I add the "Main menu" block
When I add a "Forum" to section "0" and I fill the form with:
| Forum name | My forum name |
And I click on "Edit title" "link" in the "My forum name" activity in site main menu block
And I set the field "New name for activity My forum name" to "New forum name"
And I press key "13" in the field "New name for activity My forum name"
When I set the field "Edit title" in the "My forum name" "block_site_main_menu > Activity" to "New forum name"
Then I should not see "My forum name"
And I should see "New forum name"
And I follow "New forum name"
@@ -114,12 +114,8 @@ class behat_block_social_activities extends behat_base {
protected function get_social_block_activity_element($element, $selectortype, $activityname) {
$activitynode = $this->get_social_block_activity_node($activityname);
// Transforming to Behat selector/locator.
list($selector, $locator) = $this->transform_selector($selectortype, $element);
$exception = new ElementNotFoundException($this->getSession(), '"' . $element . '" "' .
$selectortype . '" in "' . $activityname . '" ');
return $this->find($selector, $locator, $exception, $activitynode);
$exception = new ElementNotFoundException($this->getSession(), "'{$element}' '{$selectortype}' in '${activityname}'");
return $this->find($selectortype, $element, $exception, $activitynode);
}
/**
@@ -154,4 +150,17 @@ class behat_block_social_activities extends behat_base {
$xpath = "//*[contains(concat(' ',normalize-space(@class),' '),' block_social_activities ')]//li[contains(., $activityname)]";
$this->execute('behat_action_menu::i_open_the_action_menu_in', [$xpath, 'xpath_element']);
}
/**
* Return the list of partial named selectors.
*
* @return array
*/
public static function get_partial_named_selectors(): array {
return [
new behat_component_named_selector('Activity', [
"//*[contains(concat(' ',normalize-space(@class),' '),' block_social_activities ')]//li[contains(., %locator%)]",
]),
];
}
}
@@ -24,9 +24,7 @@ Feature: Edit activities in social activities block
And I set the field "Add an activity to section 'section 0'" to "Forum"
And I set the field "Forum name" to "My forum name"
And I press "Save and return to course"
And I click on "Edit title" "link" in the "My forum name" activity in social activities block
And I set the field "New name for activity My forum name" to "New forum name"
And I press key "13" in the field "New name for activity My forum name"
When I set the field "Edit title" in the "My forum name" "block_social_activities > Activity" to "New forum name"
Then I should not see "My forum name" in the "Social activities" "block"
And I should see "New forum name"
And I follow "New forum name"
@@ -82,4 +80,3 @@ Feature: Edit activities in social activities block
And I should not see "My forum name" in the "Social activities" "block"
And I click on "My forum name" "link" in the "Recent activity" "block"
And I should see "My forum name" in the ".breadcrumb" "css_element"
And I log out
+1 -1
View File
@@ -1 +1 @@
define(["jquery","core_calendar/selectors","core_calendar/events","core/str","core/templates"],function(a,b,c,d,e){var f=function(d){d.on("click",b.eventFilterItem,function(b){var c=a(b.currentTarget);g(c),b.preventDefault()}),a("body").on(c.viewUpdated,function(){var c=d.find(b.eventFilterItem);c.each(function(b,c){if(c=a(c),c.data("eventtype-hidden")){var d=i(c);h(d)}})})},g=function(a){var b=i(a);return b.hidden=!b.hidden,d.get_string("eventtype"+b.eventtype,"calendar").then(function(a){return b.name=a,b}).then(function(a){return e.render("core_calendar/event_filter_key",a)}).then(function(b,c){return e.replaceNode(a,b,c)}).then(function(){h(b)})},h=function(b){M.util.js_pending("month-mini-filterChanged"),a("body").trigger(c.filterChanged,{type:b.eventtype,hidden:b.hidden}),M.util.js_complete("month-mini-filterChanged")},i=function(a){return{eventtype:a.data("eventtype"),hidden:a.data("eventtype-hidden")}};return{init:function(b){b=a(b),f(b)}}});
define(["jquery","core_calendar/selectors","core_calendar/events","core/str","core/templates"],function(a,b,c,d,e){var f=function(d){d.on("click",b.eventFilterItem,function(b){var c=a(b.currentTarget);g(c),b.preventDefault()}),a("body").on(c.viewUpdated,function(){var c=d.find(b.eventFilterItem);c.each(function(b,c){if(c=a(c),c.data("eventtype-hidden")){var d=i(c);h(d)}})})},g=function(a){var b=i(a);return b.hidden=!b.hidden,M.util.js_pending("core_calendar/calendar_filter:toggleFilter"),d.get_string("eventtype"+b.eventtype,"calendar").then(function(a){return b.name=a,b}).then(function(a){return e.render("core_calendar/event_filter_key",a)}).then(function(b,c){return e.replaceNode(a,b,c)}).then(function(){h(b),M.util.js_complete("core_calendar/calendar_filter:toggleFilter")})},h=function(b){M.util.js_pending("month-mini-filterChanged"),a("body").trigger(c.filterChanged,{type:b.eventtype,hidden:b.hidden}),M.util.js_complete("month-mini-filterChanged")},i=function(a){return{eventtype:a.data("eventtype"),hidden:a.data("eventtype-hidden")}};return{init:function(b){b=a(b),f(b)}}});
+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){var e=new n("core_calendar/crud:registerEditListeners");return d.then(function(c){return 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()}),c}).then(function(a){return e.resolve(),a})["catch"](c.exception)}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
@@ -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/repository","core_calendar/events","core_calendar/crud"],function(a,b,c,d,e,f,g,h,i,j,k){var l=!1,m={ROOT:"[data-region='summary-modal-container']",EDIT_BUTTON:'[data-action="edit"]',DELETE_BUTTON:'[data-action="delete"]'},n=function(a){e.call(this,a)};return n.TYPE="core_calendar-event_summary",n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.prototype.getEditButton=function(){return"undefined"==typeof this.editButton&&(this.editButton=this.getFooter().find(m.EDIT_BUTTON)),this.editButton},n.prototype.getDeleteButton=function(){return"undefined"==typeof this.deleteButton&&(this.deleteButton=this.getFooter().find(m.DELETE_BUTTON)),this.deleteButton},n.prototype.getEventId=function(){return this.getBody().find(m.ROOT).attr("data-event-id")},n.prototype.getEventTitle=function(){return this.getBody().find(m.ROOT).attr("data-event-title")},n.prototype.getEventCount=function(){return this.getBody().find(m.ROOT).attr("data-event-count")},n.prototype.getEditUrl=function(){return this.getBody().find(m.ROOT).attr("data-edit-url")},n.prototype.isActionEvent=function(){return"true"==this.getBody().find(m.ROOT).attr("data-action-event")},n.prototype.registerEventListeners=function(){e.prototype.registerEventListeners.call(this),this.getRoot().on(h.bodyRendered,function(){this.getModal().data({eventTitle:this.getEventTitle(),eventId:this.getEventId(),eventCount:this.getEventCount()}).attr("data-type","event"),k.registerRemove(this.getModal())}.bind(this)),a("body").on(j.deleted,function(){this.hide()}.bind(this)),d.define(this.getEditButton(),[d.events.activate]),this.getEditButton().on(d.events.activate,function(b,c){this.isActionEvent()?a("body").trigger(j.editActionEvent,[this.getEditUrl()]):a("body").trigger(j.editEvent,[this.getEventId()]),this.hide(),b.preventDefault(),b.stopPropagation(),c.originalEvent.preventDefault(),c.originalEvent.stopPropagation()}.bind(this))},l||(f.register(n.TYPE,n,"core_calendar/event_summary_modal"),l=!0),n});
define(["jquery","core/str","core/notification","core/custom_interaction_events","core/modal","core/modal_registry","core/modal_factory","core/modal_events","core_calendar/repository","core_calendar/events","core_calendar/crud"],function(a,b,c,d,e,f,g,h,i,j,k){var l=!1,m={ROOT:"[data-region='summary-modal-container']",EDIT_BUTTON:'[data-action="edit"]',DELETE_BUTTON:'[data-action="delete"]'},n=function(a){e.call(this,a)};return n.TYPE="core_calendar-event_summary",n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.prototype.getEditButton=function(){return"undefined"==typeof this.editButton&&(this.editButton=this.getFooter().find(m.EDIT_BUTTON)),this.editButton},n.prototype.getDeleteButton=function(){return"undefined"==typeof this.deleteButton&&(this.deleteButton=this.getFooter().find(m.DELETE_BUTTON)),this.deleteButton},n.prototype.getEventId=function(){return this.getBody().find(m.ROOT).attr("data-event-id")},n.prototype.getEventTitle=function(){return this.getBody().find(m.ROOT).attr("data-event-title")},n.prototype.getEventCount=function(){return this.getBody().find(m.ROOT).attr("data-event-count")},n.prototype.getEditUrl=function(){return this.getBody().find(m.ROOT).attr("data-edit-url")},n.prototype.isActionEvent=function(){return"true"==this.getBody().find(m.ROOT).attr("data-action-event")},n.prototype.registerEventListeners=function(){e.prototype.registerEventListeners.call(this),M.util.js_pending("core_calendar/summary_modal:registerEventListeners:bodyRendered"),this.getRoot().on(h.bodyRendered,function(){this.getModal().data({eventTitle:this.getEventTitle(),eventId:this.getEventId(),eventCount:this.getEventCount()}).attr("data-type","event"),k.registerRemove(this.getModal()),M.util.js_complete("core_calendar/summary_modal:registerEventListeners:bodyRendered")}.bind(this)),a("body").on(j.deleted,function(){this.hide()}.bind(this)),d.define(this.getEditButton(),[d.events.activate]),this.getEditButton().on(d.events.activate,function(b,c){this.isActionEvent()?a("body").trigger(j.editActionEvent,[this.getEditUrl()]):a("body").trigger(j.editEvent,[this.getEventId()]),this.hide(),b.preventDefault(),b.stopPropagation(),c.originalEvent.preventDefault(),c.originalEvent.stopPropagation()}.bind(this))},l||(f.register(n.TYPE,n,"core_calendar/event_summary_modal"),l=!0),n});
+1 -1
View File
@@ -1 +1 @@
define(["jquery","core/templates","core/str","core/notification","core_calendar/repository","core_calendar/events","core_calendar/selectors","core/modal_factory","core/modal_events","core_calendar/summary_modal"],function(a,b,c,d,e,f,g,h,i,j){var k=function(b){b=a(b),b.on("click",g.links.eventLink,function(b){var c,d=a(b.target),e=null;c=d.is(g.actions.viewEvent)?d:d.closest(g.actions.viewEvent),e=c.length?c.data("eventId"):d.find(g.actions.viewEvent).data("eventId"),e&&(b.preventDefault(),b.stopPropagation(),w(e))}),b.on("click",g.links.navLink,function(c){var d=b.find(g.wrapper),e=d.data("view"),f=d.data("courseid"),h=d.data("categoryid"),i=a(c.currentTarget);"month"===e?(m(b,i.attr("href"),i.data("year"),i.data("month"),f,h),c.preventDefault()):"day"===e&&(q(b,i.attr("href"),i.data("year"),i.data("month"),i.data("day"),f,h),c.preventDefault())})},l=function(c,h,i,j,k,l){r(c),l=l||c.find(g.wrapper),M.util.js_pending([c.get("id"),h,i,j].join("-"));var m=c.data("includenavigation"),n=c.data("mini");return e.getCalendarMonthData(h,i,j,k,m,n).then(function(a){return b.render(c.attr("data-template"),a)}).then(function(a,c){return b.replaceNode(l,a,c)}).then(function(){a("body").trigger(f.viewUpdated)}).always(function(){return M.util.js_complete([c.get("id"),h,i,j].join("-")),s(c)}).fail(d.exception)},m=function(b,c,d,e,g,h){return l(b,d,e,g,h).then(function(){return c.length&&"#"!==c&&window.history.pushState({},"",c),arguments}).then(function(){return a("body").trigger(f.monthChanged,[d,e,g,h]),arguments})},n=function(a,b,c){var d=a.find(g.wrapper).data("year"),e=a.find(g.wrapper).data("month");return"undefined"==typeof b&&(b=a.find(g.wrapper).data("courseid")),"undefined"==typeof c&&(c=a.find(g.wrapper).data("categoryid")),l(a,d,e,b,c)},o=function(c,h,i,j,k,l,m){r(c),m=m||c.find(g.wrapper),M.util.js_pending([c.get("id"),h,i,j,k,l].join("-"));var n=c.data("includenavigation");return e.getCalendarDayData(h,i,j,k,l,n).then(function(a){return b.render(c.attr("data-template"),a)}).then(function(a,c){return b.replaceNode(m,a,c)}).then(function(){a("body").trigger(f.viewUpdated)}).always(function(){return M.util.js_complete([c.get("id"),h,i,j,k,l].join("-")),s(c)}).fail(d.exception)},p=function(a,b,c){var d=a.find(g.wrapper),e=d.data("year"),f=d.data("month"),h=d.data("day");return b||(b=a.find(g.wrapper).data("courseid")),"undefined"==typeof c&&(c=a.find(g.wrapper).data("categoryid")),o(a,e,f,h,b,c)},q=function(b,c,d,e,g,h,i){return o(b,d,e,g,h,i).then(function(){return c.length&&"#"!==c&&window.history.pushState({},"",c),arguments}).then(function(){return a("body").trigger(f.dayChanged,[d,e,g,h,i]),arguments})},r=function(a){var b=a.find(g.containers.loadingIcon);b.removeClass("hidden")},s=function(a){var b=a.find(g.containers.loadingIcon);b.addClass("hidden")},t=function(c,h,i){r(c);var j=c.find(g.wrapper);return"undefined"==typeof h&&(h=c.find(g.wrapper).data("courseid")),"undefined"==typeof i&&(i=c.find(g.wrapper).data("categoryid")),e.getCalendarUpcomingData(h,i).then(function(a){return b.render(c.attr("data-template"),a)}).then(function(a,c){return b.replaceNode(j,a,c)}).then(function(){a("body").trigger(f.viewUpdated)}).always(function(){return s(c)}).fail(d.exception)},u=function(a){switch(a){case"user":return"user";case"site":return"site";case"group":return"group";case"category":return"category";default:return"course"}},v=function(a){return"calendar_event_"+u(a)},w=function(a){var c="";e.getEventById(a).then(function(b){if(!b.event)throw new Error("Error encountered while trying to fetch calendar event with ID: "+a);var d=b.event;return c=v(d.eventtype),x(d.eventtype).then(function(a){return d.eventtype=a,d})}).then(function(a){var d={title:a.name,type:j.TYPE,body:b.render("core_calendar/event_summary_body",a),templateContext:{canedit:a.canedit,candelete:a.candelete,headerclasses:c,isactionevent:a.isactionevent,url:a.url}};return h.create(d)}).done(function(a){a.getRoot().on(i.hidden,function(){a.destroy()}),a.show()}).fail(d.exception)},x=function(a){var b="type"+u(a);return c.get_string(b,"core_calendar").then(function(a){return a})};return{init:function(a){k(a)},reloadCurrentMonth:n,changeMonth:m,refreshMonthContent:l,reloadCurrentDay:p,changeDay:q,refreshDayContent:o,reloadCurrentUpcoming:t}});
define(["jquery","core/templates","core/str","core/notification","core_calendar/repository","core_calendar/events","core_calendar/selectors","core/modal_factory","core/modal_events","core_calendar/summary_modal","core/pending"],function(a,b,c,d,e,f,g,h,i,j,k){var l=function(b){b=a(b),b.on("click",g.links.eventLink,function(b){var c,d=new k("core_calendar/view_manager:eventLink:click"),e=a(b.target),f=null;c=e.is(g.actions.viewEvent)?e:e.closest(g.actions.viewEvent),f=c.length?c.data("eventId"):e.find(g.actions.viewEvent).data("eventId"),f?(b.preventDefault(),b.stopPropagation(),x(f).then(d.resolve())["catch"]()):d.resolve()}),b.on("click",g.links.navLink,function(c){var d=b.find(g.wrapper),e=d.data("view"),f=d.data("courseid"),h=d.data("categoryid"),i=a(c.currentTarget);"month"===e?(n(b,i.attr("href"),i.data("year"),i.data("month"),f,h),c.preventDefault()):"day"===e&&(r(b,i.attr("href"),i.data("year"),i.data("month"),i.data("day"),f,h),c.preventDefault())})},m=function(c,h,i,j,k,l){s(c),l=l||c.find(g.wrapper),M.util.js_pending([c.get("id"),h,i,j].join("-"));var m=c.data("includenavigation"),n=c.data("mini");return e.getCalendarMonthData(h,i,j,k,m,n).then(function(a){return b.render(c.attr("data-template"),a)}).then(function(a,c){return b.replaceNode(l,a,c)}).then(function(){a("body").trigger(f.viewUpdated)}).always(function(){return M.util.js_complete([c.get("id"),h,i,j].join("-")),t(c)}).fail(d.exception)},n=function(b,c,d,e,g,h){return m(b,d,e,g,h).then(function(){return c.length&&"#"!==c&&window.history.pushState({},"",c),arguments}).then(function(){return a("body").trigger(f.monthChanged,[d,e,g,h]),arguments})},o=function(a,b,c){var d=a.find(g.wrapper).data("year"),e=a.find(g.wrapper).data("month");return"undefined"==typeof b&&(b=a.find(g.wrapper).data("courseid")),"undefined"==typeof c&&(c=a.find(g.wrapper).data("categoryid")),m(a,d,e,b,c)},p=function(c,h,i,j,k,l,m){s(c),m=m||c.find(g.wrapper),M.util.js_pending([c.get("id"),h,i,j,k,l].join("-"));var n=c.data("includenavigation");return e.getCalendarDayData(h,i,j,k,l,n).then(function(a){return b.render(c.attr("data-template"),a)}).then(function(a,c){return b.replaceNode(m,a,c)}).then(function(){a("body").trigger(f.viewUpdated)}).always(function(){return M.util.js_complete([c.get("id"),h,i,j,k,l].join("-")),t(c)}).fail(d.exception)},q=function(a,b,c){var d=a.find(g.wrapper),e=d.data("year"),f=d.data("month"),h=d.data("day");return b||(b=a.find(g.wrapper).data("courseid")),"undefined"==typeof c&&(c=a.find(g.wrapper).data("categoryid")),p(a,e,f,h,b,c)},r=function(b,c,d,e,g,h,i){return p(b,d,e,g,h,i).then(function(){return c.length&&"#"!==c&&window.history.pushState({},"",c),arguments}).then(function(){return a("body").trigger(f.dayChanged,[d,e,g,h,i]),arguments})},s=function(a){var b=a.find(g.containers.loadingIcon);b.removeClass("hidden")},t=function(a){var b=a.find(g.containers.loadingIcon);b.addClass("hidden")},u=function(c,h,i){s(c);var j=c.find(g.wrapper);return"undefined"==typeof h&&(h=c.find(g.wrapper).data("courseid")),"undefined"==typeof i&&(i=c.find(g.wrapper).data("categoryid")),e.getCalendarUpcomingData(h,i).then(function(a){return b.render(c.attr("data-template"),a)}).then(function(a,c){return b.replaceNode(j,a,c)}).then(function(){a("body").trigger(f.viewUpdated)}).always(function(){return t(c)}).fail(d.exception)},v=function(a){switch(a){case"user":return"user";case"site":return"site";case"group":return"group";case"category":return"category";default:return"course"}},w=function(a){return"calendar_event_"+v(a)},x=function(a){var c=new k("core_calendar/view_manager:renderEventSummaryModal"),f="";return e.getEventById(a).then(function(b){if(!b.event)throw new Error("Error encountered while trying to fetch calendar event with ID: "+a);var c=b.event;return f=w(c.eventtype),y(c.eventtype).then(function(a){return c.eventtype=a,c})}).then(function(a){var c={title:a.name,type:j.TYPE,body:b.render("core_calendar/event_summary_body",a),templateContext:{canedit:a.canedit,candelete:a.candelete,headerclasses:f,isactionevent:a.isactionevent,url:a.url}};return h.create(c)}).then(function(a){return a.getRoot().on(i.hidden,function(){a.destroy()}),a.show(),a}).then(function(a){return c.resolve(),a})["catch"](d.exception)},y=function(a){var b="type"+v(a);return c.get_string(b,"core_calendar").then(function(a){return a})};return{init:function(a){l(a)},reloadCurrentMonth:o,changeMonth:n,refreshMonthContent:m,reloadCurrentDay:q,changeDay:r,refreshDayContent:p,reloadCurrentUpcoming:u}});
+2
View File
@@ -64,6 +64,7 @@ function(
// Toggle the hidden. We need to render the template before we change the value.
data.hidden = !data.hidden;
M.util.js_pending("core_calendar/calendar_filter:toggleFilter");
return Str.get_string('eventtype' + data.eventtype, 'calendar')
.then(function(nameStr) {
data.name = nameStr;
@@ -78,6 +79,7 @@ function(
})
.then(function() {
fireFilterChangedEvent(data);
M.util.js_complete("core_calendar/calendar_filter:toggleFilter");
return;
});
};
+19 -13
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;
}
@@ -233,7 +234,9 @@ function(
* @returns {Promise}
*/
function registerEditListeners(root, eventFormModalPromise) {
eventFormModalPromise
var pendingPromise = new Pending('core_calendar/crud:registerEditListeners');
return eventFormModalPromise
.then(function(modal) {
// When something within the calendar tells us the user wants
// to edit an event then show the event form modal.
@@ -245,11 +248,14 @@ function(
e.stopImmediatePropagation();
});
return;
return modal;
})
.fail(Notification.exception);
.then(function(modal) {
pendingPromise.resolve();
return eventFormModalPromise;
return modal;
})
.catch(Notification.exception);
}
return {
+2 -1
View File
@@ -165,6 +165,7 @@ function(
// We have to wait for the modal to finish rendering in order to ensure that
// the data-event-title property is available to use as the modal title.
M.util.js_pending('core_calendar/summary_modal:registerEventListeners:bodyRendered');
this.getRoot().on(ModalEvents.bodyRendered, function() {
this.getModal().data({
eventTitle: this.getEventTitle(),
@@ -173,7 +174,7 @@ function(
})
.attr('data-type', 'event');
CalendarCrud.registerRemove(this.getModal());
M.util.js_complete('core_calendar/summary_modal:registerEventListeners:bodyRendered');
}.bind(this));
$('body').on(CalendarEvents.deleted, function() {
+22 -5
View File
@@ -32,6 +32,7 @@ define([
'core/modal_factory',
'core/modal_events',
'core_calendar/summary_modal',
'core/pending',
], function(
$,
Templates,
@@ -42,7 +43,8 @@ define([
CalendarSelectors,
ModalFactory,
ModalEvents,
SummaryModal
SummaryModal,
Pending
) {
/**
@@ -55,6 +57,7 @@ define([
// Bind click events to event links.
root.on('click', CalendarSelectors.links.eventLink, function(e) {
var pendingPromise = new Pending('core_calendar/view_manager:eventLink:click');
var target = $(e.target);
var eventId = null;
@@ -79,7 +82,11 @@ define([
// and causing the day click handler to fire.
e.stopPropagation();
renderEventSummaryModal(eventId);
renderEventSummaryModal(eventId)
.then(pendingPromise.resolve())
.catch();
} else {
pendingPromise.resolve();
}
});
@@ -375,12 +382,14 @@ define([
* Render the event summary modal.
*
* @param {Number} eventId The calendar event id.
* @returns {Promise}
*/
var renderEventSummaryModal = function(eventId) {
var pendingPromise = new Pending('core_calendar/view_manager:renderEventSummaryModal');
var typeClass = '';
// Calendar repository promise.
CalendarRepository.getEventById(eventId).then(function(getEventResponse) {
return CalendarRepository.getEventById(eventId).then(function(getEventResponse) {
if (!getEventResponse.event) {
throw new Error('Error encountered while trying to fetch calendar event with ID: ' + eventId);
}
@@ -409,7 +418,8 @@ define([
// Create the modal.
return ModalFactory.create(modalParams);
}).done(function(modal) {
})
.then(function(modal) {
// Handle hidden event.
modal.getRoot().on(ModalEvents.hidden, function() {
// Destroy when hidden.
@@ -419,7 +429,14 @@ define([
// Finally, render the modal!
modal.show();
}).fail(Notification.exception);
return modal;
})
.then(function(modal) {
pendingPromise.resolve();
return modal;
})
.catch(Notification.exception);
};
/**
+6
View File
@@ -1270,6 +1270,12 @@ class calendar_information {
* @param string|null $view preference view options (eg: day, month, upcoming)
*/
public function add_sidecalendar_blocks(core_calendar_renderer $renderer, $showfilters=false, $view=null) {
global $PAGE;
if (!has_capability('moodle/block:view', $PAGE->context) ) {
return;
}
if ($showfilters) {
$filters = new block_contents();
$filters->content = $renderer->event_filter();
+1 -1
View File
@@ -121,7 +121,7 @@ class behat_calendar extends behat_base {
*/
public function i_view_the_calendar_for($month, $year) {
$time = make_timestamp($year, $month, 1);
$this->getSession()->visit($this->locate_path('/calendar/view.php?view=month&course=1&time='.$time));
$this->execute('behat_general::i_visit', ['/calendar/view.php?view=month&course=1&time='.$time]);
}
}
+1 -3
View File
@@ -59,9 +59,7 @@ Feature: Add cohorts of users
@javascript
Scenario: Edit cohort name in-place
When I follow "Cohorts"
And I click on "Edit cohort name" "link" in the "Test cohort name" "table_row"
And I set the field "New name for cohort Test cohort name" to "Students cohort"
And I press key "13" in the field "New name for cohort Test cohort name"
And I set the field "Edit cohort name" to "Students cohort"
Then I should not see "Test cohort name"
And I should see "Students cohort"
And I follow "Cohorts"

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