Compare commits

..

862 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7) 31059fd653 Moodle release 2.7.2 2014-09-06 13:01:52 +02:00
Eloy Lafuente (stronk7) cbdde9a495 weekly release 2.7.1+ 2014-09-04 19:55:11 +02:00
Eloy Lafuente (stronk7) ce65706ceb Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2014-09-04 19:55:06 +02:00
Marina Glancy 65f8dc31d8 MDL-46861 webservice: reverted unnecessary change in 2.7 2014-09-04 11:40:48 +08:00
Eloy Lafuente (stronk7) 779303d869 Merge branch 'MDL-47031-27-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_27_STABLE 2014-09-03 19:25:55 +02:00
Helen Foster 28c9a1993d MDL-47031 Merge English strings from the en_fix language pack 2014-09-03 10:59:31 +02:00
Marina Glancy 8f866fa1c3 Merge branch 'm27_MDL-46639' of git://github.com/danmarsden/moodle into MOODLE_27_STABLE 2014-09-03 16:59:16 +08:00
Dan Marsden a556c4d02c MDL-46639 SCORM: incorrect setting of launch param, it is done in scorm_parse_aicc 2014-09-03 20:21:31 +12:00
Charles Fulton 87c0820260 MDL-30414 block_private_files: convert button to inline link 2014-09-03 01:09:32 +02:00
Damyon Wiese 0444bcffc7 Merge branch 'wip-MDL-47052-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2014-09-02 15:30:46 +08:00
Marina Glancy 15990b65ac MDL-47052 report_participation: fixed bug when filtering by first letter 2014-09-02 15:01:32 +08:00
Michael de Raadt 1f3066f197 MDL-46619 Forum: link to the discussion only if users cannot see posts. 2014-09-02 10:10:05 +08:00
Michael de Raadt 532c25d5bd MDL-46619 Forum: only output last poster's name if user can view it. 2014-09-02 10:10:02 +08:00
Marina Glancy c256614eab Merge branch 'MDL-45952_27' of git://github.com/Syxton/moodle into MOODLE_27_STABLE 2014-09-02 09:58:58 +08:00
Eloy Lafuente (stronk7) 0f67177a54 Merge branch 'MDL-46633_m27' of https://github.com/shashirepo/moodle into MOODLE_27_STABLE 2014-09-02 02:12:22 +02:00
Eloy Lafuente (stronk7) 2e6e70ccd2 Merge branch 'wip_MDL-46679_m27_addonenv' of https://github.com/skodak/moodle into MOODLE_27_STABLE 2014-09-02 02:08:43 +02:00
Eloy Lafuente (stronk7) a13ae2ac2d Merge branch 'MDL-46979_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-09-02 01:48:56 +02:00
Eloy Lafuente (stronk7) e19f164fc7 Merge branch 'MDL-45909_install_M27' of https://github.com/nadavkav/moodle into MOODLE_27_STABLE 2014-09-02 01:46:34 +02:00
Eloy Lafuente (stronk7) 702c4b1206 Merge branch 'MDL-43639_updatePassEveryLogin_27' of https://github.com/moodlerooms/moodle into MOODLE_27_STABLE 2014-09-02 01:07:43 +02:00
Damyon Wiese 17a31c7a1f Merge branch 'MDL-46852-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-09-01 16:16:33 +08:00
Damyon Wiese 7b258d7186 Merge branch 'wip-MDL-46540-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2014-09-01 16:08:00 +08:00
Marina Glancy 609a129b84 MDL-46540 stats: missing include file
Thanks to Vadim Dvorovenko for finding a bug and providing a solution
2014-09-18 03:40:17 +08:00
Marina Glancy ecd01922e9 Merge branch 'MDL-46861_27_STABLE' of https://github.com/Lightwork-Marking/moodle into MOODLE_27_STABLE 2014-09-01 16:07:05 +08:00
Damyon Wiese c8782c56d7 Merge branch 'MDL-46902_m27' of git://github.com/markn86/moodle into MOODLE_27_STABLE 2014-09-01 15:54:18 +08:00
Damyon Wiese 4deed68f49 Merge branch 'MDL-46911-27' of https://github.com/bostelm/moodle into MOODLE_27_STABLE 2014-09-01 15:45:52 +08:00
Damyon Wiese 40b705e153 Merge branch 'm27_MDL-46985_7ZIP_RAR_MIME_types_missing' of https://github.com/scara/moodle into MOODLE_27_STABLE 2014-09-01 15:36:22 +08:00
Damyon Wiese 3b35ea4686 Merge branch 'm27_MDL-46961' of https://github.com/danmarsden/moodle into MOODLE_27_STABLE 2014-09-01 15:29:03 +08:00
Damyon Wiese 5a9dde69b1 Merge branch 'wip-mdl-46670-m27' of https://github.com/rajeshtaneja/moodle into MOODLE_27_STABLE 2014-09-01 15:23:23 +08:00
Damyon Wiese a02ad260e0 Merge branch 'MDL-45818_m27' of git://github.com/markn86/moodle into MOODLE_27_STABLE 2014-09-01 15:17:57 +08:00
Marina Glancy 15f15ccddd Merge branch 'm27_MDL-46639' of git://github.com/danmarsden/moodle into MOODLE_27_STABLE 2014-09-01 14:34:52 +08:00
Marina Glancy 346e41d042 Merge branch 'MDL-46539-fix-27' of https://github.com/jmarthaler/moodle into MOODLE_27_STABLE 2014-09-01 14:34:40 +08:00
Frederic Massart 36bf61e152 MDL-46852 mod_lesson: More accurate comparison of shortanswer answers 2014-09-01 14:25:31 +08:00
Damyon Wiese bc180cd111 Merge branch 'wip-MDL-39233-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2014-09-01 13:40:38 +08:00
Damyon Wiese b10d7c59ae MDL-46619 Forum: whitespace fixes 2014-09-01 11:35:26 +08:00
Damyon Wiese 6aee251874 Merge branch 'MDL-46619-2.7-visisble-authors-qanda' of https://github.com/amandadoughty/moodle into MOODLE_27_STABLE 2014-09-01 11:00:35 +08:00
Damyon Wiese d1e9bdfbc8 Merge branch 'm27_MDL-46737' of https://github.com/danmarsden/moodle into MOODLE_27_STABLE 2014-09-01 10:55:22 +08:00
zbdd 0c18577317 MDL-37312 backup: Keep course idnumber on same site course restore
When the course idnumber is set during a same site course restore,
retain the course idnumber if there are no duplicates.
2014-09-01 10:44:50 +08:00
Rajesh Taneja 255221acdf MDL-46670 report_participation: Look for records in legacy and current
Priority log store will have current information, so
make sure to get information and aggregate that with
legacy data
2014-09-01 10:24:51 +08:00
Matteo Scaramuccia 93bd10c300 MDL-46985 Added 7-Zip and RAR MIME types. 2014-08-31 22:39:37 +02:00
Petr Skoda 03bdfbd37b MDL-39840 environment: add support for environment.xml in plugins
New features:

* environment.xml files in all types of plugins
* support for plugin strings via new optional plugin attribute in FEEDBACK
* support for class_name::method_name custom callbacks and classloader
2014-09-01 08:39:11 +12:00
AMOS bot d7de792dac Automatically generated installer lang files 2014-09-01 00:05:42 +08:00
Mark Nelson 763e5d6c83 MDL-45818 core_message: use system context if user no longer exists 2014-08-29 16:20:08 -07:00
Mark Nelson 436c7825b1 MDL-46902 core_course: display meaningful message when no courses found 2014-08-29 14:31:55 -07:00
AMOS bot 9074f5914f Automatically generated installer lang files 2014-08-30 00:05:30 +08:00
Paul Charsley 62ff078fcf MDL-46861 added missing required field areaname 2014-08-29 10:53:38 +12:00
Nadav Kavalerchik df174952fd MDL-45909 install/css: Left align input form fields on Install pages,in RTL mode 2014-08-28 22:58:02 +03:00
Tim Hunt 9d97806c7e MDL-46979 backup: remove duplicate string.
Thanks to Matt Sammarco for spotting this.
2014-08-28 20:45:00 +01:00
Eloy Lafuente (stronk7) e6f1c141bf weekly release 2.7.1+ 2014-08-28 19:12:21 +02:00
Eloy Lafuente (stronk7) 687f244a6f Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2014-08-28 19:12:14 +02:00
AMOS bot 461532ecfc Automatically generated installer lang files 2014-08-29 00:05:30 +08:00
shashirepo 16b6239a88 MDL-46633 chat: Chat send button gets stuck 2014-08-28 15:01:49 +05:30
Syxton 8121a2fad0 MDL-45952 feedback: non-respondents in groupings
Fixes feedback non-respondents list to show only members in groups in
the selected grouping if "Available for group members only" is selected.
2014-08-27 15:14:08 -04:00
Mark Nielsen d78e72a940 MDL-43639: Prevent user updated event on every login
If auth plugin prevents local passwords, then user
is updated and event is triggered on every login.
2014-08-27 11:24:51 -07:00
Jon Marthaler 16a175de06 MDL-46539 assign calendar: Fix lastcron value for assign cron 2014-08-27 11:15:38 -05:00
AMOS bot ec4f31f984 Automatically generated installer lang files 2014-08-28 00:05:33 +08:00
Damyon Wiese 323a7a151b Merge branch 'MDL-46812-27-fixup' of https://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-08-27 10:49:08 +08:00
Frederic Massart 14eb0c478d MDL-46812 gradereport_grader: Hide vertical scrollbar of scroller 2014-08-27 10:44:02 +08:00
Damyon Wiese e8b487e010 Merge branch 'wip-MDL-39888-27' of git://github.com/abgreeve/moodle into MOODLE_27_STABLE 2014-08-27 09:56:58 +08:00
Faisal Kaleem 641351118e MDL-46961 SCORM: JavaScript Hoisting issue. 2014-08-27 13:08:59 +12:00
Eloy Lafuente (stronk7) 12e42d2246 MDL-46875 tinymce: keep stable version YYYMMDD constant
Note this has been integrated together with previous commit
so nobody should get a "downgrade" ever (but Brian, I'm sorry :-)
2014-08-27 02:11:59 +02:00
Eloy Lafuente (stronk7) 0a668af390 Merge branch 'm27_MDL-46875' of https://github.com/totara/moodle into MOODLE_27_STABLE 2014-08-27 02:03:37 +02:00
Damyon Wiese 22290d726a Revert "Merge branch 'MDL-46917-27' of git://github.com/andrewnicols/moodle into MOODLE_27_STABLE"
This reverts commit 439f2e7e83, reversing
changes made to b523d5bc33.
2014-08-26 17:20:41 +08:00
Henning Bostelmann 03fc135cb6 MDL-46911 Database activity: jump to correct place in list after (un)approve 2014-08-26 10:17:07 +01:00
Marina Glancy 0459ed43e1 MDL-39233 mod_url: added unittest for get_course_content 2014-08-26 13:55:11 +08:00
Jason 928f531307 MDL-39233 mod_url: fix php notice 2014-08-26 13:55:10 +08:00
Damyon Wiese 767dfb307d MDL-46842 assign: Fix for unit tests - previous patch was completely ignoring manually reopening attempts. 2014-08-26 10:34:03 +08:00
Brian Barnes 3efe531af4 MDL-46875 tinymce: Fixed issue with full screen and spelling 2014-08-26 13:23:01 +12:00
Eloy Lafuente (stronk7) ef54b1272a Merge branch 'MDL-46477_m27' of https://github.com/shashirepo/moodle into MOODLE_27_STABLE 2014-08-26 02:24:31 +02:00
Eloy Lafuente (stronk7) 2e97e57edb Merge branch 'MDL-46753-27' of git://github.com/lameze/moodle into MOODLE_27_STABLE 2014-08-26 02:08:17 +02:00
Eloy Lafuente (stronk7) 2f64ea2a2e Merge branch 'm27_MDL-46842' of https://github.com/greg-or/moodle-mod_assign into MOODLE_27_STABLE 2014-08-26 01:59:25 +02:00
Eloy Lafuente (stronk7) 3fda0a9736 Merge branch 'MDL-46868_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-08-26 01:40:48 +02:00
Eloy Lafuente (stronk7) 0047e4612c Merge branch 'm27_MDL-46816' of https://github.com/danmarsden/moodle into MOODLE_27_STABLE 2014-08-26 00:10:50 +02:00
Eloy Lafuente (stronk7) 44088a5aeb Merge branch 'wip-MDL-46874-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2014-08-25 22:11:17 +02:00
Eloy Lafuente (stronk7) 2507ecbd3e Merge branch 'm27_MDL-46900' of https://github.com/totara/moodle into MOODLE_27_STABLE 2014-08-25 20:55:29 +02:00
Damyon Wiese 439f2e7e83 Merge branch 'MDL-46917-27' of git://github.com/andrewnicols/moodle into MOODLE_27_STABLE 2014-08-25 16:55:08 +08:00
Marina Glancy b523d5bc33 Merge branch 'MDL-46894_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-08-25 16:53:40 +08:00
Marina Glancy 63e0fee364 Merge branch 'MDL-46916_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-08-25 16:50:05 +08:00
Damyon Wiese 063c6e23d4 Merge branch 'MDL-46923_m27' of git://github.com/markn86/moodle into MOODLE_27_STABLE 2014-08-25 16:48:11 +08:00
Damyon Wiese 5c1f1690bb Merge branch 'wip_MDL-43918_m27_cm' of https://github.com/skodak/moodle into MOODLE_27_STABLE 2014-08-25 16:44:50 +08:00
Marina Glancy b46ad4bdd5 Merge branch 'M27_MDL46887_assignment_file_max_size' of git://github.com/Dave-B/moodle into MOODLE_27_STABLE 2014-08-25 16:29:33 +08:00
Marina Glancy 8001ddd8b2 Merge branch 'MDL-46895_27' of git://github.com/colchambers/moodle into MOODLE_27_STABLE 2014-08-25 16:28:02 +08:00
Rex Lorenzo b9894e1e9f MDL-46776 gradereport_grader: Improve Grader report user interface
* Adding assignments to test course generator to more easily test the grader report with large number of students and graded activities.
2014-08-25 16:20:49 +08:00
Dan Marsden 0e26b1d309 MDL-46639 mod_scorm: Fix load of simple AICC content
Thanks to Ian Wild for the report and suggested patch.
2014-08-25 20:01:45 +12:00
Marina Glancy 5cc6700f27 Merge branch 'MDL-46904-27' of git://github.com/damyon/moodle into MOODLE_27_STABLE 2014-08-25 14:45:38 +08:00
Damyon Wiese 090f8f300d Merge branch 'wip-MDL-46812_M27' of git://github.com/lazydaisy/moodle into MOODLE_27_STABLE 2014-08-25 14:03:18 +08:00
Damyon Wiese fc36873f61 Merge branch 'wip-MDL-46703-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2014-08-25 13:53:52 +08:00
Marina Glancy 315392626b Merge branch 'MDL-46918_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-08-25 12:01:27 +08:00
Petr Skoda c27add8d87 MDL-43918 add more validation to $modulename parameter when fetching cms 2014-08-25 12:19:11 +12:00
Adrian Greeve ae18cf2461 MDL-39888 mnet: Added a notification that logs may not be displayed in the log report.
In Moodle 2.7+ we are using the new logging system and if legacy logs are not enabled
(on the client system) then no logs will be displayed.
2014-08-23 11:55:57 +08:00
Colin Chambers deab7fda59 MDL-46895 qtype_calculated_find_formula_errors not defined causes Calculated question type test to fail 2014-08-22 14:03:36 +01:00
Andrew Nicols af3085d2d5 MDL-46917 atto: Focus on the editor when the form label is selected 2014-08-22 15:00:20 +08:00
Eloy Lafuente (stronk7) 55a8f72251 MDL-46918 ddl: cover behavior with unit test 2014-08-21 18:33:39 +01:00
Tim Hunt af02385d49 MDL-46918 ddl: fix error when renaming table already exists 2014-08-21 18:33:39 +01:00
AMOS bot c5b3017b49 Automatically generated installer lang files 2014-08-22 00:05:31 +08:00
Tim Hunt 5ec684b353 MDL-46916 behat: improve question state test. 2014-08-21 14:15:22 +01:00
Tim Hunt 0a03803081 MDL-46894 make Behat backup steps more robust. 2014-08-21 14:15:08 +01:00
Tim Hunt 6527b097e8 MDL-46868 glossary / filter: performance, check modinfo sooner.
Since we need to check modinfo anyway, do that as soon as possible so we
can get a performance win if there are no glossaries in the course.
2014-08-21 14:14:56 +01:00
Dan Poltawski 8f5c4f6b34 MDL-46880 mod_forum: move cron to scheduled task
Note that this is a very basic conversion without doing any refactoring
to split the tasks up better. That will come in MDL-44734, this is about
being a safe backportable change to give admins better control over the
running of the forum cron task.

Conflicts:
	mod/forum/version.php
2014-08-21 13:46:33 +01:00
Amanda Doughty b1325427ec MDL-46619 Forum: author showing in Q and A forum 2014-08-21 13:13:15 +01:00
shashirepo 5de6795ec0 MDL-46477 chat:hard coded string in mod/chat 2014-08-21 17:32:34 +05:30
Mary Evans 0dc138d47c MDL-46812 grade/report/grader: Need to tie up loose ends in Gradebook after MDL-43824
Squashed commit of the following:

commit 4ae57a823ba6fa1d627d2bad296cdf905b1930ee
Author: Mary Evans <lazydaisy@visible-expression.co.uk>
Date:   Thu Aug 21 02:05:35 2014 +0100

    MDL-46812 grade/report/grader: Reset previous commit for left scroller.

commit 7e3d27d3cc9d22ffe8e1dbb54eb705a65153a6b0
Author: Mary Evans <lazydaisy@visible-expression.co.uk>
Date:   Thu Aug 21 01:23:09 2014 +0100

    MDL-46812 grade/report/grader: Added jsenabled css body class to rtl style.

commit 0b5c3341b79c4b4bfefcd82eef1940964448ccba
Author: Mary Evans <lazydaisy@visible-expression.co.uk>
Date:   Thu Aug 21 01:13:34 2014 +0100

    MDL-46812 theme_base: Removed more redundant CSS.

commit 8c44e8a4c644a9139d1750af498bed6a14decf5c
Author: Mary Evans <lazydaisy@visible-expression.co.uk>
Date:   Wed Aug 20 15:44:42 2014 +0100

    MDL-46812 theme_base: Removed redundent grade/report/grader CSS in style/grade.css

commit 7c69b546fab03163d3863044ab9d1d9130c1cdd9
Author: Mary Evans <lazydaisy@visible-expression.co.uk>
Date:   Thu Aug 14 12:50:14 2014 +0100

    MDL-46812 grade/report/grader: Need to tie up loose ends in Gradebook after MDL-43824

        1. fixed gradebook layout when JS is disabled
        2. added height and background color to scroller when JS is enabled
        3. removed redundent top margin in user-grades table
2014-08-21 11:23:27 +01:00
Mark Nelson f367cfcbef MDL-46923 core_behat: fixed typos in function names 2014-08-20 22:11:31 -07:00
Brian Barnes c2b526c484 MDL-46900 theme: allowed more than 1 nav collapse element 2014-08-21 15:01:58 +12:00
Marina Glancy b01092111c weekly release 2.7.1+ 2014-08-21 10:18:55 +08:00
Marina Glancy 8ef945280c Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2014-08-21 10:18:53 +08:00
AMOS bot fbfeb98d39 Automatically generated installer lang files 2014-08-21 00:05:30 +08:00
Damyon Wiese 24276da9ce MDL-46904 core_task: Gracefully handle rubbish entries in the tasks table. 2014-08-20 17:02:02 +08:00
Gregory Faller 1f316df7d9 MDL-46842: Reopen assignment submissions when using offline grading worksheet 2014-08-20 17:28:38 +09:30
Damyon Wiese 467aefd1a6 Merge branch 'MDL-45029-27' of git://github.com/lameze/moodle into MOODLE_27_STABLE
Conflicts:
	course/modlib.php
2014-08-20 13:58:58 +08:00
Simey Lameze f354a67357 MDL-45029 core_course: set aggregationcoef while creating a new course module 2014-08-20 12:07:34 +08:00
Mark Nelson 32193155f5 MDL-46188 core_course: use correct hide/show icon 2014-08-20 12:04:59 +08:00
Damyon Wiese b3f6c093aa Merge branch 'MDL-45029-27' of git://github.com/lameze/moodle into MOODLE_27_STABLE 2014-08-20 10:21:46 +08:00
Eloy Lafuente (stronk7) 82a678c91e Merge branch 'MDL-46302-atto-float-right' of git://github.com/uhunkler/moodle into MOODLE_27_STABLE 2014-08-20 00:57:22 +02:00
Mark Nielsen f3f21f18c4 MDL-46536: OAuth signature fails with inconsistent new lines
When the LTI intro contains a single \n or
\r newline character then the OAuth signature
fails.  All newlines should be \r\n

Conflicts:
	mod/lti/tests/locallib_test.php
2014-08-19 21:51:13 +02:00
AMOS bot 05c7b75672 Automatically generated installer lang files 2014-08-20 00:05:29 +08:00
Mark Nielsen 39c01271f0 MDL-46051 mod_lti: Not enough data passed to lti_extend_lti_services 2014-08-19 17:08:59 +02:00
Mark Nielsen c09f63c5ac MDL-46051 mod_lti: Fixing errors in unknown_service_api_called class
Also adding unit tests.
2014-08-19 17:08:47 +02:00
Eloy Lafuente (stronk7) 9f9bcb251c Merge branch 'MDL-46301' of https://github.com/michaelwheeler/moodle into MOODLE_27_STABLE 2014-08-19 15:37:26 +02:00
David Balch 39864d9e88 MDL-46887 mod_assign: Enforce module's maxbytes setting at submission. 2014-08-19 14:01:15 +01:00
Marina Glancy 2a46808ed3 Merge branch 'wip-mdl-46327-m27' of git://github.com/rajeshtaneja/moodle into MOODLE_27_STABLE 2014-08-19 17:39:40 +08:00
Rajesh Taneja 4221300426 MDL-46327 phpunit: drop_table should be used, rather then drop_temp_table 2014-08-19 17:17:50 +08:00
Simey Lameze d14fe6017f MDL-45029 core_course: set aggregationcoef while creating a new course module 2014-08-19 17:08:10 +08:00
Marina Glancy cdc0a8db3f MDL-46538 theme_base: recompiled moodle.css 2014-08-19 16:52:42 +08:00
Marina Glancy 9ddb811866 Merge branch 'MDL-46538_M27' of git://github.com/lazydaisy/moodle into MOODLE_27_STABLE 2014-08-19 16:52:08 +08:00
Petr Skoda 29dd7397e2 MDL-46711 session: add support for multiple servers to memcache session driver
Includes proper definition of object properties which fixes handling of timout default.
2014-08-19 16:41:26 +08:00
Marina Glancy bef5900bdb Merge branch 'MDL-46281-MOODLE_27_STABLE' of git://github.com/lucisgit/moodle into MOODLE_27_STABLE 2014-08-19 16:22:24 +08:00
Marina Glancy 623379d82b Merge branch 'MDL-46829_M27' of git://github.com/lazydaisy/moodle into MOODLE_27_STABLE 2014-08-19 14:21:18 +08:00
Marina Glancy 8480fd9364 Merge branch 'MDL-46833-MOODLE_27_STABLE' of git://github.com/lucisgit/moodle into MOODLE_27_STABLE 2014-08-19 14:21:09 +08:00
Damyon Wiese 5faaf18173 Merge branch 'MDL-41513-Scrollbar_not_working-27' of https://github.com/MorrisR2/moodle into MOODLE_27_STABLE 2014-08-19 14:07:10 +08:00
Marina Glancy d23d771071 Merge branch 'wip-mdl-46817-m27' of git://github.com/rajeshtaneja/moodle into MOODLE_27_STABLE 2014-08-19 14:04:05 +08:00
Marina Glancy 5f690a9be6 Merge branch 'MDL-43197-27-2nd' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-08-19 13:26:01 +08:00
Damyon Wiese 95dae00235 Merge branch 'MDL-46188_m27' of https://github.com/shashirepo/moodle into MOODLE_27_STABLE 2014-08-19 13:14:45 +08:00
Marina Glancy 7c4e3db7c0 MDL-46874 gradereport: replace usage of class hidden with dimmed_text 2014-08-19 12:56:11 +08:00
Michael Wheeler 0ed1b7d277 MDL-46794 install: Fixed typo in config-dist.php 2014-08-19 11:26:49 +08:00
Marina Glancy 690988d958 Merge branch 'm27_MDL-46775' of git://github.com/totara/moodle into MOODLE_27_STABLE 2014-08-19 11:21:52 +08:00
Marina Glancy 26b3b4e80e Merge branch 'wip-mdl-46327-m27' of git://github.com/rajeshtaneja/moodle into MOODLE_27_STABLE 2014-08-19 10:50:34 +08:00
Marina Glancy a5e67c5bcc Merge branch 'wip-MDL-46791-MOODLE_27_STABLE' of git://github.com/satrun77/moodle into MOODLE_27_STABLE 2014-08-19 10:50:22 +08:00
Frederic Massart 01327cfcf5 MDL-43197 gradereport_user: Parents/mentors can see all the relevant grades 2014-08-19 10:48:11 +08:00
Rajesh Taneja 1b775e96c1 MDL-46327 phpunit: Fixed oracle fail 2014-08-19 10:13:55 +08:00
Marina Glancy ef467ee957 MDL-46691 mod_choice: apply filters to user input 2014-08-19 03:04:57 +02:00
James Henestofel 247b756248 MDL-42231 auth: custom profile fields to support numbers at the end.
For data mapping LDAP or CAS.  Change order of fieldname display checks to verify
custom profile fields first to allow custom field shortname to contain number at the end.
2014-08-19 02:43:44 +02:00
Eloy Lafuente (stronk7) 1eedfdf2c0 Merge branch 'MDL-44894_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-08-19 02:34:48 +02:00
Eloy Lafuente (stronk7) d4bbbedbde Merge branch 'wip_MDL-46552_m27_memcached' of https://github.com/skodak/moodle into MOODLE_27_STABLE 2014-08-19 02:29:06 +02:00
Eloy Lafuente (stronk7) c8abe81b99 Merge branch 'MDL-45874-27' of https://github.com/danielneis/moodle into MOODLE_27_STABLE 2014-08-19 02:12:19 +02:00
Eloy Lafuente (stronk7) 7943aabfbe Merge branch 'wip-MDL-46826-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2014-08-18 20:06:54 +02:00
Eloy Lafuente (stronk7) 2de77919d8 Merge branch 'wip-MDL-46589-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2014-08-18 19:48:42 +02:00
Marina Glancy 5094443f65 MDL-41284 stats: fix sql query from MDL-41284 2014-08-18 19:42:41 +02:00
Eric Merrill 9ec65dc485 MDL-46766 auth_cas: Upgrading to phpCAS 1.3.3 2014-08-18 16:38:55 +08:00
Simey Lameze 068ef548de MDL-46753 auth_cas: Replace hardcoded logout_return_url to user defined URL.
Credit goes to Mitsuru Udagawa, thanks!
2014-08-18 12:57:34 +08:00
Damyon Wiese bad563d2f4 Merge branch 'm27_MDL-46760' of https://github.com/danmarsden/moodle into MOODLE_27_STABLE 2014-08-18 12:41:12 +08:00
Rajesh Taneja 50eb74065b MDL-46817 behat: Step to check if value exist/not in table column 2014-08-18 10:01:06 +08:00
AMOS bot febd8afc8e Automatically generated installer lang files 2014-08-18 00:07:49 +08:00
Marina Glancy cac959739b MDL-46703 mod_data: limit the width of select element when editing templates
Thanks to Hittesh for the provided solution
2014-08-16 13:27:27 +08:00
Marina Glancy cef5600303 MDL-46589 scheduled task does not send emails
Thanks to  Luděk Šulák  for the patch
2014-08-16 12:48:16 +08:00
Mary Evans 63a2e24bc2 MDL-46538 theme_base/theme_bootstrapbase: Removed incorrect RTL CSS. 2014-08-16 01:11:31 +01:00
Daniel Neis 35eefad6b3 MDL-45874 Fix access to users reports in navigation when using separate groups 2014-08-15 17:06:39 -03:00
Rajesh Taneja c8121c53d1 MDL-46817 behat: Table selector support css
Previously table selector supported id and caption only.
But in few cases we don't have proper id, so added support
for css
2014-08-15 13:17:06 +08:00
Marina Glancy 74f6a6ae5b MDL-46826 forum: make sql query indexed, regression from MDL-31089 2014-08-15 11:46:01 +08:00
Ray Morris d560fb3e26 MDL-41513 mod_quiz: Scrollbar not working in JS Security Popup 2014-08-14 15:44:51 -05:00
Ruslan Kabalin 213220c159 MDL-46833 mod_assign: Fix assignment view when available for group members only.
When assignment is "Available for group members only" and no users with
mod/assign:submit role permision is enrolled (students),
groups_filter_users_by_course_module_visible is causing error (as $users
array is empty). The patch resolves the issue.
2014-08-14 16:04:54 +01:00
shashirepo baa476ce92 MDL-46188 course:show/hide button disappears after action 2014-08-14 20:32:31 +05:30
Mary Evans 795dc143c2 MDL-46829 theme_base: Fixed regression in Base casued by MDL-45031. 2014-08-14 14:27:06 +01:00
Tony Butler a18e060c5b MDL-46281 core_backup: Add class_exists check for backup_<mod>_activity_task
Signed-off-by: Tony Butler <tonyjbutler@gmail.com>
2014-08-14 12:57:15 +01:00
Mohamed Alsharaf 84ebf61b82 MDL-46791 question: fixed incorrect 5th param for tag_set() 2014-08-14 23:51:41 +12:00
Tim Hunt 300dff939f MDL-44894 question editing: fix validation with odd permissions
For users with edit permissions, but not add permissions, it was
impossible to save the editing form. The validation assuemd this value
was present, but it was not. Other code checks this field too, so I
added it rather than changing the validation and all the other uses.
2014-08-14 11:26:25 +01:00
Marina Glancy 2aa6dd4c60 weekly release 2.7.1+ 2014-08-14 14:52:31 +08:00
Marina Glancy e59d25c944 Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2014-08-14 14:52:27 +08:00
Dan Marsden a86531f20b MDL-46816 mod_asssign plagiarism: Remove unnecessary code. 2014-08-14 13:09:42 +12:00
Dan Marsden 239bfa31b0 MDL-46760 mod_scorm: Fix js error when preview mode disabled 2014-08-14 10:10:45 +12:00
Eloy Lafuente (stronk7) 9056ee506a MDL-45031 theme: fix tabs base line alignment by 1px.
Credit goes to Damyon Wiese, thanks!
2014-08-13 21:33:02 +02:00
Michael Wheeler 5a8fdd1c27 Normalize request header names. 2014-08-13 14:51:44 -04:00
AMOS bot be14be6175 Automatically generated installer lang files 2014-08-14 00:05:45 +08:00
Marina Glancy 0b09c8e48f Revert "Merge branch 'm27_MDL-46643' of git://github.com/totara/moodle into MOODLE_27_STABLE"
This reverts commit a62801941e, reversing
changes made to 0282c20862.
2014-08-13 16:30:07 +08:00
Andrew Nicols 90e4b26229 MDL-45759 mod_quiz: Correct behat test to reflect changes from a translation fix 2014-08-13 15:49:45 +08:00
Eloy Lafuente (stronk7) 8b9c45b666 Merge branch 'MDL-46697_27' of git://github.com/aolley/moodle into MOODLE_27_STABLE 2014-08-13 02:08:16 +02:00
Eloy Lafuente (stronk7) 2c3eea86fa Merge branch 'MDL-45031_M27' of git://github.com/lazydaisy/moodle into MOODLE_27_STABLE 2014-08-13 00:33:03 +02:00
Eloy Lafuente (stronk7) 39259ea58b Merge branch 'wip-MDL-46470-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE
Conflicts:
	theme/bootstrapbase/style/moodle.css
2014-08-13 00:26:16 +02:00
Tim Hunt 3ce36f6ac1 MDL-45642 questions: add required index to question_attempts.
It is important to be able to tell which behaviours are in use, and
without this index, it requires a complete scan of this table, which can
be very big, to verify that a behaviour is unused.
2014-08-12 11:38:26 +01:00
Dan Poltawski 6a9a7005b0 Merge branch 'MDL-43824-M27' of git://github.com/lazydaisy/moodle into MOODLE_27_STABLE
Conflicts:
	theme/bootstrapbase/style/moodle.css
2014-08-12 11:08:11 +01:00
Dan Poltawski 2d9145638c Merge branch 'm27_MDL-46718' of https://github.com/greg-or/moodle-mod_assign into MOODLE_27_STABLE 2014-08-12 11:02:18 +01:00
Marina Glancy 531b675632 Merge branch 'MDL-46308_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-08-12 16:02:54 +08:00
Marina Glancy c41d4355ac Merge branch 'MDL-21042_m27' of git://github.com/markn86/moodle into MOODLE_27_STABLE 2014-08-12 16:02:11 +08:00
Marina Glancy ac4bf23c02 Merge branch 'm27_MDL-46315' of git://github.com/totara/moodle into MOODLE_27_STABLE 2014-08-12 15:02:03 +08:00
Marina Glancy 51c59e8b9f Merge branch 'MDL-46600_import_failed_27' of git://github.com/andyjdavis/moodle into MOODLE_27_STABLE 2014-08-12 15:01:55 +08:00
Marina Glancy 606db83726 Merge branch 'wip_MDL-46480_m27_footernan' of git://github.com/skodak/moodle into MOODLE_27_STABLE 2014-08-12 15:01:46 +08:00
Marina Glancy a62801941e Merge branch 'm27_MDL-46643' of git://github.com/totara/moodle into MOODLE_27_STABLE 2014-08-12 13:31:41 +08:00
Marina Glancy 0282c20862 Merge branch 'MDL-43740_manual_none_27' of git://github.com/andyjdavis/moodle into MOODLE_27_STABLE 2014-08-12 13:29:30 +08:00
Simon Coggins 915e21170c MDL-46775: Fix call to unavailable function when loading an invalid JS file 2014-08-12 14:33:23 +12:00
Mary Evans 11b6abd02c MDL-45031 theme_base: Added style/tabs.css and updated config.php
also removed tabtree css from style/core.css to style/tabs.css.
2014-08-12 01:11:31 +01:00
Eloy Lafuente (stronk7) 6005337c33 Merge branch 'MDL-46676_2.7' of https://github.com/ikawhero/moodle into MOODLE_27_STABLE 2014-08-12 01:48:18 +02:00
Eloy Lafuente (stronk7) ea2833bc35 Merge branch 'MDL-46681_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-08-12 01:44:23 +02:00
Mary Evans 2271f1845c MDL-43824 core/grade/report/grader: Fix for misalignment of static rows with scale grades. 2014-08-11 23:53:36 +01:00
Dan Poltawski b4875aa348 Merge branch 'MDL-46496-27' of git://github.com/andrewnicols/moodle into MOODLE_27_STABLE 2014-08-11 14:38:35 +01:00
Dan Poltawski 3b4cc68ff4 Merge branch 'm27_MDL-44015' of https://github.com/greg-or/moodle-mod_assign into MOODLE_27_STABLE 2014-08-11 14:31:04 +01:00
Dan Poltawski 2f0d26c522 Merge branch 'MDL-46688_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-08-11 14:13:14 +01:00
Andrew Davis 3dd8bd5069 MDL-43740 core_grade: Thanks to Robert Russo for the patch. Removed the ability to set manual grade items to grade type "None" 2014-08-11 20:17:13 +08:00
Dan Poltawski eede6aae43 Merge branch 'MDL-45759-27' of git://github.com/andrewnicols/moodle into MOODLE_27_STABLE 2014-08-11 11:24:20 +01:00
Dan Poltawski a623fdf11b Merge branch 'wip-MDL-30668-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2014-08-11 10:41:42 +01:00
Marina Glancy 617144f163 Merge branch 'MDL-35984-27' of git://github.com/damyon/moodle into MOODLE_27_STABLE 2014-08-11 17:24:48 +08:00
Dan Poltawski 61d3898de9 Merge branch 'MDL-46748-27' of git://github.com/damyon/moodle into MOODLE_27_STABLE 2014-08-11 08:37:35 +01:00
Damyon Wiese ec297cc65b MDL-35984 Grades: Fix deprecation of grade_category::aggregate_values 2014-08-11 14:22:27 +08:00
Damyon Wiese 5e33ee65e5 MDL-35984 grade: Recalculate min/max for sum of grades when hidden grades are involved. 2014-08-11 14:22:27 +08:00
Damyon Wiese 3bf4cc3887 MDL-35984 grade: Add behat tests for grade aggregations 2014-08-11 14:22:27 +08:00
Andrew Nicols 4f88c9f38d MDL-45780 mod_quiz: Autosave should listen for textarea:change events too 2014-08-11 12:32:15 +08:00
Andrew Nicols 096ef13c79 MDL-45780 editor_atto: Update the textarea more often
This change updates the frequency of the textarea update to additionally
update it:
* on keypress; and
* on content paste.
2014-08-11 12:32:13 +08:00
Damyon Wiese c49e848571 MDL-46748 MathJax filter: Update setting default for https cdn url. 2014-08-11 12:03:54 +08:00
Damyon Wiese 25a0be8b27 MDL-46748 MathJax filter: Make misconfigured mathjax url less "fatal" for Atto. 2014-08-11 12:03:05 +08:00
Tim Hunt b760c63189 MDL-46308 qformat_xml: fix import of broken calculated questions.
Questions like this should not exist, of course. But they do, so we
should avoid generating errors in this case.
2014-08-08 17:59:15 +01:00
Tim Hunt b3569fb6fa MDL-46688 weblib: improve the highlight function.
Thanks to Joseph Baxter for suggesting some of the test cases.
2014-08-08 17:53:04 +01:00
Marina Glancy db14163584 MDL-30668 gradereport_grader: split user preferences into individual courses
This solves the DB exception when users were trying to insert very large string in DB
2014-08-08 15:16:32 +08:00
Andrew Nicols c58559191a MDL-46496 libraries: Add additional tests for jquery and jqueryUI
The additional tests add a clear example of the use of jquery UI images in
addition to working JavaScript.
2014-08-08 14:06:20 +08:00
Gregory Faller d86be9c53e MDL-46718: Return user to last accessed page when quick grading 2014-08-08 14:12:03 +09:30
Dan Marsden 7de6a916a2 MDL-46737 SCORM: correct dml syntax. 2014-08-08 15:10:11 +12:00
Andrew Nicols cf93e03ea0 MDL-45759 javascript: Handle setting of the confirm button fields post-init 2014-08-08 08:36:20 +08:00
Petr Skoda f2774239cb MDL-46480 fix get_htmlelement_size() to deal with hidden or non-block elements 2014-08-08 10:28:51 +12:00
Tim Hunt 5049dfceca MDL-46681 qtype_multichoice: disabled unused options
For questions set to 'One answer only', the 'Clear incorrect responses'
and 'Show the number of correct responses' hint options make not sense,
and are not used. Hence we disableIf them.
2014-08-07 14:23:07 +01:00
Marina Glancy 186af5a430 weekly release 2.7.1+ 2014-08-07 13:15:08 +08:00
Marina Glancy 7a4826bc3e Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2014-08-07 13:15:07 +08:00
Paul Holden 1b1432ab88 MDL-21042 report_security: don't display warning for riskbackup unnecessarily 2014-08-06 19:54:23 -07:00
Andrew Davis 5bfbec5521 MDL-46600 core_grades: made it explicit in the error message that a failed grade import means nothing was imported. 2014-08-07 09:17:04 +08:00
Shane Elliott eee25b4a13 MDL-46676 profilefield_datetime: Use moodle time API 2014-08-06 16:36:03 +08:00
Adam Olley a175c5d1ba MDL-46697 gradebook: Only count active users when needed (and only id)
The code only needs the id column to perform its count. On courses with a lot of users
fetching the whole user record for them all easily adds up to several hundred MB of
memory.
2014-08-06 15:58:11 +09:30
Gregory Faller d209e7161a MDL-44015: EditPDF scrolls instead of drawing on iOS 2014-08-06 14:42:53 +09:30
Marina Glancy ef494edcd6 MDL-46470 bootstrapbase: support linkedwhenselected attribute for tabs 2014-08-06 11:46:16 +08:00
Brian Barnes 20ada5de55 MDL-46643 calendar: improved tab order of calendar detail pages 2014-08-06 15:32:02 +12:00
Eloy Lafuente (stronk7) c21c4761d1 Merge branch 'm27_MDL-46625' of https://github.com/totara/moodle into MOODLE_27_STABLE 2014-08-05 13:04:37 +02:00
Brian Barnes 9ab9793c53 MDL-46315 themes: Fixed display inconsistancy with help modals 2014-08-05 13:08:17 +12:00
Eloy Lafuente (stronk7) 4a106a5759 Merge branch 'MDL-46641_27-delete-activity-step' of https://github.com/rlorenzo/moodle into MOODLE_27_STABLE 2014-08-05 02:27:35 +02:00
Petr Skoda b5256231a6 MDL-46552 session: add support for multiple servers in memcached session driver 2014-08-05 11:40:28 +12:00
Eloy Lafuente (stronk7) b29e02d57e Merge branch 'MDL-44149-27' of git://github.com/damyon/moodle into MOODLE_27_STABLE 2014-08-04 17:10:58 +02:00
Damyon Wiese 95bb29b902 MDL-44149 Assign: Reopen attempts from quick grading (reopenuntilpass) 2014-08-04 15:55:10 +08:00
Marina Glancy 59fe1b009f Merge branch 'MDL-44794-27' of git://github.com/lameze/moodle into MOODLE_27_STABLE 2014-08-04 14:24:51 +08:00
Simey Lameze ab8571d19a MDL-44794 group: unit test for groups_get_user_groups method. 2014-08-04 11:35:32 +08:00
Simey Lameze 90ff64881e MDL-44794 group: unit test for get_groups method. 2014-08-04 11:35:32 +08:00
Marina Glancy 1818308bca Merge branch 'MDL-46457_27' of git://github.com/aolley/moodle into MOODLE_27_STABLE 2014-08-04 11:24:30 +08:00
Marina Glancy b47604e938 Merge branch 'MDL-46414-m27' of git://github.com/sammarshallou/moodle into MOODLE_27_STABLE 2014-08-04 11:24:17 +08:00
Eloy Lafuente (stronk7) c1ee5cf31b Merge branch 'MDL-46620-27' of https://github.com/merrill-oakland/moodle into MOODLE_27_STABLE 2014-08-03 20:01:44 +02:00
Rex Lorenzo 18f802f85a MDL-46641 behat: Delete activity step does not work without actions menu open 2014-07-31 11:32:53 -07:00
AMOS bot ea8c5bdc74 Automatically generated installer lang files 2014-08-01 00:05:36 +08:00
Dan Poltawski 6b7a5f86a0 weekly release 2.7.1+ 2014-07-31 09:37:24 +01:00
Dan Poltawski f28ce6eb2e Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2014-07-31 09:37:20 +01:00
Brian Barnes 5bb55eeb21 MDL-46625 theme: Added a way to target the current page 2014-07-31 13:21:16 +12:00
Eric Merrill ddb652c706 MDL-46620 messages Make sure full message is used for read marking
message_mark_message_read needs to have the full message object,
otherwise data will be lost.
2014-07-30 15:58:04 -04:00
sam marshall 648cc055c2 MDL-46414 Conditional availability: Dropdowns not set correctly when editing in IE
In IE, you cannot set the value of a dropdown to an integer; it has to be a string.
This caused a bug in several parts of the conditional availability editing
interface.
2014-07-29 18:35:21 +01:00
Dan Poltawski 0fbda60bb3 Merge branch 'MDL-46236_27' of git://github.com/nobelium/moodle into MOODLE_27_STABLE 2014-07-29 12:04:32 +01:00
AMOS bot 486ad6e842 Automatically generated installer lang files 2014-07-29 16:02:21 +08:00
Dan Poltawski 74980995b4 Merge branch 'wip-MDL-46338-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2014-07-29 08:50:37 +01:00
Marina Glancy 33c3193f06 Merge branch 'm27_MDL-46325' of git://github.com/totara/moodle into MOODLE_27_STABLE 2014-07-29 11:58:55 +08:00
Sam Hemelryk 95924516fa Merge branch 'MDL-43908-MOODLE_27_STABLE' of https://github.com/lucisgit/moodle into MOODLE_27_STABLE 2014-07-29 15:51:09 +12:00
Sam Hemelryk 1663aa1fb9 Merge branch 'MDL-45041_27_STABLE' of git://github.com/jleyva/moodle into MOODLE_27_STABLE 2014-07-29 15:47:22 +12:00
Sam Hemelryk 970536b659 Merge branch 'MDL-46460_27' of git://github.com/jleyva/moodle into MOODLE_27_STABLE 2014-07-29 15:44:34 +12:00
Marina Glancy b6fadf63d4 MDL-46338 enrol_self: Icon should indicate enrolment availability 2014-07-29 09:51:21 +08:00
Adam Olley f1213f3a75 MDL-46457 mod_lti: Render lti description through standard format_module_intro 2014-07-29 10:41:40 +09:30
Sam Hemelryk adac041f8c Merge branch 'MDL-45044-m27-master' of https://github.com/dthies/moodle into MOODLE_27_STABLE 2014-07-29 08:47:00 +12:00
Dan Poltawski acadd22a65 Merge branch 'MDL-46206-27' of git://github.com/jethac/moodle into MOODLE_27_STABLE 2014-07-28 17:25:05 +01:00
Dan Poltawski acafcb18f5 Merge branch 'MDL-45594_m27' of git://github.com/markn86/moodle into MOODLE_27_STABLE 2014-07-28 12:54:17 +01:00
Dan Poltawski 71f4cb812c Merge branch 'wip-MDL-46503-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2014-07-28 12:49:15 +01:00
Dan Poltawski b1f78408a5 Merge branch 'm27_MDL-45715' of https://github.com/danmarsden/moodle into MOODLE_27_STABLE 2014-07-28 12:47:32 +01:00
Dan Poltawski 1669cf37f0 Merge branch 'MDL-46459_27' of git://github.com/jleyva/moodle into MOODLE_27_STABLE 2014-07-28 11:59:03 +01:00
Dan Poltawski 71e7387f43 Merge branch 'MDL-46433-27' of git://github.com/lameze/moodle into MOODLE_27_STABLE 2014-07-28 11:49:38 +01:00
Dan Poltawski 4eb9f7dd72 Merge branch 'MDL-46504_27' of git://github.com/dmonllao/moodle into MOODLE_27_STABLE 2014-07-28 10:56:43 +01:00
Nobelium 568e9560af MDL-46236 mod_scorm : Setting lauch options for scorm in popup 2014-07-28 06:41:40 +00:00
Sam Hemelryk dc7fe6acca Merge branch 'wip_MDL-46449_m27_loginblock' of https://github.com/skodak/moodle into MOODLE_27_STABLE 2014-07-28 13:25:19 +12:00
Sam Hemelryk 786a6227d0 Merge branch 'MDL-43390_27' of git://github.com/dmonllao/moodle into MOODLE_27_STABLE 2014-07-28 12:22:51 +12:00
Sam Hemelryk fd9ee7dd8b Merge branch 'wip-MDL-46525-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2014-07-28 12:13:53 +12:00
Sam Hemelryk 8ba664e245 Merge branch 'MDL-46506-27' of git://github.com/damyon/moodle into MOODLE_27_STABLE 2014-07-28 08:46:11 +12:00
Juan Leyva b88a31a654 MDL-45041 Web Service: add_user_device doesn't store entries for different users using the same push key 2014-07-25 10:40:08 +02:00
Juan Leyva 76dc0848c1 MDL-46460 Web Services: Invalid check of grades visibility for missing grades 2014-07-25 10:20:44 +02:00
Juan Leyva c838cb15d8 MDL-46459 Web Services: Incorrect return parameters get_grades external function 2014-07-25 09:31:43 +02:00
Damyon Wiese 3b1fec6fb2 MDL-46485 Assign: Fix when submitting to a group assignment from the default group 2014-07-25 15:20:36 +08:00
Damyon Wiese 4939d0d71a MDL-46485 Assign: New unit test to show error with group submission 2014-07-25 15:20:36 +08:00
Marina Glancy d61604b455 MDL-46525 enrol_cohort: fix JS error 2014-07-25 14:45:22 +08:00
Jason Fowler ec085021f2 MDL-46206 Accessibility: Add aria role to footer image 2014-07-25 14:36:06 +08:00
Brian Barnes 4c6481694e MDL-46325 behat: Fixed issue where 'teacher1' didn't exist 2014-07-25 15:44:26 +12:00
AMOS bot fdeb6af76e Automatically generated installer lang files 2014-07-24 22:41:56 +00:00
Petr Skoda ee7af1e19d MDL-46449 fix username prompt in login block when authloginviaemail enabled 2014-07-25 10:10:54 +12:00
Tony Butler 7561f3d64a MDL-43908 mod_assign: Order submissions by course id then cm id
Signed-off-by: Tony Butler <tonyjbutler@gmail.com>
2014-07-24 17:30:18 +01:00
Tony Butler a65c0da40d MDL-43908 mod_assign: Remove redundant code and improve SQL query
Signed-off-by: Tony Butler <tonyjbutler@gmail.com>
2014-07-24 17:30:09 +01:00
Tony Butler 1e07291026 MDL-43908 mod_assign: Prevent notifications for unavailable assignments
Signed-off-by: Tony Butler <tonyjbutler@gmail.com>
2014-07-24 17:29:59 +01:00
Tony Butler 1215c112c0 MDL-43908 mod_assign: Defer notifications for unavailable assignments
Signed-off-by: Tony Butler <tonyjbutler@gmail.com>
2014-07-24 17:29:40 +01:00
Daniel Thies 0e37d94b67 MDL-45044 filter_tex: properly escape excutable pathnames for Windows 2014-07-24 11:05:00 -05:00
uhunkler 3264dcece0 MDL-46302 correct atto img float right
Correct the atto image "float right" margin CSS
2014-07-24 17:24:37 +02:00
Dan Poltawski cc1dc858c0 weekly release 2.7.1+ 2014-07-24 09:51:04 +01:00
Dan Poltawski 6ca7efb157 Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2014-07-24 09:51:01 +01:00
Damyon Wiese 72d49e8419 MDL-46506 Assign: fix php warning on grant extension page
This code was missed when the extensionduedate was moved to the userflags table.
2014-07-24 11:26:23 +08:00
David Monllao cd2f4a87a4 MDL-46504 libraries: Fixing typo 2014-07-24 11:16:44 +08:00
Damyon Wiese b8ba7f3619 MDL-46017 Assign: Restore can't rely allocated marker fields existing in backup 2014-07-24 10:57:26 +08:00
Marina Glancy aa8ae42d24 MDL-46503 behat: cohort generator allows to create cohort in category 2014-07-24 10:04:12 +08:00
Mark Nelson 1c7509bc86 MDL-45594 core_message: added unit tests 2014-07-23 16:40:25 -07:00
Mark Nelson 7ed94cbe9c MDL-45594 core_message: ordered recent notifications by timecreated 2014-07-23 16:40:25 -07:00
Tim Hunt 7c7d086ae1 MDL-45594 simplify message_get_recent_conversations SQL
I am pretty sure that this new SQL is logically equivalent to
the original, and it passes Mark's unit tests. However, it is
hard to be 100% sure.
2014-07-23 16:40:25 -07:00
AMOS bot 725ce55546 Automatically generated installer lang files 2014-07-23 22:46:16 +00:00
Simey Lameze 1f55a12bf8 MDL-46433 blog: fix error message when creating an external blog 2014-07-23 16:12:05 +08:00
Dan Poltawski ee0f0b3986 Revert "Merge branch 'MDL-45594_m27' of git://github.com/markn86/moodle into MOODLE_27_STABLE"
This reverts commit 0cc8a0b4b2, reversing
changes made to 6d32f6300e.
2014-07-23 09:02:02 +01:00
Dan Poltawski 92d4bcd9f7 Merge branch 'MDL-46017-27' of git://github.com/damyon/moodle into MOODLE_27_STABLE 2014-07-23 08:24:26 +01:00
Dan Marsden e7215ce5b7 MDL-45715 assign: disable marking allocation if markingworkflow is not set. 2014-07-23 19:21:30 +12:00
Sam Hemelryk 6dc0b5482b MDL-45724 cache: fixed warning structure bug 2014-07-23 15:24:35 +12:00
AMOS bot 45d7ec6123 Automatically generated installer lang files 2014-07-22 22:49:11 +00:00
Dan Poltawski a7e348e937 Merge branch 'MDL-37509-27' of git://github.com/damyon/moodle into MOODLE_27_STABLE 2014-07-22 15:56:58 +01:00
Dan Poltawski eba7490c31 Merge branch 'MDL-34248_m27' of https://github.com/markn86/moodle into MOODLE_27_STABLE 2014-07-22 12:01:04 +01:00
Dan Poltawski a4798ada52 Merge branch '45724-27' of git://github.com/samhemelryk/moodle into MOODLE_27_STABLE 2014-07-22 09:07:25 +01:00
Sam Hemelryk 0cc8a0b4b2 Merge branch 'MDL-45594_m27' of git://github.com/markn86/moodle into MOODLE_27_STABLE 2014-07-22 11:12:17 +12:00
Sam Hemelryk 6d32f6300e Merge branch 'MDL-43063-27' of git://github.com/lameze/moodle into MOODLE_27_STABLE 2014-07-22 09:49:10 +12:00
Dan Poltawski 08348b8f86 Merge branch 'MDL-46386-27' of https://github.com/merrill-oakland/moodle into MOODLE_27_STABLE 2014-07-21 14:11:46 +01:00
Eric Merrill 519eec044c MDL-46386 question Whitelist the Atto editor from return blocking
Prevent the question engine from blocking return/enter key presses
from being sent to the Atto editor.
2014-07-21 09:08:52 -04:00
Dan Poltawski ab156686ff Merge branch '46335-27' of git://github.com/samhemelryk/moodle into MOODLE_27_STABLE 2014-07-21 09:59:06 +01:00
Dan Poltawski 1fc8ebf085 Merge branch 'MDL-46370_27' of https://github.com/moodlerooms/moodle into MOODLE_27_STABLE 2014-07-21 09:54:57 +01:00
Damyon Wiese 0086364857 MDL-46017 Assign: Fix restore of marking workflow data 2014-07-21 16:38:21 +08:00
Damyon Wiese 05cc5bf052 MDL-37509 Assign: Do not put description in calendar before it should be shown to students 2014-07-21 15:58:08 +08:00
Simey Lameze 8bd3dfd6f5 MDL-43063 core: fix phpdoc comment codechecker issue. 2014-07-21 10:14:12 +08:00
Julien Boulen 1c9e079b7c MDL-46206 Accessibility: Remove alt attribute for footer image 2014-07-21 08:21:06 +08:00
Sam Hemelryk 8b90e93c94 MDL-42909 course: fixed whitespace 2014-07-21 11:43:04 +12:00
Sam Hemelryk 94f0349745 Merge branch 'MDL-42909-27' of git://github.com/phalacee/moodle into MOODLE_27_STABLE 2014-07-21 11:35:54 +12:00
David Balch 50cc7daa0f MDL-40479 mod_assign: Fix the colour of grading success messages. 2014-07-21 11:33:04 +12:00
Brian Barnes 0a841ac85c MDL-46406 core_auth: Placed remember username before submit login form 2014-07-21 11:22:22 +12:00
Sam Hemelryk 28d6752d07 Merge branch 'mdl-46427-m27' of git://github.com/deraadt/moodle into MOODLE_27_STABLE 2014-07-21 11:12:11 +12:00
Willy Lee 1d0f235097 MDL-46159 course: Add search box to course management pages 2014-07-21 10:56:22 +12:00
Sam Hemelryk 93d7596d3f Merge branch 'MDL-45339-27' of git://github.com/xow/moodle into MOODLE_27_STABLE 2014-07-21 10:49:33 +12:00
Sam Hemelryk aa9f17df92 Merge branch 'm27_MDL-46363' of https://github.com/danmarsden/moodle into MOODLE_27_STABLE 2014-07-21 10:45:43 +12:00
Sam Hemelryk d251180b31 MDL-45724 cache: added cache API warnings to the admin notifications page 2014-07-21 09:48:54 +12:00
Sam Hemelryk 67a77fa36f MDL-45724 cache: admin screen now shows store warnings
Implemented a means by which cache store instance can communicate
warnings due to things such as conflicting configurations etc.
2014-07-21 09:39:15 +12:00
AMOS bot c3cf035fad Automatically generated installer lang files 2014-07-20 00:44:24 +00:00
AMOS bot 8a52ccea0c Automatically generated installer lang files 2014-07-19 00:41:49 +00:00
Michael de Raadt d35f49ba45 MDL-46427 Course: Correcting dimmed course link class on profile pages. 2014-07-18 15:43:05 +08:00
Jason Fowler 38748c6ada MDL-42909 Course: Fix title for move-targets 2014-07-18 14:43:10 +08:00
Mark Nelson 68fb3969e1 MDL-34248 core_backup: used API instead of inserting into the log table directly 2014-07-17 18:12:01 -07:00
Mark Nelson 527afcfb8c MDL-34248 core_backup: added missing end quotation 2014-07-17 18:12:00 -07:00
Jim Thorpe c62f8bc71f enrol_imsenterprise: MDL-46363 including course lib when create_course is
used
2014-07-18 11:27:15 +12:00
Sam Hemelryk d3c034f8e8 MDL-46335 backup: fixed casting issue with setting labels
The issue was that clean_param took an int and returned a string
and the result was used in an exact comparison.
The type change mean the comparison failed.
The solution was to ensure the param was cast as a string.
2014-07-18 08:29:53 +12:00
John Okely 5f399d0c52 MDL-45339 Libraries: Add a note to docblock of get_config, set_config, and unset_config to note they are used in lib/db/upgrade.php 2014-07-17 17:48:14 +08:00
Dan Poltawski a9e0505fde weekly release 2.7.1+ 2014-07-17 09:22:55 +01:00
Dan Poltawski 96d73266ef Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2014-07-17 09:22:51 +01:00
AMOS bot 66a0fea650 Automatically generated installer lang files 2014-07-17 00:52:51 +00:00
AMOS bot a4bba406ad Automatically generated installer lang files 2014-07-17 00:52:51 +00:00
Mark Nelson 20914ba26a MDL-45594 core_message: added unit tests 2014-07-16 17:06:39 -07:00
Mark Nelson 8b5520877b MDL-45594 core_message: ordered recent notifications by timecreated 2014-07-16 17:06:39 -07:00
Tim Hunt 7cacba3db3 MDL-45594 simplify message_get_recent_conversations SQL
I am pretty sure that this new SQL is logically equivalent to
the original, and it passes Mark's unit tests. However, it is
hard to be 100% sure.
2014-07-16 17:06:39 -07:00
Sam Chaffee f4c37747dc MDL-46370 Ajax and Javascript - Fixes docked blocks not expanding when using dock on right 2014-07-16 12:04:50 -06:00
Dan Poltawski 3e65f72a40 Revert "MDL-46226 core: pix_icon no longer sets title to the alt text"
This reverts commit 956ec418c6.
2014-07-16 13:45:35 +01:00
Dan Poltawski d613a0db57 Revert "MDL-46226 fix unit tests"
This reverts commit d927f222a9.
2014-07-16 13:45:32 +01:00
Rajesh Taneja 26f004f29b MDL-30431 behat: Fixed wiki behat 2014-07-16 09:18:51 +02:00
Eloy Lafuente (stronk7) 0ed87e5063 MDL-30431 mod_wiki: whitespace fix 2014-07-16 01:19:36 +02:00
Eloy Lafuente (stronk7) 87cc899c44 Merge branch 'MDL-30431_wiki_comments_27' of https://github.com/andyjdavis/moodle into MOODLE_27_STABLE 2014-07-16 01:16:19 +02:00
AMOS bot e1661a6346 Automatically generated installer lang files 2014-07-15 00:46:33 +00:00
Eloy Lafuente (stronk7) 3ba2b5c925 Merge branch 'MDL-46080_27' of https://github.com/jonof/moodle into MOODLE_27_STABLE 2014-07-14 23:30:25 +02:00
Sam Hemelryk 7c5d28c26c Merge branch 'MDL-42179-003-27' of https://github.com/dbezborodovrp/moodle into MOODLE_27_STABLE 2014-07-15 08:41:31 +12:00
Eloy Lafuente (stronk7) 67711964d1 Merge branch 'm27_MDL-31366' of git://github.com/danmarsden/moodle into MOODLE_27_STABLE 2014-07-14 18:17:44 +02:00
Dan Poltawski bf394372d8 Merge branch 'MDL-42752-27' of git://github.com/phalacee/moodle into MOODLE_27_STABLE 2014-07-14 16:09:29 +01:00
Dan Poltawski d927f222a9 MDL-46226 fix unit tests 2014-07-14 15:49:20 +01:00
Dan Poltawski bbcbbcd130 Merge branch 'MDL-46218_disabled2_27' of https://github.com/andyjdavis/moodle into MOODLE_27_STABLE 2014-07-14 15:33:13 +01:00
Eloy Lafuente (stronk7) cc0b20ba9d Merge branch 'm27_MDL-46197' of https://github.com/totara/moodle into MOODLE_27_STABLE 2014-07-14 16:25:21 +02:00
Dan Poltawski 8f15eebc22 Merge branch 'm27_MDL-46226' of https://github.com/totara/moodle into MOODLE_27_STABLE 2014-07-14 15:13:45 +01:00
Damien Bezborodov d8b6437fa9 MDL-42179 mod_assign: Time remaining issue for group assignment 2014-07-14 13:52:41 +09:30
David Monllao e257ad8372 MDL-43390 files: Only lock when locking is not prevented 2014-07-14 12:13:41 +08:00
Sam Hemelryk ba03dc18ad Merge branch 'MDL-42214_popup_blocked_27' of https://github.com/andyjdavis/moodle into MOODLE_27_STABLE 2014-07-14 15:27:46 +12:00
Sam Hemelryk 7c15d3b34c Merge branch 'MDL-46073_27' of https://github.com/totara/openbadges into MOODLE_27_STABLE 2014-07-14 15:15:57 +12:00
Andrew Davis 1c76803ec1 MDL-42214 core_message:prevented popup notifications of messages from blocked users 2014-07-14 10:11:14 +08:00
Andrew Davis 5660ceba8d MDL-30431 mod_wiki: clarified the logic around editing and deleting wiki comments and added behat tests 2014-07-14 08:16:39 +08:00
Sam Hemelryk ae59c35eb9 Merge branch 'MDL-45765-moodle27' of https://github.com/StudiUM/moodle into MOODLE_27_STABLE 2014-07-14 12:09:50 +12:00
Sam Hemelryk 3c129829ce MDL-46138 post integratino phpdoc fixes 2014-07-14 10:50:42 +12:00
Sam Hemelryk 050720be90 Merge branch 'MDL-46138-27' of git://github.com/damyon/moodle into MOODLE_27_STABLE 2014-07-14 10:40:37 +12:00
Sam Hemelryk 7573d5ff21 Merge branch 'wip-MDL-46280-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2014-07-14 10:32:42 +12:00
Gilles-Philippe Leblanc b3656b26be MDL-22469 auth_cas: CAS module : parameter authCAS=NOCAS not properly handled 2014-07-14 10:21:48 +12:00
Sam Hemelryk 804c22b8f1 Merge branch 'MDL-31089_27' of git://github.com/dmonllao/moodle into MOODLE_27_STABLE 2014-07-14 09:51:39 +12:00
Sam Hemelryk 8716b6c89f Merge branch 'MDL-45562-27' of git://github.com/lameze/moodle into MOODLE_27_STABLE 2014-07-14 08:41:38 +12:00
Eloy Lafuente (stronk7) 8b3d19c2f5 Moodle release 2.7.1 2014-07-12 19:10:44 +02:00
David Monllao cf9ed67a4e MDL-31089 mod_forum: Filtering non-visible groups 2014-07-11 16:49:39 +08:00
Simey Lameze 417b6921d5 MDL-45562 blog: fixed issues when creating/editing an external blog. 2014-07-11 15:16:28 +08:00
Damyon Wiese f72a23d69b MDL-46138 tasks: The adhoc task is being too helpful with json_encoding/decoding. 2014-07-11 09:45:27 +08:00
Dan Marsden ca602b6beb MDL-31366 Feedback: decode htmlchars on output to excel 2014-07-11 13:28:59 +12:00
Brian Barnes 2b8647034a MDL-46197 core_calendar: Added label text to durations in minutes field 2014-07-11 09:09:10 +12:00
Brian Barnes 956ec418c6 MDL-46226 core: pix_icon no longer sets title to the alt text 2014-07-11 08:39:45 +12:00
Jean-Philippe Gaudreau 31d453f735 MDL-45765 Calendar import: Fix undefined variable in cron when updating calendar subscriptions 2014-07-10 16:09:04 -04:00
Eloy Lafuente (stronk7) b4d0a4479c weekly release 2.7+ 2014-07-10 19:15:41 +02:00
Eloy Lafuente (stronk7) 3e07b8a2f3 Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2014-07-10 19:15:37 +02:00
Ankit Agarwal 383776876b MDL-46148 qtype_calculated: low-level defence against bad formulas
This catches things like:
 * Malicious equations coming from backup files.
 * Malicious equations in old questions in the database.
2014-07-10 17:55:03 +08:00
Andrew Nicols 91c8d4da71 MDL-38990 mod_forum: Restrict ability to post to all groups in a forum
In order to post to all groups in a forum, you must have the
moodle/site:accessallgroups capability.

Thanks to Jakob Ackermann <jackermann@onlineschool.ca> for part of the fix
on this one.
2014-07-10 11:52:57 +08:00
Damyon Wiese 1721c8eb85 MDL-46148 questions: Added missing allow_commit for transaction 2014-07-10 11:36:57 +08:00
Andrew Davis ad3d9452bf MDL-46218 reshuffled access checks in blog and notes 2014-07-10 11:25:15 +08:00
Damyon Wiese c5f351435e Merge branch 'MDL-19270_moodle27stable' of https://github.com/nadavkav/moodle into MOODLE_27_STABLE
Conflicts:
	lib/graphlib.php
2014-07-10 09:58:44 +08:00
AMOS bot 03b06dedbc Automatically generated installer lang files 2014-07-10 00:47:09 +00:00
Tim Hunt da80885cc6 MDL-46148 qtype_calculatedsimple: fix notice
... when adding a dataset with a formula error.
2014-07-09 14:11:39 +01:00
Tim Hunt 94ac7a87fa MDL-46148 qtype_calculated: fix validation when importing.
In order to do this in a sane way, I cleaned up a lot of old mess,
inclduing:

1. Previously, qtype_calcuated used ->answeres when importing, and
->answer when saving the form. This was crazy, so I fixed it, and
stripped out the code that made the alternative variable name work.

2. Similarly, it could handle ->answer being either an array, such as
you would get form the HTML editor, or a simple string, which is what
you get form the form. I simplified that too.

3. Finally, I made import use a transaction around saving each
question, so we don't get half questions in the database when an error
occurs.
2014-07-09 14:11:38 +01:00
Tim Hunt 10b02d6d41 MDL-46148 qtype_calculated: removed unused method. 2014-07-09 14:11:38 +01:00
Nadav Kavalerchik ebb6f3e80b MDL-19270 - Quiz graph - Fix reverse display of Hebrew legend text in RTL mode 2014-07-09 16:07:56 +03:00
David Mudrák 7f4db6f4d9 MDL-46223 Fix frequently used comments in the marking guide
When the frequently used comment contains a character like >, re-use it
directly instead of its HTML entitiy.
2014-07-09 16:43:40 +08:00
David Mudrák 4fc5861cba MDL-46223 Improve the display of marking guide validation message 2014-07-09 16:43:37 +08:00
Dan Poltawski 40b205197c MDL-46227 fix typo 2014-07-09 08:23:14 +01:00
Dan Poltawski cb914a71aa MDL-44605 calendar: improved returnurl validation
Now we will only redirect to a local url (though sesskey was
already preventing this redirect from being open)
2014-07-09 01:06:35 +02:00
Eloy Lafuente (stronk7) 85f376892d Merge branch 'MDL-43849_27' of git://github.com/dmonllao/moodle into MOODLE_27_STABLE 2014-07-08 20:29:04 +02:00
Dan Poltawski e0708141f8 Merge branch 'MDL-45599-27-addons' of git://github.com/mudrd8mz/moodle into MOODLE_27_STABLE 2014-07-08 15:31:53 +01:00
Dan Poltawski 76b012d611 Merge branch 'MDL-44492_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-07-08 14:18:01 +01:00
Frederic Massart 53ca351f7a MDL-45471 javascript: Escape content of exception dialogs 2014-07-08 14:13:33 +01:00
Tim Hunt ea9f3057da MDL-44492 quiz: fix hilighting of graded attempt
In various places, when showing several attempts, we try to hilight the
most significant one (the one that gave the final grade if the quiz is
set to first/last/best attempt). That was not working because the table
zebra stripes were a more specific rule.

Also, the colour was inconsistent, not nice, and not very bootstrapy, so
I changed it.
2014-07-08 13:33:41 +01:00
Tim Hunt f1406d3b39 MDL-44492 quiz reports: revert some style overrides.
But add one more. This makes Clean theme look a lot better.
2014-07-08 13:33:38 +01:00
Tim Hunt 91251e4889 MDL-44492 Rough unit test for the report SQL.
We really ought to test more cases, but this hits one of the most tricky cases.
2014-07-08 13:33:36 +01:00
Tim Hunt 8994593332 MDL-44492 quiz reports: make show only graded attempt work.
It needs to only affect finished attempts, and the wording needs to be
modified to make it clear that is what it does.
2014-07-08 13:33:33 +01:00
Dan Poltawski 67b3704318 Merge branch 'MDL-45381_m27' of git://github.com/markn86/moodle into MOODLE_27_STABLE 2014-07-08 11:29:03 +01:00
Dan Poltawski 37e7d91b8c Merge branch 'MDL-45596-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-07-08 10:50:55 +01:00
Marina Glancy 3fe64cbd7d MDL-43948 forms: setting types to filemanager and editor elements 2014-07-08 10:47:35 +01:00
Dan Poltawski 22051a4e34 Merge branch 'MDL-46231-27-en_fix' of git://github.com/mudrd8mz/moodle into MOODLE_27_STABLE 2014-07-08 08:32:35 +01:00
Helen Foster e7cd680765 MDL-45599 Fix tiny grammatical errors in the plugin installer 2014-07-08 09:02:06 +02:00
Marina Glancy 84d2c6f761 Merge branch 'MDL-46229_27' of https://github.com/totara/openbadges into MOODLE_27_STABLE 2014-07-08 13:51:40 +08:00
Skylar Kelty f97581eda7 MDL-46227 Fix XSS in scheduled tasks 2014-07-08 13:38:01 +08:00
David Mudrák 2c0b608cda MDL-46223 Improve the marking guide output 2014-07-08 13:18:59 +08:00
David Mudrák eb1381de1d MDL-46223 Improve the rubric output 2014-07-08 13:18:58 +08:00
Marina Glancy c7bfbb01c6 MDL-46280 filter_activitynames: sort activities by length in reverse order 2014-07-08 10:55:25 +08:00
Sam Hemelryk 4eacb77012 Merge branch 'MDL-46016_m27' of https://github.com/markn86/moodle into MOODLE_27_STABLE 2014-07-08 14:28:02 +12:00
Sam Hemelryk 93835758f3 MDL-19270 core_text: added unit tests for strrev 2014-07-08 14:15:02 +12:00
Sam Hemelryk a238e7ed72 Merge branch 'MDL-19270_moodle27stable' of https://github.com/nadavkav/moodle into MOODLE_27_STABLE 2014-07-08 13:53:52 +12:00
Sam Hemelryk 98ac33bcb0 Merge branch 'MDL-46200-27' of git://github.com/danpoltawski/moodle into MOODLE_27_STABLE 2014-07-08 13:38:08 +12:00
Sam Hemelryk 0caa8c60d2 Merge branch 'mdl45982-moodle27' of https://github.com/tlock/moodle into MOODLE_27_STABLE 2014-07-08 13:26:58 +12:00
Sam Hemelryk 2dbdaedc3e Merge branch 'm27_MDL-46144' of https://github.com/totara/moodle into MOODLE_27_STABLE 2014-07-08 13:10:36 +12:00
Eloy Lafuente (stronk7) 30a264540b Merge branch '46208-27' of git://github.com/samhemelryk/moodle into MOODLE_27_STABLE 2014-07-08 02:13:44 +02:00
Sam Hemelryk 6d05bee940 Merge branch 'MDL-46212_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-07-08 10:45:01 +12:00
Sam Hemelryk 2535dfaf64 Merge branch 'MDL-46240-27' of git://github.com/danpoltawski/moodle into MOODLE_27_STABLE 2014-07-08 10:34:30 +12:00
Eloy Lafuente (stronk7) 35186e3725 Merge branch 'wip_MDL-45945_m27_mssqlcol' of https://github.com/skodak/moodle into MOODLE_27_STABLE 2014-07-08 00:32:09 +02:00
Sam Hemelryk bfe4417cb7 MDL-45678 cache: renamed new cache and better comments 2014-07-08 09:52:53 +12:00
Sam Hemelryk 6b6affec1f Merge branch 'MDL-45678-006-27' of https://github.com/dbezborodovrp/moodle into MOODLE_27_STABLE 2014-07-08 09:42:51 +12:00
Sam Hemelryk 9e13649c89 Merge branch 'wip_MDL-46126_m27_passnulls' of https://github.com/skodak/moodle into MOODLE_27_STABLE 2014-07-08 09:37:20 +12:00
Yuliya Bozhko 1465b22f7d MDL-46073 badges: Make sure html tags are not used in badge description
Signed-off-by: Yuliya Bozhko <yuliya.bozhko@totaralms.com>
2014-07-08 09:36:21 +12:00
Sam Hemelryk f549deed15 Merge branch 'MDL-43347-27' of https://github.com/mackensen/moodle into MOODLE_27_STABLE 2014-07-08 09:28:31 +12:00
Adrian Greeve ab59b7db71 MDL-46201 events: Sanitization of username before returning the description. 2014-07-07 18:19:11 +01:00
Yuliya Bozhko 200a2b7fad MDL-46042 badges: Clean up external badge data
Signed-off-by: Yuliya Bozhko <yuliya.bozhko@totaralms.com>
2014-07-07 16:37:44 +01:00
Dan Poltawski 9945bcec41 Merge branch 'MDL-42393-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-07-07 16:27:32 +01:00
Dan Poltawski b4ac5653ed Merge branch 'MDL-41389_m27' of https://github.com/markn86/moodle into MOODLE_27_STABLE 2014-07-07 16:10:26 +01:00
Osanda Malith Jayathissa 0207466e77 MDL-45683 user: Escaping Skype ID used in profile 2014-07-07 16:05:10 +01:00
Marina Glancy 2ca9e09dab MDL-45760 make sure to check permission before setting header 2014-07-07 15:06:40 +01:00
Tim Hunt 6eaf5ec8e3 MDL-46148 qtype_calculated: fix formula validation. 2014-07-07 14:34:02 +01:00
Frederic Massart 1d110af2d6 MDL-45417 mod_imscp: Prevent entity injections from package content 2014-07-07 13:03:05 +01:00
Frederic Massart 2d121036cc MDL-45463 mod_lti: Prevent XML entity injections from provider 2014-07-07 13:00:39 +01:00
Marina Glancy 61961447c2 MDL-45616 repositories: use json encoding instead of serialization 2014-07-07 15:17:42 +08:00
Marina Glancy 867f40990b MDL-45616 repositories: more clearly distinguish when we use source and when reference
Function repository::get_moodle_file() should always be called on packed reference and not on the source received from user.
Also added phpdocs to some other methods that were confusing source and reference
2014-07-07 15:17:42 +08:00
Jason Fowler da6ce47102 MDL-42752 File-picker: Fix tabbing to disabled icons 2014-07-07 14:30:17 +08:00
Dan Poltawski 78ba7d9e6b MDL-43848 messages: do not display message content in popups
The user is not in control of when these popups show up and it
may not be appropiate to have part of this content display whilst
in the presence of other users.
2014-07-07 13:46:35 +08:00
Nadav Kavalerchik 63010978b4 MDL-19270 - Quiz graph - Fix reverse display of Hebrew legend text in RTL mode 2014-07-06 19:00:23 +03:00
Helen Foster c5e9bc48f0 MDL-46231 Merge English strings from the en_fix language pack 2014-07-04 22:37:30 +02:00
Dan Poltawski cd90445d4a MDL-46200 fix missing space in failed login message 2014-07-04 14:55:43 +01:00
Dan Poltawski 0052796dbb MDL-46240 atto_collapse: fix icon url 2014-07-04 14:35:16 +01:00
David Mudrák b522356839 MDL-45599 Stop using the 'add-on' term
We now call them all as just 'plugins' for consistency. There where we need to
explicitly distinguish the source of the plugin, we say they are 'additional
plugins' on contrary to 'standards plugins' coming with the core.
2014-07-04 11:34:34 +02:00
David Mudrák 1d45b926f3 MDL-45599 Remove string editingnoncorelangfile from core_admin
This string mentions 'add-on' and has been greylisted in AMOS since 2.0. The
usage of it was removed in 00b41d.
2014-07-04 10:36:53 +02:00
Damien Bezborodov 0ba5f02b15 MDL-45678 assignsubmission_comments: Improve performance for permissions checking 2014-07-04 14:25:06 +09:30
Petr Skoda a31fdfb145 MDL-46126 upgrade: fix bogus nulls in user.password before changing precission
Note: there is no need to deal with Oracle empty strings here
because only MySQL running in non-strict mode is affected.
2014-07-04 16:29:40 +12:00
Frederic Massart d019ffd21f MDL-45596 roles: Escape filter value before using it in form field 2014-07-04 11:49:42 +08:00
Mark Nelson a93f8344ae MDL-41389 auth_db: added unit tests for events 2014-07-03 20:16:56 -07:00
Petr Skoda 2d7617aa18 MDL-45945 mssql: force default database collation in all tables including temp table 2014-07-04 15:05:24 +12:00
AMOS bot 84acc68175 Automatically generated installer lang files 2014-07-04 00:44:19 +00:00
Mark Nelson 38d8b7b703 MDL-46016 auth_shibboleth: updated misleading comment
Also generated a random string for the password field in case it is ever used.
2014-07-03 16:15:57 -07:00
Mark Nelson 69ddeb42e2 MDL-41389 auth_db: added user_updated/created event triggers 2014-07-03 14:28:44 -07:00
Sam Hemelryk 2bd9cd1077 MDL-46208 cachestore_mongo: fixed invalid collection name use 2014-07-04 08:11:24 +12:00
Tim Hunt 35588aa876 MDL-46212 question editing: extra answer fields notice.
It turns out that PHP does not interpret "$field[$key]" the way we were
expecting.
2014-07-03 13:40:38 +01:00
Dan Poltawski fc415ee908 weekly release 2.7+ 2014-07-03 10:53:27 +01:00
Dan Poltawski 10b4bda916 Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2014-07-03 10:53:24 +01:00
Marina Glancy 3708e1bb7c MDL-46163 question/quiz: fix elements ids and their labels 2014-07-03 10:13:23 +01:00
David Monllao e7e79055e1 MDL-43849 enrol_meta: Renaming methods according to what they test 2014-07-03 14:51:00 +08:00
David Monllao 3d4cf404df MDL-43849 mod_forum: Adding tests for observers 2014-07-03 14:50:52 +08:00
Frederic Massart 31c0efeac7 MDL-42393 calendar: Preventing open/close loop in events overlay 2014-07-03 10:17:41 +08:00
Yuliya Bozhko 3571cd46d2 MDL-46229 badges: Fix missing additional names fields
Signed-off-by: Yuliya Bozhko <yuliya.bozhko@totaralms.com>
2014-07-03 09:33:27 +12:00
Tim Hunt fa6db7b8c1 MDL-46163 quiz/questions: fix missing hidden fields.
I have done this by eliminating the duplication between the base class
and the subclass.

This was a regression introdcued by MDL-40313.
2014-07-02 15:04:56 +01:00
AMOS bot 947a90339a Automatically generated installer lang files 2014-07-02 00:44:40 +00:00
Eloy Lafuente (stronk7) dc30afaafc Merge branch 'wip-mdl-45889-m27' of https://github.com/rajeshtaneja/moodle into MOODLE_27_STABLE 2014-07-02 00:36:26 +02:00
Eloy Lafuente (stronk7) 03a5278a38 Merge branch '45209-27' of git://github.com/samhemelryk/moodle into MOODLE_27_STABLE 2014-07-01 23:49:46 +02:00
Sam Hemelryk d683942c6a Merge branch 'wip-MDL-46147-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2014-07-02 09:31:25 +12:00
Mary Evans 24c0432bbc MDL-45507 theme_bootstrapbase: Fix regression for theme based custom menu
in renderers/core_renderer.php.
2014-07-02 09:22:43 +12:00
Eloy Lafuente (stronk7) c16de45a14 MDL-45961 user profile: track user on reset
It seems that redirect (after reset button) was also
missing the userid so the user track was lost.
2014-07-01 19:22:14 +02:00
Eloy Lafuente (stronk7) 9d19781014 Merge branch 'MDL-45961_MOODLE_27_STABLE' of https://github.com/NeillM/moodle into MOODLE_27_STABLE 2014-07-01 19:22:05 +02:00
Dan Poltawski ab6ae906cd Merge branch 'MDL-46063_27' of git://github.com/schach/moodle into MOODLE_27_STABLE 2014-07-01 17:29:16 +01:00
Dan Poltawski f45b59d427 Merge branch 'MDL-46036_survey_27' of https://github.com/andyjdavis/moodle into MOODLE_27_STABLE 2014-07-01 16:34:29 +01:00
Charles Fulton 3add7d878f MDL-43347 grades: convert keep highest to text field 2014-07-01 07:34:23 -07:00
Charles Fulton c9bd902bd3 MDL-43347 grades: consistent interface for drop lowest setting 2014-07-01 07:34:11 -07:00
Dan Poltawski 366124d222 Merge branch 'MDL-46107_27' of https://github.com/totara/openbadges into MOODLE_27_STABLE 2014-07-01 14:20:53 +01:00
Dan Poltawski 89203e11a7 Merge branch 'MDL-4013-stable27' of https://github.com/MorrisR2/moodle into MOODLE_27_STABLE 2014-07-01 14:16:22 +01:00
Dan Poltawski dd83fbfbbc Merge branch 'wip_MDL-46099_m27_userglobal' of https://github.com/skodak/moodle into MOODLE_27_STABLE 2014-07-01 10:39:15 +01:00
Marina Glancy 1fb374121a MDL-46147 modinfo: performance improvement for course page (check filterall) 2014-07-01 15:30:28 +08:00
Damyon Wiese f3163a2002 MDL-46147 modinfo: performance improvement for course page
This is a big win in a specific situation, ie filters enabled for content+headings,
and no activity descriptions visible on the course page.
2014-07-01 15:30:22 +08:00
Mark Nelson 65764352dd MDL-45381 mod_forum: updated unit tests for subscription created/deleted events 2014-06-30 23:35:37 -07:00
Mark Nelson 2c7b800f2f MDL-45381 mod_forum: changed event URL for subscription created/deleted events 2014-06-30 23:35:36 -07:00
Brian Barnes ed7d676329 MDL-46144 core_calendar:Fixed label linking in calendar 2014-07-01 13:44:56 +12:00
Sam Hemelryk b23bc0a148 Merge branch 'MDL-40805-27' of git://github.com/lameze/moodle into MOODLE_27_STABLE 2014-07-01 09:06:20 +12:00
Petr Skoda df9a669791 MDL-46099 session: fix use of references for session globals
This reverses the references used for global $USER and $SESSION,
the reason is that PHP does not allow references to references.
$USER is a reference to $GLOBALS['USER'] which means we cannot
put any references to it. Solution is to store the current user and session
objects in $GLOBALS['USER'] and $GLOBALS['SESSIOn'] are reference
them in $_SESSION.

This patch makes the session code behave the same way in CLI,
phpunit and normal web requests - this allows use to finally
unit test most aspects of the session code in Moodle.
2014-07-01 08:38:10 +12:00
Sam Hemelryk b1ab535efa Merge branch 'MDL-46118_27' of git://github.com/dmonllao/moodle into MOODLE_27_STABLE 2014-07-01 08:33:16 +12:00
Dan Poltawski 1e9dce0df4 Merge branch 'wip-mdl-45641-m27' of https://github.com/rajeshtaneja/moodle into MOODLE_27_STABLE 2014-06-30 15:26:34 +01:00
Dan Poltawski 8dd0756226 Merge branch 'MDL-42467_database_27' of https://github.com/andyjdavis/moodle into MOODLE_27_STABLE 2014-06-30 15:09:53 +01:00
Dan Poltawski 8458e3d2c2 Merge branch 'MDL-45833_27' of git://github.com/dmonllao/moodle into MOODLE_27_STABLE 2014-06-30 13:27:16 +01:00
Dan Poltawski 951a64f6ef Merge branch 'MDL-46044-27' of git://github.com/damyon/moodle into MOODLE_27_STABLE 2014-06-30 11:45:29 +01:00
Heiko Schach b336cf98b4 MDL-46063 feedback: Fix user pictures 2014-06-30 13:27:39 +03:00
Dan Poltawski b6ac868d71 Merge branch 'MDL-40228-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-06-30 08:55:39 +01:00
AMOS bot 57ce05c631 Automatically generated installer lang files 2014-06-29 00:42:51 +00:00
Ray Morris f0538cee92 MDL-4013 Question bank: Category selector renders as nested form (invalid html) 2014-06-27 10:00:11 -05:00
NeillM f4f4965a1c MDL-45961 Customise this page button on user profile page only works correctly for users own profile 2014-06-27 09:05:49 +01:00
Rajesh Taneja 93a593daab MDL-45641 event: Ldap user_signup unit test added 2014-06-27 15:43:49 +08:00
Rajesh Taneja c8c1a2cb10 MDL-45641 event: Manually trigger event where needed.
Some places, user_created_user and user_updated_user
events should be triggred after profile data is saved.
2014-06-27 15:43:49 +08:00
Rajesh Taneja 793ab11d95 MDL-45641 event: Removed multiple user_updated event trigger
user_updated event was being triggred while
setting password, which is not correct. It now
trigger user_password_updated event. Few more
modifications done:
1. Correct event is being triggred.
2. Event is only triggred when password is chnaged.
3. Password is updated via single api.
4. Updated unit test
2014-06-27 15:43:49 +08:00
Rajesh Taneja 47221d5fdd MDL-45641 event: Option to trigger user event manually
On some pages full user data is not stored before user_created/
user_updated event is triggred. So giving option to trigger that
manually, so it can be triggred after all data is saved
2014-06-27 15:43:49 +08:00
Damyon Wiese 1affa3ea22 MDL-46044 Assign: Add conditions to the inner query for performance 2014-06-27 15:01:17 +08:00
Damyon Wiese 70971d43eb MDL-46044 Assign: Modify myhome query to only use the maxattempt from the submission
Using mismatches from the submissions/grades tables does not make much sense, we
should always only consider only the maxattempt from the submissions table.
2014-06-27 14:23:17 +08:00
Damyon Wiese 99e0bb23bf MDL-46044 Assign: Move common setup to setUp method (share it for all of lib_test.php) 2014-06-27 14:18:10 +08:00
Damyon Wiese d95453d903 MDL-46044 Assign: Fix print_overview function when there are multiple attempts 2014-06-27 14:17:53 +08:00
Damyon Wiese 53fb01aef0 MDL-46044 Assign: Update unit test to test multiple attempts on overview page 2014-06-27 14:17:44 +08:00
David Monllao cfd5ba4101 MDL-46118 report_log: No results limit when downloading 2014-06-27 11:35:06 +08:00
David Monllao 5eb386fd09 MDL-45833 event: Removing courseid as the context is higher than course context 2014-06-27 11:25:07 +08:00
Yuliya Bozhko 594848bb15 MDL-46107 badges: Fix badges navigation and remove empty breadcrumbs on pages using Clean
Signed-off-by: Yuliya Bozhko <yuliya.bozhko@totaralms.com>
2014-06-27 12:48:01 +12:00
Sam Hemelryk 64fea720ce MDL-45209 course: fixed navbar when creating,editing courses 2014-06-27 09:39:45 +12:00
Eloy Lafuente (stronk7) 83d08fcc21 weekly release 2.7+ 2014-06-26 10:35:58 +02:00
Eloy Lafuente (stronk7) 01e7204646 Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2014-06-26 10:35:54 +02:00
Eloy Lafuente (stronk7) 3152864fd5 Revert " MDL-45044 filter_tex: properly escape excutable pathnames for Windows"
This reverts commit 7eac026a02.
2014-06-26 10:05:49 +02:00
Rajesh Taneja 2997bd6dce MDL-45889 behat: Allow admin config to set by shortname 2014-06-26 13:18:32 +08:00
Andrew Davis 083d5a6f0c MDL-46036 mod_survey: added logic to prevent user trying to download when there are no results 2014-06-26 11:18:29 +08:00
Rajesh Taneja c1ee80fef5 MDL-46061 behat: Fixed blur event problem for atto_image
atto_image look for blur event after changing width/height
Added a new step to get focus off the element, so this can
work.
2014-06-26 10:29:35 +08:00
Andrew Davis 0a9815d14e MDL-42467 mod_data: added code to delete cached RSS feeds when database or glossary entries are deleted 2014-06-26 09:30:18 +08:00
Damyon Wiese 3ac5a3544c MDL-45983 Atto equation editor: Exclude phantomjs from this behat test because it's buggy 2014-06-25 15:05:01 +08:00
Jonathon Fowler b7cb9c60c1 MDL-46080 assign: fix offline grading worksheet marker column 2014-06-25 12:23:34 +10:00
AMOS bot 6f5ca6613f Automatically generated installer lang files 2014-06-25 00:45:27 +00:00
AMOS bot a16755314a Automatically generated installer lang files 2014-06-25 00:45:27 +00:00
Eloy Lafuente (stronk7) a4919abf4f Merge branch 'MDL-46079-m27' of https://github.com/sammarshallou/moodle into MOODLE_27_STABLE 2014-06-25 01:33:37 +02:00
Eloy Lafuente (stronk7) 022a58af8d Merge branch 'MDL-45445_m27' of https://github.com/markn86/moodle into MOODLE_27_STABLE 2014-06-25 00:47:43 +02:00
Eloy Lafuente (stronk7) 6480ec0c48 Merge branch 'MDL-41258-27' of git://github.com/andrewnicols/moodle into MOODLE_27_STABLE 2014-06-24 20:10:48 +02:00
Damyon Wiese 1e4e4a05d7 Merge branch 'MDL-45652_m27' of https://github.com/markn86/moodle into MOODLE_27_STABLE 2014-06-24 16:59:42 +08:00
Damyon Wiese 9dc9608795 Merge branch 'MDL-10115-27' of git://github.com/xow/moodle into MOODLE_27_STABLE 2014-06-24 16:03:53 +08:00
John Okely e08d290469 MDL-10115 User profile: Use title to aid in the ellipsis link being understood by screen readers 2014-06-24 15:38:58 +08:00
Marina Glancy 80bb90c3ca Merge branch 'MDL-45933-27' of git://github.com/damyon/moodle into MOODLE_27_STABLE 2014-06-24 13:52:42 +08:00
Marina Glancy a3ddcab336 Merge branch 'MDL-45983-27' of git://github.com/damyon/moodle into MOODLE_27_STABLE 2014-06-24 13:52:14 +08:00
Marina Glancy a839769c23 Merge branch 'MDL-46061-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-06-24 13:32:25 +08:00
Marina Glancy 1eb503b379 Merge branch 'MDL-45044-m27-master' of git://github.com/dthies/moodle into MOODLE_27_STABLE 2014-06-24 13:29:06 +08:00
Damyon Wiese cc5f8bd53f Merge branch 'wip-MDL-46038-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2014-06-24 13:10:52 +08:00
Damyon Wiese bb512f7c1f Merge branch 'MDL-46035_survey_27' of https://github.com/andyjdavis/moodle into MOODLE_27_STABLE 2014-06-24 13:08:17 +08:00
Damyon Wiese 5b5a73019d Merge branch 'MDL-46046-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-06-24 11:48:02 +08:00
Damyon Wiese ce0b9bb7ca Merge branch 'MDL-46056-27' of git://github.com/mudrd8mz/moodle into MOODLE_27_STABLE 2014-06-24 11:35:21 +08:00
Damyon Wiese 38063e7d1b Merge branch 'MDL-44512-27' of git://github.com/jethac/moodle into MOODLE_27_STABLE 2014-06-24 10:58:17 +08:00
Damyon Wiese ee5b9e137d Merge branch 'MDL-44773-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-06-24 10:19:16 +08:00
Eloy Lafuente (stronk7) 55103810f0 Merge branch 'MDL-45721_m27' of https://github.com/markn86/moodle into MOODLE_27_STABLE 2014-06-24 01:00:10 +02:00
Eloy Lafuente (stronk7) e5b111f26b Merge branch 'MDL-39883-27' of git://github.com/ankitagarwal/moodle into MOODLE_27_STABLE 2014-06-24 00:48:56 +02:00
Eloy Lafuente (stronk7) 7c2e2133cc Merge branch 'MDL-45764_generalTool_27' of https://github.com/moodlerooms/moodle into MOODLE_27_STABLE 2014-06-24 00:03:34 +02:00
Damyon Wiese 3352ffcfa2 Merge branch 'MDL-45580-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-06-23 15:20:14 +08:00
Simey Lameze 8e74bfa8e8 MDL-40805 auth_cas : Trigger user_loggedout event before CAS logout. 2014-06-23 15:19:07 +08:00
Frederic Massart 9f630b6cc4 MDL-45580 assignfeedback_editpdf: Save readonly version in backup 2014-06-23 14:56:08 +08:00
Frederic Massart c2779c9f29 MDL-45580 assignfeedback_editpdf: Delete draft content on new submission 2014-06-23 14:56:08 +08:00
Frederic Massart 7fecbba80b MDL-45580 assignfeedback_editpdf: Store a readonly version of the PDF 2014-06-23 14:56:08 +08:00
Damyon Wiese 80b81e5094 Merge branch '37145-27' of git://github.com/samhemelryk/moodle into MOODLE_27_STABLE 2014-06-23 14:39:56 +08:00
Damyon Wiese 6e977fcdd6 Merge branch 'MDL-38693-27' of git://github.com/jethac/moodle into MOODLE_27_STABLE 2014-06-23 14:15:36 +08:00
Damyon Wiese 9c8c5f2d01 MDL-41746 External api: Allow multiple calls to validate_context at different levels
(Only from webservices)
2014-06-23 13:39:21 +08:00
Damyon Wiese 9134f3f0df Merge branch 'MDL-35453_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-06-23 12:30:41 +08:00
Damyon Wiese b093752289 Merge branch 'MDL-46086_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-06-23 12:26:31 +08:00
Mark Nielsen bd87c3e225 MDL-46013 theme: Uninstall theme unconditionally unsets configs 2014-06-23 11:34:59 +08:00
Marina Glancy 7bea1ea240 Merge branch 'MDL-44124-27' of git://github.com/ankitagarwal/moodle into MOODLE_27_STABLE 2014-06-23 11:34:10 +08:00
Sam Hemelryk afd6e7d542 MDL-37145 caching: noted recommendation for dedicated memcache servers
Several reports have been made about the unexpected purging of entire
memcached servers when MUC is configured to use Memcache and caches
get purged.
This is expected and occurs because the memcache extenions don't
provide isolated containers. Moodle data is stored along side any other
data in the cache and when caches get purged all data gets removed
whether it belongs to Moodle or not.

The docs cover this point and here I've added notes about this to both
config-dist.php and cache/README.md
2014-06-23 11:01:51 +12:00
AMOS bot e29eef4bde Automatically generated installer lang files 2014-06-21 00:43:37 +00:00
Tim Hunt 63dd180030 MDL-46086 quiz: fix unit test on Oracle 2014-06-20 22:29:28 +01:00
Tim Hunt 8eacbd5a32 MDL-35453 quiz reports: don't order by id.
We were using ORDER BY id even though there was a perfectly good
attempt column to order the attempts by one user at one quiz.

Also, Oracle was complaining:
Debug info: ORA-01799: a column may not be outer-joined to a subquery
2014-06-20 16:55:35 +01:00
sam marshall 680ff52414 MDL-46079 Restore: Can run out of memory in get_records call 2014-06-20 14:14:53 +01:00
Frederic Massart 884e310a3b MDL-40228 backup: Settings were ignored during automated backups 2014-06-20 15:38:29 +08:00
Daniel Thies 7eac026a02 MDL-45044 filter_tex: properly escape excutable pathnames for Windows 2014-06-19 21:34:10 -05:00
Andrew Davis deaddfb6b8 MDL-46035 mod_survey: a string change to make an error message always correct 2014-06-20 09:17:47 +08:00
Frederic Massart 85b40b18d5 MDL-46061 atto_image: Improved tests to cover sizing feature 2014-06-19 16:00:47 +08:00
Frederic Massart 3b6987cea3 MDL-46061 atto_image: Prevent error when image does not have a size 2014-06-19 16:00:47 +08:00
Jetha Chan 14ff3d59b3 MDL-44512 themes: fix for custom menu submenu arrows on RTL languages 2014-06-19 15:16:52 +08:00
Damyon Wiese dd02a787d8 weekly release 2.7+ 2014-06-19 14:13:25 +08:00
Damyon Wiese cefe7c7f59 Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2014-06-19 14:13:20 +08:00
Frederic Massart d9fc73dc7a MDL-44773 atto_accessibilitychecker: Improved image test coverage 2014-06-19 13:38:36 +08:00
Frederic Massart 3bc1e345ca MDL-44773 atto_accessibilitychecker: Set focus on clicked warnings 2014-06-19 13:38:35 +08:00
AMOS bot 5d3fe21ab2 Automatically generated installer lang files 2014-06-19 00:42:51 +00:00
David Mudrák 17db3e8af1 MDL-46056 Remove invalid string definition from the workshop module
The correct version of the string is defined above.
2014-06-19 00:33:24 +02:00
Frederic Massart a0da864ac2 MDL-46046 atto_accessibilityhelper: Remove dead code from the plugin 2014-06-18 16:52:48 +08:00
Ankit Agarwal 0978aab839 MDL-39883 events: Trigger a module created event when duplicating a module 2014-06-18 16:02:23 +08:00
Ankit Agarwal 7d947ad66c MDL-39883 events: Create a new api create_from_cm for module create event 2014-06-18 15:46:26 +08:00
Damyon Wiese 5e63c8e57e MDL-45933 Assign: Prevent fatal error when there are no users in the grading table 2014-06-18 15:17:36 +08:00
Ankit Agarwal 34bcea8159 MDL-44124 libraries: Allow rrules with only one part during rrule validation checks 2014-06-18 14:14:49 +08:00
Marina Glancy 2a56e3c8b9 MDL-46038 repositories: added forgotten global 2014-06-18 13:39:43 +08:00
Mark Nelson 1fb1c6d456 MDL-45652 core_backup: display warning on restore destination form when necessary data is missing 2014-06-17 21:56:21 -07:00
Mark Nelson 469e7dd82d MDL-45721 core_backup: only trigger the course_restored event when restoring a course 2014-06-17 19:38:30 -07:00
AMOS bot 1461f9d664 Automatically generated installer lang files 2014-06-18 00:42:28 +00:00
Eloy Lafuente (stronk7) 8791525d88 Merge branch 'MDL-45978_27' of git://github.com/grabs/moodle into MOODLE_27_STABLE 2014-06-17 11:54:50 +02:00
Andrew Nicols a0f39f2b57 MDL-41258 Forum: Add additional unit tests for forum digest settings 2014-06-17 16:07:59 +08:00
Damyon Wiese 6fc2264a8a MDL-45983 Atto equation editor: Various bugs when editing an existing equation
(And a behat test for it).
2014-06-17 15:21:20 +08:00
Andreas Grabs 8893b111c2 MDL-45978 logging - added missing parameter id 2014-06-17 07:05:58 +02:00
Damyon Wiese 3362673173 MDL-45582 Editpdf: Prevent debugging when there is no pdf 2014-06-17 10:19:55 +08:00
Damyon Wiese 49703ecf1d Merge branch 'm27_MDL-45582' of git://github.com/greg-or/moodle-mod_assign into MOODLE_27_STABLE
Conflicts:
	mod/assign/feedback/editpdf/locallib.php
2014-06-17 10:17:55 +08:00
Eloy Lafuente (stronk7) d56f3531b4 Merge branch 'MDL-45970_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-06-17 01:15:47 +02:00
Eloy Lafuente (stronk7) 902a36137a Merge branch 'MDL-45611-27' of git://github.com/phalacee/moodle into MOODLE_27_STABLE
Conflicts:
	theme/bootstrapbase/style/moodle.css
2014-06-17 01:12:02 +02:00
Eloy Lafuente (stronk7) 19e4d5ada8 Merge branch 'wip-mdl-45719-m27' of https://github.com/deraadt/moodle into MOODLE_27_STABLE 2014-06-17 01:03:58 +02:00
Eloy Lafuente (stronk7) d81917322f Merge branch 'MDL-45870-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-06-17 00:51:33 +02:00
Marina Glancy b657f6db05 Merge branch 'MDL-45940-27' of git://github.com/damyon/moodle into MOODLE_27_STABLE 2014-06-16 17:28:30 +08:00
Marina Glancy abd980d36d Merge branch 'MDL-45901_Quiz_MOODLE-27-STABLE' of git://github.com/nadavkav/moodle into MOODLE_27_STABLE 2014-06-16 17:27:40 +08:00
Rajneel Totaram 7b27045680 MDL-45967 admin lang: Fix typo 2014-06-16 17:26:50 +08:00
Marina Glancy e4a56bd9dd Merge branch 'MDL-43274-27' of git://github.com/xow/moodle into MOODLE_27_STABLE 2014-06-16 17:24:10 +08:00
Jonathon Fowler 5807b224d9 MDL-42531 assign: refactor batch operations to use forms properly
Avoids a lot of ugly optional_param() use. Also fixes the
non-functional cancel buttons.
2014-06-16 16:43:54 +08:00
Gregory Faller 8b1596c257 MDL-45582: Apply grades and feedback to entire group does not work with Annotate PDF feature 2014-06-16 18:06:09 +09:30
John Okely 2649eefe1c MDL-43274 Course: Remove message about course logs from upgrade.txt 2014-06-16 16:23:51 +08:00
Damyon Wiese b3bb3a4422 MDL-45940 Assign: Improved access check
Call can_edit() instead of repeating a (slightly wrong) access check.
2014-06-16 16:20:34 +08:00
Damyon Wiese 6e10f195c5 Merge branch 'm27_MDL-45582' of git://github.com/greg-or/moodle-mod_assign into MOODLE_27_STABLE 2014-06-16 14:29:51 +08:00
Daniel Neis ab7c329acf MDL-35648 adding missing distinct selector in sql on participation report 2014-06-16 14:22:46 +08:00
Marina Glancy 95d39aabc7 Merge branch 'MDL-45935-27' of git://github.com/andrewnicols/moodle into MOODLE_27_STABLE 2014-06-16 14:22:42 +08:00
John Okely 6e515be94f MDL-10115 User profile: Use moodle_url and html_writer::link for course links on user profiles 2014-06-16 14:08:44 +08:00
Damyon Wiese b3b4f9a4a4 Merge branch 'MDL-31998_27' of git://github.com/grabs/moodle into MOODLE_27_STABLE 2014-06-16 12:07:40 +08:00
Gregory Faller c71d8267ed MDL-45582: Apply grades and feedback to entire group does not work with Annotate PDF feature 2014-06-16 12:44:23 +09:30
Damyon Wiese 1742e76777 Merge branch 'wip-mdl-46001-m27' of https://github.com/rajeshtaneja/moodle into MOODLE_27_STABLE 2014-06-16 11:13:45 +08:00
Rajesh Taneja 2797fcc75e MDL-46001 atto_clear: modfied behat test to work on xvfb 2014-06-16 11:10:29 +08:00
Damyon Wiese 2538e2dab1 Merge branch 'MDL-45803_m27' of https://github.com/markn86/moodle into MOODLE_27_STABLE 2014-06-16 11:01:04 +08:00
John Okely 6bf5eeed56 MDL-43274 Course: Remove ability to delete logs on a course during reset 2014-06-16 09:54:20 +08:00
AMOS bot c14d87daaa Automatically generated installer lang files 2014-06-15 00:42:44 +00:00
Nadav Kavalerchik cb201e866b MDL-45901 - Quiz - Random question category question are not visible, in RTL mode 2014-06-14 00:42:30 +03:00
Mark Nelson cc6a8bc792 MDL-45445 events: added '(optional)' to event params where applicable 2014-06-12 20:47:21 -07:00
Mark Nelson fa71841e9d MDL-45445 events: documented the additional validation 2014-06-12 20:47:21 -07:00
Mark Nelson be7809f5fd MDL-45445 events: added missing 'other' validation 2014-06-12 20:47:20 -07:00
Mark Nelson 655cdde2dc MDL-45445 events: added missing 'relateduserid' validation 2014-06-12 20:47:20 -07:00
Mark Nelson 7f75f1507e MDL-45445 events: trivial changes 2014-06-12 20:47:20 -07:00
Jason Fowler 3fbf089303 MDL-45611 Questions: Fixing the layout of the 'points box' 2014-06-13 10:24:20 +08:00
Tim Lock 8a453265d2 MDL-45982: Implement displaying of non error messages from a provider. 2014-06-13 10:13:57 +09:30
AMOS bot 807d45073a Merge branch 'MOODLE_27_STABLE' into install_27_STABLE 2014-06-13 00:41:59 +00:00
Andreas Grabs 253bbbb668 MDL-31998 mod_feedback - Feedback depend questions bug 2014-06-13 01:44:59 +02:00
Tim Hunt 8fbc1919df MDL-45970 quiz editing: fix display of random questions.
The pass by reference meant the function was clobbering the variable in
the calling function. Once that was change, it was not strictly
necessary to rename the variable in the function, but I did anyway for
clarity.

Thanks to Rajesh Taneja for finding the problem, and identifying which
bit of code was broken. I really just made the patch.
2014-06-12 19:43:42 +01:00
Eloy Lafuente (stronk7) c41ace2f7a weekly release 2.7+ 2014-06-12 18:59:06 +02:00
Eloy Lafuente (stronk7) 3be351cabc Merge branch 'MDL-44871-27' of git://github.com/damyon/moodle into MOODLE_27_STABLE 2014-06-12 11:38:37 +02:00
Damyon Wiese 53bd21e7d8 MDL-42835 Scorm: Fix for JS error because no nodes are selected in the toc. 2014-06-12 10:00:56 +02:00
John Okely 217530dfca MDL-10115 User profile: Allow full list of courses to be viewed on a user's profile 2014-06-12 15:03:27 +08:00
Rajesh Taneja 30271d87aa MDL-45808 enrol_self: Fixed behat to observe the group key policy 2014-06-12 14:20:37 +08:00
Damyon Wiese f271df32ec MDL-44871 Atto: Add missing tags to behat tests @editor and @editor_atto 2014-06-12 11:15:17 +08:00
Rajesh Taneja 77ae35faba MDL-44871 behat: Hack to make equation editor visible 2014-06-12 11:11:17 +08:00
Damyon Wiese 32d746479b MDL-44871 Atto behat: Use one less page load to get to profile edit page 2014-06-12 11:11:17 +08:00
Damyon Wiese b18fd23232 MDL-44871 Atto: Move custom select text step to atto specific step definition. 2014-06-12 11:11:17 +08:00
Damyon Wiese bbd644ea34 MDL-44871 Atto behat tests: Modified the tests to work around focus bugs with workspaces
The main changes here are that the "select the text in" step was modified to select only the
first text node in the editor field, and to focus on it's parent instead of the entire editable div.

Some tests had to be modified to match the new behaviour, and another "real" bug was found in the table plugin.
2014-06-12 11:11:17 +08:00
Damyon Wiese c4bfba91c2 MDL-44871 Behat: Add tests for Atto functionalities (some of them) 2014-06-12 11:11:17 +08:00
AMOS bot 6e7a7aecf3 Automatically generated installer lang files 2014-06-12 00:43:36 +00:00
Mark Nelson 635493f6dd MDL-45803 mod_quiz: removed the quiz_fire_attempt_started function
Also commented in mod/quiz/upgrade.txt to inform developers.
2014-06-11 13:57:24 -07:00
Mark Nelson 0f583e0c91 MDL-45803 mod_quiz: removed usage of the function quiz_fire_attempt_started_event 2014-06-11 13:57:24 -07:00
Mark Nelson 1a7ded8989 MDL-45803 mod_quiz: prevented the attempt_started event from being triggered twice 2014-06-11 13:57:23 -07:00
Mark Nelson 159e18c977 MDL-45803 mod_quiz: added attempt snapshot for the attempt and preview started events 2014-06-11 13:57:23 -07:00
Damyon Wiese 801dea3298 MDL-45763 Question types: Allow saving '0' as question text. 2014-06-11 17:29:26 +08:00
Marina Glancy d468b949f1 MDL-39726 backup: fix SQL syntax for Oracle 2014-06-11 17:16:40 +08:00
Marina Glancy a0881872c7 MDL-39726 backup: fix SQL syntax for Oracle 2014-06-11 12:17:25 +08:00
Marina Glancy a9e9cd31e1 MDL-45763 question: fix SQL syntax for Oracle 2014-06-11 12:17:25 +08:00
Frederic Massart 0085d95576 MDL-45870 mod_assign: Behat test covering some outcome usage 2014-06-11 10:34:44 +08:00
Frederic Massart e4226ddc26 MDL-45870 mod_assign: Outcomes are saved for each group member 2014-06-11 10:34:44 +08:00
Eloy Lafuente (stronk7) 4c7169437b Merge branch 'm27_MDL-29708_Typo_Extra_Slashes' of https://github.com/scara/moodle into MOODLE_27_STABLE 2014-06-11 01:36:56 +02:00
Frederic Massart b2cdd35a46 MDL-45808 group: Observe the group key policy upon group creation 2014-06-10 23:02:58 +02:00
Eloy Lafuente (stronk7) aa0fad65e3 Merge branch 'MDL-45579-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-06-10 22:25:54 +02:00
Eloy Lafuente (stronk7) 4c06cef684 Merge branch 'MDL-45418_27' of git://github.com/stronk7/moodle into MOODLE_27_STABLE 2014-06-10 20:13:28 +02:00
Barbara Ramiro 6871df272d MDL-45943: Replacement for publisher icons 2014-06-10 19:31:22 +02:00
Jason Fowler 40a4427420 MDL-45418 Files: Adding upgrade steps for publisher docs
Conflicts:
	lib/db/upgrade.php
	version.php
2014-06-10 19:31:04 +02:00
James McLean f76b5133a5 MDL-45418 Files: Adding publisher docs to Filetypes 2014-06-10 19:27:46 +02:00
Eric Merrill d5a7b7873e MDL-45763 question: Correct random question text if set to true or false 2014-06-10 20:08:25 +08:00
Marina Glancy ffa71ca45e Merge branch 'MDL-45813-scheduled_task_27' of git://github.com/mudrd8mz/moodle into MOODLE_27_STABLE 2014-06-10 15:42:56 +08:00
Marina Glancy 5248eb8831 Merge branch 'MDL-20154-27' of git://github.com/merrill-oakland/moodle into MOODLE_27_STABLE 2014-06-10 15:42:13 +08:00
Damyon Wiese 5468d02e60 Merge branch '45524-27' of git://github.com/samhemelryk/moodle into MOODLE_27_STABLE 2014-06-10 15:31:00 +08:00
Marina Glancy 251fd097bb Merge branch '27STABLE-wip-MDL45846' of git://github.com/jennymgray/moodle into MOODLE_27_STABLE 2014-06-10 14:20:02 +08:00
Daniel Neis Araujo 3ac721e5a3 MDL-45245 html_writer::select_time does not respect 5th parameter "attributes" 2014-06-10 14:19:29 +08:00
Damyon Wiese ecd99dc88a Merge branch 'wip-mdl-44309-m27' of https://github.com/deraadt/moodle into MOODLE_27_STABLE 2014-06-10 14:08:03 +08:00
Damyon Wiese 3097fca71c Merge branch 'MDL-45761-27' of https://github.com/merrill-oakland/moodle into MOODLE_27_STABLE 2014-06-10 14:00:58 +08:00
Damyon Wiese bc1c896692 Merge branch 'MDL-45767_returnInstanceid_27' of https://github.com/moodlerooms/moodle into MOODLE_27_STABLE 2014-06-10 13:53:43 +08:00
Damyon Wiese 6a927661f2 Merge branch 'MDL-45763-27' of https://github.com/merrill-oakland/moodle into MOODLE_27_STABLE 2014-06-10 13:12:07 +08:00
Andrew Nicols 601d32ae66 MDL-45935 tests: Specify step names during backup/restore tests 2014-06-10 12:14:09 +08:00
Michael de Raadt 2dde0b96da MDL-45719 mod_lti - Pass language strings to inline JS to allow for escaping 2014-06-10 11:39:12 +08:00
Eloy Lafuente (stronk7) d420bf952f Merge branch 'MDL-45789_m27' of https://github.com/markn86/moodle into MOODLE_27_STABLE 2014-06-10 01:17:00 +02:00
Eloy Lafuente (stronk7) a02d7831b6 Merge branch 'MDL-45804_m27' of https://github.com/markn86/moodle into MOODLE_27_STABLE 2014-06-10 01:14:29 +02:00
Jetha Chan 604db7d557 MDL-42782 usability: fix for extreme course page indenting 2014-06-10 01:10:31 +02:00
Nobelium 41ab96e7ff MDL-42835 mod_scorm: Close tree nodes using TreeView API 2014-06-10 00:37:16 +02:00
Eloy Lafuente (stronk7) 9dfb59fa28 Merge branch 'MDL-45574-m27' of https://github.com/sammarshallou/moodle into MOODLE_27_STABLE 2014-06-09 21:49:18 +02:00
Eloy Lafuente (stronk7) ad94e63238 Merge branch 'wip-MDL-44501-27' of git://github.com/abgreeve/moodle into MOODLE_27_STABLE 2014-06-09 18:59:22 +02:00
Jenny Gray 82c0485aab MDL-45846 Libraries custom user agent device detection unit test added 2014-06-09 13:59:10 +01:00
Eloy Lafuente (stronk7) 4524454ff2 Merge branch 'wip-mdl-45769-m27' of https://github.com/rajeshtaneja/moodle into MOODLE_27_STABLE 2014-06-09 13:25:17 +02:00
Andrew Nicols 658bba713a MDL-45560 report_log: Close sessions before download only
If the session is closed too early, then preferences made in the body of
the page will not be saved to the session.
2014-06-09 17:24:56 +08:00
Marina Glancy 238c388016 Merge branch 'MDL-45634-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-06-09 17:24:36 +08:00
David Mudrák 5e10e88673 MDL-45813 Fix variable name in scheduled task 2014-06-09 09:47:01 +02:00
Jetha Chan 7b6bad24ee MDL-38693 themes: amended z-indexes
Amended #dock z-index level from 11000 to 5000 across all themes; amended z-index style of #page-header in Overlay theme such that elements no longer occlude TinyMCE.
2014-06-09 14:16:24 +08:00
Damyon Wiese 11be1e8b2b Merge branch 'MDL-39726-27' of https://github.com/merrill-oakland/moodle into MOODLE_27_STABLE 2014-06-09 12:43:27 +08:00
Rajesh Taneja 42126ff6a5 MDL-45769 behat: use final versions of symfony and behat 2014-06-09 09:59:19 +08:00
Rajesh Taneja f12f99241c MDL-45769 Behat: Fixed behat, was failing because of xpath chaining 2014-06-09 09:59:13 +08:00
Damyon Wiese 8fde6e8ef9 Merge branch 'MDL-45714-27' of https://github.com/merrill-oakland/moodle into MOODLE_27_STABLE 2014-06-09 08:56:00 +08:00
Sam Hemelryk 36bd6f3319 MDL-45524 navigation: fixed non-expandable node behat tests 2014-06-09 09:34:02 +12:00
Sam Hemelryk 0f52f263ca MDL-44711 navigation: improved expandable course calculation 2014-06-09 09:34:02 +12:00
Matteo Scaramuccia b9e1842e02 MDL-29708 Fixed file_exception() arguments in rename(). 2014-06-07 09:56:24 +02:00
Matteo Scaramuccia 99261fdf05 MDL-29708 Fixed extra slashes in $string['storedfilenotcreated']. 2014-06-07 09:56:23 +02:00
sam marshall 07388eaded MDL-45574 Backup progress: Can time out with large number of files
When there are many files inside a single resource, it's possible
for the backup to time out because it does not report progress
while adding entries to the backup_ids table.
2014-06-06 10:42:27 +01:00
Jenny Gray d983601e46 MDL-45846 Libraries Reinstate custom user agent device detection 2014-06-06 09:12:58 +01:00
Sam Chaffee fd85f4eeb9 MDL-45767: Fixed DB error when returning to course from external tool
The instance ID is not always returned from the external
tool provider.
2014-06-05 09:38:07 -07:00
Eric Merrill c11ac48868 MDL-20154 quiz: Remove unused random questions
When a random question is removed from a quiz, and it is not
in use elsewhere, it should be deleted.
2014-06-05 11:06:59 -04:00
Eric Merrill 0d5c68bfd8 MDL-20154 questions: question_delete_question should not check perms
By Moodle convention, library functions should not implement permission
checks, they are to be handled by the invoking code.
2014-06-05 11:06:59 -04:00
Eloy Lafuente (stronk7) a6b91c8407 weekly release 2.7+ 2014-06-05 16:58:54 +02:00
Eloy Lafuente (stronk7) f6cac05e9c Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2014-06-05 16:58:49 +02:00
Eric Merrill 9a2938c57c MDL-45761 assign Set inline comment format properly when plugin is empty
If a plugin says it is empty, skip it for for building the inline
comment.

If not format was found in any plugins, set to FORMAT_HTML, which is
the default for feedback anyways.
2014-06-05 08:58:09 -04:00
Michael de Raadt f4d6bab1b4 MDL-44309 Administration - correcting inproperly assigned column classes in environment table 2014-06-05 10:52:43 +08:00
Mark Nielsen ebfbd63b3c MDL-45764 mod_lti: Fix adding General Tool
This error only occurs when a ltisource
plugin is present that implements the
get_types callback.
2014-06-04 08:10:19 -07:00
Eric Merrill 9ec7228b03 MDL-39726 backup: Move question files by context, not one at a time
Use question category contexts to send file to the file pool in bulk.
Questions are only restored in whole category chunks, so this is safe
to do.
2014-06-04 09:19:52 -04:00
Adrian Greeve 0a1f0c4b1f MDL-44501 mod_data: Only attempt to export when a file exists.
The error only occurs when portfolios are enabled and there is only one field which is
a file field.
2014-06-04 15:30:03 +08:00
Frederic Massart 7180fb19c1 MDL-45579 group: Behat tests to cover group enrolment key rules 2014-06-04 15:12:12 +08:00
Frederic Massart ac2015f2ce MDL-45579 group: Prevent duplicate enrolment keys in course groups 2014-06-04 15:12:12 +08:00
Marina Glancy 6fc8187375 Merge branch 'MDL-18162-27-2' of git://github.com/andrewnicols/moodle into MOODLE_27_STABLE 2014-06-04 12:59:42 +08:00
Andrew Nicols 81e433d505 MDL-18162 mod_forum: Correct @param type in phpdoc to use stdClass 2014-06-04 11:26:10 +08:00
Damyon Wiese 9fbdee633a Merge branch 'MDL-45568_m27' of git://github.com/markn86/moodle into MOODLE_27_STABLE 2014-06-04 10:20:15 +08:00
Mark Nelson f1dee5ce23 MDL-45568 events: fixed the description for the 'course_module_completion_updated' event 2014-06-03 17:26:22 -07:00
Mark Nelson 1ffce0c735 MDL-45789 mod_wiki: removed undefined "$this->other['itemid']" from the comments_viewed event description 2014-06-03 15:23:50 -07:00
Eloy Lafuente (stronk7) 3e307259ac Merge branch 'MDL-44620_master' of git://github.com/dmonllao/moodle into MOODLE_27_STABLE 2014-06-03 18:11:37 +02:00
Dan Poltawski 8455124070 Merge branch '45333-27' of git://github.com/samhemelryk/moodle into MOODLE_27_STABLE 2014-06-03 15:26:01 +01:00
Tim Hunt a1d932bd82 MDL-44054 quiz_statistics fix lang string concatenation. 2014-06-03 13:01:25 +01:00
Jason Fowler d9ef98fc80 MDL-42953 Themes: Fixing CSS for headers of central blocks 2014-06-03 12:12:37 +02:00
Damyon Wiese 4affd3c42e Merge branch 'MDL-45592_27' of git://github.com/grabs/moodle into MOODLE_27_STABLE 2014-06-03 16:14:56 +08:00
Damyon Wiese 8771f49c0a Merge branch 'MDL-45677_m27' of https://github.com/markn86/moodle into MOODLE_27_STABLE 2014-06-03 14:38:57 +08:00
Damyon Wiese b018b44b49 Merge branch 'm27_MDL-44098' of git://github.com/greg-or/moodle-mod_assign into MOODLE_27_STABLE 2014-06-03 12:49:59 +08:00
Damyon Wiese 3d4f5c6bf8 MDL-45781 mod_quiz: Shifted files did not match CI version 2014-06-03 12:14:07 +08:00
Frederic Massart 6bbdb16bb1 MDL-45634 editor_atto: Adding type button to toolbar buttons
This prevents the browser to assume that those buttons are submit
buttons. In which case the submit action was stolen and the form
could not be submitted pressing the 'enter' key.
2014-06-03 12:09:46 +08:00
Damyon Wiese 07783f9c20 Merge branch 'MDL-45781_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-06-03 11:57:54 +08:00
Andrew Nicols b19370bd35 MDL-18162 mod_forum: Correct phpdoc for forum_clean_search_terms 2014-06-03 15:19:41 +12:00
Eric Merrill 9d18c714b8 MDL-45714 backup: Less aggressive removal of old backup dirs
The old 4 hour standard was too aggressive and can cause backup files
to be removed while they were still in use. Now the same as cron,
1 week.
2014-06-02 21:50:48 -04:00
Eloy Lafuente (stronk7) 474dd3da66 Merge branch 'm27_MDL-45726' of https://github.com/danmarsden/moodle into MOODLE_27_STABLE 2014-06-03 02:20:34 +02:00
Mark Nelson 5095725a00 MDL-45804 mod_workshop: fixed objecttable specified for the submission_reassessed event 2014-06-02 16:35:15 -07:00
Sam Hemelryk 02da49597c Merge branch 'MDL-33763-27' of git://github.com/ankitagarwal/moodle into MOODLE_27_STABLE 2014-06-03 08:57:39 +12:00
Eric Merrill 5f86aa9d14 MDL-45763 question Random qtype should use '0' or '1' question text.
Some time ago, it when from using '0' for no-subcategories to blank.
Change to properly define '0' or '1', update old questions, and make
sure to fix newly restored questions.
2014-06-02 15:33:00 -04:00
Albert Gasset ae916b5d6a MDL-35514 mod_forum: Fixed warning message to students in forums with groups 2014-06-02 18:25:21 +02:00
AMOS bot ea66859873 Automatically generated installer lang files 2014-05-31 01:06:17 +00:00
Tim Hunt 23f43bb4c4 MDL-45781 quiz autosave: detect and report when the session is lost.
and also other errors.
2014-05-30 16:29:56 +01:00
AMOS bot 108d281f6b Automatically generated installer lang files 2014-05-30 01:24:20 +00:00
AMOS bot 4a0e272c5b Automatically generated installer lang files 2014-05-30 01:24:20 +00:00
Ciaran Irvine 647a688de3 MDL-45726 SCORM: Correct check for forcenewattempt 2014-05-30 09:48:50 +12:00
Sam Hemelryk 3f9ea21ae3 MDL-45333 output: navbar is now wrapped in a <nav> tag 2014-05-30 08:41:34 +12:00
Andreas Grabs 34a46904c2 MDL-45592 mod_feedback - unwanted linebreak after import or duplicating a feedback 2014-05-29 17:16:10 +02:00
Eloy Lafuente (stronk7) d73b1f3e71 weekly release 2.7+ 2014-05-29 12:51:41 +02:00
Eloy Lafuente (stronk7) 2c356d8ecd Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2014-05-29 12:51:36 +02:00
Damyon Wiese 62c7d543f6 MDL-45654 Cron: Fix for unit test that was causing integer overflow in 32 bit php 2014-05-29 16:29:58 +12:00
Rajesh Taneja 008cfb2a1f MDL-45698 behat: Added extra setting, to avoid timout issue 2014-05-29 14:52:57 +12:00
Sam Hemelryk 243f766222 Merge branch 'wip-mdl-45698-m27' of https://github.com/rajeshtaneja/moodle into MOODLE_27_STABLE 2014-05-29 14:28:13 +12:00
Rajesh Taneja 2b9259ed7f MDL-45698 behat: Fixed behat and symfony versions 2014-05-29 09:47:55 +08:00
Sam Hemelryk c5d9d36e79 MDL-45654 cron: fixed dataprovider timestamp issue 2014-05-29 11:31:13 +12:00
Sam Hemelryk 296029fadf Merge branch 'wip-mdl-45565-m27' of https://github.com/rajeshtaneja/moodle into MOODLE_27_STABLE 2014-05-29 08:12:43 +12:00
Eloy Lafuente (stronk7) 7e78f9c4a5 MDL-45503 upgrade: add v2.7.0 sep lines 2014-05-28 01:16:36 +02:00
Simey Lameze 83bc3ccfdf MDL-45544 events: Add event user_profile_viewed trigger to user/profile.php. 2014-05-27 07:50:35 +01:00
Rajesh Taneja 6a001a3223 MDL-45565 phpunit: Changed testsuite_name, so as to avoid class collision 2014-05-27 09:45:16 +08:00
Rajesh Taneja 1974f5ade7 MDL-45565 core_message: Reset internal users in phpunit 2014-05-27 09:45:15 +08:00
Gregory Faller 837e3741fd MDL-44098: Late submissions with extension calculate period of lateness incorrectly 2014-05-27 11:13:41 +09:30
AMOS bot 4bdb702918 Automatically generated installer lang files 2014-05-26 16:46:54 +00:00
AMOS bot e588f20b6c Automatically generated installer lang files 2014-05-26 16:46:54 +00:00
Dan Poltawski ad7d8edf0c Merge branch 'MDL-45676_m27' of https://github.com/markn86/moodle into MOODLE_27_STABLE 2014-05-26 12:02:41 +01:00
Dan Poltawski 9f4a69a8cd Merge branch 'MDL-45675_m27' of https://github.com/markn86/moodle into MOODLE_27_STABLE 2014-05-26 11:58:57 +01:00
Andrew Nicols fd4c7d7b69 MDL-45682 editor_atto: Ensure that the current editor is active when saving selections 2014-05-26 11:24:11 +01:00
Jetha Chan e77b4ac0de MDL-44482 mod_lti: use localized dates
Fixed an issue where LTI external tools had creation datestamps of NaN/NaN/NaN under particular non-English languages.
2014-05-26 14:46:21 +08:00
Damyon Wiese 4fe4fbba9d MDL-45661 Assign: Clean bad data from DB after MDL-42526 2014-05-26 14:43:10 +08:00
Marina Glancy 331298218b MDL-45688 added missing library requirement 2014-05-26 12:47:52 +08:00
Damyon Wiese db52d4058d Merge branch '45499-27' of git://github.com/samhemelryk/moodle into MOODLE_27_STABLE 2014-05-26 12:11:39 +08:00
Mark Nelson b5d1353575 MDL-45629 mod_assign: removed use of '$this->objectid' in the submission_status_viewed event 2014-05-26 11:59:25 +08:00
Mark Nielsen fb3663ae5c MDL-44014 Navigation: Set the correct context when retrieved via AJAX 2014-05-26 11:59:19 +08:00
Mark Nelson 6825f882e2 MDL-45677 mod_assign: removed treatment of an array as an object 2014-05-25 20:25:31 -07:00
Mark Nelson 04b949a8f5 MDL-45676 mod_data: added missing additional name fields 2014-05-25 20:23:13 -07:00
Ankit Agarwal 86976c5bd9 MDL-33763 notes: Fix issue with incorrect node highlighting in the nav tree 2014-05-26 10:42:14 +08:00
Mark Nelson 33238bb24b MDL-45675 mod_data: initialise options as an empty array to avoid error when there are none 2014-05-25 19:29:44 -07:00
Mark Nelson 2b548c27ee MDL-45650 events: ensure correct objectid passed when triggering user_profile_viewed event 2014-05-26 13:59:52 +12:00
David Monllao e0cd7e44db MDL-45192 behat: Replacing specific-selector steps by a generic one
Having a I click on we can use all our selectors rather
than having multiple steps for the same purpose. This
step allow us to manage JS native dialogues without
having to fail a scenario.

Credit for Mohamed Alsharaf.
2014-05-26 13:57:23 +12:00
Mohamed Alsharaf 184cdf0d52 MDL-45192 assign: added behat script & new definitions to handle alert dialog
The behat script is to test the batch action to lock and unlock submissions.
The new definitions are to prevent the "unexpected alert open" error in Selenium.
2014-05-26 13:57:18 +12:00
Tim Hunt 472896acdd MDL-45660 question statistics: make comparison more robust. 2014-05-26 11:53:06 +12:00
Sam Hemelryk 1ff977a5e5 Merge branch 'MDL-45686_27' of git://github.com/jmvedrine/moodle into MOODLE_27_STABLE 2014-05-26 10:55:17 +12:00
Andrew Nicols 68a1c2a8d9 MDL-45635 javascript: Make core dialogue translatable 2014-05-26 10:38:59 +12:00
Simon Coggins db77228155 MDL-45623: Fix assigned users count on role delete confirmation page 2014-05-26 10:00:51 +12:00
Mark Nelson 8a0dcb91cc MDL-45607 events: changed the context passed to the user_profile_viewed event 2014-05-26 09:54:42 +12:00
Sam Hemelryk 11b5d9b763 Merge branch 'MDL-42526-27' of git://github.com/jamiepratt/moodle into MOODLE_27_STABLE 2014-05-26 09:02:53 +12:00
Sam Hemelryk dc195425ee MDL-45499 admin: fixed error when displaying page settings 2014-05-26 09:01:14 +12:00
Sam Hemelryk 72cf8ec5eb Merge branch 'MDL-45654-27' of https://github.com/rtcn2/moodle into MOODLE_27_STABLE 2014-05-26 08:58:13 +12:00
Jean-Michel Vedrine 1130c181f9 MDL-45686 qtype_multichoice get_num_selected_choices return wrong result 2014-05-25 09:23:26 +02:00
Rajesh Taneja 443d4dae06 MDL-45565 core_message: Added unit tests. 2014-05-23 16:48:18 +08:00
Rajesh Taneja a2720952c2 MDL-45565 core_message: Fixed strangers array
Strangers get mixed with noreply user and support user,
if  noreply/support users real user.
To avoid duplication use userid as array index. Also,
avoid fetching data again for noreply and support users,
if they are real users, then data is already feteched.
2014-05-23 16:48:15 +08:00
Eloy Lafuente (stronk7) 89262fa9f1 weekly release 2.7+ 2014-05-22 16:47:19 +02:00
James Pratt bc3c2a8eed MDL-42526 mod_assignment : fix record insert with assigment.id 0 2014-05-22 13:01:47 +07:00
Andrew Nicols fb7e5c42cd MDL-45239 editor_atto: On Android do not restore focus in the callbackWrapper
It seems that Android automatically focuses the cursor in the last position
when the content editable region is programatically re-focused.

Whilst this does not cause an issue on it's own, when combined with the
behaviour of the dictionary auto-completion to restore focus on the start
of the word when a word has not yet been finished, this was causing us to
change focus when pressing buttons.
2014-05-22 13:02:26 +08:00
Andrew Nicols 2e2a229f58 MDL-45536 atto_html: Update the textarea size when switching to HTML view 2014-05-22 11:47:37 +08:00
Rod Norfor d12b20d022 MDL-45654 cron: fix non-empty directories deletion
Remove errors when attempting to delete non-empty directories when
child directories do not get removed since the mtime was updated when
files were removed from the child directory.
2014-05-21 17:20:16 +01:00
Sam Hemelryk 5ce5bc6bdd MDL-44711 course: fixed navigation expansion in course tests 2014-05-21 20:58:27 +12:00
Marina Glancy 54c9048405 MDL-45469 profile: make sure profile fields can be initialised without arguments 2014-05-21 12:04:48 +08:00
Marina Glancy 7b04f1fa49 MDL-45371 behat: Tests for block glossary_random 2014-05-21 10:03:26 +08:00
Marina Glancy eebd7f8964 MDL-45320 behat: change to block selector 2014-05-21 09:32:18 +12:00
Marina Glancy 871af2ebc5 MDL-45320 block_html: behat tests 2014-05-21 09:32:14 +12:00
Marina Glancy 0d4b11ff88 MDL-45320 behat: Step definitions for blocks 2014-05-21 09:32:12 +12:00
David Monllao e342149a37 MDL-45294 behat: Updating block references to aria label value
Also improving moodle selectors xpath expressions
readability.
2014-05-21 09:31:50 +12:00
David Monllao 9054cd2a25 MDL-45294 behat: Supporting an aria-label as a block ref 2014-05-21 09:31:46 +12:00
Dan Poltawski 7d5e56cffd Merge branch '44711-27-r2' of git://github.com/samhemelryk/moodle into MOODLE_27_STABLE 2014-05-20 20:32:10 +08:00
Sam Hemelryk 137c0261ee MDL-44711 block_navigation: fixed typo in behat tests 2014-05-20 23:39:17 +12:00
Damyon Wiese 1c500e2157 MDL-45606 Unit test fix for MySQL and added a comment about the removed code. 2014-05-20 18:07:13 +08:00
Dan Poltawski 46021b98b2 Merge branch 'MDL-45496-m27' of https://github.com/micaherne/moodle into MOODLE_27_STABLE 2014-05-20 15:55:12 +08:00
Dan Poltawski 55739cdfb6 Merge branch 'MDL-45563-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-05-20 15:50:29 +08:00
Tim Hunt 63e5416f5b MDL-45618 Fix @since PHPdoc tags. 2014-05-20 15:03:34 +08:00
Jetha Chan 689a8f383c MDL-45525 themes: minor forum improvements
Fixed an RTL style that wasn't kicking in properly.

Conflicts:
	theme/bootstrapbase/style/moodle.css
2014-05-20 14:29:25 +08:00
Andrew Nicols 10f981a794 MDL-45536 theme: Use width auto for inputs and textareas specifying them
Conflicts:
	theme/bootstrapbase/style/moodle.css
2014-05-20 14:25:45 +08:00
Adrian Greeve 556a760d0c MDL-45512 comments: Added full date to comment details. 2014-05-20 14:22:32 +08:00
Michael Aherne 2ba0565d7d MDL-43669 messaging Enable sending email only from no-reply address 2014-05-20 14:16:05 +08:00
Tim Hunt 16d5729223 MDL-44333 quiz reports: use consitent name for user pref
The Marks for each question setting was not being saved properly as a
user preference.
2014-05-20 14:11:39 +08:00
Mark Nelson 38ef7ab379 MDL-45571 events: included enrolment method in the 'user_enrolment_created' event description 2014-05-20 14:08:14 +08:00
Damyon Wiese 740cb942ce Merge branch 'master_MDL-45583' of github.com:danmarsden/moodle into MOODLE_27_STABLE 2014-05-20 13:30:51 +08:00
Damyon Wiese 3725adf852 Merge branch 'MDL-45323-master' of git://github.com/lameze/moodle into MOODLE_27_STABLE 2014-05-20 13:28:09 +08:00
Dan Poltawski b9c49aefb2 Merge branch 'MDL-45501-27' of git://github.com/ankitagarwal/moodle into MOODLE_27_STABLE 2014-05-20 13:23:40 +08:00
Dan Poltawski 60f8e19ce1 Merge branch 'MDL-45566-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-05-20 13:17:41 +08:00
Damyon Wiese d0f43772fb Merge branch 'MDL-45476-master' of git://github.com/phalacee/moodle into MOODLE_27_STABLE 2014-05-20 13:12:16 +08:00
Dan Poltawski 106be68e82 Merge branch 'MDL-45545-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-05-20 12:21:12 +08:00
Marina Glancy f12ad8521f MDL-45469 Move profile tests to the location recognised by phpunit 2014-05-20 11:59:58 +08:00
Marina Glancy 9efa210e32 MDL-45466 forum: performance improvement for mass (un)subscriptions 2014-05-20 11:52:23 +08:00
Dan Poltawski 79b146cb5c MDL-44323 admin: use correct css class for warning
The notifyproblem notification is consistent with the rest of
the warnings we report.

Conflicts:
	theme/bootstrapbase/style/moodle.css
2014-05-20 15:48:48 +12:00
Sam Hemelryk 8711ce1f4a Merge branch 'MDL-44027-27' of git://github.com/danpoltawski/moodle into MOODLE_27_STABLE 2014-05-20 15:39:36 +12:00
Damyon Wiese 417fa07162 MDL-45605 Phpunit: Do not call gc_collect_cycles as part of reset.
This takes 25% of the time in running tests and there is no benefit. The
behaviour of destructors is the same before/after the patch.
2014-05-20 10:51:58 +08:00
Dan Poltawski 1910d01a86 Merge branch 'MDL-45546-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-05-20 10:24:42 +08:00
Dan Poltawski c9c530fd6e Merge branch '44711-27' of git://github.com/samhemelryk/moodle into MOODLE_27_STABLE 2014-05-20 10:14:22 +08:00
Sam Hemelryk dadeff80c9 Merge branch 'MDL-45603-27' of https://github.com/merrill-oakland/moodle into MOODLE_27_STABLE 2014-05-20 13:59:36 +12:00
sam marshall cc41096ad5 MDL-45469 Conditional availability: Restrict by text area broken
It has never worked, because the data for text area fields is not
loaded into the $USER object.

Changing it so that the dropdown list does not include these types
of field.
2014-05-20 09:52:36 +08:00
Tim Hunt db9987c267 MDL-44449 quiz access rules should have a delete hook.
So they can clean up their settings when the quiz is deleted.

See
https://github.com/moodleou/moodle-quizaccess_honestycheck/commit/babf149c2cc6dd734c272cd332b2032cc19db7d8
for an example of using this.
2014-05-20 09:51:16 +08:00
Dan Poltawski 8d8a5e8035 Merge branch 'MDL-45550-m27' of https://github.com/sammarshallou/moodle into MOODLE_27_STABLE 2014-05-20 09:30:19 +08:00
Andrew Nicols b60373f3e4 MDL-45479 atto_image: Improve the preview area
This changes the preview area:
* to show the image at the requested size; and
* to fix the scaling issues.
2014-05-20 13:20:17 +12:00
Damyon Wiese 1d8bebfeaf Merge branch '44974-27' of git://github.com/samhemelryk/moodle into MOODLE_27_STABLE 2014-05-20 09:00:35 +08:00
Ankit Agarwal 41d178f9da MDL-45543 availability: Use correct namespace for global classes 2014-05-20 12:07:39 +12:00
Sam Hemelryk d144e53188 Merge branch 'MDL-45477-m27' of https://github.com/sammarshallou/moodle into MOODLE_27_STABLE 2014-05-20 11:58:24 +12:00
sam marshall 49b50ef5ab MDL-45535 CSS chunking breaks media rules if CSS invalid (IE)
Invalid CSS with extra } symbols, which previously (by fluke)
worked, was broken by recent chunking improvements. This change
makes the chunking code robust against this (stupid) situation.
2014-05-20 11:57:54 +12:00
Sam Hemelryk 4fac06549a Merge branch 'MDL-44953-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-05-20 11:43:17 +12:00
Sam Hemelryk 7141921ad4 Merge branch 'MDL-45474-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-05-20 10:46:34 +12:00
Sam Hemelryk 70e78a4315 Merge branch 'MDL-37838-27' of git://github.com/danpoltawski/moodle into MOODLE_27_STABLE 2014-05-20 10:42:23 +12:00
Sam Hemelryk 520592c43d Merge branch 'MDL-45380-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE
Conflicts:
	theme/bootstrapbase/style/moodle.css
2014-05-20 08:53:18 +12:00
Dan Poltawski 553b1e6f6d MDL-45135 mod_glossary: fix RTL alignment of table
Tablelib has a specific 'hook' to allow alignment to be corrected for
RTL languages, but needs to be specified direction in lowercase.
2014-05-20 08:49:01 +12:00
Damyon Wiese bb5652829f Merge branch 'MDL-45130-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-05-19 21:27:47 +08:00
Damyon Wiese 288a79ccd4 Merge branch 'MDL-45472-master' of git://github.com/andrewnicols/moodle into MOODLE_27_STABLE 2014-05-19 20:47:27 +08:00
Damyon Wiese 8f6d8a5653 Merge branch 'MDL-45447-master' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-05-19 20:23:09 +08:00
Tim Hunt c64368bb1d MDL-43833 quiz reports: persist states settings between pages. 2014-05-19 20:12:09 +08:00
Damyon Wiese 177beaf23a Merge branch 'MDL-45527-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-05-19 20:05:25 +08:00
Tim Hunt 147d7af758 MDL-45455 quiz cron must rollback transaction on error. 2014-05-19 19:57:21 +08:00
Tony Butler 20bd24b70d MDL-45432 mod_assign Declare character encoding in onlinetext export
Signed-off-by: Tony Butler <tonyjbutler@gmail.com>
2014-05-19 18:48:06 +08:00
sam marshall 7c75924319 MDL-45478 Conditional availability: Custom user restriction missing
There was an error in the JavaScript and custom user field
restrictions did not show correctly when editing the form.

Behat tests didn't cover custom user fields, so I added a
scenario.
2014-05-19 17:30:43 +08:00
Andrew Nicols d90846033b MDL-45239 editor_atto: The editor cannot be active if it is not the active element
FireFox thinks that you can have an active selection on an element which
currently does not have focus. How this can be the case is a mystery.

Conflicts:
	lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js
2014-05-19 16:15:50 +08:00
Andrew Nicols da02a3c472 MDL-45468 editor_atto: Check that the common ancestor is within the editor
Conflicts:
	lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js
2014-05-19 16:15:43 +08:00
Andrew Nicols 61609ec274 MDL-41109 dndupload: Add missing error string 2014-05-19 15:07:59 +08:00
Dan Poltawski 228fc821e0 Merge branch 'wip-MDL-34914-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2014-05-19 14:58:51 +08:00
Damyon Wiese d44071ee09 MDL-32543 upgrade: Increment the version bump 2014-05-19 13:02:10 +08:00
Damyon Wiese 91fae7e9b4 Merge branch 'MDL-32543' of https://github.com/danielneis/moodle into MOODLE_27_STABLE 2014-05-19 13:00:00 +08:00
Damyon Wiese 3e7b9158f4 Merge branch 'MDL-23566' of https://github.com/aolley/moodle into MOODLE_27_STABLE 2014-05-19 12:44:31 +08:00
Marina Glancy 95f9c8f716 Merge branch 'MDL-45537-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-05-19 12:39:43 +08:00
Marina Glancy 170392d4a0 Merge branch 'wip-MDL-45483-MOODLE_27_STABLE' of https://github.com/kwiliarty/moodle into MOODLE_27_STABLE 2014-05-19 12:37:59 +08:00
Damyon Wiese 3724b3aa8d Merge branch 'MDL-45533-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-05-19 12:28:10 +08:00
Damyon Wiese 9af90f03bb Merge branch 'MDL-44634-27' of https://github.com/dbezborodovrp/moodle into MOODLE_27_STABLE 2014-05-19 12:14:42 +08:00
Jetha Chan 64a2dfba1f MDL-45561 themes: horizontal scroll in RTL base 2014-05-19 13:38:22 +12:00
Sam Hemelryk 043cf8bab7 MDL-44974 admin: repositioned call to initialise renderer 2014-05-19 08:41:27 +12:00
Sam Hemelryk 832393cfc9 MDL-44711 navigation: better handling of course expansion exception 2014-05-19 08:41:12 +12:00
Eric Merrill d8e7fa9196 MDL-45603 cache Fix the mappingsonly option to work as advertised. 2014-05-17 23:58:05 -04:00
Marina Glancy 075e999c1a MDL-34914 cohorts: more understandable filter of user list by cohort 2014-05-16 17:14:29 +08:00
Frederic Massart 8efb66741f MDL-45566 message: Send blocking events when user is not in contact list 2014-05-15 16:43:01 +08:00
Frederic Massart fa348b5d46 MDL-45563 message: Inverting IDs in description of event message_viewed 2014-05-15 16:17:03 +08:00
Frederic Massart ac2eafee91 MDL-45537 mod_assign: Requiring locallib for class assign 2014-05-15 15:52:48 +08:00
Damyon Wiese e6c69d835d weekly release 2.7+ 2014-05-15 15:32:36 +08:00
Ankit Agarwal bfa6c5080e MDL-45501 availability: Add uninstall support for conditional plugins 2014-05-15 14:07:05 +08:00
Damyon Wiese 0f0729b157 MDL-41383 Filepicker: whitespace fix 2014-05-15 13:33:04 +08:00
Jetha Chan f75d82450a MDL-41383: RTL fix for base when zoomed out 2014-05-15 13:29:03 +08:00
Damien Bezborodov 3dd33e3862 MDL-44634 Regression: link to user profile in comments block fails due to double URI encoding 2014-05-15 11:46:32 +09:30
Damien Bezborodov e3b98ac6b6 MDL-44634 Regression: link to user profile in comments block fails due to double URI encoding 2014-05-15 10:43:06 +09:30
sam marshall 3951213860 MDL-45550 Conditional availability: Missing lang string for save settings error 2014-05-14 11:48:33 +01:00
sam marshall 24b81e0566 MDL-45477 Behat: List of steps takes too long to load, times out
Increase time limit to 300 seconds (5 minutes).
2014-05-14 11:05:38 +01:00
Juan Leyva 0ab271dcfd MDL-36670 logging: action parameter length restricted to 40 chars 2014-05-14 16:35:18 +08:00
Frederic Massart b9cb39eaf6 MDL-45546 mod_forum: Login the user before getting its context 2014-05-14 16:16:40 +08:00
Frederic Massart c83407f033 MDL-45545 csslib: Chunking handles commas in media query definitions 2014-05-14 15:28:11 +08:00
Jetha Chan da75ffce68 MDL-41383 theme: filepicker zoom resiliency (base)
Fixed an issue that broke the file picker on base when initial zoom level is less than 100%.
2014-05-14 15:07:44 +08:00
Frederic Massart d48b1de9f7 MDL-45474 atto_undo: Remove notice when undo stack is empty 2014-05-13 17:49:26 +08:00
Dan Poltawski 38d1c9a886 MDL-44027 groups: remove some junk html 2014-05-13 16:17:14 +08:00
Damyon Wiese 1c48d7e188 Merge branch 'MDL-41383-27' of git://github.com/jethac/moodle into MOODLE_27_STABLE 2014-05-13 16:01:50 +08:00
Dan Poltawski 11b39253d2 Merge branch 'MDL-45523_m27' of https://github.com/merrill-oakland/moodle into MOODLE_27_STABLE 2014-05-13 14:46:55 +08:00
Dan Poltawski 56e84a7985 Merge branch 'MDL-45522_m27' of https://github.com/merrill-oakland/moodle into MOODLE_27_STABLE 2014-05-13 14:37:23 +08:00
Dan Poltawski 133f83d557 MDL-37838 block_courseoverview: fix pluaralisation logic
Note that this kind of handling of plurals is extremely limited, see:

https://moodle.org/mod/forum/discuss.php?d=85897
http://search.cpan.org/~petdance/Locale-Maketext-1.12/lib/Locale/Maketext/TPJ13.pod

However, this is a simple fix to the existing logic
2014-05-13 14:18:16 +08:00
Eric Merrill 17e57aa07d MDL-45523 quiz Cleanup duplicate question instances. 2014-05-12 16:01:32 -04:00
Eric Merrill 710b364b44 MDL-45522 quiz Check that sumgrade is valid before saving. 2014-05-12 15:21:44 -04:00
Frederic Massart 81d72831b8 MDL-44953 theme_more: Removing odd-looking text-shadow 2014-05-12 16:51:37 +08:00
Frederic Massart 3cfabf7190 MDL-45130 editor_atto: Remove debugging messages for missing plugins
This is no longer required as the toolbar configuration prevents
missing plugins from being set. However, even if we do not output
any notice, we ignore missing plugins to prevent errors in case
one was uninstalled but left in the editor toolbar.
2014-05-12 16:09:40 +08:00
Michael Aherne 0e5791a6cd MDL-45496 core Added space to logged in as line 2014-05-12 08:58:41 +01:00
Frederic Massart da3e5e0c5c MDL-45380 theme_bootstrapbase: Restore config override highlight 2014-05-12 15:50:08 +08:00
Rajesh Taneja ae3b9e1e1f MDL-45514 behat: Fixed should_not_exist timout param 2014-05-12 14:13:21 +08:00
Kevin Wiliarty 3485ecf225 MDL-45483 mod_forum: corrects values for maxattachments in forum settings 2014-05-11 23:51:57 -04:00
6869 changed files with 141027 additions and 476122 deletions
-3
View File
@@ -1,3 +0,0 @@
--errors=errors,duplicate-properties
--warnings=known-properties,display-property-grouping,empty-rules,important
--exclude-list=vendor/,lib/editor/tinymce/,lib/yuilib/,theme/bootstrapbase/style/
+2 -3
View File
@@ -26,13 +26,12 @@ CVS
/.buildpath
/.cache
phpunit.xml
# Composer support. Do not ignore composer.json, or composer.lock. These should be shipped by us.
# Composer support - only composer.json is to be in git, the rest is installed in each checkout.
composer.phar
composer.lock
/vendor/
/behat.yml
*/yui/build/*/*-coverage.js
/lib/yuilib/*/build/*/*-coverage.js
# lib/yuilib/version/module/module-coverage.js
/lib/yuilib/*/*/*-coverage.js
atlassian-ide-plugin.xml
/node_modules/
+22 -28
View File
@@ -1,54 +1,48 @@
{
"asi": false,
"bitwise": true,
"boss": false,
"browser": true,
"yui": true,
"bitwise": true,
"curly": true,
"eqeqeq": true,
"forin": false,
"immed": true,
"newcap": true,
"noarg": true,
"noempty": true,
"nomen": false,
"onevar": false,
"plusplus": false,
"regexp": false,
"strict": false,
"trailing": true,
"unused": true,
"white": false,
"asi": false,
"boss": false,
"debug": false,
"eqeqeq": false,
"eqnull": false,
"es5": false,
"esnext": false,
"evil": false,
"expr": false,
"forin": false,
"funcscope": false,
"globalstrict": false,
"immed": true,
"indent": 4,
"iterator": false,
"lastsemic": false,
"latedef": true,
"laxbreak": true,
"laxcomma": false,
"loopfunc": false,
"maxerr": 500,
"maxlen": 132,
"multistr": false,
"newcap": true,
"noarg": true,
"noempty": true,
"nomen": false,
"onecase": false,
"onevar": false,
"passfail": false,
"plusplus": false,
"predef": [
"M",
"define"
],
"proto": false,
"regexdash": false,
"regexp": false,
"scripturl": false,
"shadow": false,
"smarttabs": false,
"strict": false,
"sub": false,
"supernew": false,
"trailing": true,
"undef": true,
"unused": true,
"white": false,
"yui": true
"maxerr": 500,
"maxlen": 180,
"passfail": false,
"latedef": true
}
-253
View File
@@ -1,253 +0,0 @@
// 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/>.
/**
* @copyright 2014 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Grunt configuration
*/
module.exports = function(grunt) {
var path = require('path'),
fs = require('fs'),
tasks = {},
cwd = process.env.PWD || process.cwd();
// Project configuration.
grunt.initConfig({
jshint: {
options: {jshintrc: '.jshintrc'},
files: ['**/amd/src/*.js']
},
uglify: {
dynamic_mappings: {
files: grunt.file.expandMapping(
['**/src/*.js', '!**/node_modules/**'],
'',
{
cwd: cwd,
rename: function(destBase, destPath) {
destPath = destPath.replace('src', 'build');
destPath = destPath.replace('.js', '.min.js');
destPath = path.resolve(cwd, destPath);
return destPath;
}
}
)
}
},
less: {
bootstrapbase: {
files: {
"theme/bootstrapbase/style/moodle.css": "theme/bootstrapbase/less/moodle.less",
"theme/bootstrapbase/style/editor.css": "theme/bootstrapbase/less/editor.less",
},
options: {
compress: true
}
}
}
});
tasks.shifter = function() {
var exec = require('child_process').spawn,
done = this.async(),
args = [],
options = {
recursive: true,
watch: false,
walk: false,
module: false
},
shifter;
args.push( path.normalize(__dirname + '/node_modules/shifter/bin/shifter'));
// Determine the most appropriate options to run with based upon the current location.
if (path.basename(cwd) === 'src') {
// Detect whether we're in a src directory.
grunt.log.debug('In a src directory');
args.push('--walk');
options.walk = true;
} else if (path.basename(path.dirname(cwd)) === 'src') {
// Detect whether we're in a module directory.
grunt.log.debug('In a module directory');
options.module = true;
}
if (grunt.option('watch')) {
if (!options.walk && !options.module) {
grunt.fail.fatal('Unable to watch unless in a src or module directory');
}
// It is not advisable to run with recursivity and watch - this
// leads to building the build directory in a race-like fashion.
grunt.log.debug('Detected a watch - disabling recursivity');
options.recursive = false;
args.push('--watch');
}
if (options.recursive) {
args.push('--recursive');
}
// Always ignore the node_modules directory.
args.push('--excludes', 'node_modules');
// Add the stderr option if appropriate
if (grunt.option('verbose')) {
args.push('--lint-stderr');
}
if (grunt.option('no-color')) {
args.push('--color=false');
}
var execShifter = function() {
shifter = exec("node", args, {
cwd: cwd,
stdio: 'inherit',
env: process.env
});
// Tidy up after exec.
shifter.on('exit', function (code) {
if (code) {
grunt.fail.fatal('Shifter failed with code: ' + code);
} else {
grunt.log.ok('Shifter build complete.');
done();
}
});
};
// Actually run shifter.
if (!options.recursive) {
execShifter();
} else {
// Check that there are yui modules otherwise shifter ends with exit code 1.
var found = false;
var hasYuiModules = function(directory, callback) {
fs.readdir(directory, function(err, files) {
if (err) {
return callback(err, null);
}
// If we already found a match there is no need to continue scanning.
if (found === true) {
return;
}
// We need to track the number of files to know when we return a result.
var pending = files.length;
// We first check files, so if there is a match we don't need further
// async calls and we just return a true.
for (var i = 0; i < files.length; i++) {
if (files[i] === 'yui') {
return callback(null, true);
}
}
// Iterate through subdirs if there were no matches.
files.forEach(function (file) {
var p = path.join(directory, file);
stat = fs.statSync(p);
if (!stat.isDirectory()) {
pending--;
} else {
// We defer the pending-1 until we scan the whole dir and subdirs.
hasYuiModules(p, function(err, result) {
if (err) {
return callback(err);
}
if (result === true) {
// Once we get a true we notify the caller.
found = true;
return callback(null, true);
}
pending--;
if (pending === 0) {
// Notify the caller that the whole dir has been scaned and there are no matches.
return callback(null, false);
}
});
}
// No subdirs here, otherwise the return would be deferred until all subdirs are scanned.
if (pending === 0) {
return callback(null, false);
}
});
});
};
hasYuiModules(cwd, function(err, result) {
if (err) {
grunt.fail.fatal(err.message);
}
if (result === true) {
execShifter();
} else {
grunt.log.ok('No YUI modules to build.');
done();
}
});
}
};
tasks.startup = function() {
// Are we in a YUI directory?
if (path.basename(path.resolve(cwd, '../../')) == 'yui') {
grunt.task.run('shifter');
// Are we in an AMD directory?
} else if (path.basename(cwd) == 'amd') {
grunt.task.run('amd');
} else {
// Run them all!.
grunt.task.run('css');
grunt.task.run('js');
}
};
// Register NPM tasks.
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-less');
// Register JS tasks.
grunt.registerTask('shifter', 'Run Shifter against the current directory', tasks.shifter);
grunt.registerTask('amd', ['jshint', 'uglify']);
grunt.registerTask('js', ['amd', 'shifter']);
// Register CSS taks.
grunt.registerTask('css', ['less:bootstrapbase']);
// Register the startup task.
grunt.registerTask('startup', 'Run the correct tasks for the current directory', tasks.startup);
// Register the default task.
grunt.registerTask('default', ['startup']);
};
+2 -4
View File
@@ -64,8 +64,6 @@ echo "<form id=\"authmenu\" method=\"post\" action=\"auth_config.php\">\n";
echo "<div>\n";
echo "<input type=\"hidden\" name=\"sesskey\" value=\"".sesskey()."\" />\n";
echo "<input type=\"hidden\" name=\"auth\" value=\"".$auth."\" />\n";
// HACK to prevent browsers from automatically inserting the user's password into the wrong fields.
echo prevent_form_autofill_password();
// auth plugin description
echo $OUTPUT->box_start();
@@ -148,8 +146,8 @@ function print_auth_lock_options($auth, $user_fields, $helptext, $retrieveopts,
// If custom field then pick name from database.
$fieldshortname = str_replace('profile_field_', '', $fieldname);
$fieldname = $customfieldname[$fieldshortname]->name;
} elseif ($fieldname == 'phone1') {
$fieldname = get_string('phone');
} elseif (preg_match('/^(.+?)(\d+)$/', $fieldname, $matches)) {
$fieldname = get_string($matches[1]) . ' ' . $matches[2];
} elseif ($fieldname == 'url') {
$fieldname = get_string('webpage');
} else {
+1 -2
View File
@@ -155,8 +155,7 @@
} else if ($blocksettings instanceof admin_settingpage) {
$settings = '<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/settings.php?section=blocksetting'.$block->name.'">'.$strsettings.'</a>';
} else {
debugging('Warning: block_'.$block->name.' returns true in has_config() but does not provide a settings.php file',
DEBUG_DEVELOPER);
$settings = '<a href="block.php?block='.$blockid.'">'.$strsettings.'</a>';
}
}
+2 -1
View File
@@ -67,6 +67,7 @@ if ($data = data_submitted() and confirm_sesskey()) {
$errormsg = get_string('errorwithsettings', 'admin');
$firsterror = reset($adminroot->errors);
}
$adminroot = admin_get_root(true); //reload tree
$settingspage = $adminroot->locate($category, true);
}
@@ -155,4 +156,4 @@ echo $outputhtml;
echo html_writer::end_tag('fieldset');
echo html_writer::end_tag('form');
echo $OUTPUT->footer();
echo $OUTPUT->footer();
-76
View File
@@ -1,76 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Validate that the current db structure matches the install.xml files.
*
* @package core
* @copyright 2014 Totara Learning Solutions Ltd {@link http://www.totaralms.com/}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @author Petr Skoda <petr.skoda@totaralms.com>
*/
define('CLI_SCRIPT', true);
require(__DIR__ . '/../../config.php');
require_once($CFG->libdir.'/clilib.php');
$help = "Validate database structure
Options:
-h, --help Print out this help.
Example:
\$ sudo -u www-data /usr/bin/php admin/cli/check_database_schema.php
";
list($options, $unrecognized) = cli_get_params(
array(
'help' => false,
),
array(
'h' => 'help',
)
);
if ($options['help']) {
echo $help;
exit(0);
}
if (empty($CFG->version)) {
echo "Database is not yet installed.\n";
exit(2);
}
$dbmanager = $DB->get_manager();
$schema = $dbmanager->get_install_xml_schema();
if (!$errors = $dbmanager->check_database_schema($schema)) {
echo "Database structure is ok.\n";
exit(0);
}
foreach ($errors as $table => $items) {
cli_separator();
echo "$table\n";
foreach ($items as $item) {
echo " * $item\n";
}
}
cli_separator();
exit(1);
@@ -1,103 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This script fixes orphaned question categories.
*
* Orphaned question categories have had their associated context deleted
* but the category itself remains in the database with an invalid context.
*
* @package core
* @subpackage cli
* @copyright 2013 Tyler Bannister (tyler.bannister@remote-learner.net)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('CLI_SCRIPT', true);
require(__DIR__.'/../../config.php');
require_once($CFG->libdir.'/clilib.php');
require_once($CFG->libdir.'/questionlib.php');
$long = array('fix' => false, 'help' => false);
$short = array('f' => 'fix', 'h' => 'help');
// Now get cli options.
list($options, $unrecognized) = cli_get_params($long, $short);
if ($unrecognized) {
$unrecognized = implode("\n ", $unrecognized);
cli_error(get_string('cliunknowoption', 'admin', $unrecognized));
}
if ($options['help']) {
$help =
"Fix orphaned question categories.
This scripts detects question categories that have had their
context deleted, thus severing them from their original purpose.
This script will find the orphaned categories and delete the unused
questions in each category found. Used questions will not be
deleted, instead they will be moved to a rescue question category.
Options:
-h, --help Print out this help
-f, --fix Fix the orphaned question categories in the DB.
If not specified only check and report problems to STDERR.
Example:
\$sudo -u www-data /usr/bin/php admin/cli/fix_orphaned_question_categories.php
\$sudo -u www-data /usr/bin/php admin/cli/fix_orphaned_question_categories.php -f
";
echo $help;
die;
}
cli_heading('Checking for orphaned categories');
$sql = 'SELECT qc.id, qc.contextid, qc.name
FROM {question_categories} qc
LEFT JOIN {context} c ON qc.contextid = c.id
WHERE c.id IS NULL';
$categories = $DB->get_recordset_sql($sql);
$i = 0;
foreach ($categories as $category) {
$i += 1;
echo "Found orphaned category: {$category->name}\n";
if (!empty($options['fix'])) {
echo "Cleaning...";
// One transaction per category.
$transaction = $DB->start_delegated_transaction();
question_category_delete_safe($category);
$transaction->allow_commit();
echo " Done!\n";
}
}
if (($i > 0) && !empty($options['fix'])) {
echo "Found and removed {$i} orphaned question categories\n";
} else if ($i > 0) {
echo "Found {$i} orphaned question categories. To fix, run:\n";
echo "\$sudo -u www-data /usr/bin/php admin/cli/fix_orphaned_question_categories.php --fix\n";
} else {
echo "No orphaned question categories found.\n";
}
$categories->close();
+3 -22
View File
@@ -69,11 +69,9 @@ Options:
--prefix=STRING Table prefix for above database tables. Default is mdl_
--fullname=STRING The fullname of the site
--shortname=STRING The shortname of the site
--summary=STRING The summary to be displayed on the front page
--adminuser=USERNAME Username for the moodle admin account. Default is admin
--adminpass=PASSWORD Password for the moodle admin account,
required in non-interactive mode.
--adminemail=STRING Email address for the moodle admin account.
--non-interactive No interactive questions, installation fails if any
problem encountered.
--agree-license Indicates agreement with software license,
@@ -122,11 +120,10 @@ $olddir = getcwd();
chdir(dirname($_SERVER['argv'][0]));
// Servers should define a default timezone in php.ini, but if they don't then make sure something is defined.
if (!function_exists('date_default_timezone_set') or !function_exists('date_default_timezone_get')) {
fwrite(STDERR, "Timezone functions are not available.\n");
exit(1);
// This is a quick hack. Ideally we should ask the admin for a value. See MDL-22625 for more on this.
if (function_exists('date_default_timezone_set') and function_exists('date_default_timezone_get')) {
@date_default_timezone_set(@date_default_timezone_get());
}
date_default_timezone_set(@date_default_timezone_get());
// make sure PHP errors are displayed - helps with diagnosing of problems
@error_reporting(E_ALL);
@@ -253,10 +250,8 @@ list($options, $unrecognized) = cli_get_params(
'prefix' => 'mdl_',
'fullname' => '',
'shortname' => '',
'summary' => '',
'adminuser' => 'admin',
'adminpass' => '',
'adminemail' => '',
'non-interactive' => false,
'agree-license' => false,
'allow-unstable' => false,
@@ -692,20 +687,6 @@ if ($interactive) {
}
}
// Ask for the admin email address.
if ($interactive) {
cli_separator();
cli_heading(get_string('cliadminemail', 'install'));
$prompt = get_string('clitypevaluedefault', 'admin', $options['adminemail']);
$options['adminemail'] = cli_input($prompt);
}
// Validate that the address provided was an e-mail address.
if (!empty($options['adminemail']) && !validate_email($options['adminemail'])) {
$a = (object) array('option' => 'adminemail', 'value' => $options['adminemail']);
cli_error(get_string('cliincorrectvalueerror', 'admin', $a));
}
if ($interactive) {
if (!$options['agree-license']) {
cli_separator();
-8
View File
@@ -52,7 +52,6 @@ Options:
--lang=CODE Installation and default site language. Default is en.
--adminuser=USERNAME Username for the moodle admin account. Default is admin.
--adminpass=PASSWORD Password for the moodle admin account.
--adminemail=STRING Email address for the moodle admin account.
--agree-license Indicates agreement with software license.
--fullname=STRING Name of the site
--shortname=STRING Name of the site
@@ -103,7 +102,6 @@ list($options, $unrecognized) = cli_get_params(
'lang' => 'en',
'adminuser' => 'admin',
'adminpass' => '',
'adminemail' => '',
'fullname' => '',
'shortname' => '',
'agree-license' => false,
@@ -128,12 +126,6 @@ if ($options['adminpass'] === true or $options['adminpass'] === '') {
cli_error('You have to specify admin password. --help prints out the help'); // TODO: localize
}
// Validate that the address provided was an e-mail address.
if (!empty($options['adminemail']) && !validate_email($options['adminemail'])) {
$a = (object) array('option' => 'adminemail', 'value' => $options['adminemail']);
cli_error(get_string('cliincorrectvalueerror', 'admin', $a));
}
$options['lang'] = clean_param($options['lang'], PARAM_SAFEDIR);
if (!file_exists($CFG->dirroot.'/install/lang/'.$options['lang'])) {
$options['lang'] = 'en';
-202
View File
@@ -1,202 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* MySQL table row compression tool tool.
*
* @package core
* @copyright 2014 Totara Learning Solutions Ltd {@link http://www.totaralms.com/}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @author Petr Skoda <petr.skoda@totaralms.com>
*/
define('CLI_SCRIPT', true);
require(dirname(__FILE__).'/../../config.php');
require_once($CFG->libdir . '/clilib.php');
if ($DB->get_dbfamily() !== 'mysql') {
cli_error('This script is used for MySQL databases only.');
}
$engine = strtolower($DB->get_dbengine());
if ($engine !== 'innodb' and $engine !== 'xtradb') {
cli_error('This script is for MySQL servers using InnoDB or XtraDB engines only.');
}
list($options, $unrecognized) = cli_get_params(
array('help' => false, 'info' => false, 'list' => false, 'fix' => false, 'showsql' => false),
array('h' => 'help', 'i' => 'info', 'l' => 'list', 'f' => 'fix', 's' => 'showsql')
);
if ($unrecognized) {
$unrecognized = implode("\n ", $unrecognized);
cli_error(get_string('cliunknowoption', 'admin', $unrecognized));
}
$help =
"Script for detection of row size problems in MySQL InnoDB tables.
By default InnoDB storage table is using legacy Antelope file format
which has major restriction on database row size.
Use this script to detect and fix database tables with potential data
overflow problems.
Options:
-i, --info Show database information
-l, --list List problematic tables
-f, --fix Attempt to fix all tables (requires SUPER privilege)
-s, --showsql Print SQL statements for fixing of tables
-h, --help Print out this help
Example:
\$ sudo -u www-data /usr/bin/php admin/cli/mysql_compressed_rows.php -l
";
/** @var mysql_sql_generator $generator */
$generator = $DB->get_manager()->generator;
$info = $DB->get_server_info();
$filepertable = $DB->get_record_sql("SHOW VARIABLES LIKE 'innodb_file_per_table'");
$filepertable = $filepertable ? $filepertable->value : '';
$fileformat = $DB->get_record_sql("SHOW VARIABLES LIKE 'innodb_file_format'");
$fileformat = $fileformat ? $fileformat->value : '';
$prefix = $DB->get_prefix();
$database = $CFG->dbname;
if (!empty($options['info'])) {
echo "Database version: " . $info['description'] . "\n";
echo "Database name: $database\n";
echo "Database engine: " . $DB->get_dbengine() . "\n";
echo "innodb_file_per_table: $filepertable\n";
echo "innodb_file_format: $fileformat\n";
exit(0);
} else if (!empty($options['list'])) {
$problem = false;
foreach ($DB->get_tables(false) as $table) {
$columns = $DB->get_columns($table, false);
$size = $generator->guess_antelope_row_size($columns);
$format = $DB->get_row_format($table);
if ($size <= $generator::ANTELOPE_MAX_ROW_SIZE) {
continue;
}
echo str_pad($prefix . $table, 32, ' ', STR_PAD_RIGHT);
echo str_pad($format, 11, ' ', STR_PAD_RIGHT);
if ($format === 'Compact' or $format === 'Redundant') {
$problem = true;
echo " (needs fixing)\n";
} else if ($format !== 'Compressed' and $format !== 'Dynamic') {
echo " (unknown)\n";
} else {
echo "\n";
}
}
if ($problem) {
exit(1);
}
exit(0);
} else if (!empty($options['fix'])) {
$fixtables = array();
foreach ($DB->get_tables(false) as $table) {
$columns = $DB->get_columns($table, false);
$size = $generator->guess_antelope_row_size($columns);
$format = $DB->get_row_format($table);
if ($size <= $generator::ANTELOPE_MAX_ROW_SIZE) {
continue;
}
if ($format === 'Compact' or $format === 'Redundant') {
$fixtables[$table] = $table;
}
}
if (!$fixtables) {
echo "No changes necessary\n";
exit(0);
}
if ($filepertable !== 'ON') {
try {
$DB->execute("SET GLOBAL innodb_file_per_table=1");
} catch (dml_exception $e) {
echo "Cannot enable GLOBAL innodb_file_per_table setting, use --showsql option and execute the statements manually.";
throw $e;
}
}
if ($fileformat !== 'Barracuda') {
try {
$DB->execute("SET GLOBAL innodb_file_format=Barracuda");
} catch (dml_exception $e) {
echo "Cannot change GLOBAL innodb_file_format setting, use --showsql option and execute the statements manually.";
throw $e;
}
}
if (!$DB->is_compressed_row_format_supported(false)) {
echo "MySQL server is not compatible with compressed row format.";
exit(1);
}
foreach ($fixtables as $table) {
$DB->change_database_structure("ALTER TABLE {$prefix}$table ROW_FORMAT=Compressed");
echo str_pad($prefix . $table, 32, ' ', STR_PAD_RIGHT) . " ... Compressed\n";
}
exit(0);
} else if (!empty($options['showsql'])) {
$fixtables = array();
foreach ($DB->get_tables(false) as $table) {
$columns = $DB->get_columns($table, false);
$size = $generator->guess_antelope_row_size($columns);
$format = $DB->get_row_format($table);
if ($size <= $generator::ANTELOPE_MAX_ROW_SIZE) {
continue;
}
if ($format === 'Compact' or $format === 'Redundant') {
$fixtables[$table] = $table;
}
}
if (!$fixtables) {
echo "No changes necessary\n";
exit(0);
}
echo "Copy the following SQL statements and execute them using account with SUPER privilege:\n\n";
echo "USE $database;\n";
echo "SET SESSION sql_mode=STRICT_ALL_TABLES;\n";
echo "SET GLOBAL innodb_file_per_table=1;\n";
echo "SET GLOBAL innodb_file_format=Barracuda;\n";
foreach ($fixtables as $table) {
echo "ALTER TABLE {$prefix}$table ROW_FORMAT=Compressed;\n";
}
echo "\n";
exit(0);
} else {
echo $help;
die;
}
+2 -2
View File
@@ -45,7 +45,7 @@ admin_externalpage_setup('environment', '', $extraurlparams);
// Handle the 'updatecomponent' action
if ($action == 'updatecomponent' && confirm_sesskey()) {
// Create component installer and execute it
if ($cd = new component_installer('https://download.moodle.org',
if ($cd = new component_installer('http://download.moodle.org',
'environment',
'environment.zip')) {
$status = $cd->install(); //returns COMPONENT_(ERROR | UPTODATE | INSTALLED)
@@ -53,7 +53,7 @@ if ($action == 'updatecomponent' && confirm_sesskey()) {
case COMPONENT_ERROR:
if ($cd->get_error() == 'remotedownloaderror') {
$a = new stdClass();
$a->url = 'https://download.moodle.org/environment/environment.zip';
$a->url = 'http://download.moodle.org/environment/environment.zip';
$a->dest = $CFG->dataroot . '/';
print_error($cd->get_error(), 'error', $PAGE->url, $a);
die();
-422
View File
@@ -1027,7 +1027,6 @@
<VENDOR name="oracle" version="10.2" />
</DATABASE>
<PHP version="5.4.4" level="required">
<RESTRICT function="restrict_php_version_7" message="unsupportedphpversion7" />
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
@@ -1135,427 +1134,6 @@
<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_CHECKS>
</MOODLE>
<MOODLE version="2.8" requires="2.2">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mariadb" version="5.5.31" />
<VENDOR name="mysql" version="5.5.31" />
<VENDOR name="postgres" version="9.1" />
<VENDOR name="mssql" version="10.0" />
<VENDOR name="oracle" version="10.2" />
</DATABASE>
<PHP version="5.4.4" level="required">
<RESTRICT function="restrict_php_version_7" message="unsupportedphpversion7" />
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
<ON_CHECK message="pcreunicodewarning" />
</FEEDBACK>
</PCREUNICODE>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
<FEEDBACK>
<ON_CHECK message="mbstringrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="optional">
<FEEDBACK>
<ON_CHECK message="opensslrecommended" />
</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="intl" level="optional">
<FEEDBACK>
<ON_CHECK message="intlrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" 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="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_CHECKS>
</MOODLE>
<MOODLE version="2.9" requires="2.2">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mariadb" version="5.5.31" />
<VENDOR name="mysql" version="5.5.31" />
<VENDOR name="postgres" version="9.1" />
<VENDOR name="mssql" version="10.0" />
<VENDOR name="oracle" version="10.2" />
</DATABASE>
<PHP version="5.4.4" level="required">
<RESTRICT function="restrict_php_version_7" message="unsupportedphpversion7" />
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
<ON_CHECK message="pcreunicodewarning" />
</FEEDBACK>
</PCREUNICODE>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
<FEEDBACK>
<ON_CHECK message="mbstringrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="optional">
<FEEDBACK>
<ON_CHECK message="opensslrecommended" />
</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="intl" level="optional">
<FEEDBACK>
<ON_CHECK message="intlrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" 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_CHECKS>
</MOODLE>
<MOODLE version="3.0" requires="2.2">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mariadb" version="5.5.31" />
<VENDOR name="mysql" version="5.5.31" />
<VENDOR name="postgres" version="9.1" />
<VENDOR name="mssql" version="10.0" />
<VENDOR name="oracle" version="10.2" />
</DATABASE>
<PHP version="5.4.4" level="required">
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
<ON_CHECK message="pcreunicodewarning" />
</FEEDBACK>
</PCREUNICODE>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
<FEEDBACK>
<ON_CHECK message="mbstringrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="optional">
<FEEDBACK>
<ON_CHECK message="opensslrecommended" />
</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="intl" level="optional">
<FEEDBACK>
<ON_CHECK message="intlrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" 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_CHECKS>
</MOODLE>
</COMPATIBILITY_MATRIX>
+24 -33
View File
@@ -88,6 +88,7 @@ core_component::get_core_subsystems();
require_once($CFG->libdir.'/adminlib.php'); // various admin-only functions
require_once($CFG->libdir.'/upgradelib.php'); // general upgrade/install related functions
$id = optional_param('id', '', PARAM_TEXT);
$confirmupgrade = optional_param('confirmupgrade', 0, PARAM_BOOL);
$confirmrelease = optional_param('confirmrelease', 0, PARAM_BOOL);
$confirmplugins = optional_param('confirmplugincheck', 0, PARAM_BOOL);
@@ -513,15 +514,7 @@ if (isguestuser()) {
redirect(get_login_url());
}
$context = context_system::instance();
if (!has_capability('moodle/site:config', $context)) {
// Do not throw exception display an empty page with administration menu if visible for current user.
$PAGE->set_title($SITE->fullname);
$PAGE->set_heading($SITE->fullname);
echo $OUTPUT->header();
echo $OUTPUT->footer();
exit;
}
require_capability('moodle/site:config', $context);
// check that site is properly customized
$site = get_site();
@@ -529,10 +522,14 @@ if (empty($site->shortname)) {
// probably new installation - lets return to frontpage after this step
// remove settings that we want uninitialised
unset_config('registerauth');
unset_config('timezone'); // Force admin to select timezone!
redirect('upgradesettings.php?return=site');
}
// Check if we are returning from moodle.org registration and if so, we mark that fact to remove reminders
if (!empty($id) and $id == $CFG->siteidentifier) {
set_config('registered', time());
}
// setup critical warnings before printing admin tree block
$insecuredataroot = is_dataroot_insecure(true);
$SESSION->admin_critical_warning = ($insecuredataroot==INSECURE_DATAROOT_ERROR);
@@ -558,43 +555,37 @@ if (isset($SESSION->pluginuninstallreturn)) {
// Print default admin page with notifications.
$errorsdisplayed = defined('WARN_DISPLAY_ERRORS_ENABLED');
// We make the assumption that at least one schedule task should run once per day.
$lastcron = $DB->get_field_sql('SELECT MAX(lastruntime) FROM {task_scheduled}');
$lastcron = $DB->get_field_sql('SELECT MAX(lastcron) FROM {modules}');
$cronoverdue = ($lastcron < time() - 3600 * 24);
$dbproblems = $DB->diagnose();
$maintenancemode = !empty($CFG->maintenance_enabled);
// Available updates for Moodle core.
// Available updates for Moodle core
$updateschecker = \core\update\checker::instance();
$availableupdates = array();
$availableupdatesfetch = null;
$availableupdates['core'] = $updateschecker->get_update_info('core',
array('minmaturity' => $CFG->updateminmaturity, 'notifybuilds' => $CFG->updatenotifybuilds));
if (empty($CFG->disableupdatenotifications)) {
// Only compute the update information when it is going to be displayed to the user.
$availableupdates['core'] = $updateschecker->get_update_info('core',
array('minmaturity' => $CFG->updateminmaturity, 'notifybuilds' => $CFG->updatenotifybuilds));
// Available updates for contributed plugins
$pluginman = core_plugin_manager::instance();
foreach ($pluginman->get_plugins() as $plugintype => $plugintypeinstances) {
foreach ($plugintypeinstances as $pluginname => $plugininfo) {
if (!empty($plugininfo->availableupdates)) {
foreach ($plugininfo->availableupdates as $pluginavailableupdate) {
if ($pluginavailableupdate->version > $plugininfo->versiondisk) {
if (!isset($availableupdates[$plugintype.'_'.$pluginname])) {
$availableupdates[$plugintype.'_'.$pluginname] = array();
}
$availableupdates[$plugintype.'_'.$pluginname][] = $pluginavailableupdate;
// Available updates for contributed plugins
$pluginman = core_plugin_manager::instance();
foreach ($pluginman->get_plugins() as $plugintype => $plugintypeinstances) {
foreach ($plugintypeinstances as $pluginname => $plugininfo) {
if (!empty($plugininfo->availableupdates)) {
foreach ($plugininfo->availableupdates as $pluginavailableupdate) {
if ($pluginavailableupdate->version > $plugininfo->versiondisk) {
if (!isset($availableupdates[$plugintype.'_'.$pluginname])) {
$availableupdates[$plugintype.'_'.$pluginname] = array();
}
$availableupdates[$plugintype.'_'.$pluginname][] = $pluginavailableupdate;
}
}
}
}
// The timestamp of the most recent check for available updates
$availableupdatesfetch = $updateschecker->get_last_timefetched();
}
// The timestamp of the most recent check for available updates
$availableupdatesfetch = $updateschecker->get_last_timefetched();
$buggyiconvnomb = (!function_exists('mb_convert_encoding') and @iconv('UTF-8', 'UTF-8//IGNORE', '100'.chr(130).'€') !== '100€');
//check if the site is registered on Moodle.org
$registered = $DB->count_records('registration_hubs', array('huburl' => HUB_MOODLEORGHUBURL, 'confirmed' => 1));
+1 -1
View File
@@ -1,4 +1,4 @@
<?php
<?PHP
// Allows the admin to configure mnet stuff
-9
View File
@@ -94,15 +94,6 @@ class mnet_review_host_form extends moodleform {
$mform->setType('wwwroot', PARAM_URL);
$mform->addRule('wwwroot', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
$options = array(
mnet_peer::SSL_NONE => get_string('none'),
mnet_peer::SSL_HOST => get_string('verifyhostonly', 'core_mnet'),
mnet_peer::SSL_HOST_AND_PEER => get_string('verifyhostandpeer', 'core_mnet')
);
$mform->addElement('select', 'sslverification', get_string('sslverification', 'core_mnet'), $options);
$mform->setDefault('sslverification', mnet_peer::SSL_HOST_AND_PEER);
$mform->addHelpButton('sslverification', 'sslverification', 'core_mnet');
$themes = array('' => get_string('forceno'));
foreach (array_keys(core_component::get_plugin_list('theme')) as $themename) {
$themes[$themename] = get_string('pluginname', 'theme_'.$themename);
-1
View File
@@ -172,7 +172,6 @@ if ($formdata = $reviewform->get_data()) {
$mnet_peer->public_key = $formdata->public_key;
$credentials = $mnet_peer->check_credentials($mnet_peer->public_key);
$mnet_peer->public_key_expires = $credentials['validTo_time_t'];
$mnet_peer->sslverification = $formdata->sslverification;
if ($mnet_peer->commit()) {
redirect(new moodle_url('/admin/mnet/peers.php', array('hostid' => $mnet_peer->id)), get_string('changessaved'));
+9
View File
@@ -34,12 +34,21 @@ if (!defined('MOODLE_INTERNAL')) {
}
$strmnetservices = get_string('mnetservices', 'mnet');
$strmnetlog = get_string('mnetlog', 'mnet');
$strmnetedithost = get_string('reviewhostdetails', 'mnet');
$logurl = $CFG->wwwroot.
'/report/log/index.php?chooselog=1&amp;showusers=1&amp;showcourses=1&amp;host_course='.$mnet_peer->id.
'%2F1&amp;user='.'0'.
'&amp;date=0'.
'&amp;modid=&amp;modaction=0&amp;logformat=showashtml';
$tabs = array();
if (isset($mnet_peer->id) && $mnet_peer->id > 0) {
$tabs[] = new tabobject('mnetdetails', 'peers.php?step=update&amp;hostid='.$mnet_peer->id, $strmnetedithost, $strmnetedithost, false);
$tabs[] = new tabobject('mnetservices', 'services.php?hostid='.$mnet_peer->id, $strmnetservices, $strmnetservices, false);
if ($mnet_peer->application->name == 'moodle' && $mnet_peer->id != $CFG->mnet_all_hosts_id) {
$tabs[] = new tabobject('mnetlog', $logurl, $strmnetlog, $strmnetlog, false);
}
$tabs[] = new tabobject('mnetprofilefields', 'profilefields.php?hostid=' . $mnet_peer->id, get_string('profilefields', 'mnet'), get_string('profilefields', 'mnet'), false);
} else {
$tabs[] = new tabobject('mnetdetails', '#', $strmnetedithost, $strmnetedithost, false);
-19
View File
@@ -66,19 +66,12 @@ if (!empty($hostid) && array_key_exists($hostid, $hosts)) {
$mnet_request->set_method('system/listServices');
$mnet_request->send($mnet_peer);
$services = $mnet_request->response;
$yesno = array('No', 'Yes');
$servicenames = array();
echo $OUTPUT->heading(get_string('servicesavailableonhost', 'mnet', $host->wwwroot));
if (!empty($mnet_request->error)) {
echo $OUTPUT->heading(get_string('error'), 3);
echo html_writer::alist($mnet_request->error);
$services = array();
}
$table = new html_table();
$table->head = array(
get_string('serviceid', 'mnet'),
@@ -134,7 +127,6 @@ if (!empty($hostid) && array_key_exists($hostid, $hosts)) {
echo html_writer::table($table);
$mnet_request = new mnet_xmlrpc_client();
$mnet_request->set_method('system/listMethods');
if (isset($servicename) && array_key_exists($servicename, $serviceinfo)) {
echo $OUTPUT->heading(get_string('methodsavailableonhostinservice', 'mnet', (object)array('host' => $host->wwwroot, 'service' => $servicename)));
@@ -147,11 +139,6 @@ if (!empty($hostid) && array_key_exists($hostid, $hosts)) {
$mnet_request->send($mnet_peer);
$methods = $mnet_request->response;
if (!empty($mnet_request->error)) {
echo $OUTPUT->heading(get_string('error'), 3);
echo html_writer::alist($mnet_request->error);
$methods = array();
}
$table = new html_table();
$table->head = array(
@@ -184,12 +171,6 @@ if (!empty($hostid) && array_key_exists($hostid, $hosts)) {
echo $OUTPUT->heading(get_string('methodsignature', 'mnet', $method));
if (!empty($mnet_request->error)) {
echo $OUTPUT->heading(get_string('error'), 3);
echo html_writer::alist($mnet_request->error);
$signature = array();
}
$table = new html_table();
$table->head = array(
get_string('position', 'mnet'),
+1 -1
View File
@@ -11,7 +11,7 @@
echo '<div class="phpinfo">';
ob_start();
phpinfo(INFO_GENERAL + INFO_CONFIGURATION + INFO_MODULES + INFO_VARIABLES);
phpinfo(INFO_GENERAL + INFO_CONFIGURATION + INFO_MODULES);
$html = ob_get_contents();
ob_end_clean();
+5 -2
View File
@@ -58,14 +58,17 @@ if (!empty($registeredhub) and $registeredhub->token == $token) {
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('registrationconfirmed', 'hub'), 3, 'main');
$hublink = html_writer::tag('a', $hubname, array('href' => $url));
$registeredhub->token = $newtoken;
$registeredhub->confirmed = 1;
$registeredhub->hubname = $hubname;
$registrationmanager->update_registeredhub($registeredhub);
// Display notification message.
echo $OUTPUT->notification(get_string('registrationconfirmedon', 'hub'), 'notifysuccess');
//display notficiation message
$notificationmessage = $OUTPUT->notification(
get_string('registrationconfirmedon', 'hub', $hublink), 'notifysuccess');
echo $notificationmessage;
//display continue button
$registrationpage = new moodle_url('/admin/registration/index.php');
+3 -3
View File
@@ -22,9 +22,9 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com
*
* On this page the administrator selects which hub he wants to register (except for moodle.net)
* Admins can register with moodle.net via the site admin menu "Registration" link.
* On this page the administrator can also unregister from any hubs including moodle.net.
* On this page the administrator selects which hub he wants to register,
* except for MOOCH. Admins can register with MOOCH with the top admin menu "Registration" link.
* On this page the administrator can also unregister from any hubs, including MOOCH.
*/
require('../../config.php');
+27 -28
View File
@@ -53,30 +53,31 @@ class registration_manager {
public function cron() {
global $CFG;
if (extension_loaded('xmlrpc')) {
$function = 'hub_update_site_info';
require_once($CFG->dirroot . "/webservice/xmlrpc/lib.php");
//check if the last registration cron update was less than a week ago
$lastcron = get_config('registration', 'crontime');
if ($lastcron === false or $lastcron < strtotime("-7 day")) { //set to a week, see MDL-23704
$function = 'hub_update_site_info';
require_once($CFG->dirroot . "/webservice/xmlrpc/lib.php");
// Update all hubs where the site is registered.
$hubs = $this->get_registered_on_hubs();
if (empty($hubs)) {
mtrace(get_string('registrationwarning', 'admin'));
}
foreach ($hubs as $hub) {
// Update the registration.
$siteinfo = $this->get_site_info($hub->huburl);
$params = array('siteinfo' => $siteinfo);
$serverurl = $hub->huburl . "/local/hub/webservice/webservices.php";
$xmlrpcclient = new webservice_xmlrpc_client($serverurl, $hub->token);
try {
$result = $xmlrpcclient->call($function, $params);
$this->update_registeredhub($hub); // To update timemodified.
mtrace(get_string('siteupdatedcron', 'hub', $hub->hubname));
} catch (Exception $e) {
$errorparam = new stdClass();
$errorparam->errormessage = $e->getMessage();
$errorparam->hubname = $hub->hubname;
mtrace(get_string('errorcron', 'hub', $errorparam));
//update all hub where the site is registered on
$hubs = $this->get_registered_on_hubs();
foreach ($hubs as $hub) {
//update the registration
$siteinfo = $this->get_site_info($hub->huburl);
$params = array('siteinfo' => $siteinfo);
$serverurl = $hub->huburl . "/local/hub/webservice/webservices.php";
$xmlrpcclient = new webservice_xmlrpc_client($serverurl, $hub->token);
try {
$result = $xmlrpcclient->call($function, $params);
mtrace(get_string('siteupdatedcron', 'hub', $hub->hubname));
} catch (Exception $e) {
$errorparam = new stdClass();
$errorparam->errormessage = $e->getMessage();
$errorparam->hubname = $hub->hubname;
mtrace(get_string('errorcron', 'hub', $errorparam));
}
}
set_config('crontime', time(), 'registration');
}
} else {
mtrace(get_string('errorcronnoxmlrpc', 'hub'));
@@ -117,7 +118,6 @@ class registration_manager {
*/
public function add_registeredhub($hub) {
global $DB;
$hub->timemodified = time();
$id = $DB->insert_record('registration_hubs', $hub);
return $id;
}
@@ -171,16 +171,15 @@ class registration_manager {
/**
* Update a registered hub (mostly use to update the confirmation status)
* @param object $hub the hub
* @param object $communication the hub
*/
public function update_registeredhub($hub) {
public function update_registeredhub($communication) {
global $DB;
$hub->timemodified = time();
$DB->update_record('registration_hubs', $hub);
$DB->update_record('registration_hubs', $communication);
}
/**
* Return all hubs where the site is registered
* Return all hubs where the site is registered on
*/
public function get_registered_on_hubs() {
global $DB;
+1 -16
View File
@@ -39,8 +39,6 @@ require_once($CFG->dirroot . '/' . $CFG->admin . '/registration/forms.php');
require_once($CFG->dirroot . '/webservice/lib.php');
require_once($CFG->dirroot . '/' . $CFG->admin . '/registration/lib.php');
require_sesskey();
$huburl = required_param('huburl', PARAM_URL);
$huburl = rtrim($huburl, "/");
@@ -118,7 +116,6 @@ if ($update and confirm_sesskey()) {
$xmlrpcclient = new webservice_xmlrpc_client($serverurl, $registeredhub->token);
try {
$result = $xmlrpcclient->call($function, $params);
$registrationmanager->update_registeredhub($registeredhub); // To update timemodified.
} catch (Exception $e) {
$error = $OUTPUT->notification(get_string('errorregistration', 'hub', $e->getMessage()));
}
@@ -178,20 +175,8 @@ if (!empty($error)) {
echo $error;
}
// Some Moodle.org registration explanation.
//some Moodle.org resitration explanation
if ($huburl == HUB_MOODLEORGHUBURL) {
if (!empty($registeredhub->token)) {
if ($registeredhub->timemodified == 0) {
$registrationmessage = get_string('pleaserefreshregistrationunknown', 'admin');
} else {
$lastupdated = userdate($registeredhub->timemodified, get_string('strftimedate', 'langconfig'));
$registrationmessage = get_string('pleaserefreshregistration', 'admin', $lastupdated);
}
} else {
$registrationmessage = get_string('registrationwarning', 'admin');
}
echo $OUTPUT->notification($registrationmessage);
echo $OUTPUT->heading(get_string('registerwithmoodleorg', 'admin'));
$renderer = $PAGE->get_renderer('core', 'register');
echo $renderer->moodleorg_registration_message();
+7 -7
View File
@@ -31,18 +31,18 @@
class core_register_renderer extends plugin_renderer_base {
/**
* Display message about the benefits of registering on Moodle.org
* Display Moodle.org registration message about benefit to register on Moodle.org
*
* @return string
*/
public function moodleorg_registration_message() {
$moodleorgstatslink = html_writer::link('http://moodle.net/stats',
get_string('statsmoodleorg', 'admin'),
array('target' => '_blank'));
$moodleorgregmsg = get_string('registermoodleorg', 'admin');
$moodleorgurl = html_writer::link('http://moodle.org', 'Moodle.org');
$moodleorgstatsurl = html_writer::link('http://moodle.org/stats', get_string('statsmoodleorg', 'admin'));
$moochurl = html_writer::link(HUB_MOODLEORGHUBURL, get_string('moodleorghubname', 'admin'));
$moodleorgregmsg = get_string('registermoodleorg', 'admin', $moodleorgurl);
$items = array(get_string('registermoodleorgli1', 'admin'),
get_string('registermoodleorgli2', 'admin', $moodleorgstatslink));
get_string('registermoodleorgli2', 'admin', $moodleorgstatsurl),
get_string('registermoodleorgli3', 'admin', $moochurl));
$moodleorgregmsg .= html_writer::alist($items);
return $moodleorgregmsg;
}
+11 -22
View File
@@ -721,8 +721,6 @@ class core_admin_renderer extends plugin_renderer_base {
foreach ($updates['core'] as $update) {
$updateinfo .= $this->moodle_available_update_info($update);
}
$updateinfo .= html_writer::tag('p', get_string('updateavailablerecommendation', 'core_admin'),
array('class' => 'updateavailablerecommendation'));
}
unset($updates['core']);
// If something has left in the $updates array now, it is updates for plugins.
@@ -1041,28 +1039,19 @@ class core_admin_renderer extends plugin_renderer_base {
}
foreach ($plugin->get_other_required_plugins() as $component => $requiredversion) {
$ok = true;
$otherplugin = $pluginman->get_plugin_info($component);
$actions = array();
if (is_null($otherplugin)) {
// The required plugin is not installed.
$class = 'requires-failed requires-missing';
$installurl = new moodle_url('https://moodle.org/plugins/view.php', array('plugin' => $component));
$uploadurl = new moodle_url('/admin/tool/installaddon/');
$actions[] = html_writer::link($installurl, get_string('dependencyinstall', 'core_plugin'));
$actions[] = html_writer::link($uploadurl, get_string('dependencyupload', 'core_plugin'));
$ok = false;
} else if ($requiredversion != ANY_VERSION and $otherplugin->versiondisk < $requiredversion) {
// The required plugin is installed but needs to be updated.
$class = 'requires-failed requires-outdated';
if (!$otherplugin->is_standard()) {
$updateurl = new moodle_url($this->page->url, array('sesskey' => sesskey(), 'fetchupdates' => 1));
$actions[] = html_writer::link($updateurl, get_string('checkforupdates', 'core_plugin'));
}
$ok = false;
}
} else {
// Already installed plugin with sufficient version.
if ($ok) {
$class = 'requires-ok';
} else {
$class = 'requires-failed';
}
if ($requiredversion != ANY_VERSION) {
@@ -1070,11 +1059,11 @@ class core_admin_renderer extends plugin_renderer_base {
} else {
$str = 'otherplugin';
}
$componenturl = new moodle_url('https://moodle.org/plugins/view.php?plugin='.$component);
$componenturl = html_writer::tag('a', $component, array('href' => $componenturl->out()));
$requires[] = html_writer::tag('li',
html_writer::div(get_string($str, 'core_plugin',
array('component' => $component, 'version' => $requiredversion)), 'component').
html_writer::div(implode(' | ', $actions), 'actions'),
get_string($str, 'core_plugin',
array('component' => $componenturl, 'version' => $requiredversion)),
array('class' => $class));
}
+2 -6
View File
@@ -50,8 +50,7 @@ $table->set_attribute('class', 'admintable generaltable');
$table->setup();
$plugins = array();
$availableplugins = core_component::get_plugin_list('report');
foreach ($availableplugins as $plugin => $plugindir) {
foreach (core_component::get_plugin_list('report') as $plugin => $plugindir) {
if (get_string_manager()->string_exists('pluginname', 'report_' . $plugin)) {
$strpluginname = get_string('pluginname', 'report_' . $plugin);
} else {
@@ -81,10 +80,7 @@ foreach ($plugins as $plugin => $name) {
$uninstall = html_writer::link($uninstallurl, $struninstall);
}
$stores = array();
if (isset($availableplugins[$plugin])) {
$stores = $logmanager->get_supported_logstores('report_' . $plugin);
}
$stores = $logmanager->get_supported_logstores('report_' . $plugin);
if ($stores === false) {
$supportedstores = get_string('logstorenotrequired', 'admin');
} else if (!empty($stores)) {
+4 -14
View File
@@ -264,7 +264,6 @@ if (($action == 'edit') || ($action == 'new')) {
$strshow = get_string('on', 'repository');
$strhide = get_string('off', 'repository');
$strdelete = get_string('disabled', 'repository');
$struninstall = get_string('uninstallplugin', 'core_admin');
$actionchoicesforexisting = array(
'show' => $strshow,
@@ -287,9 +286,9 @@ if (($action == 'edit') || ($action == 'new')) {
// Table to list plug-ins
$table = new html_table();
$table->head = array(get_string('name'), get_string('isactive', 'repository'), get_string('order'), $settingsstr, $struninstall);
$table->head = array(get_string('name'), get_string('isactive', 'repository'), get_string('order'), $settingsstr);
$table->colclasses = array('leftalign', 'centeralign', 'centeralign', 'centeralign', 'centeralign', 'centeralign');
$table->colclasses = array('leftalign', 'centeralign', 'centeralign', 'centeralign', 'centeralign');
$table->id = 'repositoriessetting';
$table->data = array();
$table->attributes['class'] = 'admintable generaltable';
@@ -385,12 +384,7 @@ if (($action == 'edit') || ($action == 'new')) {
$updowncount++;
$uninstall = '';
if ($uninstallurl = core_plugin_manager::instance()->get_uninstall_url('repository_' . $typename, 'manage')) {
$uninstall = html_writer::link($uninstallurl, $struninstall);
}
$table->data[] = array($i->get_readablename(), $OUTPUT->render($select), $updown, $settings, $uninstall);
$table->data[] = array($i->get_readablename(), $OUTPUT->render($select), $updown, $settings);
if (!in_array($typename, $alreadyplugins)) {
$alreadyplugins[] = $typename;
@@ -406,11 +400,7 @@ if (($action == 'edit') || ($action == 'new')) {
if (!in_array($plugin, $alreadyplugins)) {
$select = new single_select(repository_action_url($plugin, 'repos'), 'action', $actionchoicesfornew, 'delete', null, 'applyto' . basename($plugin));
$select->set_label(get_string('action'), array('class' => 'accesshide'));
$uninstall = '';
if ($uninstallurl = core_plugin_manager::instance()->get_uninstall_url('repository_' . $plugin, 'manage')) {
$uninstall = html_writer::link($uninstallurl, $struninstall);
}
$table->data[] = array(get_string('pluginname', 'repository_'.$plugin), $OUTPUT->render($select), '', '', $uninstall);
$table->data[] = array(get_string('pluginname', 'repository_'.$plugin), $OUTPUT->render($select), '', '');
}
}
}
-5
View File
@@ -135,11 +135,6 @@ if ($roleid) {
}
}
if (!empty($user) && ($user->id != $USER->id)) {
$PAGE->navigation->extend_for_user($user);
$PAGE->navbar->includesettingsbase = true;
}
$PAGE->set_pagelayout('admin');
$PAGE->set_title($title);
-1
View File
@@ -52,7 +52,6 @@ if (!has_any_capability(array('moodle/role:assign', 'moodle/role:safeoverride',
$PAGE->set_url($url);
if ($context->contextlevel == CONTEXT_USER and $USER->id != $context->instanceid) {
$PAGE->navbar->includesettingsbase = true;
$PAGE->navigation->extend_for_user($user);
$PAGE->set_context(context_course::instance($course->id));
} else {
@@ -472,9 +472,7 @@ class core_role_define_role_table_advanced extends core_role_capability_table_wi
}
protected function get_description_field($id) {
return '<textarea class="form-textarea" id="'. s($id) .'" name="description" rows="10" cols="50">' .
htmlspecialchars($this->role->description) .
'</textarea>';
return print_textarea(true, 10, 50, 50, 10, 'description', $this->role->description, 0, true);
}
protected function get_archetype_field($id) {
+5 -14
View File
@@ -41,24 +41,15 @@ class core_role_existing_role_holders extends core_role_assign_user_selector_bas
list($sort, $sortparams) = users_order_by_sql('u', $search, $this->accesscontext);
$params = array_merge($params, $sortparams);
$fields = "SELECT ra.id AS raid," . $this->required_fields_sql('u') . ",ra.contextid,ra.component ";
$countfields = "SELECT COUNT(1) ";
$sql = "FROM {role_assignments} ra
$sql = "SELECT ra.id AS raid," . $this->required_fields_sql('u') . ",ra.contextid,ra.component
FROM {role_assignments} ra
JOIN {user} u ON u.id = ra.userid
JOIN {context} ctx ON ra.contextid = ctx.id
WHERE $wherecondition
AND ctx.id $ctxcondition
AND ra.roleid = :roleid";
$order = " ORDER BY ctx.depth DESC, ra.component, $sort";
if (!$this->is_validating()) {
$existinguserscount = $DB->count_records_sql($countfields . $sql, $params);
if ($existinguserscount > $this->maxusersperpage) {
return $this->too_many_results($search, $existinguserscount);
}
}
$contextusers = $DB->get_records_sql($fields . $sql . $order, $params);
AND ra.roleid = :roleid
ORDER BY ctx.depth DESC, ra.component, $sort";
$contextusers = $DB->get_records_sql($sql, $params);
// No users at all.
if (empty($contextusers)) {
@@ -48,12 +48,11 @@ class core_role_potential_assignees_below_course extends core_role_assign_user_s
$fields = 'SELECT ' . $this->required_fields_sql('u');
$countfields = 'SELECT COUNT(u.id)';
$sql = " FROM ($enrolsql) enrolled_users_view
JOIN {user} u ON u.id = enrolled_users_view.id
LEFT JOIN {role_assignments} ra ON (ra.userid = enrolled_users_view.id AND
ra.roleid = :roleid AND ra.contextid = :contextid)
WHERE ra.id IS NULL
$wherecondition";
$sql = " FROM {user} u
LEFT JOIN {role_assignments} ra ON (ra.userid = u.id AND ra.roleid = :roleid AND ra.contextid = :contextid)
WHERE u.id IN ($enrolsql)
$wherecondition
AND ra.id IS NULL";
$params['contextid'] = $this->context->id;
$params['roleid'] = $this->roleid;
+2 -2
View File
@@ -53,9 +53,9 @@ M.core_role.init_cap_table_filter = function(Y, tableid, contextid) {
// Create the capability search input.
this.input = Y.Node.create('<input type="text" id="'+this.table.get('id')+'capabilitysearch" value="'+Y.Escape.html(filtervalue)+'" />');
// Create a label for the search input.
this.label = Y.Node.create('<label for="'+this.input.get('id')+'">'+M.util.get_string('filter', 'moodle')+' </label>');
this.label = Y.Node.create('<label for="'+this.input.get('id')+'">'+M.str.moodle.filter+' </label>');
// Create a clear button to clear the input.
this.button = Y.Node.create('<input type="button" value="'+M.util.get_string('clear', 'moodle')+'" />').set('disabled', filtervalue=='');
this.button = Y.Node.create('<input type="button" value="'+M.str.moodle.clear+'" />').set('disabled', filtervalue=='');
// Tie it all together
this.div.append(this.label).append(this.input).append(this.button);
+1 -2
View File
@@ -59,9 +59,8 @@ require_capability('moodle/role:review', $context);
$PAGE->set_url($url);
if ($context->contextlevel == CONTEXT_USER and $USER->id != $context->instanceid) {
$PAGE->navbar->includesettingsbase = true;
$PAGE->navigation->extend_for_user($user);
$PAGE->set_context(context_user::instance($user->id));
$PAGE->set_context(context_course::instance($course->id));
} else {
$PAGE->set_context($context);
}
+1 -1
View File
@@ -132,7 +132,7 @@ if ($courseid == SITEID) {
$PAGE->set_heading($course->fullname.': '.$fullname);
}
echo $OUTPUT->header();
echo $OUTPUT->heading($title);
echo $OUTPUT->heading($title, 3);
echo $OUTPUT->box_start('generalbox boxaligncenter boxwidthnormal');
// Display them.
+3 -3
View File
@@ -22,6 +22,7 @@ if ($data = data_submitted() and confirm_sesskey()) {
if (admin_write_settings($data)) {
$statusmsg = get_string('changessaved');
}
$adminroot = admin_get_root(true); //reload tree
if (!empty($adminroot->errors)) {
$errormsg = get_string('errorwithsettings', 'admin');
@@ -43,11 +44,10 @@ if ($errormsg !== '') {
$resultshtml = admin_search_settings_html($query); // case insensitive search only
echo '<form action="' . $PAGE->url->out(true) . '" method="post" id="adminsettings">';
echo '<form action="search.php" method="post" id="adminsettings">';
echo '<div>';
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
// HACK to prevent browsers from automatically inserting the user's password into the wrong fields.
echo prevent_form_autofill_password();
echo '<input type="hidden" name="query" value="'.s($query).'" />';
echo '</div>';
echo '<fieldset>';
echo '<div class="clearer"><!-- --></div>';
+1 -4
View File
@@ -48,6 +48,7 @@ if ($data = data_submitted() and confirm_sesskey()) {
$errormsg = get_string('errorwithsettings', 'admin');
$firsterror = reset($adminroot->errors);
}
$adminroot = admin_get_root(true); //reload tree
$settingspage = $adminroot->locate($section, true);
}
@@ -77,8 +78,6 @@ if (empty($SITE->fullname)) {
echo html_writer::input_hidden_params($PAGE->url);
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
echo '<input type="hidden" name="return" value="'.$return.'" />';
// HACK to prevent browsers from automatically inserting the user's password into the wrong fields.
echo prevent_form_autofill_password();
echo $settingspage->output_html();
@@ -121,8 +120,6 @@ if (empty($SITE->fullname)) {
echo html_writer::input_hidden_params($PAGE->url);
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
echo '<input type="hidden" name="return" value="'.$return.'" />';
// HACK to prevent browsers from automatically inserting the user's password into the wrong fields.
echo prevent_form_autofill_password();
echo $OUTPUT->heading($settingspage->visiblename);
echo $settingspage->output_html();
+7 -35
View File
@@ -23,17 +23,6 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) { // sp
$temp->add(new admin_setting_configcheckbox('allowuserblockhiding', new lang_string('allowuserblockhiding', 'admin'), new lang_string('configallowuserblockhiding', 'admin'), 1));
$temp->add(new admin_setting_configcheckbox('allowblockstodock', new lang_string('allowblockstodock', 'admin'), new lang_string('configallowblockstodock', 'admin'), 1));
$temp->add(new admin_setting_configtextarea('custommenuitems', new lang_string('custommenuitems', 'admin'), new lang_string('configcustommenuitems', 'admin'), '', PARAM_TEXT, '50', '10'));
$temp->add(new admin_setting_configtextarea(
'customusermenuitems',
new lang_string('customusermenuitems', 'admin'),
new lang_string('configcustomusermenuitems', 'admin'),
'grades,grades|/grade/report/mygrades.php|grades
messages,message|/message/index.php|message
preferences,moodle|/user/preferences.php|preferences',
PARAM_TEXT,
'50',
'10'
));
$temp->add(new admin_setting_configcheckbox('enabledevicedetection', new lang_string('enabledevicedetection', 'admin'), new lang_string('configenabledevicedetection', 'admin'), 1));
$temp->add(new admin_setting_devicedetectregex('devicedetectregex', new lang_string('devicedetectregex', 'admin'), new lang_string('devicedetectregex_desc', 'admin'), ''));
$ADMIN->add('themes', $temp);
@@ -64,8 +53,7 @@ preferences,moodle|/user/preferences.php|preferences',
array('0' => new lang_string('default', 'calendar'),
'%I:%M %p' => new lang_string('timeformat_12', 'calendar'),
'%H:%M' => new lang_string('timeformat_24', 'calendar'))));
$temp->add(new admin_setting_configselect('calendar_startwday', new lang_string('configstartwday', 'admin'),
new lang_string('helpstartofweek', 'admin'), get_string('firstdayofweek', 'langconfig'),
$temp->add(new admin_setting_configselect('calendar_startwday', new lang_string('configstartwday', 'admin'), new lang_string('helpstartofweek', 'admin'), 0,
array(
0 => new lang_string('sunday', 'calendar'),
1 => new lang_string('monday', 'calendar'),
@@ -76,24 +64,11 @@ preferences,moodle|/user/preferences.php|preferences',
6 => new lang_string('saturday', 'calendar')
)));
$temp->add(new admin_setting_special_calendar_weekend());
$options = array(365 => new lang_string('numyear', '', 1),
270 => new lang_string('nummonths', '', 9),
180 => new lang_string('nummonths', '', 6),
150 => new lang_string('nummonths', '', 5),
120 => new lang_string('nummonths', '', 4),
90 => new lang_string('nummonths', '', 3),
60 => new lang_string('nummonths', '', 2),
30 => new lang_string('nummonth', '', 1),
21 => new lang_string('numweeks', '', 3),
14 => new lang_string('numweeks', '', 2),
7 => new lang_string('numweek', '', 1),
6 => new lang_string('numdays', '', 6),
5 => new lang_string('numdays', '', 5),
4 => new lang_string('numdays', '', 4),
3 => new lang_string('numdays', '', 3),
2 => new lang_string('numdays', '', 2),
1 => new lang_string('numday', '', 1));
$temp->add(new admin_setting_configselect('calendar_lookahead', new lang_string('configlookahead', 'admin'), new lang_string('helpupcominglookahead', 'admin'), 21, $options));
$options = array();
for ($i=1; $i<=99; $i++) {
$options[$i] = $i;
}
$temp->add(new admin_setting_configselect('calendar_lookahead',new lang_string('configlookahead','admin'),new lang_string('helpupcominglookahead', 'admin'),21,$options));
$options = array();
for ($i=1; $i<=20; $i++) {
$options[$i] = $i;
@@ -141,14 +116,12 @@ preferences,moodle|/user/preferences.php|preferences',
HOMEPAGE_MY => new lang_string('mymoodle', 'admin'),
HOMEPAGE_USER => new lang_string('userpreference', 'admin')
);
$temp->add(new admin_setting_configselect('defaulthomepage', new lang_string('defaulthomepage', 'admin'),
new lang_string('configdefaulthomepage', 'admin'), HOMEPAGE_MY, $choices));
$temp->add(new admin_setting_configselect('defaulthomepage', new lang_string('defaulthomepage', 'admin'), new lang_string('configdefaulthomepage', 'admin'), HOMEPAGE_SITE, $choices));
$temp->add(new admin_setting_configcheckbox('allowguestmymoodle', new lang_string('allowguestmymoodle', 'admin'), new lang_string('configallowguestmymoodle', 'admin'), 1));
$temp->add(new admin_setting_configcheckbox('navshowfullcoursenames', new lang_string('navshowfullcoursenames', 'admin'), new lang_string('navshowfullcoursenames_help', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('navshowcategories', new lang_string('navshowcategories', 'admin'), new lang_string('confignavshowcategories', 'admin'), 1));
$temp->add(new admin_setting_configcheckbox('navshowmycoursecategories', new lang_string('navshowmycoursecategories', 'admin'), new lang_string('navshowmycoursecategories_help', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('navshowallcourses', new lang_string('navshowallcourses', 'admin'), new lang_string('confignavshowallcourses', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('navexpandmycourses', new lang_string('navexpandmycourses', 'admin'), new lang_string('navexpandmycourses_desc', 'admin'), 1));
$sortoptions = array(
'sortorder' => new lang_string('sort_sortorder', 'admin'),
'fullname' => new lang_string('sort_fullname', 'admin'),
@@ -159,7 +132,6 @@ preferences,moodle|/user/preferences.php|preferences',
$temp->add(new admin_setting_configtext('navcourselimit',new lang_string('navcourselimit','admin'),new lang_string('confignavcourselimit', 'admin'),20,PARAM_INT));
$temp->add(new admin_setting_configcheckbox('usesitenameforsitepages', new lang_string('usesitenameforsitepages', 'admin'), new lang_string('configusesitenameforsitepages', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('linkadmincategories', new lang_string('linkadmincategories', 'admin'), new lang_string('linkadmincategories_help', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('linkcoursesections', new lang_string('linkcoursesections', 'admin'), new lang_string('linkcoursesections_help', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('navshowfrontpagemods', new lang_string('navshowfrontpagemods', 'admin'), new lang_string('navshowfrontpagemods_help', 'admin'), 1));
$temp->add(new admin_setting_configcheckbox('navadduserpostslinks', new lang_string('navadduserpostslinks', 'admin'), new lang_string('navadduserpostslinks_help', 'admin'), 1));
+2 -8
View File
@@ -46,7 +46,7 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
$ADMIN->add('courses',
new admin_externalpage('restorecourse', new lang_string('restorecourse', 'admin'),
new moodle_url('/backup/restorefile.php', array('contextid' => context_system::instance()->id)),
array('moodle/restore:restorecourse')
array('moodle/course:create')
)
);
@@ -196,10 +196,6 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_logs', new lang_string('generallogs','backup'), new lang_string('configgenerallogs','backup'), array('value'=>0, 'locked'=>0)));
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_histories', new lang_string('generalhistories','backup'), new lang_string('configgeneralhistories','backup'), array('value'=>0, 'locked'=>0)));
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_questionbank', new lang_string('generalquestionbank','backup'), new lang_string('configgeneralquestionbank','backup'), array('value'=>1, 'locked'=>0)));
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_groups',
new lang_string('generalgroups', 'backup'), new lang_string('configgeneralgroups', 'backup'),
array('value' => 1, 'locked' => 0)));
$ADMIN->add('backups', $temp);
// Create a page for general import configuration and defaults.
@@ -225,7 +221,7 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
2 => new lang_string('storagecourseandexternal', 'backup')
);
$temp->add(new admin_setting_configselect('backup/backup_auto_storage', new lang_string('automatedstorage', 'backup'), new lang_string('automatedstoragehelp', 'backup'), 0, $storageoptions));
$temp->add(new admin_setting_special_backup_auto_destination());
$temp->add(new admin_setting_configdirectory('backup/backup_auto_destination', new lang_string('saveto'), new lang_string('backupsavetohelp'), ''));
$keepoptoins = array(
0 => new lang_string('all'), 1 => '1',
2 => '2',
@@ -275,8 +271,6 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_logs', new lang_string('generallogs', 'backup'), new lang_string('configgenerallogs', 'backup'), 0));
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_histories', new lang_string('generalhistories','backup'), new lang_string('configgeneralhistories','backup'), 0));
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_questionbank', new lang_string('generalquestionbank','backup'), new lang_string('configgeneralquestionbank','backup'), 1));
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_groups', new lang_string('generalgroups', 'backup'),
new lang_string('configgeneralgroups', 'backup'), 1));
//$temp->add(new admin_setting_configcheckbox('backup/backup_auto_messages', new lang_string('messages', 'message'), new lang_string('backupmessageshelp','message'), 0));
//$temp->add(new admin_setting_configcheckbox('backup/backup_auto_blogs', new lang_string('blogs', 'blog'), new lang_string('backupblogshelp','blog'), 0));
+10
View File
@@ -11,6 +11,7 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
//TODO: Re-enable cc-import once re-implemented in 2.0.x
//$temp->add(new admin_setting_configcheckbox('enableimsccimport', new lang_string('enable_cc_import', 'imscc'), new lang_string('enable_cc_import_description', 'imscc'), 0));
$temp->add(new admin_setting_configcheckbox('enablesafebrowserintegration', new lang_string('enablesafebrowserintegration', 'admin'), new lang_string('configenablesafebrowserintegration', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('enablegroupmembersonly', new lang_string('enablegroupmembersonly', 'admin'), new lang_string('configenablegroupmembersonly', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('dndallowtextandlinks', new lang_string('dndallowtextandlinks', 'admin'), new lang_string('configdndallowtextandlinks', 'admin'), 0));
// The CSS optimiser setting. When changed we need to reset the theme caches in order to ensure they are regenerated through the optimiser.
@@ -18,6 +19,15 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
$enablecssoptimiser->set_updatedcallback('theme_reset_all_caches');
$temp->add($enablecssoptimiser);
// Backup archive .mbz format: switching to .tar.gz enables larger files, better
// progress reporting and possibly better performance. This is an experimental
// setting but if successful, should be removed and enabled by default in a future
// version. Note: this setting controls newly-created backups only; restore always
// supports both formats.
$temp->add(new admin_setting_configcheckbox('enabletgzbackups',
new lang_string('enabletgzbackups', 'admin'),
new lang_string('enabletgzbackups_desc', 'admin'), 0));
$ADMIN->add('experimental', $temp);
// "debugging" settingpage
+6 -16
View File
@@ -68,20 +68,9 @@ if (has_capability('moodle/grade:manage', $systemcontext)
$temp->add(new admin_setting_special_gradelimiting());
$temp->add(new admin_setting_configcheckbox('grade_report_showmin',
get_string('minimum_show', 'grades'),
get_string('minimum_show_help', 'grades'), '1'));
$temp->add(new admin_setting_special_gradepointmax());
$temp->add(new admin_setting_special_gradepointdefault());
$temp->add(new admin_setting_special_grademinmaxtouse());
$temp->add(new admin_setting_my_grades_report());
$temp->add(new admin_setting_configtext('gradereport_mygradeurl', new lang_string('externalurl', 'grades'),
new lang_string('externalurl_desc', 'grades'), ''));
}
$ADMIN->add('grades', $temp);
@@ -103,9 +92,11 @@ if (has_capability('moodle/grade:manage', $systemcontext)
GRADE_AGGREGATE_MODE =>new lang_string('aggregatemode', 'grades'),
GRADE_AGGREGATE_SUM =>new lang_string('aggregatesum', 'grades'));
$defaultvisible = array(GRADE_AGGREGATE_SUM);
$defaultvisible = array(GRADE_AGGREGATE_MEAN, GRADE_AGGREGATE_WEIGHTED_MEAN, GRADE_AGGREGATE_WEIGHTED_MEAN2,
GRADE_AGGREGATE_EXTRACREDIT_MEAN, GRADE_AGGREGATE_MEDIAN, GRADE_AGGREGATE_MIN,
GRADE_AGGREGATE_MAX, GRADE_AGGREGATE_MODE, GRADE_AGGREGATE_SUM);
$defaults = array('value' => GRADE_AGGREGATE_SUM, 'forced' => false, 'adv' => false);
$defaults = array('value'=>GRADE_AGGREGATE_WEIGHTED_MEAN2, 'forced'=>false, 'adv'=>false);
$temp->add(new admin_setting_gradecat_combo('grade_aggregation', new lang_string('aggregation', 'grades'), new lang_string('aggregation_help', 'grades'), $defaults, $options));
$temp->add(new admin_setting_configmultiselect('grade_aggregations_visible', new lang_string('aggregationsvisible', 'grades'),
@@ -119,6 +110,8 @@ if (has_capability('moodle/grade:manage', $systemcontext)
$defaults = array('value'=>0, 'forced'=>false, 'adv'=>true);
$temp->add(new admin_setting_gradecat_combo('grade_aggregateoutcomes', new lang_string('aggregateoutcomes', 'grades'),
new lang_string('aggregateoutcomes_help', 'grades'), $defaults, $options));
$temp->add(new admin_setting_gradecat_combo('grade_aggregatesubcats', new lang_string('aggregatesubcats', 'grades'),
new lang_string('aggregatesubcats_help', 'grades'), $defaults, $options));
$options = array(0 => new lang_string('none'));
for ($i=1; $i<=20; $i++) {
@@ -132,9 +125,6 @@ if (has_capability('moodle/grade:manage', $systemcontext)
$defaults['forced'] = false;
$temp->add(new admin_setting_gradecat_combo('grade_droplow', new lang_string('droplow', 'grades'),
new lang_string('droplow_help', 'grades'), $defaults, $options));
$temp->add(new admin_setting_configcheckbox('grade_overridecat', new lang_string('overridecat', 'grades'),
new lang_string('overridecat_help', 'grades'), 1));
}
$ADMIN->add('grades', $temp);
+5 -2
View File
@@ -4,8 +4,11 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
// "locations" settingpage
$temp = new admin_settingpage('locationsettings', new lang_string('locationsettings', 'admin'));
$temp->add(new admin_setting_servertimezone());
$temp->add(new admin_setting_forcetimezone());
$options = get_list_of_timezones();
$options[99] = new lang_string('serverlocaltime');
$temp->add(new admin_setting_configselect('timezone', new lang_string('timezone','admin'), new lang_string('configtimezone', 'admin'), 99, $options));
$options[99] = new lang_string('timezonenotforced', 'admin');
$temp->add(new admin_setting_configselect('forcetimezone', new lang_string('forcetimezone', 'admin'), new lang_string('helpforcetimezone', 'admin'), 99, $options));
$temp->add(new admin_settings_country_select('country', new lang_string('country', 'admin'), new lang_string('configcountry', 'admin'), 0));
$temp->add(new admin_setting_configtext('defaultcity', new lang_string('defaultcity', 'admin'), new lang_string('defaultcity_help', 'admin'), ''));
+4 -12
View File
@@ -32,13 +32,6 @@ if ($hassiteconfig) {
// activity modules
$ADMIN->add('modules', new admin_category('modsettings', new lang_string('activitymodules')));
$temp = new admin_settingpage('managemodulescommon', new lang_string('commonsettings', 'admin'));
$temp->add(new admin_setting_configcheckbox('requiremodintro',
get_string('requiremodintro', 'admin'), get_string('requiremodintro_desc', 'admin'), 0));
$ADMIN->add('modsettings', $temp);
$ADMIN->add('modsettings', new admin_page_managemods());
foreach (core_plugin_manager::instance()->get_plugins_of_type('mod') as $plugin) {
/** @var \core\plugininfo\mod $plugin */
@@ -84,10 +77,6 @@ if ($hassiteconfig) {
$temp->add(new admin_setting_configcheckbox('loginpageautofocus', new lang_string('loginpageautofocus', 'admin'), new lang_string('loginpageautofocus_help', 'admin'), 0));
$temp->add(new admin_setting_configselect('guestloginbutton', new lang_string('guestloginbutton', 'auth'),
new lang_string('showguestlogin', 'auth'), '1', array('0'=>new lang_string('hide'), '1'=>new lang_string('show'))));
$options = array(0 => get_string('no'), 1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 10 => 10, 20 => 20, 50 => 50);
$temp->add(new admin_setting_configselect('limitconcurrentlogins',
new lang_string('limitconcurrentlogins', 'core_auth'),
new lang_string('limitconcurrentlogins_desc', 'core_auth'), 0, $options));
$temp->add(new admin_setting_configtext('alternateloginurl', new lang_string('alternateloginurl', 'auth'),
new lang_string('alternatelogin', 'auth', htmlspecialchars(get_login_url())), ''));
$temp->add(new admin_setting_configtext('forgottenpasswordurl', new lang_string('forgottenpasswordurl', 'auth'),
@@ -289,6 +278,9 @@ if ($hassiteconfig) {
$ADMIN->add('webservicesettings', new admin_externalpage('webservicedocumentation', new lang_string('wsdocapi', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/documentation.php", 'moodle/site:config', false));
/// manage service
$temp = new admin_settingpage('externalservices', new lang_string('externalservices', 'webservice'));
$temp->add(new admin_setting_enablemobileservice('enablemobilewebservice',
new lang_string('enablemobilewebservice', 'admin'),
new lang_string('configenablemobilewebservice', 'admin', $enablemobiledoclink), 0));
$temp->add(new admin_setting_heading('manageserviceshelpexplaination', new lang_string('information', 'webservice'), new lang_string('servicehelpexplanation', 'webservice')));
$temp->add(new admin_setting_manageexternalservices());
$ADMIN->add('webservicesettings', $temp);
@@ -366,7 +358,7 @@ if ($hassiteconfig || has_capability('moodle/question:config', $systemcontext))
2 => get_string('showmarkandmax', 'question'),
);
$settings->add(new admin_setting_configselect('question_preview/marks',
get_string('marks', 'question'), '', 2, $marksoptions));
get_string('marks', 'question'), '', 1, $marksoptions));
$settings->add(new admin_setting_configselect('question_preview/markdp',
get_string('decimalplacesingrades', 'question'), '', 2, array(0, 1, 2, 3, 4, 5, 6, 7)));
+2 -12
View File
@@ -35,8 +35,7 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
$params = new stdClass();
$params->bytes = $defaultuserquota;
$params->displaysize = display_size($defaultuserquota);
$temp->add(new admin_setting_configtext('userquota', new lang_string('userquota', 'admin'),
new lang_string('configuserquota', 'admin', $params), $defaultuserquota, PARAM_INT, 30));
$temp->add(new admin_setting_configtext('userquota', new lang_string('userquota', 'admin'), new lang_string('configuserquota', 'admin', $params), $defaultuserquota));
$temp->add(new admin_setting_configcheckbox('allowobjectembed', new lang_string('allowobjectembed', 'admin'), new lang_string('configallowobjectembed', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('enabletrusttext', new lang_string('enabletrusttext', 'admin'), new lang_string('configenabletrusttext', 'admin'), 0));
@@ -56,8 +55,7 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
$temp->add(new admin_setting_configcheckbox('profilesforenrolledusersonly', new lang_string('profilesforenrolledusersonly','admin'),new lang_string('configprofilesforenrolledusersonly', 'admin'),'1'));
$temp->add(new admin_setting_configcheckbox('cronclionly', new lang_string('cronclionly', 'admin'), new lang_string
('configcronclionly', 'admin'), 1));
$temp->add(new admin_setting_configcheckbox('cronclionly', new lang_string('cronclionly', 'admin'), new lang_string('configcronclionly', 'admin'), 0));
$temp->add(new admin_setting_configpasswordunmask('cronremotepassword', new lang_string('cronremotepassword', 'admin'), new lang_string('configcronremotepassword', 'admin'), ''));
$options = array(0=>get_string('no'), 3=>3, 5=>5, 7=>7, 10=>10, 20=>20, 30=>30, 50=>50, 100=>100);
@@ -72,11 +70,6 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
$temp->add(new admin_setting_configtext('minpasswordupper', new lang_string('minpasswordupper', 'admin'), new lang_string('configminpasswordupper', 'admin'), 1, PARAM_INT));
$temp->add(new admin_setting_configtext('minpasswordnonalphanum', new lang_string('minpasswordnonalphanum', 'admin'), new lang_string('configminpasswordnonalphanum', 'admin'), 1, PARAM_INT));
$temp->add(new admin_setting_configtext('maxconsecutiveidentchars', new lang_string('maxconsecutiveidentchars', 'admin'), new lang_string('configmaxconsecutiveidentchars', 'admin'), 0, PARAM_INT));
$temp->add(new admin_setting_configtext('passwordreuselimit',
new lang_string('passwordreuselimit', 'admin'),
new lang_string('passwordreuselimit_desc', 'admin'), 0, PARAM_INT));
$pwresetoptions = array(
300 => new lang_string('numminutes', '', 5),
900 => new lang_string('numminutes', '', 15),
@@ -93,9 +86,6 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
1800,
$pwresetoptions);
$temp->add($adminsetting);
$temp->add(new admin_setting_configcheckbox('passwordchangelogout',
new lang_string('passwordchangelogout', 'admin'),
new lang_string('passwordchangelogout_desc', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('groupenrolmentkeypolicy', new lang_string('groupenrolmentkeypolicy', 'admin'), new lang_string('groupenrolmentkeypolicy_desc', 'admin'), 1));
$temp->add(new admin_setting_configcheckbox('disableuserimages', new lang_string('disableuserimages', 'admin'), new lang_string('configdisableuserimages', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('emailchangeconfirmation', new lang_string('emailchangeconfirmation', 'admin'), new lang_string('configemailchangeconfirmation', 'admin'), 1));
-14
View File
@@ -11,7 +11,6 @@ $temp = new admin_settingpage('systempaths', new lang_string('systempaths','admi
$temp->add(new admin_setting_configexecutable('pathtodu', new lang_string('pathtodu', 'admin'), new lang_string('configpathtodu', 'admin'), ''));
$temp->add(new admin_setting_configexecutable('aspellpath', new lang_string('aspellpath', 'admin'), new lang_string('edhelpaspellpath'), ''));
$temp->add(new admin_setting_configexecutable('pathtodot', new lang_string('pathtodot', 'admin'), new lang_string('pathtodot_help', 'admin'), ''));
$temp->add(new admin_setting_configexecutable('pathtogs', new lang_string('pathtogs', 'admin'), new lang_string('pathtogs_help', 'admin'), '/usr/bin/gs'));
$ADMIN->add('server', $temp);
@@ -153,19 +152,6 @@ $temp->add(new admin_setting_configselect('gradehistorylifetime', new lang_strin
60 => new lang_string('numdays', '', 60),
30 => new lang_string('numdays', '', 30))));
$temp->add(new admin_setting_configselect('tempdatafoldercleanup', new lang_string('tempdatafoldercleanup', 'admin'),
new lang_string('configtempdatafoldercleanup', 'admin'), 168, array(
1 => new lang_string('numhours', '', 1),
3 => new lang_string('numhours', '', 3),
6 => new lang_string('numhours', '', 6),
9 => new lang_string('numhours', '', 9),
12 => new lang_string('numhours', '', 12),
18 => new lang_string('numhours', '', 18),
24 => new lang_string('numhours', '', 24),
48 => new lang_string('numdays', '', 2),
168 => new lang_string('numdays', '', 7),
)));
$ADMIN->add('server', $temp);
+1 -1
View File
@@ -11,7 +11,7 @@ $hassiteconfig = has_capability('moodle/site:config', $systemcontext);
$ADMIN->add('root', new admin_externalpage('adminnotifications', new lang_string('notifications'), "$CFG->wwwroot/$CFG->admin/index.php"));
$ADMIN->add('root', new admin_externalpage('registrationmoodleorg', new lang_string('registration', 'admin'),
"$CFG->wwwroot/$CFG->admin/registration/register.php?huburl=" . HUB_MOODLEORGHUBURL . "&hubname=Moodle.org&sesskey=" . sesskey()));
"$CFG->wwwroot/$CFG->admin/registration/register.php?huburl=" . HUB_MOODLEORGHUBURL . "&hubname=Moodle.org"));
$ADMIN->add('root', new admin_externalpage('registrationhub', new lang_string('registerwith', 'hub'),
"$CFG->wwwroot/$CFG->admin/registration/register.php", 'moodle/site:config', true));
$ADMIN->add('root', new admin_externalpage('registrationhubs', new lang_string('hubs', 'admin'),
-42
View File
@@ -24,44 +24,6 @@ if ($hassiteconfig
$ADMIN->add('accounts', new admin_externalpage('editusers', new lang_string('userlist','admin'), "$CFG->wwwroot/$CFG->admin/user.php", array('moodle/user:update', 'moodle/user:delete')));
$ADMIN->add('accounts', new admin_externalpage('userbulk', new lang_string('userbulk','admin'), "$CFG->wwwroot/$CFG->admin/user/user_bulk.php", array('moodle/user:update', 'moodle/user:delete')));
$ADMIN->add('accounts', new admin_externalpage('addnewuser', new lang_string('addnewuser'), "$securewwwroot/user/editadvanced.php?id=-1", 'moodle/user:create'));
// "User default preferences" settingpage.
$temp = new admin_settingpage('userdefaultpreferences', new lang_string('userdefaultpreferences', 'admin'));
if ($ADMIN->fulltree) {
$choices = array();
$choices['0'] = new lang_string('emaildisplayno');
$choices['1'] = new lang_string('emaildisplayyes');
$choices['2'] = new lang_string('emaildisplaycourse');
$temp->add(new admin_setting_configselect('defaultpreference_maildisplay', new lang_string('emaildisplay'),
'', 2, $choices));
$choices = array();
$choices['0'] = new lang_string('textformat');
$choices['1'] = new lang_string('htmlformat');
$temp->add(new admin_setting_configselect('defaultpreference_mailformat', new lang_string('emailformat'), '', 1, $choices));
$choices = array();
$choices['0'] = new lang_string('emaildigestoff');
$choices['1'] = new lang_string('emaildigestcomplete');
$choices['2'] = new lang_string('emaildigestsubjects');
$temp->add(new admin_setting_configselect('defaultpreference_maildigest', new lang_string('emaildigest'),
new lang_string('emaildigest_help'), 0, $choices));
$choices = array();
$choices['1'] = new lang_string('autosubscribeyes');
$choices['0'] = new lang_string('autosubscribeno');
$temp->add(new admin_setting_configselect('defaultpreference_autosubscribe', new lang_string('autosubscribe'),
'', 1, $choices));
$choices = array();
$choices['0'] = new lang_string('trackforumsno');
$choices['1'] = new lang_string('trackforumsyes');
$temp->add(new admin_setting_configselect('defaultpreference_trackforums', new lang_string('trackforums'),
'', 0, $choices));
}
$ADMIN->add('accounts', $temp);
$ADMIN->add('accounts', new admin_externalpage('profilefields', new lang_string('profilefields','admin'), "$CFG->wwwroot/user/profile/index.php", 'moodle/site:config'));
$ADMIN->add('accounts', new admin_externalpage('cohorts', new lang_string('cohorts', 'cohort'), $CFG->wwwroot . '/cohort/index.php', array('moodle/cohort:manage', 'moodle/cohort:view')));
@@ -157,7 +119,6 @@ if ($hassiteconfig
array('description' => new lang_string('description'),
'city' => new lang_string('city'),
'country' => new lang_string('country'),
'timezone' => new lang_string('timezone'),
'webpage' => new lang_string('webpage'),
'icqnumber' => new lang_string('icqnumber'),
'skypeid' => new lang_string('skypeid'),
@@ -191,9 +152,6 @@ if ($hassiteconfig
'institution' => new lang_string('institution'),
)));
$temp->add(new admin_setting_configtext('fullnamedisplay', new lang_string('fullnamedisplay', 'admin'), new lang_string('configfullnamedisplay', 'admin'), 'language', PARAM_TEXT, 50));
$temp->add(new admin_setting_configtext('alternativefullnameformat', new lang_string('alternativefullnameformat', 'admin'),
new lang_string('alternativefullnameformat_desc', 'admin'),
'language', PARAM_RAW, 50));
$temp->add(new admin_setting_configtext('maxusersperpage', new lang_string('maxusersperpage','admin'), new lang_string('configmaxusersperpage','admin'), 100, PARAM_INT));
$temp->add(new admin_setting_configcheckbox('enablegravatar', new lang_string('enablegravatar', 'admin'), new lang_string('enablegravatar_help', 'admin'), 0));
$temp->add(new admin_setting_configtext('gravatardefaulturl', new lang_string('gravatardefaulturl', 'admin'), new lang_string('gravatardefaulturl_help', 'admin'), 'mm'));
-24
View File
@@ -114,30 +114,6 @@ class behat_admin extends behat_base {
}
}
/**
* Sets the specified site settings. A table with | config | value | (optional)plugin | is expected.
*
* @Given /^the following config values are set as admin:$/
* @param TableNode $table
*/
public function the_following_config_values_are_set_as_admin(TableNode $table) {
if (!$data = $table->getRowsHash()) {
return;
}
foreach ($data as $config => $value) {
// Default plugin value is null.
$plugin = null;
if (is_array($value)) {
$plugin = $value[1];
$value = $value[0];
}
set_config($config, $value, $plugin);
}
}
/**
* Waits with the provided params if we are running a JS session.
*
@@ -9,7 +9,6 @@ Feature: Display extended course names
| fullname | shortname | category |
| Course fullname | C_shortname | 0 |
And I log in as "admin"
And I am on site homepage
Scenario: Courses list without extended course names (default value)
Then I should see "Course fullname"
@@ -20,5 +19,5 @@ Feature: Display extended course names
And I click on "Courses" "link" in the "//div[@id='settingsnav']/descendant::li[contains(concat(' ', normalize-space(@class), ' '), ' type_setting ')][contains(., 'Appearance')]" "xpath_element"
And I set the field "Display extended course names" to "1"
When I press "Save changes"
And I am on site homepage
And I am on homepage
Then I should see "C_shortname Course fullname"
+6 -6
View File
@@ -7,10 +7,10 @@ Feature: An administrator can filter user accounts by role, cohort and other pro
Background:
Given the following "users" exist:
| username | firstname | lastname | email | auth | confirmed |
| user1 | User | One | one@example.com | manual | 0 |
| user2 | User | Two | two@example.com | ldap | 1 |
| user3 | User | Three | three@example.com | manual | 1 |
| user4 | User | Four | four@example.com | ldap | 0 |
| user1 | User | One | one@asd.com | manual | 0 |
| user2 | User | Two | two@asd.com | ldap | 1 |
| user3 | User | Three | three@asd.com | manual | 1 |
| user4 | User | Four | four@asd.com | ldap | 0 |
And the following "cohorts" exist:
| name | idnumber |
| Cohort 1 | CH1 |
@@ -23,8 +23,8 @@ Feature: An administrator can filter user accounts by role, cohort and other pro
| user2 | C1 | student |
| user3 | C1 | student |
And I log in as "admin"
And I add "User Two (two@example.com)" user to "CH1" cohort members
And I add "User Three (three@example.com)" user to "CH1" cohort members
And I add "User Two (two@asd.com)" user to "CH1" cohort members
And I add "User Three (three@asd.com)" user to "CH1" cohort members
And I follow "Browse list of users"
@javascript
@@ -9,18 +9,19 @@ Feature: Set admin settings value
| fullname | shortname | category |
| Course fullname | C_shortname | 0 |
And I log in as "admin"
And I am on site homepage
And I should see "Course fullname"
And I should not see "C_shortname Course fullname"
Scenario: set admin value with full name
Given the following config values are set as admin:
| courselistshortnames | 1 |
And I am on site homepage
Given I set the following administration settings values:
| Display extended course names | 1 |
When I press "Save changes"
And I am on homepage
Then I should see "C_shortname Course fullname"
Scenario: set admin value with short name
Given the following config values are set as admin:
Given I set the following administration settings values:
| courselistshortnames | 1 |
And I am on site homepage
Then I should see "C_shortname Course fullname"
When I press "Save changes"
And I am on homepage
Then I should see "C_shortname Course fullname"
+3 -3
View File
@@ -21,7 +21,7 @@ Feature: Upload users
And I should see "Tom"
And I should see "Jones"
And I should see "verysecret"
And I should see "jonest@example.com"
And I should see "jonest@someplace.edu"
And I should see "Reznor"
And I should see "course1"
And I should see "math102"
@@ -32,8 +32,8 @@ Feature: Upload users
And I follow "Browse list of users"
And I should see "Tom Jones"
And I should see "Trent Reznor"
And I should see "reznor@example.com"
And I am on site homepage
And I should see "reznor@someplace.edu"
And I am on homepage
And I follow "Maths"
And I expand "Users" node
And I follow "Groups"
+2 -2
View File
@@ -41,11 +41,11 @@
}
require_once($CFG->dirroot.'/calendar/lib.php');
$timezones = core_date::get_list_of_timezones(null, true);
$timezones = get_list_of_timezones();
echo '<center><form action="timezone.php" method="post">';
echo html_writer::label($strusers . ' (' . $strall . '): ', 'menuzone');
echo html_writer::select($timezones, "zone", $current);
echo html_writer::select($timezones, "zone", $current, array('99'=>get_string("serverlocaltime")));
echo "<input type=\"hidden\" name=\"sesskey\" value=\"".sesskey()."\" />";
echo '<input type="submit" value="'.s($strsavechanges).'" />';
echo "</form></center>";
+1 -1
View File
@@ -55,7 +55,7 @@ M.tool_assignmentupgrade = {
assignmentsinput = Y.one('input.selectedassignments');
assignmentsinput.set('value', selectedassignments.join(','));
if (selectedassignments.length == 0) {
alert(M.util.get_string('noassignmentsselected', 'tool_assignmentupgrade'));
alert(M.str.tool_assignmentupgrade.noassignmentsselected);
e.preventDefault();
}
});
+3 -3
View File
@@ -24,7 +24,7 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2015051100;
$plugin->requires = 2015050500;
$plugin->version = 2014051200;
$plugin->requires = 2014050800;
$plugin->component = 'tool_assignmentupgrade';
$plugin->dependencies = array('mod_assign' => 2015050500);
$plugin->dependencies = array('mod_assign' => 2014050800);
@@ -13,8 +13,8 @@ Feature: Manage availability conditions
Then I should not see "Availability restrictions"
# Enable it and check I can now see and click on it.
And the following config values are set as admin:
| enableavailability | 1 |
And I set the following administration settings values:
| Enable conditional access | 1 |
And I am on homepage
And I navigate to "Manage restrictions" node in "Site administration > Plugins > Availability restrictions"
@@ -28,10 +28,10 @@ Feature: Manage availability conditions
Given the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And the following config values are set as admin:
| enableavailability | 1 |
And I log in as "admin"
And I am on site homepage
And I set the following administration settings values:
| Enable conditional access | 1 |
And I am on homepage
When I navigate to "Manage restrictions" node in "Site administration > Plugins > Availability restrictions"
# Check the icon is there (it should be a Hide icon, meaning is currently visible).
@@ -47,7 +47,7 @@ Feature: Manage availability conditions
# OK, toggling works. Set the grade one to Hide and we'll go see if it actually worked.
And I click on "input[title=Hide]" "css_element" in the "Restriction by grade" "table_row"
And I am on site homepage
And I am on homepage
And I follow "Course 1"
And I turn editing mode on
And I add a "Page" to section "1"
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2015051100;
$plugin->requires = 2015050500;
$plugin->version = 2014051200;
$plugin->requires = 2014050800;
$plugin->component = 'tool_availabilityconditions';
+24 -76
View File
@@ -40,113 +40,61 @@ define('CACHE_DISABLE_ALL', true);
require_once(__DIR__ . '/../../../../lib/clilib.php');
require_once(__DIR__ . '/../../../../lib/behat/lib.php');
list($options, $unrecognized) = cli_get_params(
array(
'parallel' => 0,
'maxruns' => false,
'help' => false,
'fromrun' => 1,
'torun' => 0,
),
array(
'j' => 'parallel',
'm' => 'maxruns',
'h' => 'help',
)
);
// Checking run.php CLI script usage.
$help = "
Behat utilities to initialise behat tests
Usage:
php init.php [--parallel=value [--maxruns=value] [--fromrun=value --torun=value]] [--help]
Options:
-j, --parallel Number of parallel behat run to initialise
-m, --maxruns Max parallel processes to be executed at one time.
--fromrun Execute run starting from (Used for parallel runs on different vms)
--torun Execute run till (Used for parallel runs on different vms)
-h, --help Print out this help
Example from Moodle root directory:
\$ php admin/tool/behat/cli/init.php --parallel=2
More info in http://docs.moodle.org/dev/Acceptance_testing#Running_tests
";
if (!empty($options['help'])) {
echo $help;
exit(0);
}
// Check which util file to call.
$utilfile = 'util_single_run.php';
$paralleloption = "";
// If parallel run then use utilparallel.
if ($options['parallel'] && $options['parallel'] > 1) {
$utilfile = 'util.php';
$paralleloption = "";
foreach ($options as $option => $value) {
if ($value) {
$paralleloption .= " --$option=\"$value\"";
}
}
}
// Changing the cwd to admin/tool/behat/cli.
$cwd = getcwd();
$output = null;
// If behat dependencies not downloaded then do it first, else symfony/process can't be used.
testing_update_composer_dependencies();
// Check whether the behat test environment needs to be updated.
chdir(__DIR__);
exec("php $utilfile --diag $paralleloption", $output, $code);
$output = null;
exec("php util.php --diag", $output, $code);
if ($code == 0) {
echo "Behat test environment already installed\n";
} else if ($code == BEHAT_EXITCODE_INSTALL) {
testing_update_composer_dependencies();
// Behat and dependencies are installed and we need to install the test site.
chdir(__DIR__);
passthru("php $utilfile --install $paralleloption", $code);
passthru("php util.php --install", $code);
if ($code != 0) {
chdir($cwd);
exit($code);
}
} else if ($code == BEHAT_EXITCODE_REINSTALL) {
testing_update_composer_dependencies();
// Test site data is outdated.
chdir(__DIR__);
passthru("php $utilfile --drop $paralleloption", $code);
passthru("php util.php --drop", $code);
if ($code != 0) {
chdir($cwd);
exit($code);
}
chdir(__DIR__);
passthru("php $utilfile --install $paralleloption", $code);
passthru("php util.php --install", $code);
if ($code != 0) {
exit($code);
}
} else if ($code == BEHAT_EXITCODE_COMPOSER) {
// Missing Behat dependencies.
testing_update_composer_dependencies();
// Returning to admin/tool/behat/cli.
chdir(__DIR__);
passthru("php util.php --install", $code);
if ($code != 0) {
chdir($cwd);
exit($code);
}
} else {
// Generic error, we just output it.
echo implode("\n", $output)."\n";
chdir($cwd);
exit($code);
}
// Enable editing mode according to config.php vars.
chdir(__DIR__);
passthru("php $utilfile --enable $paralleloption", $code);
passthru("php util.php --enable", $code);
if ($code != 0) {
echo "Error enabling site" . PHP_EOL;
chdir($cwd);
exit($code);
}
-398
View File
@@ -1,398 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Wrapper to run previously set-up behat tests in parallel.
*
* @package tool_behat
* @copyright 2014 NetSpot Pty Ltd
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
if (isset($_SERVER['REMOTE_ADDR'])) {
die(); // No access from web!
}
define('BEHAT_UTIL', true);
define('CLI_SCRIPT', true);
define('ABORT_AFTER_CONFIG', true);
define('CACHE_DISABLE_ALL', true);
define('NO_OUTPUT_BUFFERING', true);
require_once(__DIR__ .'/../../../../config.php');
require_once(__DIR__.'/../../../../lib/clilib.php');
require_once(__DIR__.'/../../../../lib/behat/lib.php');
require_once(__DIR__.'/../../../../lib/behat/classes/behat_command.php');
require_once(__DIR__.'/../../../../lib/behat/classes/behat_config_manager.php');
error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', '1');
ini_set('log_errors', '1');
list($options, $unrecognised) = cli_get_params(
array(
'stop-on-failure' => 0,
'verbose' => false,
'replace' => false,
'help' => false,
'tags' => '',
'profile' => '',
'feature' => '',
'fromrun' => 1,
'torun' => 0,
'single-run' => false,
),
array(
'h' => 'help',
't' => 'tags',
'p' => 'profile',
's' => 'single-run',
)
);
// Checking run.php CLI script usage.
$help = "
Behat utilities to run behat tests in parallel
Usage:
php run.php [--BEHAT_OPTION=\"value\"] [--feature=\"value\"] [--replace] [--fromrun=value --torun=value] [--help]
Options:
--BEHAT_OPTION Any combination of behat option specified in http://behat.readthedocs.org/en/v2.5/guides/6.cli.html
--feature Only execute specified feature file (Absolute path of feature file).
--replace Replace args string with run process number, useful for output.
--fromrun Execute run starting from (Used for parallel runs on different vms)
--torun Execute run till (Used for parallel runs on different vms)
-h, --help Print out this help
Example from Moodle root directory:
\$ php admin/tool/behat/cli/run.php --tags=\"@javascript\"
More info in http://docs.moodle.org/dev/Acceptance_testing#Running_tests
";
if (!empty($options['help'])) {
echo $help;
exit(0);
}
$parallelrun = behat_config_manager::get_parallel_test_runs($options['fromrun']);
// Default torun is maximum parallel runs.
if (empty($options['torun'])) {
$options['torun'] = $parallelrun;
}
// Capture signals and ensure we clean symlinks.
if (extension_loaded('pcntl')) {
$disabled = explode(',', ini_get('disable_functions'));
if (!in_array('pcntl_signal', $disabled)) {
pcntl_signal(SIGTERM, "signal_handler");
pcntl_signal(SIGINT, "signal_handler");
}
}
$time = microtime(true);
array_walk($unrecognised, function (&$v) {
if ($x = preg_filter("#^(-+\w+)=(.+)#", "\$1=\"\$2\"", $v)) {
$v = $x;
} else if (!preg_match("#^-#", $v)) {
$v = escapeshellarg($v);
}
});
$extraopts = $unrecognised;
$tags = '';
if ($options['profile']) {
$profile = $options['profile'];
if (!isset($CFG->behat_config[$profile])) {
echo "Invalid profile passed: " . $profile;
exit(1);
}
$extraopts[] = '--profile="' . $profile . '"';
// By default, profile tags will be used.
if (!empty($CFG->behat_config[$profile]['filters']['tags'])) {
$tags = $CFG->behat_config[$profile]['filters']['tags'];
}
}
// Command line tags have precedence (std behat behavior).
if ($options['tags']) {
$tags = $options['tags'];
$extraopts[] = '--tags="' . $tags . '"';
}
// Feature should be added to last, for behat command.
if ($options['feature']) {
$extraopts[] = $options['feature'];
// Only run 1 process as process.
// Feature file is picked from absolute path provided, so no need to check for behat.yml.
$options['torun'] = $options['fromrun'];
}
// Set of options to pass to behat.
$extraopts = implode(' ', $extraopts);
// If empty parallelrun then just check with user if it's a run single behat test.
if (empty($parallelrun)) {
$cwd = getcwd();
chdir(__DIR__);
$runtestscommand = behat_command::get_behat_command(false, false, true);
$runtestscommand .= ' --config ' . behat_config_manager::get_behat_cli_config_filepath();
$runtestscommand .= ' ' . $extraopts;
echo "Running single behat site:" . PHP_EOL;
passthru("php $runtestscommand", $code);
chdir($cwd);
exit($code);
}
// Update config file if tags defined.
if ($tags) {
// Hack to set proper dataroot and wwwroot.
$behatdataroot = $CFG->behat_dataroot;
$behatwwwroot = $CFG->behat_wwwroot;
for ($i = 1; $i <= $parallelrun; $i++) {
$CFG->behatrunprocess = $i;
if (!empty($CFG->behat_parallel_run[$i - 1]['behat_wwwroot'])) {
$CFG->behat_wwwroot = $CFG->behat_parallel_run[$i - 1]['behat_wwwroot'];
} else {
$CFG->behat_wwwroot = $behatwwwroot . "/" . BEHAT_PARALLEL_SITE_NAME . $i;
}
if (!empty($CFG->behat_parallel_run[$i - 1]['behat_dataroot'])) {
$CFG->behat_dataroot = $CFG->behat_parallel_run[$i - 1]['behat_dataroot'];
} else {
$CFG->behat_dataroot = $behatdataroot . $i;
}
behat_config_manager::update_config_file('', true, $tags);
}
$CFG->behat_dataroot = $behatdataroot;
$CFG->behat_wwwroot = $behatwwwroot;
unset($CFG->behatrunprocess);
}
$cmds = array();
echo "Running " . ($options['torun'] - $options['fromrun'] + 1) . " parallel behat sites:" . PHP_EOL;
for ($i = $options['fromrun']; $i <= $options['torun']; $i++) {
$CFG->behatrunprocess = $i;
// Options parameters to be added to each run.
$myopts = !empty($options['replace']) ? str_replace($options['replace'], $i, $extraopts) : $extraopts;
$behatcommand = behat_command::get_behat_command(false, false, true);
$behatconfigpath = behat_config_manager::get_behat_cli_config_filepath($i);
// Command to execute behat run.
$cmds[BEHAT_PARALLEL_SITE_NAME . $i] = $behatcommand . ' --config ' . $behatconfigpath . " " . $myopts;
echo "[" . BEHAT_PARALLEL_SITE_NAME . $i . "] " . $cmds[BEHAT_PARALLEL_SITE_NAME . $i] . PHP_EOL;
}
if (empty($cmds)) {
echo "No commands to execute " . PHP_EOL;
exit(1);
}
// Create site symlink if necessary.
if (!behat_config_manager::create_parallel_site_links($options['fromrun'], $options['torun'])) {
echo "Check permissions. If on windows, make sure you are running this command as admin" . PHP_EOL;
exit(1);
}
// Execute all commands.
$processes = cli_execute_parallel($cmds, __DIR__);
$stoponfail = empty($options['stop-on-failure']) ? false : true;
// Print header.
print_process_start_info($processes);
// Print combined run o/p from processes.
$exitcodes = print_combined_run_output($processes, $stoponfail);
$time = round(microtime(true) - $time, 1);
echo "Finished in " . gmdate("G\h i\m s\s", $time) . PHP_EOL . PHP_EOL;
// Print exit info from each run.
$status = false;
foreach ($exitcodes as $exitcode) {
$status = (bool)$status || (bool)$exitcode;
}
// Run finished. Show exit code and output from individual process.
$verbose = empty($options['verbose']) ? false : true;
$verbose = $verbose || $status;
// Show exit code from each process, if any process failed.
if ($verbose) {
// Echo exit codes.
echo "Exit codes for each behat run: " . PHP_EOL;
ksort($exitcodes);
foreach ($exitcodes as $run => $exitcode) {
echo $run . ": " . $exitcode . PHP_EOL;
}
// Show failed re-run commands.
if ($status) {
echo "To re-run failed processes, you can use following commands:" . PHP_EOL;
foreach ($cmds as $name => $cmd) {
if (!empty($exitcodes[$name])) {
echo "[" . $name . "] " . $cmd . PHP_EOL;
}
}
}
echo PHP_EOL;
}
print_each_process_info($processes, $verbose);
// Remove site symlink if necessary.
behat_config_manager::drop_parallel_site_links();
exit((int) $status);
/**
* Signal handler for terminal exit.
*
* @param int $signal signal number.
*/
function signal_handler($signal) {
switch ($signal) {
case SIGTERM:
case SIGKILL:
case SIGINT:
// Remove site symlink if necessary.
behat_config_manager::drop_parallel_site_links();
exit(1);
}
}
/**
* Prints header from the first process.
*
* @param array $processes list of processes to loop though.
*/
function print_process_start_info($processes) {
$printed = false;
// Keep looping though processes, till we get first process o/p.
while (!$printed) {
usleep(10000);
foreach ($processes as $name => $process) {
// Exit if any process has stopped.
if (!$process->isRunning()) {
$printed = true;
break;
}
$op = explode(PHP_EOL, $process->getOutput());
if (count($op) >= 3) {
foreach ($op as $line) {
if (trim($line) && (strpos($line, '.') !== 0)) {
echo $line . PHP_EOL;
}
}
$printed = true;
}
}
}
}
/**
* Loop though all processes and print combined o/p
*
* @param array $processes list of processes to loop though.
* @param bool $stoponfail Stop all processes and exit if failed.
* @return array list of exit codes from all processes.
*/
function print_combined_run_output($processes, $stoponfail = false) {
$exitcodes = array();
$maxdotsonline = 70;
$remainingprintlen = $maxdotsonline;
$progresscount = 0;
while (count($exitcodes) != count($processes)) {
usleep(10000);
foreach ($processes as $name => $process) {
if ($process->isRunning()) {
$op = $process->getIncrementalOutput();
if (trim($op)) {
$update = preg_filter('#^\s*([FS\.\-]+)(?:\s+\d+)?\s*$#', '$1', $op);
// Exit process if anything fails.
if ($stoponfail && (strpos($update, 'F') !== false)) {
$process->stop(0);
}
$strlentoprint = strlen($update);
// If not enough dots printed on line then just print.
if ($strlentoprint < $remainingprintlen) {
echo $update;
$remainingprintlen = $remainingprintlen - $strlentoprint;
} else if ($strlentoprint == $remainingprintlen) {
$progresscount += $maxdotsonline;
echo $update ." " . $progresscount . PHP_EOL;
$remainingprintlen = $maxdotsonline;
} else {
while ($part = substr($update, 0, $remainingprintlen) > 0) {
$progresscount += $maxdotsonline;
echo $part . " " . $progresscount . PHP_EOL;
$update = substr($update, $remainingprintlen);
$remainingprintlen = $maxdotsonline;
}
}
}
} else {
$exitcodes[$name] = $process->getExitCode();
if ($stoponfail && ($exitcodes[$name] != 0)) {
foreach ($processes as $l => $p) {
$exitcodes[$l] = -1;
$process->stop(0);
}
}
}
}
}
echo PHP_EOL;
return $exitcodes;
}
/**
* Loop though all processes and print combined o/p
*
* @param array $processes list of processes to loop though.
* @param bool $verbose Show verbose output for each process.
*/
function print_each_process_info($processes, $verbose = false) {
foreach ($processes as $name => $process) {
echo "**************** [" . $name . "] ****************" . PHP_EOL;
if ($verbose) {
echo $process->getOutput();
echo $process->getErrorOutput();
} else {
$op = explode(PHP_EOL, $process->getOutput());
foreach ($op as $line) {
// Don't print progress .
if (trim($line) && (strpos($line, '.') !== 0) && (strpos($line, 'Moodle ') !== 0) &&
(strpos($line, 'Server OS ') !== 0) && (strpos($line, 'Started at ') !== 0) &&
(strpos($line, 'Browser specific fixes ') !== 0)) {
echo $line . PHP_EOL;
}
}
}
echo PHP_EOL;
}
}
+69 -367
View File
@@ -15,7 +15,7 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* CLI tool with utilities to manage parallel Behat integration in Moodle
* CLI tool with utilities to manage Behat integration in Moodle
*
* All CLI utilities uses $CFG->behat_dataroot and $CFG->prefix_dataroot as
* $CFG->dataroot and $CFG->prefix
@@ -30,61 +30,45 @@ if (isset($_SERVER['REMOTE_ADDR'])) {
die(); // No access from web!.
}
define('BEHAT_UTIL', true);
define('CLI_SCRIPT', true);
define('NO_OUTPUT_BUFFERING', true);
define('IGNORE_COMPONENT_CACHE', true);
define('ABORT_AFTER_CONFIG', true);
require_once(__DIR__ . '/../../../../config.php');
// Basic functions.
require_once(__DIR__ . '/../../../../lib/clilib.php');
require_once(__DIR__ . '/../../../../lib/behat/lib.php');
require_once(__DIR__ . '/../../../../lib/behat/classes/behat_command.php');
require_once(__DIR__ . '/../../../../lib/behat/classes/behat_config_manager.php');
// CLI options.
list($options, $unrecognized) = cli_get_params(
array(
'help' => false,
'install' => false,
'drop' => false,
'enable' => false,
'disable' => false,
'diag' => false,
'parallel' => 0,
'maxruns' => false,
'updatesteps' => false,
'fromrun' => 1,
'torun' => 0,
'help' => false,
'install' => false,
'drop' => false,
'enable' => false,
'disable' => false,
'diag' => false
),
array(
'h' => 'help',
'j' => 'parallel',
'm' => 'maxruns'
'h' => 'help'
)
);
if ($options['install'] or $options['drop']) {
define('CACHE_DISABLE_ALL', true);
}
// Checking util.php CLI script usage.
$help = "
Behat utilities to manage the test environment
Usage:
php util.php [--install|--drop|--enable|--disable|--diag|--updatesteps|--help] [--parallel=value [--maxruns=value]]
Options:
--install Installs the test environment for acceptance tests
--drop Drops the database tables and the dataroot contents
--enable Enables test environment and updates tests list
--disable Disables test environment
--diag Get behat test environment status code
--updatesteps Update feature step file.
-j, --parallel Number of parallel behat run operation
-m, --maxruns Max parallel processes to be executed at one time.
--install Installs the test environment for acceptance tests
--drop Drops the database tables and the dataroot contents
--enable Enables test environment and updates tests list
--disable Disables test environment
--diag Get behat test environment status code
-h, --help Print out this help
Example from Moodle root directory:
\$ php admin/tool/behat/cli/util.php --enable --parallel=4
\$ php admin/tool/behat/cli/util.php --enable
More info in http://docs.moodle.org/dev/Acceptance_testing#Running_tests
";
@@ -94,348 +78,66 @@ if (!empty($options['help'])) {
exit(0);
}
$cwd = getcwd();
// Describe this script.
define('BEHAT_UTIL', true);
define('CLI_SCRIPT', true);
define('NO_OUTPUT_BUFFERING', true);
define('IGNORE_COMPONENT_CACHE', true);
// For drop option check if parallel site.
if ((empty($options['parallel'])) && ($options['drop']) || $options['updatesteps']) {
// Get parallel run info from first run.
$options['parallel'] = behat_config_manager::get_parallel_test_runs($options['fromrun']);
// Only load CFG from config.php, stop ASAP in lib/setup.php.
define('ABORT_AFTER_CONFIG', true);
require_once(__DIR__ . '/../../../../config.php');
// Remove error handling overrides done in config.php.
$CFG->debug = (E_ALL | E_STRICT);
$CFG->debugdisplay = 1;
error_reporting($CFG->debug);
ini_set('display_errors', '1');
ini_set('log_errors', '1');
// Finish moodle init.
define('ABORT_AFTER_CONFIG_CANCEL', true);
require("$CFG->dirroot/lib/setup.php");
raise_memory_limit(MEMORY_HUGE);
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/upgradelib.php');
require_once($CFG->libdir.'/clilib.php');
require_once($CFG->libdir.'/installlib.php');
require_once($CFG->libdir.'/testing/classes/test_lock.php');
if ($unrecognized) {
$unrecognized = implode("\n ", $unrecognized);
cli_error(get_string('cliunknowoption', 'admin', $unrecognized));
}
// If not a parallel site then open single run.
if (empty($options['parallel'])) {
chdir(__DIR__);
// Check if behat is initialised, if not exit.
passthru("php util_single_run.php --diag", $status);
if ($status) {
exit ($status);
}
$cmd = commands_to_execute($options);
$processes = cli_execute_parallel(array($cmd), __DIR__);
$status = print_sequential_output($processes, false);
chdir($cwd);
exit($status);
}
// Behat utilities.
require_once($CFG->libdir . '/behat/classes/util.php');
require_once($CFG->libdir . '/behat/classes/behat_command.php');
// Default torun is maximum parallel runs.
if (empty($options['torun'])) {
$options['torun'] = $options['parallel'];
}
$status = false;
$cmds = commands_to_execute($options);
// Start executing commands either sequential/parallel for options provided.
if ($options['diag'] || $options['enable'] || $options['disable']) {
// Do it sequentially as it's fast and need to be displayed nicely.
foreach (array_chunk($cmds, 1, true) as $cmd) {
$processes = cli_execute_parallel($cmd, __DIR__);
print_sequential_output($processes);
}
} else if ($options['drop']) {
$processes = cli_execute_parallel($cmds, __DIR__);
$exitcodes = print_combined_drop_output($processes);
foreach ($exitcodes as $exitcode) {
$status = (bool)$status || (bool)$exitcode;
}
} else if ($options['install']) {
// This is intensive compared to behat itself so run them in chunk if option maxruns not set.
if ($options['maxruns']) {
foreach (array_chunk($cmds, $options['maxruns'], true) as $chunk) {
$processes = cli_execute_parallel($chunk, __DIR__);
$exitcodes = print_combined_install_output($processes);
foreach ($exitcodes as $name => $exitcode) {
if ($exitcode != 0) {
echo "Failed process [[$name]]" . PHP_EOL;
echo $processes[$name]->getOutput();
echo PHP_EOL;
echo $processes[$name]->getErrorOutput();
echo PHP_EOL . PHP_EOL;
}
$status = (bool)$status || (bool)$exitcode;
}
}
} else {
$processes = cli_execute_parallel($cmds, __DIR__);
$exitcodes = print_combined_install_output($processes);
foreach ($exitcodes as $name => $exitcode) {
if ($exitcode != 0) {
echo "Failed process [[$name]]" . PHP_EOL;
echo $processes[$name]->getOutput();
echo PHP_EOL;
echo $processes[$name]->getErrorOutput();
echo PHP_EOL . PHP_EOL;
}
$status = (bool)$status || (bool)$exitcode;
}
}
} else if ($options['updatesteps']) {
// Rewrite config file to ensure we have all the features covered.
if (empty($options['parallel'])) {
behat_config_manager::update_config_file();
} else {
// Update config file, ensuring we have up-to-date behat.yml.
for ($i = $options['fromrun']; $i <= $options['torun']; $i++) {
$CFG->behatrunprocess = $i;
behat_config_manager::update_config_file();
}
unset($CFG->behatrunprocess);
}
// Do it sequentially as it's fast and need to be displayed nicely.
foreach (array_chunk($cmds, 1, true) as $cmd) {
$processes = cli_execute_parallel($cmd, __DIR__);
print_sequential_output($processes);
}
exit(0);
} else {
// We should never reach here.
echo $help;
exit(1);
}
// Ensure we have success status to show following information.
if ($status) {
echo "Unknown failure $status" . PHP_EOL;
exit((int)$status);
}
// Show command o/p (only one per time).
// Run command (only one per time).
if ($options['install']) {
echo "Acceptance tests site installed for sites:".PHP_EOL;
// Display all sites which are installed/drop/diabled.
for ($i = $options['fromrun']; $i <= $options['torun']; $i++) {
if (empty($CFG->behat_parallel_run[$i - 1]['behat_wwwroot'])) {
echo $CFG->behat_wwwroot . "/" . BEHAT_PARALLEL_SITE_NAME . $i . PHP_EOL;
} else {
echo $CFG->behat_parallel_run[$i - 1]['behat_wwwroot'] . PHP_EOL;
}
}
behat_util::install_site();
mtrace("Acceptance tests site installed");
} else if ($options['drop']) {
echo "Acceptance tests site dropped for " . $options['parallel'] . " parallel sites" . PHP_EOL;
// Ensure no tests are running.
test_lock::acquire('behat');
behat_util::drop_site();
mtrace("Acceptance tests site dropped");
} else if ($options['enable']) {
echo "Acceptance tests environment enabled on $CFG->behat_wwwroot, to run the tests use:" . PHP_EOL;
echo behat_command::get_behat_command(true, true);
echo PHP_EOL;
behat_util::start_test_mode();
$runtestscommand = behat_command::get_behat_command(true) .
' --config ' . behat_config_manager::get_behat_cli_config_filepath();
mtrace("Acceptance tests environment enabled on $CFG->behat_wwwroot, to run the tests use:\n " . $runtestscommand);
} else if ($options['disable']) {
echo "Acceptance tests environment disabled for " . $options['parallel'] . " parallel sites" . PHP_EOL;
behat_util::stop_test_mode();
mtrace("Acceptance tests environment disabled");
} else if ($options['diag']) {
// Valid option, so nothing to do.
$code = behat_util::get_behat_status();
exit($code);
} else {
echo $help;
chdir($cwd);
exit(1);
}
chdir($cwd);
exit(0);
/**
* Create commands to be executed for parallel run.
*
* @param array $options options provided by user.
* @return array commands to be executed.
*/
function commands_to_execute($options) {
$removeoptions = array('maxruns', 'fromrun', 'torun');
$cmds = array();
$extraoptions = $options;
$extra = "";
// Remove extra options not in util_single_run.php.
foreach ($removeoptions as $ro) {
$extraoptions[$ro] = null;
unset($extraoptions[$ro]);
}
foreach ($extraoptions as $option => $value) {
if ($options[$option]) {
$extra .= " --$option";
if ($value) {
$extra .= "=$value";
}
}
}
if (empty($options['parallel'])) {
$cmds = "php util_single_run.php " . $extra;
} else {
// Create commands which has to be executed for parallel site.
for ($i = $options['fromrun']; $i <= $options['torun']; $i++) {
$prefix = BEHAT_PARALLEL_SITE_NAME . $i;
$cmds[$prefix] = "php util_single_run.php " . $extra . " --run=" . $i . " 2>&1";
}
}
return $cmds;
}
/**
* Print drop output merging each run.
*
* @param array $processes list of processes.
* @return array exit codes of each process.
*/
function print_combined_drop_output($processes) {
$exitcodes = array();
$maxdotsonline = 70;
$remainingprintlen = $maxdotsonline;
$progresscount = 0;
echo "Dropping tables:" . PHP_EOL;
while (count($exitcodes) != count($processes)) {
usleep(10000);
foreach ($processes as $name => $process) {
if ($process->isRunning()) {
$op = $process->getIncrementalOutput();
if (trim($op)) {
$update = preg_filter('#^\s*([FS\.\-]+)(?:\s+\d+)?\s*$#', '$1', $op);
$strlentoprint = strlen($update);
// If not enough dots printed on line then just print.
if ($strlentoprint < $remainingprintlen) {
echo $update;
$remainingprintlen = $remainingprintlen - $strlentoprint;
} else if ($strlentoprint == $remainingprintlen) {
$progresscount += $maxdotsonline;
echo $update . " " . $progresscount . PHP_EOL;
$remainingprintlen = $maxdotsonline;
} else {
while ($part = substr($update, 0, $remainingprintlen) > 0) {
$progresscount += $maxdotsonline;
echo $part . " " . $progresscount . PHP_EOL;
$update = substr($update, $remainingprintlen);
$remainingprintlen = $maxdotsonline;
}
}
}
} else {
// Process exited.
$process->clearOutput();
$exitcodes[$name] = $process->getExitCode();
}
}
}
echo PHP_EOL;
return $exitcodes;
}
/**
* Print install output merging each run.
*
* @param array $processes list of processes.
* @return array exit codes of each process.
*/
function print_combined_install_output($processes) {
$exitcodes = array();
$line = array();
// Check what best we can do to accommodate all parallel run o/p on single line.
// Windows command line has length of 80 chars, so default we will try fit o/p in 80 chars.
if (defined('BEHAT_MAX_CMD_LINE_OUTPUT') && BEHAT_MAX_CMD_LINE_OUTPUT) {
$lengthofprocessline = (int)max(10, BEHAT_MAX_CMD_LINE_OUTPUT / count($processes));
} else {
$lengthofprocessline = (int)max(10, 80 / count($processes));
}
echo "Installing behat site for " . count($processes) . " parallel behat run" . PHP_EOL;
// Show process name in first row.
foreach ($processes as $name => $process) {
// If we don't have enough space to show full run name then show runX.
if ($lengthofprocessline < strlen($name + 2)) {
$name = substr($name, -5);
}
// One extra padding as we are adding | separator for rest of the data.
$line[$name] = str_pad('[' . $name . '] ', $lengthofprocessline + 1);
}
ksort($line);
$tableheader = array_keys($line);
echo implode("", $line) . PHP_EOL;
// Now print o/p from each process.
while (count($exitcodes) != count($processes)) {
usleep(50000);
$poutput = array();
// Create child process.
foreach ($processes as $name => $process) {
if ($process->isRunning()) {
$output = $process->getIncrementalOutput();
if (trim($output)) {
$poutput[$name] = explode(PHP_EOL, $output);
}
} else {
// Process exited.
$exitcodes[$name] = $process->getExitCode();
}
}
ksort($poutput);
// Get max depth of o/p before displaying.
$maxdepth = 0;
foreach ($poutput as $pout) {
$pdepth = count($pout);
$maxdepth = $pdepth >= $maxdepth ? $pdepth : $maxdepth;
}
// Iterate over each process to get line to print.
for ($i = 0; $i <= $maxdepth; $i++) {
$pline = "";
foreach ($tableheader as $name) {
$po = empty($poutput[$name][$i]) ? "" : substr($poutput[$name][$i], 0, $lengthofprocessline - 1);
$po = str_pad($po, $lengthofprocessline);
$pline .= "|". $po;
}
if (trim(str_replace("|", "", $pline))) {
echo $pline . PHP_EOL;
}
}
unset($poutput);
$poutput = null;
}
echo PHP_EOL;
return $exitcodes;
}
/**
* Print install output merging showing one run at a time.
* If any process fail then exit.
*
* @param array $processes list of processes.
* @param bool $showprefix show prefix.
* @return bool exitcode.
*/
function print_sequential_output($processes, $showprefix = true) {
$status = false;
foreach ($processes as $name => $process) {
$shownname = false;
while ($process->isRunning()) {
$op = $process->getIncrementalOutput();
if (trim($op)) {
// Show name of the run once for sequential.
if ($showprefix && !$shownname) {
echo '[' . $name . '] ';
$shownname = true;
}
echo $op;
}
}
// If any error then exit.
$exitcode = $process->getExitCode();
if ($exitcode != 0) {
exit($exitcode);
}
$status = $status || (bool)$exitcode;
}
return $status;
}
-277
View File
@@ -1,277 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* CLI tool with utilities to manage Behat integration in Moodle
*
* All CLI utilities uses $CFG->behat_dataroot and $CFG->prefix_dataroot as
* $CFG->dataroot and $CFG->prefix
*
* @package tool_behat
* @copyright 2012 David Monllaó
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
if (isset($_SERVER['REMOTE_ADDR'])) {
die(); // No access from web!.
}
// Basic functions.
require_once(__DIR__ . '/../../../../lib/clilib.php');
require_once(__DIR__ . '/../../../../lib/behat/lib.php');
// CLI options.
list($options, $unrecognized) = cli_get_params(
array(
'help' => false,
'install' => false,
'parallel' => 0,
'run' => '',
'drop' => false,
'enable' => false,
'disable' => false,
'diag' => false,
'tags' => '',
'updatesteps' => false,
),
array(
'h' => 'help'
)
);
if ($options['install'] or $options['drop']) {
define('CACHE_DISABLE_ALL', true);
}
// Checking util_single_run.php CLI script usage.
$help = "
Behat utilities to manage the test environment
Usage:
php util_single_run.php [--install|--drop|--enable|--disable|--diag|--updatesteps|--help]
Options:
--install Installs the test environment for acceptance tests
--drop Drops the database tables and the dataroot contents
--enable Enables test environment and updates tests list
--disable Disables test environment
--diag Get behat test environment status code
--updatesteps Update feature step file.
-h, --help Print out this help
Example from Moodle root directory:
\$ php admin/tool/behat/cli/util_single_run.php --enable
More info in http://docs.moodle.org/dev/Acceptance_testing#Running_tests
";
if (!empty($options['help'])) {
echo $help;
exit(0);
}
// Describe this script.
define('BEHAT_UTIL', true);
define('CLI_SCRIPT', true);
define('NO_OUTPUT_BUFFERING', true);
define('IGNORE_COMPONENT_CACHE', true);
// Set run value, to be used by setup for configuring proper CFG variables.
if ($options['run']) {
define('BEHAT_CURRENT_RUN', $options['run']);
}
// Only load CFG from config.php, stop ASAP in lib/setup.php.
define('ABORT_AFTER_CONFIG', true);
require_once(__DIR__ . '/../../../../config.php');
// Remove error handling overrides done in config.php.
$CFG->debug = (E_ALL | E_STRICT);
$CFG->debugdisplay = 1;
error_reporting($CFG->debug);
ini_set('display_errors', '1');
ini_set('log_errors', '1');
// Finish moodle init.
define('ABORT_AFTER_CONFIG_CANCEL', true);
require("$CFG->dirroot/lib/setup.php");
raise_memory_limit(MEMORY_HUGE);
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/upgradelib.php');
require_once($CFG->libdir.'/clilib.php');
require_once($CFG->libdir.'/installlib.php');
require_once($CFG->libdir.'/testing/classes/test_lock.php');
if ($unrecognized) {
$unrecognized = implode(PHP_EOL . " ", $unrecognized);
cli_error(get_string('cliunknowoption', 'admin', $unrecognized));
}
// Behat utilities.
require_once($CFG->libdir . '/behat/classes/util.php');
require_once($CFG->libdir . '/behat/classes/behat_command.php');
require_once($CFG->libdir . '/behat/classes/behat_config_manager.php');
// Ensure run option is <= parallel run installed.
if ($options['run']) {
if (!$options['parallel']) {
$options['parallel'] = behat_config_manager::get_parallel_test_runs();
}
if (empty($options['parallel']) || $options['run'] > $options['parallel']) {
echo "Parallel runs can't be more then ".$options['parallel'].PHP_EOL;
exit(1);
}
$CFG->behatrunprocess = $options['run'];
}
// Run command (only one per time).
if ($options['install']) {
behat_util::install_site();
// This is only displayed once for parallel install.
if (empty($options['run'])) {
mtrace("Acceptance tests site installed");
}
} else if ($options['drop']) {
// Ensure no tests are running.
test_lock::acquire('behat');
behat_util::drop_site();
// This is only displayed once for parallel install.
if (empty($options['run'])) {
mtrace("Acceptance tests site dropped");
}
} else if ($options['enable']) {
if (!empty($options['parallel'])) {
// Save parallel site info for enable and install options.
$filepath = behat_config_manager::get_parallel_test_file_path();
if (!file_put_contents($filepath, $options['parallel'])) {
behat_error(BEHAT_EXITCODE_PERMISSIONS, 'File ' . $filepath . ' can not be created');
}
}
// Enable test mode.
behat_util::start_test_mode();
// This is only displayed once for parallel install.
if (empty($options['run'])) {
$runtestscommand = behat_command::get_behat_command(true, !empty($options['run']));
$runtestscommand .= ' --config ' . behat_config_manager::get_behat_cli_config_filepath();
mtrace("Acceptance tests environment enabled on $CFG->behat_wwwroot, to run the tests use: " . PHP_EOL .
$runtestscommand);
}
} else if ($options['disable']) {
behat_util::stop_test_mode();
// This is only displayed once for parallel install.
if (empty($options['run'])) {
mtrace("Acceptance tests environment disabled");
}
} else if ($options['diag']) {
$code = behat_util::get_behat_status();
exit($code);
} else if ($options['updatesteps']) {
if (defined('BEHAT_FEATURE_STEP_FILE') && BEHAT_FEATURE_STEP_FILE) {
$behatstepfile = BEHAT_FEATURE_STEP_FILE;
} else {
echo "BEHAT_FEATURE_STEP_FILE is not set, please ensure you set this to writable file" . PHP_EOL;
exit(1);
}
// Run behat command to get steps in feature files.
$featurestepscmd = behat_command::get_behat_command(true);
$featurestepscmd .= ' --config ' . behat_config_manager::get_behat_cli_config_filepath();
$featurestepscmd .= ' --dry-run --format=moodle_step_count';
$processes = cli_execute_parallel(array($featurestepscmd), __DIR__ . "/../../../../");
$status = print_update_step_output(array_pop($processes), $behatstepfile);
exit($status);
} else {
echo $help;
exit(1);
}
exit(0);
/**
* Print update progress as dots for updating feature file step list.
*
* @param Process $process process executing update step command.
* @param string $featurestepfile feature step file in which steps will be saved.
* @return int exitcode.
*/
function print_update_step_output($process, $featurestepfile) {
$printedlength = 0;
echo "Updating steps feature file for parallel behat runs" . PHP_EOL;
// Show progress while running command.
while ($process->isRunning()) {
usleep(10000);
$op = $process->getIncrementalOutput();
if (trim($op)) {
echo ".";
$printedlength++;
if ($printedlength > 70) {
$printedlength = 0;
echo PHP_EOL;
}
}
}
// If any error then exit.
$exitcode = $process->getExitCode();
// Output err.
if ($exitcode != 0) {
echo $process->getErrorOutput();
exit($exitcode);
}
// Extract features with step info and save it in file.
$featuresteps = $process->getOutput();
$featuresteps = explode(PHP_EOL, $featuresteps);
$realroot = realpath(__DIR__.'/../../../../').'/';
foreach ($featuresteps as $featurestep) {
if (trim($featurestep)) {
$step = explode("::", $featurestep);
$step[0] = str_replace($realroot, '', $step[0]);
$steps[$step[0]] = $step[1];
}
}
if ($existing = @json_decode(file_get_contents($featurestepfile), true)) {
$steps = array_merge($existing, $steps);
}
arsort($steps);
if (!@file_put_contents($featurestepfile, json_encode($steps, JSON_PRETTY_PRINT))) {
behat_error(BEHAT_EXITCODE_PERMISSIONS, 'File ' . $featurestepfile . ' can not be created');
$exitcode = -1;
}
echo PHP_EOL. "Updated step count in " . $featurestepfile . PHP_EOL;
return $exitcode;
}
+1 -1
View File
@@ -165,7 +165,7 @@ class tool_behat_renderer extends plugin_renderer_base {
// Info.
$installurl = behat_command::DOCS_URL . '#Installation';
$installlink = html_writer::tag('a', $installurl, array('href' => $installurl, 'target' => '_blank'));
$writetestsurl = behat_command::DOCS_URL . '#Writing_features';
$writetestsurl = behat_command::DOCS_URL . '#Writting_features';
$writetestslink = html_writer::tag('a', $writetestsurl, array('href' => $writetestsurl, 'target' => '_blank'));
$writestepsurl = behat_command::DOCS_URL . '#Adding_steps_definitions';
$writestepslink = html_writer::tag('a', $writestepsurl, array('href' => $writestepsurl, 'target' => '_blank'));
@@ -0,0 +1,53 @@
@tool @tool_behat
Feature: Page contents assertions
In order to write good tests
As a tests writer
I need to check the page contents
@javascript
Scenario: Basic contents assertions
Given I log in as "admin"
And I am on homepage
And I expand "Users" node
And I follow "Groups"
And I press "Create group"
And I set the following fields to these values:
| Group name | I'm the name |
| Group description | I'm the description |
And I press "Save changes"
When I follow "Overview"
And I wait until the page is ready
And I wait "2" seconds
And I hover "#region-main .generaltable td span" "css_element"
Then I should see "I'm the description"
And "Grouping" "select" in the "region-main" "region" should be visible
And "Group" "select" should be visible
And "Messaging" "link" in the "Administration" "block" should not be visible
And "Change password" "link" should not be visible
And I should see "Filter groups by"
And I should not see "Filter groupssss by"
And I should see "Group members" in the "#region-main table th.c1" "css_element"
And I should not see "Group membersssss" in the "#region-main table th.c1" "css_element"
And I follow "Groups"
And the "#groupeditform #showcreateorphangroupform" "css_element" should be enabled
And the "#groupeditform #showeditgroupsettingsform" "css_element" should be disabled
@javascript
Scenario: Locators inside specific DOM nodes using CSS selectors
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And I log in as "admin"
And I follow "Course 1"
When I dock "Administration" block
Then I should not see "Question bank" in the ".block-region" "css_element"
And I click on "//div[@id='dock']/descendant::h2[normalize-space(.)='Administration']" "xpath_element"
@javascript
Scenario: Locators inside specific DOM nodes using XPath
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And I log in as "admin"
When I dock "Administration" block
Then I should not see "Turn editing on" in the ".block-region" "css_element"
@@ -27,7 +27,6 @@ Feature: Set up contextual data for tests
| Course 2 | COURSE2 | CAT3 |
| Course 3 | COURSE3 | 0 |
When I log in as "admin"
And I am on site homepage
Then I should see "Course 1"
And I should see "Course 2"
And I should see "Course 3"
@@ -57,7 +56,6 @@ Feature: Set up contextual data for tests
| Grouping 1 | C1 | GG1 |
| Grouping 2 | C1 | GG2 |
When I log in as "admin"
And I am on site homepage
And I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
@@ -71,8 +69,8 @@ Feature: Set up contextual data for tests
Scenario: Role overrides
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
| teacher1 | Teacher | 1 | teacher1@asd.com |
| student1 | Student | 1 | student1@asd.com |
And the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
@@ -88,7 +86,6 @@ Feature: Set up contextual data for tests
| mod/forum:editanypost | Allow | student | Course | C1 |
| mod/forum:replynews | Prevent | editingteacher | Course | C1 |
When I log in as "admin"
And I am on site homepage
And I follow "Course 1"
And I expand "Users" node
And I follow "Permissions"
@@ -102,7 +99,7 @@ Feature: Set up contextual data for tests
Scenario: Add course enrolments
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | student1@example.com |
| student1 | Student | 1 | student1@asd.com |
And the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
@@ -120,11 +117,11 @@ Feature: Set up contextual data for tests
| Custom student | custom2 | | |
And the following "users" exist:
| username | firstname | lastname | email |
| user1 | User | 1 | user1@example.com |
| user2 | User | 2 | user2@example.com |
| user3 | User | 3 | user3@example.com |
| user4 | User | 4 | user4@example.com |
| user5 | User | 5 | user5@example.com |
| user1 | User | 1 | user1@moodlemoodle.com |
| user2 | User | 2 | user2@moodlemoodle.com |
| user3 | User | 3 | user3@moodlemoodle.com |
| user4 | User | 4 | user4@moodlemoodle.com |
| user5 | User | 5 | user5@moodlemoodle.com |
And the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
@@ -141,27 +138,22 @@ Feature: Set up contextual data for tests
| user3 | editingteacher | Course | C1 |
| user5 | custom2 | System | |
When I log in as "user1"
And I am on site homepage
Then I should see "Front page settings"
And I log out
And I log in as "user2"
And I am on site homepage
And I follow "Course 1"
And I should see "Turn editing on"
And I log out
And I log in as "user3"
And I am on site homepage
And I follow "Course 1"
And I should see "Turn editing on"
And I log out
And I log in as "user4"
And I am on site homepage
And I follow "Course 1"
And I should see "Turn editing on"
And I log out
And I log in as "user5"
And I should see "You are logged in as"
And I am on site homepage
And I follow "Course 1"
And I should see "You can not enrol yourself in this course."
@@ -193,14 +185,7 @@ Feature: Set up contextual data for tests
| url | Test url name | Test url description | C1 | url1 |
| wiki | Test wiki name | Test wiki description | C1 | wiki1 |
| workshop | Test workshop name | Test workshop description | C1 | workshop1 |
And the following "scales" exist:
| name | scale |
| Test Scale 1 | Disappointing, Good, Very good, Excellent |
And the following "activities" exist:
| activity | name | intro | course | idnumber | grade |
| assign | Test assignment name with scale | Test assignment description | C1 | assign1 | Test Scale 1 |
When I log in as "admin"
And I am on site homepage
And I follow "Course 1"
Then I should see "Test assignment name"
# Assignment 2.2 module type is disabled by default
@@ -229,17 +214,13 @@ Feature: Set up contextual data for tests
And I should see "Test workshop name"
And I follow "Test assignment name"
And I should see "Test assignment description"
And I follow "C1"
And I follow "Test assignment name with scale"
And I follow "Edit settings"
And the field "Type" matches value "Scale"
@javascript
Scenario: Add relations between users and groups
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | student1@example.com |
| student2 | Student | 2 | student2@example.com |
| student1 | Student | 1 | student1@asd.com |
| student2 | Student | 2 | student2@asd.com |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
@@ -262,7 +243,6 @@ Feature: Set up contextual data for tests
| grouping | group |
| GG1 | G1 |
When I log in as "admin"
And I am on site homepage
And I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
@@ -273,183 +253,24 @@ Feature: Set up contextual data for tests
And I set the field "groups" to "Group 2 (1)"
And the "members" select box should contain "Student 2"
Scenario: Add cohorts and cohort members with data generator
Scenario: Add cohorts with data generator
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
And the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | student1@example.com |
| student2 | Student | 2 | student2@example.com |
And the following "cohorts" exist:
| name | idnumber |
| System cohort A | CHSA |
| System cohort 1 | CH01 |
And the following "cohorts" exist:
| name | idnumber | contextlevel | reference |
| System cohort B | CHSB | System | |
| Cohort in category | CHC | Category | CAT1 |
| Empty cohort | CHE | Category | CAT1 |
And the following "cohort members" exist:
| user | cohort |
| student1 | CHSA |
| student2 | CHSB |
| student1 | CHSB |
| student1 | CHC |
| System cohort 2 | CH02 | System | |
| Cohort in category 1 | CH1 | Category | CAT1 |
When I log in as "admin"
And I navigate to "Cohorts" node in "Site administration > Users > Accounts"
Then the following should exist in the "cohorts" table:
| Name | Cohort size |
| System cohort A | 1 |
| System cohort B | 2 |
Then I should see "System cohort 1"
And I should see "System cohort 2"
And I should not see "Cohort in category"
And I follow "Courses"
And I follow "Cat 1"
And I follow "Cohorts"
And I should see "Cohort in category 1"
And I should not see "System cohort"
And the following should exist in the "cohorts" table:
| Name | Cohort size |
| Cohort in category | 1 |
| Empty cohort | 0 |
Scenario: Add grade categories with data generator
Given the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "grade categories" exist:
| fullname | course |
| Grade category 1 | C1 |
And the following "grade categories" exist:
| fullname | course | gradecategory |
| Grade sub category 2 | C1 | Grade category 1 |
When I log in as "admin"
And I am on site homepage
And I follow "Courses"
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
Then I should see "Grade category 1"
And I should see "Grade sub category 2"
Scenario: Add a bunch of grade items
Given the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "grade categories" exist:
| fullname | course |
| Grade category 1 | C1 |
And the following "grade categories" exist:
| fullname | course | gradecategory |
| Grade sub category 2 | C1 | Grade category 1 |
And the following "grade items" exist:
| itemname | course |
| Test Grade Item 1 | C1 |
And the following "grade items" exist:
| itemname | course | gradecategory |
| Test Grade Item 2 | C1 | Grade category 1 |
| Test Grade Item 3 | C1 | Grade sub category 2 |
When I log in as "admin"
And I am on site homepage
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I expand "Setup" node
And I follow "Categories and items"
Then I should see "Test Grade Item 1"
And I follow "Edit Test Grade Item 1"
And I expand all fieldsets
And I should see "Course 1"
And I press "Cancel"
And I should see "Grade category 1"
And I should see "Test Grade Item 2"
And I follow "Edit Test Grade Item 2"
And I expand all fieldsets
And I should see "Grade category 1"
And I press "Cancel"
And I should see "Grade sub category 2"
And I should see "Test Grade Item 3"
And I follow "Edit Test Grade Item 3"
And I expand all fieldsets
And I should see "Grade sub category 2"
And I press "Cancel"
Scenario: Add a bunch of scales
Given the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "scales" exist:
| name | scale |
| Test Scale 1 | Disappointing, Good, Very good, Excellent |
When I log in as "admin"
And I am on site homepage
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I follow "Scales"
Then I should see "Test Scale 1"
And I should see "Disappointing, Good, Very good, Excellent"
Scenario: Add a bunch of outcomes
Given the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "scales" exist:
| name | scale |
| Test Scale 1 | Disappointing, Good, Very good, Excellent |
And the following "grade outcomes" exist:
| fullname | shortname | scale |
| Grade outcome 1 | OT1 | Test Scale 1 |
And the following "grade outcomes" exist:
| fullname | shortname | course | scale |
| Grade outcome 2 | OT2 | C1 | Test Scale 1 |
And the following config values are set as admin:
| enableoutcomes | 1 |
When I log in as "admin"
And I am on site homepage
And I follow "Course 1"
And I follow "Outcomes"
Then I should see "Grade outcome 1" in the "#addoutcomes" "css_element"
And I should see "Grade outcome 2" in the "#removeoutcomes" "css_element"
And I follow "Edit outcomes"
And the following should exist in the "generaltable" table:
| Full name | Short name | Scale |
| Grade outcome 2 | OT2 | Test Scale 1 |
Scenario: Add a bunch of outcome grade items
Given the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "scales" exist:
| name | scale |
| Test Scale 1 | Disappointing, Good, Very good, Excellent |
And the following "grade outcomes" exist:
| fullname | shortname | course | scale |
| Grade outcome 1 | OT1 | C1 | Test Scale 1 |
And the following "grade categories" exist:
| fullname | course |
| Grade category 1 | C1 |
And the following "grade items" exist:
| itemname | course | outcome | gradecategory |
| Test Outcome Grade Item 1 | C1 | OT1 | Grade category 1 |
And the following config values are set as admin:
| enableoutcomes | 1 |
When I log in as "admin"
And I am on site homepage
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I expand "Setup" node
And I follow "Categories and items"
Then I should see "Test Outcome Grade Item 1"
And I follow "Edit Test Outcome Grade Item 1"
And the field "Outcome" matches value "Grade outcome 1"
And I expand all fieldsets
And "//div[contains(@class, 'fitem')]/div[contains(@class, 'fitemtitle')]/div[contains(@class, fstaticlabel) and contains(., 'Grade category')]/../../div[contains(@class, 'felement') and contains(., 'Grade category 1')]" "xpath_element" should exist
And I press "Cancel"
Scenario: Add a block
Given the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| online_users | Course | C1 | course-view-* | site-pre |
When I log in as "admin"
And I am on site homepage
And I follow "Course 1"
Then I should see "Online users"
@@ -7,7 +7,7 @@ Feature: Edit capabilities
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| teacher1 | Teacher | 1 | teacher1@asd.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
@@ -15,6 +15,7 @@ Feature: Edit capabilities
| user | course | role |
| teacher1 | C1 | editingteacher |
@javascript
Scenario: Default system capabilities modification
Given I log in as "admin"
And I set the following system permissions of "Teacher" role:
@@ -29,6 +30,7 @@ Feature: Edit capabilities
And "moodle/grade:managesharedforms" capability has "Prevent" permission
And "moodle/course:request" capability has "Prohibit" permission
@javascript
Scenario: Course capabilities overrides
Given I log in as "teacher1"
And I follow "Course 1"
@@ -39,11 +41,11 @@ Feature: Edit capabilities
| mod/forum:editanypost | Prevent |
| mod/forum:addquestion | Allow |
When I set the field "Advanced role override" to "Student (3)"
And I press "Go"
Then "mod/forum:deleteanypost" capability has "Prohibit" permission
And "mod/forum:editanypost" capability has "Prevent" permission
And "mod/forum:addquestion" capability has "Allow" permission
@javascript
Scenario: Module capabilities overrides
Given I log in as "teacher1"
And I follow "Course 1"
@@ -58,7 +60,6 @@ Feature: Edit capabilities
| mod/forum:editanypost | Prevent |
| mod/forum:addquestion | Allow |
When I set the field "Advanced role override" to "Student (3)"
And I press "Go"
Then "mod/forum:deleteanypost" capability has "Prohibit" permission
And "mod/forum:editanypost" capability has "Prevent" permission
And "mod/forum:addquestion" capability has "Allow" permission
@@ -10,9 +10,9 @@ Feature: Verify that all form fields values can be get and set
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | email | firstname | lastname |
| student1 | s1@example.com | Student | 1 |
| student2 | s2@example.com | Student | 2 |
| student3 | s3@example.com | Student | 3 |
| student1 | s1@asd.com | Student | 1 |
| student2 | s2@asd.com | Student | 2 |
| student3 | s3@asd.com | Student | 3 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
@@ -39,7 +39,7 @@ Feature: Verify that all form fields values can be get and set
# Select (multi-select) - We will check "I set the field...".
And I set the field "otagsadd" to "OT1, OT2, OT3, OT4, OT5"
And I press "Add official tags"
And I am on site homepage
And I am on homepage
And I follow "Course 1"
And I turn editing mode on
And I follow "Test this one"
@@ -137,17 +137,6 @@ Feature: Verify that all form fields values can be get and set
And I press "Save my choice"
And the field "one" matches value "1"
And the field "two" matches value ""
# Check if field xpath set/match works.
And I am on site homepage
And I follow "Course 1"
And I navigate to "Edit settings" node in "Course administration"
And I set the field with xpath "//input[@id='id_idnumber']" to "Course id number"
And the field with xpath "//input[@name='idnumber']" matches value "Course id number"
And the field with xpath "//input[@name='idnumber']" does not match value ""
And I press "Save and display"
And I navigate to "Edit settings" node in "Course administration"
And the field "Course ID number" matches value "Course id number"
Scenario: with JS disabled all form fields getters and setters works as expected
@@ -170,7 +159,6 @@ Feature: Verify that all form fields values can be get and set
And I add a "Lesson" to section "1"
And I set the following fields to these values:
| Name | Test lesson |
| Description | Test lesson description |
| available[enabled] | 1 |
And I set the field "deadline[enabled]" to "1"
# Checkbox (AJAX) - Checking "the field matches value" before saving.
@@ -7,14 +7,12 @@ Feature: Forms manipulation
@javascript
Scenario: Basic forms manipulation
Given I log in as "admin"
And I follow "Preferences" in the user menu
And I follow "Edit profile"
And I navigate to "Edit profile" node in "My profile settings"
When I set the field "First name" to "Field value"
And I set the field "Select a country" to "Japan"
And I set the field "Text editor" to "Plain text area"
And I set the field "Unmask" to "1"
And I expand all fieldsets
Then the field "First name" matches value "Field value"
And the "Select a country" select box should contain "Japan"
And the "Text editor" select box should contain "Plain text area"
And the field "Unmask" matches value "1"
And I set the field "Unmask" to ""
And the field "Unmask" matches value ""
@@ -26,7 +24,6 @@ Feature: Forms manipulation
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And I log in as "admin"
And I am on site homepage
And I follow "Course 1"
And I turn editing mode on
And I add a "Quiz" to section "1"
@@ -5,13 +5,12 @@ Feature: Transform steps arguments
I need to apply some transformations to the steps arguments
Background:
Given I am on site homepage
Given I am on homepage
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And I log in as "admin"
And I follow "Preferences" in the user menu
And I follow "Edit profile"
And I navigate to "Edit profile" node in "My profile settings"
Scenario: Use nasty strings on steps arguments
When I set the field "Surname" to "$NASTYSTRING1"
@@ -46,6 +45,7 @@ Feature: Transform steps arguments
And the field "Description" matches value "va\\"lue2"
And the field "City/town" matches value "va\"lue3"
@javascript
Scenario: Nasty strings with other contents
When I set the field "First name" to "My Firstname $NASTYSTRING1"
And I set the following fields to these values:
@@ -5,5 +5,5 @@ Feature: Set up the testing environment
I need to use the test environment instead of the regular environment
Scenario: Accessing the site
When I am on site homepage
When I am on homepage
Then I should see "Acceptance test site"
+2 -2
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2015051100; // The current plugin version (Date: YYYYMMDDXX)
$plugin->requires = 2015050500; // Requires this Moodle version
$plugin->version = 2014051200; // The current plugin version (Date: YYYYMMDDXX)
$plugin->requires = 2014050800; // Requires this Moodle version
$plugin->component = 'tool_behat'; // Full name of the plugin (used for diagnostics)
+2 -2
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2015051100; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2015050500; // Requires this Moodle version.
$plugin->version = 2014051200; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2014050800; // Requires this Moodle version.
$plugin->component = 'tool_capability'; // Full name of the plugin (used for diagnostics).
@@ -83,6 +83,7 @@ SEARCH.prototype = {
div.append(label).append(this.input);
this.select.insert(div, 'before');
this.select.one('option').setStyle('display', 'none');
this.input.on('keyup', this.typed, this);
this.select.on('change', this.validate, this);
@@ -1 +1 @@
YUI.add("moodle-tool_capability-search",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)};n.prototype={form:null,select:null,selectoptions:{},input:null,button:null,lastsearch:null,initializer:function(){this.form=e.one("#capability-overview-form"),this.select=this.form.one("select[data-search=capability]"),this.select.setStyle("minWidth",this.select.get("offsetWidth")),this.select.get("options").each(function(e){var t=e.get("value");this.selectoptions[t]=e},this),this.button=this.form.all("input[type=submit]"),this.lastsearch=this.form.one("input[name=search]");var t=e.Node.create('<div id="capabilitysearchui"></div>'),n=e.Node.create('<label for="capabilitysearch">'+this.get("strsearch")+"</label>");this.input=e.Node.create('<input type="text" id="capabilitysearch" />'),t.append(n).append(this.input),this.select.insert(t,"before"),this.input.on("keyup",this.typed,this),this.select.on("change",this.validate,this),this.lastsearch&&(this.input.set("value",this.lastsearch.get("value")),this.typed(),this.select.one("option[selected]")&&this.select.set("scrollTop",this.select.one("option[selected]").get("getX"))),this.validate()},validate:function(){this.button.set("disabled",this.select.get("value")==="")},typed:function(){var e=this.input.get("value"),t=0,n=null,r;this.lastsearch&&this.lastsearch.set("value",e),this.select.all("option").remove();for(r in this.selectoptions)r.indexOf(e)>=0&&(t++,n=this.selectoptions[r],this.select.append(this.selectoptions[r]));t===0?this.input.addClass("error"):(this.input.removeClass("error"),t===1&&n.set("selected",!0)),this.validate()}},e.extend(n,e.Base,n.prototype,{NAME:"tool_capability-search",ATTRS:{strsearch:{}}}),M.tool_capability=M.tool_capability||{},M.tool_capability.init_capability_search=function(e){new n(e)}},"@VERSION@",{requires:["base","node"]});
YUI.add("moodle-tool_capability-search",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)};n.prototype={form:null,select:null,selectoptions:{},input:null,button:null,lastsearch:null,initializer:function(){this.form=e.one("#capability-overview-form"),this.select=this.form.one("select[data-search=capability]"),this.select.setStyle("minWidth",this.select.get("offsetWidth")),this.select.get("options").each(function(e){var t=e.get("value");this.selectoptions[t]=e},this),this.button=this.form.all("input[type=submit]"),this.lastsearch=this.form.one("input[name=search]");var t=e.Node.create('<div id="capabilitysearchui"></div>'),n=e.Node.create('<label for="capabilitysearch">'+this.get("strsearch")+"</label>");this.input=e.Node.create('<input type="text" id="capabilitysearch" />'),t.append(n).append(this.input),this.select.insert(t,"before"),this.select.one("option").setStyle("display","none"),this.input.on("keyup",this.typed,this),this.select.on("change",this.validate,this),this.lastsearch&&(this.input.set("value",this.lastsearch.get("value")),this.typed(),this.select.one("option[selected]")&&this.select.set("scrollTop",this.select.one("option[selected]").get("getX"))),this.validate()},validate:function(){this.button.set("disabled",this.select.get("value")==="")},typed:function(){var e=this.input.get("value"),t=0,n=null,r;this.lastsearch&&this.lastsearch.set("value",e),this.select.all("option").remove();for(r in this.selectoptions)r.indexOf(e)>=0&&(t++,n=this.selectoptions[r],this.select.append(this.selectoptions[r]));t===0?this.input.addClass("error"):(this.input.removeClass("error"),t===1&&n.set("selected",!0)),this.validate()}},e.extend(n,e.Base,n.prototype,{NAME:"tool_capability-search",ATTRS:{strsearch:{}}}),M.tool_capability=M.tool_capability||{},M.tool_capability.init_capability_search=function(e){new n(e)}},"@VERSION@",{requires:["base","node"]});
@@ -83,6 +83,7 @@ SEARCH.prototype = {
div.append(label).append(this.input);
this.select.insert(div, 'before');
this.select.one('option').setStyle('display', 'none');
this.input.on('keyup', this.typed, this);
this.select.on('change', this.validate, this);
+1
View File
@@ -81,6 +81,7 @@ SEARCH.prototype = {
div.append(label).append(this.input);
this.select.insert(div, 'before');
this.select.one('option').setStyle('display', 'none');
this.input.on('keyup', this.typed, this);
this.select.on('change', this.validate, this);
-6
View File
@@ -48,11 +48,5 @@ function xmldb_tool_customlang_upgrade($oldversion) {
// Moodle v2.7.0 release upgrade line.
// Put any upgrade step following this.
// Moodle v2.8.0 release upgrade line.
// Put any upgrade step following this.
// Moodle v2.9.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+1 -1
View File
@@ -63,7 +63,7 @@ if ($translatorsubmitted) {
$checkin = optional_param('savecheckin', false, PARAM_RAW);
if ($checkin === false) {
$nexturl = new moodle_url($PAGE->url, array('p' => $currentpage));
$nexturl = $PAGE->url;
} else {
$nexturl = new moodle_url('/admin/tool/customlang/index.php', array('action'=>'checkin', 'lng' => $lng, 'sesskey'=>sesskey()));
}
-1
View File
@@ -133,7 +133,6 @@ class tool_customlang_renderer extends plugin_renderer_base {
$output .= html_writer::start_tag('div');
$output .= html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'translatorsubmitted', 'value'=>1));
$output .= html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'sesskey', 'value'=>sesskey()));
$output .= html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'p', 'value'=>$translator->currentpage));
$save1 = html_writer::empty_tag('input', array('type'=>'submit', 'name'=>'savecontinue', 'value'=>get_string('savecontinue', 'tool_customlang')));
$save2 = html_writer::empty_tag('input', array('type'=>'submit', 'name'=>'savecheckin', 'value'=>get_string('savecheckin', 'tool_customlang')));
$output .= html_writer::tag('fieldset', $save1.$save2, array('class'=>'buttonsbar'));
+2 -2
View File
@@ -25,6 +25,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2015051100;
$plugin->requires = 2015050500;
$plugin->version = 2014051200;
$plugin->requires = 2014050800;
$plugin->component = 'tool_customlang'; // Full name of the plugin (used for diagnostics)
+2 -2
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2015051100; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2015050500; // Requires this Moodle version.
$plugin->version = 2014051200; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2014050800; // Requires this Moodle version.
$plugin->component = 'tool_dbtransfer'; // Full name of the plugin (used for diagnostics).
-122
View File
@@ -1,122 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Class with static back-end methods used by the file type tool.
*
* @package tool_filetypes
* @copyright 2014 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_filetypes;
defined('MOODLE_INTERNAL') || die();
/**
* Class with static back-end methods used by the file type tool.
*
* @package tool_filetypes
* @copyright 2014 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class utils {
/**
* Checks if the given file type extension is invalid.
* The added file type extension must be unique and must not begin with a dot.
*
* @param string $extension Extension of the file type to add
* @param string $oldextension Extension prior to update (empty string if adding new type)
* @return bool True if it the file type trying to add already exists
*/
public static function is_extension_invalid($extension, $oldextension = '') {
$extension = trim($extension);
if ($extension === '' || $extension[0] === '.') {
return true;
}
$mimeinfo = get_mimetypes_array();
if ($oldextension !== '') {
unset($mimeinfo[$oldextension]);
}
return array_key_exists($extension, $mimeinfo);
}
/**
* Checks if we are allowed to turn on the 'default icon' option. You can
* only have one of these for a given MIME type.
*
* @param string $mimetype MIME type
* @param string $oldextension File extension name (before any change)
*/
public static function is_defaulticon_allowed($mimetype, $oldextension = '') {
$mimeinfo = get_mimetypes_array();
if ($oldextension !== '') {
unset($mimeinfo[$oldextension]);
}
foreach ($mimeinfo as $extension => $values) {
if ($values['type'] !== $mimetype) {
continue;
}
if (!empty($values['defaulticon'])) {
return false;
}
}
return true;
}
/**
* Gets all unique file type icons from a specific path, not including
* sub-directories.
*
* Icon files such as pdf.png, pdf-24.png and pdf-36.png etc. are counted as
* the same icon type.
*
* The resultant array has both key and value set to the icon name prefix,
* such as 'pdf' => 'pdf'.
*
* @param string $path The path of the icon path
* @return array An array of unique file icons within the given path
*/
public static function get_icons_from_path($path) {
$icons = array();
if ($handle = @opendir($path)) {
while (($file = readdir($handle)) !== false) {
$matches = array();
if (preg_match('~(.+?)(?:-24|-32|-48|-64|-72|-80|-96|-128|-256)?\.(?:gif|png)$~',
$file, $matches)) {
$key = $matches[1];
$icons[$key] = $key;
}
}
closedir($handle);
}
ksort($icons);
return $icons;
}
/**
* Gets unique file type icons from pix/f folder.
*
* @return array An array of unique file type icons e.g. 'pdf' => 'pdf'
*/
public static function get_file_icons() {
global $CFG;
$path = $CFG->dirroot . '/pix/f';
return self::get_icons_from_path($path);
}
}
-60
View File
@@ -1,60 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Delete a file type with a confirmation box.
*
* @package tool_filetypes
* @copyright 2014 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require(__DIR__ . '/../../../config.php');
require_once($CFG->libdir . '/adminlib.php');
admin_externalpage_setup('tool_filetypes');
$extension = required_param('extension', PARAM_ALPHANUMEXT);
$redirecturl = new \moodle_url('/admin/tool/filetypes/index.php');
if (optional_param('delete', 0, PARAM_INT)) {
require_sesskey();
// Delete the file type from the config.
core_filetypes::delete_type($extension);
redirect($redirecturl);
}
// Page settings.
$title = get_string('deletefiletypes', 'tool_filetypes');
$context = context_system::instance();
$PAGE->set_url(new \moodle_url('/admin/tool/filetypes/delete.php', array('extension' => $extension)));
$PAGE->navbar->add($title);
$PAGE->set_context($context);
$PAGE->set_pagelayout('admin');
$PAGE->set_title($SITE->fullname. ': ' . $title);
// Display the page.
echo $OUTPUT->header();
$message = get_string('delete_confirmation', 'tool_filetypes', $extension);
$deleteurl = new \moodle_url('delete.php', array('extension' => $extension, 'delete' => 1));
$yesbutton = new single_button($deleteurl, get_string('yes'));
$nobutton = new single_button($redirecturl, get_string('no'), 'get');
echo $OUTPUT->confirm($message, $yesbutton, $nobutton);
echo $OUTPUT->footer();
-111
View File
@@ -1,111 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Display the file type updating page.
*
* @package tool_filetypes
* @copyright 2014 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require(__DIR__ . '/../../../config.php');
require_once($CFG->libdir . '/adminlib.php');
require_once('edit_form.php');
admin_externalpage_setup('tool_filetypes');
$oldextension = optional_param('oldextension', '', PARAM_ALPHANUMEXT);
$mform = new tool_filetypes_form('edit.php', array('oldextension' => $oldextension));
$title = get_string('addfiletypes', 'tool_filetypes');
if ($oldextension) {
// This is editing an existing filetype, load data to the form.
$mimetypes = get_mimetypes_array();
if (!array_key_exists($oldextension, $mimetypes)) {
throw new moodle_exception('error_notfound', 'tool_filetypes');
}
$typeinfo = $mimetypes[$oldextension];
$formdata = array(
'extension' => $oldextension,
'mimetype' => $typeinfo['type'],
'icon' => $typeinfo['icon'],
'oldextension' => $oldextension,
'description' => '',
'groups' => '',
'corestring' => '',
'defaulticon' => 0
);
if (!empty($typeinfo['customdescription'])) {
$formdata['description'] = $typeinfo['customdescription'];
}
if (!empty($typeinfo['groups'])) {
$formdata['groups'] = implode(', ', $typeinfo['groups']);
}
if (!empty($typeinfo['string'])) {
$formdata['corestring'] = $typeinfo['string'];
}
if (!empty($typeinfo['defaulticon'])) {
$formdata['defaulticon'] = 1;
}
$mform->set_data($formdata);
$title = get_string('editfiletypes', 'tool_filetypes');
}
$backurl = new \moodle_url('/admin/tool/filetypes/index.php');
if ($mform->is_cancelled()) {
redirect($backurl);
} else if ($data = $mform->get_data()) {
// Convert the groups value back into an array.
$data->groups = trim($data->groups);
if ($data->groups) {
$data->groups = preg_split('~,\s*~', $data->groups);
} else {
$data->groups = array();
}
if (empty($data->defaulticon)) {
$data->defaulticon = 0;
}
if (empty($data->corestring)) {
$data->corestring = '';
}
if (empty($data->description)) {
$data->description = '';
}
if ($data->oldextension) {
// Update an existing file type.
core_filetypes::update_type($data->oldextension, $data->extension, $data->mimetype, $data->icon,
$data->groups, $data->corestring, $data->description, (bool)$data->defaulticon);
} else {
// Add a new file type entry.
core_filetypes::add_type($data->extension, $data->mimetype, $data->icon,
$data->groups, $data->corestring, $data->description, (bool)$data->defaulticon);
}
redirect($backurl);
}
// Page settings.
$context = context_system::instance();
$PAGE->set_url(new \moodle_url('/admin/tool/filetypes/edit.php', array('oldextension' => $oldextension)));
$PAGE->navbar->add($oldextension ? s($oldextension) : $title);
$PAGE->set_context($context);
$PAGE->set_pagelayout('admin');
$PAGE->set_title($SITE->fullname. ': ' . $title);
// Display the page.
echo $OUTPUT->header();
$mform->display();
echo $OUTPUT->footer();
-152
View File
@@ -1,152 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Customised file types editing form.
*
* @package tool_filetypes
* @copyright 2014 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once($CFG->dirroot . '/lib/formslib.php');
/**
* Form for adding a new custom file type or updating an existing custom file type.
*
* @package tool_filetypes
* @copyright 2014 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class tool_filetypes_form extends moodleform {
public function definition() {
global $CFG;
$mform = $this->_form;
$oldextension = $this->_customdata['oldextension'];
$mform->addElement('text', 'extension', get_string('extension', 'tool_filetypes'));
$mform->setType('extension', PARAM_ALPHANUMEXT);
$mform->addRule('extension', null, 'required', null, 'client');
$mform->addHelpButton('extension', 'extension', 'tool_filetypes');
$mform->addElement('text', 'mimetype', get_string('mimetype', 'tool_filetypes'));
$mform->setType('mimetype', PARAM_RAW);
$mform->addRule('mimetype', null, 'required', null, 'client');
$mform->addHelpButton('mimetype', 'mimetype', 'tool_filetypes');
$fileicons = \tool_filetypes\utils::get_file_icons();
$mform->addElement('select', 'icon',
get_string('icon', 'tool_filetypes'), $fileicons);
$mform->addHelpButton('icon', 'icon', 'tool_filetypes');
$mform->addElement('text', 'groups', get_string('groups', 'tool_filetypes'));
$mform->setType('groups', PARAM_RAW);
$mform->addHelpButton('groups', 'groups', 'tool_filetypes');
$mform->addElement('select', 'descriptiontype', get_string('descriptiontype', 'tool_filetypes'),
array('' => get_string('descriptiontype_default', 'tool_filetypes'),
'custom' => get_string('descriptiontype_custom', 'tool_filetypes'),
'lang' => get_string('descriptiontype_lang', 'tool_filetypes')));
$mform->addElement('text', 'description', get_string('description', 'tool_filetypes'));
$mform->setType('description', PARAM_TEXT);
$mform->addHelpButton('description', 'description', 'tool_filetypes');
$mform->disabledIf('description', 'descriptiontype', 'ne', 'custom');
$mform->addElement('text', 'corestring', get_string('corestring', 'tool_filetypes'));
$mform->setType('corestring', PARAM_ALPHANUMEXT);
$mform->addHelpButton('corestring', 'corestring', 'tool_filetypes');
$mform->disabledIf('corestring', 'descriptiontype', 'ne', 'lang');
$mform->addElement('checkbox', 'defaulticon', get_string('defaulticon', 'tool_filetypes'));
$mform->addHelpButton('defaulticon', 'defaulticon', 'tool_filetypes');
$mform->addElement('hidden', 'oldextension', $oldextension);
$mform->setType('oldextension', PARAM_RAW);
$this->add_action_buttons(true, get_string('savechanges'));
}
public function set_data($data) {
// Set up the description type.
if (!empty($data['corestring'])) {
$data['descriptiontype'] = 'lang';
} else if (!empty($data['description'])) {
$data['descriptiontype'] = 'custom';
} else {
$data['descriptiontype'] = '';
}
// Call parent.
parent::set_data($data);
}
public function get_data() {
$data = parent::get_data();
// Update the data to handle the descriptiontype dropdown. (The type
// is not explicitly stored, we just set or unset relevant fields.)
if ($data) {
switch ($data->descriptiontype) {
case 'lang' :
unset($data->description);
break;
case 'custom' :
unset($data->corestring);
break;
default:
unset($data->description);
unset($data->corestring);
break;
}
unset($data->descriptiontype);
}
return $data;
}
public function validation($data, $files) {
$errors = parent::validation($data, $files);
// Check the extension isn't already in use.
$oldextension = $data['oldextension'];
$extension = trim($data['extension']);
if (\tool_filetypes\utils::is_extension_invalid($extension, $oldextension)) {
$errors['extension'] = get_string('error_extension', 'tool_filetypes', $extension);
}
// Check the 'default icon' setting doesn't conflict with an existing one.
if (!empty($data['defaulticon']) && !\tool_filetypes\utils::is_defaulticon_allowed(
$data['mimetype'], $oldextension)) {
$errors['defaulticon'] = get_string('error_defaulticon', 'tool_filetypes', $extension);
}
// If you choose 'lang' or 'custom' descriptiontype, you must fill something in the field.
switch ($data['descriptiontype']) {
case 'lang' :
if (!trim($data['corestring'])) {
$errors['corestring'] = get_string('required');
}
break;
case 'custom' :
if (!trim($data['description'])) {
$errors['description'] = get_string('required');
}
break;
}
return $errors;
}
}
-48
View File
@@ -1,48 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Display the custom file type settings page.
*
* @package tool_filetypes
* @copyright 2014 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require(__DIR__ . '/../../../config.php');
require_once($CFG->libdir . '/adminlib.php');
admin_externalpage_setup('tool_filetypes');
// Page settings.
$title = get_string('pluginname', 'tool_filetypes');
$context = context_system::instance();
$PAGE->set_url(new \moodle_url('/admin/tool/filetypes/index.php'));
$PAGE->set_context($context);
$PAGE->set_pagelayout('admin');
$PAGE->set_title($SITE->fullname. ': ' . $title);
$renderer = $PAGE->get_renderer('tool_filetypes');
// Is it restricted because set in config.php?
$restricted = array_key_exists('customfiletypes', $CFG->config_php_settings);
// Display the page.
echo $renderer->header();
echo $renderer->edit_table(get_mimetypes_array(), core_filetypes::get_deleted_types(),
$restricted);
echo $renderer->footer();
@@ -1,69 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Strings for custom file types.
*
* @package tool_filetypes
* @copyright 2014 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$string['addfiletypes'] = 'Add a new file type';
$string['corestring'] = 'Alternative language string';
$string['corestring_help'] = 'This setting can be used to select a different language string from the core mimetypes.php language file. Generally it should be left blank. For custom types, use the description field.';
$string['defaulticon'] = 'Default icon for MIME type';
$string['defaulticon_help'] = 'If there are multiple file extensions with the same MIME type, select this option for one of the extensions so that its icon will be used when determining an icon from the MIME type.';
$string['delete_confirmation'] = 'Are you absolutely sure you want to remove <strong>.{$a}</strong>?';
$string['deletea'] = 'Delete {$a}';
$string['deletefiletypes'] = 'Delete a file type';
$string['description'] = 'Custom description';
$string['description_help'] = 'Simple file type description, e.g. &lsquo;Kindle ebook&rsquo;. If your site supports multiple languages and uses the multi-language filter, you can enter multi-language tags in this field to supply a description in different languages.';
$string['descriptiontype'] = 'Description type';
$string['descriptiontype_help'] = 'There are three possible ways to specify a description.
* Default behaviour uses the MIME type. If there is a language string in mimetypes.php corresponding to that MIME type, it will be used; otherwise the MIME type itself will be displayed to users.
* You can specify a custom description on this form.
* You can specify the name of a languge string in mimetypes.php to use instead of the MIME type.';
$string['descriptiontype_default'] = 'Default (MIME type or corresponding language string if available)';
$string['descriptiontype_custom'] = 'Custom description specified in this form';
$string['descriptiontype_lang'] = 'Alternative language string (from mimetypes.php)';
$string['displaydescription'] = 'Description';
$string['editfiletypes'] = 'Edit an existing file type';
$string['emptylist'] = 'There are no file types defined.';
$string['error_addentry'] = 'The file type extension, description, MIME type, and icon must not contain line feed and semicolon characters.';
$string['error_defaulticon'] = 'Another file extension with the same MIME type is already marked as the default icon.';
$string['error_extension'] = 'The file type extension <strong>{$a}</strong> already exists or is invalid. File extensions must be unique and must not contain special characters.';
$string['error_notfound'] = 'The file type with extension {$a} cannot be found.';
$string['extension'] = 'Extension';
$string['extension_help'] = 'File name extension without the dot, e.g. &lsquo;mobi&rsquo;';
$string['groups'] = 'Type groups';
$string['groups_help'] = 'Optional list of file type groups that this type belongs to. These are generic categories such as &lsquo;document&rsquo; and &lsquo;image&rsquo;.';
$string['icon'] = 'File icon';
$string['icon_help'] = 'Icon filename.
The list of icons is taken from the /pix/f directory inside your Moodle installation. You can add custom icons to this folder if required.';
$string['mimetype'] = 'MIME type';
$string['mimetype_help'] = 'MIME type associated with this file type, e.g. &lsquo;application/x-mobipocket-ebook&rsquo;';
$string['pluginname'] = 'File types';
$string['revert'] = 'Restore {$a} to Moodle defaults';
$string['revert_confirmation'] = 'Are you sure you want to restore <strong>.{$a}</strong> to Moodle defaults, discarding your changes?';
$string['revertfiletype'] = 'Restore a file type';
$string['source'] = 'Type';
$string['source_custom'] = 'Custom';
$string['source_deleted'] = 'Deleted';
$string['source_modified'] = 'Modified';
$string['source_standard'] = 'Standard';
-179
View File
@@ -1,179 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Renderer.
*
* @package tool_filetypes
* @copyright 2014 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Class containing the renderer functions for displaying file types.
*
* @package tool_filetypes
* @copyright 2014 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class tool_filetypes_renderer extends plugin_renderer_base {
/**
* Renderer for displaying the file type edit table.
*
* @param array $filetypes An array of file type objects (from get_mimetypes_array)
* @param array $deleted An array of deleted file types
* @param bool $restricted If true, cannot be edited because set in config.php.
* @return string HTML code
*/
public function edit_table(array $filetypes, array $deleted, $restricted) {
// Get combined array of all types, with deleted marker.
$combined = array_merge($filetypes, $deleted);
foreach ($deleted as $ext => $value) {
$combined[$ext]['deleted'] = true;
}
ksort($combined);
$out = $this->heading(get_string('pluginname', 'tool_filetypes'));
if ($restricted) {
$out .= html_writer::div(
html_writer::div(get_string('configoverride', 'admin'), 'form-overridden'),
'', array('id' => 'adminsettings'));
}
if (count($combined) > 1) {
// Display the file type table if any file types exist (other than 'xxx').
$table = new html_table();
$headings = new html_table_row();
$headings->cells = array();
$headings->cells[] = new html_table_cell(get_string('extension', 'tool_filetypes'));
if (!$restricted) {
$headings->cells[] =
new html_table_cell(html_writer::span(get_string('edit'), 'accesshide'));
}
$headings->cells[] = new html_table_cell(get_string('source', 'tool_filetypes'));
$headings->cells[] = new html_table_cell(get_string('mimetype', 'tool_filetypes'));
$headings->cells[] = new html_table_cell(get_string('groups', 'tool_filetypes'));
$headings->cells[] = new html_table_cell(get_string('displaydescription', 'tool_filetypes'));
foreach ($headings->cells as $cell) {
$cell->header = true;
}
$table->data = array($headings);
foreach ($combined as $extension => $filetype) {
if ($extension === 'xxx') {
continue;
}
$row = new html_table_row();
$row->cells = array();
// First cell has icon and extension.
$icon = $this->pix_icon('f/' . $filetype['icon'], '');
$row->cells[] = new html_table_cell($icon . ' ' . html_writer::span(s($extension)));
// Reset URL and button if needed.
$reverturl = new \moodle_url('/admin/tool/filetypes/revert.php',
array('extension' => $extension));
$revertbutton = html_writer::link($reverturl, $this->pix_icon('t/restore',
get_string('revert', 'tool_filetypes', s($extension))));
if ($restricted) {
$revertbutton = '';
}
// Rest is different for deleted items.
if (!empty($filetype['deleted'])) {
// Show deleted standard types differently.
if (!$restricted) {
$row->cells[] = new html_table_cell('');
}
$source = new html_table_cell(get_string('source_deleted', 'tool_filetypes') .
' ' . $revertbutton);
$source->attributes = array('class' => 'nonstandard');
$row->cells[] = $source;
// Other cells are blank.
$row->cells[] = new html_table_cell('');
$row->cells[] = new html_table_cell('');
$row->cells[] = new html_table_cell('');
$row->attributes = array('class' => 'deleted');
} else {
if (!$restricted) {
// Edit icons. For accessibility, the name of these links should
// be different for each row, so we have to include the extension.
$editurl = new \moodle_url('/admin/tool/filetypes/edit.php',
array('oldextension' => $extension));
$editbutton = html_writer::link($editurl, $this->pix_icon('t/edit',
get_string('edita', '', s($extension))));
$deleteurl = new \moodle_url('/admin/tool/filetypes/delete.php',
array('extension' => $extension));
$deletebutton = html_writer::link($deleteurl, $this->pix_icon('t/delete',
get_string('deletea', 'tool_filetypes', s($extension))));
$row->cells[] = new html_table_cell($editbutton . '&nbsp;' . $deletebutton);
}
// Source.
$sourcestring = 'source_';
if (!empty($filetype['custom'])) {
$sourcestring .= 'custom';
} else if (!empty($filetype['modified'])) {
$sourcestring .= 'modified';
} else {
$sourcestring .= 'standard';
}
$source = new html_table_cell(get_string($sourcestring, 'tool_filetypes') .
($sourcestring === 'source_modified' ? ' ' . $revertbutton : ''));
if ($sourcestring !== 'source_standard') {
$source->attributes = array('class' => 'nonstandard');
}
$row->cells[] = $source;
// MIME type.
$mimetype = html_writer::div(s($filetype['type']), 'mimetype');
if (!empty($filetype['defaulticon'])) {
// Include the 'default for MIME type' info in the MIME type cell.
$mimetype .= html_writer::div(html_writer::tag('i',
get_string('defaulticon', 'tool_filetypes')));
}
$row->cells[] = new html_table_cell($mimetype);
// Groups.
$groups = !empty($filetype['groups']) ? implode(', ', $filetype['groups']) : '';
$row->cells[] = new html_table_cell(s($groups));
// Description.
$description = get_mimetype_description(array('filename' => 'a.' . $extension));
// Don't show the description if it's just a copy of the MIME type,
// it makes the table ugly with the long duplicate text; leave blank instead.
if ($description === $filetype['type']) {
$description = '';
}
$row->cells[] = new html_table_cell($description);
}
$table->data[] = $row;
}
$out .= html_writer::table($table);
} else {
$out .= html_writer::tag('div', get_string('emptylist', 'tool_filetypes'));
}
// Displaying the 'Add' button.
if (!$restricted) {
$out .= $this->single_button(new moodle_url('/admin/tool/filetypes/edit.php',
array('name' => 'add')), get_string('addfiletypes', 'tool_filetypes'), 'get');
}
return $out;
}
}
-60
View File
@@ -1,60 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Resets a file type to the default Moodle values.
*
* @package tool_filetypes
* @copyright 2014 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require(__DIR__ . '/../../../config.php');
require_once($CFG->libdir . '/adminlib.php');
admin_externalpage_setup('tool_filetypes');
$extension = required_param('extension', PARAM_RAW);
$redirecturl = new \moodle_url('/admin/tool/filetypes/index.php');
if (optional_param('revert', 0, PARAM_INT)) {
require_sesskey();
// Reset the file type in config.
core_filetypes::revert_type_to_default($extension);
redirect($redirecturl);
}
// Page settings.
$title = get_string('revertfiletype', 'tool_filetypes');
$context = context_system::instance();
$PAGE->set_url(new \moodle_url('/admin/tool/filetypes/revert.php', array('extension' => $extension)));
$PAGE->navbar->add($title);
$PAGE->set_context($context);
$PAGE->set_pagelayout('admin');
$PAGE->set_title($SITE->fullname. ': ' . $title);
// Display the page.
echo $OUTPUT->header();
$message = get_string('revert_confirmation', 'tool_filetypes', $extension);
$reverturl = new \moodle_url('revert.php', array('extension' => $extension, 'revert' => 1));
$yesbutton = new single_button($reverturl, get_string('yes'));
$nobutton = new single_button($redirecturl, get_string('no'), 'get');
echo $OUTPUT->confirm($message, $yesbutton, $nobutton);
echo $OUTPUT->footer();
-31
View File
@@ -1,31 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Configure the setting page of the custom file type as an external page.
*
* @package tool_filetypes
* @copyright 2014 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die;
if ($hassiteconfig) {
$ADMIN->add('server', new admin_externalpage('tool_filetypes',
new lang_string('pluginname', 'tool_filetypes'),
$CFG->wwwroot . '/admin/tool/filetypes/index.php'));
}
-32
View File
@@ -1,32 +0,0 @@
/**
* Styles for admin tool page.
*/
/* Fix bad default table wrap (caused by the long mimetype field). */
.path-admin-tool-filetypes .generaltable .c0,
.path-admin-tool-filetypes .generaltable .c1,
.path-admin-tool-filetypes .generaltable .c2,
.path-admin-tool-filetypes .generaltable th {
white-space: nowrap;
}
/* Formatting for deleted lines. */
.path-admin-tool-filetypes .generaltable .deleted .c0 img {
opacity: 0.2;
}
.path-admin-tool-filetypes .generaltable .deleted .c0 span {
text-decoration: line-through;
}
/* Custom types show bold */
.path-admin-tool-filetypes .generaltable .nonstandard {
font-weight: bold;
}
/* Spacing around the 'Defined in config.php' stripe */
.path-admin-tool-filetypes .form-overridden {
display: inline-block;
margin-bottom: 1em;
padding: 4px 6px;
}
@@ -1,136 +0,0 @@
@tool @tool_filetypes
Feature: Add customised file types
In order to support a file mime type which doesn't exist in Moodle
As an administrator
I need to add a new customised file type
Scenario: Add a new file type
Given I log in as "admin"
And I navigate to "File types" node in "Site administration > Server"
And I press "Add"
# Try setting all the form fields, not just the optional ones.
And I set the following fields to these values:
| Extension | frog |
| MIME type | application/x-frog |
| File icon | archive |
| Type groups | document |
| Description type | Custom description specified in this form |
| Custom description | Froggy file |
| Default icon for MIME type | 1 |
When I press "Save changes"
Then I should see "Froggy file" in the "application/x-frog" "table_row"
And I should see "document" in the "application/x-frog" "table_row"
And I should see "frog" in the "application/x-frog" "table_row"
And "//img[contains(@src, 'archive')]" "xpath_element" should exist in the "application/x-frog" "table_row"
Scenario: Update an existing file type
Given I log in as "admin"
And I navigate to "File types" node in "Site administration > Server"
When I click on "Edit 7z" "link"
And I set the following fields to these values:
| Extension | doc |
And I press "Save changes"
Then I should see "File extensions must be unique"
And I set the following fields to these values:
| Extension | frog |
And I press "Save changes"
And I should see "frog" in the "application/x-7z-compressed" "table_row"
Scenario: Change the text option (was buggy)
Given I log in as "admin"
And I navigate to "File types" node in "Site administration > Server"
When I click on "Edit 7z" "link"
And I set the following fields to these values:
| Description type | Custom description specified in this form |
| Custom description | New description for 7z |
And I press "Save changes"
Then I should see "New description" in the "application/x-7z-compressed" "table_row"
And I click on "Edit 7z" "link"
And I set the field "Description type" to "Default"
And I press "Save changes"
And I should not see "New description" in the "application/x-7z-compressed" "table_row"
Scenario: Try to select a text option without entering a value.
Given I log in as "admin"
And I navigate to "File types" node in "Site administration > Server"
When I click on "Edit dmg" "link"
And I set the field "Description type" to "Custom description"
And I press "Save changes"
Then I should see "Required"
And I set the field "Description type" to "Alternative language string"
And I press "Save changes"
And I should see "Required"
And I set the field "Description type" to "Default"
And I press "Save changes"
# Check we're back on the main page now.
And "dmg" "table_row" should exist
Scenario: Delete an existing file type
Given I log in as "admin"
And I navigate to "File types" node in "Site administration > Server"
When I click on "Delete 7z" "link"
Then I should see "Are you absolutely sure you want to remove .7z?"
And I press "Yes"
And I should see "Deleted" in the "7z" "table_row"
Scenario: Delete a custom file type
Given I log in as "admin"
And I navigate to "File types" node in "Site administration > Server"
And I press "Add"
And I set the following fields to these values:
| Extension | frog |
| MIME type | application/x-frog |
And I press "Save changes"
When I click on "Delete frog" "link"
And I press "Yes"
Then I should not see "frog"
Scenario: Revert changes to deleted file type
Given I log in as "admin"
And I navigate to "File types" node in "Site administration > Server"
When I click on "Delete 7z" "link"
And I press "Yes"
And I follow "Restore 7z to Moodle defaults"
And I press "Yes"
Then I should not see "Deleted" in the "7z" "table_row"
Scenario: Revert changes to updated file type
Given I log in as "admin"
And I navigate to "File types" node in "Site administration > Server"
And I click on "Edit 7z" "link"
And I set the following fields to these values:
| File icon | document |
And I press "Save changes"
When I follow "Restore 7z to Moodle defaults"
And I press "Yes"
Then "//img[contains(@src, 'archive')]" "xpath_element" should exist in the "7z" "table_row"
@javascript @_file_upload
Scenario: Create a resource activity which contains a customised file type
Given the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And I log in as "admin"
And I navigate to "File types" node in "Site administration > Server"
And I press "Add"
And I set the following fields to these values:
| Extension | frog |
| MIME type | application/x-frog |
| File icon | archive |
| Description type | Custom description specified in this form |
| Custom description | Froggy file |
And I press "Save changes"
# Create a resource activity and add it to a course
And I am on site homepage
And I follow "Course 1"
And I turn editing mode on
When I add a "File" to section "1"
And I set the following fields to these values:
| Name | An example of customised file type |
| Description | File description |
And I upload "admin/tool/filetypes/tests/fixtures/test.frog" file to "Select files" filemanager
And I expand all fieldsets
And I set the field "Show type" to "1"
And I press "Save and return to course"
Then I should see "Froggy file"
And the "src" attribute of ".modtype_resource a img" "css_element" should contain "archive"
Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 B

-1
View File
@@ -1 +0,0 @@
This is not a real file format.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 B

@@ -1,86 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Unit tests for the custom file types.
*
* @package tool_filetypes
* @copyright 2014 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
use tool_filetypes\utils;
/**
* Unit tests for the custom file types.
*
* @package tool_filetypes
* @copyright 2014 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class tool_filetypes_test extends advanced_testcase {
/**
* Tests is_extension_invalid() function.
*/
public function test_is_extension_invalid() {
// The pdf file extension already exists in default moodle minetypes.
$this->assertTrue(utils::is_extension_invalid('pdf'));
// The frog extension does not.
$this->assertFalse(utils::is_extension_invalid('frog'));
// However you could use the pdf extension when editing the pdf extension.
$this->assertFalse(utils::is_extension_invalid('pdf', 'pdf'));
// Blank extension is invalid.
$this->assertTrue(utils::is_extension_invalid(''));
// Extensions with dot are invalid.
$this->assertTrue(utils::is_extension_invalid('.frog'));
}
/**
* Tests is_defaulticon_allowed() function.
*/
public function test_is_defaulticon_allowed() {
// You ARE allowed to set a default icon for a MIME type that hasn't
// been used yet.
$this->assertTrue(utils::is_defaulticon_allowed('application/x-frog'));
// You AREN'T allowed to set default icon for text/plain as there is
// already a type that has that set.
$this->assertFalse(utils::is_defaulticon_allowed('text/plain'));
// But you ARE still allowed to set it when actually editing txt, which
// is the default.
$this->assertTrue(utils::is_defaulticon_allowed('text/plain', 'txt'));
}
/**
* Tests get_icons_from_path() function.
*/
public function test_get_icons_from_path() {
// Get icons from the fixtures folder.
$icons = utils::get_icons_from_path(__DIR__ . '/fixtures');
// The icons are returned alphabetically and with keys === values.
// For the icon with numbers after the name, only the base name is
// returned and only one of it.
$this->assertEquals(array('frog' => 'frog', 'zombie' => 'zombie'), $icons);
}
}
-29
View File
@@ -1,29 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Version details.
*
* @package tool_filetypes
* @copyright 2014 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2015051100;
$plugin->requires = 2015050500;
$plugin->component = 'tool_filetypes';
@@ -83,21 +83,6 @@ class tool_generator_course_backend extends tool_generator_backend {
*/
private $shortname;
/**
* @var string Course fullname.
*/
private $fullname = "";
/**
* @var string Course summary.
*/
private $summary = "";
/**
* @var string Course summary format, defaults to FORMAT_HTML.
*/
private $summaryformat = FORMAT_HTML;
/**
* @var testing_data_generator Data generator
*/
@@ -122,38 +107,11 @@ class tool_generator_course_backend extends tool_generator_backend {
* @param int|bool $filesizelimit The max number of bytes for a generated file
* @param bool $progress True if progress information should be displayed
*/
public function __construct(
$shortname,
$size,
$fixeddataset = false,
$filesizelimit = false,
$progress = true,
$fullname = null,
$summary = null,
$summaryformat = FORMAT_HTML) {
public function __construct($shortname, $size, $fixeddataset = false, $filesizelimit = false, $progress = true) {
// Set parameters.
$this->shortname = $shortname;
// We can't allow fullname to be set to an empty string.
if (empty($fullname)) {
$this->fullname = get_string(
'fullname',
'tool_generator',
array(
'size' => get_string('shortsize_' . $size, 'tool_generator')
)
);
} else {
$this->fullname = $fullname;
}
// Summary, on the other hand, should be empty-able.
if (!is_null($summary)) {
$this->summary = $summary;
$this->summaryformat = $summaryformat;
}
parent::__construct($size, $fixeddataset, $filesizelimit, $progress);
}
@@ -250,17 +208,10 @@ class tool_generator_course_backend extends tool_generator_backend {
*/
private function create_course() {
$this->log('createcourse', $this->shortname);
$courserecord = array(
'shortname' => $this->shortname,
'fullname' => $this->fullname,
'numsections' => self::$paramsections[$this->size],
'startdate' => usergetmidnight(time())
);
if (strlen($this->summary) > 0) {
$courserecord['summary'] = $this->summary;
$courserecord['summary_format'] = $this->summaryformat;
}
$courserecord = array('shortname' => $this->shortname,
'fullname' => get_string('fullname', 'tool_generator',
array('size' => get_string('shortsize_' . $this->size, 'tool_generator'))),
'numsections' => self::$paramsections[$this->size]);
return $this->generator->create_course($courserecord, array('createsections' => true));
}
@@ -357,7 +308,8 @@ class tool_generator_course_backend extends tool_generator_backend {
$username = 'tool_generator_' . $textnumber;
// Create user account.
$record = array('username' => $username, 'idnumber' => $number);
$record = array('firstname' => get_string('firstname', 'tool_generator'),
'lastname' => $number, 'username' => $username);
// We add a user password if it has been specified.
if (!empty($CFG->tool_generator_users_password)) {

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