Compare commits

...

375 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7) fad0937a82 Moodle release 2.7.7 2015-03-10 00:42:36 +01:00
Eloy Lafuente (stronk7) c1106792b1 weekly release 2.7.6+ 2015-03-09 16:47:46 +01:00
Marina Glancy 44b789cc6d MDL-49418 core: partial revert of MDL-48804
this is a quick fix for the issue 'Course module with two or more availability restrictions is not accessible'
MDL-49434 is created to deal with the renderer access inside availability check
2015-03-09 11:32:19 +08:00
Eloy Lafuente (stronk7) 8533cba2ae Moodle release 2.7.6 2015-03-07 11:23:38 +01:00
Eloy Lafuente (stronk7) b855cfcfee weekly release 2.7.5+ 2015-03-05 11:26:40 +01:00
Eloy Lafuente (stronk7) 94218cb1af Merge branch 'MDL-49379_m27' of git://github.com/markn86/moodle into MOODLE_27_STABLE 2015-03-04 10:50:34 +01:00
Mark Nelson 5c6dd1dc5b MDL-49379 core_webservice: fixed ability to edit services 2015-03-04 01:37:01 -08:00
Andrew Nicols 25327eecff MDL-49303 mod_scorm: Fix JS errors with default values 2015-03-04 15:06:03 +08:00
David Monllao 2924ba1c73 MDL-49204 core_message: Checking current user 2015-03-04 10:06:03 +08:00
Andrew Nicols b707f76f64 Merge branch 'MDL-49364_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2015-03-04 08:53:34 +08:00
Andrew Nicols 7f8230f8df Merge branch 'mdl27_MDL-46390' of https://github.com/danmarsden/moodle into MOODLE_27_STABLE 2015-03-04 07:56:57 +08:00
Dan Marsden 5a96b851a2 MDL-46390 mod_scorm: Find correct sco to launch when org based sco is selected
Also tidies up some redundant code in scorm_format_toc_for_droplist()
2015-03-04 09:29:35 +13:00
Eloy Lafuente (stronk7) 5e9a15e516 Merge branch 'MDL-49214_M27' of git://github.com/lazydaisy/moodle into MOODLE_27_STABLE 2015-03-03 19:36:54 +01:00
Dan Poltawski e8e4d45620 Merge branch 'MDL-49335_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2015-03-03 14:46:37 +00:00
Dan Poltawski 1456b2674d Merge branch 'MDL-49334_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2015-03-03 13:25:36 +00:00
Dan Poltawski fb53bebd1d Merge branch 'MDL-47000-27' of git://github.com/merrill-oakland/moodle into MOODLE_27_STABLE 2015-03-03 13:21:33 +00:00
Tim Hunt ceab40d186 MDL-49364 quiz statistics: escape output in the response analysis 2015-03-03 13:05:05 +00:00
Tim Hunt daab241a0b MDL-49335 quiz behat: new test of attempting a quiz
This separates out attempting the quiz into a separate .feature, away
from the monolithic add_quiz.feature. At some point we should clean that
up, but for now I am just adding this.

Really, the main reason for this test is to verify the two Behat
enhancememnts I just did.
2015-03-03 11:37:50 +00:00
Tim Hunt cf5cc056b4 MDL-49335 quiz behat: improved step for adding questions to a quiz
Explicit headings make the script more readable, and pave the way for
new options that are due to be added.
2015-03-03 11:37:49 +00:00
Tim Hunt b45ff8b856 MDL-49335 Behat: new question selector
So you can say things like
    And I click on "True" "radio" in the "First question" "question"
2015-03-03 11:37:38 +00:00
Tim Hunt 7042dfe5f3 MDL-49334 behat: sort selector lists 2015-03-03 11:21:22 +00:00
Dan Poltawski 629df3afd0 Merge branch 'MDL-34006_m27v7' of https://github.com/sbourget/moodle into MOODLE_27_STABLE 2015-03-03 11:03:15 +00:00
Stephen Bourget 5e89c05368 MDL-45621 Portfolio: Allow portfolios to be uninstalled 2015-03-03 11:00:08 +01:00
Andrew Nicols 74a2c781f7 Merge branch 'wip-mdl-49110-m27' of https://github.com/rajeshtaneja/moodle into MOODLE_27_STABLE 2015-03-03 16:27:35 +08:00
Andrew Nicols 48213fc8ad Merge branch 'MDL-38485-27' of git://github.com/ankitagarwal/moodle into MOODLE_27_STABLE 2015-03-03 16:15:29 +08:00
Andrew Nicols 81e8eb60a9 Merge branch 'MDL-49075-27' of https://github.com/lucisgit/moodle into MOODLE_27_STABLE 2015-03-03 15:44:23 +08:00
pau.ferrer-ocana 379c492a98 MDL-49234 oracle: Remove variables passed by reference error 2015-03-03 15:14:57 +08:00
Andrew Nicols bfc0273f12 Merge branch 'MDL-49247_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2015-03-03 15:08:13 +08:00
Andrew Nicols 72bb4ca411 Merge branch 'MDL-49284_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2015-03-03 13:49:48 +08:00
Eloy Lafuente (stronk7) 84f9f60b67 MDL-49087 mdeploy: now relying on config.php documented 2015-03-03 02:47:05 +01:00
Andrew Nicols a47aabc783 MDL-49087 mnet: Ensure typeroot is in dirroot 2015-03-03 02:46:17 +01:00
Andrew Nicols 76da7e9bc8 MDL-49087 mnet: Use real dataroot instead of user-provided 2015-03-03 02:46:17 +01:00
Eloy Lafuente (stronk7) 1bdc5cc997 Merge branch 'MDL-37470_27' of https://github.com/mike-grant/moodle into MOODLE_27_STABLE 2015-03-03 01:44:04 +01:00
Eloy Lafuente (stronk7) 429aa0f321 Merge branch 'MDL-49240-27' of git://github.com/damyon/moodle into MOODLE_27_STABLE 2015-03-03 01:11:32 +01:00
Dan Poltawski da53b55002 Merge branch 'MOODLE_27_STABLE' of https://github.com/mitstek/moodle into MOODLE_27_STABLE 2015-03-02 17:27:18 +00:00
Dan Poltawski 67957f5683 Merge branch '27_MDL-49303' of https://github.com/danmarsden/moodle into MOODLE_27_STABLE 2015-03-02 16:57:56 +00:00
Marina Glancy cd060b5fe2 MDL-48804 core: do not set current course until login validated 2015-03-02 16:51:29 +01:00
Juan Leyva b0abcbda17 MDL-48691 webservices: Check if the user must be changing password 2015-03-02 14:40:05 +00:00
Simey Lameze 1a344ea46f MDL-49084 core_tag: add capability check to flag as inappropriate action 2015-03-02 12:52:16 +00:00
Andrew Nicols 3a89cea7f7 MDL-49144 blocks: Sanitise alt and title for block controls 2015-03-02 12:09:58 +00:00
Andrew Nicols 3657649aaa MDL-49144 blocks: Add behat test to ensury sanity of block title 2015-03-02 12:09:57 +00:00
Ankit Agarwal 12ba38e725 MDL-38466 filters: Redos protection and unit tests 2015-03-02 11:31:04 +01:00
Zachary Durber fdab8c0a51 MDL-38466 filters: ReDoS protection for text to URL conversion. 2015-03-02 11:31:04 +01:00
Dan Poltawski 1bf41ebcd8 Merge branch 'MDL-23273-27' of git://github.com/zbdd/moodle into MOODLE_27_STABLE 2015-03-02 09:33:59 +00:00
Mary Evans 70d5d05c0e MDL-49214 theme_bootstrapbase: OL list numbers cut off in Clean theme
Conflicts:

	theme/bootstrapbase/style/moodle.css
2015-03-01 19:36:33 +00:00
Tony Butler 2ceee45b76 MDL-49075 mod_assign: Add assertions to marking workflow unit test
Make sure grades aren't pushed to gradebook for marking workflow
states other than 'released'.
2015-02-26 11:59:23 +00:00
Tony Butler 952db2245b MDL-49075 mod_assign: Keep unreleased assign grades out of gradebook 2015-02-26 11:59:23 +00:00
Dan Marsden 4d6cfa8e4f MDL-49303 mod_scorm: Initialise student preference on re-entry. 2015-02-26 20:51:42 +13:00
Tim Hunt 845ecec21e MDL-49284 formslib: fix strict validation of HTML. 2015-02-25 17:39:12 +00:00
Stephen Bourget bf6c92065d MDL-34006 Lesson: Behat tests 2015-02-25 10:33:23 -05:00
Stephen Bourget f0ecdada22 MDL-34006 Lesson: Resume lesson loads wrong page 2015-02-25 10:32:45 -05:00
Dan Poltawski deea56cf6f weekly release 2.7.5+ 2015-02-25 14:57:34 +00:00
Dan Poltawski ff6092696c Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2015-02-25 14:57:32 +00:00
Mitsuhiro Yoshida 56479e0721 MDL-49259 lib: Fix for unzipped Japanese filename character corruption 2015-02-25 23:27:57 +09:00
Eric Merrill 8012d5ad5e MDL-47000 session: Update memcached version referecnes to 2.2.0 2015-02-24 15:19:35 -05:00
Dan Poltawski a9558a0559 Merge branch 'MDL-49241-27-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_27_STABLE 2015-02-24 16:53:56 +00:00
Dan Poltawski e2abf6048c Merge branch 'wip_MDL-49184_m27_choice' of https://github.com/skodak/moodle into MOODLE_27_STABLE 2015-02-24 10:43:36 +00:00
Brian Barnes 8527a343e1 MDL-48519 accessibility: improved accessibility of user filters 2015-02-24 17:53:36 +08:00
Andrew Nicols 4b4466e559 Merge branch 'MDL-49078_m27' of git://github.com/shashirepo/moodle into MOODLE_27_STABLE 2015-02-24 17:08:52 +08:00
Andrew Nicols b70c6fcf87 Merge branch 'MDL-49008_lang_vanish_27' of https://github.com/andyjdavis/moodle into MOODLE_27_STABLE 2015-02-24 16:55:08 +08:00
Shashikant Vaishnav 98b1c93d11 MDL-49078 theme_bootstrapbase: 'Create new course' text too high
Thanks to  Gareth J Barnard  for the code suggestion
2015-02-24 14:22:27 +05:30
Dan Poltawski 0aadd59a87 Merge branch 'MDL-49216-27' of git://github.com/andrewnicols/moodle into MOODLE_27_STABLE 2015-02-24 08:31:57 +00:00
Andrew Davis e742ba8b7e MDL-49008 lang: dont preemptively delete lang packs when updating 2015-02-24 09:18:06 +01:00
David Monllao 938d6e9def Merge branch 'MDL-48899-27' of git://github.com/andrewnicols/moodle into MOODLE_27_STABLE 2015-02-24 16:17:37 +08:00
Zachary Durber 0396e811bb MDL-23273 mod_choice: error continue button redirects back to choice
Locks only occur when a choice is using limits.
2015-02-24 12:58:04 +08:00
Andrew Nicols 0eaac55d01 Merge branch 'mdl27_MDL-46408' of https://github.com/danmarsden/moodle into MOODLE_27_STABLE 2015-02-24 11:36:49 +08:00
Ankit Agarwal 7cbb09aaa3 MDL-38485 calendar: Carry over line breaks on imports
Thanks to Matthias Schwabe for the patch suggestion
2015-02-24 08:55:12 +05:30
Andrew Nicols 933fa26e63 MDL-49216 mod_forum: Move subquery to outer component
It is not possible to order sub-query results with some RDBMs, and the
subquery is not necessary anyway.
2015-02-24 08:31:43 +08:00
Andrew Nicols d0284fe719 MDL-49216 mod_forum: Add tests for discussion reply count 2015-02-24 08:31:36 +08:00
Helen Foster 2017880f90 MDL-49241 lang: Merge English strings from the en_fix language pack 2015-02-23 21:17:31 +01:00
Dan Poltawski 8bcfbda511 Merge branch 'MDL-49198_m27' of https://github.com/markn86/moodle into MOODLE_27_STABLE 2015-02-23 16:29:27 +00:00
Dan Poltawski a06527d280 Merge branch 'MDL-49200_m27' of https://github.com/markn86/moodle into MOODLE_27_STABLE 2015-02-23 16:20:06 +00:00
Dan Poltawski d830e39f28 Merge branch 'MOODLE_27_STABLE' of https://github.com/eberhardt/moodle into MOODLE_27_STABLE 2015-02-23 15:55:39 +00:00
Andrew Nicols bb323b1876 MDL-48807 accesslib: Change create_level_instance to recordset 2015-02-23 16:03:23 +08:00
Andrew Nicols 6253df7309 Merge branch 'MDL-48807-27' of git://github.com/lameze/moodle into MOODLE_27_STABLE 2015-02-23 15:09:49 +08:00
Simey Lameze 817837bdd1 MDL-48807 core_task: change create_contexts_task to daily frequency 2015-02-23 14:44:04 +08:00
Simey Lameze 1cf194adaa MDL-48807 accesslib: table locking fix on all create_level_instance 2015-02-23 14:41:05 +08:00
Zachary Durber 93f6e83dce MDL-23273 mod_choice: Using locks to ensure choice limits 2015-02-23 10:48:51 +08:00
David Monllao 4bc553ab04 MDL-49145 report_log: Moving conditions
Now get_url() does not need to be resolved when
we are downloading.
2015-02-23 10:39:09 +08:00
Andrew Nicols 1092970fda Merge branch 'MDL-49174-27' of git://github.com/jleyva/moodle into MOODLE_27_STABLE 2015-02-23 09:37:01 +08:00
Andrew Nicols 12e121ed33 Merge branch 'MDL-35392-27' of git://github.com/zbdd/moodle into MOODLE_27_STABLE 2015-02-23 09:22:26 +08:00
Zachary Durber 6e040c0593 MDL-35392 mod_assign: Push feedback to gradebook when releasing grades
When bulk changing workflow status a mismatch in variable
names meant that feedback wasn't being sent to the gradebook.
2015-02-23 09:17:17 +08:00
Andrew Nicols 0488bd92cd Merge branch 'MDL-49145_27' of git://github.com/dmonllao/moodle into MOODLE_27_STABLE 2015-02-23 09:06:26 +08:00
David Monllao 036bf6ec37 MDL-49145 report_log: Fixing condition
Credit and thanks to Tyler Bannister and Renaat Debleu.
2015-02-23 08:47:08 +08:00
Dan Marsden 772ec0a6e3 MDL-46408 mod_scorm: check param is set before using.
The default org is only set if it exists in the imsmanifest.xml
2015-02-20 13:42:57 +13:00
Tim Hunt b01f29882b MDL-49247 question restore: avoid unique key errors from old bad data
Several tables have had unique keys added to enforce a constraint that
should always have been there. It is possible for old sites to have
data that violate the constraints, and sometimes people want to backup
data from those old sites, and restore them into a new Moodle.
Therefore, we need to guard agains the unique key violation errors.
2015-02-19 21:51:09 +00:00
AMOS bot 89b06d239f Automatically generated installer lang files 2015-02-20 00:04:19 +08:00
Jan Eberhardt fcf8a305ea MDL-31578 auth_shibboleth: Custom fields added to shibboleth settings
Since LDAP is able to sync custom user profile fields, this feature was
requested for Shibboleth.
2015-02-19 13:56:26 +00:00
Eloy Lafuente (stronk7) 327272881a weekly release 2.7.5+ 2015-02-19 10:44:36 +01:00
Damyon Wiese 21d6db9b77 MDL-49240 webservices: core_get_string and friends bad lang handling
The core_get_string webservice and friends have never passed lang values
properly, (so never worked) and when I fixed that I found they were passing
lang parameter into the lazyload parameter.
2015-02-19 17:43:45 +08:00
Andrew Nicols 86d20a95c8 Revert "Merge branch 'MDL-49154_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE"
This reverts commit e0312ddb49, reversing
changes made to 636eb3726c.
2015-02-19 09:18:40 +08:00
Rajesh Taneja fd77d51e5d MDL-48841 admin: Fixed changed string 2015-02-18 16:33:38 +08:00
Rajesh Taneja 992a8a42d5 MDL-48841 admin: Behat table row should start with first row 2015-02-18 15:47:46 +08:00
Botond Hegedus bd3332ff6e MDL-49198 core_webservice: Fix error when using existing service name 2015-02-17 23:14:29 -08:00
David Monllao 94c912d7c4 Merge branch 'MDL-49034_m27' of git://github.com/mattporritt/moodle into MOODLE_27_STABLE 2015-02-18 09:36:49 +08:00
Eloy Lafuente (stronk7) 3692b5dd8b Merge branch 'MDL-49211_M27' of git://github.com/lazydaisy/moodle into MOODLE_27_STABLE 2015-02-18 00:04:08 +01:00
Eloy Lafuente (stronk7) f423902be7 Merge branch 'MDL-48973_27' of https://github.com/pauln/moodle into MOODLE_27_STABLE 2015-02-17 23:53:00 +01:00
Eloy Lafuente (stronk7) e0312ddb49 Merge branch 'MDL-49154_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2015-02-17 23:47:13 +01:00
Eloy Lafuente (stronk7) 636eb3726c Merge branch 'MDL-49170_27' of https://github.com/totara/openbadges into MOODLE_27_STABLE 2015-02-17 23:43:44 +01:00
Eloy Lafuente (stronk7) 98e374b38f Merge branch 'MDL-49205_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2015-02-17 22:19:04 +01:00
Juan Leyva a698a4d1f2 MDL-49174 webservices: Return front page contents in get_contents ws 2015-02-17 21:33:35 +01:00
Eloy Lafuente (stronk7) edbe1e67f1 Merge branch 'MDL-49041_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2015-02-17 21:10:12 +01:00
Eloy Lafuente (stronk7) e9265276b8 Merge branch 'MDL-49059-split_27' of https://github.com/pauln/moodle into MOODLE_27_STABLE 2015-02-17 20:59:03 +01:00
David Monllao e530410232 Merge branch 'MDL-48993-27' of git://github.com/merrill-oakland/moodle into MOODLE_27_STABLE 2015-02-17 17:24:56 +08:00
David Monllao e282453aea Merge branch 'MDL-49167-27' of git://github.com/damyon/moodle into MOODLE_27_STABLE 2015-02-17 17:01:39 +08:00
David Monllao 6a03a96e47 Merge branch 'MDL-48884_m27' of git://github.com/markn86/moodle into MOODLE_27_STABLE 2015-02-17 14:44:18 +08:00
David Monllao 0df2edf254 Merge branch 'MDL-48841-MOODLE_27_STABLE' of git://github.com/lucisgit/moodle into MOODLE_27_STABLE 2015-02-17 14:25:22 +08:00
Andrew Nicols 73d3d0d37f Merge branch 'wip-mdl-48670-m27' of https://github.com/rajeshtaneja/moodle into MOODLE_27_STABLE 2015-02-17 14:06:45 +08:00
David Monllao 71ae878ca9 Merge branch 'MDL-49169_27' of git://github.com/grabs/moodle into MOODLE_27_STABLE 2015-02-17 14:01:23 +08:00
Mark Nelson 21e6dc4d52 MDL-49200 core_form: corrected string 2015-02-16 21:59:46 -08:00
David Monllao 3adfe5f72f Merge branch 'MDL-48215_m27' of git://github.com/markn86/moodle into MOODLE_27_STABLE 2015-02-17 13:24:47 +08:00
Petr Skoda 62baf63445 MDL-49184 choice: fix block actions
The problems was that blocks editing breaks if you redirect
after if (data_submitted()) - all form actions must make sure
it is really their form, otherwise they may hijack the post from
block actions.

Note that this is not a problem for mforms, only legacy forms
are affected.
2015-02-17 16:58:34 +13:00
David Monllao 685fba3ffe Merge branch 'MDL-48543-27' of git://github.com/damyon/moodle into MOODLE_27_STABLE 2015-02-17 11:16:03 +08:00
David Monllao 113a06cd95 Merge branch 'MDL-48709_27' of git://github.com/jmvedrine/moodle into MOODLE_27_STABLE 2015-02-17 09:17:38 +08:00
Michael Hughes 175883c223 MDL-48215 gradingform_guide: Name length validation
Validating both criterion name and guide name to be 255 chars.
2015-02-15 21:53:02 -08:00
David Monllao 00ce45b9aa Merge branch 'MDL-47529-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2015-02-16 11:56:08 +08:00
Damyon Wiese 21929ef07d MDL-49167 YUI: Fix for theme/yui_combo.php and $CFG->yuislashargs
It was too aggressively cleaning it's params (broken in MDL-48980).
2015-02-16 11:26:57 +08:00
Frederic Massart 049943b708 MDL-47529 lock: Fix typo on lock factory in config-dist 2015-02-16 11:14:05 +08:00
Frederic Massart 27548ec845 MDL-47529 task: Remove usage of lock when editing a task 2015-02-16 11:14:05 +08:00
Frederic Massart c33fdb5834 MDL-47529 task: Do not use lock when updating task records 2015-02-16 11:14:05 +08:00
David Monllao 3bd8407407 Merge branch 'MDL-40776_27' of git://github.com/s-cenni/moodle into MOODLE_27_STABLE 2015-02-16 10:35:41 +08:00
Yuliya Bozhko 91b8101c16 MDL-49170 badges: Backpack connection missing a port colon in URL
Signed-off-by: Yuliya Bozhko <yuliya.bozhko@totaralms.com>
2015-02-16 09:35:32 +13:00
Mary Evans 822c4b9c40 MDL-49211 theme_bootstrapbase: Text alignment issue in CLOZE questions.
Conflicts:

	theme/bootstrapbase/style/moodle.css
2015-02-15 19:04:39 +00:00
Jean-Michel Vedrine 476fa05c08 MDL-48709 mod_lesson: subclusters are not working 2015-02-14 18:18:32 +01:00
Tim Hunt 2a7241b3a1 MDL-49205 behat: fix I set the field with xpath fail message. 2015-02-13 16:16:27 +00:00
Paul Nicholls 5e5b5b393d MDL-48973 Atto: Atto does not listen to the drop event
The 'drop' event fires before the native ContentEditable drop handler, so
in order to update the underlying textarea we need to call updateOriginal
with a brief delay so that the dropped content has actually been added to
the editor.
2015-02-13 14:51:24 +13:00
Rajesh Taneja 5fe6298a05 MDL-48670 behat: Set timezone to Australia/perth
Behat tests might rely on time related tests
Ensure we have default timezone set to Australia/Perth
2015-02-13 08:13:41 +08:00
Eric Merrill 56e9f5c166 MDL-48993 gradebook: When importing new items, treat blank or - as empty 2015-02-12 17:18:30 -05:00
Paul Nicholls f65b1f10ad MDL-49059 medialib: Add test cases for invalid Youtube URL param values
Tests to ensure that we're not allowing injection via invalid values of
the Youtube start time and playlist parameters.
2015-02-13 09:49:16 +13:00
Paul Nicholls a16e03df3f MDL-49059 medialib: Support links to Youtube videos within playlists
As well as embedding playlists, you can embed specific videos from them -
resulting in the playlist UI displaying, but starting with the specified
video rather than the first in the playlist.  Previously, just the
specified video would embed - without the playlist UI.
2015-02-13 09:49:16 +13:00
Paul Nicholls b516be1d7e MDL-49059 medialib: Support start time params in Youtube URLs
Medialib (and thus the Multimedia Plugins filter) was ignoring start time
parameters on YouTube video URLs, meaning that the video would always
start at the start, even when the appropriate parameter was present.
2015-02-13 09:49:16 +13:00
Paul Nicholls 85a61d783e MDL-49059 medialib: Add tests for Youtube videos within playlists
As well as embedding playlists, you can embed specific videos from them -
resulting in the playlist UI displaying, but starting with the specified
video rather than the first in the playlist.  These URLs should be covered
by the tests to ensure that we're handling them properly.
2015-02-13 09:49:15 +13:00
Paul Nicholls 48b7540b31 MDL-49059 medialib: Add test cases for Youtube start times
Add test cases to core_medialib_testcase to cover YouTube videos with
start times.
2015-02-13 09:49:15 +13:00
Tim Hunt 3d3b2669c9 MDL-49154 behat: step to type with focus on a given element 2015-02-12 20:15:52 +00:00
Andreas Grabs 497e25d8f4 MDL-49169 user - After MDL-48978-Fix description is not saved anymore 2015-02-12 12:25:29 +01:00
Mike Grant 8cb2cbbf98 MDL-37470 blocklib: Respect block weight and offset 2015-02-12 09:42:05 +00:00
David Monllao cfab858010 weekly release 2.7.5+ 2015-02-12 15:30:13 +08:00
David Monllao 298aa05da8 Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2015-02-12 15:30:12 +08:00
David Monllao 20b114ec27 Revert "Merge branch 'MDL-36009-27' of git://github.com/jethac/moodle into MOODLE_27_STABLE"
This reverts commit abb41a5363, reversing
changes made to 2b8b2e876e.
2015-02-12 13:46:59 +08:00
AMOS bot 5bae4138e9 Automatically generated installer lang files 2015-02-12 00:04:18 +08:00
Ruslan Kabalin 46471489f5 MDL-48841 admin: Fix scheduled task reset to defaults finctionality.
It is safe to make fields as non-required, because form validation will not
pass through any empty field anyway.
2015-02-11 11:13:50 +00:00
Marina Glancy 7a6581f6c2 MDL-49003 login: prevent signup when user is logged in 2015-02-11 00:04:46 +01:00
AMOS bot 76b5719bbb Automatically generated installer lang files 2015-02-11 00:04:14 +08:00
Eloy Lafuente (stronk7) e314024bdd Merge branch 'MDL-48910_block_my_27' of https://github.com/andyjdavis/moodle into MOODLE_27_STABLE 2015-02-10 13:23:17 +01:00
Sara Cenni 4d65e9527e MDL-40776 grade: fix query for report outcomes
Add a missing space to the query for report outcomes to avoid error with Oracle.
2015-02-10 12:10:07 +01:00
Dan Poltawski d612b63001 Merge branch 'wip-mdl-49081-m27' of https://github.com/rajeshtaneja/moodle into MOODLE_27_STABLE 2015-02-10 09:18:00 +00:00
David Monllao 9bec924781 MDL-48805 theme: Fixing trailing whitespace 2015-02-10 15:48:34 +08:00
David Monllao 812ed49a93 Merge branch 'm27_MDL-48805' of git://github.com/totara/moodle into MOODLE_27_STABLE 2015-02-10 15:27:16 +08:00
Andrew Davis a43200104c MDL-48910 core_block: user_can_addto() respects applicable formats 2015-02-10 08:20:23 +01:00
Mark Nelson 9e0b0f76bb MDL-48884 mod_assign: prevented setting gradebook feedback unnecessarily 2015-02-09 22:18:21 -08:00
David Monllao c7b96ac18a Merge branch 'm27_MDL-49064' of git://github.com/totara/moodle into MOODLE_27_STABLE 2015-02-10 11:58:12 +08:00
David Monllao 9c95bd6d03 Merge branch 'MDL-48960-27' of git://github.com/danpoltawski/moodle into MOODLE_27_STABLE 2015-02-10 11:12:45 +08:00
Matt Porritt cc980d0197 MDL-49034 enrol_self: Enforce maxlength in self enrolment form fields.
Alter self enrolment creation form to enforce max field lengths.
Limit "Custom instance name" (name) form field to 255 characters via maxlength.
Limit "Enrolment key" (password) form field to 50 characters via maxlength.

Fix for when the form is submitted causing a database write error to be thrown
as corresponding field "name" in the table mdl_enrol is set to varchar(255) and
database field "password" is varying(50).
2015-02-10 13:20:31 +11:00
Eloy Lafuente (stronk7) 0370128f35 Merge branch 'MDL-49073-27' of git://github.com/jethac/moodle into MOODLE_27_STABLE 2015-02-10 01:07:45 +01:00
Dan Poltawski 00e8070f00 Merge branch 'MDL-48544-27' of git://github.com/andrewnicols/moodle into MOODLE_27_STABLE 2015-02-09 22:42:15 +00:00
Eloy Lafuente (stronk7) 42559a9df0 Merge branch 'wip_MDL-49125_m27_install' of https://github.com/skodak/moodle into MOODLE_27_STABLE 2015-02-09 20:02:44 +01:00
Eloy Lafuente (stronk7) 078e04775e Merge branch 'MDL-48357-27' of git://github.com/jleyva/moodle into MOODLE_27_STABLE 2015-02-09 15:51:53 +01:00
Dan Poltawski 4cd7c56432 Merge branch 'wip-MDL-47558-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2015-02-09 14:50:38 +00:00
Andrew Nicols 8bc846ff7a MDL-48544 blocks: Only add docked tags if all blocks are docked
Previously, if all blocks were hidden, then the region was reported as
being docked eroniously and it was not possible to unhide the blocks.

Docking should have no relation to the presence of block content.
2015-02-09 20:56:04 +08:00
Eloy Lafuente (stronk7) 33446800b7 Merge branch 'wip-MDL-48794-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2015-02-09 13:05:24 +01:00
Dan Poltawski 4f0874c0cf Merge branch 'MDL-44520-27' of git://github.com/xow/moodle into MOODLE_27_STABLE 2015-02-09 11:33:16 +00:00
Dan Poltawski 19e7fb0ca0 Merge branch 'MDL-48294-27' of git://github.com/jleyva/moodle into MOODLE_27_STABLE 2015-02-09 11:28:22 +00:00
Dan Poltawski 62f5dc3fdc Merge branch 'MDL_47085_27' of https://github.com/totara/openbadges into MOODLE_27_STABLE 2015-02-09 10:29:20 +00:00
Dan Poltawski b2792006aa Merge branch 'MDL-47953-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2015-02-09 10:21:44 +00:00
David Monllao f5d47e3648 Merge branch 'MDL-42138-27' of git://github.com/xow/moodle into MOODLE_27_STABLE 2015-02-09 17:18:59 +08:00
David Monllao abb41a5363 Merge branch 'MDL-36009-27' of git://github.com/jethac/moodle into MOODLE_27_STABLE 2015-02-09 16:59:40 +08:00
Damyon Wiese 77d4380533 MDL-48543 Mathjax: Update default config for JAWS Math player
JAWS Maths player does not recognise the math content when manually specifying the config for MathJax.
If you use one of the default config files it works.
So - we switch our config to the Accessible.js config that it is based off anyway.
There are no features changes with this approach.

Conflicts:
	filter/mathjaxloader/db/upgrade.php
	filter/mathjaxloader/version.php
2015-02-09 16:33:22 +08:00
Jetha Chan 3be4c8751c MDL-36009 grader_gradereport: filler and extra user cells should not be headers 2015-02-09 13:52:59 +08:00
Yuliya Bozhko 4582c3d4fa MDL-47085 badges: Fix badges file download issues
Signed-off-by: Yuliya Bozhko <yuliya.bozhko@totaralms.com>
2015-02-09 16:01:51 +13:00
Petr Skoda a6ba98c2c9 MDL-49125 install: fix installer notices 2015-02-07 13:12:55 +13:00
Adrian Greeve 2b8b2e876e MDL-48038 mod_tag: Unit tests for tag cron functions. 2015-02-06 14:53:06 +08:00
Adrian Greeve 102d449fa9 MDL-48038 mod_tag: Improvement of tag cron. 2015-02-06 14:53:06 +08:00
Marina Glancy f702287188 MDL-47558 resource: allow to edit module without being redirected
Thanks to Nathan Lewis for the code suggestion
2015-02-06 13:13:32 +08:00
Rajesh Taneja b7b0a28dc6 MDL-49110 behat: No expand form required in non-js mode 2015-02-06 13:05:45 +08:00
Tony Levi 9443735f27 MDL-49110 behat: Do not poll within spin for non-javascript mode 2015-02-06 13:05:23 +08:00
John Okely 52b817b6ba MDL-44520 behat: Change behat features to use new section selectors 2015-02-06 10:35:05 +08:00
John Okely d025f8a226 MDL-44520 behat: Add behat selectors for section, activity 2015-02-06 10:35:05 +08:00
John Okely ddbc062458 MDL-42138 user: Require custom profile fields when registering as guest
Previously when someone registers after logging in as a guest, required
custom profile fields would not be required.

Thanks to Andreas Diendorfer for providing the patch.
2015-02-06 10:04:32 +08:00
Tim Hunt 76f1a72720 MDL-49041 qtype_multianswer: don't reveal marks on partial responses
This commit also fixes MDL-32049 about the lack or valdiation message
when an incomplete respnses is submitted.

AMOS BEGIN
 CPY [pleaseananswerallparts,qtype_match],[pleaseananswerallparts,qtype_multianswer]
AMOS END
2015-02-05 20:00:45 +00:00
Dan Poltawski ba9a541797 weekly release 2.7.5+ 2015-02-05 10:07:17 +00:00
Dan Poltawski 40020334e3 Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2015-02-05 10:07:15 +00:00
Dan Poltawski 232a79c81c MDL-48960 output: use nofollow attribute to stop crawling invalid links
Both the calendar set url and switch theme links are displayed to
non-logged in users which mean they get crawled by search bots. This
prevents the search bots following these links.
2015-02-05 08:14:14 +00:00
Frederic Massart 87914aa407 MDL-47953 gradereport_grader: Accurate pagination with suspended users
Thanks to Zvonko Martinovic for pointing out the source of the bug.
2015-02-05 15:08:00 +08:00
AMOS bot 2df1e26d6b Automatically generated installer lang files 2015-02-05 00:04:13 +08:00
Juan Leyva af5f6b7300 MDL-48294 settings: enablemobilewebservice appears twice 2015-02-04 10:26:49 +01:00
Jetha Chan 3ba01c11b4 MDL-49073 timezones: update to 2015a (2323 rules) 2015-02-04 13:19:16 +08:00
Rajesh Taneja 0402c8c069 MDL-49081 tests: Removed dev option from composer
dev option is enabled by default in composer, so not required.
https://github.com/composer/composer/blob/master/CHANGELOG.md
2015-02-04 10:21:38 +08:00
Dan Poltawski 6b6125b949 Merge branch 'MDL-48942_survey_27' of https://github.com/andyjdavis/moodle into MOODLE_27_STABLE 2015-02-03 15:55:25 +00:00
Dan Poltawski 734df0d567 Merge branch 'MDL-48955-27' of https://github.com/vadimonus/moodle into MOODLE_27_STABLE 2015-02-03 14:05:02 +00:00
Dan Poltawski c14e541347 Merge branch 'm27_MDL-48799_Incorrect_Legacy_Dir_Fallback' of https://github.com/scara/moodle into MOODLE_27_STABLE 2015-02-03 13:15:20 +00:00
Dan Poltawski a07b461a4a Merge branch 'm27_MDL-48907' of https://github.com/totara/moodle into MOODLE_27_STABLE 2015-02-03 12:56:45 +00:00
Eloy Lafuente (stronk7) d9985cf497 MDL-48920 tool_generator: fix unit tests 2015-02-03 12:39:34 +00:00
Dan Poltawski 4a21f1b58b Merge branch 'MDL-44071-27' of git://github.com/zbdd/moodle into MOODLE_27_STABLE 2015-02-03 12:17:51 +00:00
Dan Poltawski ae2faed37d Merge branch 'MDL-48533_m27' of https://github.com/markn86/moodle into MOODLE_27_STABLE 2015-02-03 11:13:51 +00:00
Dan Poltawski 47dfdfcfbe MDL-48624 behat: fix trailing whitespace 2015-02-03 11:02:48 +00:00
Dan Poltawski a84ea4944a Merge branch 'wip-mdl-48624-m27' of https://github.com/rajeshtaneja/moodle into MOODLE_27_STABLE 2015-02-03 11:01:58 +00:00
Eloy Lafuente (stronk7) 27ccaa5f29 Merge branch 'wip-mdl-49015-m27' of https://github.com/rajeshtaneja/moodle into MOODLE_27_STABLE 2015-02-03 11:52:32 +01:00
Andrew Nicols 82d8e53dec Merge branch 'MDL-48865-27' of git://github.com/xow/moodle into MOODLE_27_STABLE 2015-02-03 16:42:06 +08:00
Neill Magill a2b22dd5df MDL-48865 core_block: Show regions with only hidden blocks when editing
Before this patch if all the blocks in a block region are set to hidden the region will be docked even when editing is enabled.
This meant that as a user I would need to add a new block to the page and move it to that region via the configuration
menu before I could manipulate the hidden blocks again.
2015-02-03 16:14:42 +08:00
Andrew Nicols cb4f747758 Merge branch 'MDL-48920-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2015-02-03 16:12:22 +08:00
Andrew Nicols 4d70a24d32 Merge branch 'tgz_fixing27' of https://github.com/tlevi/moodle into MOODLE_27_STABLE 2015-02-03 16:04:30 +08:00
Andrew Nicols 5c5559abb8 Merge branch '48968-27' of git://github.com/samhemelryk/moodle into MOODLE_27_STABLE 2015-02-03 14:25:15 +08:00
Andrew Nicols 068925e251 Merge branch 'MDL-48929-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2015-02-03 14:11:02 +08:00
Andrew Nicols 8d3e6e385d MDL-48484 admin: Improve coding style 2015-02-03 13:44:47 +08:00
Andrew Nicols 1030084f6e Merge branch 'm27_MDL-48484' of https://github.com/totara/moodle into MOODLE_27_STABLE 2015-02-03 13:44:21 +08:00
Andrew Nicols 7f866e3c18 Merge branch 'm27_MDL-46467' of https://github.com/totara/moodle into MOODLE_27_STABLE 2015-02-03 12:59:46 +08:00
Eloy Lafuente (stronk7) 9e4f60924c Merge branch 'MDL-48578-27' of git://github.com/jleyva/moodle into MOODLE_27_STABLE 2015-02-03 00:47:53 +01:00
Brian Barnes 36d81e9ef2 MDL-49064 bootstrapbase: fixed rtl alignment of leftalign CSS class 2015-02-03 09:14:23 +13:00
David Monllao 1ad756e4ed Merge branch 'MDL-31036-27' of git://github.com/zbdd/moodle into MOODLE_27_STABLE 2015-02-02 14:55:31 +08:00
David Monllao 5e4ddeab88 Merge branch 'wip-mdl-46626-m27' of git://github.com/rajeshtaneja/moodle into MOODLE_27_STABLE 2015-02-02 12:08:49 +08:00
Brian Barnes 51f931fea7 MDL-48484 admin: Added labels to configtime settings 2015-02-02 16:46:33 +13:00
Matteo Scaramuccia 61cff2855e MDL-48799 Files API: fixed legacy directory fallback. 2015-02-01 09:18:49 +01:00
Eloy Lafuente (stronk7) f25f4caffd Moodle release 2.7.5 2015-01-30 12:35:20 +01:00
Zachary Durber 3d10a0b762 MDL-31036 mod_assign: Don't strip quickgrading feedback of special chars 2015-01-30 14:38:46 +08:00
Andrew Nicols 40c809b83e MDL-48899 lib: Use the wwwroot to inform the message-ID
PHPMailer can sometimes fail to get a valid hostname when trying to
determine a Message-ID.

Rather than relying entirely on the serverHostname, fall back on the
wwwroot when unable to determine the real hostname.
2015-01-30 11:01:11 +08:00
Tyler Bannister 14fe039d20 MDL-46626 report_log: Removed HTML from log report export
This is a partial backport of MDL-34867
2015-01-30 09:10:09 +08:00
Rajesh Taneja a9d59d433a MDL-49015 mod_lesson: Don't rely on external links in behat 2015-01-30 08:59:26 +08:00
Rajesh Taneja 379a362bca MDL-48624 behat: Added page load check in workshop step
i_allocate_submissions_in_workshop_as step sometimes
fails because of server speed. Added page load check
with extended timout.
2015-01-30 08:55:54 +08:00
Rajesh Taneja b6fcba4636 MDL-48624 behat: Added extended timeout to ensure step pass
following_should_download_between_and_bytes step sometimes
fails because of server speed. Added extended timout
ensuring they wait enough before failing.
Also, not calling force download while running behat site
2015-01-30 08:55:54 +08:00
Vadim Dvorovenko d9e865148d MDL-48955 filter_mathjax: Regexp fix for texfiltercompatibility mode
Fixing incorrect regexp for replacing text like
"$$a$$ and $$b$$" to "\(a\) and \(b\)". This is needed for
texfiltercompatibility to work as expected.
2015-01-29 23:16:07 +07:00
AMOS bot fef4361142 Automatically generated installer lang files 2015-01-30 00:04:16 +08:00
Juan Leyva bdc6977dc7 MDL-48357 webservices: Missing instance property in course contents ws 2015-01-29 14:13:33 +01:00
Tony Levi edcb9e619f MDL-48924 backup: Fix some get_file_packer() calls for enabletgzbackups 2015-01-29 22:53:01 +10:30
Eloy Lafuente (stronk7) 9196786861 weekly release 2.7.4+ 2015-01-29 10:28:07 +01:00
Eloy Lafuente (stronk7) f554a14205 Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2015-01-29 10:28:02 +01:00
Andrew Nicols 904883b08f Merge branch 'MDL-36877_27' of https://github.com/jmvedrine/moodle into MOODLE_27_STABLE 2015-01-29 09:10:47 +08:00
Jean-Michel Vedrine 20e9ca0faa MDL-36877 mod_lesson: Fix while MDL-38578 is not solved 2015-01-28 21:37:18 +01:00
Juan Leyva ff936081dc MDL-48578 webservices: Fixed missing required library 2015-01-28 14:44:28 +01:00
Simon Coggins 788a4e112d MDL-48855 dev: Fix ctags command to handle extra whitespace 2015-01-28 12:42:29 +01:00
Marina Glancy 3db52fd27f MDL-48978 user: fixed regression from MDL-37704 2015-01-28 11:58:45 +01:00
David Monllao 1ffc405936 Merge branch 'MDL-48914-27' of git://github.com/rtcn2/moodle into MOODLE_27_STABLE 2015-01-28 17:45:01 +08:00
Damyon Wiese 0289be1321 MDL-48980 Security: Always clean the result from min_get_slash_argument
The result from this function is used in send_file calls and if unclean
(windows dir separators, or .. path components) it could expose sensitive
files (e.g. .php files). Now we always clean the result from this function
even if it means double cleaning.

I also fixed the unit test for this function and added a new test for this cleaning.

I also updated the comments to point to get_file_argument as the full version of
min_get_slash_argument.
2015-01-28 14:38:01 +08:00
Andrew Nicols 365e0555ee MDL-41026 webservices: Correct unit tests 2015-01-28 14:05:03 +08:00
Andrew Nicols ef76325dda Merge branch 'MDL-41026-27' of git://github.com/ankitagarwal/moodle into MOODLE_27_STABLE 2015-01-28 10:07:01 +08:00
Eloy Lafuente (stronk7) 8cda566640 Merge branch 'MDL-48685-27' of git://github.com/andrewnicols/moodle into MOODLE_27_STABLE 2015-01-28 00:47:01 +01:00
Eloy Lafuente (stronk7) d09c57ee33 Merge branch 'MDL-48660-m27' of https://github.com/sammarshallou/moodle into MOODLE_27_STABLE 2015-01-27 21:14:10 +01:00
AMOS bot fe3c75ae36 Automatically generated installer lang files 2015-01-28 00:04:26 +08:00
sam marshall 848dd93bf2 MDL-48660 Availability: filter_user_list() should respect 'view hidden'
Updated filter_user_list to account for the viewhiddenactivities and
viewhiddensections capabilities.
2015-01-27 12:02:28 +00:00
Eloy Lafuente (stronk7) 86799aa49f Merge branch 'MDL-40285_m27' of git://github.com/markn86/moodle into MOODLE_27_STABLE 2015-01-27 12:21:23 +01:00
Mark Nelson 5869dbfc4c MDL-40285 mod_assign: added extra group submissions behat scenario
Thanks a lot to Jody Steele for providing the basis for the scenario.
2015-01-27 00:35:14 -08:00
Mark Nelson 731251f405 MDL-40285 mod_assign: show details for all default group members 2015-01-27 00:35:13 -08:00
Jerome Mouneyrac 0a5543cb55 MDL-41026 webservices: use correct param format in external apis 2015-01-27 10:07:58 +05:30
James Henestofel ec711d5bbd MDL-44071 webservices: Sorting courses post deletion.
Signed-off-by: Zachary Durber <zdurber@gmail.com>
2015-01-27 11:46:21 +08:00
Frederic Massart f321e5a222 MDL-48920 tool_generator: Use 'real' names during course generation 2015-01-27 11:27:37 +08:00
Andrew Nicols 358c48ff27 Merge branch 'MDL-48491-27' of git://github.com/zbdd/moodle into MOODLE_27_STABLE 2015-01-27 10:58:32 +08:00
Brian Barnes cecc812fa0 MDL-46467 forms: Labels have "for" attribute even when frozen 2015-01-27 14:38:09 +13:00
Andrew Nicols 7956f0c3af MDL-48685 core_useragent: Correct IE 5.0 issues 2015-01-27 08:37:18 +08:00
Andrew Nicols f53e024291 MDL-48685 tests: Add testing for supports_json_contenttype 2015-01-27 08:37:18 +08:00
Andrew Nicols 3f4c39004d MDL-48685 tests: Add additional User Agents
* Firefox 33; Mac OS X 10.10
* Chrome 39; Mac OS X
* Safari; iPhone 6 Plus; iOS 8.1; Build 12B411
* Opera 12.15 (Build 1748); Mac OS X
2015-01-27 08:37:18 +08:00
Andrew Nicols a0adb4195e MDL-48685 tests: Rewrite useragent tests 2015-01-27 08:37:18 +08:00
Eloy Lafuente (stronk7) d55e5bb821 Merge branch 'MDL-48916_27' of https://github.com/wesleysitu/moodle into MOODLE_27_STABLE 2015-01-27 01:09:42 +01:00
Eloy Lafuente (stronk7) 4cd289ae45 Merge branch 'MDL-48921-27-2nd' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2015-01-27 01:02:58 +01:00
Eloy Lafuente (stronk7) db8977f209 Merge branch 'wip-MDL-48325-27' of git://github.com/abgreeve/moodle into MOODLE_27_STABLE 2015-01-27 00:26:07 +01:00
Eloy Lafuente (stronk7) af65e0db33 Merge branch 'MDL-35765-27' of git://github.com/merrill-oakland/moodle into MOODLE_27_STABLE 2015-01-26 17:32:33 +01:00
Eloy Lafuente (stronk7) 083fe32ba3 Merge branch 'MDL-36877_27' of git://github.com/jmvedrine/moodle into MOODLE_27_STABLE 2015-01-26 16:04:45 +01:00
Andrew Davis 32f0ad84c6 MDL-48942 mod_survey: synced security checks in view.php and graph.php 2015-01-26 15:06:36 +01:00
Eloy Lafuente (stronk7) 73502d6464 Merge branch 'MDL-43421-27' of git://github.com/mr-russ/moodle into MOODLE_27_STABLE 2015-01-26 10:25:09 +01:00
Brian Barnes 33f9b3b1e1 MDL-48805 theme: Collapse now collapses all data-target 2015-01-26 11:24:57 +13:00
Valerii Kuznetsov 20ef0b4257 MDL-48968 blocks: fixed bug with pagetype handling 2015-01-26 09:28:39 +13:00
Jean-Michel Vedrine fd7100a221 MDL-36877 Lesson: final page not displayed if show gradebook set to no 2015-01-25 19:57:09 +01:00
Rod Norfor 73841c3908 MDL-48914 admin: check maxuserperpage in existingroleholders->find_users 2015-01-23 16:01:46 +00:00
Nelson Moller ce534d5dfa MDL-48929 repository_filesystem: Valide relative path against realpath
On Windows systems, there could have been a mix of back and forward
slashes, causing the validation of the relative path to fail. Now
we will always get the realpath before comparing.
2015-01-23 17:28:09 +08:00
Andrew Nicols cccb0c0722 weekly release 2.7.4+ 2015-01-23 08:27:49 +08:00
Andrew Nicols c5363d38d2 Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2015-01-23 08:27:42 +08:00
Adrian Greeve 74783abd8d MDL-48325 mod_data: Export to portfolio button uses capability.
The Export to portfolio button now checks the mod/data:exportownentry
capability to see if the export button should be shown.
2015-01-22 15:01:21 +08:00
Zachary Durber b44e802eaf MDL-48491 enrolments: Paypal enrolments send email as support user. 2015-01-22 13:47:28 +08:00
Andrew Nicols d02eaee727 Revert "Merge branch 'wip-mdl-48624-m27' of https://github.com/rajeshtaneja/moodle into MOODLE_27_STABLE"
This reverts commit 85ea64f5ee, reversing
changes made to 1db2e142a2.
2015-01-22 12:17:17 +08:00
Eloy Lafuente (stronk7) 5bb19510ab Merge branch 'MDL-48823_27' of git://github.com/dmonllao/moodle into MOODLE_27_STABLE 2015-01-21 12:32:39 +01:00
Frederic Massart 5634dcb828 MDL-48921 admin: Keep the search string in the URL after form submission 2015-01-21 15:50:34 +08:00
David Monllao 90ef484cec MDL-48823 admin: Just one admin tree reload after settings changes 2015-01-21 10:42:09 +08:00
Andrew Nicols e47d85fadb Merge branch 'wip-mdl-48761-m27' of https://github.com/rajeshtaneja/moodle into MOODLE_27_STABLE 2015-01-21 10:22:35 +08:00
Rajesh Taneja 68e1853422 MDL-48761 behat: Added new step for debugging scenarios 2015-01-21 10:18:25 +08:00
Wesley Situ a6a73abf88 MDL-48916 atto_undo: Clarify text for "Undo/Redo" 2015-01-20 16:18:36 -08:00
Eloy Lafuente (stronk7) f4ebb7eb0a Merge branch 'wip-MDL-48847-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2015-01-21 00:28:46 +01:00
Eloy Lafuente (stronk7) 990854c17b Merge branch 'MDL-48830-m27' of https://github.com/micaherne/moodle into MOODLE_27_STABLE 2015-01-21 00:04:33 +01:00
Brian Barnes 4758a64934 MDL-48907 grades: fixed display of grade tabs 2015-01-21 10:30:53 +13:00
Eric Merrill ca1b2405c4 MDL-35765 availability: Use category total full names 2015-01-20 15:38:12 -05:00
Eloy Lafuente (stronk7) 02528f3266 Merge branch 'MDL-48873_moodle27' of https://github.com/StudiUM/moodle into MOODLE_27_STABLE 2015-01-20 19:27:33 +01:00
Eloy Lafuente (stronk7) b20e80fb67 Merge branch 'wip-mdl-48837-m27' of https://github.com/rajeshtaneja/moodle into MOODLE_27_STABLE 2015-01-20 18:52:38 +01:00
Dan Poltawski 3fdfc48a44 Merge branch 'MDL-48798-27' of https://github.com/vadimonus/moodle into MOODLE_27_STABLE 2015-01-20 17:50:30 +00:00
Eloy Lafuente (stronk7) 85b77c7ea4 Merge branch 'MDL-48477_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2015-01-20 18:44:52 +01:00
Eloy Lafuente (stronk7) 13125610aa Merge branch 'MDL-48779-27' of https://github.com/vadimonus/moodle into MOODLE_27_STABLE 2015-01-20 18:41:28 +01:00
Eloy Lafuente (stronk7) 981464e4ba Merge branch 'MDL-47792_27' of git://github.com/dmonllao/moodle into MOODLE_27_STABLE 2015-01-20 18:38:14 +01:00
Dan Poltawski 29972512c1 Merge branch 'wip-mdl-48831-m27' of https://github.com/rajeshtaneja/moodle into MOODLE_27_STABLE 2015-01-20 17:21:14 +00:00
Eloy Lafuente (stronk7) 41be0b4e02 Merge branch 'MDL-48859_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2015-01-20 18:09:20 +01:00
Dan Poltawski 68a5cc75a6 Merge branch 'MDL-48829_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2015-01-20 17:07:59 +00:00
Eloy Lafuente (stronk7) b70a4b3e61 Merge branch 'MDL-48860_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2015-01-20 17:47:24 +01:00
Eloy Lafuente (stronk7) 85ea64f5ee Merge branch 'wip-mdl-48624-m27' of https://github.com/rajeshtaneja/moodle into MOODLE_27_STABLE 2015-01-20 17:21:28 +01:00
Eloy Lafuente (stronk7) 1db2e142a2 Merge branch 'MDL-47166-27' of git://github.com/andrewnicols/moodle into MOODLE_27_STABLE 2015-01-20 16:15:56 +01:00
David Monllao a56ec068ed Merge branch 'MDL-48765-27' of git://github.com/gurgus/moodle into MOODLE_27_STABLE 2015-01-20 17:09:17 +08:00
David Monllao 39922f8029 Merge branch 'MDL-48776-27' of git://github.com/gurgus/moodle into MOODLE_27_STABLE 2015-01-20 16:08:06 +08:00
Andrew Nicols 67ae93f917 Merge branch 'MDL-42172-27' of https://github.com/vadimonus/moodle into MOODLE_27_STABLE 2015-01-20 15:43:45 +08:00
Patrik Granlöv 93bfaf4fa8 MDL-35486 outputlib: Fix typos in comments
Just a copy-past text error in two comments.
2015-01-20 14:04:25 +08:00
Andrew Nicols 589fb8e7b3 Merge branch 'MDL-44560-27' of git://github.com/xow/moodle into MOODLE_27_STABLE 2015-01-20 13:26:39 +08:00
Andrew Nicols 125c11d3f0 Merge branch 'MDL-38277_m27' of https://github.com/sbourget/moodle into MOODLE_27_STABLE 2015-01-20 12:47:16 +08:00
Aaron Barnes 17c0747edd MDL-47792 javascript: Fix for cropped headers and horizontal align 2015-01-20 11:38:54 +08:00
Jean-Michel Vedrine fa9e5b5709 MDL-48596 mod_lesson: editing interface won't expand to full screen 2015-01-20 11:05:23 +08:00
Andrew Nicols 919fd9433b Merge branch 'MDL-48741_27' of git://github.com/stronk7/moodle into MOODLE_27_STABLE 2015-01-20 09:57:04 +08:00
Dave Cooper 0256434964 MDL-48776 core_message: Fixed userid check.
Thanks to Oleg Demeshev for providing the patch.
2015-01-19 15:21:13 +08:00
Andrew Nicols 55316d0b0d Merge branch 'MDL-46976-27' of git://github.com/danpoltawski/moodle into MOODLE_27_STABLE 2015-01-19 12:20:34 +08:00
Andrew Nicols 77bb001602 Merge branch 'MDL-48073-27' of git://github.com/gurgus/moodle into MOODLE_27_STABLE 2015-01-19 11:41:39 +08:00
Nivedita Setru 04f14e3047 MDL-48073 enrol: Fixed group filter resetting erroneously. 2015-01-19 11:26:21 +08:00
Rajesh Taneja 1031133cce MDL-48624 behat: Added extended timeout in workshop step
i_allocate_submissions_in_workshop_as step sometimes
fails because of server speed. Added extended timout
ensuring they wait enough before failing.
2015-01-19 10:19:30 +08:00
Rajesh Taneja 5f5c2b846d MDL-48624 behat: Added extended timeout to ensure step pass
following_should_download_between_and_bytes step sometimes
fails because of server speed. Added extended timout
ensuring they wait enough before failing.
Also, not calling force download while running behat site
2015-01-19 10:19:27 +08:00
Jean-Michel Vedrine 5aa4150f4a MDL-43386 Lesson: Grade essay student response formatting not correct
Conflicts:
	mod/lesson/locallib.php
2015-01-18 20:44:54 +01:00
Vadim Dvorovenko fa51ff9969 MDL-48798 Statistics: Adding lang string for user activity.
New lang string for 'Activity' (meaning count of user actions) in stats
reports to disambiguate it with 'Activity' (meaning course module).

AMOS BEGIN
 CPY [activity,core],[useractivity,core]
AMOS END
2015-01-17 23:14:34 +07:00
Vadim Dvorovenko 82e95407eb MDL-48779 MNet: multibyte substr in certificate generation
Using core_text::substr instead of substr for trimming certificate
data. Is needed for sites with long unicode sitename to prevent
breaking line between unicode pair.
2015-01-17 23:13:24 +07:00
Vadim Dvorovenko 9369b2167f MDL-42172 Authentification: Adding alternate names to "Lock user fields"
Adding alternate name fields (firstnamephonetic, lastnamephonetic,
middlename, alternatename) to "Lock user fields" for all
authentification plugins. This is needed to sync alternate name fields
with external data sources and to lock them for editing.
2015-01-17 23:10:51 +07:00
AMOS bot 08116bf552 Automatically generated installer lang files 2015-01-18 00:04:01 +08:00
Gilles-Philippe Leblanc 13f6652060 MDL-48873 auth_cas: Wrong redirection with bad multiauth login 2015-01-16 12:00:01 -05:00
Ray Bon 8705f0f9ea MDL-48837 phpunit: Restore system default timezone 2015-01-16 12:47:54 +08:00
John Okely 807c71c0bd MDL-44560 glossary: Fix pagination on glossary category view
Credit to Sebastian B for this fix
2015-01-16 11:12:00 +08:00
Rajesh Taneja c665480063 MDL-48831 behat: Added behat test for label activity
Thanks to Neill Magill, for providing test feature.
2015-01-16 10:41:10 +08:00
Rajesh Taneja ead9f6c78d MDL-48831 behat: Fixed activity show hide for label
Labels are not links and have dimmed_text class
So updated find query for show/hide activity check
2015-01-16 10:41:10 +08:00
Eloy Lafuente (stronk7) e5f2f54920 MDL-48741 behat: add new moodle_list formatter (rerun compatible) 2015-01-16 03:15:43 +01:00
Stephen Bourget fc05d527e4 MDL-38277 Lesson: Fix strings on activity report 2015-01-15 12:53:37 -05:00
Tim Hunt da36d32ef7 MDL-48860 behat: fix matching select human-readable value
This is a selective back-port of a small part of MDL-43835.
2015-01-15 12:37:16 +00:00
Rajesh Taneja c8410c245c MDL-43835 behat: Added new step to set field with xpath defined 2015-01-15 11:35:19 +00:00
Michael Aherne 59e724cfa1 MDL-48830 accesslib: Add sort field to query 2015-01-15 10:19:38 +00:00
Tim Hunt 60802d3a1c MDL-48829 quiz nav: add a data attr to buttons giving the page
This way, if you need to know which page each button goes to in
JavaScript, you can find out.
2015-01-15 10:18:06 +00:00
Tim Hunt 4047bebb65 MDL-48477 questions: no delete icon for only top-level category
The back end code already threw an exception if you clicked the icon,
so you could not delete the category, but we should not have shown the
icon in the first place.

Thanks to Pramith Dayananda for working out the fix for this issue. I am
just committing it.
2015-01-15 10:17:58 +00:00
Andrew Nicols 146c80d338 weekly release 2.7.4+ 2015-01-15 14:20:00 +08:00
Andrew Nicols ced23f8a50 Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2015-01-15 14:19:50 +08:00
Charles Fulton 13ad716894 MDL-48765 enrol: do not use a non-breaking space as a separator 2015-01-15 11:21:30 +08:00
Marina Glancy 9beca92ae6 MDL-48847 groups: fixed incorrect user count 2015-01-15 11:12:01 +08:00
Dan Poltawski eedfb32ea0 MDL-46976 user: trim whitespace from input email address
Don't complain about invalid email address, we are a computer, we
love the jobs users hate.

ref: https://www.youtube.com/watch?v=5tquSbZEP-g
2015-01-14 17:14:38 +00:00
AMOS bot 52d7933eec Automatically generated installer lang files 2015-01-15 00:04:06 +08:00
Dan Poltawski 261cb39eca Merge branch 'MDL-14730_27' of git://github.com/jmvedrine/moodle into MOODLE_27_STABLE 2015-01-14 10:28:17 +00:00
John Okely 3d383a7da5 MDL-47761 enrol: Show more detail for self-enrolment errors
Thanks to Mirko Otto for the solution
2015-01-14 00:30:26 +01:00
Eloy Lafuente (stronk7) e048e9f1ab Merge branch 'M27_MDL-48574_workflow_state_updated_batch_single' of https://github.com/Dave-B/moodle into MOODLE_27_STABLE 2015-01-14 00:14:57 +01:00
Eloy Lafuente (stronk7) 0dc79af9c6 Merge branch 'MDL-41166-27' of git://github.com/danpoltawski/moodle into MOODLE_27_STABLE 2015-01-13 23:42:33 +01:00
Eloy Lafuente (stronk7) 7cda92f09c Merge branch 'MDL-48753_m27' of git://github.com/markn86/moodle into MOODLE_27_STABLE 2015-01-13 15:54:02 +01:00
Dan Poltawski f88fc2bb85 Merge branch 'MDL-36824_m27' of https://github.com/sbourget/moodle into MOODLE_27_STABLE 2015-01-13 13:15:08 +00:00
Dan Poltawski 8ef170b1cc Merge branch 'MDL-39103-27' of git://github.com/xow/moodle into MOODLE_27_STABLE
Conflicts:
	mod/lesson/lib.php
2015-01-13 12:54:32 +00:00
Dan Poltawski 953601bcb0 Merge branch 'MDL-45784-27' of git://github.com/xow/moodle into MOODLE_27_STABLE 2015-01-13 12:35:12 +00:00
Dan Poltawski 308bca3b39 Merge branch 'MDL-48474_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2015-01-13 11:45:39 +00:00
Stephen Bourget ac5f381992 MDL-48750 Lesson: Behat test for lesson attempt info
behat test provided by Jean-Michel Vedrine
2015-01-13 11:20:21 +00:00
Stephen Bourget 8a15f3d25f MDL-48750 Lesson: Fix attempt info displayed by course overview block 2015-01-13 10:59:36 +00:00
Dan Poltawski d3e6254b40 Merge branch 'MDL-40326_27' of git://github.com/jmvedrine/moodle into MOODLE_27_STABLE 2015-01-13 10:08:22 +00:00
Andrew Nicols 492e583328 Merge branch 'MDL-43898-27' of git://github.com/danpoltawski/moodle into MOODLE_27_STABLE 2015-01-13 10:28:40 +08:00
Eloy Lafuente (stronk7) d86285fb80 MDL-35155 database: better sql_substr() impl. for mssql/sqlsrv + unit tests
MSSQL's substring() implementation is somehow silly/strict and unable to
perform implicit casts to integer both for the start and length parameters.

This hits Moodle badly because of another problems (MDL-23997) we decided
to cast to string all bound placeholders long ago.

So this commit just enforces the cast of the start and length parameters to
integer. And includes unit tests for using placeholders on all positions in
the sql_substr() method.
2015-01-12 18:26:58 +01:00
Eloy Lafuente (stronk7) e1dab7082d Merge branch 'MDL-35155-27' of git://github.com/danpoltawski/moodle into MOODLE_27_STABLE 2015-01-12 18:26:52 +01:00
AMOS bot 287986340f Automatically generated installer lang files 2015-01-13 00:04:07 +08:00
Dan Poltawski 28b6d8949c MDL-31774 mod_lesson: fix for behat test 2015-01-12 14:54:28 +00:00
Dan Poltawski ad028c1ea0 Merge branch 'MDL-31774_27' of git://github.com/jmvedrine/moodle into MOODLE_27_STABLE 2015-01-12 14:37:54 +00:00
Dan Poltawski e3d7ab13ed Merge branch 'MDL-44907-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2015-01-12 11:31:34 +00:00
Marina Glancy 154685629a MDL-48794 report_log: make sure y-axis gridlines in graphs are integers 2015-01-12 16:22:23 +08:00
Andrew Nicols 56eb183b01 Merge branch 'MDL-46671-27' of https://github.com/pjking07/moodle into MOODLE_27_STABLE 2015-01-12 13:58:03 +08:00
Andrew Nicols 1ffb2f5e2e Merge branch 'MDL-47425-27' of git://github.com/zbdd/moodle into MOODLE_27_STABLE 2015-01-12 13:43:35 +08:00
Sam Hemelryk cb04c9cb1e MDL-48753 badges: converted func to named params
Converted the SQL params within badges_get_user_badges to
named params.
Unit tests added for this function at the same time.
UI covered by behat already.
2015-01-11 20:12:36 -08:00
Andrew Nicols c7a0ba9623 Merge branch 'MDL-38142-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2015-01-12 11:56:57 +08:00
Andrew Nicols aef5f4d5a3 Merge branch 'MDL-47692_m27' of git://github.com/markn86/moodle into MOODLE_27_STABLE 2015-01-12 11:31:02 +08:00
Jean-Michel Vedrine 0be93791cb MDL-31774 mod_lesson: Wrong jumps in lessons with mutiple clusters 2015-01-10 18:44:16 +01:00
AMOS bot 6eb4a6bd28 Automatically generated installer lang files 2015-01-11 00:04:09 +08:00
Stephen Bourget a476d04ce5 MDL-36824 Lesson: Media File should be displayed as a block 2015-01-09 18:20:56 -05:00
David Balch e119e084ec MDL-48574 assign: Test workflow_state_updated fired on batch and single. 2015-01-09 16:48:01 +00:00
Jean-Michel Vedrine 61266a15e9 MDL-14730 mod_lesson: allow linking to pages inside a lesson 2015-01-09 11:42:15 +01:00
Zachary Durber 7e6411aae5 MDL-47425 mod_assign: Allow sorting by state without submissions.
Special thanks to Antton Rodriguez for the suggested patch.
2015-01-09 14:51:39 +08:00
Frederic Massart 8818f55a75 MDL-38142 mod_forum: Allow viewing of student posts in hidden courses 2015-01-09 11:38:02 +08:00
Andrew Nicols d8b26e11dd MDL-47166 atto_indent: Swap Outdent and Indent 2015-01-09 09:22:19 +08:00
Tim Hunt 4655dedf1f MDL-48474 qtype_shortanswer: answers were not being trimmed.
This fix is based on Oleg Sychev's suggestion. Thanks.
2015-01-08 17:43:24 +00:00
Frederic Massart 96ed0694ef MDL-44907 admin: Better styling of admin settings validation errors
Conflicts:
	theme/bootstrapbase/style/moodle.css
2015-01-08 16:23:29 +08:00
Dan Poltawski 895b61d6e6 MDL-35155 dml: add unit test which exposes substr problem
Previously, when using parameters, substring broke on mssql.
2015-01-08 08:14:20 +00:00
Simon Coggins 227b31ccbe MDL-35155: Fix MSSQL bug in sql_substr() 2015-01-08 08:14:19 +00:00
Mark Nelson 127210170d MDL-48533 report_backups: added ability to view backup logs 2015-01-07 22:24:44 -08:00
Mark Nelson 0b2e01db96 MDL-48533 core_backup: use default log level when none specified 2015-01-07 22:24:43 -08:00
John Okely 0d71d809e6 MDL-45784 lesson: Remove preview link for students viewing lesson
Credit to Pete Jones for the fix.
2015-01-08 13:28:48 +08:00
David Balch e2a3ea029a MDL-48574 assign: Fire workflow_state_updated event on batch and single.
This change adds the workflow_state_updated event when changing workflow
state using the single grading page and the quick grading mechanisms.
Previously, it only fired for batch updates using
process_set_batch_marking_workflow_state().
2015-01-07 14:48:34 +00:00
Mark Nelson 3cae9f4d13 MDL-47692 mod_quiz: added additional question_manually_graded trigger 2015-01-06 15:09:25 -08:00
John Okely 5ce6beca15 MDL-39103 lesson: Fix lesson administration block
Credit to Joseph Rézeau for the fix
2015-01-06 14:52:47 +08:00
Russell Smith b2fb93f89b MDL-43421 logging: Ignore race condition in access update. 2015-01-03 20:49:58 +11:00
PJ King 719c2dac88 MDL-46671 availability: DEBUG when course_module does not exist.
There was a fatal error when calendar event linked to non-extant activities.

Now, instead of throwing an exception when a course_module does not exist, is_user_visible() will print a debug statement.
2015-01-02 09:38:21 -05:00
Jean-Michel Vedrine ad43491248 MDL-40326 mod_lesson: progress bar is not reset by course reset 2015-01-01 13:24:31 +01:00
Lloyd Powell afca27a6dc MDL-43898 lesson: Fix for positioning of blocks on continue.php 2014-12-31 09:09:54 +00:00
Dan Poltawski 1fdfd7127c MDL-41166 assign: don't display portfolio button when no permissions
Thanks to Katja Krüger for the basis of the patch.
2014-12-30 16:48:55 +00:00
269 changed files with 7761 additions and 3658 deletions
+1 -2
View File
@@ -67,7 +67,6 @@ 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);
}
@@ -156,4 +155,4 @@ echo $outputhtml;
echo html_writer::end_tag('fieldset');
echo html_writer::end_tag('form');
echo $OUTPUT->footer();
echo $OUTPUT->footer();
+14 -5
View File
@@ -41,15 +41,24 @@ 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);
$sql = "SELECT ra.id AS raid," . $this->required_fields_sql('u') . ",ra.contextid,ra.component
FROM {role_assignments} ra
$fields = "SELECT ra.id AS raid," . $this->required_fields_sql('u') . ",ra.contextid,ra.component ";
$countfields = "SELECT COUNT(1) ";
$sql = "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 BY ctx.depth DESC, ra.component, $sort";
$contextusers = $DB->get_records_sql($sql, $params);
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);
// No users at all.
if (empty($contextusers)) {
+1 -3
View File
@@ -22,7 +22,6 @@ 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');
@@ -44,10 +43,9 @@ if ($errormsg !== '') {
$resultshtml = admin_search_settings_html($query); // case insensitive search only
echo '<form action="search.php" method="post" id="adminsettings">';
echo '<form action="' . $PAGE->url->out(true) . '" method="post" id="adminsettings">';
echo '<div>';
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
echo '<input type="hidden" name="query" value="'.s($query).'" />';
echo '</div>';
echo '<fieldset>';
echo '<div class="clearer"><!-- --></div>';
-1
View File
@@ -48,7 +48,6 @@ 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);
}
-3
View File
@@ -278,9 +278,6 @@ 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);
@@ -308,8 +308,7 @@ class tool_generator_course_backend extends tool_generator_backend {
$username = 'tool_generator_' . $textnumber;
// Create user account.
$record = array('firstname' => get_string('firstname', 'tool_generator'),
'lastname' => $number, 'username' => $username);
$record = array('username' => $username, 'idnumber' => $number);
// We add a user password if it has been specified.
if (!empty($CFG->tool_generator_users_password)) {
@@ -62,7 +62,6 @@ $string['error_nonexistingcourse'] = 'The specified course does not exist';
$string['error_nopageinstances'] = 'The selected course does not contain page module instances';
$string['error_notdebugging'] = 'Not available on this server because debugging is not set to DEVELOPER';
$string['error_nouserspassword'] = 'You need to set $CFG->tool_generator_users_password in config.php to generate the test plan';
$string['firstname'] = 'Test course user';
$string['fullname'] = 'Test course: {$a->size}';
$string['maketestcourse'] = 'Make test course';
$string['maketestplan'] = 'Make JMeter test plan';
@@ -136,7 +136,7 @@ class tool_generator_maketestcourse_testcase extends advanced_testcase {
$lastusernumber = 0;
$discussionstarters = array();
foreach ($discussions as $discussion) {
$usernumber = intval($discussion->lastname);
$usernumber = core_user::get_user($discussion->userid, 'id, idnumber')->idnumber;
// Checks that the users are odd numbers.
$this->assertEquals(1, $usernumber % 2);
-27
View File
@@ -164,33 +164,6 @@ if ($mode == UPDATE_ALL_LANG) {
make_temp_directory('');
make_upload_directory('lang');
// clean-up currently installed versions of the packs
foreach ($neededlangs as $packindex => $pack) {
if ($pack == 'en') {
continue;
}
// delete old directories
$dest1 = $CFG->dataroot.'/lang/'.$pack;
$dest2 = $CFG->dirroot.'/lang/'.$pack;
$rm1 = false;
$rm2 = false;
if (file_exists($dest1)) {
if (!remove_dir($dest1)) {
$notice_error[] = 'Could not delete old directory '.$dest1.', update of '.$pack.' failed, please check permissions.';
unset($neededlangs[$packindex]);
continue;
}
}
if (file_exists($dest2)) {
if (!remove_dir($dest2)) {
$notice_error[] = 'Could not delete old directory '.$dest2.', update of '.$pack.' failed, please check permissions.';
unset($neededlangs[$packindex]);
continue;
}
}
}
// install all needed language packs
$installer->set_queue($neededlangs);
$results = $installer->run();
@@ -53,27 +53,22 @@ class tool_task_edit_scheduled_task_form extends moodleform {
$mform->addElement('text', 'minute', get_string('taskscheduleminute', 'tool_task'));
$mform->setType('minute', PARAM_RAW);
$mform->addHelpButton('minute', 'taskscheduleminute', 'tool_task');
$mform->addRule('minute', get_string('required'), 'required');
$mform->addElement('text', 'hour', get_string('taskschedulehour', 'tool_task'));
$mform->setType('hour', PARAM_RAW);
$mform->addHelpButton('hour', 'taskschedulehour', 'tool_task');
$mform->addRule('hour', get_string('required'), 'required');
$mform->addElement('text', 'day', get_string('taskscheduleday', 'tool_task'));
$mform->setType('day', PARAM_RAW);
$mform->addHelpButton('day', 'taskscheduleday', 'tool_task');
$mform->addRule('day', get_string('required'), 'required');
$mform->addElement('text', 'month', get_string('taskschedulemonth', 'tool_task'));
$mform->setType('month', PARAM_RAW);
$mform->addHelpButton('month', 'taskschedulemonth', 'tool_task');
$mform->addRule('month', get_string('required'), 'required');
$mform->addElement('text', 'dayofweek', get_string('taskscheduledayofweek', 'tool_task'));
$mform->setType('dayofweek', PARAM_RAW);
$mform->addHelpButton('dayofweek', 'taskscheduledayofweek', 'tool_task');
$mform->addRule('dayofweek', get_string('required'), 'required');
$mform->addElement('advcheckbox', 'disabled', get_string('disabled', 'tool_task'));
$mform->addHelpButton('disabled', 'disabled', 'tool_task');
@@ -0,0 +1,53 @@
@tool @tool_task @javascript
Feature: Manage scheduled tasks
In order to configure scheduled tasks
As an admin
I need to be able to disable, enable, edit and reset to default scheduled tasks
Background:
Given I log in as "admin"
And I navigate to "Scheduled tasks" node in "Site administration > Server"
Scenario: Disable scheduled task
When I click on "Edit task schedule: Log table cleanup" "link" in the "Log table cleanup" "table_row"
Then I should see "Edit task schedule: Log table cleanup"
And I set the following fields to these values:
| disabled | 1 |
And I press "Save changes"
Then I should see "Changes saved"
And I should see "Disabled" in the "Log table cleanup" "table_row"
Scenario: Enable scheduled task
When I click on "Edit task schedule: Log table cleanup" "link" in the "Log table cleanup" "table_row"
Then I should see "Edit task schedule: Log table cleanup"
And I set the following fields to these values:
| disabled | 0 |
And I press "Save changes"
Then I should see "Changes saved"
And I should not see "Task disabled" in the "Log table cleanup" "table_row"
Scenario: Edit scheduled task
When I click on "Edit task schedule: Log table cleanup" "link" in the "Log table cleanup" "table_row"
Then I should see "Edit task schedule: Log table cleanup"
And I set the following fields to these values:
| minute | */5 |
| hour | 1 |
| day | 2 |
| month | 3 |
| dayofweek | 4 |
And I press "Save changes"
Then I should see "Changes saved"
And the following should exist in the "admintable" table:
| Component | Minute | Hour | Day | Day of week | Month |
| Standard log | */5 | 1 | 2 | 4 | 3 |
Scenario: Reset scheduled task to default
When I click on "Edit task schedule: Log table cleanup" "link" in the "Log table cleanup" "table_row"
Then I should see "Edit task schedule: Log table cleanup"
And I set the following fields to these values:
| resettodefaults | 1 |
And I press "Save changes"
Then I should see "Changes saved"
And the following should not exist in the "admintable" table:
| Name | Component | Minute | Hour | Day | Day of week | Month |
| Log table cleanup | Standard log | */5 | 1 | 2 | 4 | 3 |
-1
View File
@@ -24,7 +24,6 @@ $adminroot = admin_get_root(); // need all settings
// now we'll deal with the case that the admin has submitted the form with new settings
if ($data = data_submitted() and confirm_sesskey()) {
$count = admin_write_settings($data);
$adminroot = admin_get_root(true); //reload tree
}
$newsettings = admin_output_new_settings_by_page($adminroot);
+7
View File
@@ -157,6 +157,13 @@ class external_service_form extends moodleform {
$errors = parent::validation($data, $files);
// Add field validation check for duplicate name.
if ($webservice = $DB->get_record('external_services', array('name' => $data['name']))) {
if (empty($data['id']) || $webservice->id != $data['id']) {
$errors['name'] = get_string('nameexists', 'webservice');
}
}
// Add field validation check for duplicate shortname.
// Allow duplicated "empty" shortnames.
if (!empty($data['shortname'])) {
+6
View File
@@ -113,6 +113,12 @@ class auth_plugin_cas extends auth_plugin_ldap {
// If the multi-authentication setting is used, check for the param before connecting to CAS.
if ($this->config->multiauth) {
// If there is an authentication error, stay on the default authentication page.
if (!empty($SESSION->loginerrormsg)) {
return;
}
$authCAS = optional_param('authCAS', '', PARAM_RAW);
if ($authCAS == 'NOCAS') {
return;
+2 -1
View File
@@ -143,7 +143,8 @@ class auth_plugin_shibboleth extends auth_plugin_base {
$configarray = (array) $this->config;
$moodleattributes = array();
foreach ($this->userfields as $field) {
$userfields = array_merge($this->userfields, $this->get_custom_user_profile_fields());
foreach ($userfields as $field) {
if (isset($configarray["field_map_$field"])) {
$moodleattributes[$field] = $configarray["field_map_$field"];
}
+1 -1
View File
@@ -138,7 +138,7 @@ urn:mace:organization2:providerID, Example Organization 2, /Shibboleth.sso/WAYF/
<?php
print_auth_lock_options($this->authtype, $user_fields, '<!-- empty help -->', true, false);
print_auth_lock_options($this->authtype, $user_fields, '<!-- empty help -->', true, false, $this->get_custom_user_profile_fields());
?>
</table>
+23 -1
View File
@@ -608,12 +608,34 @@ abstract class info {
}
$tree = $this->get_availability_tree();
$checker = new capability_checker($this->get_context());
// Filter using availability tree.
$this->modinfo = get_fast_modinfo($this->get_course());
$result = $tree->filter_user_list($users, false, $this, $checker);
$filtered = $tree->filter_user_list($users, false, $this, $checker);
$this->modinfo = null;
// Include users in the result if they're either in the filtered list,
// or they have viewhidden. This logic preserves ordering of the
// passed users array.
$result = array();
$canviewhidden = $checker->get_users_by_capability($this->get_view_hidden_capability());
foreach ($users as $userid => $data) {
if (array_key_exists($userid, $filtered) || array_key_exists($userid, $canviewhidden)) {
$result[$userid] = $users[$userid];
}
}
return $result;
}
/**
* Gets the capability used to view hidden activities/sections (as
* appropriate).
*
* @return string Name of capability used to view hidden items of this type
*/
protected abstract function get_view_hidden_capability();
/**
* Formats the $cm->availableinfo string for display. This includes
* filling in the names of any course-modules that might be mentioned.
+10 -1
View File
@@ -109,6 +109,10 @@ class info_module extends info {
return parent::filter_user_list($filtered);
}
protected function get_view_hidden_capability() {
return 'moodle/course:viewhiddenactivities';
}
/**
* Checks if an activity is visible to the given user.
*
@@ -157,7 +161,12 @@ class info_module extends info {
if (is_object($cmorid)) {
$cmorid = $cmorid->id;
}
$cm = $DB->get_record('course_modules', array('id' => $cmorid), '*', MUST_EXIST);
$cm = $DB->get_record('course_modules', array('id' => $cmorid));
if (!$cm) {
// In some error cases, the course module may not exist.
debugging('info_module::is_user_visible called with invalid cmid ' . $cmorid, DEBUG_DEVELOPER);
return false;
}
}
// Check the groupmembersonly feature.
+4
View File
@@ -56,6 +56,10 @@ class info_section extends info {
return \context_course::instance($this->get_course()->id);
}
protected function get_view_hidden_capability() {
return 'moodle/course:viewhiddensections';
}
protected function set_in_database($availability) {
global $DB;
$DB->set_field('course_sections', 'availability', $availability,
+6 -1
View File
@@ -139,7 +139,8 @@ abstract class tree_node {
/**
* Tests this condition against a user list. Users who do not meet the
* condition will be removed from the list.
* condition will be removed from the list, unless they have the ability
* to view hidden activities/sections.
*
* This function must be implemented if is_applied_to_user_lists returns
* true. Otherwise it will not be called.
@@ -150,6 +151,10 @@ abstract class tree_node {
* Within this function, if you need to check capabilities, please use
* the provided checker which caches results where possible.
*
* Conditions do not need to check the viewhiddenactivities or
* viewhiddensections capabilities. These are handled by
* core_availability\info::filter_user_list.
*
* @param array $users Array of userid => object
* @param bool $not True if this condition is applying in negative mode
* @param \core_availability\info $info Item we're checking
@@ -55,7 +55,7 @@ class frontend extends \core_availability\frontend {
&& $item->itemtype == 'mod') {
continue;
}
$gradeoptions[$id] = $item->get_name();
$gradeoptions[$id] = $item->get_name(true);
}
\core_collator::asort($gradeoptions);
@@ -109,17 +109,17 @@ Feature: display_availability
# Page 1 display still there but should be dimmed and not a link.
Then I should see "Page 1" in the "#section-1 .dimmed_text" "css_element"
And ".activityinstance a" "css_element" should not exist in the "#section-1" "css_element"
And ".activityinstance a" "css_element" should not exist in the "Topic 1" "section"
# Date display should be present.
And I should see "Available until" in the "#section-1" "css_element"
And I should see "Available until" in the "Topic 1" "section"
# Page 2 display not there at all
And I should not see "Page 2" in the "region-main" "region"
# Page 3 display and link
And I should see "Page 3" in the "region-main" "region"
And ".activityinstance a" "css_element" should exist in the "#section-3" "css_element"
And ".activityinstance a" "css_element" should exist in the "Topic 3" "section"
@javascript
Scenario: Section availability display
+4
View File
@@ -60,6 +60,10 @@ class mock_info extends info {
return \context_course::instance($this->get_course()->id);
}
protected function get_view_hidden_capability() {
return 'moodle/course:viewhiddensections';
}
protected function set_in_database($availability) {
}
+21
View File
@@ -421,7 +421,14 @@ class info_testcase extends \advanced_testcase {
$u1 = $generator->create_user();
$u2 = $generator->create_user();
$u3 = $generator->create_user();
$studentroleid = $DB->get_field('role', 'id', array('shortname' => 'student'), MUST_EXIST);
$allusers = array($u1->id => $u1, $u2->id => $u2, $u3->id => $u3);
$generator->enrol_user($u1->id, $course->id, $studentroleid);
$generator->enrol_user($u2->id, $course->id, $studentroleid);
$generator->enrol_user($u3->id, $course->id, $studentroleid);
// Page 2 allows access to users 2 and 3, while section 2 allows access
// to users 1 and 2.
$pagegen = $generator->get_plugin_generator('mod_page');
$page = $pagegen->create_instance(array('course' => $course));
$page2 = $pagegen->create_instance(array('course' => $course,
@@ -477,5 +484,19 @@ class info_testcase extends \advanced_testcase {
$info = new info_module($modinfo->get_cm($page2->cmid));
$this->assertEquals(array($u2->id),
array_keys($info->filter_user_list($allusers)));
// If the students have viewhiddenactivities, they get past the module
// restriction.
role_change_permission($studentroleid, context_module::instance($page2->cmid),
'moodle/course:viewhiddenactivities', CAP_ALLOW);
$expected = array($u1->id, $u2->id);
$this->assertEquals($expected, array_keys($info->filter_user_list($allusers)));
// If they have viewhiddensections, they also get past the section
// restriction.
role_change_permission($studentroleid, context_course::instance($course->id),
'moodle/course:viewhiddensections', CAP_ALLOW);
$expected = array($u1->id, $u2->id, $u3->id);
$this->assertEquals($expected, array_keys($info->filter_user_list($allusers)));
}
}
@@ -66,7 +66,7 @@ abstract class backup_factory {
// Create database_logger, observing $CFG->backup_database_logger_level and defaulting to LOG_WARNING
// and pointing to the backup_logs table
$dllevel = isset($CFG->backup_database_logger_level) ? $CFG->backup_database_logger_level : backup::LOG_WARNING;
$dllevel = isset($CFG->backup_database_logger_level) ? $CFG->backup_database_logger_level : $dfltloglevel;
$columns = array('backupid' => $backupid);
$enabledloggers[] = new database_logger($dllevel, 'timecreated', 'loglevel', 'message', 'backup_logs', $columns);
@@ -33,6 +33,19 @@ require_once($CFG->dirroot . '/backup/util/helper/backup_cron_helper.class.php')
*/
class backup_cron_helper_testcase extends advanced_testcase {
/**
* @var String keep system default timezone.
*/
protected $systemdefaulttimezone;
/**
* Setup.
*/
protected function setUp() {
parent::setUp();
$this->systemdefaulttimezone = date_default_timezone_get();
}
/**
* Test {@link backup_cron_automated_helper::calculate_next_automated_backup}.
*/
@@ -457,4 +470,12 @@ class backup_cron_helper_testcase extends advanced_testcase {
$this->assertEquals($expected, date('w-H:i', $next));
}
/**
* Set timezone back to default.
*/
protected function tearDown() {
date_default_timezone_set($this->systemdefaulttimezone);
parent::tearDown();
}
}
@@ -34,6 +34,6 @@ Feature: Duplicate activities
| Name | Duplicated database name |
| Description | Duplicated database description |
And I press "Save and return to course"
Then I should see "Original database name" in the "#section-1" "css_element"
And I should see "Duplicated database name" in the "#section-1" "css_element"
Then I should see "Original database name" in the "Topic 1" "section"
And I should see "Duplicated database name" in the "Topic 1" "section"
And "Original database name" "link" should appear before "Duplicated database name" "link"
@@ -129,5 +129,5 @@ Feature: Restore Moodle 2 course backups
And section "3" should be hidden
And section "7" should be hidden
And section "15" should be visible
And I should see "Test URL name" in the "#section-3" "css_element"
And I should see "Test forum name" in the "#section-1" "css_element"
And I should see "Test URL name" in the "Topic 3" "section"
And I should see "Test forum name" in the "Topic 1" "section"
+1 -1
View File
@@ -49,7 +49,7 @@ $assertion = filter_input(
// Audience is the site url scheme + host + port only.
$wwwparts = parse_url($CFG->wwwroot);
$audience = $wwwparts['scheme'] . '://' . $wwwparts['host'];
$audience .= isset($wwwparts['port']) ? $wwwparts['port'] : '';
$audience .= isset($wwwparts['port']) ? ':' . $wwwparts['port'] : '';
$params = 'assertion=' . urlencode($assertion) . '&audience=' .
urlencode($audience);
+5 -6
View File
@@ -26,6 +26,7 @@
require_once(dirname(dirname(__FILE__)) . '/config.php');
require_once($CFG->libdir . '/badgeslib.php');
require_once($CFG->libdir . '/filelib.php');
$id = required_param('hash', PARAM_ALPHANUM);
$bake = optional_param('bake', 0, PARAM_BOOL);
@@ -37,12 +38,10 @@ $badge = new issued_badge($id);
if ($bake && ($badge->recipient->id == $USER->id)) {
$name = str_replace(' ', '_', $badge->badgeclass['name']) . '.png';
ob_start();
$file = badges_bake($id, $badge->badgeid);
header('Content-Type: image/png');
header('Content-Disposition: attachment; filename="'. $name .'"');
readfile($file);
ob_flush();
$filehash = badges_bake($id, $badge->badgeid, $USER->id, true);
$fs = get_file_storage();
$file = $fs->get_file_by_hash($filehash);
send_stored_file($file, 0, 0, true, array('filename' => $name));
}
$PAGE->set_url('/badges/badge.php', array('hash' => $id));
+5 -8
View File
@@ -26,6 +26,7 @@
require_once(dirname(dirname(__FILE__)) . '/config.php');
require_once($CFG->libdir . '/badgeslib.php');
require_once($CFG->libdir . '/filelib.php');
$page = optional_param('page', 0, PARAM_INT);
$search = optional_param('search', '', PARAM_CLEAN);
@@ -71,17 +72,13 @@ if ($hide) {
require_sesskey();
$badge = new badge($download);
$name = str_replace(' ', '_', $badge->name) . '.png';
ob_start();
$file = badges_bake($hash, $download);
header('Content-Type: image/png');
header('Content-Disposition: attachment; filename="'. $name .'"');
readfile($file);
ob_flush();
$filehash = badges_bake($hash, $download, $USER->id, true);
$fs = get_file_storage();
$file = $fs->get_file_by_hash($filehash);
send_stored_file($file, 0, 0, true, array('filename' => $name));
} else if ($downloadall) {
require_sesskey();
ob_start();
badges_download($USER->id);
ob_flush();
}
$context = context_user::instance($USER->id);
+89
View File
@@ -180,6 +180,95 @@ class core_badges_badgeslib_testcase extends advanced_testcase {
$this->assertCount(2, $badge->get_awards());
}
/**
* Test the {@link badges_get_user_badges()} function in lib/badgeslib.php
*/
public function test_badges_get_user_badges() {
global $DB;
// Messaging is not compatible with transactions.
$this->preventResetByRollback();
$badges = array();
$user1 = $this->getDataGenerator()->create_user();
$user2 = $this->getDataGenerator()->create_user();
// Record the current time, we need to be precise about a couple of things.
$now = time();
// Create 11 badges with which to test.
for ($i = 1; $i <= 11; $i++) {
// Mock up a badge.
$badge = new stdClass();
$badge->id = null;
$badge->name = "Test badge $i";
$badge->description = "Testing badges $i";
$badge->timecreated = $now - 12;
$badge->timemodified = $now - 12;
$badge->usercreated = $user1->id;
$badge->usermodified = $user1->id;
$badge->issuername = "Test issuer";
$badge->issuerurl = "http://issuer-url.domain.co.nz";
$badge->issuercontact = "issuer@example.com";
$badge->expiredate = null;
$badge->expireperiod = null;
$badge->type = BADGE_TYPE_SITE;
$badge->courseid = null;
$badge->messagesubject = "Test message subject for badge $i";
$badge->message = "Test message body for badge $i";
$badge->attachment = 1;
$badge->notification = 0;
$badge->status = BADGE_STATUS_INACTIVE;
$badgeid = $DB->insert_record('badge', $badge, true);
$badges[$badgeid] = new badge($badgeid);
$badges[$badgeid]->issue($user2->id, true);
// Check it all actually worked.
$this->assertCount(1, $badges[$badgeid]->get_awards());
// Hack the database to adjust the time each badge was issued.
// The alternative to this is sleep which is a no-no in unit tests.
$DB->set_field('badge_issued', 'dateissued', $now - 11 + $i, array('userid' => $user2->id, 'badgeid' => $badgeid));
}
// Make sure the first user has no badges.
$result = badges_get_user_badges($user1->id);
$this->assertInternalType('array', $result);
$this->assertCount(0, $result);
// Check that the second user has the expected 11 badges.
$result = badges_get_user_badges($user2->id);
$this->assertCount(11, $result);
// Test pagination.
// Ordering is by time issued desc, so things will come out with the last awarded badge first.
$result = badges_get_user_badges($user2->id, 0, 0, 4);
$this->assertCount(4, $result);
$lastbadgeissued = reset($result);
$this->assertSame('Test badge 11', $lastbadgeissued->name);
// Page 2. Expecting 4 results again.
$result = badges_get_user_badges($user2->id, 0, 1, 4);
$this->assertCount(4, $result);
$lastbadgeissued = reset($result);
$this->assertSame('Test badge 7', $lastbadgeissued->name);
// Page 3. Expecting just three results here.
$result = badges_get_user_badges($user2->id, 0, 2, 4);
$this->assertCount(3, $result);
$lastbadgeissued = reset($result);
$this->assertSame('Test badge 3', $lastbadgeissued->name);
// Page 4.... there is no page 4.
$result = badges_get_user_badges($user2->id, 0, 3, 4);
$this->assertCount(0, $result);
// Test search.
$result = badges_get_user_badges($user2->id, 0, 0, 0, 'badge 1');
$this->assertCount(3, $result);
$lastbadgeissued = reset($result);
$this->assertSame('Test badge 11', $lastbadgeissued->name);
// The term Totara doesn't appear anywhere in the badges.
$result = badges_get_user_badges($user2->id, 0, 0, 0, 'Totara');
$this->assertCount(0, $result);
}
public function data_for_message_from_template() {
return array(
array(
+1 -2
View File
@@ -212,8 +212,7 @@ Feature: Award badges
And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
And I press "Create badge"
And I set the field "type" to "Course completion"
And I set the following fields to these values:
| grade_2 | 0 |
And I set the field with xpath "//fieldset/input[1]" to "0"
And I press "Save"
And I press "Enable access"
When I press "Continue"
@@ -25,7 +25,7 @@
$string['activityoverview'] = 'You have {$a}s that need attention';
$string['alwaysshowall'] = 'Always show all';
$string['collapseall'] = 'Collapse all course lists';
$string['configotherexpanded'] = 'If enabled, other courses will be expanded by default unless overriden by user preferences.';
$string['configotherexpanded'] = 'If enabled, other courses will be expanded by default unless overridden by user preferences.';
$string['configpreservestates'] = 'If enabled, the collapsed/expanded states set by the user are stored and used on each load.';
$string['course_overview:addinstance'] = 'Add a new course overview block';
$string['course_overview:myaddinstance'] = 'Add a new course overview block to My home';
+15 -3
View File
@@ -584,9 +584,21 @@ class block_base {
&& $page->context->contextlevel == CONTEXT_USER // Page belongs to a user
&& $page->context->instanceid == $USER->id // Page belongs to this user
&& $page->pagetype == 'my-index') { // Ensure we are on the My Moodle page
$capability = 'block/' . $this->name() . ':myaddinstance';
return $this->has_add_block_capability($page, $capability)
&& has_capability('moodle/my:manageblocks', $page->context);
// If the block cannot be displayed on /my it is ok if the myaddinstance capability is not defined.
$formats = $this->applicable_formats();
// Is 'my' explicitly forbidden?
// If 'all' has not been allowed, has 'my' been explicitly allowed?
if ((isset($formats['my']) && $formats['my'] == false)
|| (empty($formats['all']) && empty($formats['my']))) {
// Block cannot be added to /my regardless of capabilities.
return false;
} else {
$capability = 'block/' . $this->name() . ':myaddinstance';
return $this->has_add_block_capability($page, $capability)
&& has_capability('moodle/my:manageblocks', $page->context);
}
}
$capability = 'block/' . $this->name() . ':addinstance';
@@ -56,3 +56,16 @@ Feature: Add and configure blocks throughout the site
And I follow "Course 1"
And I follow "Turn editing on"
Then I should see "Assign roles in Search forums block"
@javascript
Scenario: Blocks can safely be customised
Given I log in as "admin"
And I click on "My home" "link" in the "Navigation" "block"
And I press "Customise this page"
And I add the "HTML" block
And I configure the "(new HTML block)" block
And I set the following fields to these values:
| Block title | Foo " onload="document.getElementsByTagName('body')[0].remove()" alt="
| Content | Example
When I press "Save changes"
Then I should see "Course overview"
@@ -0,0 +1,49 @@
@core @core_block
Feature: Show hidden blocks in a docked block region when editing
In order to edit blocks in a hidden region
As a teacher
I need to be able to see the blocks when editing is on
Background:
Given the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And the following "course enrolments" exist:
| user | course | role |
| admin | C1 | editingteacher |
And I log in as "admin"
And I follow "Course 1"
And I turn editing mode on
# Hide all the blocks in the non-default region
And I configure the "Search forums" block
And I set the following fields to these values:
| Visible | No |
And I click on "Save changes" "button"
And I configure the "Latest news" block
And I set the following fields to these values:
| Visible | No |
And I click on "Save changes" "button"
And I configure the "Upcoming events" block
And I set the following fields to these values:
| Visible | No |
And I click on "Save changes" "button"
And I configure the "Recent activity" block
And I set the following fields to these values:
| Visible | No |
When I click on "Save changes" "button"
# Editing is on so they should be visible
Then I should see "Search forums"
And I should see "Latest news"
And I should see "Upcoming events"
And I should see "Recent activity"
And I turn editing mode off
# Editing is off, so they should no longer be visible
And I should not see "Search forums"
And I should not see "Latest news"
And I should not see "Upcoming events"
And I should not see "Recent activity"
@javascript
Scenario: Check that a region with only hidden blocks is not docked in editing mode (javascript enabled)
Scenario: Check that a region with only hidden blocks is not docked in editing mode (javascript disabled)
+28
View File
@@ -0,0 +1,28 @@
@core @core_block
Feature: Block visibility
In order to configure blocks visibility
As a teacher
I need to show and hide blocks on a page
Background:
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And I log in as "admin"
And I am on homepage
And I follow "Course 1"
And I follow "Turn editing on"
@javascript
Scenario: Hiding all blocks on the page should remove the column they're in
Given I open the "Search forums" blocks action menu
And I click on "Hide Search forums block" "link" in the "Search forums" "block"
And I open the "Latest news" blocks action menu
And I click on "Hide Latest news block" "link" in the "Latest news" "block"
And I open the "Upcoming events" blocks action menu
And I click on "Hide Upcoming events block" "link" in the "Upcoming events" "block"
And I open the "Recent activity" blocks action menu
When I click on "Hide Recent activity block" "link" in the "Recent activity" "block"
Then ".empty-region-side-post" "css_element" should not exist in the "body" "css_element"
And I follow "Turn editing off"
And ".empty-region-side-post" "css_element" should exist in the "body" "css_element"
+3 -2
View File
@@ -991,7 +991,7 @@ function calendar_filter_controls_element(moodle_url $url, $type) {
$str = get_string('show'.$typeforhumans.'events', 'calendar');
}
$content = html_writer::start_tag('li', array('class' => 'calendar_event'));
$content .= html_writer::start_tag('a', array('href' => $url));
$content .= html_writer::start_tag('a', array('href' => $url, 'rel' => 'nofollow'));
$content .= html_writer::tag('span', $icon, array('class' => $class));
$content .= html_writer::tag('span', $str, array('class' => 'eventname'));
$content .= html_writer::end_tag('a');
@@ -2953,11 +2953,12 @@ function calendar_add_icalendar_event($event, $courseid, $subscriptionid, $timez
$description = '';
} else {
$description = $event->properties['DESCRIPTION'][0]->value;
$description = clean_param($description, PARAM_NOTAGS);
$description = str_replace('\n', '<br />', $description);
$description = str_replace('\\', '', $description);
$description = preg_replace('/\s+/', ' ', $description);
}
$eventrecord->description = clean_param($description, PARAM_NOTAGS);
$eventrecord->description = $description;
// Probably a repeating event with RRULE etc. TODO: skip for now.
if (empty($event->properties['DTSTART'][0]->value)) {
+1 -1
View File
@@ -8,6 +8,6 @@
"require-dev": {
"phpunit/phpunit": "3.7.*",
"phpunit/dbUnit": "1.2.*",
"moodlehq/behat-extension": "1.27.12"
"moodlehq/behat-extension": "1.27.13"
}
}
+2 -2
View File
@@ -242,7 +242,7 @@ $CFG->admin = 'admin';
// $CFG->session_memcached_save_path = '127.0.0.1:11211';
// $CFG->session_memcached_prefix = 'memc.sess.key.';
// $CFG->session_memcached_acquire_lock_timeout = 120;
// $CFG->session_memcached_lock_expire = 7200; // Ignored if memcached extension <= 2.1.0
// $CFG->session_memcached_lock_expire = 7200; // Ignored if PECL memcached is below version 2.2.0
//
// Memcache session handler (requires memcached server and memcache extension):
// $CFG->session_handler_class = '\core\session\memcache';
@@ -507,7 +507,7 @@ $CFG->admin = 'admin';
// Uses lock files stored by default in the dataroot. Whether this
// works on clusters depends on the file system used for the dataroot.
//
// "\\core\\lock\\db_row_lock_factory" - DB locking based on table rows.
// "\\core\\lock\\db_record_lock_factory" - DB locking based on table rows.
//
// "\\core\\lock\\postgres_lock_factory" - DB locking based on postgres advisory locks.
//
+12 -6
View File
@@ -77,11 +77,14 @@ class core_course_external extends external_api {
//retrieve the course
$course = $DB->get_record('course', array('id' => $params['courseid']), '*', MUST_EXIST);
//check course format exist
if (!file_exists($CFG->dirroot . '/course/format/' . $course->format . '/lib.php')) {
throw new moodle_exception('cannotgetcoursecontents', 'webservice', '', null, get_string('courseformatnotfound', 'error', '', $course->format));
} else {
require_once($CFG->dirroot . '/course/format/' . $course->format . '/lib.php');
if ($course->id != SITEID) {
// Check course format exist.
if (!file_exists($CFG->dirroot . '/course/format/' . $course->format . '/lib.php')) {
throw new moodle_exception('cannotgetcoursecontents', 'webservice', '', null,
get_string('courseformatnotfound', 'error', $course->format));
} else {
require_once($CFG->dirroot . '/course/format/' . $course->format . '/lib.php');
}
}
// now security checks
@@ -217,6 +220,7 @@ class core_course_external extends external_api {
'id' => new external_value(PARAM_INT, 'activity id'),
'url' => new external_value(PARAM_URL, 'activity url', VALUE_OPTIONAL),
'name' => new external_value(PARAM_RAW, 'activity module name'),
'instance' => new external_value(PARAM_INT, 'instance id', VALUE_OPTIONAL),
'description' => new external_value(PARAM_RAW, 'activity description', VALUE_OPTIONAL),
'visible' => new external_value(PARAM_INT, 'is the module visible', VALUE_OPTIONAL),
'modicon' => new external_value(PARAM_URL, 'activity icon url'),
@@ -849,6 +853,7 @@ class core_course_external extends external_api {
// Check if the current user has enought permissions.
if (!can_delete_course($courseid)) {
fix_course_sortorder();
throw new moodle_exception('cannotdeletecategorycourse', 'error',
'', format_string($course->fullname)." (id: $courseid)");
}
@@ -857,6 +862,7 @@ class core_course_external extends external_api {
}
$transaction->allow_commit();
fix_course_sortorder();
return null;
}
@@ -1028,7 +1034,7 @@ class core_course_external extends external_api {
// Check if we need to unzip the file because the backup temp dir does not contains backup files.
if (!file_exists($backupbasepath . "/moodle_backup.xml")) {
$file->extract_to_pathname(get_file_packer(), $backupbasepath);
$file->extract_to_pathname(get_file_packer('application/vnd.moodle.backup'), $backupbasepath);
}
// Create new course.
+6 -2
View File
@@ -473,7 +473,9 @@ class behat_course extends behat_base {
// The activity should not be dimmed.
try {
$this->find('css', 'a.dimmed', false, $activitynode);
$xpath = "/descendant-or-self::a[contains(concat(' ', normalize-space(@class), ' '), ' dimmed ')] | ".
"/descendant-or-self::div[contains(concat(' ', normalize-space(@class), ' '), ' dimmed_text ')]";
$this->find('xpath', $xpath, false, $activitynode);
throw new ExpectationException('"' . $activityname . '" is hidden', $this->getSession());
} catch (ElementNotFoundException $e) {
// All ok.
@@ -501,7 +503,9 @@ class behat_course extends behat_base {
// Should be hidden.
$exception = new ExpectationException('"' . $activityname . '" is not dimmed', $this->getSession());
$this->find('css', 'a.dimmed', $exception, $activitynode);
$xpath = "/descendant-or-self::a[contains(concat(' ', normalize-space(@class), ' '), ' dimmed ')] | ".
"/descendant-or-self::div[contains(concat(' ', normalize-space(@class), ' '), ' dimmed_text ')]";
$this->find('xpath', $xpath, $exception, $activitynode);
// Also 'Show' icon.
$noshowexception = new ExpectationException('"' . $activityname . '" don\'t have a "' . get_string('show') . '" icon', $this->getSession());
+35 -35
View File
@@ -42,18 +42,18 @@ Feature: Course activity controls works as expected
And I click on "Actions" "link" in the "Recent activity" "block"
And I click on "Delete Recent activity block" "link"
And I press "Yes"
And "#section-2" "css_element" <should_see_other_sections> exist
And <belowpage> "section" <should_see_other_sections> exist
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name 1 |
| Description | Test forum description 1 |
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name 2 |
| Description | Test forum description 2 |
And "#section-2" "css_element" <should_see_other_sections> exist
And <belowpage> "section" <should_see_other_sections> exist
And I indent right "Test forum name 1" activity
And "#section-2" "css_element" <should_see_other_sections> exist
And <belowpage> "section" <should_see_other_sections> exist
And I indent left "Test forum name 1" activity
And "#section-2" "css_element" <should_see_other_sections> exist
And <belowpage> "section" <should_see_other_sections> exist
And I open "Test forum name 1" actions menu
And I click on "Edit settings" "link" in the "Test forum name 1" activity
And I should see "Updating Forum"
@@ -63,38 +63,38 @@ Feature: Course activity controls works as expected
| Description | Just to check that I can edit the description |
| Display description on course page | 1 |
And I click on "Cancel" "button"
And "#section-2" "css_element" <should_see_other_sections> exist
And <belowpage> "section" <should_see_other_sections> exist
And I open "Test forum name 1" actions menu
And I click on "Hide" "link" in the "Test forum name 1" activity
And "#section-2" "css_element" <should_see_other_sections> exist
And <belowpage> "section" <should_see_other_sections> exist
And I delete "Test forum name 1" activity
And I should not see "Test forum name 1" in the "#region-main" "css_element"
And I duplicate "Test forum name 2" activity editing the new copy with:
| Forum name | Edited test forum name 2 |
And "#section-2" "css_element" <should_see_other_sections> exist
And <belowpage> "section" <should_see_other_sections> exist
And I should see "Test forum name 2"
And I should see "Edited test forum name 2"
And I hide section "1"
And "#section-2" "css_element" <should_see_other_sections> exist
And <belowpage> "section" <should_see_other_sections> exist
And section "1" should be hidden
And all activities in section "1" should be hidden
And I show section "1"
And "#section-2" "css_element" <should_see_other_sections> exist
And <belowpage> "section" <should_see_other_sections> exist
And section "1" should be visible
And I add the "Section links" block
And "#section-2" "css_element" <should_see_other_sections> exist
And <belowpage> "section" <should_see_other_sections> exist
And I should see "1 2 3 4 5" in the "Section links" "block"
And I click on "2" "link" in the "Section links" "block"
And I <should_see_other_sections_following_block_sections_links> see "Test forum name 2"
Examples:
| courseformat | coursedisplay | targetpage | should_see_other_sections | should_see_other_sections_following_block_sections_links |
| topics | 0 | "Course 1" | should | should |
| topics | 1 | "Topic 1" | should not | should not |
| topics | 1 | "Course 1" | should | should not |
| weeks | 0 | "Course 1" | should | should |
| weeks | 1 | "1 January - 7 January" | should not | should not |
| weeks | 1 | "Course 1" | should | should not |
| courseformat | coursedisplay | targetpage | should_see_other_sections | should_see_other_sections_following_block_sections_links | belowpage |
| topics | 0 | "Course 1" | should | should | "Topic 2" |
| topics | 1 | "Topic 1" | should not | should not | "Topic 2" |
| topics | 1 | "Course 1" | should | should not | "Topic 2" |
| weeks | 0 | "Course 1" | should | should | "8 January - 14 January" |
| weeks | 1 | "1 January - 7 January" | should not | should not | "8 January - 14 January" |
| weeks | 1 | "Course 1" | should | should not | "8 January - 14 January" |
Scenario Outline: General activities course controls using topics and weeks formats, and paged mode and not paged mode works as expected
Given the following "users" exist:
@@ -122,51 +122,51 @@ Feature: Course activity controls works as expected
And I click on "Actions" "link" in the "Recent activity" "block"
And I click on "Delete Recent activity block" "link"
And I press "Yes"
And "#section-2" "css_element" <should_see_other_sections> exist
And <belowpage> "section" <should_see_other_sections> exist
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name 1 |
| Description | Test forum description 1 |
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name 2 |
| Description | Test forum description 2 |
And "#section-2" "css_element" <should_see_other_sections> exist
And <belowpage> "section" <should_see_other_sections> exist
And I indent right "Test forum name 1" activity
And "#section-2" "css_element" <should_see_other_sections> exist
And <belowpage> "section" <should_see_other_sections> exist
And I indent left "Test forum name 1" activity
And "#section-2" "css_element" <should_see_other_sections> exist
And <belowpage> "section" <should_see_other_sections> exist
And I click on "Edit settings" "link" in the "Test forum name 1" activity
And I should see "Updating Forum"
And I should see "Display description on course page"
And I press "Save and return to course"
And "#section-2" "css_element" <should_see_other_sections> exist
And <belowpage> "section" <should_see_other_sections> exist
And I click on "Hide" "link" in the "Test forum name 1" activity
And "#section-2" "css_element" <should_see_other_sections> exist
And <belowpage> "section" <should_see_other_sections> exist
And I delete "Test forum name 1" activity
And "#section-2" "css_element" <should_see_other_sections> exist
And <belowpage> "section" <should_see_other_sections> exist
And I should not see "Test forum name 1" in the "#region-main" "css_element"
And I duplicate "Test forum name 2" activity editing the new copy with:
| Forum name | Edited test forum name 2 |
And "#section-2" "css_element" <should_see_other_sections> exist
And <belowpage> "section" <should_see_other_sections> exist
And I should see "Test forum name 2"
And I should see "Edited test forum name 2"
And I hide section "1"
And "#section-2" "css_element" <should_see_other_sections> exist
And <belowpage> "section" <should_see_other_sections> exist
And section "1" should be hidden
And all activities in section "1" should be hidden
And I show section "1"
And "#section-2" "css_element" <should_see_other_sections> exist
And <belowpage> "section" <should_see_other_sections> exist
And section "1" should be visible
And I add the "Section links" block
And "#section-2" "css_element" <should_see_other_sections> exist
And <belowpage> "section" <should_see_other_sections> exist
And I should see "1 2 3 4 5" in the "Section links" "block"
And I click on "2" "link" in the "Section links" "block"
And I <should_see_other_sections_following_block_sections_links> see "Test forum name 2"
Examples:
| courseformat | coursedisplay | targetpage | should_see_other_sections | should_see_other_sections_following_block_sections_links |
| topics | 0 | "Course 1" | should | should |
| topics | 1 | "Topic 1" | should not | should not |
| topics | 1 | "Course 1" | should | should not |
| weeks | 0 | "Course 1" | should | should |
| weeks | 1 | "1 January - 7 January" | should not | should not |
| weeks | 1 | "Course 1" | should | should not |
| courseformat | coursedisplay | targetpage | should_see_other_sections | should_see_other_sections_following_block_sections_links | belowpage |
| topics | 0 | "Course 1" | should | should | "Topic 2" |
| topics | 1 | "Topic 1" | should not | should not | "Topic 2" |
| topics | 1 | "Course 1" | should | should not | "Topic 2" |
| weeks | 0 | "Course 1" | should | should | "8 January - 14 January" |
| weeks | 1 | "1 January - 7 January" | should not | should not | "8 January - 14 January" |
| weeks | 1 | "Course 1" | should | should not | "8 January - 14 January" |
+4 -4
View File
@@ -29,8 +29,8 @@ Feature: Activities can be moved between sections
Scenario: Move activities in a single page course with Javascript disabled
When I move "Test forum name" activity to section "2"
Then I should see "Test forum name" in the "#section-2" "css_element"
And I should not see "Test forum name" in the "#section-1" "css_element"
Then I should see "Test forum name" in the "Topic 2" "section"
And I should not see "Test forum name" in the "Topic 1" "section"
Scenario: Move activities in the course home with Javascript disabled using paged mode
Given I click on "Edit settings" "link" in the "Administration" "block"
@@ -38,8 +38,8 @@ Feature: Activities can be moved between sections
| Course layout | Show one section per page |
And I press "Save changes"
When I move "Test forum name" activity to section "2"
Then I should see "Test forum name" in the "#section-2" "css_element"
And I should not see "Test forum name" in the "#section-1" "css_element"
Then I should see "Test forum name" in the "Topic 2" "section"
And I should not see "Test forum name" in the "Topic 1" "section"
Scenario: Move activities in a course section with Javascript disabled using paged mode
Given I click on "Edit settings" "link" in the "Administration" "block"
+6 -6
View File
@@ -23,9 +23,9 @@ Feature: Sections can be moved
| Forum name | Test forum name |
| Description | Test forum description |
When I move down section "1"
Then I should see "Test forum name" in the "#section-2" "css_element"
Then I should see "Test forum name" in the "Topic 2" "section"
And I move up section "2"
And I should see "Test forum name" in the "#section-1" "css_element"
And I should see "Test forum name" in the "Topic 1" "section"
Scenario: Move up and down a section with Javascript disabled in the course home of a course using paged mode
Given I click on "Edit settings" "link" in the "Administration" "block"
@@ -36,9 +36,9 @@ Feature: Sections can be moved
| Forum name | Test forum name |
| Description | Test forum description |
When I move down section "1"
Then I should see "Test forum name" in the "#section-2" "css_element"
Then I should see "Test forum name" in the "Topic 2" "section"
And I move up section "2"
And I should see "Test forum name" in the "#section-1" "css_element"
And I should see "Test forum name" in the "Topic 1" "section"
Scenario: Sections can not be moved with Javascript disabled in a section page of a course using paged mode
Given I click on "Edit settings" "link" in the "Administration" "block"
@@ -49,7 +49,7 @@ Feature: Sections can be moved
| Forum name | Test forum name |
| Description | Test forum description |
When I follow "Topic 2"
Then "#section-1" "css_element" should not exist
And "#section-3" "css_element" should not exist
Then "Topic 1" "section" should not exist
And "Topic 3" "section" should not exist
And "Move down" "link" should not exist
And "Move up" "link" should not exist
@@ -11,11 +11,11 @@ Feature: Course paged mode
| Course 1 | C1 | 0 | <courseformat> | 1 | 3 |
And I log in as "admin"
And I follow "Course 1"
Then I click on <section2> "link" in the "#section-2" "css_element"
Then I click on <section2> "link" in the <section2> "section"
And I follow "C1"
And I click on <section3> "link" in the "#section-3" "css_element"
And I click on <section3> "link" in the <section3> "section"
And I follow "C1"
And I click on <section1> "link" in the "#section-1" "css_element"
And I click on <section1> "link" in the <section1> "section"
And I should see <section1> in the "div.single-section" "css_element"
And I should see <section2> in the ".single-section span.mdl-right" "css_element"
And I should not see <prevunexistingsection> in the ".single-section" "css_element"
@@ -44,11 +44,11 @@ Feature: Course paged mode
| Course 1 | C1 | 0 | <courseformat> | 1 | 3 |
And I log in as "admin"
And I follow "Course 1"
Then I click on <section2> "link" in the "#section-2" "css_element"
Then I click on <section2> "link" in the <section2> "section"
And I follow "C1"
And I click on <section3> "link" in the "#section-3" "css_element"
And I click on <section3> "link" in the <section3> "section"
And I follow "C1"
And I click on <section1> "link" in the "#section-1" "css_element"
And I click on <section1> "link" in the <section1> "section"
And I should see <section1> in the "div.single-section" "css_element"
And I should see <section2> in the ".single-section span.mdl-right" "css_element"
And I should not see <prevunexistingsection> in the ".single-section" "css_element"
+1 -1
View File
@@ -1731,7 +1731,7 @@ class core_course_courselib_testcase extends advanced_testcase {
$bc->execute_plan();
$results = $bc->get_results();
$file = $results['backup_destination'];
$fp = get_file_packer();
$fp = get_file_packer('application/vnd.moodle.backup');
$filepath = $CFG->dataroot . '/temp/backup/test-restore-course-event';
$file->extract_to_pathname($fp, $filepath);
$bc->destroy();
+2
View File
@@ -611,12 +611,14 @@ class core_course_externallib_testcase extends externallib_advanced_testcase {
$formattedtext = format_text($cm->content, FORMAT_HTML,
array('noclean' => true, 'para' => false, 'filter' => false));
$this->assertEquals($formattedtext, $module['description']);
$this->assertEquals($forumcm->instance, $module['instance']);
$testexecuted = $testexecuted + 1;
} else if ($module['id'] == $labelcm->id and $module['modname'] == 'label') {
$cm = $modinfo->cms[$labelcm->id];
$formattedtext = format_text($cm->content, FORMAT_HTML,
array('noclean' => true, 'para' => false, 'filter' => false));
$this->assertEquals($formattedtext, $module['description']);
$this->assertEquals($labelcm->instance, $module['instance']);
$testexecuted = $testexecuted + 1;
}
}
+2 -2
View File
@@ -240,8 +240,8 @@ foreach ($instances as $instance) {
}
}
// add a row to the table
$table->data[] = array($displayname, $users, implode('&nbsp;', $updown), implode('&nbsp;', $edit));
// Add a row to the table.
$table->data[] = array($displayname, $users, implode('', $updown), implode('', $edit));
}
echo html_writer::table($table);
+1 -1
View File
@@ -894,7 +894,7 @@ class course_enrolment_manager {
$args['search'] = $this->searchfilter;
}
if (!empty($this->groupfilter)) {
$args['group'] = $this->groupfilter;
$args['filtergroup'] = $this->groupfilter;
}
if ($this->statusfilter !== -1) {
$args['status'] = $this->statusfilter;
+1 -1
View File
@@ -251,7 +251,7 @@ if (strlen($result) > 0) {
$eventdata->modulename = 'moodle';
$eventdata->component = 'enrol_paypal';
$eventdata->name = 'paypal_enrolment';
$eventdata->userfrom = empty($teacher) ? get_admin() : $teacher;
$eventdata->userfrom = empty($teacher) ? core_user::get_support_user() : $teacher;
$eventdata->userto = $user;
$eventdata->subject = get_string("enrolmentnew", 'enrol', $shortname);
$eventdata->fullmessage = get_string('welcometocoursetext', '', $a);
+6 -2
View File
@@ -38,8 +38,10 @@ class enrol_self_edit_form extends moodleform {
$mform->addElement('header', 'header', get_string('pluginname', 'enrol_self'));
$mform->addElement('text', 'name', get_string('custominstancename', 'enrol'));
$nameattribs = array('size' => '20', 'maxlength' => '255');
$mform->addElement('text', 'name', get_string('custominstancename', 'enrol'), $nameattribs);
$mform->setType('name', PARAM_TEXT);
$mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'server');
$options = array(ENROL_INSTANCE_ENABLED => get_string('yes'),
ENROL_INSTANCE_DISABLED => get_string('no'));
@@ -51,11 +53,13 @@ class enrol_self_edit_form extends moodleform {
$mform->addHelpButton('customint6', 'newenrols', 'enrol_self');
$mform->disabledIf('customint6', 'status', 'eq', ENROL_INSTANCE_DISABLED);
$mform->addElement('passwordunmask', 'password', get_string('password', 'enrol_self'));
$passattribs = array('size' => '20', 'maxlength' => '50');
$mform->addElement('passwordunmask', 'password', get_string('password', 'enrol_self'), $passattribs);
$mform->addHelpButton('password', 'password', 'enrol_self');
if (empty($instance->id) and $plugin->get_config('requirepassword')) {
$mform->addRule('password', get_string('required'), 'required', null, 'client');
}
$mform->addRule('password', get_string('maximumchars', '', 50), 'maxlength', 50, 'server');
$options = array(1 => get_string('yes'),
0 => get_string('no'));
+3 -1
View File
@@ -248,6 +248,8 @@ class enrol_self_plugin extends enrol_plugin {
$form->display();
$output = ob_get_clean();
return $OUTPUT->box($output);
} else {
return $OUTPUT->box($enrolstatus);
}
}
@@ -265,7 +267,7 @@ class enrol_self_plugin extends enrol_plugin {
if ($checkuserenrolment) {
if (isguestuser()) {
// Can not enrol guest.
return get_string('canntenrol', 'enrol_self');
return get_string('noguestaccess', 'enrol');
}
// Check if user is already enroled.
if ($DB->get_record('user_enrolments', array('userid' => $USER->id, 'enrolid' => $instance->id))) {
+1 -1
View File
@@ -602,7 +602,7 @@ class enrol_self_testcase extends advanced_testcase {
$selfplugin->enrol_user($instance1, $user2->id, $editingteacherrole->id);
$this->setUser($guest);
$this->assertSame($expectederrorstring, $selfplugin->can_self_enrol($instance1, true));
$this->assertSame(get_string('noguestaccess', 'enrol'), $selfplugin->can_self_enrol($instance1, true));
$this->setUser($user1);
$this->assertTrue($selfplugin->can_self_enrol($instance1, true));
+1 -1
View File
@@ -205,7 +205,7 @@ if (!has_capability('moodle/course:viewhiddenuserfields', $context)) {
$filterform = new enrol_users_filter_form('users.php', array('manager' => $manager, 'id' => $id),
'get', '', array('id' => 'filterform'));
$filterform->set_data(array('search' => $search, 'ifilter' => $filter, 'role' => $role));
$filterform->set_data(array('search' => $search, 'ifilter' => $filter, 'role' => $role, 'filtergroup' => $fgroup));
$table->set_fields($fields, $renderer);
+2 -1
View File
@@ -87,7 +87,8 @@ if (!$file = $fs->get_file_by_hash(sha1($fullpath))) {
if (strrpos($fullpath, '/') !== strlen($fullpath) -1 ) {
$fullpath .= '/';
}
if (!$file = $fs->get_file_by_hash(sha1($fullpath.'/.'))) {
// Try to fallback to the directory named as the supposed file.
if (!$file = $fs->get_file_by_hash(sha1($fullpath.'.'))) {
send_file_not_found();
}
}
+42
View File
@@ -44,5 +44,47 @@ function xmldb_filter_mathjaxloader_upgrade($oldversion) {
upgrade_plugin_savepoint(true, 2014051201, 'filter', 'mathjaxloader');
}
if ($oldversion < 2014051202) {
$oldconfig = get_config('filter_mathjaxloader', 'mathjaxconfig');
$olddefault = 'MathJax.Hub.Config({
config: ["MMLorHTML.js", "Safe.js"],
jax: ["input/TeX","input/MathML","output/HTML-CSS","output/NativeMML"],
extensions: ["tex2jax.js","mml2jax.js","MathMenu.js","MathZoom.js"],
TeX: {
extensions: ["AMSmath.js","AMSsymbols.js","noErrors.js","noUndefined.js"]
},
menuSettings: {
zoom: "Double-Click",
mpContext: true,
mpMouse: true
},
errorSettings: { message: ["!"] },
skipStartupTypeset: true,
messageStyle: "none"
});
';
$newdefault = '
MathJax.Hub.Config({
config: ["Accessible.js", "Safe.js"],
errorSettings: { message: ["!"] },
skipStartupTypeset: true,
messageStyle: "none"
});
';
// Ignore white space changes.
$oldconfig = trim(preg_replace('/\s+/', ' ', $oldconfig));
$olddefault = trim(preg_replace('/\s+/', ' ', $olddefault));
// Update the default config for mathjax only if it has not been customised.
if ($oldconfig == $olddefault) {
set_config('mathjaxconfig', $newdefault, 'filter_mathjaxloader');
}
upgrade_plugin_savepoint(true, 2014051202, 'filter', 'mathjaxloader');
}
return true;
}
+1 -1
View File
@@ -144,7 +144,7 @@ class filter_mathjaxloader extends moodle_text_filter {
$text = str_replace('[tex]', '\\(', $text);
$text = str_replace('[/tex]', '\\)', $text);
// E.g. "$$ blah $$".
$text = preg_replace('|\$\$[\S\s]\$\$|u', '\\(\1\\)', $text);
$text = preg_replace('|\$\$([\S\s]*?)\$\$|u', '\\(\1\\)', $text);
// E.g. "\[ blah \]".
$text = str_replace('\\[', '\\(', $text);
$text = str_replace('\\]', '\\)', $text);
+1 -11
View File
@@ -52,17 +52,7 @@ if ($ADMIN->fulltree) {
$default = '
MathJax.Hub.Config({
config: ["MMLorHTML.js", "Safe.js"],
jax: ["input/TeX","input/MathML","output/HTML-CSS","output/NativeMML"],
extensions: ["tex2jax.js","mml2jax.js","MathMenu.js","MathZoom.js"],
TeX: {
extensions: ["AMSmath.js","AMSsymbols.js","noErrors.js","noUndefined.js"]
},
menuSettings: {
zoom: "Double-Click",
mpContext: true,
mpMouse: true
},
config: ["Accessible.js", "Safe.js"],
errorSettings: { message: ["!"] },
skipStartupTypeset: true,
messageStyle: "none"
+1 -1
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2014051201;
$plugin->version = 2014051202;
$plugin->requires = 2014050800; // Requires this Moodle version
$plugin->component= 'filter_mathjaxloader';
+33 -3
View File
@@ -134,10 +134,9 @@ class filter_urltolink extends moodle_text_filter {
// Lookbehind assertions.
// Is not HTML attribute or CSS URL property. Unfortunately legit text like "url(http://...)" will not be a link.
$lookbehindstart = "(?<!=[\"']|\burl\([\"' ]|\burl\()";
$lookbehindend = "(?<![]),.;])";
$regex = "$lookbehindstart$urlstart((?:$domainsegment\.)+$domainsegment|$numericip)" .
$regex = "$urlstart((?:$domainsegment\.)+$domainsegment|$numericip)" .
"($port?$path$querystring?$fragment?)$lookbehindend";
if ($unicoderegexp) {
$regex = '#' . $regex . '#ui';
@@ -145,7 +144,38 @@ class filter_urltolink extends moodle_text_filter {
$regex = '#' . preg_replace(array('\pLl', '\PL'), 'a-z', $regex) . '#i';
}
$text = preg_replace($regex, '<a href="http$1://$2$3$4" class="_blanktarget">$0</a>', $text);
// Locate any HTML tags.
$matches = preg_split('/(<[^<|>]*>)/i', $text, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
// Iterate through the tokenized text to handle chunks (html and content).
foreach ($matches as $idx => $chunk) {
// Nothing to do. We skip completely any html chunk.
if (strpos(trim($chunk), '<') === 0) {
continue;
}
// Nothing to do. We skip any content chunk having any of these attributes.
if (preg_match('#(background=")|(action=")|(style="background)|(href=")|(src=")|(url [(])#', $chunk)) {
continue;
}
// Arrived here, we want to process every word in this chunk.
$text = $chunk;
$words = explode(' ', $text);
foreach ($words as $idx2 => $word) {
// ReDoS protection. Stop processing if a word is too large.
if (strlen($word) < 4096) {
$words[$idx2] = preg_replace($regex, '<a href="http$1://$2$3$4" class="_blanktarget">$0</a>', $word);
}
}
$text = implode(' ', $words);
// Copy the result back to the array.
$matches[$idx] = $text;
}
$text = implode('', $matches);
if (!empty($ignoretags)) {
$ignoretags = array_reverse($ignoretags); /// Reversed so "progressive" str_replace() will solve some nesting problems.
+27 -1
View File
@@ -29,9 +29,13 @@ global $CFG;
require_once($CFG->dirroot . '/filter/urltolink/filter.php'); // Include the code to test
class filter_urltolink_testcase extends basic_testcase {
class filter_urltolink_filter_testcase extends basic_testcase {
function get_convert_urls_into_links_test_cases() {
// Create a 4095 and 4096 long URLs.
$superlong4095 = str_pad('http://www.superlong4095.com?this=something', 4095, 'a');
$superlong4096 = str_pad('http://www.superlong4096.com?this=something', 4096, 'a');
$texts = array (
//just a url
'http://moodle.org - URL' => '<a href="http://moodle.org" class="_blanktarget">http://moodle.org</a> - URL',
@@ -130,6 +134,7 @@ class filter_urltolink_testcase extends basic_testcase {
'<td background="http://moodle.org">&nbsp;</td>' => '<td background="http://moodle.org">&nbsp;</td>',
'<td background="www.moodle.org">&nbsp;</td>' => '<td background="www.moodle.org">&nbsp;</td>',
'<form name="input" action="http://moodle.org/submit.asp" method="get">'=>'<form name="input" action="http://moodle.org/submit.asp" method="get">',
'<input type="submit" value="Go to http://moodle.org">' => '<input type="submit" value="Go to http://moodle.org">',
'<td background="https://www.moodle.org">&nbsp;</td>' => '<td background="https://www.moodle.org">&nbsp;</td>',
// CSS URLs.
'<table style="background-image: url(\'http://moodle.org/pic.jpg\');">' => '<table style="background-image: url(\'http://moodle.org/pic.jpg\');">',
@@ -148,6 +153,27 @@ class filter_urltolink_testcase extends basic_testcase {
//Encoded URLs in the query
'URL: http://127.0.0.1/path/to?param=value_with%28parenthesis%29&param2=1' => 'URL: <a href="http://127.0.0.1/path/to?param=value_with%28parenthesis%29&param2=1" class="_blanktarget">http://127.0.0.1/path/to?param=value_with%28parenthesis%29&param2=1</a>',
'URL: www.localhost.com/path/to?param=value_with%28parenthesis%29&param2=1' => 'URL: <a href="http://www.localhost.com/path/to?param=value_with%28parenthesis%29&param2=1" class="_blanktarget">www.localhost.com/path/to?param=value_with%28parenthesis%29&param2=1</a>',
// Test URL less than 4096 characters in size is converted to link.
'URL: ' . $superlong4095 => 'URL: <a href="' . $superlong4095 . '" class="_blanktarget">' . $superlong4095 . '</a>',
// Test URL equal to or greater than 4096 characters in size is not converted to link.
'URL: ' . $superlong4096 => 'URL: ' . $superlong4096,
// Testing URL within a span tag.
'URL: <span style="kasd"> my link to http://google.com </span>' => 'URL: <span style="kasd"> my link to <a href="http://google.com" class="_blanktarget">http://google.com</a> </span>',
// Nested tags test.
'<b><i>www.google.com</i></b>' => '<b><i><a href="http://www.google.com" class="_blanktarget">www.google.com</a></i></b>',
'<input type="submit" value="Go to http://moodle.org">' => '<input type="submit" value="Go to http://moodle.org">',
// Test realistic content.
'<p><span style="color: rgb(37, 37, 37); font-family: sans-serif; line-height: 22.3999996185303px;">Lorem ipsum amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut http://google.com aliquip ex ea <a href="http://google.com">commodo consequat</a>. Duis aute irure in reprehenderit in excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia https://docs.google.com/document/d/BrokenLinkPleaseAyacDHc_Ov8aoskoSVQsfmLHP_jYAkRMk/edit?usp=sharing https://docs.google.com/document/d/BrokenLinkPleaseAyacDHc_Ov8aoskoSVQsfmLHP_jYAkRMk/edit?usp=sharing mollit anim id est laborum.</span><br></p>'
=>
'<p><span style="color: rgb(37, 37, 37); font-family: sans-serif; line-height: 22.3999996185303px;">Lorem ipsum amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut <a href="http://google.com" class="_blanktarget">http://google.com</a> aliquip ex ea <a href="http://google.com">commodo consequat</a>. Duis aute irure in reprehenderit in excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia <a href="https://docs.google.com/document/d/BrokenLinkPleaseAyacDHc_Ov8aoskoSVQsfmLHP_jYAkRMk/edit?usp=sharing" class="_blanktarget">https://docs.google.com/document/d/BrokenLinkPleaseAyacDHc_Ov8aoskoSVQsfmLHP_jYAkRMk/edit?usp=sharing</a> <a href="https://docs.google.com/document/d/BrokenLinkPleaseAyacDHc_Ov8aoskoSVQsfmLHP_jYAkRMk/edit?usp=sharing" class="_blanktarget">https://docs.google.com/document/d/BrokenLinkPleaseAyacDHc_Ov8aoskoSVQsfmLHP_jYAkRMk/edit?usp=sharing</a> mollit anim id est laborum.</span><br></p>',
// Test some broken html.
'5 < 10 www.google.com <a href="hi.com">im a link</a>' => '5 < 10 <a href="http://www.google.com" class="_blanktarget">www.google.com</a> <a href="hi.com">im a link</a>',
'h3 (www.styles.com/h3) < h1 (www.styles.com/h1)' => 'h3 (<a href="http://www.styles.com/h3" class="_blanktarget">www.styles.com/h3</a>) < h1 (<a href="http://www.styles.com/h1" class="_blanktarget">www.styles.com/h1</a>)',
'<p>text www.moodle.org&lt;/p> text' => '<p>text <a href="http://www.moodle.org" class="_blanktarget">www.moodle.org</a>&lt;/p> text',
// Some more urls.
'<link rel="search" type="application/opensearchdescription+xml" href="/osd.jsp" title="Peer review - Moodle Tracker"/>' => '<link rel="search" type="application/opensearchdescription+xml" href="/osd.jsp" title="Peer review - Moodle Tracker"/>',
'<a href="https://docs.moodle.org/dev/Main_Page"></a><span>www.google.com</span><span class="placeholder"></span>' => '<a href="https://docs.moodle.org/dev/Main_Page"></a><span><a href="http://www.google.com" class="_blanktarget">www.google.com</a></span><span class="placeholder"></span>',
'http://nolandforzombies.com <a href="zombiesFTW.com">Zombies FTW</a> http://aliens.org' => '<a href="http://nolandforzombies.com" class="_blanktarget">http://nolandforzombies.com</a> <a href="zombiesFTW.com">Zombies FTW</a> <a href="http://aliens.org" class="_blanktarget">http://aliens.org</a>',
//URLs in Javascript. Commented out as part of MDL-21183
//'var url="http://moodle.org";'=>'var url="http://moodle.org";',
//'var url = "http://moodle.org";'=>'var url = "http://moodle.org";',
+3 -1
View File
@@ -51,9 +51,11 @@ class gradingform_guide_editguide extends moodleform {
$form->setType('returnurl', PARAM_LOCALURL);
// Name.
$form->addElement('text', 'name', get_string('name', 'gradingform_guide'), array('size'=>52));
$form->addElement('text', 'name', get_string('name', 'gradingform_guide'),
array('size' => 52, 'maxlength' => 255));
$form->addRule('name', get_string('required'), 'required');
$form->setType('name', PARAM_TEXT);
$form->addRule('name', null, 'maxlength', 255, 'client');
// Description.
$options = gradingform_guide_controller::description_form_field_options($this->_customdata['context']);
+4
View File
@@ -197,6 +197,10 @@ class moodlequickform_guideeditor extends HTML_QuickForm_input {
$errors['err_noshortname'] = 1;
$criterion['error_description'] = true;
}
if (strlen(trim($criterion['shortname'])) > 255) {
$errors['err_shortnametoolong'] = 1;
$criterion['error_description'] = true;
}
if (!strlen(trim($criterion['maxscore']))) {
$errors['err_nomaxscore'] = 1;
$criterion['error_description'] = true;
@@ -54,6 +54,7 @@ $string['err_nodescription'] = 'Student description can not be empty';
$string['err_nodescriptionmarkers'] = 'Marker description can not be empty';
$string['err_nomaxscore'] = 'Criterion max score can not be empty';
$string['err_noshortname'] = 'Criterion name can not be empty';
$string['err_shortnametoolong'] = 'Criterion name must be less than 256 characters';
$string['err_scoreinvalid'] = 'The score given to {$a->criterianame} is not valid, the max score is: {$a->maxscore}';
$string['gradingof'] = '{$a} grading';
$string['guidemappingexplained'] = 'WARNING: Your marking guide has a maximum grade of <b>{$a->maxscore} points</b> but the maximum grade set in your activity is {$a->modulegrade} The maximum score set in your marking guide will be scaled to the maximum grade in the module.<br />
+5 -5
View File
@@ -287,11 +287,11 @@ if ($formdata = $mform2->get_data()) {
$newgrade = new stdClass();
$newgrade->newgradeitem = $newgradeitems[$key];
// if the user has a grade for this grade item
if (trim($value) != '-') {
// instead of omitting the grade we could insert one with finalgrade set to 0
// we do not have access to grade item min grade
$newgrade->finalgrade = $value;
// If the user has a grade for this grade item.
$trimmed = trim($value);
if ($trimmed !== '' and $trimmed != '-') {
// Only include a grade if it is not blank or a dash.
$newgrade->finalgrade = $value;
$newgrades[] = $newgrade;
}
break;
+3 -3
View File
@@ -533,7 +533,7 @@ function grade_print_tabs($active_type, $active_plugin, $plugin_info, $return=fa
$top_row = array();
$bottom_row = array();
$inactive = array($active_plugin);
$activated = array();
$activated = array($active_type);
$count = 0;
$active = '';
@@ -577,9 +577,9 @@ function grade_print_tabs($active_type, $active_plugin, $plugin_info, $return=fa
$tabs[] = $bottom_row;
if ($return) {
return print_tabs($tabs, $active_type, $inactive, $activated, true);
return print_tabs($tabs, $active_plugin, $inactive, $activated, true);
} else {
print_tabs($tabs, $active_type, $inactive, $activated);
print_tabs($tabs, $active_plugin, $inactive, $activated);
}
}
+29 -24
View File
@@ -415,8 +415,14 @@ class grade_report_grader extends grade_report {
// Limit to users with a gradeable role.
list($gradebookrolessql, $gradebookrolesparams) = $DB->get_in_or_equal(explode(',', $this->gradebookroles), SQL_PARAMS_NAMED, 'grbr0');
// Check the status of showing only active enrolments.
$coursecontext = $this->context->get_course_context(true);
$defaultgradeshowactiveenrol = !empty($CFG->grade_report_showonlyactiveenrol);
$showonlyactiveenrol = get_user_preferences('grade_report_showonlyactiveenrol', $defaultgradeshowactiveenrol);
$showonlyactiveenrol = $showonlyactiveenrol || !has_capability('moodle/course:viewsuspendedusers', $coursecontext);
// Limit to users with an active enrollment.
list($enrolledsql, $enrolledparams) = get_enrolled_sql($this->context);
list($enrolledsql, $enrolledparams) = get_enrolled_sql($this->context, '', 0, $showonlyactiveenrol);
// Fields we need from the user table.
$userfields = user_picture::fields('u', get_extra_user_fields($this->context));
@@ -479,30 +485,29 @@ class grade_report_grader extends grade_report {
$this->userselect = "AND g.userid $usql";
$this->userselect_params = $uparams;
// Add a flag to each user indicating whether their enrolment is active.
$sql = "SELECT ue.userid
FROM {user_enrolments} ue
JOIN {enrol} e ON e.id = ue.enrolid
WHERE ue.userid $usql
AND ue.status = :uestatus
AND e.status = :estatus
AND e.courseid = :courseid
AND ue.timestart < :now1 AND (ue.timeend = 0 OR ue.timeend > :now2)
GROUP BY ue.userid";
$coursecontext = $this->context->get_course_context(true);
$time = time();
$params = array_merge($uparams, array('estatus' => ENROL_INSTANCE_ENABLED, 'uestatus' => ENROL_USER_ACTIVE,
'courseid' => $coursecontext->instanceid, 'now1' => $time, 'now2' => $time));
$useractiveenrolments = $DB->get_records_sql($sql, $params);
$defaultgradeshowactiveenrol = !empty($CFG->grade_report_showonlyactiveenrol);
$showonlyactiveenrol = get_user_preferences('grade_report_showonlyactiveenrol', $defaultgradeshowactiveenrol);
$showonlyactiveenrol = $showonlyactiveenrol || !has_capability('moodle/course:viewsuspendedusers', $coursecontext);
// First flag everyone as not suspended.
foreach ($this->users as $user) {
// If we are showing only active enrolments, then remove suspended users from list.
if ($showonlyactiveenrol && !array_key_exists($user->id, $useractiveenrolments)) {
unset($this->users[$user->id]);
} else {
$this->users[$user->id]->suspendedenrolment = false;
}
// If we want to mix both suspended and not suspended users, let's find out who is suspended.
if (!$showonlyactiveenrol) {
$sql = "SELECT ue.userid
FROM {user_enrolments} ue
JOIN {enrol} e ON e.id = ue.enrolid
WHERE ue.userid $usql
AND ue.status = :uestatus
AND e.status = :estatus
AND e.courseid = :courseid
AND ue.timestart < :now1 AND (ue.timeend = 0 OR ue.timeend > :now2)
GROUP BY ue.userid";
$time = time();
$params = array_merge($uparams, array('estatus' => ENROL_INSTANCE_ENABLED, 'uestatus' => ENROL_USER_ACTIVE,
'courseid' => $coursecontext->instanceid, 'now1' => $time, 'now2' => $time));
$useractiveenrolments = $DB->get_records_sql($sql, $params);
foreach ($this->users as $user) {
$this->users[$user->id]->suspendedenrolment = !array_key_exists($user->id, $useractiveenrolments);
}
}
+1 -1
View File
@@ -74,7 +74,7 @@ foreach ($outcomes as $outcomeid => $outcome) {
FROM {grade_grades}
WHERE itemid = ?".
$hidesuspendedsql.
"GROUP BY itemid";
" GROUP BY itemid";
$info = $DB->get_records_sql($sql, $params);
if (!$info) {
+1 -1
View File
@@ -113,7 +113,7 @@ foreach ($rs as $row) {
if (!array_key_exists($row->groupid, $members[$row->groupingid])) {
$members[$row->groupingid][$row->groupid] = array();
}
if(isset($user->id)){
if (!empty($user->id)) {
$members[$row->groupingid][$row->groupid][] = $user;
}
}
+1
View File
@@ -48,6 +48,7 @@ define('AJAX_SCRIPT', false); // prevents some warnings later
define('CACHE_DISABLE_ALL', true); // Disables caching.. just in case.
define('PHPUNIT_TEST', false);
define('IGNORE_COMPONENT_CACHE', true);
define('MDL_PERF_TEST', false);
// Servers should define a default timezone in php.ini, but if they don't then make sure something is defined.
// This is a quick hack. Ideally we should ask the admin for a value. See MDL-22625 for more on this.
+1
View File
@@ -38,4 +38,5 @@ $string['cannotfindcomponent'] = 'لم يتم العثور على المكون';
$string['cannotsavemd5file'] = 'لم يتم حفظ ملف md5';
$string['cannotsavezipfile'] = 'لم يتم حفظ الملف المضغوط';
$string['cannotunzipfile'] = 'لم يتم فك الملف المضغوط';
$string['componentisuptodate'] = 'العنصر محدث';
$string['missingrequiredfield'] = 'بعض الحقول المطلوبة مفقودة';
+1
View File
@@ -39,6 +39,7 @@ $string['cannotsavemd5file'] = 'Ezin da Md5 fitxategia gorde';
$string['cannotsavezipfile'] = 'Ezin da ZIP fitxategia gorde';
$string['cannotunzipfile'] = 'Ezin da fitxategia deskonprimatu';
$string['componentisuptodate'] = 'Osagaia eguneratu da';
$string['dmlexceptiononinstall'] = '<p>Datu-basearen errorea gertatu da [{$a->errorcode}].<br />{$a->debuginfo}</p>';
$string['downloadedfilecheckfailed'] = 'Jaitsitako fitxategiaren konprobazioak kale egin du.';
$string['invalidmd5'] = 'md5 ez da baliagarria';
$string['missingrequiredfield'] = 'Beharrezko eremuren bat falta da.';
+3 -2
View File
@@ -71,9 +71,10 @@ $string['pathsunsecuredataroot'] = 'Dataroot-en kokapena ez da segurua';
$string['pathswrongadmindir'] = 'Kudeaketa direktorioa ez da existitzen';
$string['phpextension'] = '{$a} PHP luzapena';
$string['phpversion'] = 'PHP bertsioa';
$string['phpversionhelp'] = '<p>Moodle-k PHP 4.1.0 edo geroagoko bertsioa behar du.</p>
$string['phpversionhelp'] = '<p>Moodle-k gutxienez PHP 4.3.0 edo 5.1.0 (5.0.x errore batzuk ditu). </p>
<p>Zure bertsioa: {$a}</p>
<p>PHP eguneratu edo PHP bertsio berriagoa duen zerbitzari batera jo</p>';
<p>PHP eguneratu edo PHP bertsio berriagoa duen zerbitzari batera jo</p>
<p>5.0.x baduzu, nahi izanez gero, 4.4.x. bertsiora jaitsi dezakezu</p>';
$string['welcomep10'] = '{$a->installername} ({$a->installerversion})';
$string['welcomep20'] = 'Orri hau ikusten baduzu <strong>{$a->packname} {$a->packversion}</strong> paketea
zure ordenadorean instalatu ahal izan duzu. Zorionak!';
+34
View File
@@ -0,0 +1,34 @@
<?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/>.
/**
* Automatically generated strings for Moodle installer
*
* Do not edit this file manually! It contains just a subset of strings
* needed during the very first steps of installation. This file was
* generated automatically by export-installer.php (which is part of AMOS
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
* list of strings defined in /install/stringnames.txt.
*
* @package installer
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$string['parentlanguage'] = 'fi';
$string['thislanguage'] = 'Suomi+';
+2 -2
View File
@@ -32,8 +32,8 @@ defined('MOODLE_INTERNAL') || die();
$string['clianswerno'] = 'n';
$string['cliansweryes'] = 'y';
$string['cliincorrectvalueerror'] = 'エラー「 {$a->option} 」の値「 {$a->value} 」が正しくありません。';
$string['cliincorrectvalueretry'] = '値が正しくありません、再度お試しください。';
$string['cliincorrectvalueerror'] = 'エラー: 「 {$a->option} 」の値「 {$a->value} 」が正しくありません。';
$string['cliincorrectvalueretry'] = '値が正しくありません、再度入力してください。';
$string['clitypevalue'] = '値を入力してください。';
$string['clitypevaluedefault'] = '値を入力してください。デフォルト値 ({$a}) を使用するにはEnterキーを押してください。';
$string['cliunknowoption'] = '不明なオプション:
+1 -1
View File
@@ -32,4 +32,4 @@ defined('MOODLE_INTERNAL') || die();
$string['parentlanguage'] = '';
$string['thisdirection'] = 'ltr';
$string['thislanguage'] = 'Lithuanian';
$string['thislanguage'] = 'Lietuvių';
+35
View File
@@ -0,0 +1,35 @@
<?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/>.
/**
* Automatically generated strings for Moodle installer
*
* Do not edit this file manually! It contains just a subset of strings
* needed during the very first steps of installation. This file was
* generated automatically by export-installer.php (which is part of AMOS
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
* list of strings defined in /install/stringnames.txt.
*
* @package installer
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$string['parentlanguage'] = 'no';
$string['thisdirection'] = 'ltr';
$string['thislanguage'] = 'Davvisámegiella';
+1 -1
View File
@@ -36,7 +36,7 @@ $string['cliincorrectvalueerror'] = '错误,将“{$a->option}”的值设为
$string['cliincorrectvalueretry'] = '不正确的值,请重试';
$string['clitypevalue'] = '输入值';
$string['clitypevaluedefault'] = '输入值,按回车使用缺省值({$a})';
$string['cliunknowoption'] = '错误选项:
$string['cliunknowoption'] = '未识别的选项:
{$a}
请使用 --help 选项。';
$string['cliyesnoprompt'] = '输入y(表示是)或n(表示否)';
+1 -1
View File
@@ -1124,7 +1124,7 @@ $string['users'] = 'Users';
$string['userquota'] = 'User quota';
$string['usesitenameforsitepages'] = 'Use site name for site pages';
$string['usetags'] = 'Enable tags functionality';
$string['validateerror'] = 'This value was not valid:';
$string['validateerror'] = 'This value is not valid';
$string['verifychangedemail'] = 'Restrict domains when changing email';
$string['warningcurrentsetting'] = 'Invalid current value: {$a}';
$string['warningiconvbuggy'] = 'Your version of the iconv library does not support the //IGNORE modifier. You should install the mbstring extension which can be used instead for cleaning strings containing invalid UTF-8 characters.';
+1
View File
@@ -145,6 +145,7 @@ $string['cannotsetupblock'] = 'Blocks tables could NOT be set up successfully!';
$string['cannotsetupcapformod'] = 'Could not set up the capabilities for {$a}';
$string['cannotsetupcapforplugin'] = 'Could not set up the capabilities for {$a}';
$string['cannotshowhidecoursesincategory'] = 'Cannot show/hide the courses in category {$a}.';
$string['cannotsignup'] = 'You cannot create a new account because you are already logged in as {$a}.';
$string['cannotunassigncap'] = 'Could not unassign deprecated capability {$a->cap} from role {$a->role}';
$string['cannotunassignrolefrom'] = 'Cannot unassign this user from role id: {$a}';
$string['cannotunzipfile'] = 'Cannot unzip file';
+6
View File
@@ -35,9 +35,11 @@ $string['categoryrole'] = 'Category role';
$string['contains'] = 'contains';
$string['content'] = 'Content';
$string['contentandheadings'] = 'Content and headings';
$string['coursecategory'] = 'course category';
$string['courserole'] = 'Course role';
$string['courserolelabel'] = '{$a->label} is {$a->rolename} in {$a->coursename} from {$a->categoryname}';
$string['courserolelabelerror'] = '{$a->label} error: course {$a->coursename} does not exist';
$string['coursevalue'] = 'course value';
$string['datelabelisafter'] = '{$a->label} is after {$a->after}';
$string['datelabelisbefore'] = '{$a->label} is before {$a->before}';
$string['datelabelisbetween'] = '{$a->label} is between {$a->after} and {$a->before}';
@@ -63,6 +65,7 @@ $string['isempty'] = 'is empty';
$string['isequalto'] = 'is equal to';
$string['isnotdefined'] = 'isn\'t defined';
$string['isnotequalto'] = 'isn\'t equal to';
$string['limiterfor'] = '{$a} field limiter';
$string['neveraccessed'] = 'Never accessed';
$string['nevermodified'] = 'Never modified';
$string['newfilter'] = 'New filter';
@@ -70,6 +73,8 @@ $string['nofiltersenabled'] = 'No filter plugins have been enabled on this site.
$string['off'] = 'Off';
$string['offbutavailable'] = 'Off, but available';
$string['on'] = 'On';
$string['profilefilterfield'] = 'Profile field name';
$string['profilefilterlimiter'] = 'Profile field operator';
$string['profilelabel'] = '{$a->label}: {$a->profile} {$a->operator} {$a->value}';
$string['profilelabelnovalue'] = '{$a->label}: {$a->profile} {$a->operator}';
$string['removeall'] = 'Remove all filters';
@@ -79,3 +84,4 @@ $string['startswith'] = 'starts with';
$string['tablenosave'] = 'Changes in table above are saved automatically.';
$string['textlabel'] = '{$a->label} {$a->operator} {$a->value}';
$string['textlabelnovalue'] = '{$a->label} {$a->operator}';
$string['valuefor'] = '{$a} value';
+1 -1
View File
@@ -32,7 +32,7 @@ $string['err_alphanumeric'] = 'You must enter only letters or numbers here.';
$string['err_email'] = 'You must enter a valid email address here.';
$string['err_lettersonly'] = 'You must enter only letters here.';
$string['err_maxfiles'] = 'You must not attach more than {$a} files here.';
$string['err_maxlength'] = 'You must enter not more than {$a->format} characters here.';
$string['err_maxlength'] = 'You must enter no more than {$a->format} characters here.';
$string['err_minlength'] = 'You must enter at least {$a->format} characters here.';
$string['err_nonzero'] = 'You must enter a number not starting with a 0 here.';
$string['err_nopunctuation'] = 'You must enter no punctuation characters here.';
+2 -1
View File
@@ -1566,7 +1566,7 @@ $string['rssarticles'] = 'Number of RSS recent articles';
$string['rsserror'] = 'Error reading RSS data';
$string['rsserrorauth'] = 'Your RSS link does not contain a valid authentication token.';
$string['rsserrorguest'] = 'This feed uses guest access to access the data, but guest does not have permission to read the data. Visit the original location that this feed comes from (URL) as a valid user and get a new RSS link from there.';
$string['rsskeyshelp'] = 'To ensure security and privacy, RSS feed URLs contain a special token that identifies the user they are for. This prevents other users from accessing areas of Moodle they shouldn\'t have access to via RSS feeds.</p><p>This token is automatically created the first time you access an area of Moodle that produces an RSS feed. If you feel that your RSS feed token has been compromised in some way you can request a new one by clicking the Reset link here. Please note that your current RSS feed URLs will then become invalid.';
$string['rsskeyshelp'] = '<p>To ensure security and privacy, RSS feed URLs contain a special token that identifies the user they are for. This prevents other users from accessing areas of the site where they are not allowed.</p><p>The token is automatically created the first time you access an area that produces an RSS feed. If you think that your RSS feed token has been compromised, you can request a new one by clicking the reset link. Please note that your current RSS feed URLs will then become invalid.</p>';
$string['rsstype'] = 'RSS feed for this activity';
$string['saveandnext'] = 'Save and show next';
$string['savedat'] = 'Saved at:';
@@ -1904,6 +1904,7 @@ $string['usemessageform'] = 'or use the form below to send a message to the sele
$string['user'] = 'User';
$string['userconfirmed'] = 'Confirmed {$a}';
$string['usercurrentsettings'] = 'My profile settings';
$string['useractivity'] = 'Activity';
$string['userdata'] = 'User data';
$string['userdeleted'] = 'This user account has been deleted';
$string['userdescription'] = 'Description';
+4 -4
View File
@@ -62,16 +62,16 @@ $string['close'] = 'Close';
$string['commonrepositorysettings'] = 'Common repository settings';
$string['configallowexternallinks'] = 'This option enables all users to choose whether or not external media is copied into Moodle or not. If this is off then media is always copied into Moodle (this is usually best for overall data integrity and security). If this is on then users can choose each time they add media to a text.';
$string['configcacheexpire'] = 'The amount of time that file listings are cached locally (in seconds) when browsing external repositories.';
$string['configgetfiletimeout'] = 'Timeout in seconds for downloading the external file into moodle.';
$string['configgetfiletimeout'] = 'Timeout in seconds for downloading an external file into Moodle.';
$string['configsaved'] = 'Configuration saved!';
$string['configsyncfiletimeout'] = 'Timeout in seconds for syncronising the external file size.';
$string['configsyncimagetimeout'] = 'Timeout in seconds for downloading an image file from external repository during syncronisation.';
$string['confirmdelete'] = 'Are you sure you want to delete this repository - {$a}? If you choose "Continue and download", file references to external contents will be downloaded to moodle, but it could take long time to process.';
$string['confirmdelete'] = 'Are you sure you want to delete the repository {$a}? If you choose "Continue and download", file references to external contents will be downloaded to Moodle. This could take a long time to process.';
$string['confirmdeletefile'] = 'Are you sure you want to delete this file?';
$string['confirmrenamefile'] = 'Are you sure you want to rename/move this file? There are {$a} alias/shortcut files that use this file as their source. If you proceed then those aliases will be converted to true copies.';
$string['confirmdeletefilewithhref'] = 'Are you sure you want to delete this file? There are {$a} alias/shortcut files that use this file as their source. If you proceed then those aliases will be converted to true copies.';
$string['confirmdeletefolder'] = 'Are you sure you want to delete this folder? All files and subfolders will be deleted.';
$string['confirmremove'] = 'Are you sure you want to remove this repository plugin, its options and <strong>all of its instances</strong> - {$a}? If you choose "Continue and download", file references to external contents will be downloaded to moodle, but it could take long time to process.';
$string['confirmremove'] = 'Are you sure you want to remove this repository plugin, its options and <strong>all of its instances</strong> - {$a}? If you choose "Continue and download", file references to external contents will be downloaded to Moodle. This could take a long time to process.';
$string['confirmrenamefolder'] = ' Are you sure you want to move/rename this folder? Any alias/shortcut files that reference files in this folder will be converted into true copies.';
$string['continueuninstall'] = 'Continue';
$string['continueuninstallanddownload'] = 'Continue and download';
@@ -242,5 +242,5 @@ $string['usenonjsfilemanager'] = 'Open file manager in new window';
$string['usenonjsfilepicker'] = 'Open file picker in new window';
$string['unzipped'] = 'Unzipped successfully';
$string['wrongcontext'] = 'You cannot access to this context';
$string['xhtmlerror'] = 'You are probably using XHTML strict header, some YUI Component doesn\'t work in this mode, please turn it off in moodle';
$string['xhtmlerror'] = 'You are probably using an XHTML strict header. Certain YUI components don\'t work in this mode; please turn it off.';
$string['ziped'] = 'Compress folder successfully';
+2 -2
View File
@@ -171,10 +171,10 @@ $string['defaultx'] = 'Default: {$a}';
$string['defineroles'] = 'Define roles';
$string['deletecourseoverrides'] = 'Delete all overrides in course';
$string['deletelocalroles'] = 'Delete all local role assignments';
$string['deleterolesure'] = 'Are you sure that you want to delete role "{$a->name} ({$a->shortname})"?</p><p>Currently this role is assigned to {$a->count} users.';
$string['deleterolesure'] = '<p>Are you sure that you want to delete role "{$a->name} ({$a->shortname})"?</p><p>Currently this role is assigned to {$a->count} users.</p>';
$string['deletexrole'] = 'Delete {$a} role';
$string['duplicaterole'] = 'Duplicate role';
$string['duplicaterolesure'] = 'Are you sure that you want to duplicate role "{$a->name} ({$a->shortname})"?</p>';
$string['duplicaterolesure'] = '<p>Are you sure that you want to duplicate role "{$a->name} ({$a->shortname})"?</p>';
$string['editingrolex'] = 'Editing role \'{$a}\'';
$string['editrole'] = 'Edit role';
$string['editxrole'] = 'Edit {$a} role';
+1
View File
@@ -127,6 +127,7 @@ $string['missingusername'] = 'Missing username';
$string['missingversionfile'] = 'Coding error: version.php file is missing for the component {$a}';
$string['mobilewsdisabled'] = 'Disabled';
$string['mobilewsenabled'] = 'Enabled';
$string['nameexists'] = 'This name is already in use by another service';
$string['nocapabilitytouseparameter'] = 'The user does not have the required capability to use the parameter {$a}';
$string['nofunctions'] = 'This service has no functions.';
$string['norequiredcapability'] = 'No required capability';
+31 -16
View File
@@ -2927,7 +2927,7 @@ function get_capability_info($capabilityname) {
if (empty($ACCESSLIB_PRIVATE->capabilities)) {
$ACCESSLIB_PRIVATE->capabilities = array();
$caps = $DB->get_records('capabilities', array(), 'id, name, captype, riskbitmask');
$caps = $DB->get_records('capabilities', array(), '', 'id, name, captype, riskbitmask');
foreach ($caps as $cap) {
$capname = $cap->name;
unset($cap->id);
@@ -6418,14 +6418,17 @@ class context_user extends context {
protected static function create_level_instances() {
global $DB;
$sql = "INSERT INTO {context} (contextlevel, instanceid)
SELECT ".CONTEXT_USER.", u.id
$sql = "SELECT ".CONTEXT_USER.", u.id
FROM {user} u
WHERE u.deleted = 0
AND NOT EXISTS (SELECT 'x'
FROM {context} cx
WHERE u.id = cx.instanceid AND cx.contextlevel=".CONTEXT_USER.")";
$DB->execute($sql);
$contextdata = $DB->get_recordset_sql($sql);
foreach ($contextdata as $context) {
context::insert_context_record(CONTEXT_USER, $context->id, null);
}
$contextdata->close();
}
/**
@@ -6626,13 +6629,16 @@ class context_coursecat extends context {
protected static function create_level_instances() {
global $DB;
$sql = "INSERT INTO {context} (contextlevel, instanceid)
SELECT ".CONTEXT_COURSECAT.", cc.id
$sql = "SELECT ".CONTEXT_COURSECAT.", cc.id
FROM {course_categories} cc
WHERE NOT EXISTS (SELECT 'x'
FROM {context} cx
WHERE cc.id = cx.instanceid AND cx.contextlevel=".CONTEXT_COURSECAT.")";
$DB->execute($sql);
$contextdata = $DB->get_recordset_sql($sql);
foreach ($contextdata as $context) {
context::insert_context_record(CONTEXT_COURSECAT, $context->id, null);
}
$contextdata->close();
}
/**
@@ -6849,13 +6855,16 @@ class context_course extends context {
protected static function create_level_instances() {
global $DB;
$sql = "INSERT INTO {context} (contextlevel, instanceid)
SELECT ".CONTEXT_COURSE.", c.id
$sql = "SELECT ".CONTEXT_COURSE.", c.id
FROM {course} c
WHERE NOT EXISTS (SELECT 'x'
FROM {context} cx
WHERE c.id = cx.instanceid AND cx.contextlevel=".CONTEXT_COURSE.")";
$DB->execute($sql);
$contextdata = $DB->get_recordset_sql($sql);
foreach ($contextdata as $context) {
context::insert_context_record(CONTEXT_COURSE, $context->id, null);
}
$contextdata->close();
}
/**
@@ -7103,13 +7112,16 @@ class context_module extends context {
protected static function create_level_instances() {
global $DB;
$sql = "INSERT INTO {context} (contextlevel, instanceid)
SELECT ".CONTEXT_MODULE.", cm.id
$sql = "SELECT ".CONTEXT_MODULE.", cm.id
FROM {course_modules} cm
WHERE NOT EXISTS (SELECT 'x'
FROM {context} cx
WHERE cm.id = cx.instanceid AND cx.contextlevel=".CONTEXT_MODULE.")";
$DB->execute($sql);
$contextdata = $DB->get_recordset_sql($sql);
foreach ($contextdata as $context) {
context::insert_context_record(CONTEXT_MODULE, $context->id, null);
}
$contextdata->close();
}
/**
@@ -7320,13 +7332,16 @@ class context_block extends context {
protected static function create_level_instances() {
global $DB;
$sql = "INSERT INTO {context} (contextlevel, instanceid)
SELECT ".CONTEXT_BLOCK.", bi.id
$sql = "SELECT ".CONTEXT_BLOCK.", bi.id
FROM {block_instances} bi
WHERE NOT EXISTS (SELECT 'x'
FROM {context} cx
WHERE bi.id = cx.instanceid AND cx.contextlevel=".CONTEXT_BLOCK.")";
$DB->execute($sql);
$contextdata = $DB->get_recordset_sql($sql);
foreach ($contextdata as $context) {
context::insert_context_record(CONTEXT_BLOCK, $context->id, null);
}
$contextdata->close();
}
/**
+19 -14
View File
@@ -3224,16 +3224,20 @@ class admin_setting_configtime extends admin_setting {
$defaultinfo = NULL;
}
$return = '<div class="form-time defaultsnext">'.
'<select id="'.$this->get_id().'h" name="'.$this->get_full_name().'[h]">';
$return = '<div class="form-time defaultsnext">';
$return .= '<label class="accesshide" for="' . $this->get_id() . 'h">' . get_string('hours') . '</label>';
$return .= '<select id="' . $this->get_id() . 'h" name="' . $this->get_full_name() . '[h]">';
for ($i = 0; $i < 24; $i++) {
$return .= '<option value="'.$i.'"'.($i == $data['h'] ? ' selected="selected"' : '').'>'.$i.'</option>';
$return .= '<option value="' . $i . '"' . ($i == $data['h'] ? ' selected="selected"' : '') . '>' . $i . '</option>';
}
$return .= '</select>:<select id="'.$this->get_id().'m" name="'.$this->get_full_name().'[m]">';
$return .= '</select>:';
$return .= '<label class="accesshide" for="' . $this->get_id() . 'm">' . get_string('minutes') . '</label>';
$return .= '<select id="' . $this->get_id() . 'm" name="' . $this->get_full_name() . '[m]">';
for ($i = 0; $i < 60; $i += 5) {
$return .= '<option value="'.$i.'"'.($i == $data['m'] ? ' selected="selected"' : '').'>'.$i.'</option>';
$return .= '<option value="' . $i . '"' . ($i == $data['m'] ? ' selected="selected"' : '') . '>' . $i . '</option>';
}
$return .= '</select></div>';
$return .= '</select>';
$return .= '</div>';
return format_admin_setting($this, $this->visiblename, $return, $this->description, false, '', $defaultinfo, $query);
}
@@ -6952,21 +6956,22 @@ function format_admin_setting($setting, $title='', $form='', $description='', $l
}
$adminroot = admin_get_root();
$error = '';
if (array_key_exists($fullname, $adminroot->errors)) {
$error = '<div><span class="error">' . $adminroot->errors[$fullname]->error . '</span></div>';
}
$str = '
<div class="form-item clearfix" id="admin-'.$setting->name.'">
<div class="form-label">
<label '.$labelfor.'>'.highlightfast($query, $title).$override.$warning.'</label>
<span class="form-shortname">'.highlightfast($query, $name).'</span>
</div>
<div class="form-setting">'.$form.$defaultinfo.'</div>
<div class="form-setting">'.$error.$form.$defaultinfo.'</div>
<div class="form-description">'.highlight($query, markdown_to_html($description)).'</div>
</div>';
$adminroot = admin_get_root();
if (array_key_exists($fullname, $adminroot->errors)) {
$str = '<fieldset class="error"><legend>'.$adminroot->errors[$fullname]->error.'</legend>'.$str.'</fieldset>';
}
return $str;
}
@@ -7763,11 +7768,11 @@ class admin_setting_webservicesoverview extends admin_setting {
get_string('enablemobilewebservice', 'admin'),
get_string('configenablemobilewebservice',
'admin', ''), 0); //we don't want to display it but to know the ws mobile status
$manageserviceurl = new moodle_url("/admin/settings.php?section=externalservices");
$manageserviceurl = new moodle_url("/admin/settings.php?section=mobile");
$wsmobileparam = new stdClass();
$wsmobileparam->enablemobileservice = get_string('enablemobilewebservice', 'admin');
$wsmobileparam->manageservicelink = html_writer::link($manageserviceurl,
get_string('externalservices', 'webservice'));
get_string('mobile', 'admin'));
$mobilestatus = $enablemobile->get_setting()?get_string('mobilewsenabled', 'webservice'):get_string('mobilewsdisabled', 'webservice');
$wsmobileparam->wsmobilestatus = html_writer::tag('strong', $mobilestatus);
$return .= $OUTPUT->heading(get_string('enablemobilewebservice', 'admin'), 3, 'main');
+1 -1
View File
@@ -28,7 +28,7 @@ require_once(dirname(__FILE__) . '/../../config.php');
// Initialise ALL common incoming parameters here, up front.
$courseid = required_param('courseid', PARAM_INT);
$pagelayout = required_param('pagelayout', PARAM_ALPHAEXT);
$pagetype = required_param('pagetype', PARAM_ALPHAEXT);
$pagetype = required_param('pagetype', PARAM_ALPHANUMEXT);
$contextid = required_param('contextid', PARAM_INT);
$subpage = optional_param('subpage', '', PARAM_ALPHANUMEXT);
$cmid = optional_param('cmid', null, PARAM_INT);
+5 -1
View File
@@ -114,7 +114,11 @@ class auth_plugin_base {
'department',
'phone1',
'phone2',
'address'
'address',
'firstnamephonetic',
'lastnamephonetic',
'middlename',
'alternatename'
);
/**
+10 -7
View File
@@ -843,9 +843,10 @@ function badges_get_badges($type, $courseid = 0, $sort = '', $dir = '', $page =
*/
function badges_get_user_badges($userid, $courseid = 0, $page = 0, $perpage = 0, $search = '', $onlypublic = false) {
global $DB;
$badges = array();
$params[] = $userid;
$params = array(
'userid' => $userid
);
$sql = 'SELECT
bi.uniquehash,
bi.dateissued,
@@ -860,18 +861,19 @@ function badges_get_user_badges($userid, $courseid = 0, $page = 0, $perpage = 0,
{user} u
WHERE b.id = bi.badgeid
AND u.id = bi.userid
AND bi.userid = ?';
AND bi.userid = :userid';
if (!empty($search)) {
$sql .= ' AND (' . $DB->sql_like('b.name', '?', false) . ') ';
$params[] = "%$search%";
$sql .= ' AND (' . $DB->sql_like('b.name', ':search', false) . ') ';
$params['search'] = '%'.$DB->sql_like_escape($search).'%';
}
if ($onlypublic) {
$sql .= ' AND (bi.visible = 1) ';
}
if ($courseid != 0) {
$sql .= ' AND (b.courseid = ' . $courseid . ') ';
$sql .= ' AND (b.courseid = :courseid) ';
$params['courseid'] = $courseid;
}
$sql .= ' ORDER BY bi.dateissued DESC';
$badges = $DB->get_records_sql($sql, $params, $page * $perpage, $perpage);
@@ -1124,7 +1126,8 @@ function badges_download($userid) {
if ($zipper->archive_to_pathname($filelist, $tempzip)) {
send_temp_file($tempzip, 'badges.zip');
} else {
debugging("Problems with archiving the files.");
debugging("Problems with archiving the files.", DEBUG_DEVELOPER);
die;
}
}
+11 -4
View File
@@ -302,6 +302,11 @@ class behat_base extends Behat\MinkExtension\Context\RawMinkContext {
$loops = $timeout;
}
// DOM will never change on non-javascript case; do not wait or try again.
if (!$this->running_javascript()) {
$loops = 1;
}
for ($i = 0; $i < $loops; $i++) {
// We catch the exception thrown by the step definition to execute it again.
try {
@@ -320,10 +325,12 @@ class behat_base extends Behat\MinkExtension\Context\RawMinkContext {
continue;
}
if ($microsleep) {
usleep(100000);
} else {
sleep(1);
if ($this->running_javascript()) {
if ($microsleep) {
usleep(100000);
} else {
sleep(1);
}
}
}
+2 -1
View File
@@ -221,7 +221,8 @@ class behat_config_manager {
),
'Moodle\BehatExtension\Extension' => array(
'formatters' => array(
'moodle_progress' => 'Moodle\BehatExtension\Formatter\MoodleProgressFormatter'
'moodle_progress' => 'Moodle\BehatExtension\Formatter\MoodleProgressFormatter',
'moodle_list' => 'Moodle\BehatExtension\Formatter\MoodleListFormatter'
),
'features' => $features,
'steps_definitions' => $stepsdefinitions
+58 -38
View File
@@ -39,41 +39,47 @@ class behat_selectors {
* @var Allowed types when using text selectors arguments.
*/
protected static $allowedtextselectors = array(
'dialogue' => 'dialogue',
'activity' => 'activity',
'block' => 'block',
'region' => 'region',
'table_row' => 'table_row',
'list_item' => 'list_item',
'table' => 'table',
'fieldset' => 'fieldset',
'css_element' => 'css_element',
'xpath_element' => 'xpath_element'
'dialogue' => 'dialogue',
'fieldset' => 'fieldset',
'list_item' => 'list_item',
'question' => 'question',
'region' => 'region',
'section' => 'section',
'table' => 'table',
'table_row' => 'table_row',
'xpath_element' => 'xpath_element',
);
/**
* @var Allowed types when using selector arguments.
*/
protected static $allowedselectors = array(
'dialogue' => 'dialogue',
'activity' => 'activity',
'block' => 'block',
'region' => 'region',
'table_row' => 'table_row',
'list_item' => 'list_item',
'link' => 'link',
'button' => 'button',
'link_or_button' => 'link_or_button',
'select' => 'select',
'checkbox' => 'checkbox',
'radio' => 'radio',
'file' => 'file',
'filemanager' => 'filemanager',
'optgroup' => 'optgroup',
'option' => 'option',
'table' => 'table',
'css_element' => 'css_element',
'dialogue' => 'dialogue',
'field' => 'field',
'fieldset' => 'fieldset',
'file' => 'file',
'filemanager' => 'filemanager',
'link' => 'link',
'link_or_button' => 'link_or_button',
'list_item' => 'list_item',
'optgroup' => 'optgroup',
'option' => 'option',
'question' => 'question',
'radio' => 'radio',
'region' => 'region',
'section' => 'section',
'select' => 'select',
'table' => 'table',
'table_row' => 'table_row',
'text' => 'text',
'css_element' => 'css_element',
'xpath_element' => 'xpath_element'
);
@@ -86,8 +92,14 @@ class behat_selectors {
* @var XPaths for moodle elements.
*/
protected static $moodleselectors = array(
'text' => <<<XPATH
//*[contains(., %locator%)][count(./descendant::*[contains(., %locator%)]) = 0]
'activity' => <<<XPATH
//li[contains(concat(' ', normalize-space(@class), ' '), ' activity ')][normalize-space(.) = %locator% ]
XPATH
, 'block' => <<<XPATH
//div[contains(concat(' ', normalize-space(@class), ' '), ' block ') and
(contains(concat(' ', normalize-space(@class), ' '), concat(' ', %locator%, ' ')) or
descendant::h2[normalize-space(.) = %locator%] or
@aria-label = %locator%)]
XPATH
, 'dialogue' => <<<XPATH
//div[contains(concat(' ', normalize-space(@class), ' '), ' moodle-dialogue ') and
@@ -96,28 +108,36 @@ XPATH
]) = %locator%] |
//div[contains(concat(' ', normalize-space(@class), ' '), ' yui-dialog ') and
normalize-space(descendant::div[@class='hd']) = %locator%]
XPATH
, 'block' => <<<XPATH
//div[contains(concat(' ', normalize-space(@class), ' '), ' block ') and
(contains(concat(' ', normalize-space(@class), ' '), concat(' ', %locator%, ' ')) or
descendant::h2[normalize-space(.) = %locator%] or
@aria-label = %locator%)]
XPATH
, 'region' => <<<XPATH
//*[self::div | self::section | self::aside | self::header | self::footer][./@id = %locator%]
XPATH
, 'table_row' => <<<XPATH
.//tr[contains(normalize-space(.), %locator%)]
XPATH
, 'list_item' => <<<XPATH
.//li[contains(normalize-space(.), %locator%)]
XPATH
, 'filemanager' => <<<XPATH
//div[contains(concat(' ', normalize-space(@class), ' '), ' ffilemanager ')]
/descendant::input[@id = //label[contains(normalize-space(string(.)), %locator%)]/@for]
XPATH
, 'list_item' => <<<XPATH
.//li[contains(normalize-space(.), %locator%)]
XPATH
, 'question' => <<<XPATH
//div[contains(concat(' ', normalize-space(@class), ' '), ' que ')]
[contains(div[@class='content']/div[@class='formulation'], %locator%)]
XPATH
, 'region' => <<<XPATH
//*[self::div | self::section | self::aside | self::header | self::footer][./@id = %locator%]
XPATH
, 'section' => <<<XPATH
//li[contains(concat(' ', normalize-space(@class), ' '), ' section ')][./descendant::*[self::h3]
[normalize-space(.) = %locator%][contains(concat(' ', normalize-space(@class), ' '), ' sectionname ') or
contains(concat(' ', normalize-space(@class), ' '), ' section-title ')]] |
//div[contains(concat(' ', normalize-space(@class), ' '), ' sitetopic ')]
[./descendant::*[self::h2][normalize-space(.) = %locator%] or %locator% = 'frontpage']
XPATH
, 'table' => <<<XPATH
.//table[(./@id = %locator% or contains(.//caption, %locator%) or contains(concat(' ', normalize-space(@class), ' '), %locator% ))]
XPATH
, 'table_row' => <<<XPATH
.//tr[contains(normalize-space(.), %locator%)]
XPATH
, 'text' => <<<XPATH
//*[contains(., %locator%)][count(./descendant::*[contains(., %locator%)]) = 0]
XPATH
);
+1 -1
View File
@@ -278,7 +278,7 @@ class behat_form_select extends behat_form_field {
*/
protected function get_selected_options($returntexts = true) {
$method = 'getText';
$method = 'getHtml';
if ($returntexts === false) {
$method = 'getValue';
}
+23 -14
View File
@@ -517,6 +517,11 @@ class block_manager {
return false;
}
// Block regions should not be docked during editing when all the blocks are hidden.
if ($this->page->user_is_editing() && $this->page->user_can_edit_blocks()) {
return false;
}
$this->check_is_loaded();
$this->ensure_content_created($region, $output);
if (!$this->region_has_content($region, $output)) {
@@ -524,7 +529,7 @@ class block_manager {
return false;
}
foreach ($this->visibleblockcontent[$region] as $instance) {
if (!empty($instance->content) && !get_user_preferences('docked_block_instance_'.$instance->blockinstanceid, 0)) {
if (!get_user_preferences('docked_block_instance_'.$instance->blockinstanceid, 0)) {
return false;
}
}
@@ -776,19 +781,23 @@ class block_manager {
}
/**
* Convenience method, calls add_block repeatedly for all the blocks in $blocks.
* Convenience method, calls add_block repeatedly for all the blocks in $blocks. Optionally, a starting weight
* can be used to decide the starting point that blocks are added in the region, the weight is passed to {@link add_block}
* and incremented by the position of the block in the $blocks array
*
* @param array $blocks array with array keys the region names, and values an array of block names.
* @param string $pagetypepattern optional. Passed to @see add_block()
* @param string $subpagepattern optional. Passed to @see add_block()
* @param string $pagetypepattern optional. Passed to {@link add_block()}
* @param string $subpagepattern optional. Passed to {@link add_block()}
* @param boolean $showinsubcontexts optional. Passed to {@link add_block()}
* @param integer $weight optional. Determines the starting point that the blocks are added in the region.
*/
public function add_blocks($blocks, $pagetypepattern = NULL, $subpagepattern = NULL, $showinsubcontexts=false, $weight=0) {
$initialweight = $weight;
$this->add_regions(array_keys($blocks), false);
foreach ($blocks as $region => $regionblocks) {
$weight = 0;
foreach ($regionblocks as $blockname) {
foreach ($regionblocks as $offset => $blockname) {
$weight = $initialweight + $offset;
$this->add_block($blockname, $region, $weight, $showinsubcontexts, $pagetypepattern, $subpagepattern);
$weight += 1;
}
}
}
@@ -2188,12 +2197,12 @@ function blocks_find_block($blockid, $blocksarray) {
// Functions for programatically adding default blocks to pages ================
/**
* Parse a list of default blocks. See config-dist for a description of the format.
*
* @param string $blocksstr
* @return array
*/
/**
* Parse a list of default blocks. See config-dist for a description of the format.
*
* @param string $blocksstr Determines the starting point that the blocks are added in the region.
* @return array the parsed list of default blocks
*/
function blocks_parse_default_blocks_list($blocksstr) {
$blocks = array();
$bits = explode(':', $blocksstr);
@@ -2204,7 +2213,7 @@ function blocks_parse_default_blocks_list($blocksstr) {
}
}
if (!empty($bits)) {
$rightbits =trim(array_shift($bits));
$rightbits = trim(array_shift($bits));
if ($rightbits != '') {
$blocks[BLOCK_POS_RIGHT] = explode(',', $rightbits);
}
+38 -1
View File
@@ -54,4 +54,41 @@ class portfolio extends base {
public static function get_manage_url() {
return new moodle_url('/admin/portfolio.php');
}
}
/**
* Defines if there should be a way to uninstall the plugin via the administration UI.
* @return boolean
*/
public function is_uninstall_allowed() {
return true;
}
/**
* Pre-uninstall hook.
* This is intended for disabling of plugin, some DB table purging, etc.
*/
public function uninstall_cleanup() {
global $DB;
// Get all instances of this portfolio.
$count = $DB->count_records('portfolio_instance', array('plugin' => $this->name));
if ($count > 0) {
// This portfolio is in use, get the it's ID.
$rec = $DB->get_record('portfolio_instance', array('plugin' => $this->name));
// Remove all records from portfolio_instance_config.
$DB->delete_records('portfolio_instance_config', array('instance' => $rec->id));
// Remove all records from portfolio_instance_user.
$DB->delete_records('portfolio_instance_user', array('instance' => $rec->id));
// Remove all records from portfolio_log.
$DB->delete_records('portfolio_log', array('portfolio' => $rec->id));
// Remove all records from portfolio_tempdata.
$DB->delete_records('portfolio_tempdata', array('instance' => $rec->id));
// Remove the record from the portfolio_instance table.
$DB->delete_records('portfolio_instance', array('id' => $rec->id));
}
parent::uninstall_cleanup();
}
}
+3 -3
View File
@@ -44,7 +44,7 @@ class memcached extends handler {
protected $acquiretimeout = 120;
/**
* @var int $lockexpire how long to wait before expiring the lock so that other requests
* may continue execution, ignored if memcached <= 2.1.0.
* may continue execution, ignored if PECL memcached is below version 2.2.0.
*/
protected $lockexpire = 7200;
@@ -86,7 +86,7 @@ class memcached extends handler {
* @return bool success
*/
public function start() {
// NOTE: memcached <= 2.1.0 expires session locks automatically after max_execution_time,
// NOTE: memcached before 2.2.0 expires session locks automatically after max_execution_time,
// this leads to major difference compared to other session drivers that timeout
// and stop the second request execution instead.
@@ -119,7 +119,7 @@ class memcached extends handler {
ini_set('memcached.sess_prefix', $this->prefix);
ini_set('memcached.sess_locking', '1'); // Locking is required!
// Try to configure lock and expire timeouts - ignored if memcached <=2.1.0.
// Try to configure lock and expire timeouts - ignored if memcached is before version 2.2.0.
ini_set('memcached.sess_lock_max_wait', $this->acquiretimeout);
ini_set('memcached.sess_lock_expire', $this->lockexpire);
}

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