Compare commits

...

426 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7) fb41a38153 Moodle release 2.5.1 2013-07-06 17:59:23 +02:00
Damyon Wiese 4c6f1ec52e weekly release 2.5+ 2013-07-04 15:34:24 +08:00
Damyon Wiese ef572665e9 MDL-40308: Fix javascript for lti mod_form
It was toggling the state of the hidden input - not the checkbox.
2013-07-04 13:47:23 +08:00
Eloy Lafuente (stronk7) 0383404678 MDL-40376 Fix copy/paste typo 2013-07-03 17:54:14 +02:00
Yuliya Bozhko a7c2742900 MDL-39986 badges: Show badge navigation to users with awardbadge capability
Also fixes an arror when a user with this capability tries to award a badge,
but their role is not among the criteria set up for a badge
2013-07-03 13:05:50 +08:00
Damyon Wiese fc83888891 MDL-39558 badges: Prevent backup of badges without user information 2013-07-03 10:54:31 +08:00
Yuliya Bozhko 18811be378 MDL-39558 badges: Add backup/restore of manually awarded badges 2013-07-03 10:13:05 +08:00
Yuliya Bozhko 56d54e1eed MDL-39558 badges: Add backup/restore to course badges 2013-07-03 10:12:46 +08:00
Michael Aherne 3a4a5356eb MDL-40275 core Improve documentation for block_base::has_config() 2013-07-02 21:52:59 +02:00
Eloy Lafuente (stronk7) 1a5986dab9 Merge branch 'MDL-40376-m25' of git://github.com/andrewnicols/moodle into MOODLE_25_STABLE 2013-07-02 21:12:10 +02:00
Eloy Lafuente (stronk7) c10fc915ad MDL-37516 Translate fieldnames on output only.
This reverts a change performed by the previous commit where user
fieldnames were being translated (and cached) when fetched,
causing the information to remain static later, not responding
to language switches (and perhaps leading to other problems if those
structures are used lated for DB / $USER comparisons.

With the commit, the translation happens on output, so no
potential interferences will happen and, also, the information
changes dynamically on lang switching.
2013-07-02 21:01:56 +02:00
sam marshall a6683d327f MDL-37516 Conditional activities: user field condition display fixes 2013-07-02 20:59:07 +02:00
Eloy Lafuente (stronk7) a9155c2875 Merge branch 'MDL-40246_25' of git://github.com/dmonllao/moodle into MOODLE_25_STABLE 2013-07-02 14:27:24 +02:00
Eloy Lafuente (stronk7) 4d52fbbc14 Merge branch 'MDL-40439-en_fix_25' of git://github.com/mudrd8mz/moodle into MOODLE_25_STABLE 2013-07-02 13:47:37 +02:00
Helen Foster bb07f7ecce MDL-40439 Merge English strings from the en_fix language pack 2013-07-02 11:47:49 +02:00
Dan Poltawski dee6316364 Merge branch 'MDL-40389_25' of git://github.com/stronk7/moodle into MOODLE_25_STABLE 2013-07-02 15:53:06 +08:00
Dan Poltawski f6b1260812 Merge branch 'MDL-40282.25' of github.com:colchambers/moodle into MOODLE_25_STABLE 2013-07-02 15:15:32 +08:00
Damyon Wiese 1e6919f6c8 Merge branch 'wip-MDL-40353-m25' of git://github.com/marinaglancy/moodle into MOODLE_25_STABLE 2013-07-02 14:29:08 +08:00
Dan Poltawski a852df6f11 Merge branch 'MDL-40297_25' of git://github.com/stronk7/moodle into MOODLE_25_STABLE 2013-07-02 13:43:45 +08:00
Andreas Grabs e235c97f09 MDL-39570 mod_feedback - Missing privilege check 2013-07-02 13:36:51 +08:00
Dan Poltawski d7e626156e Merge branch 'w27_MDL-40399_m25_msarrayshift' of https://github.com/skodak/moodle into MOODLE_25_STABLE 2013-07-02 13:33:59 +08:00
Dan Marsden 0bde9de161 MDL-39628 Chat: check mod/chat:chat capability when using daemon.
Thanks to Francois Gauthier for report/fix.
2013-07-02 12:18:24 +08:00
Jason Fowler dafe65e438 MDL-37818 - RSS - Prevent access to blocks while RSS context errors are displayed 2013-07-02 10:03:57 +08:00
Dan Poltawski 204383e50d Merge branch 'w27_MDL-40266_m25_arrayshift' of https://github.com/skodak/moodle into MOODLE_25_STABLE 2013-07-02 09:55:24 +08:00
Eloy Lafuente (stronk7) f1293083a2 Merge branch 'get_users_by_capability_fix_m25' of http://github.com/timgus/moodle into MOODLE_25_STABLE 2013-07-02 00:46:38 +02:00
Sam Hemelryk f0d974fb28 Merge branch 'MDL-39733_25' of git://github.com/stronk7/moodle into MOODLE_25_STABLE 2013-07-02 10:31:28 +12:00
Eloy Lafuente (stronk7) 16a2860ad2 MDL-39733 xhprof: implement import of runs 2013-07-02 00:27:30 +02:00
Rossiani Wijaya bb9024d9d4 MDL-39546 Lesson module: removed duplicate to decode special characters 2013-07-02 09:36:46 +12:00
Rossiani Wijaya a77f19bc47 MDL-39546 Lesson module: fixed matching question issues. 2013-07-02 09:36:32 +12:00
Eloy Lafuente (stronk7) 2bc8f21600 Merge branch 'w27_MDL-39754_m25_evn26' of https://github.com/skodak/moodle into MOODLE_25_STABLE 2013-07-01 23:14:05 +02:00
Eloy Lafuente (stronk7) 75b8d4a146 Merge branch 'MDL-40370_25' of git://github.com/timhunt/moodle into MOODLE_25_STABLE 2013-07-01 18:02:51 +02:00
Tim Hunt 33b4331eaf MDL-40370 qtype_shortanswer: unique index upgrade problem.
Eliminate duplicate rows before we try to add a unique index. We
arbitrarily keep the duplicate row with the lowest id.
2013-07-01 11:23:55 +01:00
Petr Škoda 00a2921469 MDL-39754 copy 2.5 requirements to Moodle 2.6
Optional features and warnings may be added later,
but we need at least required environment for 2.5.1

This includes database family cleanup and more realistic memory requirement.
2013-07-01 10:03:14 +02:00
Petr Škoda fc4523f8f3 MDL-40266 improve emulate_bound_params() for mssql driver
Looping over large numbers of items with array_shift() is expensive.
Reverse the array and fetch items from the top of the pile.

Credit goes to Martin Langhoff for original mysqli fix.
2013-07-01 08:52:51 +02:00
Petr Škoda 39714cb255 MDL-40266 improve emulate_bound_params() for sqlsrv driver
Looping over large numbers of items with array_shift() is expensive.
Reverse the array and fetch items from the top of the pile.

Credit goes to Martin Langhoff for original mysqli fix.
2013-07-01 08:52:51 +02:00
Mark Nielsen c11621b415 MDL-40308: Privacy settings do not change
Update LTI mod form so checkboxes always submit their value.
2013-07-01 11:27:43 +08:00
Dan Poltawski 7698803c95 Merge branch 'wip-MDL-40344-m25' of git://github.com/samhemelryk/moodle into MOODLE_25_STABLE 2013-07-01 11:22:05 +08:00
Sam Hemelryk ebc9b6d158 Merge branch 'MDL-40069_25' of git://github.com/timhunt/moodle into MOODLE_25_STABLE 2013-07-01 13:47:50 +12:00
Sam Hemelryk ae754bba07 NOBUG: fixed whitespace 2013-07-01 13:24:04 +12:00
Sam Hemelryk d20391916c Merge branch 'wip-MDL-39741-m25' of git://github.com/marinaglancy/moodle into MOODLE_25_STABLE
Conflicts:
	theme/bootstrapbase/style/moodle.css
2013-07-01 13:17:48 +12:00
Sam Hemelryk 9a561bc5a1 Merge branch 'MDL-35206-email-links_25' of git://github.com/mudrd8mz/moodle into MOODLE_25_STABLE 2013-07-01 13:08:15 +12:00
Eloy Lafuente (stronk7) 7af092c2d6 MDL-39733 profiling: UI for importing runs 2013-07-01 01:39:55 +02:00
Eloy Lafuente (stronk7) 706db16531 MDL-39733 profiling: UI for exporting runs 2013-07-01 01:39:50 +02:00
Eloy Lafuente (stronk7) e3c2cb4656 MDL-39733 xhprof: implement export of runs 2013-07-01 01:39:45 +02:00
Andrew Nicols 2738bb2c2f MDL-40376 Themes: Remove padding from course/manage page 2013-06-30 19:28:41 +01:00
Martin Langhoff c17768973e MDL-40266 improve emulate_bound_params() for mysqli
Looping over large numbers of items with array_shift() is expensive.
Reverse the array and fetch items from the top of the pile.
2013-06-30 18:39:53 +02:00
Eloy Lafuente (stronk7) 11ffc395f4 MDL-40389 Test "parent" course/category generators
Verify that the category->parent switchers for
course & category behat generators are happening
as expected. Use the manage courses page for that.
2013-06-30 18:10:25 +02:00
Eloy Lafuente (stronk7) 1608fbe7c0 MDL-40297 whitespace, comments & var names cleanup 2013-06-30 16:48:44 +02:00
Dmytro Vorona 0927af1e8d MDL-40297 Hide empty categories in my courses
This is a followup of MDL-38631 were was detected that
whith categories being displayed in my courses, some of
them, not having courses for the user, were still shown.

With this patch, any category in the tree, not having courses
is automatically hidden, any depth.
2013-06-30 16:48:39 +02:00
Tim Hunt 77504426de MDL-40069 question/type/upgrade.txt editing changes
Try to more clearly document what question type authors need to do to
upgrade their question types.
2013-06-28 18:21:04 +01:00
Colin Chambers 2fe9be7a9e MDL-40069 Document editing form changes 2013-06-28 18:21:02 +01:00
David Mudrák 52d485c435 MDL-35206 Fix the links list enumeration in the html2text library 2013-06-28 13:13:29 +02:00
Colin Chambers 93a2a0e3d7 MDL-40282 Collapsible editor loses border in IE8-9 2013-06-28 11:23:47 +01:00
Mary Evans dc59a1b1f9 MDL-40131 theme_bootstrapbase: added missing grader table css to less/moodle/grade.less 2013-06-28 02:45:29 +01:00
Sam Hemelryk 21d9cb723b MDL-40344 navigation: expandable branch id is now properly unique 2013-06-28 09:59:09 +12:00
Eloy Lafuente (stronk7) 32e550a6eb weekly release 2.5+ 2013-06-27 20:12:40 +02:00
Eloy Lafuente (stronk7) 97a7b6a7aa Merge branch 'install_25_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_25_STABLE 2013-06-27 20:05:10 +02:00
Marina Glancy 3c4c23876c MDL-39741 removed unused css classes 2013-06-27 22:18:59 +10:00
David Monllao ff46f98998 MDL-40246 mod_forum: Changing scenario to non-JS
Also replacing hardcoded waits for a
wait to be redirected.
2013-06-27 15:13:12 +08:00
Marina Glancy 00b4836197 MDL-40353 fixed wrong redirection on course group page 2013-06-27 13:45:16 +10:00
Marina Glancy 4af378d743 MDL-39741 Use CSS class dimmed_text instead of hidden in grader report 2013-06-27 12:36:11 +10:00
AMOS bot fab0986a5b Automatically generated installer lang files 2013-06-27 00:40:24 +00:00
Eloy Lafuente (stronk7) 866ab6e1ce Merge branch 'w26_MDL-39701_m25_filterupgrade' of git://github.com/skodak/moodle into MOODLE_25_STABLE 2013-06-26 12:30:51 +02:00
Petr Škoda 0b675e0ca2 MDL-39701 prevent string filtering before finishing 2.5 upgrade 2013-06-26 09:51:03 +02:00
Eloy Lafuente (stronk7) 3166c21471 Merge branch 'MDL-40033_25' of git://github.com/dmonllao/moodle into MOODLE_25_STABLE 2013-06-25 12:08:25 +02:00
Gareth J Barnard 2ab1b3de30 MDL-40204 theme_bootstrapbase & theme_clean: Fix RTL 3 column lyt with 1 blk. 2013-06-25 11:38:27 +12:00
Sam Hemelryk 6e07abb32d Merge branch 'wip-MDL-40065-m25_4' of git://github.com/gjb2048/moodle into MOODLE_25_STABLE 2013-06-25 09:58:44 +12:00
Sam Hemelryk bc0227d3e5 Merge branch 'w26_MDL-40289_m25_badgescaps' of git://github.com/skodak/moodle into MOODLE_25_STABLE 2013-06-25 09:13:05 +12:00
Eloy Lafuente (stronk7) e9d80e664b Merge branch 'w26_MDL-40233_m25_frontset' of git://github.com/skodak/moodle into MOODLE_25_STABLE 2013-06-24 21:29:13 +02:00
Eloy Lafuente (stronk7) ffc480afbd Merge branch 'MDL-40264-m25-essay-zero' of git://github.com/ktemkin/moodle into MOODLE_25_STABLE 2013-06-24 21:23:43 +02:00
Eloy Lafuente (stronk7) 3d4a0f2887 Merge branch 'w26_MDL-40254_m25_flatfile' of https://github.com/skodak/moodle into MOODLE_25_STABLE 2013-06-24 21:13:06 +02:00
Eloy Lafuente (stronk7) 9067595bf3 Merge branch 'MDL-34610_25' of git://github.com/timhunt/moodle into MOODLE_25_STABLE 2013-06-24 20:21:30 +02:00
Eloy Lafuente (stronk7) 94a541f7ff Merge branch 'MDL-40255_M25' of git://github.com/lazydaisy/moodle into MOODLE_25_STABLE 2013-06-24 19:26:22 +02:00
Eloy Lafuente (stronk7) 3e6f11b240 Merge branch 'm25_MDL-40200_Notices_When_Viewing_Profile_Invalid_UserId' of https://github.com/scara/moodle into MOODLE_25_STABLE 2013-06-24 19:00:43 +02:00
Sam Chaffee 7991637057 MDL-40258: Fixed invalid json string error in file-picker 2013-06-24 18:56:54 +02:00
Ankit Agarwal 4f61afa0b7 MDL-40250 phpunit: Add unit tests for core_files_external::upload() 2013-06-24 18:06:26 +02:00
Gareth J Barnard fb42a8c761 MDL-40065 theme_bootstrapbase theme_clean: Simplify column lyts / fix blocks. 2013-06-24 16:59:11 +01:00
Sam Hemelryk 4418496864 Merge branch 'wip-MDL-39044-stable25' of git://github.com/phalacee/moodle into MOODLE_25_STABLE 2013-06-24 15:41:24 +12:00
Sam Hemelryk 82125f7a78 Merge branch 'w26_MDL-39701_m25_filterupgrade' of git://github.com/skodak/moodle into MOODLE_25_STABLE 2013-06-24 15:07:14 +12:00
Sam Hemelryk 9e5adb9305 Merge branch 'MDL-39779_m25' of git://github.com/rwijaya/moodle into MOODLE_25_STABLE 2013-06-24 14:33:04 +12:00
Sam Hemelryk 23dd6b7ebf Merge branch 'MDL-39760-MOODLE_25_STABLE' of https://github.com/lucisgit/moodle into MOODLE_25_STABLE 2013-06-24 14:29:56 +12:00
Frederic Massart af4bdb8c8d MDL-39280 form: Multiple select support disabledIf with multiple values 2013-06-24 14:20:33 +12:00
Sam Hemelryk 12a9b4ec3a Merge branch 'mdl25-MDL-40130-let-course-category-caching-be-used' of git://github.com/brki/moodle into MOODLE_25_STABLE 2013-06-24 11:43:54 +12:00
Sam Hemelryk 084b971bc8 MDL-38347 fixed whitespace 2013-06-24 11:29:26 +12:00
Jason Fowler df7662560b MDL-38347 - Calendar - Fixing arrow output on Android devices 2013-06-24 11:22:51 +12:00
Sam Hemelryk 405a60712b Merge branch 'MDL-28124_M25' of git://github.com/lazydaisy/moodle into MOODLE_25_STABLE 2013-06-24 10:30:08 +12:00
Amanda Doughty bce7b6d40e MDL-38376 mod_assign: Feedback displayed when Grade set to hidden 2013-06-24 10:22:34 +12:00
Petr Škoda 55384d2016 MDL-40254 ignore flatfile records with no user idnumber 2013-06-23 21:38:39 +02:00
Petr Škoda f8bb8999e8 MDL-40289 fix block_badges capability defaults 2013-06-23 12:34:02 +02:00
Petr Škoda 2fbf721f27 MDL-40289 fix all badges capabilities
1/ contextlevel must be the lowest level where capability can be overriden
2/ coursecreator is for course creation only!!!
3/ do not mix user with other archetypes
4/ config risk is for admin actions only in standard install

No upgrade cleanup, sorry, blame integrators...
2013-06-23 12:23:50 +02:00
Mary Evans 233edd4dde MDL-40255 theme_boxxie/theme_formfactor: Added block-region class to layout files to enable dnd file uploader to work. 2013-06-22 21:24:23 +01:00
Petr Škoda 75f1afeda0 MDL-39701 prevent filters before finishing 2.5 upgrade
This prevents problems with unsigned integers in MySQL 5.5
2013-06-22 22:23:25 +02:00
Petr Škoda 808043d356 MDL-40233 add proper cache invalidation on frontpage setting save 2013-06-22 22:19:27 +02:00
Matteo Scaramuccia da0c3ea381 MDL-40200 Administration: Return the invalid user message and stop there
To avoid adding duplicate code, 'invalid user' and 'user deleted' checks
have been merged together.
2013-06-22 10:00:59 +02:00
Marina Glancy a028ac4aaf MDL-38631 link categories in My courses only when needed 2013-06-22 16:25:43 +10:00
Dmytro Vorona 02e1c8ad20 MDL-38631 Fixed faulty add_category call, introduced in 758103 2013-06-22 16:25:42 +10:00
Tim Hunt 3174f09839 MDL-34610 remove legacy IE CSS. It breaks form layout 2013-06-21 21:57:37 +01:00
Brian King 1a703d311e MDL-40130 Caching: let make_categories_list use the cache it makes 2013-06-21 11:14:08 +02:00
David Monllao 922a5cf370 MDL-40033 behat: Waiting until file manager is available 2013-06-21 15:36:41 +08:00
Dan Poltawski e978b66009 weekly release 2.5+ 2013-06-21 13:30:52 +08:00
Dan Poltawski 8e29fe2d72 Merge branch 'install_25_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_25_STABLE 2013-06-21 13:29:46 +08:00
Kyle Temkin 11f6680dee MDL-40264 fix essay handling of zero-string response
Fixes an inappropriate behavior of the is_complete_response() function
for the Essay question type, which caused the string "0" to be
inappropriately marked as an incomplete response.

Also adds a set of unit tests for the Essay question type's
is_complete_response.
2013-06-20 19:12:21 -04:00
Tim Gus 0bad576425 MDL-40259 - For SCORM reports limit fields returned from
get_users_by_capability to user ID to decrease memory utilization
2013-06-20 15:56:07 -04:00
Jason Fowler 1620d20165 MDL-39044 - Course Completion - Replaceing strtolower with multibyte safe textlib::strtolower 2013-06-20 08:49:38 +08:00
Ruslan Kabalin e2d5b6cbc8 MDL-39760: mod_assign: Add few more callback methods.
Adds lock, unlock and release_to_draft. All of them accept single parameter -
an assign_submission record.
2013-06-19 15:34:02 +01:00
Yuliya Bozhko e787333622 MDL-40022 badges: Fix missing calls to setType in course criteria settings 2013-06-19 13:41:49 +08:00
David Monllao 4ab623b9b6 MDL-40109 behat: Fixing backup feature 2013-06-19 09:14:05 +08:00
Marina Glancy 8526be5612 Merge branch 'MDL-40207-25' of git://github.com/danpoltawski/moodle into MOODLE_25_STABLE 2013-06-18 15:38:20 +10:00
Ruslan Kabalin eede0dbd7b MDL-33546: course: Fix current week hightlighting after dragging the section 2013-06-18 13:02:27 +10:00
Marina Glancy 4d7c173514 Merge branch 'MDL-40165-m25' of git://github.com/andrewnicols/moodle into MOODLE_25_STABLE 2013-06-18 12:57:06 +10:00
Sam Hemelryk 70d4b3182d Merge branch 'MDL-39634_25' of git://github.com/dmonllao/moodle into MOODLE_25_STABLE 2013-06-18 14:50:47 +12:00
Nadav Kavalerchik 32a3dc0ec0 MDL-40180 - RTL/Clean theme: Misalignment of student name and profile image in grader (fixed by Mary Evans)
Conflicts:
	theme/bootstrapbase/style/moodle.css
2013-06-18 10:43:48 +08:00
Sam Hemelryk 663c69e974 Merge branch 'MDL-40036-25' of git://github.com/FMCorz/moodle into MOODLE_25_STABLE 2013-06-18 13:59:30 +12:00
Sam Hemelryk eaf4854359 Merge branch 'MDL-39865-25' of git://github.com/FMCorz/moodle into MOODLE_25_STABLE 2013-06-18 13:54:56 +12:00
Marina Glancy 04597742cf Merge branch 'MDL-38079_25' of git://github.com/mr-russ/moodle into MOODLE_25_STABLE 2013-06-18 11:13:26 +10:00
Eloy Lafuente (stronk7) f68a2c50e6 MDL-40137 Whitespace fix 2013-06-18 01:47:44 +02:00
Eloy Lafuente (stronk7) 5e069cbd96 Merge branch 'wip-MDL-40137-m25' of git://github.com/samhemelryk/moodle into MOODLE_25_STABLE 2013-06-18 01:45:27 +02:00
Sam Hemelryk 3d19b183c6 Merge branch 'wip-mdl-39863-m25' of git://github.com/rajeshtaneja/moodle into MOODLE_25_STABLE 2013-06-18 11:19:30 +12:00
Sam Hemelryk d81ebc8f0d Merge branch 'MDL-40109_25' of git://github.com/dmonllao/moodle into MOODLE_25_STABLE 2013-06-18 11:07:57 +12:00
Eloy Lafuente (stronk7) 5cc26839e7 Merge branch 'w25_MDL-40210_m25_badgescaps' of git://github.com/skodak/moodle into MOODLE_25_STABLE 2013-06-18 00:56:11 +02:00
Eloy Lafuente (stronk7) a831f154ae Merge branch 'MDL-33562-25' of git://github.com/danpoltawski/moodle into MOODLE_25_STABLE
Conflicts:
	lib/db/upgrade.php
	version.php
2013-06-18 00:44:17 +02:00
Sam Hemelryk 54c7d518f3 Merge branch 'MDL-30132_M25' of git://github.com/lazydaisy/moodle into MOODLE_25_STABLE 2013-06-18 10:26:53 +12:00
Petr Škoda ec18ffb86c MDL-40210 do not use CAP_PREVENT for role defaults! 2013-06-17 12:13:20 +02:00
Russell Smith 842aac5ecb MDL-38079 mod_feedback - Hide "add question to activity" button 2013-06-17 19:59:37 +10:00
David Monllao dc24efe971 MDL-40110 behat: AM/PM strings are OS-dependant, removing this part from tests 2013-06-17 17:06:38 +08:00
Dan Poltawski 160e432aee Merge branch 'MDL-39825_master' of https://github.com/totara/openbadges into MOODLE_25_STABLE 2013-06-17 16:41:15 +08:00
Dan Poltawski e38c37939a Merge branch 'wip-MDL-40136-m25' of git://github.com/samhemelryk/moodle into MOODLE_25_STABLE 2013-06-17 13:37:23 +08:00
Sam Hemelryk e15bf9b1e5 Merge branch 'm25_MDL-40095_Completion_locked_Error_on_save' of https://github.com/scara/moodle into MOODLE_25_STABLE 2013-06-17 16:10:38 +12:00
Sam Hemelryk 1d1b52eb0c Merge branch 'MDL-21933_25' of https://github.com/mr-russ/moodle into MOODLE_25_STABLE 2013-06-17 15:45:33 +12:00
Sam Hemelryk 209658eab2 Merge branch 'wip-MDL-40091-MOODLE_25_STABLE' of git://github.com/satrun77/moodle into MOODLE_25_STABLE 2013-06-17 15:43:18 +12:00
Rossiani Wijaya 49a60b6c65 MDL-39779 wiki module: fix the alignment for required label to display inline on mobile devices 2013-06-17 11:42:47 +08:00
Sam Hemelryk 8c155823cc Merge branch 'MDL-39369_m25' of git://github.com/rwijaya/moodle into MOODLE_25_STABLE 2013-06-17 15:10:21 +12:00
Dan Poltawski 3c4fcce769 MDL-40207 simplepie: reduce false failures in unit tests
The simplepie tests time out too quickly due to a low connect timeout,
to fix this, I converted the unit tests to use a high timeout value.
2013-06-17 10:46:53 +08:00
Sam Hemelryk 443563a82e Merge branch 'MDL-39761-MOODLE_25_STABLE' of https://github.com/lucisgit/moodle into MOODLE_25_STABLE 2013-06-17 14:26:37 +12:00
David Monllao 346765035a MDL-39634 behat: Adding debugging() messages to deprecated methods 2013-06-17 09:02:39 +08:00
David Monllao 944fd1ca83 MDL-39634 behat: Adding deprecated methods
To keep compatibility if someone is
already using these methods.
2013-06-17 09:01:38 +08:00
David Monllao ded65ca8e0 MDL-39634 behat: Removing unused arguments 2013-06-17 08:59:59 +08:00
AMOS bot 2bf9edf84f Automatically generated installer lang files 2013-06-17 00:43:36 +00:00
Marina Glancy 29a4508930 Merge branch 'wip-MDL-40142-m25' of git://github.com/samhemelryk/moodle into MOODLE_25_STABLE 2013-06-17 10:40:39 +10:00
Sam Hemelryk bda2a7bdf5 MDL-39949 dock: fixed whitespace 2013-06-17 10:24:53 +12:00
Jason Fowler 64ddb28dfd MDL-39949 - Blocks - preventing blocks with empty titles from blocking the execution of javascript 2013-06-17 10:01:44 +12:00
Sam Hemelryk 6fa5e8658a MDL-40137 theme_clean: corrected lib.php function names 2013-06-17 09:39:20 +12:00
Sam Hemelryk 43dc7aa976 MDL-40136 cache: fixed dirroot change bugs with plugin caches 2013-06-17 09:23:47 +12:00
Sam Hemelryk 5d9349b61a MDL-40142 navigation: fixed chainable issue with navigation JS 2013-06-17 09:12:43 +12:00
Mary Evans ff24397ff3 MDL-28124 admin/tool/customlang: Changed page layout from 'standard' to 'report'. 2013-06-14 23:27:34 +01:00
Mohamed Alsharaf de5568b18e MDL-40091 book: revision must be incremented after editing a chapter 2013-06-14 21:28:31 +12:00
Marina Glancy d3cf194050 weekly release 2.5+ 2013-06-14 13:53:28 +10:00
Marina Glancy 37d38a3125 Merge branch 'install_25_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_25_STABLE 2013-06-14 13:50:50 +10:00
Andrew Nicols 2804eb29c6 MDL-40165 Backup: Split out test classes into multiple files 2013-06-13 08:57:24 +01:00
Rossiani Wijaya e85e3bff3e MDL-39369: Lesson module: change settype PARAM_TEXT to PARAM_NOTAGS 2013-06-13 15:37:45 +08:00
Rossiani Wijaya 51c72ecaa5 MDL-39369: Lesson module: fix setType() properly 2013-06-13 15:36:16 +08:00
Dan Poltawski 30703dc8f2 MDL-39824: theme_bootstrap: initalise array before use
This causes warnings when no navigation items are returned.

Also fixed some bad whitespace.
2013-06-13 14:23:55 +08:00
Dan Poltawski 33beb96847 Revert "MDL-39832 Files: Revert MDL-39688 commit, 161be9206571787557eb5c11ee440c9e6ae93ca8"
This reverts commit d618e3c07d.
2013-06-13 13:57:02 +08:00
Dan Poltawski 7f742cece1 Revert "MDL-39832 Files: Fixed ETag format according with RFC2616."
This reverts commit 52286ac358.
2013-06-13 13:57:00 +08:00
Russell Smith ab0e64524d MDL-21933 course: Allow users to search participants course permission
Capability checks are performed at the top of the page and do not need
to be completed again.

Search is an expected feature for users and it was confusion to only
appear after 3 pages.  This has been changed to enable search when
there are more records than are visible on the screen.  If users
are unable to use browser search, they will be able to use Moodle's
search.
2013-06-13 12:43:29 +10:00
AMOS bot 2a93e8d72c Automatically generated installer lang files 2013-06-13 00:41:25 +00:00
Mary Evans 6780a2301e MDL-30312 User: Changed page layout from mydashboard to mypublic in user/profile.php 2013-06-12 21:33:28 +01:00
sam marshall 3a2e904098 MDL-39472 MUC: Optimise cache::get_from_persist_cache 2013-06-12 14:29:48 +08:00
Dan Poltawski 6117c578e4 Merge branch 'MDL-39773_b_m25' of git://github.com/rwijaya/moodle into MOODLE_25_STABLE
Conflicts:
	theme/bootstrapbase/style/moodle.css
2013-06-12 09:34:04 +08:00
Sam Hemelryk 69303857c7 Merge branch 'MDL-39940-25' of git://github.com/danpoltawski/moodle into MOODLE_25_STABLE 2013-06-12 09:06:33 +12:00
Sam Hemelryk a4848b4044 Merge branch 'MDL-39964-25' of git://github.com/danpoltawski/moodle into MOODLE_25_STABLE 2013-06-12 09:02:40 +12:00
Sam Hemelryk a6b980d13b Merge branch 'MDL-25901-25' of git://github.com/danpoltawski/moodle into MOODLE_25_STABLE 2013-06-12 09:00:11 +12:00
Sam Hemelryk 9e53bbd007 Merge branch 'w24_MDL-38109_m25_pluginlist' of git://github.com/skodak/moodle into MOODLE_25_STABLE 2013-06-12 08:53:49 +12:00
Sam Hemelryk e0699a7154 Merge branch 'wip-MDL-39798_M25' of git://github.com/gjb2048/moodle into MOODLE_25_STABLE
Conflicts:
	theme/bootstrapbase/style/moodle.css
2013-06-12 08:51:21 +12:00
Sam Hemelryk aa41f96d1a Merge branch 'wip-MDL-39820_M25_2' of git://github.com/gjb2048/moodle into MOODLE_25_STABLE
Conflicts:
	theme/bootstrapbase/style/moodle.css
2013-06-12 08:46:45 +12:00
Petr Škoda e4fcb52f44 MDL-38109 use always get_plugin_list() to get list of plugins
get_list_of_plugins() is NOT intended for real plugins, only plugin like directories.
2013-06-11 10:23:14 +02:00
Dan Poltawski bacf4c5c71 Merge branch 'wip-MDL-40087_M25' of git://github.com/gjb2048/moodle into MOODLE_25_STABLE
Conflicts:
	theme/bootstrapbase/style/moodle.css
2013-06-11 16:00:51 +08:00
Dan Poltawski 43c5a7d5ad Merge branch 'wip-MDL-40100-m25' of git://github.com/samhemelryk/moodle into MOODLE_25_STABLE 2013-06-11 15:35:31 +08:00
Sam Hemelryk 624f270a26 Merge branch 'MDL-26925-25' of git://github.com/danpoltawski/moodle into MOODLE_25_STABLE 2013-06-11 17:31:36 +12:00
Sam Hemelryk 313bcd5268 Merge branch 'MDL-22390_25' of git://github.com/timhunt/moodle into MOODLE_25_STABLE 2013-06-11 17:07:24 +12:00
Mark Nelson 5a21d336f3 MDL-40010 notes: passing an object rather than an id to avoid debugging message 2013-06-11 13:05:40 +08:00
Dan Poltawski f60ad3fdff Merge branch 'm25_MDL-40002_ETag_value_must_be_a_quoted-string' of https://github.com/scara/moodle into MOODLE_25_STABLE 2013-06-11 12:54:38 +08:00
Jason Fowler 2daa9998ae MDL-39746 - Themes - Hiding the user picture on the forum page when the screensize is too small to allow for it
Conflicts:
	theme/bootstrapbase/style/moodle.css
2013-06-11 11:25:04 +08:00
Rajesh Taneja 6079448098 MDL-39863 Administration: Show confirmation/notice and don't redirect automatically 2013-06-11 10:24:51 +08:00
Tim Lock 992c0ec50d MDL-40120: Fix get_course_records() which breaks in PSQL 2013-06-11 13:47:05 +12:00
sam marshall aca67ae8b0 MDL-39454 Accesslib: is_siteadmin is a bit slow 2013-06-11 12:27:09 +12:00
Matteo Scaramuccia 474c13f27f MDL-40095 SCORM: Trivial comments tidy up 2013-06-10 20:52:24 +02:00
Matteo Scaramuccia 7480e99306 MDL-40095 SCORM: Fixed DML error when saving with completion options locked
Regression caused by MDL-38315.
2013-06-10 20:52:14 +02:00
Dan Poltawski 96241e57e9 Merge branch 'MDL-39947_25' of https://github.com/aolley/moodle into MOODLE_25_STABLE 2013-06-10 16:20:30 +08:00
Dan Poltawski ade2afc29f Merge branch 'MDL-39338_M25' of git://github.com/lazydaisy/moodle into MOODLE_25_STABLE
Conflicts:
	theme/bootstrapbase/style/moodle.css
2013-06-10 16:07:28 +08:00
Dan Poltawski 534f1476f4 Merge branch 'm25_MDL-39832_Fix_Chrome_Issues_ETag_XSendfile' of https://github.com/scara/moodle into MOODLE_25_STABLE 2013-06-10 15:42:53 +08:00
Rajesh Taneja b625e48b87 MDL-39639 Formslib: Hide calendar for datetime element on disable event 2013-06-10 15:29:16 +08:00
Dan Poltawski a327e87866 Merge branch 'MDL-40018_M25' of git://github.com/lazydaisy/moodle into MOODLE_25_STABLE 2013-06-10 15:00:20 +08:00
Dan Poltawski 0f74c82897 Merge branch 'MDL-40013_25stable' of git://github.com/oasychev/moodle into MOODLE_25_STABLE 2013-06-10 14:58:12 +08:00
David Mudrák 3ee63c14e0 MDL-40080 Remove unused strings from the core_hub subsystem 2013-06-10 14:41:53 +08:00
Mark Nelson f31670ef40 MDL-40008 forms: fixed ordering of the calendar icon and enable checkbox for the date selector element 2013-06-10 14:25:14 +08:00
David Monllao b1f151c933 MDL-40109 format_weeks: Removing extra space 2013-06-10 13:31:22 +08:00
Dan Poltawski 7f9f03442a Merge branch 'w24_MDL-39096_m25_obfuscate' of git://github.com/skodak/moodle into MOODLE_25_STABLE 2013-06-10 13:12:16 +08:00
Dan Poltawski 9d1a909f0e Merge branch 'w24_MDL-28394_m25_enrolrestore' of git://github.com/skodak/moodle into MOODLE_25_STABLE 2013-06-10 12:17:04 +08:00
Yuliya Bozhko 8b7c33ae77 MDL-39825 badges: Remove badges from course navigation when course badges are disabled 2013-06-10 16:16:59 +12:00
Dan Poltawski c9d1c4993d Merge branch 'm25_MDL-37968' of git://github.com/danmarsden/moodle into MOODLE_25_STABLE 2013-06-10 12:09:59 +08:00
Mary Evans 7b9caeb92b MDL-39016 theme_bootstrapbase: Added login info and home link to footer in both boostrapbase & clean layout/general.php 2013-06-10 16:04:22 +12:00
Mark Nelson 49acbbad2f MDL-40009 notes: corrected the form element names passed to setType 2013-06-10 15:55:53 +12:00
Sam Hemelryk afe247a0ca Merge branch 'w24_MDL-39549_m25_cohortsearch' of git://github.com/skodak/moodle into MOODLE_25_STABLE 2013-06-10 15:48:11 +12:00
Sam Hemelryk f7c2942961 Merge branch 'MDL-39971_25' of git://github.com/timhunt/moodle into MOODLE_25_STABLE 2013-06-10 15:09:34 +12:00
Dan Poltawski 6f4232974e Merge branch 'wip-MDL-39824-m25' of http://github.com/samhemelryk/moodle into MOODLE_25_STABLE 2013-06-10 10:54:27 +08:00
Sam Hemelryk f981643f58 Merge branch 'MDL-39978_25' of git://github.com/timhunt/moodle into MOODLE_25_STABLE 2013-06-10 14:44:40 +12:00
Sam Hemelryk 2f8602990f Merge branch 'w24_MDL-32480_m25_imscp' of git://github.com/skodak/moodle into MOODLE_25_STABLE 2013-06-10 14:41:07 +12:00
Sam Hemelryk 7174920aaa MDL-39824 theme: tweaking upgrade note version 2013-06-10 14:34:25 +12:00
Jason Fowler 57ecff6356 MDL-39608 - Bootstrap - Chaning the thresholds and width values for the Form labels
Conflicts:
	theme/bootstrapbase/style/moodle.css
2013-06-10 14:28:54 +12:00
AMOS bot 2d69af043d Automatically generated installer lang files 2013-06-10 00:39:09 +00:00
Andrew Davis a1d43d9e4f MDL-36090 core_grade: added logging of overriding of student grades 2013-06-10 12:35:03 +12:00
Sam Hemelryk 08c2a3ca1f Merge branch 'wip-MDL-40088-m25' of git://github.com/marinaglancy/moodle into MOODLE_25_STABLE 2013-06-10 12:14:04 +12:00
Jason Fowler fbc635e400 MDL-39227 - SCORM - repositioning the navigation panel to be visible in all themes at all resolutions 2013-06-10 11:59:36 +12:00
Sam Hemelryk 00afef17bb Merge branch 'MDL-39979-25' of git://github.com/FMCorz/moodle into MOODLE_25_STABLE 2013-06-10 11:33:59 +12:00
Sam Hemelryk c174a19207 MDL-40100 cache: removed unneeded includes from add instance forms 2013-06-10 10:26:27 +12:00
Sam Hemelryk d89fbe0285 MDL-39871 themes: can now specify regions to swap when using rtl langs
Conflicts:
	lib/pagelib.php
2013-06-10 09:31:05 +12:00
Sam Hemelryk ddf1b0741d MDL-39824 theme: changes recorded in theme/upgrade.txt 2013-06-10 09:29:58 +12:00
Sam Hemelryk dac7c261ca MDL-39824 output: fixed bug when moving blocks with rtl lang 2013-06-10 09:29:58 +12:00
Sam Hemelryk 8504444307 MDL-40089 theme_clean: simplified layouts and converted to new OUTPUT API 2013-06-10 09:29:58 +12:00
Sam Hemelryk 602255df1a MDL-40089 theme_clean: moved general to columns3.php as prep 2013-06-10 09:29:58 +12:00
Sam Hemelryk ee7a52ae91 MDL-39842 js: fixed block drag and drop 2013-06-10 09:29:58 +12:00
Sam Hemelryk 6964e6a580 MDL-39824 theme_bootstrapbase: converted $PAGE use to new $OUTPUT methods. 2013-06-10 09:29:58 +12:00
Sam Hemelryk 5c8c94eabe MDL-40089 theme_bootstrapbase: moved general to columns3.php as prep 2013-06-10 09:29:57 +12:00
Sam Hemelryk 00f906b114 MDL-39824 output: tidied up output before bootstrap cleaning
Conflicts:
	lib/pagelib.php
2013-06-10 09:29:03 +12:00
Sam Hemelryk 2d28b03d90 MDL-39839 renderer: new methods for calls appearing in theme layouts 2013-06-10 09:28:24 +12:00
Sam Hemelryk 03fa7a2ba3 MDL-39838 renderer: new methods for body classes and id 2013-06-10 09:28:24 +12:00
Sam Hemelryk cd79352fbd MDL-39841 renderer: new method to renderer blocks with predictable structure 2013-06-10 09:28:24 +12:00
Matteo Scaramuccia f082c5e390 MDL-40002 Files: ETag value must be a quoted-string.
ETag value must be double quoted, http://tools.ietf.org/html/rfc2616#section-3.11.
More details about potential impacts in MDL-39832: shortly, at least when using
HTTP Partial GET Requests (HTTP Status: 206) plus X-Sendfile HTTP Header.
In this commit, the impact is to be RFC2616 compliant when using the ETag Header.
2013-06-09 10:14:02 +02:00
Tim Hunt 266ceb16a6 MDL-22390 autolink filter: handle URLs in brackets better.
This breaks some legitimate URLs like
http://en.wikipedia.org/wiki/Slash_(punctuation).
This is a necessary trade-off. Many other web systems do not handle that
case correctly either. The work-around it so escape the ) as %29.

This commit also improves the way the unit tests for this work.

It also fixes a couple of other tricky cases that were spotted in
the forums while this was being discussed. See the new test cases.
2013-06-08 17:28:53 +01:00
Gareth J Barnard 35b76a3507 MDL-39798 theme_bootstrapbase: Improve layout for course participation reports. 2013-06-08 13:55:22 +01:00
Petr Škoda 06de509918 MDL-39096 fix obfuscate_text() utf-8 compatibility 2013-06-07 22:43:26 +02:00
Petr Škoda 788e1924a2 MDL-39549 fix cohort search in course categories 2013-06-07 22:07:53 +02:00
Gareth J Barnard 9bc4a4cc79 MDL-40087 theme_bootstrapbase: Turn editing on button misaligned on nav bar. 2013-06-07 18:15:34 +01:00
Petr Škoda d98b9a945e MDL-28394 fix enrolment method restore logic
This patch fixes:
* missing enrolment methods after 1.9 backup restore - defaults are added
* enrolment methods are restored only when users option is enabled
* manual enrolment override option is disabled if users not available
2013-06-07 10:03:25 +02:00
Petr Škoda 4ab6c6fbc0 MDL-32480 allow external https links in IMSCP too 2013-06-07 09:58:54 +02:00
Nicolas Dunand a2ec961309 MDL-32480 fix display of IMS content packages with external links 2013-06-07 09:58:53 +02:00
Marina Glancy 86882b6dfe MDL-40088 fixed bug with not visible course section 2013-06-07 13:58:57 +10:00
Dan Marsden ff3a54a5f7 MDL-37968 course_overview: add dim class to hidden courses for teachers. 2013-06-07 14:39:29 +12:00
Mary Evans 82887b29e8 MDL-39338 core_question: Make history box a .well 2013-06-06 22:57:09 +01:00
Matteo Scaramuccia 52286ac358 MDL-39832 Files: Fixed ETag format according with RFC2616.
ETag must be double quoted,
http://tools.ietf.org/html/rfc2616#section-3.11:

      entity-tag = [ weak ] opaque-tag
      weak       = "W/"
      opaque-tag = quoted-string
2013-06-06 23:11:15 +02:00
Matteo Scaramuccia d618e3c07d MDL-39832 Files: Revert MDL-39688 commit, 161be92065
MDL-39688 has been successful in providing a solution for the issue but further
investigations done in MDL-39832 have got the evidence that the given solution
is more likely a workaround.
2013-06-06 23:11:14 +02:00
Oleg Sychev 14e5c99960 MDL-40013 Easier to override saving question hints
This adds 3 new methods, called from question_type::save_hints,
to make it easier for different question types to overload this
functionality without duplicating code.

Question types that will benefit from this change include
oumultiresponse, ddmarker, preg and correctwriting.
2013-06-06 19:59:33 +03:00
Frederic Massart 333df7d951 MDL-39979 navigation: Remove the use of an undefined variable 2013-06-06 14:53:27 +08:00
Dan Poltawski 6cf8499253 MDL-26925 User selector: Set label when no results
Thanks to Jonathon Fowler for the fix!
2013-06-06 14:09:39 +08:00
Frederic Massart a3fa82636d MDL-40036 user: Respect capability to ignore user quota 2013-06-06 12:43:34 +08:00
Dan Poltawski 1430866232 weekly release 2.5+ 2013-06-06 12:01:38 +08:00
Dan Poltawski 1c437c97f7 Merge branch 'install_25_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_25_STABLE 2013-06-06 11:55:07 +08:00
Dan Poltawski 0fbfae718d MDL-25901 rss: do not copyright html tag
They copyright field does not permit html, it should be plain text
2013-06-06 11:30:27 +08:00
Eloy Lafuente (stronk7) 61899ac202 Merge branch 'wip-MDL-38773-m25' of git://github.com/marinaglancy/moodle into MOODLE_25_STABLE 2013-06-05 19:32:14 +02:00
Eloy Lafuente (stronk7) 92c46e00eb Merge branch 'w23_MDL-39588_m25_ociinstall' of git://github.com/skodak/moodle into MOODLE_25_STABLE 2013-06-05 16:24:22 +02:00
Eloy Lafuente (stronk7) 1127607bce Merge branch 'w23_MDL-39503_m25_signup' of git://github.com/skodak/moodle into MOODLE_25_STABLE 2013-06-05 16:18:01 +02:00
Eloy Lafuente (stronk7) ef580461f6 Merge branch 'wip-MDL-21097-m25' of git://github.com/marinaglancy/moodle into MOODLE_25_STABLE 2013-06-05 10:36:22 +02:00
Dan Poltawski 2d0faffb7f MDL-39940 tags: missing setType call 2013-06-05 16:17:26 +08:00
Marina Glancy f9d68a11da MDL-21097 Correctly check capabilities for frontpage editing mode 2013-06-05 18:09:34 +10:00
Dan Poltawski 0a8985843e MDL-39964 report_progress: don't browser sniff for SVG support
Use feature detection, its more robust and better practice.
2013-06-05 15:42:26 +08:00
Dan Poltawski e0e6015416 Merge branch 'wip-MDL-21097-m25' of git://github.com/marinaglancy/moodle into MOODLE_25_STABLE 2013-06-05 13:10:18 +08:00
Rossiani Wijaya 9db4dcb68b MDL-39773 bootstrapbase: add style for .centerpadded.
Relocate .centerpadded styling from standard to base themes
2013-06-05 12:50:15 +08:00
Marina Glancy 6b52abc0af MDL-21097 corrected course editing roles 2013-06-05 14:27:50 +10:00
Mary Evans 179fbc7f11 MDL-39977 theme_bootstrapbase: Changes the way Clean theme's login takes its navbar styles from Bootstrapbase.
Conflicts:
	theme/bootstrapbase/style/moodle.css
2013-06-05 10:13:39 +08:00
Marina Glancy 28ce5653c0 MDL-38773 Purge coursecat cache on course restore 2013-06-05 12:05:05 +10:00
Brian King c017ccff4c MDL-39409 auth/cas pass web proxy settings along to phpCAS 2013-06-05 02:46:25 +02:00
Eloy Lafuente (stronk7) ea85ee6f63 Merge branch 'w23_MDL-39416_m25_pagelog' of git://github.com/skodak/moodle into MOODLE_25_STABLE 2013-06-05 02:43:48 +02:00
AMOS bot 2fb98d4bc0 Automatically generated installer lang files 2013-06-05 00:39:45 +00:00
Dan Poltawski 9a0e9776c0 MDL-39968 bootstrapbase: uses non-standard browser sniffing
Also theme_clean does the same sniffing, but is not necessary as its
included by bootstrapbase
2013-06-05 02:34:13 +02:00
Eloy Lafuente (stronk7) 832aa7eb71 Merge branch 'MDL-38731-25' of git://github.com/danpoltawski/moodle into MOODLE_25_STABLE 2013-06-05 02:30:56 +02:00
Eloy Lafuente (stronk7) 0e73df9df6 Merge branch 'MDL-37332-25' of git://github.com/danpoltawski/moodle into MOODLE_25_STABLE 2013-06-05 02:27:35 +02:00
Matteo Scaramuccia ab8e75ef40 MDL-38545 Reports: PHP Strict Standards error in graph.php 2013-06-05 02:23:05 +02:00
Eloy Lafuente (stronk7) ef8a1c4908 Merge branch 'MDL-39790_master' of git://github.com/totara/openbadges into MOODLE_25_STABLE 2013-06-05 01:45:28 +02:00
Eloy Lafuente (stronk7) 0f51a82bae Merge branch 'wip-MDL-21097-m25' of git://github.com/marinaglancy/moodle into MOODLE_25_STABLE 2013-06-05 01:43:11 +02:00
Mary Evans 358544f9b7 MDL-40018 theme_sky_high: Fixed footer in admin pages. 2013-06-05 00:18:33 +01:00
Eloy Lafuente (stronk7) 36e5df06b3 MDL-39723 prevent update_courses() bad habits.
All the external functions end calling require_login() that is
always in charge of setting the $COURSE global. This is not a
problem, but in the case of core_course_external::update_courses()
testing, where we are, in the same "request", both setting and getting
the $COURSE information and it's clearly outdated, so the test fails.

Alternative solution would be to modify the external function to ensure
that, after updating a course, $COURSE is also updated with the changes
but it does not seem to be necessary for "normal" usage (both UI/WS POVs).
2013-06-04 21:49:35 +02:00
Eloy Lafuente (stronk7) 8c8b3eba24 Merge branch 'MDL-39723-m25' of git://github.com/sammarshallou/moodle into MOODLE_25_STABLE 2013-06-04 17:48:57 +02:00
Gareth J Barnard faccb2ba9f MDL-39820 theme_bootstrapbase: Fix form button alignment for badges. 2013-06-04 11:17:23 +01:00
Dan Poltawski bf2360c597 Merge branch 'MDL-39945_25' of git://github.com/timhunt/moodle into MOODLE_25_STABLE 2013-06-04 15:54:01 +08:00
Dan Poltawski e7bb4b1ee7 Merge branch 'MDL-39835_M25' of github.com:lazydaisy/moodle into MOODLE_25_STABLE 2013-06-04 14:43:13 +08:00
Dan Poltawski 2b7e18fded Merge branch 'wip-MDL-39819_M25' of git://github.com/gjb2048/moodle into MOODLE_25_STABLE
Conflicts:
	theme/bootstrapbase/style/moodle.css
2013-06-04 14:38:36 +08:00
Marina Glancy f85cb076aa MDL-39870 correctly determine whether activity is resource or module 2013-06-04 14:14:39 +08:00
Dan Poltawski 836dab79c0 MDL-39931 less: recompile with whitespace removed 2013-06-04 14:09:28 +08:00
Dan Poltawski 2fdfdd49d4 Merge branch 'MDL-39931-M25' of github.com:lazydaisy/moodle into MOODLE_25_STABLE 2013-06-04 13:32:33 +08:00
Dan Poltawski cb1318754e Merge branch 'MDL-39536-25' of git://github.com/FMCorz/moodle into MOODLE_25_STABLE 2013-06-04 13:19:16 +08:00
Frederic Massart 491e196107 MDL-39536 completion: Unit tests for get_activities and has_activities 2013-06-04 12:58:03 +08:00
Frederic Massart 13f73be25b MDL-39536 completion: Prevent DB call when fetching activities 2013-06-04 12:58:02 +08:00
David Mudrák 21c4402280 MDL-39939 Fix the basic SCORM report plugin name 2013-06-04 12:27:42 +08:00
Dan Poltawski 2140e5afa4 Merge branch 'wip-mdl-39827-m25' of git://github.com/rajeshtaneja/moodle into MOODLE_25_STABLE 2013-06-04 11:29:57 +08:00
Dan Poltawski acae4313c8 Merge branch 'MDL-39317-25' of git://github.com/damyon/moodle into MOODLE_25_STABLE 2013-06-04 11:26:33 +08:00
Frederic Massart 16725a78d0 MDL-39865 navigation: Removed unaccessible repositories node
A user is not allowed to edit another user's repositories, in any
circumstances. The repositories node under 'Profile setting for X'
does not make sense under those conditions.
2013-06-04 11:14:02 +08:00
Frederic Massart 3e17b1c4a7 MDL-39865 navigation: 'Profile settings for ...' always displayed
Before this patch, 'Profile settings for X' would only be displayed
if X can access the course, which means that if the course is hidden
the node would be hidden as well. We changed this so that the user
needs to be enrolled in the course.
2013-06-04 11:14:02 +08:00
Dan Poltawski e19a07bfcb Merge branch 'MDL-39743-25' of git://github.com/damyon/moodle into MOODLE_25_STABLE 2013-06-04 11:03:45 +08:00
Dan Poltawski c687e8d741 Merge branch 'wip_25_mdl-34085' of https://github.com/iarenaza/moodle into MOODLE_25_STABLE 2013-06-04 10:42:55 +08:00
AMOS bot 09c0ea1f39 Automatically generated installer lang files 2013-06-04 00:46:34 +00:00
Eloy Lafuente (stronk7) 1fe7be205c Merge branch 'wip-MDL-39801-m25' of git://github.com/marinaglancy/moodle into MOODLE_25_STABLE 2013-06-04 01:58:27 +02:00
Eloy Lafuente (stronk7) 6399a82028 MDL-39764 style: phpdoc changed to inline comments 2013-06-04 01:43:35 +02:00
Eloy Lafuente (stronk7) 8a2cee5091 Merge branch 'wip-MDL-39764_M25_3' of git://github.com/gjb2048/moodle into MOODLE_25_STABLE 2013-06-04 01:43:28 +02:00
Eloy Lafuente (stronk7) ca7f399be7 Merge branch 'w23_MDL-39882_m25_behatconfig' of git://github.com/skodak/moodle into MOODLE_25_STABLE 2013-06-04 01:32:12 +02:00
Damyon Wiese 6c37003d05 MDL-39821 assign: missing setType with advanced grading 2013-06-04 01:30:20 +02:00
Eloy Lafuente (stronk7) d1963974a9 MDL-39465 Show env. info instead of part twice. 2013-06-04 00:50:55 +02:00
Gareth J Barnard 3b4752e1f2 MDL-39764 course_format: Allow courses to have numsections > maxsections. 2013-06-03 23:43:24 +01:00
Eloy Lafuente (stronk7) 618737d7e9 Merge branch 'MDL-39936-25' of git://github.com/danpoltawski/moodle into MOODLE_25_STABLE 2013-06-04 00:05:04 +02:00
Eloy Lafuente (stronk7) 06ab9b8888 Merge branch 'w23_MDL-39465_m25_environment' of git://github.com/skodak/moodle into MOODLE_25_STABLE 2013-06-04 00:00:44 +02:00
Justin Filip c7abb11786 MDL-39166 auth_ldap Add triggers for user created/updated events. 2013-06-03 23:55:30 +02:00
Eloy Lafuente (stronk7) 73f8ab649f Merge branch 'wip-MDL-39710-m25' of git://github.com/marinaglancy/moodle into MOODLE_25_STABLE 2013-06-03 23:22:17 +02:00
Eloy Lafuente (stronk7) 189590bb37 Merge branch 'MDL-39932_25' of git://github.com/grabs/moodle into MOODLE_25_STABLE 2013-06-03 19:10:39 +02:00
Albert Gasset 827e54dde5 MDL-39487 mod/assign: fixed ID number of grade item changing 2013-06-03 19:05:55 +02:00
Eloy Lafuente (stronk7) 42a9e3efc2 Merge branch 'MDL-39987_M25' of git://github.com/lazydaisy/moodle into MOODLE_25_STABLE 2013-06-03 16:07:47 +02:00
Mary Evans f58fadfeba MDL-39987 theme_bootstrapbase: Fixed menunode text in renderers/core_renderer.php. 2013-06-02 23:17:14 +01:00
Petr Škoda f498ae7652 MDL-39416 do not try to get detailed perflog info before PAGE int 2013-06-02 13:35:40 +02:00
Petr Škoda dd85f5aed0 MDL-39588 require MOODLELIB Oracle package
Previously it was kind of optional, but it is now required. We also attempt to install it automatically now.
2013-06-02 11:14:10 +02:00
Mary Evans b91fcb9094 MDL-39835 theme_sky_high: Fix for footer to display correctly in higher resolutions. 2013-06-01 21:53:19 +01:00
Gareth J Barnard dfb83eb132 MDL-39819 theme_bootstrapbase: Fix icon alignment in filepicker. 2013-05-31 22:32:03 +01:00
Petr Škoda 1e558fdf66 MDL-39465 detect environment problems in tests
This should help explain why something else fails.
2013-05-31 22:03:15 +02:00
Tim Hunt 7dad4a5e59 MDL-39978 Essays with files break each attempt builds on last 2013-05-31 20:48:03 +01:00
Tim Hunt 8b2e668a19 MDL-39971 each attempt builds on last broken for previews. 2013-05-31 20:32:52 +01:00
Petr Škoda 65380ecd0a MDL-39503 tell robots to not index login and signup page
This should partially prevent people from googling moodle sites that allow signup. Please note you can not use login block if because it would still disclose the signup link.
2013-05-31 21:26:23 +02:00
Petr Škoda b5ce3bc8f4 MDL-39882 add required behat settings to config-dist 2013-05-31 21:09:05 +02:00
Marina Glancy 51173470b6 MDL-39710 Don't display rubric and guide preview unless option checked 2013-05-31 16:13:18 +10:00
Russell Boyatt 8df87c160f Fixing MDL-39710: setting to limit student access to rubric now checked. 2013-05-31 16:13:13 +10:00
Dan Poltawski e5326193bf MDL-38731 course: split course group settings header
Allow translators to translate the heading differently.

AMOS BEGIN
  CPY [groups,group],[groupsettingsheader,group]
AMOS END
2013-05-31 12:04:51 +08:00
Dan Poltawski e9fd6e5dd6 MDL-37332 portfolio: don't add double slashes
get_filepath() always returns trailing slash.

This breaks windows export - thanks to Jason Platts
2013-05-31 11:52:34 +08:00
Marina Glancy a74edf03ad MDL-39801 navigation_node::remove does not allow to insert nodes afterwards 2013-05-31 13:51:13 +10:00
Marina Glancy bd205fa484 MDL-39801 navigation_node::remove fails if first child does not have a key 2013-05-31 13:51:13 +10:00
Marina Glancy 93ac52a9f3 MDL-21097 Allow user to change current section if he does not have any other manageing capability 2013-05-31 13:20:16 +10:00
Marina Glancy db8d852af9 MDL-21097 Correctly check capabilities for course settings items
- Make sure that items in course settings (and frontpage settings) are shown depending on user capabilities
- Make sure user is able to turn editing on on the page even if he has only limited number of seciton/modules managing capabilities
2013-05-31 13:20:10 +10:00
Dan Poltawski 068373c86a MDL-33562 lib: remove deleted user tokens 2013-05-31 10:23:51 +08:00
Dan Poltawski 4c4c90f4b0 MDL-33562 lib: remove private keys when user deleted 2013-05-31 10:22:02 +08:00
AMOS bot a270a2c129 Automatically generated installer lang files 2013-05-31 00:43:06 +00:00
Adam Olley 096707c01d MDL-39947 mod_forum: Add safety check to variable assignment when counting unread posts 2013-05-31 09:50:05 +09:30
Andreas Grabs b4de832553 MDL-39932 mod_feedback - Mapping Feedback when Course is Deleted - thx to David N. Johnson 2013-05-30 23:11:37 +02:00
Tim Hunt f0dc1a71c1 MDL-39945 qtype multichoice was not comparing blank responses correctly. 2013-05-30 19:22:21 +01:00
Iñaki Arenaza 2f467a82a1 MDL-34085 Fix the backup options names in core_course_duplicate_course
Fix the option names to match those used by the backup subsystem.
2013-05-30 17:45:30 +02:00
Mary Evans 91cf8cc82c MDL-39931 theme_bootstrapbase: ported invisiblefieldset css rules from theme/base/core.css to less/moodle/core.css 2013-05-30 15:51:16 +01:00
Dan Poltawski 2e80405940 MDL-39936 upgrade: 2.5.0 line incorrectly positioned 2013-05-30 13:40:28 +08:00
Damyon Wiese f36066fa9e weekly release 2.5+ 2013-05-30 12:09:08 +08:00
Damyon Wiese a4e0171b2c Merge branch 'install_25_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_25_STABLE 2013-05-30 11:27:46 +08:00
AMOS bot 8352a1b138 Automatically generated installer lang files 2013-05-30 00:38:21 +00:00
Damyon Wiese 028b56f875 MDL-39317 assign: Fix for submitted filter on grading table.
Some old upgraded assignments have no timecreated column so use
a different one to check for a valid submission.
2013-05-29 14:50:42 +08:00
Ashley Holman e9efc2baa2 MDL-39743 assign: Fix missing capability check for "grant extension" 2013-05-29 12:04:22 +08:00
AMOS bot 7e720621ec Automatically generated installer lang files 2013-05-29 00:39:21 +00:00
Yuliya Bozhko 626c84bca9 MDL-39790 Add badges block to the course page 2013-05-29 09:42:11 +12:00
Eloy Lafuente (stronk7) 4bc4844d5b Merge branch 'w22_MDL-39676_m25_whereparam' of git://github.com/skodak/moodle into MOODLE_25_STABLE 2013-05-28 15:33:33 +02:00
sam marshall 695f6f3c23 MDL-39723 Remove unnecessary queries for COURSE, SITE 2013-05-28 13:16:03 +01:00
Damyon Wiese f4075573b9 MDL-39477: Remove some unused instances of $CFG
Also change @since tags to 2.5.1 because this will be backported.
2013-05-28 11:11:42 +08:00
David Monllao a13cbfb3e7 MDL-39702 generators: Adding MOODLE_INTERNAL
As discussed generators should include MOODLE_INTERNAL
as they make use of CFG and they don't make sense without
requiring config.php.
2013-05-28 11:10:35 +08:00
Frederic Massart 799dbbfbaa MDL-39477 repository: Tests use data generator 2013-05-28 11:08:58 +08:00
Frederic Massart e5c6694de8 MDL-39477 repository: Introducing data generators for repositories 2013-05-28 11:08:54 +08:00
Damyon Wiese d3aeeb93c2 Merge branch 'w22_MDL-39802_m25_deletedusers' of git://github.com/skodak/moodle into MOODLE_25_STABLE 2013-05-28 09:56:08 +08:00
AMOS bot f5940428a9 Automatically generated installer lang files 2013-05-28 00:38:15 +00:00
Eloy Lafuente (stronk7) e58af1dfcd Merge branch 'wip-MDL-39836_M25' of git://github.com/gjb2048/moodle into MOODLE_25_STABLE
Conflicts:
	theme/bootstrapbase/style/moodle.css
2013-05-28 01:24:58 +02:00
Eloy Lafuente (stronk7) 4f0d6118ff Merge branch 'wip-MDL-39456-m25' of git://github.com/samhemelryk/moodle into MOODLE_25_STABLE 2013-05-28 01:02:34 +02:00
Eloy Lafuente (stronk7) 8b77e81201 Merge branch 'MDL-39853_25' of git://github.com/dmonllao/moodle into MOODLE_25_STABLE 2013-05-28 00:57:06 +02:00
Eloy Lafuente (stronk7) d6e2b0a03e Merge branch 'MDL-39795_25' of git://github.com/dmonllao/moodle into MOODLE_25_STABLE 2013-05-28 00:45:02 +02:00
Damyon Wiese a665577b37 Merge branch 'MDL-39686_25' of git://github.com/dmonllao/moodle into MOODLE_25_STABLE 2013-05-27 16:28:48 +08:00
Damyon Wiese f32e55c8d7 Merge branch 'MDL-39680-M25' of git://github.com/lazydaisy/moodle into MOODLE_25_STABLE
Conflicts:
	theme/bootstrapbase/style/moodle.css
2013-05-27 16:21:44 +08:00
Damyon Wiese 6a3a3bd868 Merge branch 'MDL-39640-master-int' of git://github.com/FMCorz/moodle into MOODLE_25_STABLE 2013-05-27 16:14:59 +08:00
Kordan f70d382498 MDL-39194 theme_formal_white: cleaned the category page showing course listing 2013-05-27 15:23:08 +08:00
David Monllao e132b54a6a MDL-39853 behat: Useful info for $CFG->behat_config setting 2013-05-27 15:14:06 +08:00
David Monllao c0b59154ba MDL-39686 behat: Add option to restart the browser 2013-05-27 15:06:15 +08:00
David Monllao 268cb03e2d MDL-39686 behat: Adding into to config-dist.php 2013-05-27 15:06:09 +08:00
Dan Poltawski ad97a56875 MDL-39806 theme_bootstrapbase: run less with --compress 2013-05-27 14:42:44 +08:00
Dan Poltawski 8d94299b02 Merge branch 'MDL-39806_M25' of git://github.com/lazydaisy/moodle into MOODLE_25_STABLE 2013-05-27 14:36:55 +08:00
David Monllao 0653761da2 MDL-39795 behat: Adapting features to consider spaces 2013-05-27 14:25:40 +08:00
David Monllao e489df87bf MDL-39795 behat: Improving find-texts-in-page-contents performance 2013-05-27 14:25:34 +08:00
Marina Glancy 87a445ec70 MDL-39785 bug fix: filter_activitynames was not applied correctly 2013-05-27 14:17:15 +08:00
Dan Poltawski 121e2492e8 Merge branch 'MDL-38239-moodle25' of git://github.com/StudiUM/moodle into MOODLE_25_STABLE 2013-05-27 14:13:36 +08:00
Dan Poltawski 6c16494f03 Merge branch 'w22_MDL-39688_m25_etag' of git://github.com/skodak/moodle into MOODLE_25_STABLE 2013-05-27 13:43:37 +08:00
Dan Poltawski 191e70c2e2 Merge branch 'w22_MDL-38408_m25_paypalcost' of git://github.com/skodak/moodle into MOODLE_25_STABLE 2013-05-27 13:05:14 +08:00
Yuliya Bozhko 7291b026a0 MDL-39778 badges: Fix missing library error in delete_course() 2013-05-27 12:00:38 +08:00
Rajesh Taneja df4da0fe79 MDL-39827 course: Trigger invalidate cache event while changing sort-order of category 2013-05-27 10:55:48 +08:00
Dan Poltawski ceb4030763 Merge branch 'MDL-39768_25' of git://github.com/dmonllao/moodle into MOODLE_25_STABLE 2013-05-27 10:18:32 +08:00
Gareth J Barnard 69ecf8c0a9 MDL-38856 theme_bootstrapbase: Inverse user name text unreadable on nav bar 2013-05-27 02:09:01 +01:00
Mary Evans 039c78702d MDL-39680 theme_bootstrapbase: Fixed footer alignment in less/moodle/debug.less
Squashed commit of the following:

commit 58f5e063a8b333c184ca83ece7f61ec40d2a5080
Author: Mary Evans <lazydaisy@visible-expression.co.uk>
Date:   Sun May 26 13:45:11 2013 +0100

    MDL-39680 theme_bootstrapbase: Fixed footer alignment in less/moodle/debug.less

commit 575594257a9f4fab75977d2334d07659abea0b65
Author: Mary Evans <lazydaisy@visible-expression.co.uk>
Date:   Sun May 26 02:07:00 2013 +0100

    MDL-39680 theme_bootstrapbase: Centralised text in footer.
2013-05-26 13:55:45 +01:00
Petr Škoda 7fa470de03 MDL-38408 always validate PayPal dates and cost, improve float formatting 2013-05-25 22:48:44 +02:00
Mary Evans 6ceb6eb672 MDL-39806 theme_bootstrapbase: Fix for coursesearchbox label alignment. 2013-05-25 17:16:39 +01:00
Petr Škoda 644b1df502 MDL-39676 improve get_role_users() unit tests 2013-05-25 10:10:17 +02:00
Petr Škoda 161be92065 MDL-39688 do not set Etag when sending http ranges 2013-05-25 09:12:03 +02:00
Petr Škoda 5878ac3957 MDL-39802 ignore deleted users in meta enrolments 2013-05-24 21:28:38 +02:00
Petr Škoda 761227cfc6 MDL-39802 ignore deleted users in cohort enrolments 2013-05-24 21:28:38 +02:00
Petr Škoda 97d68b5652 MDL-39802 ignore deleted users in category enrolments 2013-05-24 21:28:37 +02:00
Petr Škoda 3ecf7ddd15 MDL-39802 fix sloppy user deleting and creating in imsenterprise plugin 2013-05-24 21:28:37 +02:00
Petr Škoda b6ef79950e MDL-39802 add cli script for fixing of all deleted users
Use this script if something just set the user.deleted flag instead of calling the delete_user() method.
2013-05-24 21:28:37 +02:00
Damyon Wiese f65261d096 weekly release 2.5+ 2013-05-24 13:26:46 +08:00
Damyon Wiese 93f645f0ae Merge branch 'install_25_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_25_STABLE 2013-05-24 13:12:11 +08:00
Sam Hemelryk e5184cac0e MDL-39456 cachestore_file: added reference to global $CFG
By holding onto a reference of the global $CFG object we
can be sure that it isn't destroyed before we are done
with it.
This allows for caches to be used within destructors for
purposes such as delayed writes.
2013-05-24 09:54:18 +12:00
Marina Glancy caaad8b08d MDL-39177 make sure we don't remove existing directories when cleaning up unzip 2013-05-23 15:59:53 +02:00
AMOS bot cb033b9fab Automatically generated installer lang files 2013-05-22 08:26:02 +00:00
David Monllao 4f629bc677 MDL-39768 behat: Adding focused panels CSS selector 2013-05-22 15:11:55 +08:00
Eloy Lafuente (stronk7) d917dc9e40 MDL-36482 Fix slipped error, thanks Petr! 2013-05-22 04:14:01 +02:00
Damyon Wiese d74f740722 Merge branch 'MDL-39697-M25' of git://github.com/lazydaisy/moodle into MOODLE_25_STABLE 2013-05-22 09:03:31 +08:00
Marina Glancy 6168502474 MDL-39177 Updating userid when file is overwritten 2013-05-22 02:25:18 +02:00
Marina Glancy 751cebfc3d MDL-39177 More comments about confusing files.source field 2013-05-22 02:25:12 +02:00
Marina Glancy acfd39cbf8 MDL-39177 New function file_storage::get_unused_dirname() 2013-05-22 02:25:07 +02:00
Marina Glancy 2efc8ff39f MDL-39177 Ensure files are overwritten correctly on unzip 2013-05-22 02:25:02 +02:00
Marina Glancy 2a0b243137 MDL-39177 Perform all checks on draftfile area before saving the files 2013-05-22 02:24:56 +02:00
Marina Glancy b8aca19538 MDL-39177 Remove code duplication 2013-05-22 02:24:50 +02:00
Marina Glancy 2fbfedb310 MDL-39177 Update file in filearea only if original is present
Now when file was deleted in filemanager and new file with the same file was uploaded the references will be converted to copies exactly like UI warns in filemanager.
Also do not delete original information from draftfiles.
2013-05-22 02:24:40 +02:00
Marina Glancy 6c43ee510f MDL-39177 Discard file origin when moving/renaming a file in filemanager
Created one function that handles file update to be used from both JS and nonJS filepicker
2013-05-22 02:24:32 +02:00
Marina Glancy d262212a1f MDL-39177 Original info is not preserved when overwriting a file in filemanager
original file location is used by filemanager to indicate that file is a source of reference and file the list of referencing files
2013-05-22 02:24:24 +02:00
Marina Glancy d50f747fd8 MDL-39177 File reference is not updated when overwriting the file 2013-05-22 02:24:13 +02:00
Marina Glancy d95506e05a MDL-33719 When overwriting a file the filemanager is not refreshed 2013-05-22 02:24:08 +02:00
Gilles-Philippe Leblanc f7d180a7fb MDL-38239 gradebook: Importing grades from a .txt file with commas for decimals causes an error 2013-05-21 14:43:07 -04:00
Marina Glancy 91af4fa5bf MDL-39720 added missing setType() in moodleform 2013-05-21 12:30:21 +08:00
Dan Poltawski b051261ecc Merge branch 'MDL-39753_25' of git://github.com/stronk7/moodle into MOODLE_25_STABLE 2013-05-21 11:00:32 +08:00
Dan Poltawski aeaf5c1337 MDL-39323 auth_ldap: fix savepoint version 2013-05-21 10:52:44 +08:00
Iñaki Arenaza 9f13f53393 MDL-39323 Make sure start_tls config value is defined
This has been introduced in 2.5, so when upgrading from previous versions
make sure we set a default value. Otherwise, we get a notice about it
being undefined when we try to use it (and we always try to use it!).
2013-05-21 10:44:11 +08:00
Russell Smith 0bc310eb5a MDL-36482 activities block: Allow mod display without intro's 2013-05-21 02:27:58 +02:00
Eloy Lafuente (stronk7) ab6a0ac4f7 Merge branch 'MDL-39758_M25' of git://github.com/lazydaisy/moodle into MOODLE_25_STABLE 2013-05-21 01:48:38 +02:00
David Monllao 18003f2adb MDL-39638 behat: New step to collapse nodes based on the expand nodes
Also updating steps with a collapse behaviour.
2013-05-21 01:00:36 +02:00
Jayesh Anandani 2ab5928066 MDL-26120 mod_forum: use correct object 2013-05-21 00:55:17 +02:00
Eloy Lafuente (stronk7) e3c1bd2593 Merge branch 'MDL-39717_25' of git://github.com/dmonllao/moodle into MOODLE_25_STABLE 2013-05-21 00:44:22 +02:00
Jerome Mouneyrac 99f5bad554 MDL-31209 web service error message: Indication about the service not containg the web service function is confusing 2013-05-20 19:06:59 +02:00
Ruslan Kabalin 666117e830 MDL-39761: mod_assign: Always check submission plugin status and visibility. 2013-05-20 16:32:04 +01:00
Eloy Lafuente (stronk7) 9b19f3f4fb MDL-39753 Add 2.5.0 upgrade line 2013-05-20 15:34:44 +02:00
Mary Evans b6d07f25a1 MDL-39758 theme_bootatrapbase: Added missing layout/embedded.php. 2013-05-20 13:04:44 +01:00
Dan Poltawski e90eb091c5 Merge branch 'w18_MDL-39374_m25_folderlog' of git://github.com/skodak/moodle into MOODLE_25_STABLE 2013-05-20 17:58:29 +08:00
Damyon Wiese 5cc84acabe Merge branch 'MDL-38498-25' of git://github.com/FMCorz/moodle into MOODLE_25_STABLE 2013-05-20 16:12:34 +08:00
Frederic Massart 543b5feae0 MDL-39719 course: Pointing to wrong category string in requests 2013-05-20 16:10:07 +08:00
Frederic Massart cdd041e631 MDL-38498 repository: Unit tests for repository::check_capability() 2013-05-20 16:00:11 +08:00
Tim Hunt 6d393bd97c MDL-27748 question: grade options should be localised.
question_bank::fraction_options should use format_float to display
decimal pionts correctly.
2013-05-20 15:47:22 +08:00
Tim Hunt f8aec131e9 MDL-39728 List all the classes in question/type/questionbase.php
This should make it easier for people to understand the type hierarchy.
2013-05-20 15:28:59 +08:00
Troy Lee 62cf9a1d2a MDL-36020 overview/report: fix quiz regrade session lock 2013-05-20 12:42:38 +08:00
Damyon Wiese 76f881c83a Merge branch 'MDL-39363-master' of git://github.com/ankitagarwal/moodle into MOODLE_25_STABLE 2013-05-20 12:13:09 +08:00
Damyon Wiese c4500213d6 Merge branch 'MDL-39528_25' of git://github.com/dmonllao/moodle into MOODLE_25_STABLE 2013-05-20 12:06:51 +08:00
Mary Evans 1cdcb6599a MDL-39630 theme_afterburner: Improving the way course/category listings display. 2013-05-20 12:03:00 +08:00
Kordan ff3f1f3ef3 MDL-39198 theme_formal_white: resized and relocated the "Add..." drop down menu of the "Add a block" pseudo block 2013-05-20 11:48:23 +08:00
Frederic Massart b42e6e1c2e MDL-38369 repository: Remove output before redirect 2013-05-20 10:25:34 +08:00
Damyon Wiese d8581a2367 Merge branch 'MDL-28250-25' of git://github.com/danpoltawski/moodle into MOODLE_25_STABLE 2013-05-17 12:11:31 +08:00
David Monllao 236ebcfe78 MDL-39528 behat: Avoid modal window suite failure
Catching JS alerts/confirms exceptions and
auto-accepting them before each test run to
avoid chained scenarios failures.
2013-05-17 12:09:04 +08:00
David Monllao c340dca9b0 MDL-39717 behat: Removing unstable steps and scenarios 2013-05-17 11:48:29 +08:00
David Monllao a3c292ee64 MDL-39717 behat: Add info to experimental steps definitions
JS modal dialogs and drag & drop should be
considered experimental as the steps are not
working as expected in all OS/browser combinations.
2013-05-17 11:48:20 +08:00
Damyon Wiese b7bbb615d7 Merge branch 'w18_MDL-39678_m25_yui' of git://github.com/skodak/moodle into MOODLE_25_STABLE 2013-05-16 15:55:45 +08:00
Mary Evans 9141e05262 MDL-39697 theme_bootstrapbase: Updated $THEME->layouts in config.php to match those in Base theme. 2013-05-16 00:57:40 +01:00
Petr Škoda e9cfbe4290 MDL-39678 fix YUI 20130515 vulnerability 2013-05-15 22:12:12 +02:00
Petr Škoda 2e297423cd MDL-39374 log only real folder edits
Credit goes to Florian Zillner, thanks.
2013-05-15 21:32:27 +02:00
Eloy Lafuente (stronk7) 8daf98a10f NOBUG: Keep backup YYYYMMDD on sync with 2.5 2013-05-14 12:42:15 +02:00
Frederic Massart 0f387618cd MDL-39640 repository: Prevent notice when editing an instance 2013-05-13 17:27:42 +08:00
Ankit Agarwal d8d0b8b390 MDL-39363 scorm: Accept 0 as a valid score 2013-04-29 16:53:15 +08:00
473 changed files with 10608 additions and 1836 deletions
+91
View File
@@ -0,0 +1,91 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This script fixed incorrectly deleted users.
*
* @package core
* @subpackage cli
* @copyright 2013 Petr Skoda (http://skodak.org)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('CLI_SCRIPT', true);
require(__DIR__.'/../../config.php');
require_once($CFG->libdir.'/clilib.php');
// Now get cli options.
list($options, $unrecognized) = cli_get_params(array('help'=>false),
array('h'=>'help'));
if ($unrecognized) {
$unrecognized = implode("\n ", $unrecognized);
cli_error(get_string('cliunknowoption', 'admin', $unrecognized));
}
if ($options['help']) {
$help =
"Fix incorrectly deleted users.
This scripts detects users that are marked as deleted instead
of calling delete_user().
Deleted users do not have original username, idnumber or email,
we must also delete all roles, enrolments, group memberships, etc.
Please note this script does not delete any public information
such as forum posts.
Options:
-h, --help Print out this help
Example:
\$sudo -u www-data /usr/bin/php admin/cli/fix_deleted_users.php
";
echo $help;
die;
}
cli_heading('Looking for sloppy user deletes');
// Look for sloppy deleted users where somebody only flipped the deleted flag.
$sql = "SELECT *
FROM {user}
WHERE deleted = 1 AND email LIKE '%@%' AND username NOT LIKE '%@%'";
$rs = $DB->get_recordset_sql($sql);
foreach ($rs as $user) {
echo "Redeleting user $user->id: $user->username ($user->email)\n";
delete_user($user);
}
cli_heading('Deleting all leftovers');
$DB->set_field('user', 'idnumber', '', array('deleted'=>1));
$DB->delete_records_select('role_assignments', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
$DB->delete_records_select('cohort_members', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
$DB->delete_records_select('groups_members', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
$DB->delete_records_select('user_enrolments', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
$DB->delete_records_select('user_preferences', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
$DB->delete_records_select('user_info_data', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
$DB->delete_records_select('user_lastaccess', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
$DB->delete_records_select('external_tokens', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
$DB->delete_records_select('external_services_users', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
exit(0);
+113
View File
@@ -892,4 +892,117 @@
</PHP_SETTING>
</PHP_SETTINGS>
</MOODLE>
<MOODLE version="2.6" requires="2.2">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mysql" version="5.1.33" />
<VENDOR name="postgres" version="8.3" />
<VENDOR name="mssql" version="9.0" />
<VENDOR name="oracle" version="10.2" />
</DATABASE>
<PHP version="5.3.3" level="required">
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
<ON_CHECK message="pcreunicodewarning" />
</FEEDBACK>
</PCREUNICODE>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
<FEEDBACK>
<ON_CHECK message="mbstringrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="optional">
<FEEDBACK>
<ON_CHECK message="opensslrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="tokenizer" level="optional">
<FEEDBACK>
<ON_CHECK message="tokenizerrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlrpc" level="optional">
<FEEDBACK>
<ON_CHECK message="xmlrpcrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="soap" level="optional">
<FEEDBACK>
<ON_CHECK message="soaprecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="ctype" level="required">
<FEEDBACK>
<ON_ERROR message="ctyperequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zip" level="required">
<FEEDBACK>
<ON_ERROR message="ziprequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="gd" level="required">
<FEEDBACK>
<ON_ERROR message="gdrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="dom" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xml" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="intl" level="optional">
<FEEDBACK>
<ON_CHECK message="intlrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" level="required"/>
</PHP_EXTENSIONS>
<PHP_SETTINGS>
<PHP_SETTING name="memory_limit" value="64M" level="required">
<FEEDBACK>
<ON_ERROR message="settingmemorylimit" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="safe_mode" value="0" level="optional">
<FEEDBACK>
<ON_CHECK message="settingsafemode" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="file_uploads" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="settingfileuploads" />
</FEEDBACK>
</PHP_SETTING>
</PHP_SETTINGS>
</MOODLE>
</COMPATIBILITY_MATRIX>
+2
View File
@@ -158,6 +158,7 @@ if ($hassiteconfig
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_blocks', new lang_string('generalblocks','backup'), new lang_string('configgeneralblocks','backup'), array('value'=>1, 'locked'=>0)));
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_filters', new lang_string('generalfilters','backup'), new lang_string('configgeneralfilters','backup'), array('value'=>1, 'locked'=>0)));
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_comments', new lang_string('generalcomments','backup'), new lang_string('configgeneralcomments','backup'), array('value'=>1, 'locked'=>0)));
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_badges', new lang_string('generalbadges','backup'), new lang_string('configgeneralbadges','backup'), array('value'=>1,'locked'=>0)));
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_userscompletion', new lang_string('generaluserscompletion','backup'), new lang_string('configgeneraluserscompletion','backup'), array('value'=>1, 'locked'=>0)));
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_logs', new lang_string('generallogs','backup'), new lang_string('configgenerallogs','backup'), array('value'=>0, 'locked'=>0)));
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_histories', new lang_string('generalhistories','backup'), new lang_string('configgeneralhistories','backup'), array('value'=>0, 'locked'=>0)));
@@ -231,6 +232,7 @@ if ($hassiteconfig
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_blocks', new lang_string('generalblocks','backup'), new lang_string('configgeneralblocks','backup'), 1));
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_filters', new lang_string('generalfilters','backup'), new lang_string('configgeneralfilters','backup'), 1));
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_comments', new lang_string('generalcomments','backup'), new lang_string('configgeneralcomments','backup'), 1));
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_badges', new lang_string('generalbadges','backup'), new lang_string('configgeneralbadges','backup'), 1));
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_userscompletion', new lang_string('generaluserscompletion','backup'), new lang_string('configgeneraluserscompletion','backup'), 1));
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_logs', new lang_string('generallogs', 'backup'), new lang_string('configgenerallogs', 'backup'), 0));
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_histories', new lang_string('generalhistories','backup'), new lang_string('configgeneralhistories','backup'), 0));
+4
View File
@@ -65,6 +65,10 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
60 => new lang_string('numminutes', '', 60),
30 => new lang_string('numminutes', '', 30),
15 => new lang_string('numminutes', '', 15))));
// Define the prefix to be added to imported profiling runs.
$temp->add(new admin_setting_configtext('profilingimportprefix',
new lang_string('profilingimportprefix', 'admin'),
new lang_string('profilingimportprefix_desc', 'admin'), '(I)', PARAM_TAG, 10));
// Add the 'profiling' page to admin block
$ADMIN->add('development', $temp);
+1 -1
View File
@@ -14,7 +14,7 @@ Feature: Upload users
| Section 1 | math102 | S1 |
| Section 3 | math102 | S3 |
And I log in as "admin"
And I expand "Front page settings" node
And I collapse "Front page settings" node
And I expand "Site administration" node
And I expand "Users" node
And I expand "Accounts" node
@@ -30,6 +30,17 @@ Feature: Set up contextual data for tests
Then I should see "Course 1"
And I should see "Course 2"
And I should see "Course 3"
When I go to the courses management page
And I follow "Cat 1"
Then I should see "Cat 2"
And I should see "Cat 3"
When I follow "Cat 3"
Then I should see "Course 1"
And I should see "Course 2"
When I select "Cat 2" from "Course categories:"
Then I should see "No courses in this category"
When I select "Miscellaneous" from "Course categories:"
Then I should see "Course 3"
@javascript
Scenario: Add a bunch of groups and groupings
+4
View File
@@ -38,5 +38,9 @@ function xmldb_tool_customlang_upgrade($oldversion) {
// Put any upgrade step following this
// Moodle v2.5.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+1 -1
View File
@@ -32,7 +32,7 @@ $lng = required_param('lng', PARAM_LANG);
$currentpage = optional_param('p', 0, PARAM_INT);
$translatorsubmitted = optional_param('translatorsubmitted', 0, PARAM_BOOL);
$PAGE->set_pagelayout('standard');
$PAGE->set_pagelayout('report'); // Allows for wide page contents.
$PAGE->set_url('/admin/tool/customlang/edit.php', array('lng' => $lng));
navigation_node::override_active_url(new moodle_url('/admin/tool/customlang/index.php'));
$PAGE->set_title(get_string('pluginname', 'tool_customlang'));
@@ -37,7 +37,7 @@ $string['missinglangparent'] = 'Missing parent language <em>{$a->parent}</em> of
$string['nolangupdateneeded'] = 'All your language packs are up to date, no update is needed';
$string['pluginname'] = 'Language packs';
$string['purgestringcaches'] = 'Purge string caches';
$string['remotelangnotavailable'] = 'Because Moodle can not connect to download.moodle.org, we are unable to do language pack installation automatically. Please download the appropriate zip file(s) from http://download.moodle.org, copy them to your {$a} directory and unzip them manually.';
$string['remotelangnotavailable'] = 'Because Moodle cannot connect to download.moodle.org, it is not possible for language packs to be installed automatically. Please download the appropriate ZIP file(s) from <a href="http://download.moodle.org/langpack/">download.moodle.org/langpack</a>, copy them to your {$a} directory and unzip them manually.';
$string['uninstall'] = 'Uninstall selected language pack';
$string['uninstallconfirm'] = 'You are about to completely uninstall language pack {$a}, are you sure?';
$string['updatelangs'] = 'Update all installed language packs';
+56
View File
@@ -0,0 +1,56 @@
<?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/>.
/**
* Profiling tool export utility.
*
* @package tool_profiling
* @copyright 2013 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(__FILE__) . '/../../../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir . '/xhprof/xhprof_moodle.php');
// Page parameters.
$runid = required_param('runid', PARAM_ALPHANUM);
$listurl = required_param('listurl', PARAM_PATH);
admin_externalpage_setup('toolprofiling');
$PAGE->navbar->add(get_string('export', 'tool_profiling'));
// Calculate export variables.
$tempdir = 'profiling';
make_temp_directory($tempdir);
$runids = array($runid);
$filename = $runid . '.mpr';
$filepath = $CFG->tempdir . '/' . $tempdir . '/' . $filename;
// Generate the mpr file and send it.
if (profiling_export_runs($runids, $filepath)) {
send_file($filepath, $filename, 0, 0, false, false, '', true);
unlink($filepath); // Delete once sent.
die;
}
// Something wrong happened, notice it and done.
$urlparams = array(
'runid' => $runid,
'listurl' => $listurl);
$url = new moodle_url('/admin/tool/profiling/index.php', $urlparams);
notice(get_string('exportproblem', 'tool_profiling', $urlparams), $url);
+70
View File
@@ -0,0 +1,70 @@
<?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/>.
/**
* Profiling tool import utility.
*
* @package tool_profiling
* @copyright 2013 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(__FILE__) . '/../../../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir . '/xhprof/xhprof_moodle.php');
require_once(dirname(__FILE__) . '/import_form.php');
admin_externalpage_setup('toolprofiling');
$PAGE->navbar->add(get_string('import', 'tool_profiling'));
// Calculate export variables.
$tempdir = 'profiling';
make_temp_directory($tempdir);
// URL where we'll end, both on success and failure.
$url = new moodle_url('/admin/tool/profiling/index.php');
// Instantiate the upload profiling runs form.
$mform = new profiling_import_form();
// If there is any file to import.
if ($data = $mform->get_data()) {
$filename = $mform->get_new_filename('mprfile');
$file = $CFG->tempdir . '/' . $tempdir . '/' . $filename;
$status = $mform->save_file('mprfile', $file);
if ($status) {
// File saved properly, let's import it.
$status = profiling_import_runs($file, $data->importprefix);
}
// Delete the temp file, not needed anymore.
if (file_exists($file)) {
unlink($file);
}
if ($status) {
// Import ended ok, let's redirect to main profiling page.
redirect($url, get_string('importok', 'tool_profiling', $filename));
}
} else {
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('import', 'tool_profiling'));
$mform->display();
echo $OUTPUT->footer();
die;
}
// Something wrong happened, notice it and done.
notice(get_string('importproblem', 'tool_profiling', $filename), $url);
+47
View File
@@ -0,0 +1,47 @@
<?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/>.
/**
* Profiling tool import utility form.
*
* @package tool_profiling
* @copyright 2013 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
require_once($CFG->libdir . '/formslib.php');
class profiling_import_form extends moodleform {
public function definition () {
global $CFG;
$mform = $this->_form;
$mform->addElement('header', 'settingsheader', get_string('upload'));
$mform->addElement('filepicker', 'mprfile', get_string('file'), null, array('accepted_types' => array('.mpr', '.zip')));
$mform->addRule('mprfile', null, 'required');
$mform->addElement('text', 'importprefix',
get_string('importprefix', 'tool_profiling'), array('size' => 10));
$mform->setDefault('importprefix', $CFG->profilingimportprefix);
$mform->setType('importprefix', PARAM_TAG);
$this->add_action_buttons(false, get_string('import', 'tool_profiling'));
}
}
+4 -5
View File
@@ -17,8 +17,7 @@
/**
* Profiling tool.
*
* @package tool
* @subpackage profiling
* @package tool_profiling
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -161,6 +160,9 @@ if (isset($script)) {
echo $OUTPUT->heading($header);
// Print the controller block with different options.
echo profiling_list_controls($listurl);
// TODO: Fix flexitable to validate tsort/thide/tshow/tifirs/tilast/page
// TODO: Fix table_sql to allow it to work without WHERE clause
// add silly condition (1 = 1) because of table_sql bug
@@ -179,9 +181,6 @@ if (isset($script)) {
$table->define_baseurl($baseurl);
$table->column_suppress('url');
$table->out(PROFILING_RUNSPERPAGE, true);
// Print the controller block with different options
echo profiling_list_controls($listurl);
}
// Footer.
@@ -24,13 +24,22 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$string['calls'] = 'Function calls';
$string['cannotfindanyrunforurl'] = 'Sorry, cannot find any profiling run for the \'{$a}\' URL';
$string['cannotfindanyrunforrunid'] = 'Sorry, cannot find the \'{$a}\' profiling run';
$string['comment'] = 'Comment';
$string['cputime'] = 'CPU time';
$string['differencesbetween2runsof'] = 'Differences between 2 runs of {$a}';
$string['executiontime'] = 'Execution time';
$string['cputime'] = 'CPU time';
$string['export'] = 'Export';
$string['exportproblem'] = 'Some problem happened exporting the profile run "{$a->runid}" corresponding to the request "{$a->listurl}".';
$string['exportthis'] = 'Export this profiling run';
$string['import'] = 'Import';
$string['importok'] = 'File "{$a}" imported successfully.';
$string['importprefix'] = 'Import prefix';
$string['importproblem'] = 'Some problem happened importing the file "{$a}".';
$string['lastrunof'] = 'Summary of last run of {$a}';
$string['markreferencerun'] = 'Mark as reference run/comment';
$string['memory'] = 'Memory used';
+2 -3
View File
@@ -17,14 +17,13 @@
/**
* Version details.
*
* @package tool
* @subpackage profiling
* @package tool_profiling
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2013050100; // The current plugin version (Date: YYYYMMDDXX)
$plugin->version = 2013050200; // The current plugin version (Date: YYYYMMDDXX)
$plugin->requires = 2013050100; // Requires this Moodle version
$plugin->component = 'tool_profiling'; // Full name of the plugin (used for diagnostics)
+11 -3
View File
@@ -23,6 +23,7 @@ echo $OUTPUT->header();
//TODO: add support for large number of users
if ($confirm and confirm_sesskey()) {
$notifications = '';
list($in, $params) = $DB->get_in_or_equal($SESSION->bulk_users);
$rs = $DB->get_recordset_select('user', "id $in", $params, '', 'id, username, secret, confirmed, auth, firstname, lastname');
foreach ($rs as $user) {
@@ -32,12 +33,19 @@ if ($confirm and confirm_sesskey()) {
$auth = get_auth_plugin($user->auth);
$result = $auth->user_confirm($user->username, $user->secret);
if ($result != AUTH_CONFIRM_OK && $result != AUTH_CONFIRM_ALREADY) {
echo $OUTPUT->notification(get_string('usernotconfirmed', '', fullname($user, true)));
$notifications .= $OUTPUT->notification(get_string('usernotconfirmed', '', fullname($user, true)));
}
}
$rs->close();
redirect($return, get_string('changessaved'));
echo $OUTPUT->box_start('generalbox', 'notice');
if (!empty($notifications)) {
echo $notifications;
} else {
echo $OUTPUT->notification(get_string('changessaved'), 'notifysuccess');
}
$continue = new single_button(new moodle_url($return), get_string('continue'), 'post');
echo $OUTPUT->render($continue);
echo $OUTPUT->box_end();
} else {
list($in, $params) = $DB->get_in_or_equal($SESSION->bulk_users);
$userlist = $DB->get_records_select_menu('user', "id $in", $params, 'fullname', 'id,'.$DB->sql_fullname().' AS fullname');
+11 -4
View File
@@ -23,20 +23,27 @@ echo $OUTPUT->header();
//TODO: add support for large number of users
if ($confirm and confirm_sesskey()) {
$notifications = '';
list($in, $params) = $DB->get_in_or_equal($SESSION->bulk_users);
$rs = $DB->get_recordset_select('user', "id $in", $params);
foreach ($rs as $user) {
if (!is_siteadmin($user) and $USER->id != $user->id and delete_user($user)) {
unset($SESSION->bulk_users[$user->id]);
} else {
echo $OUTPUT->notification(get_string('deletednot', '', fullname($user, true)));
$notifications .= $OUTPUT->notification(get_string('deletednot', '', fullname($user, true)));
}
}
$rs->close();
session_gc(); // remove stale sessions
redirect($return, get_string('changessaved'));
echo $OUTPUT->box_start('generalbox', 'notice');
if (!empty($notifications)) {
echo $notifications;
} else {
echo $OUTPUT->notification(get_string('changessaved'), 'notifysuccess');
}
$continue = new single_button(new moodle_url($return), get_string('continue'), 'post');
echo $OUTPUT->render($continue);
echo $OUTPUT->box_end();
} else {
list($in, $params) = $DB->get_in_or_equal($SESSION->bulk_users);
$userlist = $DB->get_records_select_menu('user', "id $in", $params, 'fullname', 'id,'.$DB->sql_fullname().' AS fullname');
+22 -1
View File
@@ -174,7 +174,7 @@ class auth_plugin_cas extends auth_plugin_ldap {
*
*/
function connectCAS() {
global $PHPCAS_CLIENT;
global $CFG, $PHPCAS_CLIENT;
if (!is_object($PHPCAS_CLIENT)) {
// Make sure phpCAS doesn't try to start a new PHP session when connecting to the CAS server.
@@ -185,6 +185,27 @@ class auth_plugin_cas extends auth_plugin_ldap {
}
}
// If Moodle is configured to use a proxy, phpCAS needs some curl options set.
if (!empty($CFG->proxyhost) && !is_proxybypass($this->config->hostname)) {
phpCAS::setExtraCurlOption(CURLOPT_PROXY, $CFG->proxyhost);
if (!empty($CFG->proxyport)) {
phpCAS::setExtraCurlOption(CURLOPT_PROXYPORT, $CFG->proxyport);
}
if (!empty($CFG->proxytype)) {
// Only set CURLOPT_PROXYTYPE if it's something other than the curl-default http
if ($CFG->proxytype == 'SOCKS5') {
phpCAS::setExtraCurlOption(CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
}
}
if (!empty($CFG->proxyuser) and !empty($CFG->proxypassword)) {
phpCAS::setExtraCurlOption(CURLOPT_PROXYUSERPWD, $CFG->proxyuser.':'.$CFG->proxypassword);
if (defined('CURLOPT_PROXYAUTH')) {
// any proxy authentication if PHP 5.1
phpCAS::setExtraCurlOption(CURLOPT_PROXYAUTH, CURLAUTH_BASIC | CURLAUTH_NTLM);
}
}
}
if($this->config->certificate_check && $this->config->certificate_path){
phpCAS::setCasServerCACert($this->config->certificate_path);
}else{
+43
View File
@@ -0,0 +1,43 @@
<?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/>.
/**
* CAS authentication plugin upgrade code
*
* @package auth_cas
* @copyright 2013 Iñaki Arenaza
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* @param int $oldversion the version we are upgrading from
* @return bool result
*/
function xmldb_auth_cas_upgrade($oldversion) {
// Moodle v2.5.0 release upgrade line
// Put any upgrade step following this
// MDL-39323 New setting in 2.5, make sure it's defined.
if ($oldversion < 2013052100) {
if (get_config('start_tls', 'auth/cas') === false) {
set_config('start_tls', 0, 'auth/cas');
}
upgrade_plugin_savepoint(true, 2013052100, 'auth', 'cas');
}
return true;
}
+1 -1
View File
@@ -26,6 +26,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2013050100; // The current plugin version (Date: YYYYMMDDXX)
$plugin->version = 2013052100; // The current plugin version (Date: YYYYMMDDXX)
$plugin->requires = 2013050100; // Requires this Moodle version
$plugin->component = 'auth_cas'; // Full name of the plugin (used for diagnostics)
+12
View File
@@ -598,6 +598,8 @@ class auth_plugin_ldap extends auth_plugin_base {
if ($user->firstaccess == 0) {
$DB->set_field('user', 'firstaccess', time(), array('id'=>$user->id));
}
$euser = $DB->get_record('user', array('id' => $user->id));
events_trigger('user_updated', $euser);
return AUTH_CONFIRM_OK;
}
} else {
@@ -770,6 +772,8 @@ class auth_plugin_ldap extends auth_plugin_base {
$updateuser->auth = 'nologin';
$DB->update_record('user', $updateuser);
echo "\t"; print_string('auth_dbsuspenduser', 'auth_db', array('name'=>$user->username, 'id'=>$user->id)); echo "\n";
$euser = $DB->get_record('user', array('id' => $user->id));
events_trigger('user_updated', $euser);
}
}
} else {
@@ -795,6 +799,8 @@ class auth_plugin_ldap extends auth_plugin_base {
$updateuser->auth = $this->authtype;
$DB->update_record('user', $updateuser);
echo "\t"; print_string('auth_dbreviveduser', 'auth_db', array('name'=>$user->username, 'id'=>$user->id)); echo "\n";
$euser = $DB->get_record('user', array('id' => $user->id));
events_trigger('user_updated', $euser);
}
} else {
print_string('nouserentriestorevive', 'auth_ldap');
@@ -908,6 +914,8 @@ class auth_plugin_ldap extends auth_plugin_base {
$id = $DB->insert_record('user', $user);
echo "\t"; print_string('auth_dbinsertuser', 'auth_db', array('name'=>$user->username, 'id'=>$id)); echo "\n";
$euser = $DB->get_record('user', array('id' => $user->id));
events_trigger('user_created', $euser);
if (!empty($this->config->forcechangepassword)) {
set_user_preference('auth_forcepasswordchange', 1, $id);
}
@@ -978,6 +986,10 @@ class auth_plugin_ldap extends auth_plugin_base {
}
}
}
if (!empty($updatekeys)) {
$euser = $DB->get_record('user', array('id' => $userid));
events_trigger('user_updated', $euser);
}
} else {
return false;
}
+43
View File
@@ -0,0 +1,43 @@
<?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/>.
/**
* LDAP authentication plugin upgrade code
*
* @package auth_ldap
* @copyright 2013 Iñaki Arenaza
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* @param int $oldversion the version we are upgrading from
* @return bool result
*/
function xmldb_auth_ldap_upgrade($oldversion) {
// Moodle v2.5.0 release upgrade line
// Put any upgrade step following this
// MDL-39323 New setting in 2.5, make sure it's defined.
if ($oldversion < 2013052100) {
if (get_config('start_tls', 'auth/ldap') === false) {
set_config('start_tls', 0, 'auth/ldap');
}
upgrade_plugin_savepoint(true, 2013052100, 'auth', 'ldap');
}
return true;
}
+1 -1
View File
@@ -25,6 +25,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2013050100; // The current plugin version (Date: YYYYMMDDXX)
$plugin->version = 2013052100; // The current plugin version (Date: YYYYMMDDXX)
$plugin->requires = 2013050100; // Requires this Moodle version
$plugin->component = 'auth_ldap'; // Full name of the plugin (used for diagnostics)
+4
View File
@@ -40,5 +40,9 @@ function xmldb_auth_manual_upgrade($oldversion) {
// Put any upgrade step following this
// Moodle v2.5.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+4
View File
@@ -40,5 +40,9 @@ function xmldb_auth_mnet_upgrade($oldversion) {
// Put any upgrade step following this
// Moodle v2.5.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+1 -1
View File
@@ -109,7 +109,7 @@ abstract class backup implements checksumable {
const OPERATION_RESTORE ='restore';// We are performing one restore
// Version (to keep CFG->backup_version (and release) updated automatically)
const VERSION = 2013050100;
const VERSION = 2013051400;
const RELEASE = '2.5';
}
@@ -92,6 +92,11 @@ class backup_final_task extends backup_task {
// Generate the course completion
$this->add_step(new backup_course_completion_structure_step('course_completion', 'completion.xml'));
// Conditionally generate the badges file.
if ($this->get_setting_value('badges')) {
$this->add_step(new backup_badges_structure_step('course_badges', 'badges.xml'));
}
// Generate the scales file with all the (final) annotated scales
$this->add_step(new backup_final_scales_structure_step('scaleslist', 'scales.xml'));
@@ -122,6 +122,13 @@ class backup_root_task extends backup_task {
$this->add_setting($comments);
$users->add_dependency($comments);
// Define badges (dependent of activities).
$badges = new backup_badges_setting('badges', base_setting::IS_BOOLEAN, true);
$badges->set_ui(new backup_setting_ui_checkbox($badges, get_string('rootsettingbadges', 'backup')));
$this->add_setting($badges);
$activities->add_dependency($badges);
$users->add_dependency($badges);
// Define calendar events (dependent of users)
$events = new backup_calendarevents_setting('calendarevents', base_setting::IS_BOOLEAN, true);
$events->set_ui(new backup_setting_ui_checkbox($events, get_string('rootsettingcalendarevents', 'backup')));
+6
View File
@@ -101,6 +101,12 @@ class backup_logs_setting extends backup_anonymize_setting {}
*/
class backup_comments_setting extends backup_anonymize_setting {}
/**
* root setting to control if backup will include badges or not,
* depends on @backup_activities_setting
*/
class backup_badges_setting extends backup_generic_setting {}
/**
* root setting to control if backup will include
* calender events or no (any level), depends of @backup_users_setting
+77
View File
@@ -812,6 +812,83 @@ class backup_comments_structure_step extends backup_structure_step {
}
}
/**
* structure step in charge of constructing the badges.xml file for all the badges found
* in a given context
*/
class backup_badges_structure_step extends backup_structure_step {
protected function execute_condition() {
// Check that all activities have been included.
if ($this->task->is_excluding_activities()) {
return false;
}
return true;
}
protected function define_structure() {
// Define each element separated.
$badges = new backup_nested_element('badges');
$badge = new backup_nested_element('badge', array('id'), array('name', 'description',
'timecreated', 'timemodified', 'usercreated', 'usermodified', 'issuername',
'issuerurl', 'issuercontact', 'expiredate', 'expireperiod', 'type', 'courseid',
'message', 'messagesubject', 'attachment', 'notification', 'status', 'nextcron'));
$criteria = new backup_nested_element('criteria');
$criterion = new backup_nested_element('criterion', array('id'), array('badgeid',
'criteriatype', 'method'));
$parameters = new backup_nested_element('parameters');
$parameter = new backup_nested_element('parameter', array('id'), array('critid',
'name', 'value', 'criteriatype'));
$manual_awards = new backup_nested_element('manual_awards');
$manual_award = new backup_nested_element('manual_award', array('id'), array('badgeid',
'recipientid', 'issuerid', 'issuerrole', 'datemet'));
// Build the tree.
$badges->add_child($badge);
$badge->add_child($criteria);
$criteria->add_child($criterion);
$criterion->add_child($parameters);
$parameters->add_child($parameter);
$badge->add_child($manual_awards);
$manual_awards->add_child($manual_award);
// Define sources.
$badge->set_source_table('badge', array('courseid' => backup::VAR_COURSEID));
$criterion->set_source_table('badge_criteria', array('badgeid' => backup::VAR_PARENTID));
$parametersql = 'SELECT cp.*, c.criteriatype
FROM {badge_criteria_param} cp JOIN {badge_criteria} c
ON cp.critid = c.id
WHERE critid = :critid';
$parameterparams = array('critid' => backup::VAR_PARENTID);
$parameter->set_source_sql($parametersql, $parameterparams);
$manual_award->set_source_table('badge_manual_award', array('badgeid' => backup::VAR_PARENTID));
// Define id annotations.
$badge->annotate_ids('user', 'usercreated');
$badge->annotate_ids('user', 'usermodified');
$criterion->annotate_ids('badge', 'badgeid');
$parameter->annotate_ids('criterion', 'critid');
$badge->annotate_files('badges', 'badgeimage', 'id');
$manual_award->annotate_ids('badge', 'badgeid');
$manual_award->annotate_ids('user', 'recipientid');
$manual_award->annotate_ids('user', 'issuerid');
$manual_award->annotate_ids('role', 'issuerrole');
// Return the root element ($badges).
return $badges;
}
}
/**
* structure step in charge of constructing the calender.xml file for all the events found
* in a given context
+14 -2
View File
@@ -73,8 +73,20 @@ class restore_course_task extends restore_task {
$this->add_step(new restore_course_legacy_files_step('legacy_files'));
// Restore course enrolments (plugins and membership). Conditionally prevented for any IMPORT/HUB operation
if ($this->plan->get_mode() != backup::MODE_IMPORT && $this->plan->get_mode() != backup::MODE_HUB) {
// Deal with enrolment methods and user enrolments.
if ($this->plan->get_mode() == backup::MODE_IMPORT) {
// No need to do anything with enrolments.
} else if (!$this->get_setting_value('users') or $this->plan->get_mode() == backup::MODE_HUB) {
if ($this->get_target() == backup::TARGET_CURRENT_ADDING or $this->get_target() == backup::TARGET_EXISTING_ADDING) {
// Keep current enrolments unchanged.
} else {
// If no instances yet add default enrol methods the same way as when creating new course in UI.
$this->add_step(new restore_default_enrolments_step('default_enrolments'));
}
} else {
// Restore course enrolment data.
$this->add_step(new restore_enrolments_structure_step('course_enrolments', 'enrolments.xml'));
}
@@ -66,6 +66,11 @@ class restore_final_task extends restore_task {
$this->add_step(new restore_course_completion_structure_step('course_completion', 'completion.xml'));
}
// Conditionally restore course badges.
if ($this->get_setting_value('badges')) {
$this->add_step(new restore_badges_structure_step('course_badges', 'badges.xml'));
}
// Review all the module_availability records in backup_ids in order
// to match them with existing modules / grade items.
$this->add_step(new restore_process_course_modules_availability('process_modules_availability'));
@@ -143,6 +148,9 @@ class restore_final_task extends restore_task {
$rules[] = new restore_log_rule('course', 'report stats', 'report/stats/index.php?id={course}', '{course}');
$rules[] = new restore_log_rule('course', 'view section', 'view.php?id={course}&sectionid={course_section}', '{course_section}');
// module 'grade' rules
$rules[] = new restore_log_rule('grade', 'update', 'report/grader/index.php?id={course}', null);
// module 'user' rules
$rules[] = new restore_log_rule('user', 'view', 'view.php?id={user}&course={course}', '{user}');
$rules[] = new restore_log_rule('user', 'change password', 'view.php?id={user}&course={course}', '{user}');
@@ -115,6 +115,7 @@ class restore_root_task extends restore_task {
$rootenrolmanual = new restore_users_setting('enrol_migratetomanual', base_setting::IS_BOOLEAN, false);
$rootenrolmanual->set_ui(new backup_setting_ui_checkbox($rootenrolmanual, get_string('rootenrolmanual', 'backup')));
$rootenrolmanual->get_ui()->set_changeable(enrol_is_enabled('manual'));
$rootenrolmanual->get_ui()->set_changeable($changeable);
$this->add_setting($rootenrolmanual);
$users->add_dependency($rootenrolmanual);
@@ -180,6 +181,20 @@ class restore_root_task extends restore_task {
$this->add_setting($comments);
$users->add_dependency($comments);
// Define badges (dependent of activities).
$defaultvalue = false; // Safer default.
$changeable = false;
if (isset($rootsettings['badges']) && $rootsettings['badges']) { // Only enabled when available.
$defaultvalue = true;
$changeable = true;
}
$badges = new restore_badges_setting('badges', base_setting::IS_BOOLEAN, $defaultvalue);
$badges->set_ui(new backup_setting_ui_checkbox($badges, get_string('rootsettingbadges', 'backup')));
$badges->get_ui()->set_changeable($changeable);
$this->add_setting($badges);
$activities->add_dependency($badges);
$users->add_dependency($badges);
// Define Calendar events (dependent of users)
$defaultvalue = false; // Safer default
$changeable = false;
+6
View File
@@ -63,6 +63,12 @@ class restore_activities_setting extends restore_generic_setting {}
*/
class restore_comments_setting extends restore_role_assignments_setting {}
/**
* root setting to control if restore will create badges or not,
* depends on @restore_activities_setting
*/
class restore_badges_setting extends restore_generic_setting {}
/**
* root setting to control if restore will create
* events or no, depends of @restore_users_setting
+198 -1
View File
@@ -477,6 +477,8 @@ class restore_rebuild_course_cache extends restore_execution_step {
// Rebuild cache now that all sections are in place
rebuild_course_cache($this->get_courseid());
cache_helper::purge_by_event('changesincourse');
cache_helper::purge_by_event('changesincoursecat');
}
}
@@ -631,7 +633,7 @@ class restore_load_included_files extends restore_structure_step {
// TODO: qtype_xxx should be replaced by proper backup_qtype_plugin::get_components_and_fileareas() use,
// but then we'll need to change it to load plugins itself (because this is executed too early in restore)
$isfileref = restore_dbops::get_backup_ids_record($this->get_restoreid(), 'fileref', $data->id);
$iscomponent = ($data->component == 'user' || $data->component == 'group' ||
$iscomponent = ($data->component == 'user' || $data->component == 'group' || $data->component == 'badges' ||
$data->component == 'grouping' || $data->component == 'grade' ||
$data->component == 'question' || substr($data->component, 0, 5) == 'qtype');
if ($isfileref || $iscomponent) {
@@ -1623,6 +1625,29 @@ class restore_ras_and_caps_structure_step extends restore_structure_step {
}
}
/**
* If no instances yet add default enrol methods the same way as when creating new course in UI.
*/
class restore_default_enrolments_step extends restore_execution_step {
public function define_execution() {
global $DB;
$course = $DB->get_record('course', array('id'=>$this->get_courseid()), '*', MUST_EXIST);
if ($DB->record_exists('enrol', array('courseid'=>$this->get_courseid(), 'enrol'=>'manual'))) {
// Something already added instances, do not add default instances.
$plugins = enrol_get_plugins(true);
foreach ($plugins as $plugin) {
$plugin->restore_sync_course($course);
}
} else {
// Looks like a newly created course.
enrol_course_updated(true, $course, null);
}
}
}
/**
* This structure steps restores the enrol plugins and their underlying
* enrolments, performing all the mappings and/or movements required
@@ -1930,6 +1955,178 @@ class restore_comments_structure_step extends restore_structure_step {
}
}
/**
* This structure steps restores the badges and their configs
*/
class restore_badges_structure_step extends restore_structure_step {
/**
* Conditionally decide if this step should be executed.
*
* This function checks the following parameters:
*
* 1. Badges and course badges are enabled on the site.
* 2. The course/badges.xml file exists.
* 3. All modules are restorable.
* 4. All modules are marked for restore.
*
* @return bool True is safe to execute, false otherwise
*/
protected function execute_condition() {
global $CFG;
// First check is badges and course level badges are enabled on this site.
if (empty($CFG->enablebadges) || empty($CFG->badges_allowcoursebadges)) {
// Disabled, don't restore course badges.
return false;
}
// Check if badges.xml is included in the backup.
$fullpath = $this->task->get_taskbasepath();
$fullpath = rtrim($fullpath, '/') . '/' . $this->filename;
if (!file_exists($fullpath)) {
// Not found, can't restore course badges.
return false;
}
// Check we are able to restore all backed up modules.
if ($this->task->is_missing_modules()) {
return false;
}
// Finally check all modules within the backup are being restored.
if ($this->task->is_excluding_activities()) {
return false;
}
return true;
}
protected function define_structure() {
$paths = array();
$paths[] = new restore_path_element('badge', '/badges/badge');
$paths[] = new restore_path_element('criterion', '/badges/badge/criteria/criterion');
$paths[] = new restore_path_element('parameter', '/badges/badge/criteria/criterion/parameters/parameter');
$paths[] = new restore_path_element('manual_award', '/badges/badge/manual_awards/manual_award');
return $paths;
}
public function process_badge($data) {
global $DB, $CFG;
require_once($CFG->libdir . '/badgeslib.php');
$data = (object)$data;
$data->usercreated = $this->get_mappingid('user', $data->usercreated);
$data->usermodified = $this->get_mappingid('user', $data->usermodified);
// We'll restore the badge image.
$restorefiles = true;
$courseid = $this->get_courseid();
$params = array(
'name' => $data->name,
'description' => $data->description,
'image' => 0,
'timecreated' => $this->apply_date_offset($data->timecreated),
'timemodified' => $this->apply_date_offset($data->timemodified),
'usercreated' => $data->usercreated,
'usermodified' => $data->usermodified,
'issuername' => $data->issuername,
'issuerurl' => $data->issuerurl,
'issuercontact' => $data->issuercontact,
'expiredate' => $this->apply_date_offset($data->expiredate),
'expireperiod' => $data->expireperiod,
'type' => BADGE_TYPE_COURSE,
'courseid' => $courseid,
'message' => $data->message,
'messagesubject' => $data->messagesubject,
'attachment' => $data->attachment,
'notification' => $data->notification,
'status' => BADGE_STATUS_INACTIVE,
'nextcron' => $this->apply_date_offset($data->nextcron)
);
$newid = $DB->insert_record('badge', $params);
$this->set_mapping('badge', $data->id, $newid, $restorefiles);
}
public function process_criterion($data) {
global $DB;
$data = (object)$data;
$params = array(
'badgeid' => $this->get_new_parentid('badge'),
'criteriatype' => $data->criteriatype,
'method' => $data->method
);
$newid = $DB->insert_record('badge_criteria', $params);
$this->set_mapping('criterion', $data->id, $newid);
}
public function process_parameter($data) {
global $DB, $CFG;
require_once($CFG->libdir . '/badgeslib.php');
$data = (object)$data;
$criteriaid = $this->get_new_parentid('criterion');
// Parameter array that will go to database.
$params = array();
$params['critid'] = $criteriaid;
$oldparam = explode('_', $data->name);
if ($data->criteriatype == BADGE_CRITERIA_TYPE_ACTIVITY) {
$module = $this->get_mappingid('course_module', $oldparam[1]);
$params['name'] = $oldparam[0] . '_' . $module;
$params['value'] = $oldparam[0] == 'module' ? $module : $data->value;
} else if ($data->criteriatype == BADGE_CRITERIA_TYPE_COURSE) {
$params['name'] = $oldparam[0] . '_' . $this->get_courseid();
$params['value'] = $oldparam[0] == 'course' ? $this->get_courseid() : $data->value;
} else if ($data->criteriatype == BADGE_CRITERIA_TYPE_MANUAL) {
$role = $this->get_mappingid('role', $data->value);
if (!empty($role)) {
$params['name'] = 'role_' . $role;
$params['value'] = $role;
} else {
return;
}
}
if (!$DB->record_exists('badge_criteria_param', $params)) {
$DB->insert_record('badge_criteria_param', $params);
}
}
public function process_manual_award($data) {
global $DB;
$data = (object)$data;
$role = $this->get_mappingid('role', $data->issuerrole);
if (!empty($role)) {
$award = array(
'badgeid' => $this->get_new_parentid('badge'),
'recipientid' => $this->get_mappingid('user', $data->recipientid),
'issuerid' => $this->get_mappingid('user', $data->issuerid),
'issuerrole' => $role,
'datemet' => $this->apply_date_offset($data->datemet)
);
$DB->insert_record('badge_manual_award', $award);
}
}
protected function after_execute() {
// Add related files.
$this->add_related_files('badges', 'badgeimage', 'badge');
}
}
/**
* This structure steps restores the calendar events
*/
@@ -483,6 +483,7 @@ abstract class backup_controller_dbops extends backup_dbops {
'backup_general_blocks' => 'blocks',
'backup_general_filters' => 'filters',
'backup_general_comments' => 'comments',
'backup_general_badges' => 'badges',
'backup_general_userscompletion' => 'userscompletion',
'backup_general_logs' => 'logs',
'backup_general_histories' => 'grade_histories'
@@ -26,101 +26,6 @@ defined('MOODLE_INTERNAL') || die();
// Include all the needed stuff
global $CFG;
require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php');
require_once($CFG->dirroot . '/backup/util/includes/restore_includes.php');
/**
* Restore dbops tests (all).
*/
class restore_dbops_testcase extends advanced_testcase {
/**
* Verify the xxx_ids_cached (in-memory backup_ids cache) stuff works as expected.
*
* Note that those private implementations are tested here by using the public
* backup_ids API and later performing low-level tests.
*/
public function test_backup_ids_cached() {
global $DB;
$dbman = $DB->get_manager(); // We are going to use database_manager services.
$this->resetAfterTest(true); // Playing with temp tables, better reset once finished.
// Some variables and objects for testing.
$restoreid = 'testrestoreid';
$mapping = new stdClass();
$mapping->itemname = 'user';
$mapping->itemid = 1;
$mapping->newitemid = 2;
$mapping->parentitemid = 3;
$mapping->info = 'info';
// Create the backup_ids temp tables used by restore.
restore_controller_dbops::create_restore_temp_tables($restoreid);
// Send one mapping using the public api with defaults.
restore_dbops::set_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid);
// Get that mapping and verify everything is returned as expected.
$result = restore_dbops::get_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid);
$this->assertSame($mapping->itemname, $result->itemname);
$this->assertSame($mapping->itemid, $result->itemid);
$this->assertSame(0, $result->newitemid);
$this->assertSame(null, $result->parentitemid);
$this->assertSame(null, $result->info);
// Drop the backup_xxx_temp temptables manually, so memory cache won't be invalidated.
$dbman->drop_table(new xmldb_table('backup_ids_temp'));
$dbman->drop_table(new xmldb_table('backup_files_temp'));
// Verify the mapping continues returning the same info,
// now from cache (the table does not exist).
$result = restore_dbops::get_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid);
$this->assertSame($mapping->itemname, $result->itemname);
$this->assertSame($mapping->itemid, $result->itemid);
$this->assertSame(0, $result->newitemid);
$this->assertSame(null, $result->parentitemid);
$this->assertSame(null, $result->info);
// Recreate the temp table, just to drop it using the restore API in
// order to check that, then, the cache becomes invalid for the same request.
restore_controller_dbops::create_restore_temp_tables($restoreid);
restore_controller_dbops::drop_restore_temp_tables($restoreid);
// No cached info anymore, so the mapping request will arrive to
// DB leading to error (temp table does not exist).
try {
$result = restore_dbops::get_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid);
$this->fail('Expecting an exception, none occurred');
} catch (Exception $e) {
$this->assertTrue($e instanceof dml_exception);
$this->assertSame('Table "backup_ids_temp" does not exist', $e->getMessage());
}
// Create the backup_ids temp tables once more.
restore_controller_dbops::create_restore_temp_tables($restoreid);
// Send one mapping using the public api with complete values.
restore_dbops::set_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid,
$mapping->newitemid, $mapping->parentitemid, $mapping->info);
// Get that mapping and verify everything is returned as expected.
$result = restore_dbops::get_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid);
$this->assertSame($mapping->itemname, $result->itemname);
$this->assertSame($mapping->itemid, $result->itemid);
$this->assertSame($mapping->newitemid, $result->newitemid);
$this->assertSame($mapping->parentitemid, $result->parentitemid);
$this->assertSame($mapping->info, $result->info);
// Finally, drop the temp tables properly and get the DB error again (memory caches empty).
restore_controller_dbops::drop_restore_temp_tables($restoreid);
try {
$result = restore_dbops::get_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid);
$this->fail('Expecting an exception, none occurred');
} catch (Exception $e) {
$this->assertTrue($e instanceof dml_exception);
$this->assertSame('Table "backup_ids_temp" does not exist', $e->getMessage());
}
}
}
/**
* Backup dbops tests (all).
@@ -0,0 +1,122 @@
<?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/>.
/**
* @package core_backup
* @category phpunit
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
// Include all the needed stuff
global $CFG;
require_once($CFG->dirroot . '/backup/util/includes/restore_includes.php');
/**
* Restore dbops tests (all).
*/
class restore_dbops_testcase extends advanced_testcase {
/**
* Verify the xxx_ids_cached (in-memory backup_ids cache) stuff works as expected.
*
* Note that those private implementations are tested here by using the public
* backup_ids API and later performing low-level tests.
*/
public function test_backup_ids_cached() {
global $DB;
$dbman = $DB->get_manager(); // We are going to use database_manager services.
$this->resetAfterTest(true); // Playing with temp tables, better reset once finished.
// Some variables and objects for testing.
$restoreid = 'testrestoreid';
$mapping = new stdClass();
$mapping->itemname = 'user';
$mapping->itemid = 1;
$mapping->newitemid = 2;
$mapping->parentitemid = 3;
$mapping->info = 'info';
// Create the backup_ids temp tables used by restore.
restore_controller_dbops::create_restore_temp_tables($restoreid);
// Send one mapping using the public api with defaults.
restore_dbops::set_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid);
// Get that mapping and verify everything is returned as expected.
$result = restore_dbops::get_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid);
$this->assertSame($mapping->itemname, $result->itemname);
$this->assertSame($mapping->itemid, $result->itemid);
$this->assertSame(0, $result->newitemid);
$this->assertSame(null, $result->parentitemid);
$this->assertSame(null, $result->info);
// Drop the backup_xxx_temp temptables manually, so memory cache won't be invalidated.
$dbman->drop_table(new xmldb_table('backup_ids_temp'));
$dbman->drop_table(new xmldb_table('backup_files_temp'));
// Verify the mapping continues returning the same info,
// now from cache (the table does not exist).
$result = restore_dbops::get_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid);
$this->assertSame($mapping->itemname, $result->itemname);
$this->assertSame($mapping->itemid, $result->itemid);
$this->assertSame(0, $result->newitemid);
$this->assertSame(null, $result->parentitemid);
$this->assertSame(null, $result->info);
// Recreate the temp table, just to drop it using the restore API in
// order to check that, then, the cache becomes invalid for the same request.
restore_controller_dbops::create_restore_temp_tables($restoreid);
restore_controller_dbops::drop_restore_temp_tables($restoreid);
// No cached info anymore, so the mapping request will arrive to
// DB leading to error (temp table does not exist).
try {
$result = restore_dbops::get_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid);
$this->fail('Expecting an exception, none occurred');
} catch (Exception $e) {
$this->assertTrue($e instanceof dml_exception);
$this->assertSame('Table "backup_ids_temp" does not exist', $e->getMessage());
}
// Create the backup_ids temp tables once more.
restore_controller_dbops::create_restore_temp_tables($restoreid);
// Send one mapping using the public api with complete values.
restore_dbops::set_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid,
$mapping->newitemid, $mapping->parentitemid, $mapping->info);
// Get that mapping and verify everything is returned as expected.
$result = restore_dbops::get_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid);
$this->assertSame($mapping->itemname, $result->itemname);
$this->assertSame($mapping->itemid, $result->itemid);
$this->assertSame($mapping->newitemid, $result->newitemid);
$this->assertSame($mapping->parentitemid, $result->parentitemid);
$this->assertSame($mapping->info, $result->info);
// Finally, drop the temp tables properly and get the DB error again (memory caches empty).
restore_controller_dbops::drop_restore_temp_tables($restoreid);
try {
$result = restore_dbops::get_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid);
$this->fail('Expecting an exception, none occurred');
} catch (Exception $e) {
$this->assertTrue($e instanceof dml_exception);
$this->assertSame('Table "backup_ids_temp" does not exist', $e->getMessage());
}
}
}
@@ -383,6 +383,7 @@ abstract class backup_cron_automated_helper {
'blocks' => 'backup_auto_blocks',
'filters' => 'backup_auto_filters',
'comments' => 'backup_auto_comments',
'badges' => 'backup_auto_badges',
'completion_information' => 'backup_auto_userscompletion',
'logs' => 'backup_auto_logs',
'histories' => 'backup_auto_histories'
+1 -1
View File
@@ -322,7 +322,7 @@ class behat_backup extends behat_base {
try {
$fieldnode = $this->find_field($locator);
$field = behat_field_manager::get_field($fieldnode, $locator, $this->getSession());
$field = behat_field_manager::get_form_field($fieldnode, $this->getSession());
$field->set_value($value);
} catch (ElementNotFoundException $e) {
+24 -15
View File
@@ -89,22 +89,31 @@ if (count($acceptedroles) > 1) {
$roleids = array_map(create_function('$o', 'return $o->roleid;'), $roles);
$selection = array_intersect($acceptedroles, $roleids);
}
list($usertest, $userparams) = $DB->get_in_or_equal($selection, SQL_PARAMS_NAMED, 'existing', true);
$options = $DB->get_records_sql('SELECT * FROM {role} WHERE id ' . $usertest, $userparams);
foreach ($options as $p) {
$select[$p->id] = role_get_name($p);
}
if (!$role) {
$pageurl = new moodle_url('/badges/award.php', array('id' => $badgeid));
if (!empty($selection)) {
list($usertest, $userparams) = $DB->get_in_or_equal($selection, SQL_PARAMS_NAMED, 'existing', true);
$options = $DB->get_records_sql('SELECT * FROM {role} WHERE id ' . $usertest, $userparams);
foreach ($options as $p) {
$select[$p->id] = role_get_name($p);
}
if (!$role) {
$pageurl = new moodle_url('/badges/award.php', array('id' => $badgeid));
echo $OUTPUT->header();
echo $OUTPUT->box(get_string('selectaward', 'badges') . $OUTPUT->single_select(new moodle_url($pageurl), 'role', $select));
echo $OUTPUT->footer();
die();
} else {
$pageurl = new moodle_url('/badges/award.php', array('id' => $badgeid));
$issuerrole = new stdClass();
$issuerrole->roleid = $role;
$roleselect = get_string('selectaward', 'badges') . $OUTPUT->single_select(new moodle_url($pageurl), 'role', $select, $role);
}
} else {
echo $OUTPUT->header();
echo $OUTPUT->box(get_string('selectaward', 'badges') . $OUTPUT->single_select(new moodle_url($pageurl), 'role', $select));
$return = html_writer::link(new moodle_url('recipients.php', array('id' => $badge->id)), $strrecipients);
echo $OUTPUT->notification(get_string('notacceptedrole', 'badges', $return));
echo $OUTPUT->footer();
die();
} else {
$pageurl = new moodle_url('/badges/award.php', array('id' => $badgeid));
$issuerrole = new stdClass();
$issuerrole->roleid = $role;
$roleselect = get_string('selectaward', 'badges') . $OUTPUT->single_select(new moodle_url($pageurl), 'role', $select, $role);
}
} else {
// User has to be an admin or the one with the required role.
@@ -112,8 +121,8 @@ if (count($acceptedroles) > 1) {
$usersids = array_keys($users);
if (!$isadmin && !in_array($USER->id, $usersids)) {
echo $OUTPUT->header();
$rlink = html_writer::link(new moodle_url('recipients.php', array('id' => $badge->id)), get_string('recipients', 'badges'));
echo $OUTPUT->notification(get_string('notacceptedrole', 'badges', $rlink));
$return = html_writer::link(new moodle_url('recipients.php', array('id' => $badge->id)), $strrecipients);
echo $OUTPUT->notification(get_string('notacceptedrole', 'badges', $return));
echo $OUTPUT->footer();
die();
} else {
+1
View File
@@ -168,6 +168,7 @@ abstract class award_criteria {
if (in_array('grade', $this->optional_params)) {
$parameter[] =& $mform->createElement('static', 'mgrade_' . $param['id'], null, get_string('mingrade', 'badges'));
$parameter[] =& $mform->createElement('text', 'grade_' . $param['id'], '', array('size' => '5'));
$mform->setType('grade_' . $param['id'], PARAM_INT);
}
if (in_array('bydate', $this->optional_params)) {
@@ -119,6 +119,7 @@ class award_criteria_course extends award_criteria {
$parameter[] =& $mform->createElement('text', 'grade_' . $param['course'], '', array('size' => '5'));
$parameter[] =& $mform->createElement('static', 'complby_' . $param['course'], null, get_string('bydate', 'badges'));
$parameter[] =& $mform->createElement('date_selector', 'bydate_' . $param['course'], '', array('optional' => true));
$mform->setType('grade_' . $param['course'], PARAM_INT);
$mform->addGroup($parameter, 'param_' . $param['course'], '', array(' '), false);
$mform->disabledIf('bydate_' . $param['course'] . '[day]', 'bydate_' . $param['course'] . '[enabled]', 'notchecked');
+4 -1
View File
@@ -191,8 +191,11 @@ if ($totalcount) {
echo $output->render($badges);
} else {
echo $output->notification(get_string('nobadges', 'badges'));
echo $OUTPUT->single_button(new moodle_url('newbadge.php', array('type' => $type, 'id' => $courseid)),
if (has_capability('moodle/badges:createbadge', $PAGE->context)) {
echo $OUTPUT->single_button(new moodle_url('newbadge.php', array('type' => $type, 'id' => $courseid)),
get_string('newbadge', 'badges'));
}
}
echo $OUTPUT->footer();
+6 -3
View File
@@ -549,9 +549,12 @@ class core_badges_renderer extends plugin_renderer_base {
$paging = new paging_bar($badges->totalcount, $badges->page, $badges->perpage, $this->page->url, 'page');
// New badge button.
$n['type'] = $this->page->url->get_param('type');
$n['id'] = $this->page->url->get_param('id');
$htmlnew = $this->output->single_button(new moodle_url('newbadge.php', $n), get_string('newbadge', 'badges'));
$htmlnew = '';
if (has_capability('moodle/badges:createbadge', $this->page->context)) {
$n['type'] = $this->page->url->get_param('type');
$n['id'] = $this->page->url->get_param('id');
$htmlnew = $this->output->single_button(new moodle_url('newbadge.php', $n), get_string('newbadge', 'badges'));
}
$htmlpagingbar = $this->render($paging);
$table = new html_table();
+11 -3
View File
@@ -52,7 +52,7 @@ class block_badges extends block_base {
return array(
'admin' => false,
'site-index' => true,
'course-view' => false,
'course-view' => true,
'mod' => false,
'my' => true
);
@@ -88,8 +88,16 @@ class block_badges extends block_base {
if (empty($CFG->enablebadges)) {
$this->content->text .= get_string('badgesdisabled', 'badges');
} else if ($badges = badges_get_user_badges($USER->id, null, 0, $this->config->numberofbadges)) {
$output = $PAGE->get_renderer('core', 'badges');
return $this->content;
}
$courseid = $this->page->course->id;
if ($courseid == SITEID) {
$courseid = null;
}
if ($badges = badges_get_user_badges($USER->id, $courseid, 0, $this->config->numberofbadges)) {
$output = $this->page->get_renderer('core', 'badges');
$this->content->text = $output->print_badges_list($badges, $USER->id, true);
} else {
$this->content->text .= get_string('nothingtodisplay', 'block_badges');
+4 -4
View File
@@ -26,11 +26,11 @@
$capabilities = array(
'block/badges:addinstance' => array(
'riskbitmask' => RISK_PERSONAL,
'captype' => 'read',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'user' => CAP_ALLOW,
'contextlevel' => CONTEXT_BLOCK,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/site:manageblocks'
),
+1 -1
View File
@@ -25,6 +25,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2013050100; // The current plugin version (Date: YYYYMMDDXX).
$plugin->version = 2013050101; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2013050100; // Requires this Moodle version.
$plugin->component = 'block_badges';
+4
View File
@@ -54,5 +54,9 @@ function xmldb_block_community_upgrade($oldversion) {
// Put any upgrade step following this
// Moodle v2.5.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+4
View File
@@ -60,5 +60,9 @@ function xmldb_block_completionstatus_upgrade($oldversion, $block) {
// Savepoint reached.
upgrade_block_savepoint(true, 2012112901, 'completionstatus');
}
// Moodle v2.5.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+3 -3
View File
@@ -210,12 +210,12 @@ if (empty($completions)) {
$agg = $info->get_aggregation_method($row['type']);
echo '('. html_writer::start_tag('i');
if ($agg == COMPLETION_AGGREGATION_ALL) {
echo strtolower(get_string('all', 'completion'));
echo textlib::strtolower(get_string('all', 'completion'));
} else {
echo strtolower(get_string('any', 'completion'));
echo textlib::strtolower(get_string('any', 'completion'));
}
echo html_writer::end_tag('i') .strtolower(get_string('required')).')';
echo html_writer::end_tag('i') .textlib::strtolower(get_string('required')).')';
$agg_type = false;
}
}
+3
View File
@@ -103,6 +103,9 @@ class block_course_overview_renderer extends plugin_renderer_base {
// No need to pass title through s() here as it will be done automatically by html_writer.
$attributes = array('title' => $course->fullname);
if (empty($course->visible)) {
$attributes['class'] = 'dimmed';
}
if ($course->id > 0) {
$courseurl = new moodle_url('/course/view.php', array('id' => $course->id));
$coursefullname = format_string($course->fullname, true, $course->id);
+4
View File
@@ -65,5 +65,9 @@ function xmldb_block_course_summary_upgrade($oldversion, $block) {
}
// Moodle v2.5.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+9 -2
View File
@@ -836,8 +836,15 @@ M.core_dock.genericblock.prototype = {
}
// Must set the image src seperatly of we get an error with XML strict headers
var moveto = Y.Node.create('<input type="image" class="moveto customcommand requiresjs" alt="'+M.str.block.addtodock+'" title="'+
Y.Escape.html(M.util.get_string('dockblock', 'block', node.one('.header .title h2').getHTML())) +'" />');
var moveto = Y.Node.create('<input type="image" class="moveto customcommand requiresjs" />');
var header = node.one('.header .title h2');
moveto.setAttribute('alt', Y.Escape.html(M.util.get_string('addtodock', 'block')));
if (header) {
moveto.setAttribute('title', Y.Escape.html(M.util.get_string('dockblock', 'block', header.getHTML())));
} else {
moveto.setAttribute('title', Y.Escape.html(M.util.get_string('addtodock', 'block')));
}
var icon = 't/block_to_dock';
if (right_to_left()) {
icon = 't/block_to_dock_rtl';
+4
View File
@@ -40,5 +40,9 @@ function xmldb_block_html_upgrade($oldversion) {
// Put any upgrade step following this
// Moodle v2.5.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+1 -1
View File
@@ -340,7 +340,7 @@ class block_base {
/**
* Subclasses should override this and return true if the
* subclass block has a config_global.html file.
* subclass block has a settings.php file.
*
* @return boolean
*/
+4
View File
@@ -66,5 +66,9 @@ function xmldb_block_navigation_upgrade($oldversion, $block) {
// Put any upgrade step following this
// Moodle v2.5.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+3 -1
View File
@@ -105,7 +105,9 @@ class block_navigation_renderer extends plugin_renderer_base {
if ($item->hidden) {
$attributes['class'] = 'dimmed_text';
}
if (is_string($item->action) || empty($item->action) || ($item->type === navigation_node::TYPE_CATEGORY && empty($options['linkcategories']))) {
if (is_string($item->action) || empty($item->action) ||
(($item->type === navigation_node::TYPE_CATEGORY || $item->type === navigation_node::TYPE_MY_CATEGORY) &&
empty($options['linkcategories']))) {
$attributes['tabindex'] = '0'; //add tab support to span but still maintain character stream sequence.
$content = html_writer::tag('span', $content, $attributes);
} else if ($item->action instanceof action_link) {
@@ -391,11 +391,15 @@ BRANCH.prototype = {
},
/**
* Attaches required events to the branch structure.
*
* @chainable
* @method wire
* @return {BRANCH} This function is chainable, it always returns itself.
*/
wire : function() {
this.node = this.node || Y.one('#'+this.get('id'));
if (!this.node) {
return false;
return this;
}
if (this.get('expandable')) {
this.node.setAttribute('data-expandable', '1');
File diff suppressed because one or more lines are too long
@@ -391,11 +391,15 @@ BRANCH.prototype = {
},
/**
* Attaches required events to the branch structure.
*
* @chainable
* @method wire
* @return {BRANCH} This function is chainable, it always returns itself.
*/
wire : function() {
this.node = this.node || Y.one('#'+this.get('id'));
if (!this.node) {
return false;
return this;
}
if (this.get('expandable')) {
this.node.setAttribute('data-expandable', '1');
+5 -1
View File
@@ -389,11 +389,15 @@ BRANCH.prototype = {
},
/**
* Attaches required events to the branch structure.
*
* @chainable
* @method wire
* @return {BRANCH} This function is chainable, it always returns itself.
*/
wire : function() {
this.node = this.node || Y.one('#'+this.get('id'));
if (!this.node) {
return false;
return this;
}
if (this.get('expandable')) {
this.node.setAttribute('data-expandable', '1');
+5 -3
View File
@@ -53,9 +53,6 @@ function xmldb_block_section_links_upgrade($oldversion, $block) {
// Moodle v2.4.0 release upgrade line
// Put any upgrade step following this
// Moodle v2.5.0 release upgrade line
// Put any upgrade step following this
if ($oldversion < 2013012200.00) {
// The section links block used to use its own crazy plugin name.
@@ -78,5 +75,10 @@ function xmldb_block_section_links_upgrade($oldversion, $block) {
upgrade_block_savepoint(true, 2013012200.00, 'section_links');
}
// Moodle v2.5.0 release upgrade line
// Put any upgrade step following this
return true;
}
+4
View File
@@ -65,5 +65,9 @@ function xmldb_block_selfcompletion_upgrade($oldversion, $block) {
}
// Moodle v2.5.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+4
View File
@@ -66,5 +66,9 @@ function xmldb_block_settings_upgrade($oldversion, $block) {
// Put any upgrade step following this
// Moodle v2.5.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+5
View File
@@ -350,6 +350,11 @@ class cache_helper {
* @param string $definition
*/
protected static function ensure_ready_for_stats($store, $definition) {
// This function is performance-sensitive, so exit as quickly as possible
// if we do not need to do anything.
if (isset(self::$stats[$definition][$store])) {
return;
}
if (!array_key_exists($definition, self::$stats)) {
self::$stats[$definition] = array(
$store => array(
+11 -4
View File
@@ -912,7 +912,8 @@ class cache implements cache_loader {
* @return bool
*/
protected function is_in_persist_cache($key) {
if (is_array($key)) {
// This method of checking if an array was supplied is faster than is_array.
if ($key === (array)$key) {
$key = $key['key'];
}
// This could be written as a single line, however it has been split because the ttl check is faster than the instanceof
@@ -933,10 +934,15 @@ class cache implements cache_loader {
* @return mixed|false The data from the persist cache or false if it wasn't there.
*/
protected function get_from_persist_cache($key) {
if (is_array($key)) {
// This method of checking if an array was supplied is faster than is_array.
if ($key === (array)$key) {
$key = $key['key'];
}
if (!$this->persist || !array_key_exists($key, $this->persistcache)) {
// This isset check is faster than array_key_exists but will return false
// for null values, meaning null values will come from backing store not
// the persist cache. We think this okay because null usage should be
// very rare (see comment in MDL-39472).
if (!$this->persist || !isset($this->persistcache[$key])) {
$result = false;
} else {
$data = $this->persistcache[$key];
@@ -976,7 +982,8 @@ class cache implements cache_loader {
* @return bool
*/
protected function set_in_persist_cache($key, $data) {
if (is_array($key)) {
// This method of checking if an array was supplied is faster than is_array.
if ($key === (array)$key) {
$key = $key['key'];
}
$this->persistcache[$key] = $data;
-1
View File
@@ -27,7 +27,6 @@
*/
require_once($CFG->dirroot.'/cache/forms.php');
require_once($CFG->dirroot.'/cache/stores/file/lib.php');
/**
* Form for adding a file instance.
+34
View File
@@ -101,6 +101,19 @@ class cachestore_file extends cache_store implements cache_is_key_aware, cache_i
*/
protected $definition;
/**
* A reference to the global $CFG object.
*
* You may be asking yourself why on earth this is here, but there is a good reason.
* By holding onto a reference of the $CFG object we can be absolutely sure that it won't be destroyed before
* we are done with it.
* This makes it possible to use a cache within a destructor method for the purposes of
* delayed writes. Like how the session mechanisms work.
*
* @var stdClass
*/
private $cfg = null;
/**
* Constructs the store instance.
*
@@ -111,6 +124,13 @@ class cachestore_file extends cache_store implements cache_is_key_aware, cache_i
* @param array $configuration
*/
public function __construct($name, array $configuration = array()) {
global $CFG;
if (isset($CFG)) {
// Hold onto a reference of the global $CFG object.
$this->cfg = $CFG;
}
$this->name = $name;
if (array_key_exists('path', $configuration) && $configuration['path'] !== '') {
$this->custompath = true;
@@ -605,13 +625,27 @@ class cachestore_file extends cache_store implements cache_is_key_aware, cache_i
* @throws coding_exception
*/
protected function ensure_path_exists() {
global $CFG;
if (!is_writable($this->path)) {
if ($this->custompath && !$this->autocreate) {
throw new coding_exception('File store path does not exist. It must exist and be writable by the web server.');
}
$createdcfg = false;
if (!isset($CFG)) {
// This can only happen during destruction of objects.
// A cache is being used within a destructor, php is ending a request and $CFG has
// already being cleaned up.
// Rebuild $CFG with directory permissions just to complete this write.
$CFG = $this->cfg;
$createdcfg = true;
}
if (!make_writable_directory($this->path, false)) {
throw new coding_exception('File store path does not exist and can not be created.');
}
if ($createdcfg) {
// We re-created it so we'll clean it up.
unset($CFG);
}
}
return true;
}
-1
View File
@@ -27,7 +27,6 @@
defined('MOODLE_INTERNAL') || die();
require_once($CFG->dirroot.'/cache/forms.php');
require_once($CFG->dirroot.'/cache/stores/memcached/lib.php');
/**
* Form for adding a memcache instance.
-1
View File
@@ -35,7 +35,6 @@ defined('MOODLE_INTERNAL') || die();
// Include the necessary evils.
require_once($CFG->dirroot.'/cache/forms.php');
require_once($CFG->dirroot.'/cache/stores/mongodb/lib.php');
/**
* The form to add an instance of the MongoDB store to the system.
+1
View File
@@ -86,6 +86,7 @@ $search .= html_writer::start_tag('div');
$search .= html_writer::label(get_string('searchcohort', 'cohort'), 'cohort_search_q'); // No : in form labels!
$search .= html_writer::empty_tag('input', array('id'=>'cohort_search_q', 'type'=>'text', 'name'=>'search', 'value'=>$searchquery));
$search .= html_writer::empty_tag('input', array('type'=>'submit', 'value'=>get_string('search', 'cohort')));
$search .= html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'contextid', 'value'=>$contextid));
$search .= html_writer::end_tag('div');
$search .= html_writer::end_tag('form');
echo $search;
+1 -1
View File
@@ -12,7 +12,7 @@ Feature: Add cohorts of users
| user3 | Third | User | third@user.com |
| user4 | Forth | User | forth@user.com |
And I log in as "admin"
And I expand "Front page settings" node
And I collapse "Front page settings" node
And I expand "Site administration" node
And I expand "Users" node
And I expand "Accounts" node
+1 -1
View File
@@ -65,7 +65,7 @@ class behat_cohort extends behat_base {
$steps = array_merge(
array(
new Given('I am on homepage'),
new Given('I expand "Front page settings" node'),
new Given('I collapse "Front page settings" node'),
new Given('I expand "Site administration" node'),
new Given('I expand "Users" node'),
new Given('I expand "Accounts" node'),
@@ -22,7 +22,7 @@ Feature: Upload users to a cohort
And I follow "Course 2"
And I add "Cohort sync" enrolment method with:
| Cohort | Cohort 2 |
And I expand "Course administration" node
And I collapse "Course administration" node
And I expand "Site administration" node
And I expand "Users" node
And I expand "Accounts" node
+38
View File
@@ -554,6 +554,11 @@ $CFG->admin = 'admin';
//=========================================================================
// 11. BEHAT SUPPORT
//=========================================================================
// Behat needs a separate data directory and unique database prefix:
//
// $CFG->behat_prefix = 'bht_';
// $CFG->behat_dataroot = '/home/example/bht_moodledata';
//
// Behat uses http://localhost:8000 as default URL to run
// the acceptance tests, you can override this value.
// Example:
@@ -574,6 +579,32 @@ $CFG->admin = 'admin';
// 'verbose' => false
// )
// )
// ),
// 'Mac-Firefox' => array(
// 'extensions' => array(
// 'Behat\MinkExtension\Extension' => array(
// 'selenium2' => array(
// 'browser' => 'firefox',
// 'capabilities' => array(
// 'platform' => 'OS X 10.6',
// 'version' => 20
// )
// )
// )
// )
// ),
// 'Mac-Safari' => array(
// 'extensions' => array(
// 'Behat\MinkExtension\Extension' => array(
// 'selenium2' => array(
// 'browser' => 'safari',
// 'capabilities' => array(
// 'platform' => 'OS X 10.8',
// 'version' => 6
// )
// )
// )
// )
// )
// );
//
@@ -587,6 +618,13 @@ $CFG->admin = 'admin';
// Example:
// $CFG->behat_switchcompletely = true;
//
// You can force the browser session (not user's sessions) to restart after N seconds. This could
// be useful if you are using a cloud-based service with time restrictions in the browser side.
// Setting this value the browser session that Behat is using will be restarted. Set the time in
// seconds. Is not recommended to use this setting if you don't explicitly need it.
// Example:
// $CFG->behat_restart_browser_after = 7200; // Restarts the browser session after 2 hours
//
//=========================================================================
// ALL DONE! To continue installation, visit your main page with a browser
+2 -2
View File
@@ -81,7 +81,7 @@ class course_edit_form extends moodleform {
$displaylist = coursecat::make_categories_list('moodle/course:create');
if (!isset($displaylist[$course->category])) {
//always keep current
$displaylist[$course->category] = coursecat::get($course->category)->get_formatted_name();
$displaylist[$course->category] = coursecat::get($course->category, MUST_EXIST, true)->get_formatted_name();
}
$mform->addElement('select', 'category', get_string('coursecategory'), $displaylist);
$mform->addHelpButton('category', 'coursecategory');
@@ -248,7 +248,7 @@ class course_edit_form extends moodleform {
enrol_course_edit_form($mform, $course, $context);
//--------------------------------------------------------------------------------
$mform->addElement('header','groups', get_string('groups', 'group'));
$mform->addElement('header','groups', get_string('groupsettingsheader', 'group'));
$choices = array();
$choices[NOGROUPS] = get_string('groupsnone', 'group');
+4 -4
View File
@@ -902,9 +902,9 @@ class core_course_external extends external_api {
"users" (int) Include users (default to 0 that is equal to no),
"role_assignments" (int) Include role assignments (default to 0 that is equal to no),
"comments" (int) Include user comments (default to 0 that is equal to no),
"completion_information" (int) Include user course completion information (default to 0 that is equal to no),
"userscompletion" (int) Include user course completion information (default to 0 that is equal to no),
"logs" (int) Include course logs (default to 0 that is equal to no),
"histories" (int) Include histories (default to 0 that is equal to no)'
"grade_histories" (int) Include histories (default to 0 that is equal to no)'
),
'value' => new external_value(PARAM_RAW, 'the value for the option 1 (yes) or 0 (no)'
)
@@ -966,9 +966,9 @@ class core_course_external extends external_api {
'users' => 0,
'role_assignments' => 0,
'comments' => 0,
'completion_information' => 0,
'userscompletion' => 0,
'logs' => 0,
'histories' => 0
'grade_histories' => 0
);
$backupsettings = array();
+1 -1
View File
@@ -235,7 +235,7 @@ abstract class format_base {
return null;
}
if ($this->course === false) {
$this->course = $DB->get_record('course', array('id' => $this->courseid));
$this->course = get_course($this->courseid);
$options = $this->get_format_options();
foreach ($options as $optionname => $optionvalue) {
if (!isset($this->course->$optionname)) {
+31
View File
@@ -257,6 +257,37 @@ class format_topics extends format_base {
return $courseformatoptions;
}
/**
* Adds format options elements to the course/section edit form.
*
* This function is called from {@link course_edit_form::definition_after_data()}.
*
* @param MoodleQuickForm $mform form the elements are added to.
* @param bool $forsection 'true' if this is a section edit form, 'false' if this is course edit form.
* @return array array of references to the added form elements.
*/
public function create_edit_form_elements(&$mform, $forsection = false) {
$elements = parent::create_edit_form_elements($mform, $forsection);
// Increase the number of sections combo box values if the user has increased the number of sections
// using the icon on the course page beyond course 'maxsections' or course 'maxsections' has been
// reduced below the number of sections already set for the course on the site administration course
// defaults page. This is so that the number of sections is not reduced leaving unintended orphaned
// activities / resources.
if (!$forsection) {
$maxsections = get_config('moodlecourse', 'maxsections');
$numsections = $mform->getElementValue('numsections');
$numsections = $numsections[0];
if ($numsections > $maxsections) {
$element = $mform->getElement('numsections');
for ($i = $maxsections+1; $i <= $numsections; $i++) {
$element->addOption("$i", $i);
}
}
}
return $elements;
}
/**
* Updates format options for a course
*
+14
View File
@@ -35,6 +35,20 @@ require_once($CFG->dirroot.'/course/format/renderer.php');
*/
class format_topics_renderer extends format_section_renderer_base {
/**
* Constructor method, calls the parent constructor
*
* @param moodle_page $page
* @param string $target one of rendering target constants
*/
public function __construct(moodle_page $page, $target) {
parent::__construct($page, $target);
// Since format_topics_renderer::section_edit_controls() only displays the 'Set current section' control when editing mode is on
// we need to be sure that the link 'Turn editing mode on' is available for a user who does not have any other managing capability.
$page->set_other_editing_capability('moodle/course:setcurrentsection');
}
/**
* Generate the starting container html for a list of sections
* @return string HTML to output.
+9
View File
@@ -75,6 +75,7 @@ M.course.format.process_sections = function(Y, sectionlist, response, sectionfro
for (var i = sectionfrom; i <= sectionto; i++) {
// Update section title.
sectionlist.item(i).one('.'+CSS.SECTIONNAME).setContent(response.sectiontitles[i]);
// Update move icon.
ele = sectionlist.item(i).one(SELECTORS.SECTIONLEFTSIDE);
str = ele.getAttribute('alt');
@@ -82,6 +83,14 @@ M.course.format.process_sections = function(Y, sectionlist, response, sectionfro
newstr = str.substr(0, stridx +1) + i;
ele.setAttribute('alt', newstr);
ele.setAttribute('title', newstr); // For FireFox as 'alt' is not refreshed.
// Remove the current class as section has been moved.
sectionlist.item(i).removeClass('current');
}
// If there is a current section, apply corresponding class in order to highlight it.
if (response.current !== -1) {
// Add current class to the required section.
sectionlist.item(response.current).addClass('current');
}
}
}
+37 -2
View File
@@ -64,7 +64,7 @@ class format_weeks extends format_base {
// We subtract 24 hours for display purposes.
$dates->end = ($dates->end - 86400);
$dateformat = ' '.get_string('strftimedateshort');
$dateformat = get_string('strftimedateshort');
$weekday = userdate($dates->start, $dateformat);
$endweekday = userdate($dates->end, $dateformat);
return $weekday.' - '.$endweekday;
@@ -162,15 +162,19 @@ class format_weeks extends format_base {
function ajax_section_move() {
global $PAGE;
$titles = array();
$current = -1;
$course = $this->get_course();
$modinfo = get_fast_modinfo($course);
$renderer = $this->get_renderer($PAGE);
if ($renderer && ($sections = $modinfo->get_section_info_all())) {
foreach ($sections as $number => $section) {
$titles[$number] = $renderer->section_title($section, $course);
if ($this->is_section_current($section)) {
$current = $number;
}
}
}
return array('sectiontitles' => $titles, 'action' => 'move');
return array('sectiontitles' => $titles, 'current' => $current, 'action' => 'move');
}
/**
@@ -262,6 +266,37 @@ class format_weeks extends format_base {
return $courseformatoptions;
}
/**
* Adds format options elements to the course/section edit form.
*
* This function is called from {@link course_edit_form::definition_after_data()}.
*
* @param MoodleQuickForm $mform form the elements are added to.
* @param bool $forsection 'true' if this is a section edit form, 'false' if this is course edit form.
* @return array array of references to the added form elements.
*/
public function create_edit_form_elements(&$mform, $forsection = false) {
$elements = parent::create_edit_form_elements($mform, $forsection);
// Increase the number of sections combo box values if the user has increased the number of sections
// using the icon on the course page beyond course 'maxsections' or course 'maxsections' has been
// reduced below the number of sections already set for the course on the site administration course
// defaults page. This is so that the number of sections is not reduced leaving unintended orphaned
// activities / resources.
if (!$forsection) {
$maxsections = get_config('moodlecourse', 'maxsections');
$numsections = $mform->getElementValue('numsections');
$numsections = $numsections[0];
if ($numsections > $maxsections) {
$element = $mform->getElement('numsections');
for ($i = $maxsections+1; $i <= $numsections; $i++) {
$element->addOption("$i", $i);
}
}
}
return $elements;
}
/**
* Updates format options for a course
*
+3
View File
@@ -105,6 +105,9 @@ function make_log_url($module, $url) {
case 'role':
$url = '/'.$url;
break;
case 'grade':
$url = "/grade/$url";
break;
default:
$url = "/mod/$module/$url";
break;
+1
View File
@@ -183,6 +183,7 @@ if ((!empty($moveupcat) or !empty($movedowncat)) and confirm_sesskey()) {
if ($swapcategory and $movecategory) {
$DB->set_field('course_categories', 'sortorder', $swapcategory->sortorder, array('id' => $movecategory->id));
$DB->set_field('course_categories', 'sortorder', $movecategory->sortorder, array('id' => $swapcategory->id));
cache_helper::purge_by_event('changesincoursecat');
add_to_log(SITEID, "category", "move", "editcategory.php?id=$movecategory->id", $movecategory->id);
}
+25 -11
View File
@@ -72,11 +72,11 @@ class core_course_renderer extends plugin_renderer_base {
$this->page->course->id == SITEID ||
!$this->page->user_is_editing() ||
!($context = context_course::instance($this->page->course->id)) ||
!has_capability('moodle/course:update', $context) ||
!has_capability('moodle/course:manageactivities', $context) ||
!course_ajax_enabled($this->page->course) ||
!($coursenode = $this->page->settingsnav->find('courseadmin', navigation_node::TYPE_COURSE)) ||
!$coursenode->get('editsettings')) {
// too late or we are on site page or we could not find the course settings node
!($turneditingnode = $coursenode->get('turneditingonoff'))) {
// too late or we are on site page or we could not find the adjacent nodes in course settings menu
// or we are not allowed to edit
return;
}
@@ -97,8 +97,13 @@ class core_course_renderer extends plugin_renderer_base {
$modchoosertogglestring = get_string('modchooserenable', 'moodle');
$modchoosertoggleurl->param('modchooser', 'on');
}
$modchoosertoggle = navigation_node::create($modchoosertogglestring, $modchoosertoggleurl, navigation_node::TYPE_SETTING);
$coursenode->add_node($modchoosertoggle, 'editsettings');
$modchoosertoggle = navigation_node::create($modchoosertogglestring, $modchoosertoggleurl, navigation_node::TYPE_SETTING, null, 'modchoosertoggle');
// Insert the modchoosertoggle after the settings node 'turneditingonoff' (navigation_node only has function to insert before, so we insert before and then swap).
$coursenode->add_node($modchoosertoggle, 'turneditingonoff');
$turneditingnode->remove();
$coursenode->add_node($turneditingnode, 'modchoosertoggle');
$modchoosertoggle->add_class('modchoosertoggle');
$modchoosertoggle->add_class('visibleifjs');
user_preference_allow_ajax_update('usemodchooser', PARAM_BOOL);
@@ -369,9 +374,7 @@ class core_course_renderer extends plugin_renderer_base {
$activities = array(MOD_CLASS_ACTIVITY => array(), MOD_CLASS_RESOURCE => array());
foreach ($modules as $module) {
if (!array_key_exists($module->archetype, $activities)) {
// System modules cannot be added by user, do not add to dropdown
} else if (isset($module->types)) {
if (isset($module->types)) {
// This module has a subtype
// NOTE: this is legacy stuff, module subtypes are very strongly discouraged!!
$subtypes = array();
@@ -381,17 +384,28 @@ class core_course_renderer extends plugin_renderer_base {
}
// Sort module subtypes into the list
$activityclass = MOD_CLASS_ACTIVITY;
if ($module->archetype == MOD_CLASS_RESOURCE) {
$activityclass = MOD_CLASS_RESOURCE;
}
if (!empty($module->title)) {
// This grouping has a name
$activities[$module->archetype][] = array($module->title => $subtypes);
$activities[$activityclass][] = array($module->title => $subtypes);
} else {
// This grouping does not have a name
$activities[$module->archetype] = array_merge($activities[$module->archetype], $subtypes);
$activities[$activityclass] = array_merge($activities[$activityclass], $subtypes);
}
} else {
// This module has no subtypes
$activityclass = MOD_CLASS_ACTIVITY;
if ($module->archetype == MOD_ARCHETYPE_RESOURCE) {
$activityclass = MOD_CLASS_RESOURCE;
} else if ($module->archetype === MOD_ARCHETYPE_SYSTEM) {
// System modules cannot be added by user, do not add to dropdown
continue;
}
$link = $module->link->out(true, $urlparams);
$activities[$module->archetype][$link] = $module->title;
$activities[$activityclass][$link] = $module->title;
}
}
+2 -2
View File
@@ -71,9 +71,9 @@ class course_request_form extends moodleform {
if (!empty($CFG->requestcategoryselection)) {
$displaylist = coursecat::make_categories_list();
$mform->addElement('select', 'category', get_string('category'), $displaylist);
$mform->addElement('select', 'category', get_string('coursecategory'), $displaylist);
$mform->setDefault('category', $CFG->defaultrequestcategory);
$mform->addHelpButton('category', 'category');
$mform->addHelpButton('category', 'coursecategory');
}
$mform->addElement('editor', 'summary_editor', get_string('summary'), null, course_request::summary_editor_options());
+13 -5
View File
@@ -84,7 +84,11 @@ foreach ($modinfo->cms as $cm) {
// preload instances
foreach ($resources as $modname=>$instances) {
$resources[$modname] = $DB->get_records_list($modname, 'id', $instances, 'id', 'id,name,intro,introformat,timemodified');
$additionalfields = '';
if (plugin_supports('mod', $modname, FEATURE_MOD_INTRO)) {
$additionalfields = ',intro,introformat';
}
$resources[$modname] = $DB->get_records_list($modname, 'id', $instances, 'id', 'id,name'.$additionalfields);
}
if (!$cms) {
@@ -109,8 +113,8 @@ foreach ($cms as $cm) {
continue;
}
$resource = $resources[$cm->modname][$cm->instance];
$printsection = '';
if ($usesections) {
$printsection = '';
if ($cm->sectionnum !== $currentsection) {
if ($cm->sectionnum) {
$printsection = get_section_name($course, $cm->sectionnum);
@@ -120,8 +124,6 @@ foreach ($cms as $cm) {
}
$currentsection = $cm->sectionnum;
}
} else {
$printsection = '<span class="smallinfo">'.userdate($resource->timemodified)."</span>";
}
$extra = empty($cm->extra) ? '' : $cm->extra;
@@ -131,11 +133,17 @@ foreach ($cms as $cm) {
$icon = '<img src="'.$OUTPUT->pix_url('icon', $cm->modname).'" class="activityicon" alt="'.get_string('modulename', $cm->modname).'" /> ';
}
if (isset($resource->intro) && isset($resource->introformat)) {
$intro = format_module_intro('resource', $resource, $cm->id);
} else {
$intro = '';
}
$class = $cm->visible ? '' : 'class="dimmed"'; // hidden modules are dimmed
$table->data[] = array (
$printsection,
"<a $class $extra href=\"$CFG->wwwroot/mod/$cm->modname/view.php?id=$cm->id\">".$icon.format_string($resource->name)."</a>",
format_module_intro('resource', $resource, $cm->id));
$intro);
}
echo html_writer::table($table);
+2 -2
View File
@@ -433,7 +433,7 @@ class behat_course extends behat_base {
}
/**
* Moves the specified activity to the first slot of a section. Editing mode should be on.
* Moves the specified activity to the first slot of a section. This step is experimental when using it in Javascript tests. Editing mode should be on.
*
* @Given /^I move "(?P<activity_name_string>(?:[^"]|\\")*)" activity to section "(?P<section_number>\d+)"$/
* @param string $activityname The activity name
@@ -528,7 +528,7 @@ class behat_course extends behat_base {
}
/**
* Deletes the activity or resource specified by it's name. You should be in the course page with editing mode on.
* Deletes the activity or resource specified by it's name. This step is experimental when using it in Javascript tests. You should be in the course page with editing mode on.
*
* @Given /^I delete "(?P<activity_name_string>(?:[^"]|\\")*)" activity$/
* @param string $activityname
+4 -7
View File
@@ -4,10 +4,10 @@ Feature: Course activity controls works as expected
As a teacher
I need to edit, hide, show and indent activities inside course sections
# This two scenario outlines contains exactly the same steps, the
# only difference is whether JS is enabled or not; we can not use
# Background sections when using Scenario Outlines because of Behat
# framework restrictions.
# The difference between these two scenario outlines is that one is with
# JS enabled and the other one with JS disabled, also with JS disabled we
# add the delete activity checking; we can not use Background sections
# when using Scenario Outlines because of Behat framework restrictions.
# We are testing:
# * Javascript on and off
@@ -61,9 +61,6 @@ Feature: Course activity controls works as expected
And "#section-2" "css_element" <should_see_other_sections> exists
And I click on "Hide" "link" in the "Test forum name 1" activity
And "#section-2" "css_element" <should_see_other_sections> exists
And I delete "Test forum name 1" activity
And "#section-2" "css_element" <should_see_other_sections> exists
And I should not see "Test forum name 1" in the ".region-content" "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> exists
@@ -27,25 +27,6 @@ Feature: Activities can be moved between sections
| Forum name | Test forum name |
| Description | Test forum description |
@javascript @_cross_browser
Scenario: Move activities in a single page course with Javascript enabled
When I move "Test forum name" activity to section "2"
And I reload the page
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"
@javascript @_cross_browser
Scenario: Move activities in the course home with Javascript enabled using paged mode
Given I follow "Edit settings"
And I fill the moodle form with:
| Course layout | Show one section per page |
And I press "Save changes"
When I move "Test forum name" activity to section "2"
# This reload step is added because of drap&drop & yui dd problem
And I reload the page
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"
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"
+10 -1
View File
@@ -671,7 +671,15 @@ class core_course_external_testcase extends externallib_advanced_testcase {
* Test update_courses
*/
public function test_update_courses() {
global $DB, $CFG, $USER;
global $DB, $CFG, $USER, $COURSE;
// Get current $COURSE to be able to restore it later (defaults to $SITE). We need this
// trick because we are both updating and getting (for testing) course information
// in the same request and core_course_external::update_courses()
// is overwriting $COURSE all over the time with OLD values, so later
// use of get_course() fetches those OLD values instead of the updated ones.
// See MDL-39723 for more info.
$origcourse = clone($COURSE);
$this->resetAfterTest(true);
@@ -724,6 +732,7 @@ class core_course_external_testcase extends externallib_advanced_testcase {
$courses = array($course1, $course2);
$updatedcoursewarnings = core_course_external::update_courses($courses);
$COURSE = $origcourse; // Restore $COURSE. Instead of using the OLD one set by the previous line.
// Check that right number of courses were created.
$this->assertEquals(0, count($updatedcoursewarnings['warnings']));
+16 -13
View File
@@ -122,7 +122,13 @@
$PAGE->set_pagelayout('course');
$PAGE->set_pagetype('course-view-' . $course->format);
$PAGE->set_other_editing_capability('moodle/course:update');
$PAGE->set_other_editing_capability('moodle/course:manageactivities');
$PAGE->set_other_editing_capability('moodle/course:activityvisibility');
if (course_format_uses_sections($course->format)) {
$PAGE->set_other_editing_capability('moodle/course:sectionvisibility');
$PAGE->set_other_editing_capability('moodle/course:movesections');
}
// Preload course format renderer before output starts.
// This is a little hacky but necessary since
@@ -189,20 +195,17 @@
}
}
if (has_capability('moodle/course:update', $context)) {
if (!empty($section)) {
if (!empty($move) and has_capability('moodle/course:movesections', $context) and confirm_sesskey()) {
$destsection = $section + $move;
if (move_section_to($course, $section, $destsection)) {
if ($course->id == SITEID) {
redirect($CFG->wwwroot . '/?redirect=0');
} else {
redirect(course_get_url($course));
}
} else {
echo $OUTPUT->notification('An error occurred while moving a section');
}
if (!empty($section) && !empty($move) &&
has_capability('moodle/course:movesections', $context) && confirm_sesskey()) {
$destsection = $section + $move;
if (move_section_to($course, $section, $destsection)) {
if ($course->id == SITEID) {
redirect($CFG->wwwroot . '/?redirect=0');
} else {
redirect(course_get_url($course));
}
} else {
echo $OUTPUT->notification('An error occurred while moving a section');
}
}
} else {
+4
View File
@@ -37,5 +37,9 @@ function xmldb_enrol_authorize_upgrade($oldversion) {
// Put any upgrade step following this
// Moodle v2.5.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+1
View File
@@ -213,6 +213,7 @@ function enrol_category_sync_course($course) {
$sql = "SELECT ra.userid, ra.estart
FROM (SELECT xra.userid, MIN(xra.timemodified) AS estart
FROM {role_assignments} xra
JOIN {user} xu ON (xu.id = xra.userid AND xu.deleted = 0)
WHERE xra.roleid $roleids AND xra.contextid $contextids
GROUP BY xra.userid
) ra
+3
View File
@@ -184,6 +184,7 @@ function enrol_cohort_sync(progress_trace $trace, $courseid = NULL) {
$sql = "SELECT cm.userid, e.id AS enrolid, ue.status
FROM {cohort_members} cm
JOIN {enrol} e ON (e.customint1 = cm.cohortid AND e.enrol = 'cohort' $onecourse)
JOIN {user} u ON (u.id = cm.userid AND u.deleted = 0)
LEFT JOIN {user_enrolments} ue ON (ue.enrolid = e.id AND ue.userid = cm.userid)
WHERE ue.id IS NULL OR ue.status = :suspended";
$params = array();
@@ -244,6 +245,7 @@ function enrol_cohort_sync(progress_trace $trace, $courseid = NULL) {
JOIN {enrol} e ON (e.id = ue.enrolid AND e.enrol = 'cohort' AND e.status = :statusenabled $onecourse)
JOIN {role} r ON (r.id = e.roleid)
JOIN {context} c ON (c.instanceid = e.courseid AND c.contextlevel = :coursecontext)
JOIN {user} u ON (u.id = ue.userid AND u.deleted = 0)
LEFT JOIN {role_assignments} ra ON (ra.contextid = c.id AND ra.userid = ue.userid AND ra.itemid = e.id AND ra.component = 'enrol_cohort' AND e.roleid = ra.roleid)
WHERE ue.status = :useractive AND ra.id IS NULL";
$params = array();
@@ -307,6 +309,7 @@ function enrol_cohort_sync(progress_trace $trace, $courseid = NULL) {
FROM {user_enrolments} ue
JOIN {enrol} e ON (e.id = ue.enrolid AND e.enrol = 'cohort' $onecourse)
JOIN {groups} g ON (g.courseid = e.courseid AND g.id = e.customint2)
JOIN {user} u ON (u.id = ue.userid AND u.deleted = 0)
LEFT JOIN {groups_members} gm ON (gm.groupid = g.id AND gm.userid = ue.userid)
WHERE gm.id IS NULL";
$params = array();
+4
View File
@@ -37,5 +37,9 @@ function xmldb_enrol_database_upgrade($oldversion) {
// Put any upgrade step following this
// Moodle v2.5.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+4
View File
@@ -38,5 +38,9 @@ function xmldb_enrol_flatfile_upgrade($oldversion) {
// Put any upgrade step following this
// Moodle v2.5.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+1 -1
View File
@@ -311,7 +311,7 @@ class enrol_flatfile_plugin extends enrol_plugin {
}
$roleid = $rolemap[$fields[1]];
if (!$user = $DB->get_record("user", array("idnumber"=>$fields[2]))) {
if (empty($fields[2]) or !$user = $DB->get_record("user", array("idnumber"=>$fields[2]))) {
$trace->output("Unknown user idnumber in field 3 - ignoring line $line", 1);
continue;
}
+3 -1
View File
@@ -88,6 +88,7 @@ class enrol_flatfile_testcase extends advanced_testcase {
$user4 = $this->getDataGenerator()->create_user(array('idnumber'=>'čtvrtý'));
$user5 = $this->getDataGenerator()->create_user(array('idnumber'=>'u5'));
$user6 = $this->getDataGenerator()->create_user(array('idnumber'=>'u6'));
$user7 = $this->getDataGenerator()->create_user(array('idnumber'=>''));
$course1 = $this->getDataGenerator()->create_course(array('idnumber'=>'c1'));
$course2 = $this->getDataGenerator()->create_course(array('idnumber'=>'c2'));
@@ -124,7 +125,8 @@ class enrol_flatfile_testcase extends advanced_testcase {
add,student,u5,c2,20,10
add,student,u6,c1,0,$future
add,student,u6,c2,$future,0
add,student,u6,c3,$future,$farfuture";
add,student,u6,c3,$future,$farfuture
add,student,,c2";
file_put_contents($file, $data);
$this->assertEquals(0, $DB->count_records('user_enrolments'));

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