Compare commits

...

945 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7) d43ba3caf6 Moodle release 2.3.6 2013-03-15 12:01:22 +01:00
Eloy Lafuente (stronk7) 099e1e00ee weekly release 2.3.5+ 2013-03-15 09:49:34 +01:00
Damyon Wiese 6e42741116 Merge branch 'MDL-38474-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2013-03-15 13:04:33 +08:00
Frederic Massart f75011fbad MDL-38474 repository: Undefined variable 2013-03-15 13:01:29 +08:00
Damyon Wiese 1f84f2e54a Merge branch 'MDL-38474-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2013-03-15 10:56:18 +08:00
Frederic Massart ccc803db33 MDL-38474 repository: Correct context when checking permissions to access a repository 2013-03-15 10:05:55 +08:00
Eloy Lafuente (stronk7) 0f52118a4a weekly release 2.3.5+ 2013-03-14 15:46:58 +01:00
Aparup Banerjee d5fc9f3d77 Merge branch 'MDL-38356-m23' of git://github.com/andrewnicols/moodle into MOODLE_23_STABLE 2013-03-14 11:05:43 +08:00
Aparup Banerjee 218e485ff5 Revert "Merge branch 'MDL-38356-m23' of git://github.com/andrewnicols/moodle into MOODLE_23_STABLE"
This reverts commit 771053bd83, reversing
changes made to c2fb582ef5.
2013-03-14 11:05:11 +08:00
Eloy Lafuente (stronk7) 38c5823efc Revert "Merge branch 'MDL-34818_M23' of git://github.com/lazydaisy/moodle into MOODLE_23_STABLE"
This reverts commit 4f558e2741, reversing
changes made to 97846ce94c.
2013-03-14 00:29:03 +01:00
Andrew Robert Nicols 10c6db96fb MDL-38356 JavaScript: Correct the test for currentform 2013-03-13 18:15:16 +00:00
Brent Boghosian d749cbc9a2 MDL-38356 Forms: Check that the form exists before applying changechecker
Signed-off-by: Andrew Robert Nicols <andrew.nicols@luns.net.uk>
2013-03-13 18:04:18 +00:00
Eloy Lafuente (stronk7) 51f55920b5 Merge branch 'MDL-38268-m23' of https://github.com/jfilip/moodle into MOODLE_23_STABLE 2013-03-13 01:14:59 +01:00
Eloy Lafuente (stronk7) a558b8415b Merge branch 'MDL-30166-m23' of git://github.com/ankitagarwal/moodle into MOODLE_23_STABLE 2013-03-13 01:09:59 +01:00
Eloy Lafuente (stronk7) cf6fdbd1b0 Merge branch 'wip-mdl-38332-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2013-03-12 22:58:12 +01:00
Damyon Wiese c6f2415757 Merge branch 'MDL-34011_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2013-03-12 16:05:42 +08:00
Aparup Banerjee df6266825b Merge branch 'MDL-35615_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2013-03-12 15:50:55 +08:00
Rossiani Wijaya b845942af5 MDL-34011 Lesson module - short answer question: fixed student attempt statistics 2013-03-12 15:04:04 +08:00
Damyon Wiese e7a7df3bf8 MDL-34011 Lesson module: fixed incorrect display of student attempt for short answer question 2013-03-12 15:03:58 +08:00
Aparup Banerjee 771053bd83 Merge branch 'MDL-38356-m23' of git://github.com/andrewnicols/moodle into MOODLE_23_STABLE 2013-03-12 13:38:10 +08:00
Aparup Banerjee c2fb582ef5 Merge branch 'MDL-35582_message_labels_23' of git://github.com/andyjdavis/moodle into MOODLE_23_STABLE 2013-03-12 13:28:34 +08:00
Damyon Wiese b3f8740157 Merge branch 'MDL-37771-M23' of git://github.com/lazydaisy/moodle into MOODLE_23_STABLE 2013-03-12 11:23:48 +08:00
Ankit Agarwal cbbdca1264 MDL-30166 Remove deprecated %fullname% from core
Thanks to Matheus Kautzmann for the initial patch.
2013-03-12 11:19:58 +08:00
Eloy Lafuente (stronk7) 761dfda279 Merge branch 'MDL-34774_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2013-03-12 00:55:19 +01:00
Eloy Lafuente (stronk7) 57b9d94e89 Merge branch 'MDL-38337_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-03-12 00:25:21 +01:00
Eloy Lafuente (stronk7) 4f558e2741 Merge branch 'MDL-34818_M23' of git://github.com/lazydaisy/moodle into MOODLE_23_STABLE 2013-03-12 00:22:33 +01:00
Damyon Wiese 97846ce94c Merge branch 'wip-MDL-34713-stable23' of git://github.com/phalacee/moodle into MOODLE_23_STABLE 2013-03-11 13:48:18 +08:00
Rajesh Taneja 8256fae97c MDL-38332 Users: Browse list of users should not contain guest user record 2013-03-11 10:30:08 +08:00
Mary Evans b1e17c1eb0 MDL-34818 theme_mymobile: Fixes resources folders to show properly on first access. 2013-03-11 00:21:05 +00:00
Mary Evans 6441b480f7 MDL-37771 themes: Fixed table header color in Question Bank window block.
modified: theme/anomaly/style/general.css
modified: theme/base/style/question.css
modified: theme/magazine/style/core.css
modified: theme/serenity/style/core.css
modified: theme/splash/style/blue.css
modified: theme/splash/style/green.css
modified: theme/splash/style/orange.css
modified: theme/splash/style/pagelayout.css
modified: theme/splash/style/red.css
2013-03-10 19:07:25 +00:00
Jean-Michel Vedrine 888b6ee53c MDL-33424 Images missing when restoring a 1.9 backup 2013-03-09 13:37:27 +01:00
Tim Hunt 4300a02765 MDL-38337 quiz: respect maximum grade config for new quizzes. 2013-03-08 21:33:12 +00:00
Eloy Lafuente (stronk7) 1bfc006d96 Moodle release 2.3.5 2013-03-08 20:01:23 +01:00
Jason Fowler 3ec12a2173 MDL-34713 - Blog - Fixing undefined index for blog menu block 2013-03-08 14:14:06 +08:00
Lalit Khattar 92e5cbc783 MDL-34724 Accessibility: At the bottom of Messaging settings page put the label of the checkboxes in <label> 2013-03-08 10:35:44 +08:00
Eloy Lafuente (stronk7) d461ecf772 MDL-38378 Take rid of harcoded db prefix and bump. 2013-03-08 00:20:28 +01:00
Eloy Lafuente (stronk7) 2ab86289de weekly release 2.3.4+ 2013-03-07 16:23:20 +01:00
Eloy Lafuente (stronk7) 48cafb2b24 Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2013-03-07 16:16:27 +01:00
Frederic Massart 173a201f90 MDL-37852 repository: Admins can't access user instances settings 2013-03-07 16:35:27 +08:00
Frederic Massart d5a3a92267 MDL-37852 repository: Prevent user from deleting a site-wide instance 2013-03-07 14:37:56 +08:00
Rossiani Wijaya 646059869e MDL-37411 Note Module: additional patch to fixed undefined property for stable branches 2013-03-07 11:09:17 +08:00
Damyon Wiese 38fd297dc7 Revert "MDL-38055 course: fixed print_overview use of title attribute"
This reverts commit 905ee48370.
This reverts commit 45dbcbec5f.

This issue has failed testing and will be delayed.
2013-03-07 10:28:30 +08:00
Brent Boghosian ab13a532be MDL-38356 Forms: Check that the form exists before applying changechecker
Signed-off-by: Andrew Robert Nicols <andrew.nicols@luns.net.uk>
2013-03-06 21:47:40 +00:00
Eloy Lafuente (stronk7) 71db4e58d7 MDL-38173 Swap conditions to make CI servers happy.
The alternatives were:

1) wrap the whole block within a "standard" upgrade step, indenting
   everything one more level.
2) Change (relax) the savepoints checker in the CI servers, not
   good in general.

So at the end, swapping conditions seemed to be the easier
and better alternative. After all, "&&" is commutative, lol.
2013-03-06 18:53:15 +01:00
Eloy Lafuente (stronk7) 5379574a7d Merge branch 'MDL-38173-23' of git://github.com/damyon/moodle into MOODLE_23_STABLE 2013-03-06 17:54:42 +01:00
Eloy Lafuente (stronk7) c5c1f07453 Merge branch 'MDL-38352-en_fix_23' of git://github.com/mudrd8mz/moodle into MOODLE_23_STABLE 2013-03-06 17:28:35 +01:00
Helen Foster 40d9932aa3 MDL-38352 Merge English strings from the en_fix language pack 2013-03-06 16:57:18 +01:00
Damyon Wiese a954624bc8 MDL-38173 Courselib: Make the distinct clause in the upgrade step more cross DB. 2013-03-06 23:04:04 +08:00
Damyon Wiese 6369652f17 MDL-38173 Courselib: Improvements to the upgrade step for this issue.
Set the upgrade step to only run for affected versions correctly (use a
range of affected versions) and make the query to find affected sections DISTINCT.
Also rename aliases and variables to use cm and cmid.
2013-03-06 21:07:20 +08:00
Damyon Wiese fcf890aa2b MDL-38173 Courselib: Improve the performance of the upgrade step by joining on course and only running for affected sites. 2013-03-06 20:41:01 +08:00
Damyon Wiese 2b0b5a203d MDL-38173 Course: Fix DB from regression when adding a (new) course module to a section.
Updated to remove performance fix from first upgrade step.
2013-03-06 20:41:01 +08:00
Russell Smith 14c2bada33 MDL-38173 Course: Use the correct module id's when adding to a section
When course completion is on, $mod->id is the instance, not the
course_module id.  In add_to_section $mod->coursemodule must be used.
2013-03-06 20:41:01 +08:00
Tim Hunt 8a7bc6c3d8 MDL-38311 question manual grading: comment fixes. 2013-03-06 10:37:38 +01:00
AMOS bot 47e93e02cf Automatically generated installer lang files 2013-03-06 00:36:58 +00:00
Eloy Lafuente (stronk7) ee7251689f Merge branch 'MDL-38311_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-03-06 01:24:22 +01:00
Rossiani Wijaya 1b628c489d MDL-37411 Notes: unset courseid and userid when updating the note to prevent accidental changes. Thank you Sam Hemelryk for suggesting an alternative solution.
Conflicts:
	notes/edit.php
2013-03-06 09:40:16 +13:00
Eloy Lafuente (stronk7) 9aa0a709cd Merge branch 'MDL-37642-m23' of git://github.com/sammarshallou/moodle into MOODLE_23_STABLE 2013-03-05 18:00:31 +01:00
Justin Filip d567c29dc9 MDL-38268 files: Must be explicit about switching cURL request method from HEAD to GET. 2013-03-05 11:22:20 -05:00
Eloy Lafuente (stronk7) 76cab144c8 Merge branch 'MDL-38119_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-03-05 16:46:05 +01:00
Tim Hunt 0d1fccaf15 MDL-38311 questions: manual grading API should accept commentformat
Comment format (FORMAT_...) was correctly being processed when the
manual grading happened as the result of a form submission. It was only
when done using the question_usage or question_attempt API method that
there was no way to specify the format. (Although I think the only place
this API as used was in the unit tests.)

Note that question_attempt::manual_grade API had to change, but I don't
think that is a real API change. Calling code should be using
question_usage::question_attempt, which is backwards compatible.

Note that now, if you don't pass format, then no error is generated, but
a developer debugging message is generated.
2013-03-05 11:57:42 +00:00
Aparup Banerjee b30fea4e05 Merge branch 'wip-MDL-34775-stable23' of git://github.com/phalacee/moodle into MOODLE_23_STABLE 2013-03-05 17:04:05 +08:00
Frederic Massart 4a8da21c62 MDL-37852 repository: Prevent undesired access to repositories settings 2013-03-05 09:56:15 +01:00
Damyon Wiese 18329cbf1e Merge branch 'MDL-38282_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-03-05 16:14:55 +08:00
Daniele Cordella 31946300e9 MDL-35615 Course section: fixed alignment for userdefaultname checkbox to be inline with section name text input 2013-03-05 16:12:02 +08:00
Damyon Wiese 0622ef3aa5 Merge branch 'MDL-38279_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-03-05 15:37:13 +08:00
Aparup Banerjee 792dab0f75 Merge branch 'MDL-30481_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2013-03-05 12:56:40 +08:00
Damyon Wiese db66ab7898 Merge branch 'wip-MDL-38055-m23' of git://github.com/samhemelryk/moodle into MOODLE_23_STABLE 2013-03-05 11:40:02 +08:00
Frederic Massart 55b330e6d8 MDL-34284 library: Import ZF2012-01 security patch for Zend 2013-03-05 10:32:36 +08:00
Sam Hemelryk c2cef5809e Merge branch 'wip-MDL-37901_M23' of git://github.com/gjb2048/moodle into MOODLE_23_STABLE 2013-03-05 15:23:09 +13:00
Eloy Lafuente (stronk7) c6014dccd9 Merge branch 'wip-MDL-36215-m23' of git://github.com/samhemelryk/moodle into MOODLE_23_STABLE 2013-03-05 01:28:15 +01:00
Sam Hemelryk 180e1b2fe9 Merge branch 'MDL-38101-m23' of git://github.com/sammarshallou/moodle into MOODLE_23_STABLE 2013-03-05 09:29:35 +13:00
Eloy Lafuente (stronk7) d47f3d499c Merge branch 'MDL-37522-published-attachment_23' of git://github.com/mudrd8mz/moodle into MOODLE_23_STABLE 2013-03-04 20:47:15 +01:00
Eloy Lafuente (stronk7) a366e1282a Merge branch 'wip-MDL-33013-m23' of git://github.com/samhemelryk/moodle into MOODLE_23_STABLE 2013-03-04 20:17:12 +01:00
Eloy Lafuente (stronk7) 48f3a2495b Merge branch 'MDL-36380-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2013-03-04 18:00:15 +01:00
Eloy Lafuente (stronk7) 328b5eab5c Merge branch 'wip-MDL-37983-23' of git://github.com/abgreeve/moodle into MOODLE_23_STABLE 2013-03-04 16:43:09 +01:00
Eloy Lafuente (stronk7) c3dd18842b Merge branch 'MDL-38170-m23' of git://github.com/sammarshallou/moodle into MOODLE_23_STABLE 2013-03-04 16:26:25 +01:00
Sam Hemelryk ac19bd186a Merge branch 'MDL-35350_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2013-03-04 16:12:43 +13:00
Sam Hemelryk fa5509b73c Merge branch 'MDL-35127-23' of git://github.com/damyon/moodle into MOODLE_23_STABLE 2013-03-04 16:07:51 +13:00
Frederic Massart ded4050f1b MDL-36426 repository: Prevent login_as() users to access 2013-03-04 02:38:29 +01:00
Sam Hemelryk c3a1ea1843 Merge branch 'MDL-37625-m23' of https://github.com/jfilip/moodle into MOODLE_23_STABLE 2013-03-04 14:18:19 +13:00
Sam Hemelryk 8e7afd6bf5 Merge branch 'MDL-36128-moodle23' of https://github.com/StudiUM/moodle into MOODLE_23_STABLE 2013-03-04 13:59:21 +13:00
Frederic Massart 0e94caf991 MDL-37681 repository_webdav: improved form handling when configuring an instance 2013-03-04 13:45:04 +13:00
Sam Hemelryk fb3f9c4a50 Merge branch 'MDL-38168-m23' of git://github.com/sammarshallou/moodle into MOODLE_23_STABLE 2013-03-04 13:34:47 +13:00
Frederic Massart ca2a7956b2 MDL-37507 repositories: improved formatting of external resources 2013-03-04 13:28:31 +13:00
Mark Nielsen 2c7cdbb3b0 MDL-36901: Remove system paths from exceptions
Replaces any server paths, like dataroot, with a token
in exception messages and debug info.

Conflicts:
	lib/tests/setuplib_test.php
2013-03-04 00:16:55 +01:00
Frederic Massart c7eea4e585 MDL-37481 user: fixed bug when logged in as guest 2013-03-04 11:18:05 +13:00
Sam Hemelryk 0897b1eab1 Merge branch 'MDL-32125-moodle23' of git://github.com/StudiUM/moodle into MOODLE_23_STABLE 2013-03-04 10:30:24 +13:00
Sam Hemelryk 905ee48370 MDL-38055 course: fixed print_overview use of title attribute 2013-03-04 09:48:45 +13:00
Andrew Davis 69313ec423 MDL-38149 core_grade: added a guard for when there are no old grades 2013-03-03 11:16:25 +08:00
Gareth J Barnard 92eeecdc07 MDL-37901 format_topics & format_weeks: Fix drag icon tooltip after move. 2013-03-02 13:05:12 +00:00
Tim Hunt 106269b393 MDL-39282 quiz: always allow removal of bogus questions. 2013-03-01 17:34:24 +00:00
Tim Hunt 02a88f802e MDL-38279 questions: must have default mark positive. 2013-03-01 15:22:21 +00:00
sam marshall e97baa19ca MDL-38170 SimplePie: Cannot read https feeds through proxy 2013-03-01 10:35:31 +00:00
AMOS bot cc9c8c3672 Automatically generated installer lang files 2013-03-01 00:42:20 +00:00
Sam Hemelryk 45dbcbec5f MDL-38055 navigation: fixed ampersand use within titles 2013-03-01 10:09:42 +13:00
Sam Hemelryk 459bb94a47 MDL-36215 navigation: fixed blog URL within courses using groups 2013-03-01 10:08:33 +13:00
Sam Hemelryk 240a2ee20c MDL-33013 navigation: fixed expansion limit issue hiding nodes 2013-03-01 10:08:10 +13:00
Jean-Philippe Gaudreau ac0cb8d956 MDL-36128 grade: Import outcomes error 2013-02-28 13:30:56 -05:00
Tim Hunt 3583718ce8 MDL-37847 / MDL-38119 question engine: document API change. 2013-02-28 18:26:55 +00:00
David Mudrák ce5940cc94 MDL-37522 Serve images from published submissions
If the user is allowed to see the published submission, she must be also
able to see images in it (both embedded into the text as well as
attached to the submission). See the logic in submission.php as a
reference.
2013-02-28 18:50:46 +01:00
Gilles-Philippe Leblanc d6c3051a52 MDL-32125 mod_forum: Updating subscription mode not reflecting subscribers 2013-02-28 11:57:15 -05:00
Eloy Lafuente (stronk7) 215c1897a4 weekly release 2.3.4+ 2013-02-28 15:49:56 +01:00
Eloy Lafuente (stronk7) 119d68fa19 Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2013-02-28 15:40:45 +01:00
Rossiani Wijaya 819cdd8041 MDL-34774 Lesson module: fixed report stats for 'high score' and 'low score' values where there is only one attempt with 0 score 2013-02-28 16:06:30 +08:00
Michael de Raadt ab882a67c6 MDL-34775 - Forum, RSS - Fixing RSS entries option to be disabled if RSS is not enabled 2013-02-28 15:50:58 +08:00
Michael de Raadt fce2121e19 MDL-35350 Advanced uploading assignment: add submission timestamp on assignment index page 2013-02-28 14:05:31 +08:00
Frederic Massart 9845d1bf52 MDL-36380 stats: Issue with DST and monthly statistics 2013-02-28 13:56:36 +08:00
Frederic Massart 52f9841809 MDL-36380 stats: No more duplicated entries when viewing monthly stats 2013-02-28 13:56:36 +08:00
Damyon Wiese 7215ff4efa MDL-35127 Assignment - declare the variables in the outer scope (for readability) 2013-02-27 10:09:33 +08:00
Damyon Wiese a6c54ab297 Merge branch 'MDL-35127_m23' of git://github.com/merrill-oakland/moodle into MDL-35127-23 2013-02-27 09:49:55 +08:00
Eric Merrill 7ef965ce50 MDL-35127 mod_assign More efficient use of expensive database queries
Moving two relatively expensive DB queries so they are only executed when needed
instead of on every function call. They will still only execute once, and not
repeatedly during execution of the loop.
2013-02-26 09:51:07 -05:00
Eloy Lafuente (stronk7) c4d0c8ada2 Merge branch 'wip_MDL-35641_m23_flowbackport' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2013-02-26 12:43:42 +01:00
Rossiani Wijaya 6fe4e3c02b MDL-30481 Advanced upload assignment: Fixed assignment available date string to appropriately identify past or future availability 2013-02-26 17:41:53 +08:00
Adrian Greeve f3f1f5d3d0 MDL-30669 - blocks: Added a warning when deleting blocks that have multiple displays set.
Also added a fix to the function course_page_type_list(). It was making a call to
get_context_info_array() which will generate an error if $currentcontext is not set.
2013-02-26 09:50:24 +01:00
Sam Hemelryk a515bc1b58 Merge branch 'wip-MDL-38144-MOODLE_23_STABLE' of git://github.com/marinaglancy/moodle into MOODLE_23_STABLE 2013-02-26 14:25:16 +13:00
Marina Glancy 7a3e11d5b5 MDL-38144 categories are created in reverse sort order in externallib 2013-02-26 11:30:45 +11:00
Damyon Wiese 65403fcf15 MDL-28692 Base theme - Version bump for css change 2013-02-25 13:56:45 +08:00
Damyon Wiese 24773be403 Merge branch 'MDL-28692_M23' of git://github.com/lazydaisy/moodle into MOODLE_23_STABLE 2013-02-25 13:36:31 +08:00
Dan Poltawski 7d37889b31 Merge branch 'wip-MDL-38091-MOODLE_23_STABLE' of git://github.com/marinaglancy/moodle into MOODLE_23_STABLE 2013-02-25 11:00:19 +08:00
Dan Poltawski 637611a7b3 Merge branch 'MDL-38061-23' of git://github.com/damyon/moodle into MOODLE_23_STABLE 2013-02-25 10:21:05 +08:00
Damyon Wiese b53e905618 Merge branch 'MDL-35175_23' of git://github.com/rlorenzo/moodle into MOODLE_23_STABLE 2013-02-25 09:53:46 +08:00
AMOS bot 85ee7e13ff Automatically generated installer lang files 2013-02-25 00:39:47 +00:00
Marina Glancy f1cd94b679 MDL-38091 fixed bug with SQL query on Oracle 2013-02-23 12:22:14 +11:00
sam marshall 29c7332585 MDL-38168 Filelib: Curl class does not honour proxybypass option 2013-02-22 14:24:07 +00:00
Damyon Wiese a09484cf77 weekly release 2.3.4+ 2013-02-22 10:58:57 +08:00
Damyon Wiese b2c16779d2 Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2013-02-22 10:50:07 +08:00
Damyon Wiese 9b8afa9b55 MDL-38061 Assignment - Use $CFG->showuseridentity to add extra fields to the assignment grading table/user summary.
Conflicts:

	mod/assign/gradingtable.php
	mod/assign/locallib.php
	mod/assign/renderable.php
	mod/assign/renderer.php
2013-02-22 10:29:59 +08:00
Sam Hemelryk 84cf3cce0b MDL-37224 backup-import: better handling of search button 2013-02-21 08:24:30 +13:00
sam marshall cb3a696c05 MDL-37642-m23 Course: Remove unnecessary performance warning on first view 2013-02-20 11:54:28 +00:00
Dan Poltawski e2e65d25f5 Revert "MDL-36380 stats: No more duplicated entries when viewing monthly stats"
This reverts commit e30af43f40.
2013-02-20 17:05:12 +08:00
Frederic Massart 3c509fdc04 MDL-35622 files: Fixed typo in galleryitem extension 2013-02-20 14:28:44 +08:00
AMOS bot 51b7049d70 Automatically generated installer lang files 2013-02-20 00:45:27 +00:00
Eloy Lafuente (stronk7) feb843633d MDL-37894 Amend tests with new openclose rule. 2013-02-20 01:37:30 +01:00
Eloy Lafuente (stronk7) 5d719ed8ec Merge branch 'wip-MDL-37224-m23' of git://github.com/samhemelryk/moodle into MOODLE_23_STABLE 2013-02-20 00:49:04 +01:00
Eloy Lafuente (stronk7) c5d3cf1da3 Merge branch 'wip-MDL-34298-m23' of git://github.com/samhemelryk/moodle into MOODLE_23_STABLE 2013-02-20 00:46:29 +01:00
Eloy Lafuente (stronk7) a5c0643a1d Merge branch 'MDL-37894_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-02-20 00:40:32 +01:00
Eloy Lafuente (stronk7) a6a1b51259 Merge branch 'MDL-37967_23' of git://github.com/jmvedrine/moodle into MOODLE_23_STABLE 2013-02-20 00:34:58 +01:00
Eloy Lafuente (stronk7) f8ecf7f7de Merge branch 'wip-MDL-38075-m23' of git://github.com/samhemelryk/moodle into MOODLE_23_STABLE 2013-02-20 00:08:03 +01:00
sam marshall 1716b4a54b MDL-38101 Completion: Error when teacher/admin marks activity complete 2013-02-19 16:58:38 +00:00
Eloy Lafuente (stronk7) 00f5a12de7 MDL-32620 whitespace + comment fixes. 2013-02-19 13:23:47 +01:00
Mark Nielsen fe8b7cd677 MDL-32620: Fixing up white space in comment 2013-02-19 13:23:40 +01:00
Chris Scribner 78f3381eb4 Fixing an issue with not sending the launch_presentation_return_url 2013-02-19 13:23:34 +01:00
Eloy Lafuente (stronk7) f5d26c95e8 Merge branch 'MDL-38033_dnd_uppercase_extn_23' of git://github.com/davosmith/moodle into MOODLE_23_STABLE 2013-02-19 12:24:41 +01:00
Dan Poltawski aa38d80df4 Merge branch 'w07_MDL-38059_m23_cachedir' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2013-02-19 14:07:33 +08:00
Sam Hemelryk c4a799ecde MDL-38000 css: fixed handling of CSS files by outputlib. 2013-02-19 13:48:26 +08:00
Dan Poltawski 5affcb30bc Merge branch 'MDL-38048-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2013-02-19 13:44:55 +08:00
Dan Poltawski e9328f579e Merge branch 'm23_MDL-37449_Reports_ORA-00918_column_ambiguously_defined' of https://github.com/scara/moodle into MOODLE_23_STABLE 2013-02-19 13:42:07 +08:00
Dan Poltawski cb7da8e091 Merge branch 'MDL-37749_M23' of git://github.com/lazydaisy/moodle into MOODLE_23_STABLE 2013-02-19 12:26:03 +08:00
Dan Poltawski eb6dcde62d Merge branch 'MDL-38051_23' of git://github.com/jmvedrine/moodle into MOODLE_23_STABLE 2013-02-19 11:23:56 +08:00
Dan Poltawski c3724a7002 Merge branch 'MDL-37934_23' of git://github.com/jmvedrine/moodle into MOODLE_23_STABLE 2013-02-19 10:56:47 +08:00
AMOS bot d5e9e15e54 Automatically generated installer lang files 2013-02-19 00:44:36 +00:00
Sam Hemelryk 768fdcb979 MDL-34298 course: fixed course search output validation issue 2013-02-19 11:04:13 +13:00
Sam Hemelryk 5c70a6ec3c MDL-37224 backup: fixed bug when searching for a course to import 2013-02-19 09:32:29 +13:00
Tim Hunt a2eeb58422 MDL-37894 Show the quiz close date even if the quiz is not open yet.
People care a lot about deadlines!
2013-02-18 10:29:11 +00:00
Dan Poltawski 15cc42fb9c Merge branch 'MDL-38039_M23' of git://github.com/lazydaisy/moodle into MOODLE_23_STABLE 2013-02-18 16:00:07 +08:00
Jean-Michel Vedrine c814b84573 MDL-37967 Improve XML question import format handling of duplicated files 2013-02-18 07:58:50 +01:00
Dan Poltawski 0ca9918428 Merge branch 'MDL-37396_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2013-02-18 14:27:51 +08:00
Dan Poltawski 9f4cd940b1 Merge branch 'MDL-36380-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2013-02-18 14:18:46 +08:00
Rossiani Wijaya 7e89587526 MDL-37396 Enrollmen: pass $perpage as optional_param and set default perpage variable in quickenrolment.js 2013-02-18 13:41:13 +08:00
Damyon Wiese bf78144a45 Merge branch 'MDL-37939-m23' of https://github.com/andrewnicols/moodle into MOODLE_23_STABLE
Conflicts:
	lib/db/upgrade.php
2013-02-18 13:31:40 +08:00
Dan Poltawski 45c8baafd0 Merge branch 'MDL-35336_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2013-02-18 12:24:23 +08:00
Frederic Massart e4594f737e MDL-35622 files: Add support for SMART Notebook MIME types
- The MIME type for Notebook files is: application/x-smarttech-notebook
- The MIME type for Gallery files is also: application/x-smarttech-notebook
Refs: http://exchange-forum.smarttech.com/forums/p/5152/11945.aspx#11945

Original author: Matteo Scaramuccia <moodle@matteoscaramuccia.com>
Fixed by: Paul Holden <pholden@greenhead.ac.uk>

Conflicts:

	lib/db/upgrade.php
	version.php
2013-02-18 11:35:31 +08:00
Dan Poltawski d623842807 Merge branch 'MDL-34800_ajax_submit_23' of git://github.com/andyjdavis/moodle into MOODLE_23_STABLE 2013-02-18 11:07:48 +08:00
Rossiani Wijaya 1989bb2ed8 MDL-37396 User Enrollment: fixed missing user from enrolment sub-menu 2013-02-18 10:25:01 +08:00
Rossiani Wijaya 9f2be81a8e MDL-35336 report (course overview): check the setting for enablestats before printing out the node for setting > site admin > reports 2013-02-18 10:23:26 +08:00
Rossiani Wijaya 39239e299b MDL-35336 Report (course overview): fixed redirect url to enable statistics setting page when statistics is disable 2013-02-18 10:23:26 +08:00
Mary Evans 8b6a3b4e11 MDL-28692 theme_base: Added background-color to admin settings form overridden in base/style/admin.css 2013-02-18 01:54:23 +00:00
Adrian Greeve 156b8e3c9d MDL-37983 - my home / navigation: $CFG->forcelogin is no longer affecting default home page redirects. 2013-02-18 08:55:56 +08:00
Sam Hemelryk fe0ce21840 MDL-38075 csslib: fixed coding error when working with an array of styles 2013-02-18 08:22:15 +13:00
Jean-Michel Vedrine f60f3b6c39 MDL-38051 Annihilate all the CRLFs present in some questions/fixtures... 2013-02-16 14:47:07 +01:00
Petr Škoda 0bf47bc403 MDL-38059 explain that cachedir must be shared in cluster 2013-02-16 14:46:19 +01:00
Matteo Scaramuccia 2ceaefb420 MDL-37449 Incorrect doubled 'u.email' field in the SQL query (Oracle error: ORA-00918) 2013-02-15 21:27:59 +01:00
Andrew Robert Nicols 0c9e550def MDL-37939 Course: Add unit test to ensure module moves are correct 2013-02-15 20:06:08 +00:00
Andrew Robert Nicols 31db9c51a2 MDL-37939 Course: Correct broken sequence data 2013-02-15 18:50:07 +00:00
Andrew Robert Nicols 4bcf7d3e74 MDL-37939 Course: Ensure that the cm->section is set when moving modules 2013-02-15 18:50:07 +00:00
Frederic Massart e30af43f40 MDL-36380 stats: No more duplicated entries when viewing monthly stats 2013-02-15 15:03:21 +08:00
Frederic Massart e0f5cb19a3 MDL-38048 documentation: Typo in README file 2013-02-15 13:15:07 +08:00
Eloy Lafuente (stronk7) 41eb312243 MDL-38040 Clean core from CRLFs 2013-02-15 02:25:36 +01:00
Mary Evans 9cf21fc4e3 MDL-38039 theme_base: Corrected typo fickering to flickering in CSS comment which blocked IPCOP browser firewall in IE. 2013-02-15 01:13:03 +00:00
Rex Lorenzo 99a2923de2 MDL-35175 - Lesson shows no attempts if associated with a grouping 2013-02-14 15:22:43 -08:00
Davo Smith 7d7b959bd6 MDL-38033 dndupload - ignore case when comparing dropped file extensions with those supported by activity modules 2013-02-14 20:24:12 +00:00
Jean-Michel Vedrine a56ced75e7 MDL-37934 Blackboard_six question import fails in some cases
Import fails if the same image is used several times
in the same field of the same question.
2013-02-14 14:50:41 +01:00
Damyon Wiese bbcf8dab4f weekly release 2.3.4+ 2013-02-14 14:05:42 +08:00
Damyon Wiese 212fa54826 Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2013-02-14 14:04:18 +08:00
AMOS bot 5f68421b93 Automatically generated installer lang files 2013-02-14 00:49:58 +00:00
Mary Evans 856e1568d6 MDL-37749 theme_mymobile: Removed redundant JS and CSS code for Collapsed Topic contributed plugin. 2013-02-12 17:25:53 +00:00
Eloy Lafuente (stronk7) dafe3db606 MDL-37893 Take rid of old comment. 2013-02-12 10:04:48 +01:00
Eloy Lafuente (stronk7) 79cccda3a9 Merge branch 'MDL-37893-grouped-empty_23' of git://github.com/mudrd8mz/moodle into MOODLE_23_STABLE 2013-02-12 10:04:40 +01:00
Dan Poltawski fff248b163 Merge branch 'wip-mdl-37633-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2013-02-12 15:50:10 +08:00
Rajesh Taneja 37010cc708 MDL-37633 Forum: Allow fronpage user to have forum:allowforcesubscribe capability by default
Conflicts:

	mod/forum/db/upgrade.php
	mod/forum/version.php
2013-02-12 15:02:42 +08:00
Andrew Davis 46c9d980e5 MDL-34800 core_grade:switched from hiding the submit button to disabling it if ajax is enabled 2013-02-12 14:55:06 +08:00
Dan Poltawski 35f7e66ed7 Merge branch 'MDL-32076_unlimited2_23' of git://github.com/andyjdavis/moodle into MOODLE_23_STABLE 2013-02-12 14:42:43 +08:00
Dan Poltawski 0225b635c4 Merge branch 'MDL-37074-23' of git://github.com/damyon/moodle into MOODLE_23_STABLE 2013-02-12 13:40:04 +08:00
Dan Poltawski ac45271157 Merge branch 'MDL-37924_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-02-12 13:36:15 +08:00
Dan Poltawski a8bf41cec6 Merge branch 'MDL-37964_m23' of https://github.com/markn86/moodle into MOODLE_23_STABLE 2013-02-12 12:27:02 +08:00
Dan Poltawski 35f667d850 Merge branch 'wip-MDL-34798_M23-2' of git://github.com/gjb2048/moodle into MOODLE_23_STABLE 2013-02-12 10:34:23 +08:00
Dan Poltawski f81a08b491 Merge branch 'MDL-37952_23' of git://github.com/stronk7/moodle into MOODLE_23_STABLE 2013-02-12 09:46:28 +08:00
Eloy Lafuente (stronk7) bced529e0e Merge branch 'MDL-37943_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-02-12 01:21:12 +01:00
Eloy Lafuente (stronk7) 596881dbaf Merge branch 'MDL-37896_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-02-12 01:14:43 +01:00
David Mudrák 473b153982 MDL-37919 Let PHPUnit display the content of $a even if the error string is not found 2013-02-12 01:08:44 +01:00
Eloy Lafuente (stronk7) c27b257b14 Merge branch 'MDL-35037-23' of git://github.com/danpoltawski/moodle into MOODLE_23_STABLE 2013-02-12 01:00:16 +01:00
Frederic Massart a3ded4c023 MDL-37961 webservice: PARAM_BOOL with PARAM_DEFAULT accepts boolean default 2013-02-12 00:44:42 +01:00
Gareth J Barnard d26cc0a022 MDL_34798 format_topics and format_weeks: Adjust section names when moving up. 2013-02-11 13:56:54 +00:00
Petr Škoda 9ba2682e38 MDL-37964 very basic support for enrolments in data generator 2013-02-11 17:29:00 +08:00
Dan Poltawski 731ff94a87 Merge branch 'MDL-37039-23' of git://github.com/damyon/moodle into MOODLE_23_STABLE 2013-02-11 14:33:36 +08:00
Dan Poltawski ffad867dd0 Merge branch 'MDL-37797_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2013-02-11 13:58:56 +08:00
David Mudrák ed1f5a1f25 MDL-37774 Do not pass trailing slash if the method does not want it 2013-02-10 08:59:27 +01:00
David Mudrák e2f455b8ca MDL-37774 Make moodle1_file_manager::migrate_directory() support trailing slash in rootpath
As the $rootpath is concatenated with the $relpath, we would end with a
path like course_files//file.txt. Such a path is detected as not-valid
later and an error would be thrown.

So the patch makes sure that the trailing slash is cut off.
2013-02-10 08:59:19 +01:00
David Mudrák 68c1945a8e MDL-37774 Add unit test to illustrate the problem with the trailing slash
The patch introduces two new tests for moodle1_file_manager::migrate_directory().
The second test with the trailing slash reveals the trouble here.
The expected behaviour is that the method would deal with the trailing
slash. Debugging message for the developer should be displayed though.
2013-02-10 01:54:41 +01:00
AMOS bot a0b9816e8b Automatically generated installer lang files 2013-02-10 00:41:41 +00:00
Eloy Lafuente (stronk7) 1a3487fc6e MDL-37952 make helper descendants abstract 2013-02-09 16:19:15 +01:00
Tim Hunt e429c2c386 MDL-37924 quiz settings: change wrong 'fix' => 'adv'. 2013-02-08 12:50:23 +00:00
Tim Hunt 772979e593 MDL-37896 qtype_essay: correct PARAM_CLEANHTML -> PARAM_RAW.
It turns out that you should almost never use PARAM_CLEANHTML.
2013-02-08 12:50:05 +00:00
Tim Hunt abbda1f869 MDL-37943 upgrade: logic error in upgrade_plugins_blocks.
Derek Woolhead tracked down the problem and what needed to be fixed. I
just made the patch.

The problem was that if $plugin->cron had changed in version.php, then
the version number in the database could end up wrong after the upgrade,
and so the upgrade would immediately run a second time.
2013-02-08 12:44:03 +00:00
Damyon Wiese e09f33df1b MDL-37039 Assignment - Do not apply filters to grading table for offline assignments
Because the filters do not make sense for offline assignments, they are hidden. But if the active filter
prevents you from seeing any assignments you cannot change it. This change makes it so the filters are
also not applied when the assignment is an offline assignment.
2013-02-08 15:49:17 +08:00
Damyon Wiese 80dbc147de MDL-37074 Assign theming: Use addClass/removeClass instead of setAttribute to preserve existing classes 2013-02-08 15:20:34 +08:00
Damyon Wiese c1921325d4 weekly release 2.3.4+ 2013-02-08 11:22:42 +08:00
Damyon Wiese 6337a60521 Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2013-02-08 10:59:37 +08:00
Eloy Lafuente (stronk7) fa3ca744ea MDL-37893 Always notify pending starts before dispatching chunk 2013-02-08 01:49:21 +01:00
David Mudrák 2bbe8443cc MDL-37893 Allow elements with no final tags to form a grouped path 2013-02-08 01:49:21 +01:00
David Mudrák d446475d67 MDL-37893 Add unit test to demonstrate the issue 2013-02-08 01:49:20 +01:00
AMOS bot 1924628001 Automatically generated installer lang files 2013-02-08 00:45:18 +00:00
Dan Poltawski 0dcf51a8b3 MDL-35037 tags: dont display blog entries when blogging disabled 2013-02-07 12:36:24 +08:00
Andrew Robert Nicols 72ffbbad46 MDL-37566 AJAX Fix issues with minimum height and centring
Conflicts:
	lib/yui/chooserdialogue/chooserdialogue.js
2013-02-07 01:12:22 +01:00
Andrew Davis cd536c6be5 MDL-32076 core_grade: fixed handling of unlimited grades 2013-02-06 15:57:48 +08:00
Rajesh Taneja 377d577f2d MDL-30144 Assignmnet 2.2: fixed context retrival 2013-02-06 13:22:27 +08:00
Eloy Lafuente (stronk7) 9cb6ecd9aa Merge branch 'MDL-37854_m23' of https://github.com/markn86/moodle into MOODLE_23_STABLE 2013-02-05 11:24:11 +01:00
Mark Nelson 9efe2ca244 MDL-37854 phpunit: replaced occurrence of non-existent function assertFail 2013-02-05 18:04:29 +08:00
David Mudrák c90c4f7775 MDL-37870 Fix the number of parameters when calling the parent constructor 2013-02-05 10:20:04 +01:00
Howard Miller 3c21fdc9ce MDL-37797 HTML block: add contextid to block_positions query and make it more unique. 2013-02-05 16:24:26 +08:00
Damyon Wiese 0da3d58ebd MDL-36206 Unit tests - Cleanup whitespace issues from previous patch 2013-02-05 14:14:25 +08:00
Jason Fowler afe9c36843 MDL-36206 - Unit Test - Create unit test for pagination bar 2013-02-05 14:14:19 +08:00
Dan Poltawski e04ddf75cb Merge branch 'MDL-37800_23' of git://github.com/grabs/moodle into MOODLE_23_STABLE 2013-02-05 12:43:24 +08:00
Dan Poltawski 9aa9fbd0d0 MDL-37357 - fix trailing whitespace 2013-02-05 09:58:51 +08:00
Dan Poltawski d80a777866 Merge branch 'MDL-37357_hidden_rank_23' of git://github.com/andyjdavis/moodle into MOODLE_23_STABLE 2013-02-05 09:58:41 +08:00
Dan Poltawski 8e8a6b78d0 MDL-37574 - Fix navigation tests: remove title
We are no longer setting it, to improve accessibility
2013-02-05 08:38:50 +08:00
Eloy Lafuente (stronk7) d86b640958 Merge branch 'MDL-37566-m23' of git://github.com/andrewnicols/moodle into MOODLE_23_STABLE 2013-02-05 01:14:27 +01:00
Davo Smith 4b74b9d617 MDL-37801 mod_glossary - encode / decode links to 'showentry' pages during backup & restore 2013-02-05 01:03:44 +01:00
Eloy Lafuente (stronk7) dc5957d568 Merge branch 'MDL-37775_M23' of git://github.com/lazydaisy/moodle into MOODLE_23_STABLE 2013-02-05 00:57:40 +01:00
Eloy Lafuente (stronk7) da46d05239 Merge branch 'MDL-37785_M23' of git://github.com/lazydaisy/moodle into MOODLE_23_STABLE 2013-02-05 00:36:24 +01:00
Eloy Lafuente (stronk7) 93f09e3ba8 Merge branch 'MDL-37523_M23' of git://github.com/lazydaisy/moodle into MOODLE_23_STABLE 2013-02-05 00:28:41 +01:00
Eloy Lafuente (stronk7) 34c5ea24f3 Merge branch 'MDL-37847_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-02-04 22:56:24 +01:00
Tim Hunt 53291c7256 MDL-37847 plain text essays were screwing up HTML special chars.
This was incorrect use of PARAM_CLEANHTML for these inputs.

This fix also adds some unit tests to try to verify that this does not
break again in future.
2013-02-04 13:08:26 +00:00
Mary Evans fe24496193 MDL-37523 theme_mymobile: Removed a renderer from mymobile/renderers.php and added it to theme/mymobile/renderers/mod_choice_renderer.php. Then added a conditional statement to theme/mymobile/renderers.php in order to call mymobile/renderers/mod_choice_renderer.php. 2013-02-04 11:40:29 +00:00
Damyon Wiese e20455a5ae Merge branch 'MDL-37781-workshop-schedule_23' of git://github.com/mudrd8mz/moodle into MOODLE_23_STABLE 2013-02-04 16:19:51 +08:00
Dan Poltawski 7c67ab3c14 Merge branch 'MDL-37574-m23' of git://github.com/andrewnicols/moodle into MOODLE_23_STABLE 2013-02-04 16:14:22 +08:00
Dan Poltawski 32a579e30b Revert "MDL-32076 core_grade: fixed ajax handling of unlimited grades and added some unit tests"
This reverts commit f5eaec8646.
2013-02-04 15:13:00 +08:00
Dan Poltawski b4f52cf9af Merge branch 'MDL-32076_unlimited2_23' of git://github.com/andyjdavis/moodle into MOODLE_23_STABLE 2013-02-04 14:31:01 +08:00
Michael Hughes ac3fe66f06 MDL-30144 Assignment 2.2: Download all as zip should only contain submission from active enroled users 2013-02-04 13:55:38 +08:00
Dan Poltawski 1a5f2cf058 Merge branch 'MDL-37646-23' of git://github.com/damyon/moodle into MOODLE_23_STABLE 2013-02-04 13:49:42 +08:00
Dan Poltawski 6f4c3571b8 Merge branch 'MDL-37635-23' of git://github.com/damyon/moodle into MOODLE_23_STABLE 2013-02-04 11:57:25 +08:00
Dan Poltawski 567fdbfa33 Merge branch 'MDL-37746_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-02-04 10:17:56 +08:00
Dan Poltawski 1a305ff1b9 Merge branch 'MDL-25853-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2013-02-04 10:14:07 +08:00
Andrew Robert Nicols 8e3b8a617d MDL-37574 Remove default link title from navigation items 2013-02-01 11:35:00 +00:00
Andrew Robert Nicols ce8cde8b45 MDL-37566 AJAX Only set max-height for chooser dialogues
If we set height as well as max-height then there is a potential for
whitespace to be shown at the bottom of the list of choices.

This commit stops removing the height option so that we only rely upon
max-height for dialogue heigh calculation.
2013-02-01 11:26:43 +00:00
Andreas Grabs c962e3f112 MDL-37800 mod_feedback - item "information" does not appear correctly 2013-02-01 11:40:11 +01:00
Damyon Wiese 7d054079c5 MDL-37635 Assign: Prevent errors when viewing a feedback when there is no grade_item in the gradebook 2013-02-01 13:44:46 +08:00
Andrew Davis 4e6cffa180 MDL-37357 core_grade: fixed the showing and hiding of rank on the overview report 2013-02-01 10:54:47 +08:00
Andrew Davis f5eaec8646 MDL-32076 core_grade: fixed ajax handling of unlimited grades and added some unit tests 2013-02-01 08:52:30 +08:00
Tim Hunt 24ed210069 MDL-37746 qtype_shortanser: avoid normalizer_normalize dangers.
When an error occurs, normalizer_normalize just silently returns null,
which is dangerous. Here, we wrap it in a safe helper function.
2013-01-31 11:33:02 +00:00
David Mudrák 5e5dfabd4a MDL-37781 Allocate workshop submissions without waiting for cron
Now we are checking for the need to execute the allocator every time the
main view.php is displayed to any user. Previously this was done by cron
only.
2013-01-31 11:35:07 +01:00
David Mudrák 4ab0bf0f31 MDL-37781 Check for switching the workshop phase without waiting for cron
Now we are checking for the need to switch the phase when the main
view.php is displayed to any user (previously this was done via cron
only). To give our subplugins (such as the scheduled allocation method)
a chance to do what they need to do, the workshop_viewed event is
triggered before the phase is actually switched.
2013-01-31 11:33:45 +01:00
Eloy Lafuente (stronk7) 5e3412d94d weekly release 2.3.4+ 2013-01-31 11:04:15 +01:00
Mary Evans 31235aa431 MDL-37775 theme_canvas: Changed ADD a block from center align to left in style/blocks.css 2013-01-31 08:28:41 +00:00
Dan Poltawski e17b0a6a8c Merge branch 'm23_MDL-34231' of git://github.com/danmarsden/moodle into MOODLE_23_STABLE 2013-01-31 10:15:00 +08:00
Mary Evans 533064b86a MDL-37785 theme_base: remove duplicate .dir-rtl file-picker css rules from styke/core.css 2013-01-31 01:22:27 +00:00
Dan Marsden 8bdac11f11 MDL-34231 SCORM: use correct calculation of attemptsleft 2013-01-31 11:12:43 +13:00
Sam Hemelryk 07f3c79dd4 Merge branch 'MDL-13805_others_messages_23' of git://github.com/andyjdavis/moodle into MOODLE_23_STABLE 2013-01-31 08:45:32 +13:00
Andrew Davis db30e0b00a MDL-13805 core_message: fixed some problems caused by a hasty backport 2013-01-30 18:34:02 +08:00
Frederic Massart 8a2c41aa28 MDL-25853 calendar: Fixed broken previous/next links 2013-01-30 09:02:51 +08:00
Eloy Lafuente (stronk7) 2cc9648555 Merge branch 'w04_MDL-37734_m23_marshack' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2013-01-30 01:23:44 +01:00
Petr Škoda 06ffb6544b MDL-37767 allow empty host in enrol_database which is required for default pg socket 2013-01-30 00:57:26 +01:00
Eloy Lafuente (stronk7) 6e607d44c0 Merge branch 'MDL-37533-23' of git://github.com/damyon/moodle into MOODLE_23_STABLE 2013-01-29 15:35:20 +01:00
Petr Škoda 9834ef146e MDL-37734 add one more recordset isolation test 2013-01-29 10:19:58 +01:00
Petr Škoda 1d65791467 MDL-37734 use prefetching workaround for MARS transaction problems 2013-01-29 10:19:51 +01:00
Rajesh Taneja aebbfda077 MDL-34190 Course: Role with student archtype should be selected as default in user list 2013-01-29 16:54:17 +08:00
ppichet b05659dde4 MDL-29691 Improve numerical format in multianswer
Allow the use of , as decsep in multianswer numerical subquestions
2013-01-29 16:30:36 +08:00
Damyon Wiese 86cc12d5f3 MDL-37646 Assign: Quickgrading fix when using grading filters or lots of students. 2013-01-29 14:43:34 +08:00
Dan Poltawski 87db6e272e Merge branch 'MDL-37694_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-01-29 11:54:51 +08:00
Sam Hemelryk 7b86ac4bbc Merge branch 'MDL-37476-stable23' of git://github.com/mouneyrac/moodle into MOODLE_23_STABLE 2013-01-29 15:23:35 +13:00
Dan Marsden 9e9b69fff9 MDL-37696 SCORM css: don't include style.css multiple times 2013-01-29 10:34:40 +13:00
Sam Hemelryk 09a8ba4aa6 Merge branch 'MDL-37697-m23' of git://github.com/andrewnicols/moodle into MOODLE_23_STABLE 2013-01-29 09:02:32 +13:00
Sam Hemelryk c5b346dc13 Merge branch 'MDL-37350-m23' of git://github.com/andrewnicols/moodle into MOODLE_23_STABLE 2013-01-29 08:54:42 +13:00
Sam Hemelryk 3134895c01 Merge branch 'MDL-36881-m23' of git://github.com/andrewnicols/moodle into MOODLE_23_STABLE 2013-01-29 08:51:20 +13:00
Sam Hemelryk 8108e113b3 Merge branch 'MDL-34671-m23' of git://github.com/andrewnicols/moodle into MOODLE_23_STABLE 2013-01-29 08:39:08 +13:00
Sam Hemelryk 04093db18a Merge branch 'MDL-37668-m23' of git://github.com/sammarshallou/moodle into MOODLE_23_STABLE 2013-01-29 08:33:01 +13:00
Sam Hemelryk adf01e854b Merge branch 'm23_MDL-34321' of git://github.com/danmarsden/moodle into MOODLE_23_STABLE 2013-01-29 08:27:23 +13:00
sam marshall 9fb8d1f275 MDL-37668 Accessibility: Help popup should be easy to close using keyboard 2013-01-28 10:57:42 +00:00
Andrew Robert Nicols 7efab51a7e MDL-34671 Stop browser receiving escape keydown in modal dialogues
In certain modal dialogues, we listen on the Escape key to close a
dialogue. However, this is still passed to the browser. As a result, if the
browser is in full screen mode and that browser respects the escape key as
a means to exit full screen.

As a result, we need to ensure that we listen for the escape key at keydown
rather than keyup, and additionally prevent the default browser behaviour.

This is a workaround to http://yuilibrary.com/projects/yui3/ticket/2532616
and, should that issue be fixed, it should be removed.
2013-01-28 10:49:42 +00:00
Sam Chaffee b19ecdb38d MDL-36881 Handle poorly behaved modname_get_types functions better
The modname_get_types function is not always well implemented by
third-party plugins and some return poor data. This in turn leads to
incorrect module definitions, and can lead to problems in both the
'Add an activity...' dropdowns and the Activity chooser.

This will also prevent display of plugins which legitimately can have
subtypes but where no subtypes were found. Since such plugins cannot be
used in this fashion in any case, this is also beneficial.

Signed-off-by: Andrew Robert Nicols <andrew.nicols@lancaster.ac.uk>
2013-01-28 10:23:08 +00:00
Andrew Robert Nicols f9681cffa4 MDL-37350 Detach listeners when hiding the 'Add roles' popup
If the submit event listener is not correctly closed, then the submit event
calls the relevant callback multiple times incorrectly.

When hiding the Add role dialogue, we need to detach any event listeners
which are applied to it.
2013-01-28 09:59:01 +00:00
Andrew Robert Nicols f4b106ee59 MDL-37697 Use the user selected editor format for new course forums 2013-01-28 09:56:22 +00:00
Dan Marsden 9de3aac748 MDL-34231 SCORM: Lock after final attempt when using skip content structure or direct navigation to player.php 2013-01-28 21:21:18 +13:00
Sam Hemelryk ab9008ffb0 Merge branch 'w04_MDL-37713_m23_testdir' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2013-01-28 17:53:29 +13:00
Sam Hemelryk c01e5b0cd6 Merge branch 'MDL-37548-m23' of git://github.com/andrewnicols/moodle into MOODLE_23_STABLE 2013-01-28 17:45:50 +13:00
Sam Hemelryk b0610c8bca Merge branch 'wip-MDL-29723_M23' of git://github.com/lazydaisy/moodle into MOODLE_23_STABLE 2013-01-28 17:34:40 +13:00
Sam Hemelryk c2e15c4619 Merge branch 'MDL-37172_23' of git://github.com/jmvedrine/moodle into MOODLE_23_STABLE
Conflicts:
	question/format/learnwise/format.php
2013-01-28 17:28:54 +13:00
Sam Hemelryk d6fdc727ea Merge branch 'MDL-13805_others_messages_23' of git://github.com/andyjdavis/moodle into MOODLE_23_STABLE 2013-01-28 16:06:49 +13:00
Andrew Davis eae7b4d189 MDL-13805 core_message: fixed the admin's ability to read another users messages 2013-01-28 10:33:28 +08:00
Sam Hemelryk ac9b9f152c Merge branch 'MDL-37634_23' of git://github.com/dmonllao/moodle into MOODLE_23_STABLE 2013-01-28 13:44:45 +13:00
Sam Hemelryk 7ec3fd667a Merge branch 'MDL-37628-23' of git://github.com/grabs/moodle into MOODLE_23_STABLE 2013-01-28 13:41:44 +13:00
Sam Hemelryk a83ce21dfb Merge branch 'MDL-37629-23' of git://github.com/damyon/moodle into MOODLE_23_STABLE 2013-01-28 12:02:35 +13:00
Sam Hemelryk b5fe549a3c Merge branch 'MDL-19069_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2013-01-28 11:32:32 +13:00
Petr Škoda 1892098bf0 MDL-37713 let phpunit bootstrap create test dataroot if necessary 2013-01-26 15:00:31 +01:00
Andreas Grabs 7fdb36f523 MDL-37628 feedback - Coding error in Recent Activity 2013-01-26 11:23:30 +01:00
Jean-Michel Vedrine 0acd374832 MDL-37172 Hardcoded strings in some question imports formats
AMOS BEGIN
CPY [unknownorunhandledtype,qformat_blackboard_six],[unknownorunhandledtype,question]
AMOS END
2013-01-25 23:10:00 +01:00
Tim Hunt 1ec9eeadae MDL-37694 move quiz unit tests to the right place.
Follow-on from MDL-37684.
2013-01-25 12:16:42 +00:00
Dan Poltawski 913084399a MDL-37684 - phpunit add missing definitions to phpunit.xml.dist 2013-01-25 16:32:08 +08:00
Dan Poltawski b7e9856937 weekly release 2.3.4+ 2013-01-25 15:58:46 +08:00
Dan Poltawski 11c1663d71 Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2013-01-25 15:58:26 +08:00
Dan Poltawski 4b081e7037 Merge branch 'MDL-37473b-23' of git://github.com/srynot4sale/moodle into MOODLE_23_STABLE 2013-01-25 12:36:26 +08:00
Aaron Barnes d4d06686f7 MDL-37473 completion: Add missing cap checks to tracked users functions
Namely get_num_tracked_users and is_tracked_user()
2013-01-25 17:12:48 +13:00
Andrew Robert Nicols 0bbbabb550 MDL-37548 Show the incorrect value in a colour picker after validation 2013-01-24 10:11:59 +00:00
Stephen Bourget db2a65bfa9 MDL-37533 Assign: Fix grading filters to show only assignments needing grading
Conflicts:

	mod/assign/gradingtable.php
2013-01-24 11:16:29 +08:00
Damyon Wiese 45e9749984 MDL-37533 Assign: Use the constant for the submitted status in the query (and parameterize the query) 2013-01-24 11:16:03 +08:00
Stephen Bourget 5ac332392a MDL-37533 Assign: assign_print_overview does not correctly display assignments that need grading
Conflicts:

	mod/assign/lib.php
2013-01-24 11:15:55 +08:00
AMOS bot 16441ae878 Automatically generated installer lang files 2013-01-24 00:46:51 +00:00
Jerome Mouneyrac 30e2ad8b85 MDL-37476 course_create unit test fails if course completion is enabled 2013-01-23 14:15:00 +08:00
David Monllao 7ce10d15d6 MDL-37634 lesson: readquestion visibility to protected 2013-01-23 09:52:36 +08:00
Jean-Philippe Gaudreau eed5149f1f MDL-37629 assign: Fix from regression MDL-37244 2013-01-23 09:25:52 +08:00
Mary Evans 9044b7fadf MDL-29723 mod/quiz: Modified show/hide button in edit.php and added some extra CSS rules to styles.css to make Question bank block more compatible/adaptable with themes. 2013-01-23 01:05:24 +00:00
Damyon Wiese 5cf0388b84 MDL-37619 Assign - Fix regression assign_print_overview caused by MDL-37527 2013-01-23 08:42:02 +08:00
Sam Hemelryk 3ad0ab4e67 Merge branch 'MDL-34435-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE
Conflicts:
	version.php
2013-01-23 11:07:40 +13:00
Eloy Lafuente (stronk7) 24430c5aad Merge branch 'wip-MDL-15930-23' of git://github.com/abgreeve/moodle into MOODLE_23_STABLE 2013-01-22 20:40:56 +01:00
Justin Filip 57951b86df MDL-37625 auth_radius Updated to latest version (1.5.0) of included PEAR Crypt_CHAP library. 2013-01-22 10:41:20 -05:00
Aparup Banerjee e88dfd38bd Merge branch 'wip-mdl-37339-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2013-01-22 16:28:53 +08:00
Dan Poltawski 38f688108d Merge branch 'wip-mdl-32526-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2013-01-22 14:00:42 +08:00
Dan Poltawski 166cb23ea4 Merge branch 'MDL-27164-MOODLE_23_STABLE' of git://github.com/micaherne/moodle into MOODLE_23_STABLE 2013-01-22 12:52:08 +08:00
Dan Poltawski 6042f30d5f Merge branch 'MDL-37275_m23' of git://github.com/markn86/moodle into MOODLE_23_STABLE 2013-01-22 12:46:23 +08:00
Dan Poltawski 9e4c326caf Merge branch 'MDL-37375_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2013-01-22 12:44:07 +08:00
Dan Poltawski 49042e1c8c Merge branch 'MDL-37430-23' of github.com:damyon/moodle into MOODLE_23_STABLE 2013-01-22 11:53:57 +08:00
Dan Poltawski 0302aca4ec Merge branch 'MDL-35357_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2013-01-22 11:48:26 +08:00
Dan Poltawski 211fa38ca5 Merge branch 'MDL-37599_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-01-22 11:40:28 +08:00
Dan Poltawski e21f9dd982 Merge branch 'MDL-37473-23' of git://github.com/srynot4sale/moodle into MOODLE_23_STABLE 2013-01-22 11:14:42 +08:00
Aparup Banerjee 72455fca5a Merge branch 'MDL-37540-23' of git://github.com/damyon/moodle into MOODLE_23_STABLE 2013-01-22 11:00:05 +08:00
Aparup Banerjee c90b8f82a8 Merge branch 'MDL-37543-23' of git://github.com/damyon/moodle into MOODLE_23_STABLE 2013-01-22 10:56:54 +08:00
Dan Poltawski a932d0c4cc Merge branch 'MDL-37355-stable23' of git://github.com/mouneyrac/moodle into MOODLE_23_STABLE 2013-01-22 09:06:44 +08:00
Eloy Lafuente (stronk7) b210380b4e Merge branch 'MDL-36104_m23' of https://github.com/markn86/moodle into MOODLE_23_STABLE 2013-01-22 01:20:06 +01:00
Eloy Lafuente (stronk7) 19740fe4a6 Merge branch 'MDL-37539-23' of github.com:damyon/moodle into MOODLE_23_STABLE 2013-01-22 01:06:23 +01:00
Eloy Lafuente (stronk7) 4e3f4bd9be Merge branch 'MDL-28512_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-01-22 01:02:34 +01:00
Aaron Barnes c208efa04c MDL-37473 completion: Add missing cap checks to tracked users functions
Namely get_num_tracked_users and is_tracked_user()
2013-01-22 11:27:21 +13:00
Sam Hemelryk 8f3ae32b88 Merge branch 'MDL-37563-23' of git://github.com/damyon/moodle into MOODLE_23_STABLE 2013-01-22 09:10:23 +13:00
Eloy Lafuente (stronk7) 9d2f74684c Merge branch 'MDL-37577_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-01-21 20:01:56 +01:00
Eloy Lafuente (stronk7) ee7411c4b6 Merge branch 'MDL-35924_m23' of https://github.com/markn86/moodle into MOODLE_23_STABLE 2013-01-21 19:44:27 +01:00
Eloy Lafuente (stronk7) fd843c7f22 Merge branch 'MDL-34050_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2013-01-21 16:47:45 +01:00
Tim Hunt 5f9a56011e MDL-37577 quiz overdue handling: optimise database query
This is the standard trick of adding a redundant WHERE clause to a
subquery to help the database realise that it does not have to inspect
so many rows.
2013-01-21 13:24:01 +00:00
Tim Hunt fb5819b13c MDL-37599 question import: add missing string.
AMOS BEGIN
 MOV [matcherror,question],[invalidgrade,question]
AMOS END
2013-01-21 12:12:50 +00:00
Michael de Raadt 54a25a2f88 MDL-35357 Lesson Module: fixed undefined property for $answerformat 2013-01-21 15:42:52 +08:00
Aparup Banerjee d971df89b1 Merge branch 'w03_MDL-37559_m23_otherusers' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2013-01-21 15:26:51 +08:00
Rossiani Wijaya 93a91776f6 MDL-37375 Report: fixed blog post link from course activity report 2013-01-21 14:57:05 +08:00
Mark Nelson 55ab55ba5c MDL-36104 mod_assign: added hidden labels to the feedback input fields 2013-01-21 12:52:58 +08:00
Andrew Davis 65ac28683e MDL-37352 core_grade:fixed some ajax display issues
Conflicts:
	grade/report/grader/styles.css
2013-01-21 12:31:53 +08:00
Rossiani Wijaya 28497b53b3 MDL-19069 RSS feed block: Removed link for remote RSS feeds on navigation 2013-01-21 12:02:31 +08:00
Dan Poltawski 812ea3aae2 Merge branch 'wip-mdl-36674-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2013-01-21 10:15:31 +08:00
Dan Poltawski b0da482ae0 Merge branch 'MDL-35074_23_2' of git://github.com/pauln/moodle into MOODLE_23_STABLE 2013-01-21 10:09:07 +08:00
Dan Poltawski 176bb7570b Merge branch 'MDL-37527-23' of github.com:damyon/moodle into MOODLE_23_STABLE 2013-01-21 10:04:04 +08:00
Damyon Wiese 7a6d23ef25 MDL-37563 Assignment upgrade: Upgrade conditional activity settings.
Conflicts:

	mod/assign/upgradelib.php
2013-01-21 09:13:21 +08:00
Dan Poltawski 0d674390c3 Merge branch 'm23_MDL-36421' of git://github.com/danmarsden/moodle into MOODLE_23_STABLE 2013-01-21 09:01:26 +08:00
AMOS bot 7e1f3dda3b Automatically generated installer lang files 2013-01-21 00:44:55 +00:00
Sam Hemelryk a2400fcf71 Merge branch 'MDL-37295-m23' of git://github.com/ankitagarwal/moodle into MOODLE_23_STABLE 2013-01-21 10:18:10 +13:00
Sam Hemelryk cf7ace8a37 Merge branch 'MDL-35817_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2013-01-21 09:46:01 +13:00
Sam Hemelryk cfdc33bf08 Merge branch 'MDL-36757_hidden_23' of git://github.com/andyjdavis/moodle into MOODLE_23_STABLE 2013-01-21 09:31:12 +13:00
Petr Škoda bb92d9053c MDL-37559 fix display of multiple roles of other users
Credit goes to Tyron Delean, thanks.
2013-01-19 16:52:03 +01:00
Tim Hunt af8ce622b0 MDL-28512 qtype essay: clean up properly when a question is deleted. 2013-01-18 11:52:33 +00:00
Mark Nelson a12d510c35 MDL-35924 filemanager: added label for the input field when creating a new folder 2013-01-18 15:35:48 +08:00
Mark Nelson c56248f14b MDL-37275 webservices: ensure a webservice function is chosen before attempting to add to service 2013-01-18 15:33:46 +08:00
Dan Poltawski e61f96c55b weekly release 2.3.4+ 2013-01-18 14:32:02 +08:00
Dan Poltawski fa0218be0e Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2013-01-18 14:31:25 +08:00
Ankit Agarwal a518f7eff5 MDL-37295 forum: Parse old log entries during restore 2013-01-17 14:33:21 +08:00
Rajesh Taneja b61ab6193b MDL-35873 Blocks: Fixed roles icon 2013-01-17 14:04:16 +08:00
Dan Poltawski 92a3802c39 Merge branch 'wip-mdl-29534-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2013-01-17 13:48:42 +08:00
Rajesh Taneja 532da94d0e MDL-29534 Forum: Fixed userfrom reference problem 2013-01-17 13:49:11 +08:00
Rossiani Wijaya e99486c448 MDL-35817 login: convert html tag to use html_writer and change <a> tag id to be more specific to login 2013-01-17 13:06:58 +08:00
Rossiani Wijaya a59dc25d6d MDL-35817 Login: set page focus to error message for login error 2013-01-17 13:06:50 +08:00
Damyon Wiese 508f42e2f1 MDL-37539 Assignment upgrade: Disable submission comments if allow notes was not enabled.
For advanced upload of files only - this setting was stored in var2.

Conflicts:

	mod/assign/submission/comments/locallib.php
2013-01-17 12:17:38 +08:00
Damyon Wiese f20d185c87 MDL-37540 Assignment upgrade: Upgrade setting "Hide description before due date"
Advanced upload of files has this setting which is stored in var3.
2013-01-17 11:57:10 +08:00
Rajesh Taneja 4c4ade1ca9 MDL-35780 Administration: current user email should be always displayed on participants page 2013-01-17 11:57:07 +08:00
Andrew Davis f86473cebc MDL-36757 course: avoid accidently overwriting the hidden/visible values set on grade items 2013-01-17 11:37:09 +08:00
Damyon Wiese 5be632e8b6 MDL-37543 Assignment upgrade: convert advanced upload files "Send for marking" setting
Advanced upload files assignment type has "Enable send for marking" setting instead
of "Allow resubmissions". Needs special handling in upgrade code to convert to
"Require students click submit button".

Conflicts:

	mod/assign/submission/file/locallib.php
2013-01-17 11:29:58 +08:00
Dan Poltawski 5919718019 Merge branch 'MDL-37374_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-01-17 10:23:15 +08:00
Eloy Lafuente (stronk7) d10ca0e697 MDL-37555 Apply realpath() 2 CFG->phpunit_dataroot 2013-01-16 20:54:57 +01:00
Tim Hunt 0ad7caf4c3 MDL-31616 blocks: ensure showinsubcontexts is only 0 or 1 in the DB. 2013-01-16 19:15:44 +01:00
Tim Hunt 4ca741e456 MDL-37374 questions: fix property_exists calls. 2013-01-16 11:21:03 +00:00
Rajesh Taneja 2ed251d007 MDL-32526 Course: After creating course user should be redirected to newly created course
After creating a new course if user has capability to enrol users then
enrol user page should be visible else user should see newly created course
2013-01-16 16:30:02 +08:00
Rajesh Taneja 178d99677b MDL-35873 Blocks: Made alt-text on block control icons more descriptive
Conflicts:
	lib/blocklib.php
2013-01-16 18:28:33 +13:00
Damyon Wiese c5c330babc MDL-37527 Assignment - Change query for print_overview so it uses an index (postgres)
Reported by Mark Neilsen.

Conflicts:

	mod/assign/lib.php
2013-01-16 13:18:16 +08:00
Davo Smith 1d8066e2d0 MDL-31484 backup - repeated restores with anonymised users now works correctly 2013-01-16 11:45:57 +08:00
Dan Poltawski 50dcac01eb Merge branch 'MDL-36412-m23' of git://github.com/sammarshallou/moodle into MOODLE_23_STABLE 2013-01-16 09:57:01 +08:00
Rajesh Taneja b3f92c0ab7 MDL-37339 Administration: Unique custom profile should not be checked if it's empty.
Currently we have two options for custom profile fields 'Unique' and 'Required'
If value s not entered for unique and not required field then we should allow
duplicate empty values. If value is entered then we should check for unique input.
In case field is unique and required then it should be always checked as required
field can't be empty.
2013-01-16 09:47:07 +08:00
Dan Poltawski 1962821cf5 MDL-37313 question: fix trailing whitespace 2013-01-16 09:40:32 +08:00
Dan Poltawski cd0523a78e Merge branch 'MDL-37313_23' of git://github.com/jmvedrine/moodle into MOODLE_23_STABLE 2013-01-16 09:40:07 +08:00
AMOS bot 31f183fd73 Automatically generated installer lang files 2013-01-16 00:43:45 +00:00
Sam Hemelryk 9bc178f3e6 Merge branch 'wip-MDL-35818-stable23' of git://github.com/phalacee/moodle into MOODLE_23_STABLE 2013-01-16 11:03:09 +13:00
Eloy Lafuente (stronk7) 7cf0504ac6 Merge branch 'MDL-37173-m23' of git://github.com/andrewnicols/moodle into MOODLE_23_STABLE 2013-01-15 21:56:49 +01:00
Eloy Lafuente (stronk7) 5d112775e9 Merge branch 'MDL-37354-stable23' of git://github.com/mouneyrac/moodle into MOODLE_23_STABLE 2013-01-15 21:51:38 +01:00
Eloy Lafuente (stronk7) 5a3aaea503 Revert "MDL-33117 grade: adding unit tests for the user report function inject_rowspans()"
This reverts commit b65bd8b658.
2013-01-15 21:35:02 +01:00
Eloy Lafuente (stronk7) 34db04595e Revert "MDL-33117 Whitespace fixes"
This reverts commit 5696c69b3b.
2013-01-15 21:34:41 +01:00
Eloy Lafuente (stronk7) 5f2d7b3009 Merge branch 'MDL-31616_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-01-15 20:16:29 +01:00
Eloy Lafuente (stronk7) 09ebf8386a Merge branch 'wip-mdl-37062-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2013-01-15 20:06:26 +01:00
Eloy Lafuente (stronk7) d7b3cced54 NOBUG: 1 more whitespace, was hurting my eyes all the time. 2013-01-15 19:19:04 +01:00
Eloy Lafuente (stronk7) 5696c69b3b MDL-33117 Whitespace fixes 2013-01-15 19:11:48 +01:00
Eloy Lafuente (stronk7) 4090cd2b92 Merge branch 'MDL-34883_unit_tests_23' of git://github.com/andyjdavis/moodle into MOODLE_23_STABLE 2013-01-15 18:21:35 +01:00
Eloy Lafuente (stronk7) dc43bfe372 Merge branch 'MDL-37395-m23' of git://github.com/sammarshallou/moodle into MOODLE_23_STABLE 2013-01-15 18:17:33 +01:00
sam marshall f84e58d809 MDL-34612 Grade condition range validation allows impossible conditions 2013-01-15 12:48:30 +00:00
Ben Johnson e6b9308a23 MDL-36421 SCORM: fix SCORM course format new window popups 2013-01-15 23:18:22 +13:00
Dan Poltawski ded1043407 Merge branch 'MDL-37162_23' of git://github.com/pauln/moodle into MOODLE_23_STABLE 2013-01-15 13:34:02 +08:00
Dan Poltawski b175cf2c72 Merge branch 'MDL-37374_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-01-15 12:59:54 +08:00
Jason Fowler 0da02e0a20 MDL-30316 - Libraries - improving pagination output to allow a shifting start page for displays of less than 18 pages -- original code provided by Martha (martha dot morelos at gmail dot com) 2013-01-15 12:50:05 +08:00
Dan Poltawski 25ad1dea0e Merge branch 'MDL-29835_23' of git://github.com/pauln/moodle into MOODLE_23_STABLE 2013-01-15 12:42:09 +08:00
Dan Poltawski 58a52d66b0 Merge branch 'MDL-36616-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2013-01-15 11:48:30 +08:00
Rossiani Wijaya 091a0b7b00 MDL-34050 Lesson Module: Fixed spacing and removed array_unique() for responses 2013-01-15 11:22:05 +08:00
Damyon Wiese f017aa4bd5 MDL-37430 Course - Make modules created in hidden sections visible when section is made visible.
Conflicts:

	course/lib.php
2013-01-15 11:21:44 +08:00
Dan Poltawski 9376a1e59b Merge branch 'MDL-37413-m23' of git://github.com/andrewnicols/moodle into MOODLE_23_STABLE 2013-01-15 10:58:47 +08:00
Dan Poltawski a89c9384fa Merge branch 'MDL-37194-stable23' of git://github.com/mouneyrac/moodle into MOODLE_23_STABLE 2013-01-15 10:43:44 +08:00
Eloy Lafuente (stronk7) 8784a3b2a2 Merge branch 'MDL-37431_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-01-15 00:16:34 +01:00
Eloy Lafuente (stronk7) 1ed7c77347 Merge branch 'MDL-37485_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-01-14 23:22:03 +01:00
Sam Hemelryk e5f6a755e7 Merge branch 'MDL-37378_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-01-15 10:42:36 +13:00
Rajesh Taneja e48cbfc594 MDL-36674 Administration: out_as_local_url will check for both http and https url's
out_as_local_url will first check if url passed in wwwroot, if it's not then it will check
if loginhttps is enabled and url is httpswwwroot
2013-01-14 16:02:09 +08:00
Dan Poltawski a07dccc1c5 Merge branch 'wip-MDL-30797-23' of git://github.com/abgreeve/moodle into MOODLE_23_STABLE 2013-01-14 15:26:25 +08:00
Adrian Greeve e25a7aa27e MDL-30797 - backup groups: Added a parameter to the groups_assign_grouping function.
$timeadded has now been included so that the backup / restore functions can now use
this API rather than duplicating the code.
2013-01-14 15:15:19 +08:00
Adam Olley a2bbc96b3e MDL-30797 backup: Use correct API call for mapping groups to groupings on import/restore 2013-01-14 15:15:05 +08:00
Dan Poltawski 4012fc4994 Merge branch 'wip-mdl-29534-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2013-01-14 14:59:41 +08:00
Anthony Borrow b31f52340c MDL-15930 - admin: reorganize logic to allow ->fullnamedisplay to be used as default sort. 2013-01-14 10:39:05 +08:00
Jason Fowler 3c9148d6d1 MDL-35818 - Enrolment - Changing all enrolment method icon alt text attributes to include the name of the course 2013-01-14 09:47:21 +08:00
Sam Hemelryk 0aa5236143 Merge branch 'MDL-37048-m23' of git://github.com/ankitagarwal/moodle into MOODLE_23_STABLE 2013-01-14 14:08:02 +13:00
Davo Smith bdc678a409 MDL-35568 course dndupload - resources created with the same visibility as the section they are dragged onto 2013-01-14 13:55:55 +13:00
Sam Hemelryk 3434298385 Merge branch 'wip-MDL-35885-stable23' of git://github.com/phalacee/moodle into MOODLE_23_STABLE 2013-01-14 13:39:43 +13:00
Sam Hemelryk 7fa6857c3b Merge branch 'MDL-36095-m23' of git://github.com/sammarshallou/moodle into MOODLE_23_STABLE 2013-01-14 12:23:37 +13:00
Sam Hemelryk 39bad86b14 Merge branch 'MDL-36511-23' of git://github.com/srynot4sale/moodle into MOODLE_23_STABLE 2013-01-14 12:12:30 +13:00
Sam Hemelryk e824c58aa8 Merge branch 'wip-MDL-36335-23' of git://github.com/abgreeve/moodle into MOODLE_23_STABLE 2013-01-14 11:43:29 +13:00
Sam Hemelryk 096bb297f7 Merge branch 'MDL-37397-m23' of git://github.com/andrewnicols/moodle into MOODLE_23_STABLE 2013-01-14 11:04:28 +13:00
Sam Hemelryk 571c2784d6 Merge branch 'wip-mdl-35780-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2013-01-14 10:59:23 +13:00
Tim Hunt 6fc65ae5c3 MDL-31616 block editing: show in subcontexts does not work on category pages.
Thanks to Ian David Wild for pointing to the proper fix.
2013-01-11 22:01:04 +00:00
Eloy Lafuente (stronk7) 2713f92d62 Moodle release 2.3.4 2013-01-11 22:21:52 +01:00
Tim Hunt d7f4c9c3f5 MDL-37485 plugins overview: require_login before _capability. 2013-01-11 13:03:42 +00:00
Tim Hunt 3daceb9d5c MDL-37431 question preview: cron performance problem.
This query was performing badly. The solution seems to be to add a
redundant JOIN and WHERE to the subquery.

I renamed the table aliases in the subquery to avoid name collisions
elsewhere. I am afraid that makes the diff rather unhelpful. The
    AND subq_qu.component = :qubacomponent2
line is new. The other lines have just had subq_ added.
2013-01-11 13:03:28 +00:00
Tim Hunt df0c2e5fd3 MDL-37378 quiz restore: timecheckstate not in old backups.
We need to avoid a notice. If the value is missing, setting it to 0 is
fine. It will get sorted out the next time cron is run.
2013-01-11 13:03:10 +00:00
Tim Hunt 7d9ce8864a MDL-37374 questions: use property_exists rather than isset
$a->field = null; isset($a->field) returns false, which is typical PHP.
I also improve the error handling a bit.
2013-01-11 13:02:55 +00:00
Andrew Robert Nicols 86132c35ad MDL-37397 Test for a valid select in formautosubmit
Ideally we shouldn't get into this situation, but in cases where the
generated select element is incorrectly configured, we should try and
handle it gracefully with a warning.
2013-01-11 11:50:27 +00:00
Eloy Lafuente (stronk7) dbee98b2e6 weekly release 2.3.3+ 2013-01-11 12:33:07 +01:00
Michael Aherne 5a701d1fbe MDL-27164 groups Do not show multiple instances of the same role as multiple 2013-01-11 11:17:11 +00:00
Eloy Lafuente (stronk7) 039cd4a52a Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2013-01-11 12:16:51 +01:00
Eloy Lafuente (stronk7) 0eda863c21 MDL-37420 rework pg schema (partial backport take2) 2013-01-11 11:36:48 +01:00
Eloy Lafuente (stronk7) fa02465c54 MDL-37420 rework pg schema (partial backport of 92b00c3) 2013-01-11 10:34:19 +01:00
Jean-Michel Vedrine 517f7729ca MDL-37313 Sample files with images for XML import 2013-01-11 09:44:56 +01:00
Jean-Michel Vedrine eed2721b71 MDL-37313 Moodle XML import format should use draft file areas, not arrays 2013-01-11 09:44:55 +01:00
Andrew Robert Nicols 0a7c94b3d1 MDL-37413 Use correct variable in chooserdialogue 2013-01-11 08:20:14 +00:00
Ashley Holman a34209d566 MDL-36616 repository: Fix direct linking to images in Flickr Public. 2013-01-11 15:33:37 +08:00
Jason Fowler 6df2ead050 MDL-35885 - Wiki - add a legend element to the search wikis form 2013-01-11 15:30:13 +08:00
Rossiani Wijaya 7f5290099f MDL-34050 Lesson Module: improved matching question logic for checking user response. This patch will also resolved MDL-36343. 2013-01-11 13:51:13 +08:00
Rossiani Wijaya f7109ce6d8 MDL-34050 Lesson module: Fixed undefined variable for $qtype 2013-01-11 13:50:29 +08:00
Joseph Rézeau 0fabd97928 MDL-34050: Lesson module: fixed matching answer format to use text 2013-01-11 13:50:20 +08:00
Damyon Wiese 975b2f7145 MDL-32341 calendar: get_file_by_hash() expects a hash 2013-01-11 11:56:46 +08:00
Rajesh Taneja a786cf469d MDL-35780 Administration: email display on user profile view page will respect user capability 2013-01-11 10:22:12 +08:00
Eloy Lafuente (stronk7) 72cb5eda5c Merge branch 'MDL-37467-blogs_23' of git://github.com/mudrd8mz/moodle into MOODLE_23_STABLE 2013-01-10 18:13:27 +01:00
David Mudrák 40440a5847 MDL-37467 Do not provide blog posts via RSS when blogging is disabled 2013-01-10 17:04:23 +01:00
Eloy Lafuente (stronk7) b15e5d7252 Merge branch 'MDL-36741_m23' of git://github.com/markn86/moodle into MOODLE_23_STABLE 2013-01-10 11:14:07 +01:00
Mark Nelson 6f003159a2 MDL-36741 mod_forum: fixed the function forum_rss_newstuff that was using count_records_sql incorrectly as well as generating RSS content when no data exists 2013-01-10 18:00:16 +08:00
Frederic Massart ab4cb125e4 MDL-34435 reports: Log category actions
Conflicts:

	course/lib.php
	version.php
2013-01-10 15:14:18 +08:00
Andrew Robert Nicols 6b16846e83 MDL-36600 Add missing sesskey check when previewing the message 2013-01-10 10:20:36 +08:00
Dan Poltawski 8b9929247e Revert "MDL-xxxx show appropriate instance status on user enrolments page"
This was incorrectly integrated

This reverts commit 0431cc0e16.
2013-01-10 09:40:19 +08:00
Rajesh Taneja 20b556afa1 MDL-29534 Forum: if forum_replytouser is not set then send forum email using noreplyaddress. 2013-01-09 14:54:07 +08:00
Isaac Marco Blancas 3d68b9e954 MDL-29534 Forum: If forum_replytouser is not set then don't display from user email" 2013-01-09 14:54:06 +08:00
Jerome Mouneyrac 96ace848cc MDL-37354 clean return value for each externallib PHPUnit tests 2013-01-09 14:00:48 +08:00
Aaron Barnes 7de454919b MDL-36511 course: Save "completion starts on enrolment" disabled state 2013-01-09 15:36:38 +13:00
Dan Poltawski fdd6de9177 Merge branch 'wip-MDL-36367-s23' of git://github.com/phalacee/moodle into MOODLE_23_STABLE 2013-01-09 09:50:54 +08:00
Eloy Lafuente (stronk7) cd7802517f Merge branch 'w51_MDL-37420_m23_pgschema' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2013-01-09 01:33:20 +01:00
Paul Nicholls 1d15d41073 MDL-37162: Use CSS to make mod show/hide icons not look "clickable" in hidden sections
Previously, the resource toolbox initialiser was using JS to find the show/hide icon, then find its section ancestor, then check if the section was hidden - only to pointlessly set pointer:auto if it was.  That didn't meet the aim stated in the comments ("Disable" show/hide icons (change cursor to not look clickable) if section is hidden), but this patch meets that goal with a single CSS rule.
2013-01-09 11:30:13 +13:00
Andrew Robert Nicols 0cc875b7d0 MDL-36600 user: improve course messaging checks 2013-01-09 09:22:37 +13:00
Eloy Lafuente (stronk7) a2eaf8896d Merge branch 'w51_MDL-37152_m23_smtp' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2013-01-08 18:02:51 +01:00
Petr Škoda 090c684838 MDL-37420 add support for more PostgreSQL schemas 2013-01-08 17:46:54 +01:00
sam marshall 52f37ef475 MDL-37395 Add .jar filetype so Moodle doesn't incorrectly call it a zip file 2013-01-08 12:51:24 +00:00
Jerome Mouneyrac 845ef47ccd MDL-37194 activity chooser displays entire list of default activities/resources 2013-01-08 18:05:28 +08:00
Andrew Robert Nicols b8438776db MDL-37173 Stop attempting to set User-Agent from core JS
This leads to some browsers throwing warnings that it is unsafe to set the
User-Agent. It doesn't help us in any way particularly either.
2013-01-08 09:57:17 +00:00
Dan Poltawski 7c333e0c6c Merge branch 'MDL-32639-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2013-01-08 14:46:34 +08:00
Petr Škoda 0431cc0e16 MDL-xxxx show appropriate instance status on user enrolments page 2013-01-08 14:22:59 +08:00
Jason Fowler a201a0ff4e MDL-36620 - Blog, RSS - Preventing Guests from viewing the RSS of site level blogs
Conflicts:
	blog/rsslib.php
2013-01-08 14:07:53 +08:00
Adrian Greeve 6990c10576 MDL-36335 - course: Orphaned activities no longer show a notice. 2013-01-08 12:25:09 +08:00
Joseph Rézeau ea8e60c6f8 MDL-36335 - course: Orphaned activities no longer show a notice. 2013-01-08 12:24:06 +08:00
Dan Poltawski 27b92b4a71 Merge branch 'w51_MDL-37191_m23_plugindelete' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2013-01-08 11:17:05 +08:00
Paul Nicholls 18a5b8c72e MDL-29835: filemanager - zero means zero, not unlimited
The form_filemanager constructor was using empty() rather than !isset(),
so overwrote maxfiles=0 with the default (-1).  In addition, the JS UI
treated 0 as unlimited - but the non-JS fallback UI treated it as zero.
This would result in a file manager which allowed files to be
chosen/uploaded, which would then vanish into the void when the backend
saw that the maximum number of files was 0.
2013-01-08 16:01:04 +13:00
Dan Poltawski 3de2dc19e1 Merge branch 'MDL-31641_drag_drop_help_23' of git://github.com/davosmith/moodle into MOODLE_23_STABLE 2013-01-08 10:54:24 +08:00
Charles Fulton 3ee53f7e7f MDL-35130 shibboleth: remove hard-coded string 2013-01-08 10:51:25 +08:00
Dan Poltawski b943d77cd2 Merge branch 'MDL-36456-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2013-01-08 10:31:10 +08:00
Dan Poltawski c7ad6f4504 Merge branch 'w51_MDL-37301_m23_coursecatinfoas' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2013-01-08 10:27:12 +08:00
Dan Poltawski 053f6ebc42 Merge branch 'w51_MDL-37254_m23_courseinfoas' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2013-01-08 10:24:21 +08:00
Sam Hemelryk b7af1eee2d Merge branch 'wip-mdl-36958-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2013-01-08 14:06:36 +13:00
David Mudrák 53499f8d35 MDL-36977 Be more picky when it comes to migrating files in moodle1 backups 2013-01-08 08:54:29 +08:00
David Mudrák 02a6f3b04f MDL-36977 Add more unit tests for moodle1 backup conversion 2013-01-08 08:54:29 +08:00
Paul Nicholls 330686c9fb MDL-35074: grader report - Ease limit on number of students per page
The limit imposed by max_input_vars "applies only to each nesting level of
a multi-dimensional input array"
(http://www.php.net/manual/en/info.configuration.php#ini.max-input-vars).

Turning the grader report fields into arrays (they were all top-level form
fields, i.e. elements of the top-level array) makes the number of students
become the only limiting factor, thereby allowing us to relax the limit on
number of students per page greatly (to 1 less than max_input_vars, for
safety).
2013-01-08 12:55:56 +13:00
Eloy Lafuente (stronk7) 5050a19ff7 Merge branch 'MDL-35794_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-01-07 22:38:48 +01:00
Eloy Lafuente (stronk7) 0858993db8 Merge branch 'MDL-35792_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-01-07 22:36:29 +01:00
sam marshall b12d8cd881 MDL-36095 Section availability: Make behaviour consistent with activities 2013-01-07 15:55:12 +00:00
Davo Smith db529c2346 MDL-31641 filemanager - display help message when drag and drop upload is not supported 2013-01-07 08:16:35 +00:00
Didier Raboud 7db20e0073 MDL-37157: Normalize short answers before comparison
This ensures that ambiguous Unicode representations can be compared sanely.
Also add some tests to ensure it keeps working.

Thanks to Tim Hunt for the syntax check.
2013-01-07 14:00:26 +08:00
Dan Poltawski 1f1dc87fc1 Merge branch 'w51_MDL-37128_m23_rssrestore' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2013-01-07 13:57:10 +08:00
Dan Poltawski d068c79e48 Merge branch 'w51_MDL-36893_m23_mnetestrict' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2013-01-07 13:53:29 +08:00
Dan Poltawski b0c49cea12 Merge branch 'MDL-27884-m23' of git://github.com/ankitagarwal/moodle into MOODLE_23_STABLE 2013-01-07 13:30:43 +08:00
Andrew Davis b65bd8b658 MDL-33117 grade: adding unit tests for the user report function inject_rowspans() 2013-01-07 12:00:16 +08:00
Damyon Wiese 7e57119342 MDL-37244 Assignment: Submission comments plugin does not implement comments callbacks.
This allows anyone to view or modify anyone elses submission comments.
2013-01-07 10:49:20 +08:00
Ankit Agarwal 77a7ed6535 MDL-33340 completion: Incorrect logic in hidden field check
Credit to Jody Steele
2013-01-07 10:37:38 +08:00
Simon Coggins 1e8335fb82 MDL-35991 - use PARAM_LOCALURL for local urls 2013-01-07 10:10:32 +08:00
Rajesh Taneja 9d40987c6d MDL-37062 Course: Show one 'Add new course' button
Currently if there is no course and admin/course creator go to create course, he/she see two
'Add new course' buttons.
2013-01-07 09:48:26 +08:00
Dan Poltawski 523dafe824 Merge branch 'MDL-36667-23' of git://github.com/damyon/moodle into MOODLE_23_STABLE 2013-01-07 09:45:15 +08:00
Sam Hemelryk fc77cb3d85 Merge branch 'MDL-37161-moodle23' of https://github.com/StudiUM/moodle into MOODLE_23_STABLE 2013-01-07 14:14:28 +13:00
Sam Hemelryk 178a5b4102 Merge branch 'w51_MDL-36212_m23_entities' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2013-01-07 13:44:36 +13:00
Sam Hemelryk 52817fdbbc Merge branch 'MDL-37068_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-01-07 13:39:52 +13:00
Sam Hemelryk 757376d7dd Merge branch 'w51_MDL-37281_m23_othersnav' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2013-01-07 13:33:45 +13:00
Sam Hemelryk a68bc19fa6 Merge branch 'MDL-36855-m23' of git://github.com/ankitagarwal/moodle into MOODLE_23_STABLE 2013-01-07 12:04:51 +13:00
Charles Fulton c1fcc89f71 MDL-4781 forum: show discussion link when user has ability to view discussion
Conflicts:
	mod/forum/lib.php
2013-01-07 11:17:58 +13:00
Davo Smith 318b859ac8 MDL-35887 course dndupload - correct default used for completion tracking when resources created by drag and drop 2013-01-07 11:07:45 +13:00
Sam Hemelryk d9402acd03 Merge branch 'MDL-16730-m23' of git://github.com/ankitagarwal/moodle into MOODLE_23_STABLE 2013-01-07 10:14:54 +13:00
Mark Nelson 70badb4824 MDL-37359 groups: fixing typo in the web service function create_groupings_parameters 2013-01-07 09:47:49 +13:00
Sam Hemelryk a3a84720d3 Merge branch 'MDL-29327_none_23' of git://github.com/andyjdavis/moodle into MOODLE_23_STABLE 2013-01-07 09:34:52 +13:00
Sam Hemelryk a589b0dc77 Merge branch 'MDL-36741_m23' of git://github.com/markn86/moodle into MOODLE_23_STABLE 2013-01-07 09:15:34 +13:00
Jean-Philippe Gaudreau d71792da4f MDL-37161 Backup: Database error caused by grade book settings when importing or restoring a course 2013-01-04 09:53:03 -05:00
Damyon Wiese 3f1b2800ae MDL-36712: Assignment - Do not always send feedback available emails when grade is created
The entry in the assign_grades table contains grades feedback and other settings such as locked.
Only send the student an email about new feedback if it is actually grades or feedback that
has been added. This is done by using another state for the mailed flag (2) which means "unset".

Conflicts:

	mod/assign/feedback/file/importziplib.php
	mod/assign/feedback/file/locallib.php
	mod/assign/feedback/offline/locallib.php
	mod/assign/locallib.php
2013-01-04 15:02:50 +08:00
Jerome Mouneyrac 7441838054 MDL-37355 Fix the REST server that didn't send back the cleaned values 2013-01-04 14:39:10 +08:00
Andrew Davis d674a0e16f MDL-29327 core_grade: removing some code that is messing up the categories and items screen when no grade categories are used 2013-01-04 08:58:25 +08:00
Ankit Agarwal 7f7e18c3a2 MDL-36855 scorm: update to api get_scorm_question_count()
get_scorm_question_count() should return 0 not 1 when no attempt is made in a scorm by any student
2013-01-03 14:42:18 +08:00
Ankit Agarwal 2e505a05d1 MDL-27884 Implement proper username validation during csv import 2013-01-02 14:10:16 +08:00
Ankit Agarwal f439b4242c MDL-27884 blocks: Correcting config title string
AMOS BEGIN
 CPY [configtitle,block_html],[configtitle,block_tags]
AMOS END

Conflicts:

	blocks/tags/edit_form.php
	blocks/tags/lang/en/block_tags.php
2013-01-02 10:54:51 +08:00
AMOS bot c2f393b2b5 Automatically generated installer lang files 2013-01-01 00:43:01 +00:00
Eloy Lafuente (stronk7) 10ad21dc9a weekly release 2.3.3+ 2012-12-30 01:05:13 +01:00
Petr Škoda 00f9bca84a MDL-36893 fix mnet E_STRICT issue 2012-12-27 14:33:37 +01:00
Petr Škoda 575d91977e MDL-37128 fix E_STRICT rss restore issue 2012-12-27 13:41:20 +01:00
Petr Škoda a340e04df7 MDL-37301 fix missing AS in select
This was breaking pg 8.3. Credit goes to Thomas Robb, thanks.
2012-12-26 22:27:34 +01:00
Dan Poltawski 48d53d9fd6 Merge branch 'MDL-35569-m23' of git://github.com/sammarshallou/moodle into MOODLE_23_STABLE 2012-12-24 11:43:41 +08:00
Dan Poltawski cd665c200d Merge branch 'w51_MDL-37233_m23_skype' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-12-24 11:34:55 +08:00
Dan Poltawski 1cb195dabc Merge branch 'wip-MDL-37290-m23' of git://github.com/samhemelryk/moodle into MOODLE_23_STABLE 2012-12-24 10:55:37 +08:00
Dan Poltawski ca0cbfd4db Merge branch 'w51_MDL-37283_m23_spell' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-12-24 10:35:47 +08:00
Sam Hemelryk 76dee48562 MDL-37290 course: fixed up navbar when editing categories 2012-12-24 13:06:25 +13:00
Sam Hemelryk 185eff01fa Merge branch 'wip-MDL-35833-stable23' of git://github.com/phalacee/moodle into MOODLE_23_STABLE 2012-12-24 11:43:37 +13:00
Sam Hemelryk fec305739d Merge branch 'MDL-36966-23' of git://github.com/damyon/moodle into MOODLE_23_STABLE 2012-12-24 11:16:07 +13:00
Sam Hemelryk 2c292b48da Merge branch 'wip-MDL-35653-MOODLE_23_STABLE' of git://github.com/abgreeve/moodle into MOODLE_23_STABLE 2012-12-24 09:40:36 +13:00
Petr Škoda a3243760c2 MDL-37283 import tinymce spellchecker 2.0.6.1 2012-12-22 16:48:13 +01:00
Tim Hunt 18651b0bfa MDL-37068 qformat_learnwise: fix UTF8 and other issues. 2012-12-22 15:15:20 +00:00
Thanh Le e349d18435 MDL-35794 quiz: config for whether Outcomes are advanced settings 2012-12-22 15:15:13 +00:00
Thanh Le 5b8d9521ee MDL-35792 question preview: way to update options without restarting.
It is useful, and possible, to update the display options without
restarting the question. You now only have to restart if you are
changing the maximum mark or the behaviour.
2012-12-22 15:15:06 +00:00
Petr Škoda 8d5769593d MDL-37281 fix other users current navigation node 2012-12-22 14:59:40 +01:00
Petr Škoda 92fc5a670d MDL-37152 remove bogus $mail->IsSMTP() breaking non-smtp mailing
Credit goes to Aurelijus Bruzas, thanks.
2012-12-22 14:48:47 +01:00
Petr Škoda c92a386ba4 MDL-37254 add missing AS keyword 2012-12-22 14:13:19 +01:00
Petr Škoda 7ea870a33e MDL-37233 do not show skype status icon on https sites
Funny that the same company that implemented the IE security warnings is unable to set up SSL on the Skype status server…
2012-12-21 17:28:05 +01:00
Petr Škoda 8cc55f3058 MDL-37191 do not timeout when uninstalling plugins 2012-12-21 16:00:59 +01:00
Petr Škoda ea0f9a277c MDL-36212 rework html entity conversions
This should resolve all html entity conversion problems in different PHP versions.
2012-12-20 22:49:20 +01:00
Eloy Lafuente (stronk7) 4a76321356 weekly release 2.3.3+ 2012-12-20 21:12:09 +01:00
Eloy Lafuente (stronk7) e84b8c3f5c Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2012-12-20 20:57:28 +01:00
Jason Fowler 0fa9c9ff12 MDL-35833 - Blocks - Adding alt and title attributes to the docked-block panel close button 2012-12-20 10:41:47 +08:00
Tim Hunt c0267dc549 MDL-32245 question bank: update URL after moving question between categories.
Also, improve the URL when you go to edit the questions in a category.
2012-12-20 12:12:37 +13:00
Andrew Robert Nicols 1365b07390 MDL-36934 Only set the autosubmit class on selects when required
The url_select class can optionally show a button (much like the non-JS
fallback). In this case, the autosubmit nature of the form shouldn't be
enforced and it should only submit on the button.
2012-12-19 12:27:17 +00:00
Adrian Greeve eb883f0fa4 MDL-35653 - mod/wiki: Force format now lets users edit wiki pages.
Thanks to Tõnis Tartes for part of this solution.

When force format was selected in the options, trying to view the
wiki would redirect to the front page with a message saying that
you do not have permission to edit this page. Students had no way
of viewing any entries or creating the first page.

When in force format it skips a page , which would be considered
uncessary for students, but this means that the group id is not set
and this is what is causing most of the problems.

I also have included a check to see if the title is default and whether
the user has permission to view all groups. In these situations the
intermediate page is displayed.
2012-12-19 08:54:12 +08:00
Eloy Lafuente (stronk7) 9af7c81879 Merge branch 'w50_MDL-36245_m23_convert' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-12-18 23:43:06 +01:00
Andrew Robert Nicols 5eadb30e07 MDL-35569 AJAX Move auto-submitting selects to separate YUI module
sam note: Some changes removed from 2.4 version (deprecation warning, lib/upgrade.txt).
2012-12-18 13:56:26 +00:00
Matt Oquist d032ed7b0c MDL-36958 Forum: Replaced hard-coded numbers with proper defines 2012-12-18 17:24:34 +08:00
Dan Poltawski 2ea7723c53 Merge branch 'MDL-37014_webdav_folders_23' of git://github.com/davosmith/moodle into MOODLE_23_STABLE 2012-12-18 14:52:41 +08:00
Dan Poltawski 568349fee7 MDL-36259 - change case of table alias to match definition 2012-12-18 14:27:13 +08:00
Dan Poltawski 60b5ffebf5 Merge branch 'MDL-36259_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-12-18 14:26:10 +08:00
Dan Poltawski 8d8158ea9c Merge branch 'MDL-30899_23' of git://github.com/dmonllao/moodle into MOODLE_23_STABLE 2012-12-18 09:11:31 +08:00
Raymond Wijaya 4c1d7cf9b6 MDL-36966 Assignment: Bug - Student submission appears graded by themselves.
Fix a bug when a student editing his submission after it has been graded, it changes the 'graded by' details to the student's name in the feeback summary
2012-12-18 08:47:14 +08:00
Dan Poltawski 2e791b966d Merge branch 'MDL-35740-23' of git://github.com/damyon/moodle into MOODLE_23_STABLE 2012-12-18 08:45:48 +08:00
Eloy Lafuente (stronk7) af794e19f3 Merge branch 'MDL-36842_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-12-18 00:19:55 +01:00
Eloy Lafuente (stronk7) 877960cfdf Merge branch 'w50_MDL-37171_m23_outdatedexcel' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-12-18 00:14:04 +01:00
Adrian Fish 2ad0b3a12a MDL-37035 Pass user locale after course locale. 2012-12-18 10:32:29 +13:00
Sam Hemelryk 59fc0958d6 Merge branch 'w50_MDL-37111_m23_forumsinglefirst' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-12-18 10:24:32 +13:00
Sam Hemelryk b3f46160b4 Merge branch 'MDL-37176_23' of git://github.com/stronk7/moodle into MOODLE_23_STABLE 2012-12-18 10:12:11 +13:00
Sam Hemelryk 5c65ad28b4 Merge branch 'MDL-35530_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-12-18 10:07:03 +13:00
Sam Hemelryk 6c9a77ba0c Merge branch 'wip-MDL-35056-stable23' of git://github.com/phalacee/moodle into MOODLE_23_STABLE 2012-12-18 09:56:58 +13:00
Sam Hemelryk 20da16bb77 Merge branch 'MDL-32245_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-12-18 09:51:30 +13:00
Sam Hemelryk f6a3850949 MDL-36812 grader_report: Fixed whitespace on integration 2012-12-18 09:48:06 +13:00
Nadav Kavalerchik e83a4dcdd8 MDL-36812 - Enabling grade_report_fixedstudents, shows the user's list on the left side of the page, in RTL mode (theme/standard) 2012-12-18 09:48:05 +13:00
Sam Hemelryk c20213441e Merge branch 'MDL-29733_23' of git://github.com/andyjdavis/moodle into MOODLE_23_STABLE 2012-12-18 09:42:06 +13:00
Tim Hunt f4564374d7 MDL-37098 quiz: event handler fails deleting group with no overrides
This was a regression from MDL-35717.
2012-12-17 17:01:05 +00:00
Dan Poltawski 2144749571 MDL-35717|NOBUG - fix trailing whitespace problems 2012-12-17 17:01:04 +00:00
Matt Petro 30ef79639c MDL-35717 quiz: fix overdue attempt processing 2012-12-17 17:00:52 +00:00
David Monllao 1a4bfac4db MDL-30899 moodle-enrol-notification Overridding default footer padding 2012-12-17 15:36:40 +08:00
David Monllao 49ca31880c MDL-30899 moodle-enrol-notification Adding close button title for accessibility 2012-12-17 15:36:33 +08:00
Dan Poltawski c3e3fd380d Merge branch 'w50_MDL-36493_m23_mysql' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-12-17 15:29:18 +08:00
Dan Poltawski 4dd80797b5 Merge branch 'MDL-37114_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-12-17 15:25:30 +08:00
Andrew Davidson 139d78a828 MDL-37034 - Added appropriate name to category settings navigation node 2012-12-17 15:22:07 +08:00
Dan Poltawski 5c7c78db26 Merge branch 'w50_MDL-36597_m23_courselang' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-12-17 13:53:33 +08:00
Dan Poltawski 8e81a8eb2c Merge branch 'MDL-29334_m23' of git://github.com/markn86/moodle into MOODLE_23_STABLE 2012-12-17 13:48:25 +08:00
Dan Poltawski 160d3c6b8a Merge branch 'wip-mdl-36736-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2012-12-17 12:09:46 +08:00
Dan Poltawski 0869ef50f0 Merge branch 'wip-MDL-25928-m23' of git://github.com/samhemelryk/moodle into MOODLE_23_STABLE 2012-12-17 12:05:19 +08:00
Dan Poltawski 12a3697281 Merge branch 'wip-MDL-35874-stable23' of git://github.com/phalacee/moodle into MOODLE_23_STABLE 2012-12-17 11:53:08 +08:00
Dan Poltawski f28b5664eb Merge branch 'wip-MDL-35979-s23' of git://github.com/phalacee/moodle into MOODLE_23_STABLE 2012-12-17 11:48:47 +08:00
Dan Poltawski bda079183e Merge branch 'MDL-37078-m23' of git://github.com/sammarshallou/moodle into MOODLE_23_STABLE 2012-12-17 11:37:10 +08:00
Dan Poltawski 71c3eff427 Merge branch 'MDL-37165-23' of git://github.com/damyon/moodle into MOODLE_23_STABLE 2012-12-17 11:30:35 +08:00
Sam Hemelryk 5f9106b7f2 MDL-25928 course: Fixed course info on the combo list to be a popup 2012-12-17 16:03:42 +13:00
Petr Škoda a530b69dd5 MDL-37171 fix multiple spreadsheet related PHP4isms 2012-12-15 12:41:02 +01:00
Petr Škoda 91438d7894 MDL-36245 add tests for the buggy utf-8 to utf-8 conversion 2012-12-15 11:51:21 +01:00
Petr Škoda f16a143872 MDL-36245 try to workaround buggy iconv() when converting text from utf-8 to utf-8 2012-12-15 11:51:21 +01:00
Petr Škoda 84b9192875 MDL-36493 improve timeout handling in mysql upgrade
Credit goes to Mark Nielsen, thanks.
2012-12-15 11:44:55 +01:00
Petr Škoda 4df8d1924d MDL-36493 improve performance of mysql unsigned/lob upgrade 2012-12-15 11:44:55 +01:00
Petr Škoda 372bfa208c MDL-37111 copy first post files in single type forum using intro options
This patch also removed the delete button from the first post in single
discussion type forum.

Edit button in the first post leads to the forum edit page now, this should
prevent other problems throwing first post and intro out of sync.
2012-12-15 11:24:56 +01:00
Petr Škoda fb5d7df075 MDL-36597 strip '_utf8' from all course.lang fields 2012-12-15 11:18:59 +01:00
Joseph Rezeau d057719e98 MDL-37114 quiz form validation: feedback boundaries.
The feedback boundaries must either be a number or a percentage.
We were not correctly validating the non-percentage case.
2012-12-15 10:07:58 +00:00
Thanh Le defbd5dd2c MDL-36259 course short names: ensure it displays when enabled in admin
Fixed 5 Moodle pages that does not display the course short name even if "Display extended course names" setting is on.  In fixing this, search.php also included related minor code to change to minimise DB calls to improve performance.
2012-12-15 10:07:40 +00:00
Tim Hunt c49b83bccc MDL-32245 question bank: fix coding style in categories.php 2012-12-15 10:07:09 +00:00
Thanh Le 99231022af MDL-32245 question bank: fix moving categories between contexts. 2012-12-15 10:07:08 +00:00
AMOS bot 188c725387 Automatically generated installer lang files 2012-12-15 00:42:08 +00:00
Eloy Lafuente (stronk7) cdfb784e52 MDL-37176 timezones: updated to 2012j 2012-12-14 20:08:45 +01:00
Eloy Lafuente (stronk7) 7d2c5cd0a0 weekly release 2.3.3+ 2012-12-14 13:30:25 +01:00
Eloy Lafuente (stronk7) 4e6157ca5f Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2012-12-14 13:20:49 +01:00
Frederic Massart 50cff3c0cb MDL-36456 repository: S3 handles errors in a nicer way 2012-12-14 17:57:02 +08:00
Damyon Wiese 63fd639d85 MDL-37165 Assignment: Oracle fix for count_submissions_with_status (and friends).
Oracle does not like the use of AS after a join.
2012-12-14 15:16:06 +08:00
Dan Poltawski 271bfb48b8 Merge branch 'MDL-36263-23' of git://github.com/damyon/moodle into MOODLE_23_STABLE 2012-12-13 17:43:21 +08:00
Damyon Wiese 6a1bcbfdab MDL-36263 Assignment: Fix backport for counting submissions of unenrolled students 2012-12-13 17:41:17 +08:00
Eloy Lafuente (stronk7) 87e9ea1f67 Merge branch 'MDL-30700-23' of git://github.com/damyon/moodle into MOODLE_23_STABLE 2012-12-13 10:32:38 +01:00
Jason Fowler e98a1a118e MDL-35874 - Blocks - Adding a label to the 'Add a block' block's select field 2012-12-13 15:10:18 +08:00
Jason Fowler d4f5439de2 MDL-35056 - Backup/Restore - Converting the 'Unmet Dependencies' Message to be a Developer Debug message to make moodle less confusing to the average user 2012-12-13 11:11:29 +08:00
Damyon Wiese 4d8125b1c7 MDL-30700 tablelib: Fixed get_sort_for_table to work with text sorting columns for oracle
This change stores the list of columns that require text sorting in the session,
so the static function "get_sort_for_table" can work without any additional parameters.
2012-12-13 09:59:04 +08:00
Dan Poltawski 137d63fe96 Merge branch 'MDL-36897_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-12-13 09:55:07 +08:00
sam marshall c520e08653 MDL-37078: Restore - section restore fails with multiple availability conditions 2012-12-12 12:19:59 +00:00
Davo Smith 4615b7b6ff MDL-37014 repository_webdav - strip the server URL from file & folder paths returned by webdav lib (if present) 2012-12-12 08:46:59 +00:00
Tim Hunt d8a7ef0e42 MDL-36897 quiz review: fixup previous commit. 2012-12-12 08:13:43 +00:00
Frederic Massart 03f8841d9b MDL-32639 files: Zipping a folder does not overwrite existing files 2012-12-12 14:41:08 +08:00
Frederic Massart aa4d973436 MDL-32639 files: Improved File Manager download and zip support
Conflicts:

	lib/filestorage/zip_packer.php
2012-12-12 14:41:04 +08:00
Mark Nelson f2f5a5fc0e MDL-29334 mod_data: if site-wide presets created in <= 1.9 exist convert them to 2.x 2012-12-12 13:07:03 +08:00
Dan Poltawski 9391d2f4cf Merge branch 'wip-MDL-33448-m23' of git://github.com/samhemelryk/moodle into MOODLE_23_STABLE 2012-12-12 09:38:03 +08:00
Cathal O'Riordan 18a0b829a4 MDL-36644 Assignment: prepend the course upload limit to the options array
Ensure that the course upload limit is the first option in the list of available choices for the Maximum submission size select.
2012-12-12 08:57:21 +08:00
Dan Poltawski 8869233e26 Merge branch 'm23_MDL-35737' of git://github.com/danmarsden/moodle into MOODLE_23_STABLE 2012-12-12 08:44:13 +08:00
AMOS bot bdefe732c5 Automatically generated installer lang files 2012-12-12 00:41:20 +00:00
Sam Hemelryk 3ad9a3fda3 Merge branch 'MDL-27619_23' of git://github.com/pauln/moodle into MOODLE_23_STABLE 2012-12-12 11:09:32 +13:00
Eloy Lafuente (stronk7) 106c4841a7 Merge branch 'MDL-32880_23_3' of git://github.com/pauln/moodle into MOODLE_23_STABLE 2012-12-11 22:50:08 +01:00
Sam Hemelryk 27f4a337a0 MDL-29805 redirect: added check REQUIRE_CORRECT_ACCESS is true 2012-12-12 09:47:00 +13:00
Sam Hemelryk 1b39edd662 Merge branch 'MDL-29805-23' of git://github.com/mouneyrac/moodle into MOODLE_23_STABLE 2012-12-12 09:45:03 +13:00
Sam Hemelryk 09fc0fde35 Merge branch 'MDL-35593-23' of git://github.com/mouneyrac/moodle into MOODLE_23_STABLE 2012-12-12 09:38:27 +13:00
Sam Hemelryk 6e89cdb35f Merge branch 'wip_23_mdl-37088_bad_operator_ldap_sync_user' of https://github.com/iarenaza/moodle into MOODLE_23_STABLE 2012-12-12 09:34:31 +13:00
Sam Hemelryk eb49335150 Merge branch 'MDL-36321_message_participants_23' of git://github.com/andyjdavis/moodle into MOODLE_23_STABLE 2012-12-12 09:28:58 +13:00
Eloy Lafuente (stronk7) ecdee4a925 Merge branch 'MDL-30700-23' of git://github.com/damyon/moodle into MOODLE_23_STABLE 2012-12-11 19:58:19 +01:00
Dan Poltawski def1725853 Merge branch 'w49_MDL-36447_m23_gdtest' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-12-11 17:54:51 +08:00
Dan Poltawski 7350e439bf Merge branch 'MDL-36243_23' of git://github.com/jmvedrine/moodle into MOODLE_23_STABLE 2012-12-11 16:24:34 +08:00
Dan Poltawski eba170d8fc Merge branch 'wip-MDL-36108-stable23' of git://github.com/phalacee/moodle into MOODLE_23_STABLE 2012-12-11 16:03:41 +08:00
Damyon Wiese c8aa33ea2c MDL-35740 Assignment: Show students the status of own submission on overview page.
This is a minimal patch just for backporting to 23.
2012-12-11 16:01:23 +08:00
Jason Fowler a5dbb601ce MDL-36108 - Blocks - Online User block's user image's alt attribute is now empty to prevent repetition of text for screen readers 2012-12-11 15:49:27 +08:00
Damyon Wiese 0887f75587 MDL-30700 Assignment 2.2: Added text_sorting function to tablelib
Allows oracle to sort by text (clob) columns (should be used sparingly).
2012-12-11 15:41:56 +08:00
Dan Poltawski f2190bac6c Merge branch 'MDL-36712-23' of git://github.com/damyon/moodle into MOODLE_23_STABLE 2012-12-11 14:01:14 +08:00
Dan Poltawski 1ff0a314c9 Merge branch 'MDL-36591-23' of git://github.com/damyon/moodle into MOODLE_23_STABLE 2012-12-11 13:57:11 +08:00
Dan Poltawski 556f228a9e Merge branch 'MDL-36897_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-12-11 13:54:23 +08:00
Dan Poltawski a2f2dbb5dc Merge branch 'w49_MDL-36685_m23_tablecells' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-12-11 13:44:01 +08:00
Dan Poltawski f55f2e48ca Merge branch 'MDL-34791-MOODLE_23_STABLE' of git://git.luns.net.uk/moodle into MOODLE_23_STABLE 2012-12-11 13:23:08 +08:00
Dan Poltawski 1c570f9096 Merge branch 'MDL-36808-m23' of git://github.com/sammarshallou/moodle into MOODLE_23_STABLE 2012-12-11 12:19:46 +08:00
Petr Škoda 1d2b58b5dd MDL-36983 fix incorrect test method name
Credit goes to David Scotson, thanks.
2012-12-11 12:10:43 +08:00
Dan Poltawski a2577a7cc3 Merge branch 'w49_MDL-36892_m23_enrolreadme' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-12-11 12:07:22 +08:00
Dan Poltawski 957dfed5f2 Merge branch 'MDL-36845_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-12-11 11:58:54 +08:00
Aparup Banerjee 4e66b8908c Merge branch 'w49_MDL-36817_m23_composer' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-12-11 11:54:53 +08:00
Dan Poltawski f95ba651fc Merge branch 'MDL-36828_23' of https://github.com/aolley/moodle into MOODLE_23_STABLE 2012-12-11 11:44:40 +08:00
Dan Poltawski 10c8b7390c Merge branch 'wip-MDL-36110-s23' of git://github.com/phalacee/moodle into MOODLE_23_STABLE 2012-12-11 11:33:22 +08:00
Dan Poltawski 5d1dff532e Merge branch 'wip-MDL-35884-s23' of git://github.com/phalacee/moodle into MOODLE_23_STABLE 2012-12-11 11:17:43 +08:00
Jason Fowler 2874baa411 MDL-35884 - Course - Fixing bad whitespace/character return 2012-12-11 11:12:17 +08:00
Jason Fowler 4885064053 MDL-35884 - Course - Remove text from ALT attribute for activity chooser 2012-12-11 11:11:49 +08:00
Sam Hemelryk 39a36d7d7b Merge branch 'MDL-36650_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-12-11 16:11:08 +13:00
Dan Poltawski 3f358a021b Merge branch 'MDL-36025-negative-zero-MOODLE_23_STABLE' of git://github.com/mpetrowi/moodle into MOODLE_23_STABLE 2012-12-11 11:07:43 +08:00
Sam Hemelryk b54470f497 Merge branch 'w49_MDL-36731_m23_uploadestrict' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-12-11 16:04:13 +13:00
Sam Hemelryk 237ea8768c Merge branch 'MDL-36905_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-12-11 15:44:32 +13:00
Dan Poltawski b2fa6cfa93 Merge branch 'MDL-34052-23' of https://github.com/damyon/moodle into MOODLE_23_STABLE 2012-12-11 10:39:42 +08:00
Dan Poltawski 8f647f1d3a Merge branch 'w49_MDL-31424_m23_paypalcase' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-12-11 10:31:44 +08:00
Sam Hemelryk 2e6538382a Merge branch 'MDL-36942_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-12-11 15:04:17 +13:00
Sam Hemelryk b74804c8a8 Merge branch 'MDL-36954_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-12-11 14:59:50 +13:00
Dan Poltawski 14802ee558 Merge branch 'MDL-36773-23' of git://github.com/mouneyrac/moodle into MOODLE_23_STABLE 2012-12-11 09:56:47 +08:00
Petr Škoda 702ac0ce02 MDL-37061 always validate lang when setting session user
This should resolve problems with TinyMCE langs and some unknown MUCH caching issue.
2012-12-11 14:44:41 +13:00
Andrew Davis 72754427b6 MDL-36321 core_message: made the course participants list correctly show if course participants are contacts or not 2012-12-11 08:55:25 +08:00
Petr Škoda f6ca5cf303 MDL-29442 add missing utf-8 to entity html encoding and decoding 2012-12-11 10:23:12 +13:00
Sam Hemelryk 3c805e592c Merge branch 'MDL-36263-23' of git://github.com/damyon/moodle into MOODLE_23_STABLE 2012-12-11 10:10:07 +13:00
Sam Hemelryk f1cf05cbbe Merge branch 'MDL-36601-MOODLE_23_STABLE' of git://git.luns.net.uk/moodle into MOODLE_23_STABLE 2012-12-11 09:41:49 +13:00
Sam Hemelryk 667dfa5e7c Merge branch 'MDL-36805-MOODLE_23_STABLE' of git://git.luns.net.uk/moodle into MOODLE_23_STABLE 2012-12-11 09:14:59 +13:00
Iñaki Arenaza c31d0566d7 MDL-37088 auth_ldap: bad operator in ldap sync_user() method 2012-12-10 16:48:14 +01:00
Andrew Robert Nicols 53e1e390f3 MDL-34791 AJAX Update a graded activity's title in the gradebook on rename 2012-12-10 14:15:27 +00:00
Andrew Robert Nicols 8fdecaa51a MDL-36805 Correct docs for workshop_grade_item_update in mod_workshop
The documentation suggested that the modname field should be present on the
$workshop parameter when this is not required. It is not used in any point
in the function and the $workshop variable is never passed to another
function which may use it.
2012-12-10 12:27:30 +00:00
Dan Poltawski 1423ab3709 Merge branch 'w49_MDL-36737_m23_glossstrict' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-12-10 19:37:41 +08:00
Vadim Dvorovenko 4dcae0d897 MDL-32639 files: Removing '0' start folder in archives created with filemanager
Signed-off-by: Vadim Dvorovenko <vadimon@mail.ru>
2012-12-10 18:10:58 +08:00
Dan Poltawski ae4e512f66 Merge branch 'MDL-36167-23' of git://github.com/damyon/moodle into MOODLE_23_STABLE 2012-12-10 17:32:30 +08:00
Dan Poltawski b0473b9bf0 Merge branch 'MDL-36732_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-12-10 15:18:24 +08:00
Dan Poltawski 8bd7536090 Merge branch 'MDL-36742_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-12-10 14:41:48 +08:00
Dan Poltawski 870d2fff8e Merge branch 'MDL-36549_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-12-10 14:19:10 +08:00
Dan Poltawski 66586db224 Merge branch 'MDL-36835-23' of git://github.com/damyon/moodle into MOODLE_23_STABLE 2012-12-10 14:02:24 +08:00
Dan Poltawski d4d6cce500 Merge branch 'MDL-36538_webdav_memory_23' of git://github.com/davosmith/moodle into MOODLE_23_STABLE 2012-12-10 13:13:11 +08:00
Dan Poltawski 6078f84d9f Merge branch 'w49_MDL-35456_m23_paypal' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-12-10 12:03:33 +08:00
Dan Poltawski 8ffe246d69 Merge branch 'MDL-35404_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-12-10 11:36:49 +08:00
Sam Hemelryk a9269beb9c Merge branch 'MDL-30961-23' of git://github.com/mouneyrac/moodle into MOODLE_23_STABLE 2012-12-10 14:59:31 +13:00
Dan Poltawski 1197b6163a Merge branch 'MDL-36680_hidden_23' of git://github.com/andyjdavis/moodle into MOODLE_23_STABLE 2012-12-10 09:57:10 +08:00
Sam Hemelryk e4a2de510c Merge branch 'MDL-34592_M23' of git://github.com/lazydaisy/moodle into MOODLE_23_STABLE 2012-12-10 14:28:24 +13:00
Sam Hemelryk 15e9d4c64a Merge branch 'MDL-36608_M23' of git://github.com/lazydaisy/moodle into MOODLE_23_STABLE 2012-12-10 14:24:10 +13:00
Sam Hemelryk b35e30e5bc Merge branch 'MDL-36978_M23' of git://github.com/lazydaisy/moodle into MOODLE_23_STABLE 2012-12-10 14:21:08 +13:00
Mark Nielsen ccca91bd9e MDL-36579: Adding missing fields in mod/lti backup 2012-12-10 14:16:36 +13:00
Sam Hemelryk 1f0e0ab503 Merge branch 'MDL-36607_dndBlocks' of https://github.com/moodlerooms/moodle into MOODLE_23_STABLE 2012-12-10 14:12:24 +13:00
Mary Evans 564b28731c MDL-34592 theme_magazine: Fixes the report grader fixed column misalignment in magazine/style/core.css theme, plus fixes all CORE themes with minor adjustment to grade/report/grader/style.css 2012-12-10 00:06:03 +00:00
Sam Hemelryk 2353df33a7 Merge branch 'MDL-36433' of git://github.com/itamart/moodle into MOODLE_23_STABLE 2012-12-10 12:13:10 +13:00
Dan Poltawski 8d0a31e6cf MDL-36764 ddl/oracle: fix misleading comment 2012-12-10 11:55:08 +13:00
Sam Hemelryk f382da5bf9 Merge branch 'MDL-36778-23' of git://github.com/danpoltawski/moodle into MOODLE_23_STABLE 2012-12-10 11:51:20 +13:00
Sam Hemelryk 0d76053893 Merge branch 'MDL-36887-23' of git://github.com/danpoltawski/moodle into MOODLE_23_STABLE 2012-12-10 11:47:44 +13:00
Sam Hemelryk 46210e38e8 Merge branch 'MDL-36640-MOODLE_23_STABLE' of git://git.luns.net.uk/moodle into MOODLE_23_STABLE 2012-12-10 11:42:35 +13:00
Andrew Robert Nicols 0c7f592819 MDL-36918 Decode HTML entities on ajax update title 2012-12-10 11:15:07 +13:00
Sam Hemelryk 532577bb97 Merge branch 'message_nav_23' of git://github.com/andyjdavis/moodle into MOODLE_23_STABLE 2012-12-10 10:58:50 +13:00
Sam Hemelryk 5b2b3bdaf8 Merge branch 'MDL-36761_loop_23' of git://github.com/andyjdavis/moodle into MOODLE_23_STABLE 2012-12-10 10:54:00 +13:00
Sam Hemelryk b88caf890d Merge branch 'MDL-34591_23' of git://github.com/grabs/moodle into MOODLE_23_STABLE 2012-12-10 10:48:33 +13:00
Sam Hemelryk 45fd888c52 Merge branch 'wip-MDL-35221-MOODLE_23_STABLE' of git://github.com/kwiliarty/moodle into MOODLE_23_STABLE 2012-12-10 10:41:20 +13:00
Sam Hemelryk f384987ead Merge branch 'wip-MDL-36906-MOODLE_23_STABLE' of git://github.com/abgreeve/moodle into MOODLE_23_STABLE 2012-12-10 10:33:33 +13:00
Sam Hemelryk 4dd8a25f5d Merge branch 'wip-MDL-36915-MOODLE_23_STABLE' of git://github.com/abgreeve/moodle into MOODLE_23_STABLE 2012-12-10 10:27:07 +13:00
Sam Hemelryk 289f5e85e7 Merge branch 'wip-MDL-37026-MOODLE_23_STABLE' of git://github.com/abgreeve/moodle into MOODLE_23_STABLE 2012-12-10 10:23:35 +13:00
Sam Hemelryk cf0451133f Merge branch 'MDL-33125_23' of git://github.com/aolley/moodle into MOODLE_23_STABLE 2012-12-10 10:19:22 +13:00
Petr Škoda 0f4db4574c MDL-36447 skip file preview test if GD not available 2012-12-09 19:23:52 +01:00
Andreas Grabs a0212e54f5 MDL-34591 - paypal does not allow unenrol 2012-12-09 19:08:17 +01:00
Mary Evans bf5886726f MDL-36978 theme_standardold: fixes misplaced block region check in layout/frontpage.php which, with hindsight should have been fixed in MDL-23226. 2012-12-08 22:53:36 +00:00
Jean-Michel Vedrine f62c457ece MDL-36243 question->questiontext and question->generalfeedback should always be strings 2012-12-08 20:47:32 +01:00
Petr Škoda b03f7353d0 MDL-36737 fix random glossary E_STRICT issue 2012-12-08 14:45:31 +01:00
Petr Škoda 408ef58fed MDL-31424 compare PayPal emails case-insensitively
Credit goes to Chris Follin, thanks!
2012-12-08 13:17:53 +01:00
Petr Škoda df93e51dcf MDL-35456 use HTTP 1.1 for PayPal IPN 2012-12-08 11:59:41 +01:00
Eloy Lafuente (stronk7) 5fa7d72064 weekly release 2.3.3+ 2012-12-08 02:55:28 +01:00
Eloy Lafuente (stronk7) ac10ff2459 Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2012-12-08 02:49:16 +01:00
Petr Škoda 0c1115480e MDL-36936 require phpunit as composer --dev only 2012-12-07 18:21:56 +01:00
Petr Škoda 3b3b7e68ab MDL-36892 delete outdated enrol info 2012-12-07 17:17:21 +01:00
Davo Smith fdf3274ff2 MDL-36538 repository_webdav - save files directly to local filesystem, rather than buffering in memory 2012-12-07 09:25:23 +00:00
AMOS bot 0935f03d7d Automatically generated installer lang files 2012-12-07 00:40:52 +00:00
Sam Hemelryk 467c1ad18d MDL-33448 enrol_manual: Reduced JS get_string calls for the yui widget 2012-12-07 09:52:55 +13:00
Sam Hemelryk 5c5b2999cb MDL-33448 enrol_manual: Reordered things to improve JS performance when enrolling users 2012-12-07 09:52:55 +13:00
Petr Škoda dc5496f2ae MDL-36685 add missing TinyMCE string 2012-12-06 13:18:29 +01:00
Petr Škoda ee152c0104 MDL-36731 fix E_STRICt issue when creating new groups in user upload 2012-12-06 13:16:14 +01:00
Petr Škoda 835ed7014e MDL-36701 add composer to phpunit readme
Thanks Aparup for reminding me!
2012-12-06 13:08:55 +01:00
Petr Škoda 1dd64dae7b MDL-36701 support for PHPUnit installation via Composer packaging system
See http://getcomposer.org/doc/00-intro.md
2012-12-06 13:08:54 +01:00
Adrian Greeve c154ce5a7f MDL-37026 - lib: The function user_can_assign() returns true for admins. 2012-12-06 11:07:20 +08:00
David Mudrák 783fcd0951 MDL-37003 Fix repeated line in update notification email
There was a problem experienced after 2.4.0 release because the version
of the 2.4.0 release was the same as 2.5dev release. So the version
value matched twice in the loop and the line was repeated in the email.
2012-12-06 00:03:25 +01:00
David Mudrák 5800832af8 MDL-36943 Do not notify about already installed updates
Before this patch, the available_update_checker::cron_notifications()
method accessed the availableupdates property. But for plugins, that property
basically contains the most recent version available. So we were missing
the check against the actual version installed.

The fix was simple - obtain available updates via the available_updates()
method that performs the check.
2012-12-05 23:47:54 +01:00
Jason Fowler 56f9a51bc3 MDL-35979 - Commenting - Adding an empty alt attribute to the javascript generated delete icon for comments 2012-12-05 10:04:04 +08:00
Jason Fowler e0971d8b42 MDL-36110 - Blocks - Community finder icon alt attribute is now empty 2012-12-04 15:17:55 +08:00
Jerome Mouneyrac 22e9de0ffd MDL-29805 add REQUIRE_CORRECT_ACCESS define + return error code when AJAX_SCRIPT fails 2012-12-04 13:43:54 +08:00
Eloy Lafuente (stronk7) 99584654ce weekly release 2.3.3+ 2012-12-03 23:26:00 +01:00
Eloy Lafuente (stronk7) b5cef3b9f5 Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2012-12-03 23:24:56 +01:00
Jason Fowler 4769f19ccd MDL-31824 - Calendar - Fixing HTML classes fopr calendar month view - patch provided by Mark Ward 2012-12-03 15:30:20 +08:00
Dan Poltawski b17858f991 Merge branch 'MDL-36914-23' of git://github.com/damyon/moodle into MOODLE_23_STABLE 2012-12-03 14:45:49 +08:00
Jerome Mouneyrac c7a0750b8c MDL-35593 core_webservice_get_site_info returns version number set to PARAM_TEXT and PARAM_FLOAT 2012-12-03 10:17:03 +08:00
AMOS bot b052fa8da1 Automatically generated installer lang files 2012-12-01 00:43:07 +00:00
Tim Hunt 557d890cbb MDL-36954 question bank: stop centring question name.
This was a regression caused by MDL-21625. These CSS changes
put the display back to how it was, while leaving the table
cell as a TD  for accessibility.
2012-11-30 16:33:54 +00:00
Tim Hunt a0a83bd0bf MDL-36942 xml question import: don't add spaces.
They are not necessary anyway, there is a \n character at the end of
each line.

Thanks to Richard Lobb for fining the problem and how to fix it.
2012-11-30 15:53:30 +00:00
Tim Hunt 50c88ad26c MDL-36897 quiz: redirect teachers from summary to review page.
There is already logic like this at the top of attempt.php. If the
teacher arrives at one of these pages for a student's attempt, for
example by clicking a link in the logs, then they should be redirected
to the review page to see the students attempt in its current state.
2012-11-30 15:53:12 +00:00
Tim Hunt 832b653627 MDL-36845 excel export: don't output invalid sheet names.
We should clean any proposed worksheet name, to remove the characters
that Excel does not allow.
2012-11-30 15:52:54 +00:00
Tim Hunt 66a56d2548 MDL-36742 question bank: get rid of flicker during page load.
Thanks to Frédéric Massart for working out the fix to this.
2012-11-30 15:52:34 +00:00
Tim Hunt 5d0f5f861d MDL-36732 Cloze qtype: review marks should not depend on feedback.
The various review options should be independent.
2012-11-30 15:52:14 +00:00
Tim Hunt 94215aa40d MDL-35404 question export: make it work with slasharguments off.
Thanks to Brian King for working out the problem and how to fix it. I am
just committing his patch.
2012-11-30 15:51:33 +00:00
Eloy Lafuente (stronk7) 2a0ec98d6e Satisfy version checker requirements
In stable branches, 8 first digits of the backup version
must be >= than the 8 first digits of the main version.
2012-11-30 13:35:48 +01:00
Eloy Lafuente (stronk7) c5e41c035e weekly release 2.3.3+ 2012-11-30 13:25:29 +01:00
Eloy Lafuente (stronk7) 0139100af5 Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2012-11-30 12:48:29 +01:00
Damyon Wiese 40c1230f1f MDL-36263 Assignment: Do not count submissions of unenrolled users 2012-11-30 15:36:11 +08:00
Jerome Mouneyrac d872b3dc16 MDL-30961 get_course_contents: returned activity name should not be check against PARAM_TEXT, it could be anything 2012-11-30 14:24:22 +08:00
Damyon Wiese 46c678ab33 MDL-36908 Assignment: Additional fixes for preventing empty submissions
Conflicts:

	mod/assign/assignmentplugin.php
	mod/assign/locallib.php
	mod/assign/renderer.php
2012-11-30 12:46:25 +08:00
Dan Poltawski 4d1383bcf4 MDL-36778 course - prevent undefined index warnings
When logged in as a guest the mform didn't set userid.
2012-11-30 12:28:56 +08:00
Dan Poltawski dceeeb29e0 MDL-36887 quiz: reorder upgrade.txt's 2012-11-30 11:44:33 +08:00
Andrew Davis b10a46738a MDL-36761 core_grade:shifted a call to count() out of a loop 2012-11-30 11:09:58 +08:00
Jerome Mouneyrac b64f16a6fb MDL-36773 timezone inconsistency => some number support decimal other don\'t - Original patch author: Nathan Mares 2012-11-30 10:13:25 +08:00
Adrian Greeve 691cd371f0 MDL-36915 - mod/data: A database with no entries no longer displays the export to portfolio button. 2012-11-30 10:09:48 +08:00
Damyon Wiese 4f6e4a5b75 MDL-36835 Assignment: Do not show javascript warning when toggling quickgrading 2012-11-30 10:05:40 +08:00
Dan Poltawski 96b96229f1 Revert "MDL-36838 moodle->mahara mnet SSO failure in FF17"
Firefox have now decided to reverse their UA change (since integration)
and this patch has some minor drawbacks.

This reverts commit 166d3b60d3.
2012-11-30 09:25:10 +08:00
Kevin Wiliarty d3da4d8c1a MDL-35221 mod_feedback: replace checkbox with advcheckbox for all requirable feedback question types 2012-11-29 12:30:20 -05:00
Andrew Robert Nicols be56898193 MDL-36601 Ensure that reports remember all days setting
All Days was set as the nothing value, but this nothing value was used.
Additionally, an insufficient comparison meant that the selecteddate then
became Today.
2012-11-29 09:57:09 +00:00
Damyon Wiese 16d31e2376 MDL-36914: Assignment upgrade. Clean up patch to include outcomes in the upgrade
Thanks to Nathan Mares for reporting this issue.
2012-11-29 16:11:04 +08:00
Nathan Mares fb9c26d092 MDL-36914: Re-associate all grade_item records when upgrading assignments to prevent data loss 2012-11-29 16:11:03 +08:00
Rossiani Wijaya e8dd799570 MDL-36905 accessibility for assignment grading: add label for grading actions and operations select options 2012-11-29 15:11:34 +08:00
Adrian Greeve 85094b8fa4 MDL-36906 - mod_data: Latitude and Logitude error fix.
Thanks to Marcus Boon for providing a patch for this issue.

mod/data/field/latlong/kml.php was missing a context variable.
This was causing an error when trying to download a kml file for
google earth. This variable has now been included.
2012-11-29 14:50:16 +08:00
Dan Marsden 1c951c4649 MDL-36858 SCORM: improve lang help for attempts grading to warn about failed status. 2012-11-29 12:53:51 +08:00
Sam Hemelryk a5af780bce MDL-36878 course: fixed issue with module metadata cache
Credit goes to Sam Chaffee.
2012-11-29 12:57:31 +13:00
Dan Poltawski 78601ea6fe Merge branch 'MDL-36838-FF17-MNETSSO-23' of git://github.com/peterbulmer/moodle into MOODLE_23_STABLE 2012-11-28 17:36:09 +08:00
Dan Poltawski a38a5cefb3 Merge branch 'MDL-35966-23' of git://github.com/damyon/moodle into MOODLE_23_STABLE 2012-11-28 14:15:41 +08:00
Damyon Wiese 8abd89f17e MDL-36591 Assignment - rewrite image urls in online text summaries 2012-11-28 10:19:47 +08:00
Dan Poltawski ab690341b2 Merge branch 'MDL-36752-MOODLE_23_STABLE-2' of git://git.luns.net.uk/moodle into MOODLE_23_STABLE 2012-11-28 09:41:30 +08:00
Andrew Davis 8d3b868068 MDL-36680 core_grade: fixed grade_report::blank_hidden_total() and added unit tests 2012-11-28 09:12:14 +08:00
Sam Hemelryk 0b7a458885 Merge branch 'MDL-36336_MOODLE_23_STABLE' of git://github.com/moodlerooms/moodle into MOODLE_23_STABLE 2012-11-28 11:47:53 +13:00
Sam Hemelryk 01afb8024f Merge branch 'wip-mdl-36238-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2012-11-28 11:41:35 +13:00
Sam Hemelryk 03af084b52 Merge branch 'wip-MDL-34530_MOODLE_23_STABLE' of git://github.com/jason-platts/moodle into MOODLE_23_STABLE 2012-11-28 11:24:56 +13:00
Sam Hemelryk 4254a7495c Merge branch 'MDL-36012-23' of git://github.com/damyon/moodle into MOODLE_23_STABLE 2012-11-28 11:12:30 +13:00
Andrew Robert Nicols 1ca16a9b59 MDL-36752 Be more specific about tooltip selectors 2012-11-27 14:51:05 +00:00
sam marshall 8b6aeff8ea MDL-36808 Completion: Incorrect escaping for activity name in completion tickbox 2012-11-27 12:54:23 +00:00
Aparup Banerjee f6183fa162 Merge branch 'MDL-36865_m23' of git://github.com/markn86/moodle into MOODLE_23_STABLE 2012-11-27 16:26:08 +08:00
Damyon Wiese 2dd7131e1e MDL-35966 Assignment - Localisation issue - use userdate not strftime
This is causing a database error (reported on MySQL) when strftime returns
non-utf8 characters.  This occurs when sending assignment notifications.

This was reported and a solution provided by Chien Wen-Chang(簡文章).
2012-11-27 16:18:15 +08:00
Mark Nelson 47acfc3db9 MDL-36865 filepicker: ensuring the dnd arrow displays in the center of the filepicker for all supported browsers 2012-11-27 16:00:09 +08:00
David Monllao 429a5a5b33 MDL-30899 moodle-enrol-notification Adding focus to non modal windows 2012-11-27 14:57:07 +08:00
David Monllao a3fc03f616 MDL-30899 moodle-enrol-notification Adding H1 to notifications headers 2012-11-27 14:57:07 +08:00
David Monllao 99b8393174 MDL-30899 block_community Changing from overlay to panel references 2012-11-27 14:57:07 +08:00
David Monllao 2a88835d5a MDL-30899 modchooser Changing from overlay to panel references 2012-11-27 14:57:07 +08:00
David Monllao 64cd465f13 MDL-30899 moodle-enrol-notification Replacing Y.Overlay for Y.Panel
References to lightbox are still there to maintain the same
external API but are converted to a modal attribute internally,
same with closeButton, not it uses the Y.Panel close button
2012-11-27 14:57:06 +08:00
Aparup Banerjee 7cde2573d7 Merge branch 'MDL-36841_m23' of git://github.com/markn86/moodle into MOODLE_23_STABLE 2012-11-27 14:56:36 +08:00
Dan Poltawski c9368a425a Merge branch 'MDL-34695_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-11-27 14:23:44 +08:00
Dan Poltawski db7f46ad3a Merge branch 'MDL-36302-23' of git://github.com/damyon/moodle into MOODLE_23_STABLE 2012-11-27 14:10:06 +08:00
Damyon Wiese 520b7df1a5 MDL-36302 course: Set correct URL on settings page for navigation. 2012-11-27 14:04:07 +08:00
Dan Poltawski 89ac5e8782 Merge branch 'MDL-36184-23' of git://github.com/damyon/moodle into MOODLE_23_STABLE 2012-11-27 13:58:29 +08:00
Luke Tucker 42e0a59d5b MDL-34052 assignment - Disable submission and feedback plugins based on assign type when upgrading 2012-11-27 13:39:53 +08:00
Dan Poltawski 148c786f7c Merge branch 'MDL-36752-MOODLE_23_STABLE' of git://git.luns.net.uk/moodle into MOODLE_23_STABLE 2012-11-27 13:32:47 +08:00
Dan Poltawski 6ac0d92d5b Merge branch 'MDL-36806_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-11-27 13:26:46 +08:00
Mark Nelson 487ec8a912 MDL-36841 portfolio: ensure variables in parent function match those of childs to prevent strict standard error 2012-11-27 12:41:58 +08:00
Aparup Banerjee f441ec2564 Merge branch 'wip-mdl-36767-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2012-11-27 12:20:25 +08:00
Rajesh Taneja e006de414e MDL-36767 Administration: user_filter_yesno use different name for sql filter
user_filter_yesno extends user_filter_simpleselect, so if user bulk action filter has both
user_filter_simpleselect and user_filter_yesno, they use the same filter name but counter is
different as they are different classes. Hence using different filter name will avoid confilts
2012-11-27 11:55:57 +08:00
Aparup Banerjee 4505720f3e Merge branch 'MDL-36305-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-11-27 11:53:09 +08:00
Peter Bulmer 166d3b60d3 MDL-36838 moodle->mahara mnet SSO failure in FF17
In MDL-36838 Firefox 17 users are unable to sso from moodle to mahara.

Firefox 17 uses a different user agent (UA) string for Moodle sites than it
does for Mahara or other sites.
This patch relaxes the check which previously required that the UA string
being presented to the SP on landing matched the UA string presented to the IP
when jumping.
Likewise, checks associated with logout calls have been relaxed
2012-11-27 16:19:38 +13:00
Sam Hemelryk 13669ef4d8 Merge branch 'wip-MDL-36795-MOODLE_23_STABLE' of git://github.com/abgreeve/moodle into MOODLE_23_STABLE 2012-11-27 11:21:55 +13:00
Sam Hemelryk 77f3688b2f Merge branch 'MDL-35760_m23' of git://github.com/markn86/moodle into MOODLE_23_STABLE 2012-11-27 11:10:25 +13:00
Sam Hemelryk 4c14127cdb Merge branch 'MDL-36760_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-11-27 10:40:57 +13:00
Paul Nicholls 134ede3476 MDL-27619: Prevent teachers from turning course Outcomes into site-wide ones
Similar to the issue which allowed teachers to create site-wide scales by editing a course-specific scale (MDL-24682), teachers could also promote a course-specific scale to a site-wide (standard) by editing it.  As with MDL-24682, removing the course ID check (leaving just the capability check) prevents this unauthorised creation of site-wide (standard) outcomes.
2012-11-27 09:48:16 +13:00
Adrian Greeve d22b5faae8 MDL-36795 - lib / administration: maxsections now limits the default setting for numsections.
In the default course settings, setting the maximum number topics / weeks  to 0 would not
change the default number of sections on the same page as any other number would.
A more appropriate check has been put in place.

This also incorporates a fix for MDL-28584. The course edit screen now also checks to see
if maxsections is set or numeric. If it is not set or numeric then it defaults to 52.
2012-11-26 15:54:49 +08:00
Adam Olley 63945c8de2 MDL-36828: mod_scorm: Allow deletion of scorm modules if no scorm_scoes data exists 2012-11-26 15:33:16 +10:30
Adam Olley 69b0d17436 MDL-33125: core_backup: Prevent import/activity duplication from duplicating manual grade items 2012-11-26 12:28:00 +10:30
Sam Hemelryk 55f8a9c766 Merge branch 'MDL-36609_m23' of git://github.com/markn86/moodle into MOODLE_23_STABLE 2012-11-26 14:57:57 +13:00
Sam Hemelryk f9fa262aa9 Merge branch 'wip-MDL-36551-MOODLE_23_STABLE' of git://github.com/abgreeve/moodle into MOODLE_23_STABLE 2012-11-26 14:44:27 +13:00
Sam Hemelryk 8f718da437 Merge branch 'MDL-36763-MOODLE_23_STABLE' of git://git.luns.net.uk/moodle into MOODLE_23_STABLE 2012-11-26 11:42:13 +13:00
Sam Hemelryk 703b86eefb Merge branch 'MDL-35963-23' of git://github.com/damyon/moodle into MOODLE_23_STABLE 2012-11-26 10:31:57 +13:00
AMOS bot 2afa81e6de Automatically generated installer lang files 2012-11-24 00:42:52 +00:00
Tim Hunt 36ab57f922 MDL-36806 question files: fix unnecessary require_login call.
quiz_question_pluginfile later does the correct check. Doing this
other check first means you get an error about changing $PAGE->context.
2012-11-23 15:56:46 +00:00
Tim Hunt 500c73ba1e MDL-36760 formslib: fix frozen elements with [] in name.
This was a regression caused by MDL-30845 or, to be precise, the related
issue MDL-32785.

Form elements with names like multipier[0] require special handling,
such as is present in HTML_QuickForm_element::_prepareValue. I have
added equivalent handling to MoodleQuickForm::exportValues. I am afraid
that I could not think of a way to do this reliably without duplicating
code.
2012-11-23 11:31:20 +00:00
Tim Hunt d4eec64dc6 MDL-36650 don't change question timecreated or timemodified on restore. 2012-11-23 10:50:26 +00:00
Mark Nelson 6e726489e7 MDL-36741 mod_forum: fixed SQL that was generated when either timed posts or groups were enabled 2012-11-23 17:03:10 +08:00
Dan Poltawski 5f1d8f2a8f weekly release 2.3.3+ 2012-11-23 15:20:23 +08:00
Dan Poltawski 0d80d00494 Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2012-11-23 15:12:29 +08:00
Dan Poltawski cc00f721d1 Merge branch 'MDL-36204-files-with-spaces_23' of git://github.com/mudrd8mz/moodle into MOODLE_23_STABLE 2012-11-23 11:20:04 +08:00
David Mudrák 045053f641 MDL-36204 Improve moodle1 conversion of embedded files
URL of files referenced in HTML fields via $@FILEPHP$@ are usually
encoded if they were linked using the HTML editor. So if they contain
spaces or plus signs in the name, their URL is encoded to use %20 and
%2B respectively.

Sometimes, for example when the HTML was edited manually in 1.9 without
the editor, non-encoded file names may be put into the HTML text. Such a
link used to work in 1.9 so we add an explicit support for it, too.

However, we do not support partially encoded URLs (e.g. only spaces are
encoded while plus signs are not). Such links are unmodified and will
rely on Legacy files support.
2012-11-23 03:51:55 +01:00
Paul Nicholls d09fffbefb MDL-32880: Add moodle1 backup converter for rss_client block.
Creates a shell rss_client.xml file, which contains no feeds.  This makes it behave the same as restoring a Moodle 1.9 backup into a different 1.9 site - the block is created, its title is as per the original course, but it has no feeds selected (and none are added to the site's feed list).
2012-11-23 09:01:59 +13:00
Paul Nicholls 6eb4a954a6 MDL-32880: Add moodle1 backup converter for html block.
This converter processes the HTML block's content, migrating any referenced files.
2012-11-23 09:01:47 +13:00
Paul Nicholls afaabdaf27 MDL-32880: moodle1 backup converter: add generic block handler
This handler will automatically be used for any block which does not provide its own handler, and should be subclassed by any block which needs to do anything extra (or different).

This commit incorporates contributions from Mike Churchward and API design suggestions from David Mudrak.
2012-11-23 09:01:35 +13:00
Andrew Robert Nicols 0e88b7d94f MDL-35819 Improve performance of help tooltip
Rather than using an event handler for each help link, we add the
'helpicon' class to them and delegate the display function.

In order for this to work, we modify the way that Y.io fetches the help to
use the intended target of the anchor rather than a value provided in the
add call. We also no longer modify this URL and instead add the ajaxurl
parameter to it using the Y.io data parameter.

This change is backwards compatible with people calling it without using
the help icon renderer.
2012-11-22 11:45:34 +00:00
Andrew Robert Nicols 355b4f9dfa MDL-36763 Remove onclick event when creating activity left indent link
The left indent onclick is now handled by a Y.delegate so there is no need
for a seperate event handler.
2012-11-22 10:56:20 +00:00
AMOS bot f4a048d771 Automatically generated installer lang files 2012-11-22 09:05:24 +00:00
Rajesh Taneja aae9605228 MDL-36736 course: Availability information should not be visible for hidden modules
If user is viewing hidden module, availability information should only be visible to
user when editing and module is visible. If editing and module is hidden, then hide
availablilty information as it's invalid.
When user is not editing and activity is hidden then don't add availability information.
2012-11-22 15:13:26 +08:00
Rajesh Taneja c1ac572d9c MDL-36736 course: Availability information will use hide class for hidding 2012-11-22 15:13:26 +08:00
Dan Poltawski 64ae757ee5 Merge branch 'wip-MDL-36668-MOODLE_23_STABLE' of git://github.com/abgreeve/moodle into MOODLE_23_STABLE 2012-11-22 10:33:15 +08:00
Petr Škoda 2b78a895fe MDL-36753 fix invalid sectionid in backup tests 2012-11-21 12:40:17 +01:00
Damyon Wiese dba42c3390 MDL-36712: Assignment grading with custom scale is affected by the current language 2012-11-21 15:35:44 +08:00
Dan Poltawski bbeafdbed1 Merge branch 'w47_MDL-36547_m23_sectiongen' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-11-21 15:34:22 +08:00
Dan Poltawski 105562e682 Merge branch 'MDL-30884_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-11-21 15:19:24 +08:00
Damyon Wiese 85b5e20cde MDL-35963: Assignment - do not accept empty submissions
Conflicts:

	mod/assign/locallib.php
2012-11-21 13:53:34 +08:00
Mark Nelson 03e403414e MDL-35760 filemanager: ensuring the dnd arrow displays in the center of the filemanager for all supported browsers 2012-11-21 12:03:54 +08:00
Damyon Wiese 80238a3cc2 MDL-36012: Assignment, Accessibility - Add user information to alt text for grade icon in grading table.
Conflicts:

	mod/assign/lang/en/assign.php
2012-11-21 12:03:45 +08:00
Dan Poltawski c41d292bce Merge branch 'MDL-35675-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-11-21 12:02:58 +08:00
Dan Poltawski 19d964e07a Merge branch 'MDL-36289-m23' of git://github.com/netspotau/moodle-mod_assign into MOODLE_23_STABLE 2012-11-21 12:01:03 +08:00
Dan Poltawski 8fb4c6e7c3 Merge branch 'MDL-30377_m23' of git://github.com/markn86/moodle into MOODLE_23_STABLE 2012-11-21 11:53:21 +08:00
Dan Poltawski 97c7facfe0 Merge branch 'MDL-36170_m23' of https://github.com/jfilip/moodle into MOODLE_23_STABLE 2012-11-21 11:47:39 +08:00
Rossiani Wijaya 879766ade2 MDL-36549 Lesson module: fixed strict standards errors 2012-11-21 11:32:42 +08:00
Damyon Wiese fbd336f810 MDL-36184: Assignment quickgrading should only update lastmodified dates for modified submissions 2012-11-21 11:14:29 +08:00
Adrian Greeve 0c5bd8349d MDL-36551 - mod_data: Onsite presets now retain the advanced search template.
Presets that were saved to the site would lose the advanced search template when being used.
The previous check was put in place to see if the advanced search template existed or not (presets pre 1.9),
This checked external files properly but not onsite files.

Now checks are being done on both internal and external preset files.
2012-11-21 10:03:00 +08:00
Damyon Wiese 7cc7277064 MDL-36167: Assignment quickgrading fix when there is no grade (ensure feedback still saves)
This patch modifies the previous on by Luke Tucker so that the lastmodified hidden field
is always added to the quickgrading form even if there is no grade for the assignment. This
ensures that the lastmodified checks still work (to prevent teachers overwriting each
others feedback) and feedback is saved when there is no grade.

Conflicts:

	mod/assign/locallib.php
2012-11-21 09:33:14 +08:00
Luke Tucker 9e494233b0 MDL-36167: Update all users in assignment quickgrade form to ensure feedback is saved 2012-11-21 09:31:20 +08:00
Sam Hemelryk fa99332779 Merge branch 'MDL-25552_m23' of git://github.com/markn86/moodle into MOODLE_23_STABLE 2012-11-21 09:00:17 +13:00
Justin Filip 0c665d0063 MDL-36170 - mod/data - Don't display the blocks editing button within table HTML, use a standard API to create it. 2012-11-20 09:04:34 -05:00
Tim Hunt a9258e46ae MDL-30884 quiz: ARIA attribute for the coutdown timer. 2012-11-20 12:14:27 +00:00
Mark Nelson 13f8c06414 MDL-25552 mod_lesson: changing filepicker element to filemanager to allow the deletion of a file 2012-11-20 17:42:28 +08:00
Aparup Banerjee 8626068001 Merge branch 'wip-mdl-36707-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2012-11-20 16:28:00 +08:00
Dan Poltawski 3ec8f9f74a Merge branch 'MDL-33863_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-11-20 16:16:41 +08:00
Dan Poltawski 728b702f4e Merge branch 'MDL-36022-MOODLE_23_STABLE' of git://git.luns.net.uk/moodle into MOODLE_23_STABLE 2012-11-20 16:04:19 +08:00
Dan Poltawski a91c6103f3 Merge branch 'MDL-30731-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-11-20 15:31:38 +08:00
Dan Poltawski 0299d83bc0 Merge branch 'MDL-36646_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-11-20 15:12:00 +08:00
Dan Poltawski 254d78b75f Merge branch 'MDL-36571_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-11-20 15:01:38 +08:00
Frederic Massart ac247b4e84 MDL-30731 calendar: Fixed display of images in event descriptions 2012-11-20 14:59:23 +08:00
Dan Poltawski 21082f7aed Merge branch 'MDL-36548_23' of git://github.com/pauln/moodle into MOODLE_23_STABLE 2012-11-20 14:45:04 +08:00
Dan Poltawski d7aec7342d Merge branch 'wip-MDL-36453-MOODLE_23_STABLE' of git://github.com/abgreeve/moodle into MOODLE_23_STABLE 2012-11-20 14:32:05 +08:00
Frederic Massart f54b485abc MDL-36305 theme: Forum reply button is not removed using MyMobile 2012-11-20 13:57:03 +08:00
Rajesh Taneja 84e47a8a3b MDL-36707 Course: set conditionalhidden class properly, so it doesn't overlap with dimmed class 2012-11-20 13:45:11 +08:00
Dan Poltawski d338726097 Merge branch 'MDL-36204_23' of git://github.com/pauln/moodle into MOODLE_23_STABLE 2012-11-20 12:45:32 +08:00
Dan Poltawski 81d1026d1c Merge branch 'm23_MDL-36168' of git://github.com/danmarsden/moodle into MOODLE_23_STABLE 2012-11-20 12:38:33 +08:00
Dan Poltawski aaf19f1ca3 Merge branch 'MDL-35158-23' of git://github.com/grabs/moodle into MOODLE_23_STABLE 2012-11-20 12:28:59 +08:00
Dan Poltawski 042a79870c Merge branch 'MDL-32865_23' of git://github.com/jmvedrine/moodle into MOODLE_23_STABLE 2012-11-20 12:05:46 +08:00
Dan Poltawski e81c1ad987 Merge branch 'MDL-30871-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-11-20 11:47:26 +08:00
Dan Poltawski 04821272ab Merge branch 'MDL-26439_message_search_23' of git://github.com/andyjdavis/moodle into MOODLE_23_STABLE 2012-11-20 11:20:51 +08:00
Eloy Lafuente (stronk7) c7dcaf1324 Merge branch 'MDL-36683_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-11-20 01:33:49 +01:00
Jean-Michel Vedrine e2ba9a1d70 MDL-33863 question restore: better hint identification.
This is very similar to what MDL-30018 did for question_answers.
2012-11-19 23:29:32 +00:00
Tim Hunt f88bd546eb MDL-36683 qtype match restore: better subq indentification.
This is very similar to what MDL-30018 did for question_answers.
2012-11-19 23:06:16 +00:00
Tim Hunt 4c1a35e34c MDL-36571 qtype multichoice: don't corrupt unicode characters.
It seems that \s includes non-breaking space, and the typical one-byte
representation of that is the same as some parts of multibyte unicode
characters. Therefore, you need to include the u modifer on the regular
expressions.

Also, remove any number of <br /> at the end of the answer.

Thanks to Joseph Rézeau and Jean-Michel Vedrine for working out what the
problem was, and how to fix it.
2012-11-19 18:20:38 +00:00
Dan Poltawski 358f8debde Merge branch 'MDL-36696-MOODLE_23_STABLE' of git://github.com/mrverrall/moodle into MOODLE_23_STABLE 2012-11-20 00:03:56 +08:00
Paul Verrall 4ca66b68f8 MDL-36696 - filepicker: remove superfluous comma
It causes problems with older versions of IE.
2012-11-19 15:48:23 +00:00
Mark Nelson 302808a37f MDL-36609 javascript: ensure HTML element exists before attempting to perform JS functionality 2012-11-19 15:43:12 +08:00
Dan Poltawski 21c255093d Merge branch 'MDL-36655-m23' of git://github.com/netspotau/moodle-mod_assign into MOODLE_23_STABLE 2012-11-19 15:01:54 +08:00
Dan Poltawski 682661d87a Merge branch 'MDL-34204_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-11-19 10:33:31 +08:00
Adrian Greeve 92aa8fe491 MDL-36668 - mod/data: Removed duplicate data_content join in simple searches.
Thanks to Patrick Pollet (patrick.pollet@insa-lyon.fr) for his patch
2012-11-19 10:13:04 +08:00
Sam Hemelryk 99072482f6 Merge branch 'MDL-36589_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-11-19 14:55:22 +13:00
Jean-Michel Vedrine 58310f8845 MDL-32865 CLOZE Questions imported from another course end up with broken image links 2012-11-17 16:45:40 +01:00
Andreas Grabs 8199b8748e MDL-35158 - Random Glossary block returns an error when you delete the linked glossary 2012-11-17 12:03:58 +01:00
Petr Škoda 2ded89d564 MDL-36547 fix section handling in precreate_course_module() 2012-11-17 09:06:12 +01:00
Petr Škoda 996db2f7ac MDL-36547 add test for section number when generating modules 2012-11-17 09:06:11 +01:00
Andrew Robert Nicols a0dd5e65b9 MDL-36640 Logging: Correct testing of log->info.
log->info sometimes contains additional information which can be looked up
from other tables. This should only be attempted if the field is numeric,
but the CSV, XLS, and ODS outputs were not making this check.

There is an additional case for the print_mnet_log function which has not
been covered - this is because the mnet logging is currently broken beyond
the scope of this bug rendering this section untestable. These issues are
raised in MDL-36642.
2012-11-16 11:18:05 +00:00
Dan Poltawski 6548ce0915 weekly release 2.3.3+ 2012-11-16 15:36:21 +08:00
Dan Poltawski 099c7f61da Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2012-11-16 15:32:33 +08:00
Frederic Massart 0b674ddb42 MDL-26660 libraries: Improved XML validation before parsing 2012-11-16 12:14:04 +08:00
Damyon Wiese 62d70e07bc MDL-36655: Assignment - do not add empty group to grading form when there is only one student 2012-11-16 11:00:05 +08:00
AMOS bot 01944afa45 Automatically generated installer lang files 2012-11-15 21:29:40 +00:00
Tim Hunt 877b243fed MDL-36646 unit tests should not assume number of contexts. 2012-11-15 14:36:32 +00:00
Tim Hunt 1b36a754d0 MDL-34204 grader report: static call to non-static method. 2012-11-15 13:47:36 +00:00
Mary Evans a94316030f MDL-36608 theme_sky_high: Fixes missing background in sdmin pages by removing incorrect CSS in style/admin.css 2012-11-15 11:22:31 +00:00
Dan Poltawski 153f5eb3c7 MDL-36061 - remove master-only unit tests 2012-11-15 15:19:28 +08:00
Dan Poltawski 43c6aa915e Merge branch 'MDL-36331_redirect_23' of git://github.com/andyjdavis/moodle into MOODLE_23_STABLE 2012-11-15 14:40:56 +08:00
Dan Poltawski f73a131980 Merge branch 'MDL-36061_userid_23' of git://github.com/andyjdavis/moodle into MOODLE_23_STABLE 2012-11-15 14:32:59 +08:00
Andrew Davis 168a941104 MDL-36061 core_grade: added some unit tests related to refresh_grades() 2012-11-15 11:19:34 +08:00
Matt Switlik 76ab64b07e MDL-36061 gradebook: grade_item->refresh_grades doesn't propagate $userid 2012-11-15 11:19:20 +08:00
Andrew Davis 11694f391e MDL-36331 core_grade: fixed up 2 incorrect default return URLs 2012-11-15 10:48:50 +08:00
Dan Poltawski 05c7471b5c Merge branch 'wip-MDL-36576-m23' of git://github.com/amygroshek/moodle into MOODLE_23_STABLE 2012-11-15 08:57:02 +08:00
Adrian Greeve f6cdef58cb MDL-36453 - mod_data: Presets now load in a Windows environment.
Thanks to Michael de Raadt for this patch.
2012-11-15 08:56:15 +08:00
Mark Nielsen c85164da32 MDL-36607: Improve block drag and drop
* Adding support for subpage
* Adding support for regions that do not start with "side-"
2012-11-14 15:35:14 -08:00
Paul Nicholls bdc69570f5 MDL-36204: moodle1 backup converter: add unit test to cover this issue 2012-11-15 11:16:31 +13:00
Paul Nicholls 0dfc910131 MDL-36204: moodle1 backup converter: urldecode filenames from links
If filenames are not run through urldecode(), those that contain spaces (or other url-encoded characters) will not be handled, as they can't be found in the backup file.
2012-11-15 11:09:58 +13:00
Amy Groshek 02e5529bd5 MDL-36576 - change generalbox classname to generaltable to fix rounded corners on the table background color 2012-11-14 12:32:30 -06:00
Mark Nielsen c9af37c4ab MDL-36336: Prevent duplicate grade items on restore
During restore, lti_add_instance() was being called
and this could generate a grade item.  This would
produce a duplicate item because the restore
process would automatically generate the grade item.
2012-11-14 09:38:42 -08:00
Mark Nelson 73d13b1e43 MDL-30377 forum: do not allow users to view not yet started or expired discussions 2012-11-14 21:01:19 +08:00
Rossiani Wijaya effbfda526 MDL-36589 Lesson Module: set correct answer_jump to next page in question import. 2012-11-14 16:18:00 +08:00
Dan Poltawski f5c074b60a Merge branch 'w46_MDL-36283_m23_cohortmembers' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-11-14 11:26:05 +08:00
Dan Poltawski 89a55cd9e0 Merge branch 'MDL-35358_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-11-14 11:17:00 +08:00
Dan Poltawski 83ee1d4a43 Merge branch 'MDL-26660-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-11-14 10:33:54 +08:00
Dan Poltawski 40a639fa62 Merge branch 'MDL-34520-m23' of git://github.com/ankitagarwal/moodle into MOODLE_23_STABLE 2012-11-14 09:56:03 +08:00
Amy Groshek e0fa7911e2 MDL-36540 - Survey language pack typo 2012-11-14 09:45:51 +08:00
Aparup Banerjee b459897d8f MDL-24736 anotating tinymce changes to readme 2012-11-14 09:41:34 +08:00
Dan Poltawski b1a7fcf2b3 Merge branch 'wip-MDL-36413-MOODLE_23_STABLE' of https://github.com/nicolasconnault/moodle into MOODLE_23_STABLE 2012-11-14 09:18:33 +08:00
Aparup Banerjee 4093331bad Merge branch 'wip_23_mdl-25736_tinymce_spellchecker_frech_issues' of https://github.com/iarenaza/moodle into MOODLE_23_STABLE 2012-11-14 09:13:30 +08:00
Michael Aherne b622d36f13 MDL-34762 course Hide system archetypes from mod chooser 2012-11-14 09:06:33 +08:00
Paul Nicholls 04fa1da315 MDL-36548: Major performance boost to Detail (list) view in file picker
Pass the data (filelist) into the DataTable when initialising it, rather than rendering an empty DataTable and then pushing all of the data into it via addRows().

It's also slightly more efficient to just pass the node in, rather than fetching the node and passing its ID in, as DataTable.render() will just re-select the node if given the ID. [Spotted by Andrew Nicols]
2012-11-14 12:40:08 +13:00
Dan Poltawski 5ac25e0ccb MDL-30545 messaging - remove DISTINCT from union statement 2012-11-13 22:35:35 +08:00
Dan Poltawski 675ea3231c MDL-30545 - messagelib: use $DB->sql_concat() 2012-11-13 15:09:14 +08:00
Dan Poltawski 1f5205b344 MDL-30545 tests - use mod_assignment data generator
mod_assign doens't exist yet..!
2012-11-13 14:13:37 +08:00
Petr Škoda 95f6a022ca MDL-30545/ MDL-36199 reset plugin manager singletons 2012-11-13 14:08:28 +08:00
Dan Poltawski af698e64d2 Merge branch 'w46_MDL-36169_m23_enrolsort' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-11-13 13:40:28 +08:00
Dan Poltawski 3517201801 Merge branch 'MDL-30545_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-11-13 13:22:47 +08:00
Damyon Wiese dc99b426e9 MDL-36509: Assignment grading table rownum offset is wrong by one. 2012-11-13 09:59:11 +08:00
David Mudrák 03d9c19db9 MDL-35422 Fix the confusing submit button label 2012-11-12 10:36:41 +08:00
AMOS bot 073ba0c872 Automatically generated installer lang files 2012-11-12 00:35:49 +00:00
Petr Škoda de06ba901f MDL-36283 use accesscontext when assigning cohort members 2012-11-10 20:44:38 +01:00
Iñaki Arenaza 6cd89c8fd2 MDL-25736 TinyMce Spellchecker French issues
GoogleSpell checker already returns data un UTF8, so there's no need
to use utf8_encode (in fact, using it completely mangles the string).

All credit goes to David Quintal for finding the issue and proposing
the fix.
2012-11-10 20:02:03 +01:00
AMOS bot 9b213b3b5f Automatically generated installer lang files 2012-11-10 00:36:24 +00:00
Petr Škoda 3952908d5c MDL-36169 fix enrolled users sorting by alphanumerical column
Credit goes to Nicholas Koeppen, thanks!
2012-11-09 19:49:57 +01:00
Itamar Tzadok 322965e245 MDL-36433 Forms lib - Added dash escaping to validation script getter. 2012-11-07 19:15:25 -05:00
Nicolas Connault 3522c1dca4 MDL-36413 Added "this->" to exclude variable assignment
The this-> keyword was missing from the $exclude = array() statement.
2012-11-07 14:52:09 +08:00
Frederic Massart 9e5fea4d2d MDL-35675 forms: Remove constrain to viewport for popup calendar 2012-11-05 16:43:22 +08:00
Didier Raboud 0e892b8b65 MDL-35675 forms: Popup calendar is not constrained any more 2012-11-05 16:43:22 +08:00
Matt Petro 2cae75aacc MDL-36025 qtype calculated: Fix handling of "-0" 2012-11-02 12:11:01 -04:00
Huy Hoang 71ff0a2f85 MDL-34695 Wiki Module: add prevention to create new record when userid is 0 2012-11-01 17:42:45 +08:00
Ankit Agarwal 95b877b9b1 MDL-34520 gradebook: Missing droplow setting in gradebook backup 2012-11-01 15:53:23 +08:00
Rajesh Taneja 05d1f6cb9d MDL-36238 Blocks: Logs page close session write, so editing is set before 2012-11-01 12:17:33 +08:00
Jonathon Fowler ec07ff69f2 MDL-34695 wiki: ensure the correct individual subwiki is used/created for a user 2012-11-01 11:49:17 +08:00
Andrew Davis b4a8ab2daa MDL-36162 core_message: removed the unnecessary and confusing course URL parameter as well as fixing the broken breadcrumb 2012-11-01 09:44:51 +08:00
Andrew Davis b32086390f MDL-26439 core_message: switched the message search over to displaying smallmessage instead of fullmessage which contains boilerplate we dont want 2012-11-01 08:47:50 +08:00
Andrew Robert Nicols 1438358686 MDL-36022 AJAX Remove shim on chooser dialogues 2012-10-31 16:39:36 +00:00
Damyon Wiese 5f845b3e66 MDL-36289: Assignment - Prevent feedback files being copied to the next user when using "Save and next".
Conflicts:

	mod/assign/feedback/file/locallib.php
2012-10-31 10:37:42 +08:00
Michael de Raadt 254fef3a9c MDL-35358 Lesson Module: fixed teacher grade essays display when lesson is only available for group members only 2012-10-30 11:05:50 +08:00
Frederic Massart 440dec9c27 MDL-30871 enrol: Flat file does not fail when notifications are enabled 2012-10-30 11:03:44 +08:00
Frederic Massart 1dfcc6eade MDL-26660 libraries: Do not try to parse non-valid XML 2012-10-30 09:23:40 +08:00
Andrew Davis b7b04c2dfe MDL-29733 grade: SQL and comment cleanup 2012-10-30 09:02:41 +08:00
Jonathan Champ c2539fc41d MDL-29733 grade: Query for Identifying Grade Grades to Precreate is SLOW 2012-10-30 09:02:06 +08:00
Rossiani Wijaya 69a6b638a7 MDL-35530 Lesson Module: Add question text to facilitate grading 2012-10-29 17:03:15 +08:00
Dan Marsden 64100280a0 MDL-35737 SCORM: when scorm_parse is called and external scorm manifest use always update the package. 2012-10-26 15:36:03 +13:00
Dan Marsden b7ed59c326 MDL-36168 SCORM: fix reset of course completion settings. 2012-10-25 17:15:38 +13:00
Andrew Davis (andyjdavis) 06661a5541 MDL-30545 messaging prefs: add Andy's extra unit tests. 2012-10-25 10:46:30 +08:00
Tim Hunt 20d10190d7 MDL-30545 messaging prefs: show all relevant message providers.
Some message providers have an associated capability. For example
the mod/quiz:emailconfirmsubmission capability. At the moment,
we only show the preferences for the capabilities that the user
has in the system context.

That does not work for the example capability above. Typically
the capability will be overridden in one quiz, to allow for
Students, and the user will have the Student role in the course
context. Therefore, this message type does not appear on the
preferences page.

This fix corrects the logic, so that all message types that are
to the current user are displayed.
2012-10-25 10:46:17 +08:00
Jason Platts b44d2b689a MDL-34530 Calendar: Can create an event for any group, but cannot view
it
2012-10-23 09:50:23 +01:00
Petr Škoda 2a3af105e6 MDL-35185 import Flowplayer 3.2.14 2012-10-08 19:25:42 +02:00
532 changed files with 11079 additions and 5697 deletions
+5 -1
View File
@@ -25,4 +25,8 @@ CVS
/.project
/.buildpath
/.cache
phpunit.xml
phpunit.xml
# Composer support - only composer.json is to be in git, the rest is installed in each checkout.
composer.phar
composer.lock
/vendor/
+1 -1
View File
@@ -8,7 +8,7 @@ a few minutes:
1) Move the Moodle files into your web directory.
2) Create a single database for Moodle to store all
it's tables in (or choose an existing database).
its tables in (or choose an existing database).
3) Visit your Moodle site with a browser, you should
be taken to the install.php script, which will lead
+1 -1
View File
@@ -28,8 +28,8 @@ require_once(dirname(dirname(__FILE__)) . '/config.php');
require_once($CFG->libdir . '/adminlib.php');
require_once($CFG->libdir . '/pluginlib.php');
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
admin_externalpage_setup('pluginsoverview');
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
$fetchremote = optional_param('fetchremote', false, PARAM_BOOL);
+8 -3
View File
@@ -62,6 +62,9 @@ $return = true;
if (!empty($edit) || !empty($new)) {
if (!empty($edit)) {
$instance = repository::get_instance($edit);
if ($instance->instance->contextid != $context->id) {
throw new repository_exception('nopermissiontoaccess', 'repository');
}
$instancetype = repository::get_type_by_id($instance->options['typeid']);
$classname = 'repository_' . $instancetype->get_typename();
$configs = $instance->get_instance_option_names();
@@ -118,10 +121,12 @@ if (!empty($edit) || !empty($new)) {
$return = true;
} else if (!empty($delete)) {
$instance = repository::get_instance($delete);
//if you try to delete an instance set as readonly, display an error message
if ($instance->readonly) {
throw new repository_exception('readonlyinstance', 'repository');
}
// If you try to delete an instance set as readonly, display an error message.
throw new repository_exception('readonlyinstance', 'repository');
} else if ($instance->instance->contextid != $context->id) {
throw new repository_exception('nopermissiontoaccess', 'repository');
}
if ($sure) {
if ($instance->delete($downloadcontents)) {
$deletedstr = get_string('instancedeleted', 'repository');
+5 -18
View File
@@ -39,7 +39,6 @@ list($options, $unrecognized) = cli_get_params(
'buildconfig' => false,
'buildcomponentconfigs' => false,
'diag' => false,
'phpunitdir' => false,
'run' => false,
'help' => false,
),
@@ -48,24 +47,12 @@ list($options, $unrecognized) = cli_get_params(
)
);
if ($options['phpunitdir']) {
// nasty skodak's hack for testing of future PHPUnit versions - intentionally not documented
if (!file_exists($options['phpunitdir'])) {
cli_error('Invalid custom PHPUnit lib location');
}
$files = scandir($options['phpunitdir']);
foreach ($files as $file) {
$path = $options['phpunitdir'].'/'.$file;
if (!is_dir($path) or strpos($file, '.') === 0) {
continue;
}
ini_set('include_path', $path . PATH_SEPARATOR . ini_get('include_path'));
}
unset($files);
unset($file);
if (file_exists(__DIR__.'/../../../../vendor/autoload.php')) {
// Composer packages present.
require_once(__DIR__.'/../../../../vendor/autoload.php');
}
// verify PHPUnit libs are loaded
// Verify PHPUnit libs can be loaded.
if (!include_once('PHPUnit/Autoload.php')) {
phpunit_bootstrap_error(PHPUNIT_EXITCODE_PHPUNITMISSING);
}
@@ -75,7 +62,7 @@ if ($options['run']) {
unset($unrecognized);
foreach ($_SERVER['argv'] as $k=>$v) {
if (strpos($v, '--run') === 0 or strpos($v, '--phpunitdir') === 0) {
if (strpos($v, '--run') === 0) {
unset($_SERVER['argv'][$k]);
$_SERVER['argc'] = $_SERVER['argc'] - 1;
}
+10 -2
View File
@@ -285,7 +285,11 @@ if ($formdata = $mform2->is_cancelled()) {
$userserrors++;
continue;
}
if ($user->username !== clean_param($user->username, PARAM_USERNAME)) {
$upt->track('status', get_string('invalidusername', 'error', 'username'), 'error');
$upt->track('username', $errorstr, 'error');
$userserrors++;
}
if ($existinguser = $DB->get_record('user', array('username'=>$user->username, 'mnethostid'=>$CFG->mnet_localhost_id))) {
$upt->track('id', $existinguser->id, 'normal', false);
}
@@ -900,7 +904,11 @@ if ($formdata = $mform2->is_cancelled()) {
$newgroupdata = new stdClass();
$newgroupdata->name = $addgroup;
$newgroupdata->courseid = $ccache[$shortname]->id;
if ($ccache[$shortname]->groups[$addgroup]->id = groups_create_group($newgroupdata)){
$newgroupdata->description = '';
$gid = groups_create_group($newgroupdata);
if ($gid){
$ccache[$shortname]->groups[$addgroup] = new stdClass();
$ccache[$shortname]->groups[$addgroup]->id = $gid;
$ccache[$shortname]->groups[$addgroup]->name = $newgroupdata->name;
} else {
$upt->track('enrolments', get_string('unknowngroup', 'error', s($addgroup)), 'error');
@@ -68,7 +68,7 @@ $string['usersrenamed'] = 'Users renamed';
$string['usersskipped'] = 'Users skipped';
$string['usersupdated'] = 'Users updated';
$string['usersweakpassword'] = 'Users having a weak password';
$string['uubulk'] = 'Select for bulk operations';
$string['uubulk'] = 'Select for bulk user actions';
$string['uubulkall'] = 'All users';
$string['uubulknew'] = 'New users';
$string['uubulkupdated'] = 'Updated users';
+27 -16
View File
@@ -177,16 +177,39 @@
$$column = "<a href=\"user.php?sort=$column&amp;dir=$columndir\">".$string[$column]."</a>$columnicon";
}
if ($sort == "name") {
$sort = "firstname";
$override = new stdClass();
$override->firstname = 'firstname';
$override->lastname = 'lastname';
$fullnamelanguage = get_string('fullnamedisplay', '', $override);
if (($CFG->fullnamedisplay == 'firstname lastname') or
($CFG->fullnamedisplay == 'firstname') or
($CFG->fullnamedisplay == 'language' and $fullnamelanguage == 'firstname lastname' )) {
$fullnamedisplay = "$firstname / $lastname";
if ($sort == "name") { // If sort has already been set to something else then ignore.
$sort = "firstname";
}
} else { // ($CFG->fullnamedisplay == 'language' and $fullnamelanguage == 'lastname firstname').
$fullnamedisplay = "$lastname / $firstname";
if ($sort == "name") { // This should give the desired sorting based on fullnamedisplay.
$sort = "lastname";
}
}
list($extrasql, $params) = $ufiltering->get_sql_filter();
$users = get_users_listing($sort, $dir, $page*$perpage, $perpage, '', '', '',
$extrasql, $params, $context);
$usercount = get_users(false);
$usersearchcount = get_users(false, '', false, null, "", '', '', '', '', '*', $extrasql, $params);
// Exclude guest user from list.
$noguestsql = '';
if (!empty($extrasql)) {
$noguestsql .= ' AND';
}
$noguestsql .= " id <> :guestid";
$params['guestid'] = $CFG->siteguest;
$users = get_users_listing($sort, $dir, $page*$perpage, $perpage, '', '', '',
$extrasql.$noguestsql, $params, $context);
if ($extrasql !== '') {
echo $OUTPUT->heading("$usersearchcount / $usercount ".get_string('users'));
$usercount = $usersearchcount;
@@ -231,18 +254,6 @@
$users = $nusers;
}
$override = new stdClass();
$override->firstname = 'firstname';
$override->lastname = 'lastname';
$fullnamelanguage = get_string('fullnamedisplay', '', $override);
if (($CFG->fullnamedisplay == 'firstname lastname') or
($CFG->fullnamedisplay == 'firstname') or
($CFG->fullnamedisplay == 'language' and $fullnamelanguage == 'firstname lastname' )) {
$fullnamedisplay = "$firstname / $lastname";
} else { // ($CFG->fullnamedisplay == 'language' and $fullnamelanguage == 'lastname firstname')
$fullnamedisplay = "$lastname / $firstname";
}
$table = new html_table();
$table->head = array ();
$table->align = array();
+2 -2
View File
@@ -81,7 +81,7 @@ function user_download_ods($fields) {
$worksheet = array();
$worksheet[0] =& $workbook->add_worksheet('');
$worksheet[0] = $workbook->add_worksheet('');
$col = 0;
foreach ($fields as $fieldname) {
$worksheet[0]->write(0, $col, $fieldname);
@@ -119,7 +119,7 @@ function user_download_xls($fields) {
$worksheet = array();
$worksheet[0] =& $workbook->add_worksheet('');
$worksheet[0] = $workbook->add_worksheet('');
$col = 0;
foreach ($fields as $fieldname) {
$worksheet[0]->write(0, $col, $fieldname);
+1
View File
@@ -163,6 +163,7 @@ class external_service_functions_form extends moodleform {
$mform->addElement('searchableselector', 'fids', get_string('name'),
$functions, array('multiple'));
$mform->addRule('fids', get_string('required'), 'required', null, 'client');
$mform->addElement('hidden', 'id');
$mform->setType('id', PARAM_INT);
+1 -1
View File
@@ -685,7 +685,7 @@ class auth_plugin_ldap extends auth_plugin_base {
/// User removal
// Find users in DB that aren't in ldap -- to be removed!
// this is still not as scalable (but how often do we mass delete?)
if ($this->config->removeuser !== AUTH_REMOVEUSER_KEEP) {
if ($this->config->removeuser != AUTH_REMOVEUSER_KEEP) {
$sql = 'SELECT u.*
FROM {user} u
LEFT JOIN {tmp_extuser} e ON (u.username = e.username AND u.mnethostid = e.mnethostid)
+1 -2
View File
@@ -40,8 +40,7 @@ if ($show_instructions) {
</form>
<p>
<?php
print_string("auth_shibboleth_contact_administrator", "auth_shibboleth");
echo '<a href="mailto:'.get_admin()->email.'"> Moodle Administrator</a>.';
print_string("auth_shib_contact_administrator", "auth_shibboleth", get_admin()->email);
?>
</p>
</div>
@@ -25,6 +25,7 @@
$string['auth_shib_auth_method'] = 'Authentication method name';
$string['auth_shib_auth_method_description'] = 'Provide a name for the Shibboleth authentication method that is familiar to your users. This could be the name of your Shibboleth federation, e.g. <tt>SWITCHaai Login</tt> or <tt>InCommon Login</tt> or similar.';
$string['auth_shib_contact_administrator'] = 'In case you are not associated with the given organizations and you need access to a course on this server, please contact the <a href="mailto:{$a}">Moodle Administrator</a>.';
$string['auth_shibboleth_contact_administrator'] = 'In case you are not associated with the given organizations and you need access to a course on this server, please contact the';
$string['auth_shibbolethdescription'] = 'Using this method users are created and authenticated using <a href="http://shibboleth.internet2.edu/">Shibboleth</a>.<br />Be sure to read the <a href="../auth/shibboleth/README.txt">README</a> for Shibboleth on how to set up your Moodle with Shibboleth';
$string['auth_shibboleth_errormsg'] = 'Please select the organization you are member of!';
+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 = 2012061800;
const VERSION = 2012062500;
const RELEASE = '2.3';
}
+1 -1
View File
@@ -98,7 +98,7 @@ $PAGE->navbar->add($backup->get_stage_name());
$renderer = $PAGE->get_renderer('core','backup');
echo $OUTPUT->header();
if ($backup->enforce_changed_dependencies()) {
echo $renderer->dependency_notification(get_string('dependenciesenforced','backup'));
debugging('Your settings have been altered due to unmet dependencies', DEBUG_DEVELOPER);
}
echo $renderer->progress_bar($backup->get_progress_bar());
echo $backup->display($renderer);
+1 -1
View File
@@ -33,7 +33,7 @@ $currentcontext = required_param('currentcontext', PARAM_INT);
// file parameters
$component = optional_param('component', null, PARAM_COMPONENT);
$filearea = optional_param('filearea', null, PARAM_AREA);
$returnurl = optional_param('returnurl', null, PARAM_URL);
$returnurl = optional_param('returnurl', null, PARAM_LOCALURL);
list($context, $course, $cm) = get_context_info_array($currentcontext);
$filecontext = get_context_instance_by_id($contextid);
+149 -3
View File
@@ -88,10 +88,13 @@ abstract class moodle1_handlers_factory {
foreach ($plugins as $name => $dir) {
$handlerfile = $dir . '/backup/moodle1/lib.php';
$handlerclass = "moodle1_{$type}_{$name}_handler";
if (!file_exists($handlerfile)) {
if (file_exists($handlerfile)) {
require_once($handlerfile);
} elseif ($type == 'block') {
$handlerclass = "moodle1_block_generic_handler";
} else {
continue;
}
require_once($handlerfile);
if (!class_exists($handlerclass)) {
throw new moodle1_convert_exception('missing_handler_class', $handlerclass);
@@ -1037,6 +1040,24 @@ class moodle1_question_bank_handler extends moodle1_xml_handler {
/** @var array holds the instances of qtype specific conversion handlers */
private $qtypehandlers = null;
/**
* Return the file manager instance used.
*
* @return moodle1_file_manager
*/
public function get_file_manager() {
return $this->fileman;
}
/**
* Returns the information about the question category context being currently parsed
*
* @return array with keys contextid, contextlevel and contextinstanceid
*/
public function get_current_category_context() {
return $this->currentcategory;
}
/**
* Registers path that are not qtype-specific
*/
@@ -1188,6 +1209,17 @@ class moodle1_question_bank_handler extends moodle1_xml_handler {
$data['generalfeedbackformat'] = FORMAT_HTML;
}
// Migrate files in questiontext.
$this->fileman->contextid = $this->currentcategory['contextid'];
$this->fileman->component = 'question';
$this->fileman->filearea = 'questiontext';
$this->fileman->itemid = $data['id'];
$data['questiontext'] = moodle1_converter::migrate_referenced_files($data['questiontext'], $this->fileman);
// Migrate files in generalfeedback.
$this->fileman->filearea = 'generalfeedback';
$data['generalfeedback'] = moodle1_converter::migrate_referenced_files($data['generalfeedback'], $this->fileman);
// replay the upgrade step 2010080901 - updating question image
if (!empty($data['image'])) {
if (textlib::substr(textlib::strtolower($data['image']), 0, 7) == 'http://') {
@@ -1733,12 +1765,41 @@ abstract class moodle1_qtype_handler extends moodle1_plugin_handler {
foreach ($answers as $elementname => $elements) {
foreach ($elements as $element) {
$answer = $this->convert_answer($element, $qtype);
// Migrate images in answertext.
if ($answer['answerformat'] == FORMAT_HTML) {
$answer['answertext'] = $this->migrate_files($answer['answertext'], 'question', 'answer', $answer['id']);
}
// Migrate images in feedback.
if ($answer['feedbackformat'] == FORMAT_HTML) {
$answer['feedback'] = $this->migrate_files($answer['feedback'], 'question', 'answerfeedback', $answer['id']);
}
$this->write_xml('answer', $answer, array('/answer/id'));
}
}
$this->xmlwriter->end_tag('answers');
}
/**
* Migrate files belonging to one qtype plugin text field.
*
* @param array $text the html fragment containing references to files
* @param string $component the component for restored files
* @param string $filearea the file area for restored files
* @param int $itemid the itemid for restored files
*
* @return string the text for this field, after files references have been processed
*/
protected function migrate_files($text, $component, $filearea, $itemid) {
$context = $this->qbankhandler->get_current_category_context();
$fileman = $this->qbankhandler->get_file_manager();
$fileman->contextid = $context['contextid'];
$fileman->component = $component;
$fileman->filearea = $filearea;
$fileman->itemid = $itemid;
$text = moodle1_converter::migrate_referenced_files($text, $fileman);
return $text;
}
/**
* Writes the grouped numerical_units structure
*
@@ -1897,7 +1958,8 @@ abstract class moodle1_qtype_handler extends moodle1_plugin_handler {
if ($qtype !== 'multichoice') {
$new['answerformat'] = FORMAT_PLAIN;
} else {
$new['answerformat'] = FORMAT_MOODLE;
$new['answertext'] = text_to_html($new['answertext'], false, false, true);
$new['answerformat'] = FORMAT_HTML;
}
if ($CFG->texteditors !== 'textarea') {
@@ -1989,9 +2051,93 @@ abstract class moodle1_resource_successor_handler extends moodle1_mod_handler {
*/
abstract class moodle1_block_handler extends moodle1_plugin_handler {
public function get_paths() {
$blockname = strtoupper($this->pluginname);
return array(
new convert_path('block', "/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK/{$blockname}"),
);
}
public function process_block(array $data) {
$newdata = $this->convert_common_block_data($data);
$this->write_block_xml($newdata, $data);
$this->write_inforef_xml($newdata, $data);
$this->write_roles_xml($newdata, $data);
return $data;
}
protected function convert_common_block_data(array $olddata) {
$newdata = array();
$newdata['blockname'] = $olddata['name'];
$newdata['parentcontextid'] = $this->converter->get_contextid(CONTEXT_COURSE, 0);
$newdata['showinsubcontexts'] = 0;
$newdata['pagetypepattern'] = $olddata['pagetype'].='-*';
$newdata['subpagepattern'] = null;
$newdata['defaultregion'] = ($olddata['position']=='l')?'side-pre':'side-post';
$newdata['defaultweight'] = $olddata['weight'];
$newdata['configdata'] = $this->convert_configdata($olddata);
return $newdata;
}
protected function convert_configdata(array $olddata) {
return $olddata['configdata'];
}
protected function write_block_xml($newdata, $data) {
$contextid = $this->converter->get_contextid(CONTEXT_BLOCK, $data['id']);
$this->open_xml_writer("course/blocks/{$data['name']}_{$data['id']}/block.xml");
$this->xmlwriter->begin_tag('block', array('id' => $data['id'], 'contextid' => $contextid));
foreach ($newdata as $field => $value) {
$this->xmlwriter->full_tag($field, $value);
}
$this->xmlwriter->begin_tag('block_positions');
$this->xmlwriter->begin_tag('block_position', array('id' => 1));
$this->xmlwriter->full_tag('contextid', $newdata['parentcontextid']);
$this->xmlwriter->full_tag('pagetype', $data['pagetype']);
$this->xmlwriter->full_tag('subpage', '');
$this->xmlwriter->full_tag('visible', $data['visible']);
$this->xmlwriter->full_tag('region', $newdata['defaultregion']);
$this->xmlwriter->full_tag('weight', $newdata['defaultweight']);
$this->xmlwriter->end_tag('block_position');
$this->xmlwriter->end_tag('block_positions');
$this->xmlwriter->end_tag('block');
$this->close_xml_writer();
}
protected function write_inforef_xml($newdata, $data) {
$this->open_xml_writer("course/blocks/{$data['name']}_{$data['id']}/inforef.xml");
$this->xmlwriter->begin_tag('inforef');
// Subclasses may provide inforef contents if needed
$this->xmlwriter->end_tag('inforef');
$this->close_xml_writer();
}
protected function write_roles_xml($newdata, $data) {
// This is an empty shell, as the moodle1 converter doesn't handle user data.
$this->open_xml_writer("course/blocks/{$data['name']}_{$data['id']}/roles.xml");
$this->xmlwriter->begin_tag('roles');
$this->xmlwriter->full_tag('role_overrides', '');
$this->xmlwriter->full_tag('role_assignments', '');
$this->xmlwriter->end_tag('roles');
$this->close_xml_writer();
}
}
/**
* Base class for block generic handler
*/
class moodle1_block_generic_handler extends moodle1_block_handler {
}
/**
* Base class for the activity modules' subplugins
*/
+26 -7
View File
@@ -254,7 +254,7 @@ class moodle1_converter extends base_converter {
$path = '/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK/' . $this->currentblock;
} else if (strpos($path, '/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK') === 0) {
$path = str_replace('/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK', '/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK/' . $this->currentmod, $path);
$path = str_replace('/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK', '/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK/' . $this->currentblock, $path);
}
if ($path !== $data['path']) {
@@ -350,12 +350,12 @@ class moodle1_converter extends base_converter {
}
if ($path === '/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK') {
$this->currentmod = null;
$this->currentblock = null;
$forbidden = true;
} else if (strpos($path, '/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK') === 0) {
// expand the BLOCK paths so that they contain the module name
$path = str_replace('/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK', '/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK/' . $this->currentmod, $path);
$path = str_replace('/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK', '/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK/' . $this->currentblock, $path);
}
if (empty($this->pathelements[$path])) {
@@ -397,7 +397,7 @@ class moodle1_converter extends base_converter {
$path = '/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK/' . $this->currentblock;
} else if (strpos($path, '/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK') === 0) {
$path = str_replace('/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK', '/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK/' . $this->currentmod, $path);
$path = str_replace('/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK', '/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK/' . $this->currentblock, $path);
}
if (empty($this->pathelements[$path])) {
@@ -640,7 +640,10 @@ class moodle1_converter extends base_converter {
return $files;
}
foreach ($matches[2] as $match) {
$files[] = str_replace(array('$@FILEPHP@$', '$@SLASH@$', '$@FORCEDOWNLOAD@$'), array('', '/', ''), $match);
$file = str_replace(array('$@FILEPHP@$', '$@SLASH@$', '$@FORCEDOWNLOAD@$'), array('', '/', ''), $match);
if ($file === clean_param($file, PARAM_PATH)) {
$files[] = rawurldecode($file);
}
}
return array_unique($files);
@@ -657,9 +660,16 @@ class moodle1_converter extends base_converter {
public static function rewrite_filephp_usage($text, array $files) {
foreach ($files as $file) {
// Expect URLs properly encoded by default.
$parts = explode('/', $file);
$encoded = implode('/', array_map('rawurlencode', $parts));
$fileref = '$@FILEPHP@$'.str_replace('/', '$@SLASH@$', $encoded);
$text = str_replace($fileref.'$@FORCEDOWNLOAD@$', '@@PLUGINFILE@@'.$encoded.'?forcedownload=1', $text);
$text = str_replace($fileref, '@@PLUGINFILE@@'.$encoded, $text);
// Add support for URLs without any encoding.
$fileref = '$@FILEPHP@$'.str_replace('/', '$@SLASH@$', $file);
$text = str_replace($fileref.'$@FORCEDOWNLOAD@$', '@@PLUGINFILE@@'.$file.'?forcedownload=1', $text);
$text = str_replace($fileref, '@@PLUGINFILE@@'.$file, $text);
$text = str_replace($fileref.'$@FORCEDOWNLOAD@$', '@@PLUGINFILE@@'.$encoded.'?forcedownload=1', $text);
$text = str_replace($fileref, '@@PLUGINFILE@@'.$encoded, $text);
}
return $text;
@@ -1201,6 +1211,10 @@ class moodle1_file_manager implements loggable {
$sourcefullpath = $this->basepath.'/'.$sourcepath;
if ($sourcefullpath !== clean_param($sourcefullpath, PARAM_PATH)) {
throw new moodle1_convert_exception('file_invalid_path', $sourcefullpath);
}
if (!is_readable($sourcefullpath)) {
throw new moodle1_convert_exception('file_not_readable', $sourcefullpath);
}
@@ -1260,6 +1274,11 @@ class moodle1_file_manager implements loggable {
*/
public function migrate_directory($rootpath, $relpath='/') {
// Check the trailing slash in the $rootpath
if (substr($rootpath, -1) === '/') {
$rootpath = substr($rootpath, 0, strlen($rootpath) - 1);
}
if (!file_exists($this->basepath.'/'.$rootpath.$relpath)) {
return array();
}
+105 -8
View File
@@ -266,13 +266,15 @@ class moodle1_converter_testcase extends advanced_testcase {
$fileids = $fileman->get_fileids();
$this->assertEquals(gettype($fileids), 'array');
$this->assertEquals(0, count($fileids));
// try to migrate a non-existing directory
$returned = $fileman->migrate_directory('not/existing/directory');
$this->assertEquals(gettype($returned), 'array');
$this->assertEquals(0, count($returned));
$fileids = $fileman->get_fileids();
$this->assertEquals(gettype($fileids), 'array');
$this->assertEquals(0, count($fileids));
// try to migrate an invalid file
$fileman->itemid = 1;
$thrown = false;
try {
$fileman->migrate_file('/../../../../../../../../../../../../../../etc/passwd');
} catch (moodle1_convert_exception $e) {
$thrown = true;
}
$this->assertTrue($thrown);
// migrate a single file
$fileman->itemid = 4;
$fileman->migrate_file('moddata/unittest/4/icon.gif');
@@ -305,6 +307,70 @@ class moodle1_converter_testcase extends advanced_testcase {
$converter->drop_stash_storage();
}
public function test_migrate_directory() {
$this->resetAfterTest(true);
// Set-up the file manager.
$converter = convert_factory::get_converter('moodle1', $this->tempdir);
$converter->create_stash_storage();
$contextid = $converter->get_contextid(CONTEXT_MODULE, 32);
$fileman = $converter->get_file_manager($contextid, 'mod_unittest', 'testarea');
// This fileman has not converted anything yet.
$fileids = $fileman->get_fileids();
$this->assertEquals(gettype($fileids), 'array');
$this->assertEquals(0, count($fileids));
// Try to migrate a non-existing directory.
$returned = $fileman->migrate_directory('not/existing/directory');
$this->assertEquals(gettype($returned), 'array');
$this->assertEquals(0, count($returned));
$fileids = $fileman->get_fileids();
$this->assertEquals(gettype($fileids), 'array');
$this->assertEquals(0, count($fileids));
// Try to migrate whole course_files.
$returned = $fileman->migrate_directory('course_files');
$this->assertEquals(gettype($returned), 'array');
$this->assertEquals(4, count($returned)); // Two files, two directories.
$fileids = $fileman->get_fileids();
$this->assertEquals(gettype($fileids), 'array');
$this->assertEquals(4, count($fileids));
$subdir = substr($this->iconhash, 0, 2);
$this->assertTrue(is_file($converter->get_workdir_path().'/files/'.$subdir.'/'.$this->iconhash));
// Check the file records.
$files = array();
$filerecordids = $converter->get_stash_itemids('files');
foreach ($filerecordids as $filerecordid) {
$filerecord = $converter->get_stash('files', $filerecordid);
$files[$filerecord['filepath'].$filerecord['filename']] = $filerecord;
}
$this->assertEquals('array', gettype($files['/.']));
$this->assertEquals('array', gettype($files['/file1.gif']));
$this->assertEquals('array', gettype($files['/sub1/.']));
$this->assertEquals('array', gettype($files['/sub1/file2.gif']));
$this->assertEquals(sha1(''), $files['/.']['contenthash']);
$this->assertEquals(sha1(''), $files['/sub1/.']['contenthash']);
$this->assertEquals($this->iconhash, $files['/file1.gif']['contenthash']);
$this->assertEquals($this->iconhash, $files['/sub1/file2.gif']['contenthash']);
$converter->drop_stash_storage();
}
public function test_migrate_directory_with_trailing_slash() {
$this->resetAfterTest(true);
// Set-up the file manager.
$converter = convert_factory::get_converter('moodle1', $this->tempdir);
$converter->create_stash_storage();
$contextid = $converter->get_contextid(CONTEXT_MODULE, 32);
$fileman = $converter->get_file_manager($contextid, 'mod_unittest', 'testarea');
// Try to migrate a subdirectory passed with the trailing slash.
$returned = $fileman->migrate_directory('course_files/sub1/');
$this->assertEquals(gettype($returned), 'array');
$this->assertEquals(2, count($returned)); // One file, one directory.
$converter->drop_stash_storage();
}
public function test_convert_path() {
$path = new convert_path('foo_bar', '/ROOT/THINGS/FOO/BAR');
$this->assertEquals('foo_bar', $path->get_name());
@@ -435,6 +501,8 @@ class moodle1_converter_testcase extends advanced_testcase {
$text = 'This is a text containing links to file.php
as it is parsed from the backup file. <br /><br /><img border="0" width="110" vspace="0" hspace="0" height="92" title="News" alt="News" src="$@FILEPHP@$$@SLASH@$pics$@SLASH@$news.gif" /><a href="$@FILEPHP@$$@SLASH@$pics$@SLASH@$news.gif$@FORCEDOWNLOAD@$">download image</a><br />
<div><a href=\'$@FILEPHP@$/../../../../../../../../../../../../../../../etc/passwd\'>download passwords</a></div>
<div><a href=\'$@FILEPHP@$$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$etc$@SLASH@$shadow\'>download shadows</a></div>
<br /><a href=\'$@FILEPHP@$$@SLASH@$MANUAL.DOC$@FORCEDOWNLOAD@$\'>download manual</a><br />';
$files = moodle1_converter::find_referenced_files($text);
@@ -443,12 +511,41 @@ as it is parsed from the backup file. <br /><br /><img border="0" width="110" vs
$this->assertTrue(in_array('/pics/news.gif', $files));
$this->assertTrue(in_array('/MANUAL.DOC', $files));
$text = moodle1_converter::rewrite_filephp_usage($text, array('/pics/news.gif', '/another/file/notused.txt'), $files);
$text = moodle1_converter::rewrite_filephp_usage($text, array('/pics/news.gif', '/another/file/notused.txt'));
$this->assertEquals($text, 'This is a text containing links to file.php
as it is parsed from the backup file. <br /><br /><img border="0" width="110" vspace="0" hspace="0" height="92" title="News" alt="News" src="@@PLUGINFILE@@/pics/news.gif" /><a href="@@PLUGINFILE@@/pics/news.gif?forcedownload=1">download image</a><br />
<div><a href=\'$@FILEPHP@$/../../../../../../../../../../../../../../../etc/passwd\'>download passwords</a></div>
<div><a href=\'$@FILEPHP@$$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$etc$@SLASH@$shadow\'>download shadows</a></div>
<br /><a href=\'$@FILEPHP@$$@SLASH@$MANUAL.DOC$@FORCEDOWNLOAD@$\'>download manual</a><br />');
}
public function test_referenced_files_urlencoded() {
$text = 'This is a text containing links to file.php
as it is parsed from the backup file. <br /><br /><img border="0" width="110" vspace="0" hspace="0" height="92" title="News" alt="News" src="$@FILEPHP@$$@SLASH@$pics$@SLASH@$news.gif" /><a href="$@FILEPHP@$$@SLASH@$pics$@SLASH@$news.gif$@FORCEDOWNLOAD@$">no space</a><br />
<br /><a href=\'$@FILEPHP@$$@SLASH@$pics$@SLASH@$news%20with%20spaces.gif$@FORCEDOWNLOAD@$\'>with urlencoded spaces</a><br />
<a href="$@FILEPHP@$$@SLASH@$illegal%20pics%2Bmovies$@SLASH@$romeo%2Bjuliet.avi">Download the full AVI for free! (space and plus encoded)</a>
<a href="$@FILEPHP@$$@SLASH@$illegal pics+movies$@SLASH@$romeo+juliet.avi">Download the full AVI for free! (none encoded)</a>
<a href="$@FILEPHP@$$@SLASH@$illegal%20pics+movies$@SLASH@$romeo+juliet.avi">Download the full AVI for free! (only space encoded)</a>
<a href="$@FILEPHP@$$@SLASH@$illegal pics%2Bmovies$@SLASH@$romeo%2Bjuliet.avi">Download the full AVI for free! (only plus)</a>';
$files = moodle1_converter::find_referenced_files($text);
$this->assertEquals(gettype($files), 'array');
$this->assertEquals(3, count($files));
$this->assertTrue(in_array('/pics/news.gif', $files));
$this->assertTrue(in_array('/pics/news with spaces.gif', $files));
$this->assertTrue(in_array('/illegal pics+movies/romeo+juliet.avi', $files));
$text = moodle1_converter::rewrite_filephp_usage($text, $files);
$this->assertEquals('This is a text containing links to file.php
as it is parsed from the backup file. <br /><br /><img border="0" width="110" vspace="0" hspace="0" height="92" title="News" alt="News" src="@@PLUGINFILE@@/pics/news.gif" /><a href="@@PLUGINFILE@@/pics/news.gif?forcedownload=1">no space</a><br />
<br /><a href=\'@@PLUGINFILE@@/pics/news%20with%20spaces.gif?forcedownload=1\'>with urlencoded spaces</a><br />
<a href="@@PLUGINFILE@@/illegal%20pics%2Bmovies/romeo%2Bjuliet.avi">Download the full AVI for free! (space and plus encoded)</a>
<a href="@@PLUGINFILE@@/illegal%20pics%2Bmovies/romeo%2Bjuliet.avi">Download the full AVI for free! (none encoded)</a>
<a href="$@FILEPHP@$$@SLASH@$illegal%20pics+movies$@SLASH@$romeo+juliet.avi">Download the full AVI for free! (only space encoded)</a>
<a href="$@FILEPHP@$$@SLASH@$illegal pics%2Bmovies$@SLASH@$romeo%2Bjuliet.avi">Download the full AVI for free! (only plus)</a>', $text);
}
public function test_question_bank_conversion() {
global $CFG;
+5 -3
View File
@@ -11,6 +11,8 @@ require_once($CFG->dirroot . '/backup/util/ui/import_extensions.php');
$courseid = required_param('id', PARAM_INT);
// The id of the course we are importing FROM (will only be set if past first stage
$importcourseid = optional_param('importid', false, PARAM_INT);
// We just want to check if a search has been run. True if anything is there.
$searchcourses = optional_param('searchcourses', false, PARAM_BOOL);
// The target method for the restore (adding or deleting)
$restoretarget = optional_param('target', backup::TARGET_CURRENT_ADDING, PARAM_INT);
@@ -36,7 +38,7 @@ $PAGE->set_pagelayout('incourse');
$renderer = $PAGE->get_renderer('core','backup');
// Check if we already have a import course id
if ($importcourseid === false) {
if ($importcourseid === false || $searchcourses) {
// Obviously not... show the selector so one can be chosen
$url = new moodle_url('/backup/import.php', array('id'=>$courseid));
$search = new import_course_search(array('url'=>$url));
@@ -154,10 +156,10 @@ $PAGE->navbar->add($backup->get_stage_name());
// Display the current stage
echo $OUTPUT->header();
if ($backup->enforce_changed_dependencies()) {
echo $renderer->dependency_notification(get_string('dependenciesenforced','backup'));
debugging('Your settings have been altered due to unmet dependencies', DEBUG_DEVELOPER);
}
echo $renderer->progress_bar($backup->get_progress_bar());
echo $backup->display($renderer);
$backup->destroy();
unset($backup);
echo $OUTPUT->footer();
echo $OUTPUT->footer();
+1 -1
View File
@@ -859,7 +859,7 @@ class backup_gradebook_structure_step extends backup_structure_step {
$grade_category = new backup_nested_element('grade_category', array('id'), array(
//'courseid',
'parent', 'depth', 'path', 'fullname', 'aggregation', 'keephigh',
'dropload', 'aggregateonlygraded', 'aggregateoutcomes', 'aggregatesubcats',
'droplow', 'aggregateonlygraded', 'aggregateoutcomes', 'aggregatesubcats',
'timecreated', 'timemodified', 'hidden'));
$letters = new backup_nested_element('grade_letters');
+39 -20
View File
@@ -190,6 +190,15 @@ class restore_gradebook_structure_step extends restore_structure_step {
$data->id = $newitemid = $existinggradeitem->id;
$DB->update_record('grade_items', $data);
}
} else if ($data->itemtype == 'manual') {
// Manual items aren't assigned to a cm, so don't go duplicating them in the target if one exists.
$gi = array(
'itemtype' => $data->itemtype,
'courseid' => $data->courseid,
'itemname' => $data->itemname,
'categoryid' => $data->categoryid,
);
$newitemid = $DB->get_field('grade_items', 'id', $gi);
}
if (empty($newitemid)) {
@@ -288,8 +297,13 @@ class restore_gradebook_structure_step extends restore_structure_step {
$data->courseid = $this->get_courseid();
$newitemid = $DB->insert_record('grade_settings', $data);
//$this->set_mapping('grade_setting', $oldid, $newitemid);
if (!$DB->record_exists('grade_settings', array('courseid' => $data->courseid, 'name' => $data->name))) {
$newitemid = $DB->insert_record('grade_settings', $data);
} else {
$newitemid = $data->id;
}
$this->set_mapping('grade_setting', $oldid, $newitemid);
}
/**
@@ -829,20 +843,12 @@ class restore_groups_structure_step extends restore_structure_step {
}
public function process_grouping_group($data) {
global $DB;
global $CFG;
require_once($CFG->dirroot.'/group/lib.php');
$data = (object)$data;
$data->groupingid = $this->get_new_parentid('grouping'); // Use new parentid
$data->groupid = $this->get_mappingid('group', $data->groupid); // Get from mappings
$params = array();
$params['groupingid'] = $data->groupingid;
$params['groupid'] = $data->groupid;
if (!$DB->record_exists('groupings_groups', $params)) {
$DB->insert_record('groupings_groups', $data); // No need to set this mapping (no child info nor files)
}
groups_assign_grouping($this->get_new_parentid('grouping'), $this->get_mappingid('group', $data->groupid), $data->timeadded);
}
protected function after_execute() {
@@ -1151,11 +1157,11 @@ class restore_section_structure_step extends restore_structure_step {
$sectionid = $this->get_task()->get_sectionid();
// Get data object for current section availability (if any).
$data = $DB->get_record('course_sections_availability',
array('coursesectionid' => $sectionid), 'id, sourcecmid, gradeitemid', IGNORE_MISSING);
$records = $DB->get_records('course_sections_availability',
array('coursesectionid' => $sectionid), 'id, sourcecmid, gradeitemid');
// If it exists, update mappings.
if ($data) {
foreach ($records as $data) {
// Only update mappings for entries which are created by this restore.
// Otherwise, when you restore to an existing course, it will mess up
// existing section availability entries.
@@ -2904,9 +2910,6 @@ class restore_create_categories_and_questions extends restore_structure_step {
$data->penalty = 1;
}
$data->timecreated = $this->apply_date_offset($data->timecreated);
$data->timemodified = $this->apply_date_offset($data->timemodified);
$userid = $this->get_mappingid('user', $data->createdby);
$data->createdby = $userid ? $userid : $this->task->get_userid();
@@ -2960,6 +2963,22 @@ class restore_create_categories_and_questions extends restore_structure_step {
AND ' . $DB->sql_compare_text('hint', 255) . ' = ' . $DB->sql_compare_text('?', 255);
$params = array($newquestionid, $data->hint);
$newitemid = $DB->get_field_sql($sql, $params);
// Not able to find the hint, let's try cleaning the hint text
// of all the question's hints in DB as slower fallback. MDL-33863.
if (!$newitemid) {
$potentialhints = $DB->get_records('question_hints',
array('questionid' => $newquestionid), '', 'id, hint');
foreach ($potentialhints as $potentialhint) {
// Clean in the same way than {@link xml_writer::xml_safe_utf8()}.
$cleanhint = preg_replace('/[\x-\x8\xb-\xc\xe-\x1f\x7f]/is','', $potentialhint->hint); // Clean CTRL chars.
$cleanhint = preg_replace("/\r\n|\r/", "\n", $cleanhint); // Normalize line ending.
if ($cleanhint === $data->hint) {
$newitemid = $data->id;
}
}
}
// If we haven't found the newitemid, something has gone really wrong, question in DB
// is missing hints, exception
if (!$newitemid) {
+1 -1
View File
@@ -61,7 +61,7 @@ $PAGE->navbar->add($restore->get_stage_name());
$renderer = $PAGE->get_renderer('core','backup');
echo $OUTPUT->header();
if (!$restore->is_independent() && $restore->enforce_changed_dependencies()) {
echo $renderer->dependency_notification(get_string('dependenciesenforced','backup'));
debugging('Your settings have been altered due to unmet dependencies', DEBUG_DEVELOPER);
}
echo $renderer->progress_bar($restore->get_progress_bar());
echo $restore->display($renderer);
+1 -1
View File
@@ -50,7 +50,7 @@ class backup_check_testcase extends advanced_testcase {
$coursemodule = $DB->get_record('course_modules', array('id'=>$page->cmid));
$this->moduleid = $coursemodule->id;
$this->sectionid = $DB->get_field("course_sections", 'id', array("section"=>$coursemodule->section, "course"=>$course->id));
$this->sectionid = $coursemodule->section;
$this->courseid = $coursemodule->course;
$this->userid = 2; // admin
+18 -7
View File
@@ -1148,14 +1148,16 @@ abstract class restore_dbops {
*
* If restoring users from same site backup:
* 1A - Normal check: If match by id and username and mnethost => ok, return target user
* 1B - Handle users deleted in DB and "alive" in backup file:
* 1B - If restoring an 'anonymous' user (created via the 'Anonymize user information' option) try to find a
* match by username only => ok, return target user MDL-31484
* 1C - Handle users deleted in DB and "alive" in backup file:
* If match by id and mnethost and user is deleted in DB and
* (match by username LIKE 'backup_email.%' or by non empty email = md5(username)) => ok, return target user
* 1C - Handle users deleted in backup file and "alive" in DB:
* 1D - Handle users deleted in backup file and "alive" in DB:
* If match by id and mnethost and user is deleted in backup file
* and match by email = email_without_time(backup_email) => ok, return target user
* 1D - Conflict: If match by username and mnethost and doesn't match by id => conflict, return false
* 1E - None of the above, return true => User needs to be created
* 1E - Conflict: If match by username and mnethost and doesn't match by id => conflict, return false
* 1F - None of the above, return true => User needs to be created
*
* if restoring from another site backup (cannot match by id here, replace it by email/firstaccess combination):
* 2A - Normal check: If match by username and mnethost and (email or non-zero firstaccess) => ok, return target user
@@ -1187,7 +1189,16 @@ abstract class restore_dbops {
return $rec; // Matching user found, return it
}
// 1B - Handle users deleted in DB and "alive" in backup file
// 1B - If restoring an 'anonymous' user (created via the 'Anonymize user information' option) try to find a
// match by username only => ok, return target user MDL-31484
// This avoids username / id mis-match problems when restoring subsequent anonymized backups.
if (backup_anonymizer_helper::is_anonymous_user($user)) {
if ($rec = $DB->get_record('user', array('username' => $user->username))) {
return $rec; // Matching anonymous user found - return it
}
}
// 1C - Handle users deleted in DB and "alive" in backup file
// Note: for DB deleted users email is stored in username field, hence we
// are looking there for emails. See delete_user()
// Note: for DB deleted users md5(username) is stored *sometimes* in the email field,
@@ -1210,7 +1221,7 @@ abstract class restore_dbops {
return $rec; // Matching user, deleted in DB found, return it
}
// 1C - Handle users deleted in backup file and "alive" in DB
// 1D - Handle users deleted in backup file and "alive" in DB
// If match by id and mnethost and user is deleted in backup file
// and match by email = email_without_time(backup_email) => ok, return target user
if ($user->deleted) {
@@ -1228,7 +1239,7 @@ abstract class restore_dbops {
}
}
// 1D - If match by username and mnethost and doesn't match by id => conflict, return false
// 1E - If match by username and mnethost and doesn't match by id => conflict, return false
if ($rec = $DB->get_record('user', array('username'=>$user->username, 'mnethostid'=>$user->mnethostid))) {
if ($user->id != $rec->id) {
return false; // Conflict, username already exists and belongs to another id
@@ -46,6 +46,24 @@
*/
class backup_anonymizer_helper {
/**
* Determine if the given user is an 'anonymous' user, based on their username, firstname, lastname
* and email address.
* @param stdClass $user the user record to test
* @return bool true if this is an 'anonymous' user
*/
public static function is_anonymous_user($user) {
if (preg_match('/^anon\d*$/', $user->username)) {
$match = preg_match('/^anonfirstname\d*$/', $user->firstname);
$match = $match && preg_match('/^anonlastname\d*$/', $user->lastname);
$match = $match && preg_match('/^anon\d*@doesntexist\.com$/', $user->email);
if ($match) {
return true;
}
}
return false;
}
public static function process_user_auth($value) {
return 'manual'; // Set them to manual always
}
@@ -34,6 +34,7 @@ require_once($CFG->dirroot . '/backup/util/interfaces/executable.class.php');
require_once($CFG->dirroot . '/backup/util/interfaces/processable.class.php');
require_once($CFG->dirroot . '/backup/backup.class.php');
require_once($CFG->dirroot . '/backup/util/structure/restore_path_element.class.php');
require_once($CFG->dirroot . '/backup/util/helper/backup_anonymizer_helper.class.php');
require_once($CFG->dirroot . '/backup/util/helper/backup_file_manager.class.php');
require_once($CFG->dirroot . '/backup/util/helper/restore_prechecks_helper.class.php');
require_once($CFG->dirroot . '/backup/util/helper/restore_moodlexml_parser_processor.class.php');
+1 -1
View File
@@ -75,7 +75,7 @@ class file_logger extends base_logger {
if (substr($this->fullpath, -5) !== '.html') {
$content = $prefix . str_repeat(' ', $depth) . $message . PHP_EOL;
} else {
$content = $prefix . str_repeat('&nbsp;&nbsp;', $depth) . htmlentities($message, ENT_QUOTES) . '<br/>' . PHP_EOL;
$content = $prefix . str_repeat('&nbsp;&nbsp;', $depth) . htmlentities($message, ENT_QUOTES, 'UTF-8') . '<br/>' . PHP_EOL;
}
if (false === fwrite($this->fhandle, $content)) {
throw new base_logger_exception('error_writing_file', $this->fullpath);
@@ -38,7 +38,7 @@ class output_indented_logger extends base_logger {
if (defined('STDOUT')) {
echo $prefix . str_repeat(' ', $depth) . $message . PHP_EOL;
} else {
echo $prefix . str_repeat('&nbsp;&nbsp;', $depth) . htmlentities($message, ENT_QUOTES) . '<br/>' . PHP_EOL;
echo $prefix . str_repeat('&nbsp;&nbsp;', $depth) . htmlentities($message, ENT_QUOTES, 'UTF-8') . '<br/>' . PHP_EOL;
}
flush();
return true;
@@ -37,7 +37,7 @@ class output_text_logger extends base_logger {
if (defined('STDOUT')) {
echo $prefix . $message . PHP_EOL;
} else {
echo $prefix . htmlentities($message, ENT_QUOTES) . '<br/>' . PHP_EOL;
echo $prefix . htmlentities($message, ENT_QUOTES, 'UTF-8') . '<br/>' . PHP_EOL;
}
flush();
return true;
+1
View File
@@ -322,6 +322,7 @@ abstract class base_moodleform extends moodleform {
$config->question = get_string('confirmcancelquestion', 'backup');
$config->yesLabel = get_string('confirmcancelyes', 'backup');
$config->noLabel = get_string('confirmcancelno', 'backup');
$config->closeButtonTitle = get_string('close', 'editor');
$PAGE->requires->yui_module('moodle-backup-confirmcancel', 'M.core_backup.watch_cancel_buttons', array($config));
$PAGE->requires->yui_module('moodle-backup-backupselectall', 'M.core_backup.select_all_init',
@@ -76,6 +76,17 @@ abstract class grouped_parser_processor extends simplified_parser_processor {
* @param string $path xml path which parsing has started
*/
public function before_path($path) {
if ($this->path_is_grouped($path) and !isset($this->currentdata[$path])) {
// If the grouped element itself does not contain any final tags,
// we would not get any chunk data for it. So we add an artificial
// empty data chunk here that will be eventually replaced with
// real data later in {@link self::postprocess_chunk()}.
$this->currentdata[$path] = array(
'path' => $path,
'level' => substr_count($path, '/') + 1,
'tags' => array(),
);
}
if (!$this->grouped_parent_exists($path)) {
parent::before_path($path);
}
@@ -93,7 +104,10 @@ abstract class grouped_parser_processor extends simplified_parser_processor {
// currentdata, properly built
$data = $this->currentdata[$path];
unset($this->currentdata[$path]);
// Always, before dispatching any chunk, send all pending start notifications.
$this->process_pending_startend_notifications($path, 'start');
// TODO: If running under DEBUG_DEVELOPER notice about >1MB grouped chunks
// And, finally, dispatch it.
$this->dispatch_chunk($data);
}
// Normal notification of path end
@@ -167,7 +181,7 @@ abstract class grouped_parser_processor extends simplified_parser_processor {
*/
protected function build_currentdata($grouped, $data) {
// Check the grouped already exists into currentdata
if (!array_key_exists($grouped, $this->currentdata)) {
if (!is_array($this->currentdata) or !array_key_exists($grouped, $this->currentdata)) {
$a = new stdclass();
$a->grouped = $grouped;
$a->child = $data['path'];
@@ -278,6 +278,6 @@ class progressive_parser {
class progressive_parser_exception extends moodle_exception {
public function __construct($errorcode, $a=NULL, $debuginfo=null) {
parent::__construct($errorcode, 'error', '', $a, null, $debuginfo);
parent::__construct($errorcode, 'error', '', $a, $debuginfo);
}
}
+60
View File
@@ -0,0 +1,60 @@
<test>
<MOODLE_BACKUP>
<COURSE>
<FORMATDATA>
<WEEKS>
<WEEK>
<SECTION>1</SECTION>
<HIDENUMBER>1</HIDENUMBER>
<HIDEDATE>0</HIDEDATE>
<SHOWTO></SHOWTO>
<OFFLINEMATERIAL>0</OFFLINEMATERIAL>
</WEEK>
<WEEK>
<SECTION>2</SECTION>
<HIDENUMBER>0</HIDENUMBER>
<HIDEDATE>0</HIDEDATE>
<RESETNUMBER>0</RESETNUMBER>
<SHOWTO></SHOWTO>
<OFFLINEMATERIAL>0</OFFLINEMATERIAL>
</WEEK>
</WEEKS>
<IMPORTED>
</IMPORTED>
</FORMATDATA>
<GROUPEDNOTOBSERVED>
<NOBODYOBSERVERSTHIS>
<NOTOBSERVED>Muhehe</NOTOBSERVED>
</NOBODYOBSERVERSTHIS>
</GROUPEDNOTOBSERVED>
<EMPTYGROUPED>
</EMPTYGROUPED>
<SECONDGROUPED>
<SUBS>
<SUB>
<PROP>Unit tests rock!</PROP>
</SUB>
</SUBS>
</SECONDGROUPED>
</COURSE>
</MOODLE_BACKUP>
<moodle2>
<grouped id="this is not parsed at the moment because there are no final elements">
<subs>
<sub id="34">
<prop>Oh yeah</prop>
</sub>
</subs>
</grouped>
<groupednonemptywithattr id="78">
<prop>Go baby go</prop>
<subs>
<sub id="89">
<prop>http://moodle.org</prop>
</sub>
</subs>
</groupednonemptywithattr>
<groupedemptywithattr attr="ay?">
</groupedemptywithattr>
</moodle2>
</test>
@@ -632,6 +632,93 @@ class progressive_parser_test extends advanced_testcase {
$this->assertEquals($errcount, 0); // No errors found, plz
}
/**
*/
function test_grouped_at_empty_node() {
global $CFG;
// Instantiate progressive_parser.
$pp = new progressive_parser();
// Instantiate grouped_parser_processor.
$pr = new mock_grouped_parser_processor();
$this->assertTrue($pr instanceof progressive_parser_processor);
// Add interesting paths - moodle1 style.
$pr->add_path('/test/MOODLE_BACKUP/COURSE/FORMATDATA', true);
$pr->add_path('/test/MOODLE_BACKUP/COURSE/FORMATDATA/WEEKS/WEEK');
$pr->add_path('/test/MOODLE_BACKUP/COURSE/EMPTYGROUPED', true);
$pr->add_path('/test/MOODLE_BACKUP/COURSE/SECONDGROUPED', true);
$pr->add_path('/test/MOODLE_BACKUP/COURSE/SECONDGROUPED/SUBS/SUB');
// Add interesting paths - moodle2 style.
$pr->add_path('/test/moodle2/grouped', true);
$pr->add_path('/test/moodle2/grouped/subs/sub');
$pr->add_path('/test/moodle2/groupedemptywithattr', true);
$pr->add_path('/test/moodle2/groupednonemptywithattr', true);
$pr->add_path('/test/moodle2/groupednonemptywithattr/subs/sub');
// Assign processor to parser.
$pp->set_processor($pr);
// Set file from fixtures.
$pp->set_file($CFG->dirroot . '/backup/util/xml/parser/tests/fixtures/test6.xml');
// Process the file.
$pp->process();
// Get all the simplified chunks and perform various validations.
$chunks = $pr->get_chunks();
$this->assertEquals(count($chunks), 6); // All grouped elements.
// Check some random data.
$this->assertEquals('/test/MOODLE_BACKUP/COURSE/FORMATDATA', $chunks[0]['path']);
$this->assertEquals(2, $chunks[0]['tags']['WEEKS']['WEEK'][1]['SECTION']);
$this->assertEquals('/test/MOODLE_BACKUP/COURSE/EMPTYGROUPED', $chunks[1]['path']);
$this->assertEquals(array(), $chunks[1]['tags']);
$this->assertEquals('/test/MOODLE_BACKUP/COURSE/SECONDGROUPED', $chunks[2]['path']);
$this->assertEquals('Unit tests rock!', $chunks[2]['tags']['SUBS']['SUB'][0]['PROP']);
$this->assertEquals('/test/moodle2/grouped', $chunks[3]['path']);
$this->assertFalse(isset($chunks[3]['tags']['id'])); // No final elements, this should be fixed one day.
$this->assertEquals(34, $chunks[3]['tags']['subs']['sub'][0]['id']); // We have final element so this is parsed.
$this->assertEquals('Oh yeah', $chunks[3]['tags']['subs']['sub'][0]['prop']);
$this->assertEquals('/test/moodle2/groupednonemptywithattr', $chunks[4]['path']);
$this->assertEquals(78, $chunks[4]['tags']['id']); // We have final element so this is parsed.
$this->assertEquals('Go baby go', $chunks[4]['tags']['prop']);
$this->assertEquals(89, $chunks[4]['tags']['subs']['sub'][0]['id']);
$this->assertEquals('http://moodle.org', $chunks[4]['tags']['subs']['sub'][0]['prop']);
$this->assertEquals('/test/moodle2/groupedemptywithattr', $chunks[5]['path']);
$this->assertFalse(isset($chunks[5]['tags']['attr'])); // No final elements, this should be fixed one day.
// Now check start notifications.
$snotifs = $pr->get_start_notifications();
// Check we have received the correct number of notifications.
$this->assertEquals(count($snotifs), 6);
// Check the order of notifications (in order they appear in test6.xml).
$this->assertEquals('/test/MOODLE_BACKUP/COURSE/FORMATDATA', $snotifs[0]);
$this->assertEquals('/test/MOODLE_BACKUP/COURSE/EMPTYGROUPED', $snotifs[1]);
$this->assertEquals('/test/MOODLE_BACKUP/COURSE/SECONDGROUPED', $snotifs[2]);
$this->assertEquals('/test/moodle2/grouped', $snotifs[3]);
$this->assertEquals('/test/moodle2/groupednonemptywithattr', $snotifs[4]);
$this->assertEquals('/test/moodle2/groupedemptywithattr', $snotifs[5]);
// Now check end notifications.
$enotifs = $pr->get_end_notifications();
// Check we have received the correct number of notifications.
$this->assertEquals(count($enotifs), 6);
// Check the order of notifications (in order they appear in test6.xml).
$this->assertEquals('/test/MOODLE_BACKUP/COURSE/FORMATDATA', $enotifs[0]);
$this->assertEquals('/test/MOODLE_BACKUP/COURSE/EMPTYGROUPED', $enotifs[1]);
$this->assertEquals('/test/MOODLE_BACKUP/COURSE/SECONDGROUPED', $enotifs[2]);
$this->assertEquals('/test/moodle2/grouped', $enotifs[3]);
$this->assertEquals('/test/moodle2/groupednonemptywithattr', $enotifs[4]);
$this->assertEquals('/test/moodle2/groupedemptywithattr', $enotifs[5]);
// Now verify that the start/process/end order is correct.
$allnotifs = $pr->get_all_notifications();
$this->assertEquals(count($allnotifs), count($snotifs) + count($enotifs) + count($chunks));
// Check integrity of the notifications.
$errcount = $this->helper_check_notifications_order_integrity($allnotifs);
$this->assertEquals(0, $errcount);
}
/**
* Helper function that given one array of ordered start/process/end notifications will
+1 -1
View File
@@ -69,7 +69,7 @@ class block_community extends block_list {
}
$icon = html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('i/group'),
'class' => 'icon', 'alt' => get_string('addcourse', 'block_community')));
'class' => 'icon', 'alt' => ""));
$addcourseurl = new moodle_url('/blocks/community/communitycourse.php',
array('add' => true, 'courseid' => $this->page->course->id));
$searchlink = html_writer::tag('a', $icon . '&nbsp;' . get_string('addcourse', 'block_community'),
+2 -2
View File
@@ -228,10 +228,10 @@ if (!empty($courses)) {
}
}
$PAGE->requires->yui_module('moodle-block_community-comments', 'M.blocks_community.init_comments',
array(array('commentids' => $commentedcourseids)));
array(array('commentids' => $commentedcourseids, 'closeButtonTitle' => get_string('close', 'editor'))));
$PAGE->requires->yui_module('moodle-block_community-imagegallery', 'M.blocks_community.init_imagegallery',
array(array('imageids' => $courseids, 'imagenumbers' => $courseimagenumbers,
'huburl' => $huburl)));
'huburl' => $huburl, 'closeButtonTitle' => get_string('close', 'editor'))));
echo highlight($search, $renderer->course_list($courses, $huburl, $courseid));
+3 -2
View File
@@ -213,6 +213,7 @@
background-color:#F6F6F6;
border:1px solid #CCCCCC;
overflow: auto;
padding: 7px 6px;
}
#page-blocks-community-communitycourse .moodle-dialogue-base .moodle-dialogue-bd {
@@ -222,5 +223,5 @@
#page-blocks-community-communitycourse .moodle-dialogue-base .closebutton {
margin-top:4px;
width:30px;
}
margin-right: 4px;
}
+28 -19
View File
@@ -9,8 +9,8 @@ YUI.add('moodle-block_community-comments', function(Y) {
Y.extend(COMMENTS, Y.Base, {
event:null,
overlayevent:null,
overlays: [], //all the comment boxes
panelevent: null,
panels: [], //all the comment boxes
initializer : function(params) {
@@ -18,17 +18,19 @@ YUI.add('moodle-block_community-comments', function(Y) {
for (var i=0;i<this.get('commentids').length;i++)
{
var commentid = this.get('commentids')[i];
this.overlays[commentid] = new M.core.dialogue({
headerContent:Y.one('#commentoverlay-'+commentid+' .commenttitle').get('innerHTML'),
this.panels[commentid] = new M.core.dialogue({
headerContent:Y.Node.create('<h1>')
.append(Y.one('#commentoverlay-'+commentid+' .commenttitle').get('innerHTML')),
bodyContent:Y.one('#commentoverlay-'+commentid).get('innerHTML'),
visible: false, //by default it is not displayed
lightbox : false,
zIndex:100
zIndex:100,
closeButtonTitle: this.get('closeButtonTitle')
});
this.overlays[commentid].get('contentBox').one('.commenttitle').remove();
this.overlays[commentid].render();
this.overlays[commentid].hide();
this.panels[commentid].get('contentBox').one('.commenttitle').remove();
this.panels[commentid].render();
this.panels[commentid].hide();
Y.one('#comments-'+commentid).on('click', this.show, this, commentid);
}
@@ -37,34 +39,37 @@ YUI.add('moodle-block_community-comments', function(Y) {
show : function (e, commentid) {
//hide all overlays
// Hide all panels.
for (var i=0;i<this.get('commentids').length;i++)
{
this.hide(e, this.get('commentids')[i]);
}
this.overlays[commentid].show(); //show the overlay
this.panels[commentid].show(); //show the panel
e.halt(); // we are going to attach a new 'hide overlay' event to the body,
e.halt(); // we are going to attach a new 'hide panel' event to the body,
// because javascript always propagate event to parent tag,
// we need to tell Yahoo to stop to call the event on parent tag
// otherwise the hide event will be call right away.
//we add a new event on the body in order to hide the overlay for the next click
// We add a new event on the body in order to hide the panel for the next click.
this.event = Y.one(document.body).on('click', this.hide, this, commentid);
//we add a new event on the overlay in order to hide the overlay for the next click (touch device)
this.overlayevent = Y.one("#commentoverlay-"+commentid).on('click', this.hide, this, commentid);
// We add a new event on the panel in order to hide the panel for the next click (touch device).
this.panelevent = Y.one("#commentoverlay-"+commentid).on('click', this.hide, this, commentid);
// Focus on the close button
this.panels[commentid].get('buttons').header[0].focus();
},
hide : function (e, commentid) {
this.overlays[commentid].hide(); //hide the overlay
this.panels[commentid].hide(); //hide the panel
if (this.event != null) {
this.event.detach(); //we need to detach the body hide event
//Note: it would work without but create js warning everytime
//we click on the body
}
if (this.overlayevent != null) {
this.overlayevent.detach(); //we need to detach the overlay hide event
if (this.panelevent != null) {
this.panelevent.detach(); //we need to detach the panel hide event
//Note: it would work without but create js warning everytime
//we click on the body
}
@@ -74,7 +79,11 @@ YUI.add('moodle-block_community-comments', function(Y) {
}, {
NAME : COMMENTSNAME,
ATTRS : {
commentids: {}
commentids: {},
closeButtonTitle : {
validator : Y.Lang.isString,
value : 'Close'
}
}
});
@@ -84,5 +93,5 @@ YUI.add('moodle-block_community-comments', function(Y) {
}
}, '@VERSION@', {
requires:['base','overlay', 'moodle-enrol-notification']
requires:['base', 'moodle-enrol-notification']
});
+48 -41
View File
@@ -11,8 +11,8 @@ YUI.add('moodle-block_community-imagegallery', function(Y) {
event:null,
previousevent:null,
nextevent:null,
overlayevent:null,
overlay:null, //all the comment boxes
panelevent: null,
panel: null, //all the images boxes
imageidnumbers: [],
imageloadingevent: null,
loadingimage: null,
@@ -26,15 +26,15 @@ YUI.add('moodle-block_community-imagegallery', function(Y) {
+'</div>');
objBody.append(this.loadingimage);
/// create the div for overlay
// Create the div for panel.
var objBody = Y.one(document.body);
var overlaytitle = Y.Node.create('<div id="imagetitleoverlay" class="hiddenoverlay"></div>');
objBody.append(overlaytitle);
var overlay = Y.Node.create('<div id="imageoverlay" class="hiddenoverlay"></div>');
objBody.append(overlay);
var paneltitle = Y.Node.create('<div id="imagetitleoverlay" class="hiddenoverlay"></div>');
objBody.append(paneltitle);
var panel = Y.Node.create('<div id="imageoverlay" class="hiddenoverlay"></div>');
objBody.append(panel);
/// create the overlay
this.overlay = new M.core.dialogue({
/// Create the panel.
this.panel = new M.core.dialogue({
headerContent:Y.one('#imagetitleoverlay').get('innerHTML'),
bodyContent:Y.one('#imageoverlay').get('innerHTML'),
visible: false, //by default it is not displayed
@@ -42,8 +42,8 @@ YUI.add('moodle-block_community-imagegallery', function(Y) {
zIndex:100
});
this.overlay.render();
this.overlay.hide();
this.panel.render();
this.panel.hide();
//attach a show event on the image divs (<tag id='image-X'>)
for (var i=0;i<this.get('imageids').length;i++)
@@ -85,31 +85,31 @@ YUI.add('moodle-block_community-imagegallery', function(Y) {
var maxheight = windowheight - 150;
//load the title + link to next image
var overlaytitle = Y.one('#imagetitleoverlay');
var paneltitle = Y.one('#imagetitleoverlay');
var previousimagelink = "<div id=\"previousarrow\" class=\"imagearrow\">←</div>";
var nextimagelink = "<div id=\"nextarrow\" class=\"imagearrow\">→</div>";
/// need to load the images in the overlay
var overlay = Y.one('#imageoverlay');
overlay.setContent('');
// Need to load the images in the panel.
var panel = Y.one('#imageoverlay');
panel.setContent('');
overlay.append(Y.Node.create('<div style="text-align:center"><img id=\"imagetodisplay\" src="' + url
panel.append(Y.Node.create('<div style="text-align:center"><img id=\"imagetodisplay\" src="' + url
+ '" style="max-height:' + maxheight + 'px;"></div>'));
this.overlay.destroy();
this.overlay = new M.core.dialogue({
headerContent:previousimagelink + '<div id=\"imagenumber\" class=\"imagetitle\"> Image '
+ screennumber + ' / ' + this.imageidnumbers[imageid] + ' </div>' + nextimagelink,
this.panel.destroy();
this.panel = new M.core.dialogue({
headerContent:previousimagelink + '<div id=\"imagenumber\" class=\"imagetitle\"><h1> Image '
+ screennumber + ' / ' + this.imageidnumbers[imageid] + ' </h1></div>' + nextimagelink,
bodyContent:Y.one('#imageoverlay').get('innerHTML'),
visible: false, //by default it is not displayed
lightbox : false,
zIndex:100
zIndex:100,
closeButtonTitle: this.get('closeButtonTitle')
});
this.overlay.render();
this.overlay.hide(); //show the overlay
this.overlay.set("centered", true);
this.panel.render();
this.panel.hide(); //show the panel
this.panel.set("centered", true);
e.halt(); // we are going to attach a new 'hide overlay' event to the body,
e.halt(); // we are going to attach a new 'hide panel' event to the body,
// because javascript always propagate event to parent tag,
// we need to tell Yahoo to stop to call the event on parent tag
// otherwise the hide event will be call right away.
@@ -123,14 +123,17 @@ YUI.add('moodle-block_community-imagegallery', function(Y) {
var screenshot = new Image();
screenshot.src = url;
var overlaywidth = windowwidth - 100;
if(overlaywidth > screenshot.width) {
overlaywidth = screenshot.width;
var panelwidth = windowwidth - 100;
if(panelwidth > screenshot.width) {
panelwidth = screenshot.width;
}
this.overlay.set('width', overlaywidth);
this.overlay.set("centered", true);
this.overlay.show();
this.panel.set('width', panelwidth);
this.panel.set("centered", true);
this.panel.show();
// Focus on the close button
this.panel.get('buttons').header[0].focus();
}, this, url);
@@ -147,12 +150,12 @@ YUI.add('moodle-block_community-imagegallery', function(Y) {
Y.one('#nextarrow').on('click', this.show, this, imageid, nextnumber);
Y.one('#imagenumber').on('click', this.show, this, imageid, nextnumber);
//we add a new event on the body in order to hide the overlay for the next click
//we add a new event on the body in order to hide the panel for the next click
this.event = Y.one(document.body).on('click', this.hide, this);
//we add a new event on the overlay in order to hide the overlay for the next click (touch device)
this.overlayevent = Y.one("#imageoverlay").on('click', this.hide, this);
//we add a new event on the panel in order to hide the panel for the next click (touch device)
this.panelevent = Y.one("#imageoverlay").on('click', this.hide, this);
this.overlay.on('visibleChange',function(e){
this.panel.on('visibleChange',function(e){
if(e.newVal == 0){
this.get('maskNode').remove()
}
@@ -167,14 +170,14 @@ YUI.add('moodle-block_community-imagegallery', function(Y) {
//hide the loading image
Y.one('#hubloadingimage').setStyle('display', 'none');
this.overlay.hide(); //hide the overlay
this.panel.hide(); //hide the panel
if (this.event != null) {
this.event.detach(); //we need to detach the body hide event
//Note: it would work without but create js warning everytime
//we click on the body
}
if (this.overlayevent != null) {
this.overlayevent.detach(); //we need to detach the overlay hide event
if (this.panelevent != null) {
this.panelevent.detach(); //we need to detach the panel hide event
//Note: it would work without but create js warning everytime
//we click on the body
}
@@ -185,7 +188,11 @@ YUI.add('moodle-block_community-imagegallery', function(Y) {
ATTRS : {
imageids: {},
imagenumbers: {},
huburl: {}
huburl: {},
closeButtonTitle : {
validator : Y.Lang.isString,
value : 'Close'
}
}
});
@@ -195,5 +202,5 @@ YUI.add('moodle-block_community-imagegallery', function(Y) {
}
}, '@VERSION@', {
requires:['base','node','overlay', 'moodle-enrol-notification']
requires:['base','node', 'moodle-enrol-notification']
});
@@ -217,7 +217,7 @@ class block_completionstatus extends block_base {
$this->content->footer = '<br><a href="'.$details->out().'">'.get_string('moredetails', 'completion').'</a>';
} else {
// If user is not enrolled, show error
$this->content->text = get_string('notenroled', 'completion');
$this->content->text = get_string('nottracked', 'completion');
}
if (has_capability('report/completion:view', $context)) {
@@ -24,4 +24,4 @@
*/
$string['coursesummary'] = 'Course summary';
$string['pluginname'] = 'Course/Site description';
$string['pluginname'] = 'Course/site summary';
+1 -1
View File
@@ -916,7 +916,7 @@ M.core_dock.genericblock.prototype = {
}, this);
// Add a close icon
// Must set the image src seperatly of we get an error with XML strict headers
var closeicon = Y.Node.create('<span class="hidepanelicon" tabindex="0"><img alt="" style="width:11px;height:11px;cursor:pointer;" /></span>');
var closeicon = Y.Node.create('<span class="hidepanelicon" tabindex="0"><img alt="'+M.str.block.hidepanel+'" title="'+M.str.block.hidedockpanel+'" style="width:11px;height:11px;cursor:pointer;"/></span>');
closeicon.one('img').setAttribute('src', M.util.image_url('t/dockclose', 'moodle'));
closeicon.on('forceclose|click', this.hide, this);
closeicon.on('dock:actionkey',this.hide, this, {actions:{enter:true,toggle:true}});
@@ -129,11 +129,6 @@ class block_glossary_random extends block_base {
$course = $this->page->course;
$modinfo = get_fast_modinfo($course);
$glossaryid = $this->config->glossary;
$cm = $modinfo->instances['glossary'][$glossaryid];
if (!has_capability('mod/glossary:view', get_context_instance(CONTEXT_MODULE, $cm->id))) {
return '';
}
if (!isset($modinfo->instances['glossary'][$glossaryid])) {
// we can get here if the glossary has been deleted, so
@@ -142,11 +137,18 @@ class block_glossary_random extends block_base {
$this->config->cache = '';
$this->instance_config_commit();
$this->content = new stdClass();
$this->content->text = get_string('notyetconfigured','block_glossary_random');
$this->content->footer = '';
return $this->content;
}
$cm = $modinfo->instances['glossary'][$glossaryid];
if (!has_capability('mod/glossary:view', get_context_instance(CONTEXT_MODULE, $cm->id))) {
return '';
}
if (empty($this->config->cache)) {
$this->config->cache = '';
}
@@ -23,7 +23,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$string['addentry'] = 'Add your own favorite quotes!';
$string['addentry'] = 'Add a new entry';
$string['askaddentry'] = 'When users can add entries to the glossary, show a link with this text';
$string['askinvisible'] = 'When users cannot edit or view the glossary, show this text (without link)';
$string['askviewglossary'] = 'When users can view the glossary but not add entries, show a link with this text';
@@ -41,5 +41,5 @@ $string['select_glossary'] = 'Take entries from this glossary';
$string['showconcept'] = 'Show concept (heading) for each entry';
$string['title'] = 'Title';
$string['type'] = 'How a new entry is chosen';
$string['viewglossary'] = 'More quotes...';
$string['viewglossary'] = 'View all entries';
$string['whichfooter'] = 'You can display links to actions of the glossary this block is associated with. The block will only display links to actions which are enabled for that glossary.';
+46
View File
@@ -0,0 +1,46 @@
<?php
/**
* Provides support for the conversion of moodle1 backup to the moodle2 format
*
* @package block_html
* @copyright 2012 Paul Nicholls
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Block conversion handler for html
*/
class moodle1_block_html_handler extends moodle1_block_handler {
private $fileman = null;
protected function convert_configdata(array $olddata) {
$instanceid = $olddata['id'];
$contextid = $this->converter->get_contextid(CONTEXT_BLOCK, $olddata['id']);
$configdata = unserialize(base64_decode($olddata['configdata']));
// get a fresh new file manager for this instance
$this->fileman = $this->converter->get_file_manager($contextid, 'block_html');
// convert course files embedded in the block content
$this->fileman->filearea = 'content';
$this->fileman->itemid = 0;
$configdata->text = moodle1_converter::migrate_referenced_files($configdata->text, $this->fileman);
$configdata->format = FORMAT_HTML;
return base64_encode(serialize($configdata));
}
protected function write_inforef_xml($newdata, $data) {
$this->open_xml_writer("course/blocks/{$data['name']}_{$data['id']}/inforef.xml");
$this->xmlwriter->begin_tag('inforef');
$this->xmlwriter->begin_tag('fileref');
foreach ($this->fileman->get_fileids() as $fileid) {
$this->write_xml('file', array('id' => $fileid));
}
$this->xmlwriter->end_tag('fileref');
$this->xmlwriter->end_tag('inforef');
$this->close_xml_writer();
}
}
+4 -3
View File
@@ -151,12 +151,13 @@ class block_online_users extends block_base {
$timeago = format_time($now - $user->lastaccess); //bruno to calculate correctly on frontpage
if (isguestuser($user)) {
$this->content->text .= '<div class="user">'.$OUTPUT->user_picture($user, array('size'=>16));
$this->content->text .= '<div class="user">'.$OUTPUT->user_picture($user, array('size'=>16, 'alttext'=>false));
$this->content->text .= get_string('guestuser').'</div>';
} else {
$this->content->text .= '<div class="user">'.$OUTPUT->user_picture($user, array('size'=>16));
$this->content->text .= '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&amp;course='.$this->page->course->id.'" title="'.$timeago.'">'.$user->fullname.'</a></div>';
$this->content->text .= '<div class="user">';
$this->content->text .= '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&amp;course='.$this->page->course->id.'" title="'.$timeago.'">';
$this->content->text .= $OUTPUT->user_picture($user, array('size'=>16, 'alttext'=>false, 'link'=>false)) .$user->fullname.'</a></div>';
}
if ($canshowicon and ($USER->id != $user->id) and !isguestuser($user)) { // Only when logged in and messaging active etc
$anchortagcontents = '<img class="iconsmall" src="'.$OUTPUT->pix_url('t/message') . '" alt="'. get_string('messageselectadd') .'" />';
+34
View File
@@ -0,0 +1,34 @@
<?php
/**
* Provides support for the conversion of moodle1 backup to the moodle2 format
*
* @package block_rss_client
* @copyright 2012 Paul Nicholls
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Block conversion handler for rss_client
*/
class moodle1_block_rss_client_handler extends moodle1_block_handler {
public function process_block(array $data) {
parent::process_block($data);
$instanceid = $data['id'];
$contextid = $this->converter->get_contextid(CONTEXT_BLOCK, $data['id']);
// Moodle 1.9 backups do not include sufficient data to restore feeds, so we need an empty shell rss_client.xml
// for the restore process to find
$this->open_xml_writer("course/blocks/{$data['name']}_{$instanceid}/rss_client.xml");
$this->xmlwriter->begin_tag('block', array('id' => $instanceid, 'contextid' => $contextid, 'blockname' => 'rss_client'));
$this->xmlwriter->begin_tag('rss_client', array('id' => $instanceid));
$this->xmlwriter->full_tag('feeds', '');
$this->xmlwriter->end_tag('rss_client');
$this->xmlwriter->end_tag('block');
$this->close_xml_writer();
return $data;
}
}
@@ -78,6 +78,9 @@ class restore_rss_client_block_structure_step extends restore_structure_step {
$configdata = $DB->get_field('block_instances', 'configdata', array('id' => $this->task->get_blockid()));
// Extract configdata
$config = unserialize(base64_decode($configdata));
if (empty($config)) {
$config = new stdClass();
}
// Set array of used rss feeds
$config->rssid = $feedsarr;
// Serialize back the configdata
+3 -4
View File
@@ -177,7 +177,7 @@ if ($returnurl) {
$managefeeds = new moodle_url('/blocks/rss_client/managefeeds.php', $urlparams);
$PAGE->set_url('/blocks/rss_client/editfeed.php', $urlparams);
$PAGE->set_pagelayout('base');
$PAGE->set_pagelayout('standard');
if ($rssid) {
$isadding = false;
@@ -218,10 +218,9 @@ if ($mform->is_cancelled()) {
$PAGE->set_title($strtitle);
$PAGE->set_heading($strtitle);
$settingsurl = new moodle_url('/admin/settings.php?section=blocksettingrss_client');
$PAGE->navbar->add(get_string('blocks'));
$PAGE->navbar->add(get_string('pluginname', 'block_rss_client'), $settingsurl);
$PAGE->navbar->add(get_string('managefeeds', 'block_rss_client'));
$PAGE->navbar->add(get_string('pluginname', 'block_rss_client'));
$PAGE->navbar->add(get_string('managefeeds', 'block_rss_client'), $managefeeds );
$PAGE->navbar->add($strtitle);
echo $OUTPUT->header();
+1 -2
View File
@@ -83,10 +83,9 @@ $PAGE->set_pagelayout('standard');
$PAGE->set_title($strmanage);
$PAGE->set_heading($strmanage);
$settingsurl = new moodle_url('/admin/settings.php?section=blocksettingrss_client');
$managefeeds = new moodle_url('/blocks/rss_client/managefeeds.php', $urlparams);
$PAGE->navbar->add(get_string('blocks'));
$PAGE->navbar->add(get_string('pluginname', 'block_rss_client'), $settingsurl);
$PAGE->navbar->add(get_string('pluginname', 'block_rss_client'));
$PAGE->navbar->add(get_string('managefeeds', 'block_rss_client'), $managefeeds);
echo $OUTPUT->header();
+2 -3
View File
@@ -71,11 +71,10 @@ $strviewfeed = get_string('viewfeed', 'block_rss_client');
$PAGE->set_title($strviewfeed);
$PAGE->set_heading($strviewfeed);
$settingsurl = new moodle_url('/admin/settings.php?section=blocksettingrss_client');
$managefeeds = new moodle_url('/blocks/rss_client/managefeeds.php', $urlparams);
$PAGE->navbar->add(get_string('blocks'));
$PAGE->navbar->add(get_string('pluginname', 'block_rss_client'), $settingsurl);
$PAGE->navbar->add(get_string('managefeeds', 'block_rss_client'));
$PAGE->navbar->add(get_string('pluginname', 'block_rss_client'));
$PAGE->navbar->add(get_string('managefeeds', 'block_rss_client'), $managefeeds);
$PAGE->navbar->add($strviewfeed);
echo $OUTPUT->header();
@@ -83,7 +83,7 @@ class block_selfcompletion extends block_base {
// Check this user is enroled
if (!$info->is_tracked_user($USER->id)) {
$this->content->text = get_string('notenroled', 'completion');
$this->content->text = get_string('nottracked', 'completion');
return $this->content;
}
+1 -1
View File
@@ -34,7 +34,7 @@ class block_tags_edit_form extends block_edit_form {
// Fields for editing HTML block title and contents.
$mform->addElement('header', 'configheader', get_string('blocksettings', 'block'));
$mform->addElement('text', 'config_title', get_string('pluginname', 'block_tags'));
$mform->addElement('text', 'config_title', get_string('configtitle', 'block_tags'));
$mform->setType('config_title', PARAM_MULTILANG);
$mform->setDefault('config_title', get_string('pluginname', 'block_tags'));
+1
View File
@@ -31,6 +31,7 @@ $string['arrowtitle'] = 'Click here to enter the suggested text (grey letters).'
$string['communitytags'] = 'Community tags:';
$string['communitytags1'] = 'community tags';
$string['communitytags2'] = 'Show all user created course tags';
$string['configtitle'] = 'Block title';
$string['coursetags'] = 'Course tags:';
$string['coursetags1'] = 'course tags';
$string['coursetags2'] = 'Show tags for this course';
+2 -2
View File
@@ -87,8 +87,8 @@ class blog_edit_form extends moodleform {
}
if (has_capability('moodle/blog:associatecourse', $context)) {
$mform->addElement('header', 'assochdr', get_string('associations', 'blog'));
$mform->addElement('advcheckbox', 'courseassoc', get_string('associatewithcourse', 'blog', $a), null, null, array(0, $contextid));
$mform->addElement('header', 'assochdr', get_string('associations', 'blog'));
$mform->addElement('advcheckbox', 'courseassoc', get_string('associatewithcourse', 'blog', $a), null, null, array(0, $contextid));
$mform->setDefault('courseassoc', $contextid);
}
+1 -1
View File
@@ -602,7 +602,7 @@ function blog_get_options_for_module($module, $user=null) {
}
if (array_key_exists($key, $moduleoptions)) {
// Serve from the cache so we don't have to regenerate
return $moduleoptions[$module->id];
return $moduleoptions[$key];
}
$canparticipate = (is_enrolled($modcontext) or is_viewing($modcontext));
+12
View File
@@ -158,11 +158,23 @@ function blog_rss_get_params($filters) {
function blog_rss_get_feed($context, $args) {
global $CFG, $SITE, $DB;
if (empty($CFG->bloglevel)) {
debugging('Blogging disabled on this site, RSS feeds are not available');
return null;
}
if (empty($CFG->enablerssfeeds)) {
debugging('Sorry, RSS feeds are disabled on this site');
return '';
}
if ($CFG->bloglevel == BLOG_SITE_LEVEL) {
if (isguestuser()) {
debugging(get_string('nopermissiontoshow','error'));
return '';
}
}
$sitecontext = get_context_instance(CONTEXT_SYSTEM);
if (!has_capability('moodle/blog:view', $sitecontext)) {
return null;
+25 -12
View File
@@ -729,7 +729,7 @@ function calendar_get_events($tstart, $tend, $users, $groups, $courses, $withdur
* @return string $content return available control for the calender in html
*/
function calendar_top_controls($type, $data) {
global $CFG;
global $CFG, $PAGE;
$content = '';
if(!isset($data['d'])) {
$data['d'] = 1;
@@ -752,6 +752,7 @@ function calendar_top_controls($type, $data) {
$data['m'] = $date['mon'];
$data['y'] = $date['year'];
$urlbase = $PAGE->url;
//Accessibility: calendar block controls, replaced <table> with <div>.
//$nexttext = link_arrow_right(get_string('monthnext', 'access'), $url='', $accesshide=true);
@@ -761,8 +762,8 @@ function calendar_top_controls($type, $data) {
case 'frontpage':
list($prevmonth, $prevyear) = calendar_sub_month($data['m'], $data['y']);
list($nextmonth, $nextyear) = calendar_add_month($data['m'], $data['y']);
$nextlink = calendar_get_link_next(get_string('monthnext', 'access'), 'index.php?', 0, $nextmonth, $nextyear, $accesshide=true);
$prevlink = calendar_get_link_previous(get_string('monthprev', 'access'), 'index.php?', 0, $prevmonth, $prevyear, true);
$nextlink = calendar_get_link_next(get_string('monthnext', 'access'), $urlbase, 0, $nextmonth, $nextyear, true);
$prevlink = calendar_get_link_previous(get_string('monthprev', 'access'), $urlbase, 0, $prevmonth, $prevyear, true);
$calendarlink = calendar_get_link_href(new moodle_url(CALENDAR_URL.'view.php', array('view'=>'month')), 1, $data['m'], $data['y']);
if (!empty($data['id'])) {
@@ -788,8 +789,8 @@ function calendar_top_controls($type, $data) {
case 'course':
list($prevmonth, $prevyear) = calendar_sub_month($data['m'], $data['y']);
list($nextmonth, $nextyear) = calendar_add_month($data['m'], $data['y']);
$nextlink = calendar_get_link_next(get_string('monthnext', 'access'), 'view.php?id='.$data['id'].'&amp;', 0, $nextmonth, $nextyear, $accesshide=true);
$prevlink = calendar_get_link_previous(get_string('monthprev', 'access'), 'view.php?id='.$data['id'].'&amp;', 0, $prevmonth, $prevyear, true);
$nextlink = calendar_get_link_next(get_string('monthnext', 'access'), $urlbase, 0, $nextmonth, $nextyear, true);
$prevlink = calendar_get_link_previous(get_string('monthprev', 'access'), $urlbase, 0, $prevmonth, $prevyear, true);
$calendarlink = calendar_get_link_href(new moodle_url(CALENDAR_URL.'view.php', array('view'=>'month')), 1, $data['m'], $data['y']);
if (!empty($data['id'])) {
@@ -1721,11 +1722,19 @@ function calendar_get_allowed_types(&$allowed, $course = null) {
$allowed->courses = array($course->id => 1);
if ($course->groupmode != NOGROUPS || !$course->groupmodeforce) {
$allowed->groups = groups_get_all_groups($course->id);
if (has_capability('moodle/site:accessallgroups', $coursecontext)) {
$allowed->groups = groups_get_all_groups($course->id);
} else {
$allowed->groups = groups_get_all_groups($course->id, $USER->id);
}
}
} else if (has_capability('moodle/calendar:managegroupentries', $coursecontext)) {
if($course->groupmode != NOGROUPS || !$course->groupmodeforce) {
$allowed->groups = groups_get_all_groups($course->id);
if (has_capability('moodle/site:accessallgroups', $coursecontext)) {
$allowed->groups = groups_get_all_groups($course->id);
} else {
$allowed->groups = groups_get_all_groups($course->id, $USER->id);
}
}
}
}
@@ -2080,24 +2089,22 @@ class calendar_event {
if ($usingeditor) {
switch ($this->properties->eventtype) {
case 'user':
$this->editorcontext = $this->properties->context;
$this->properties->courseid = 0;
$this->properties->course = 0;
$this->properties->groupid = 0;
$this->properties->userid = $USER->id;
break;
case 'site':
$this->editorcontext = $this->properties->context;
$this->properties->courseid = SITEID;
$this->properties->course = SITEID;
$this->properties->groupid = 0;
$this->properties->userid = $USER->id;
break;
case 'course':
$this->editorcontext = $this->properties->context;
$this->properties->groupid = 0;
$this->properties->userid = $USER->id;
break;
case 'group':
$this->editorcontext = $this->properties->context;
$this->properties->userid = $USER->id;
break;
default:
@@ -2107,6 +2114,13 @@ class calendar_event {
break;
}
// If we are actually using the editor, we recalculate the context because some default values
// were set when calculate_context() was called from the constructor.
if ($usingeditor) {
$this->properties->context = $this->calculate_context($this->properties);
$this->editorcontext = $this->properties->context;
}
$editor = $this->properties->description;
$this->properties->format = $this->properties->description['format'];
$this->properties->description = $this->properties->description['text'];
@@ -2125,7 +2139,6 @@ class calendar_event {
$this->editoroptions,
$editor['text'],
$this->editoroptions['forcehttps']);
$DB->set_field('event', 'description', $this->properties->description, array('id'=>$this->properties->id));
}
+5 -5
View File
@@ -460,7 +460,7 @@ class core_calendar_renderer extends plugin_renderer_base {
// Paddding (the first week may have blank days in the beginning)
for($i = $display->minwday; $i < $startwday; ++$i) {
$cell = new html_table_cell('&nbsp;');
$cell->attributes = array('class'=>'nottoday');
$cell->attributes = array('class'=>'nottoday dayblank');
$row->cells[] = $cell;
}
@@ -519,10 +519,10 @@ class core_calendar_renderer extends plugin_renderer_base {
}
// Special visual fx for today
if($display->thismonth && $calendar->day == $calendar->day) {
$cellclasses[] = 'today';
if ($display->thismonth && $calendar->day == $date['mday']) {
$cellclasses[] = 'day today';
} else {
$cellclasses[] = 'nottoday';
$cellclasses[] = 'day nottoday';
}
$cell->attributes = array('class'=>join(' ',$cellclasses));
@@ -553,7 +553,7 @@ class core_calendar_renderer extends plugin_renderer_base {
// Paddding (the last week may have blank days at the end)
for($i = $dayweek; $i <= $display->maxwday; ++$i) {
$cell = new html_table_cell('&nbsp;');
$cell->attributes = array('class'=>'nottoday');
$cell->attributes = array('class'=>'nottoday dayblank');
$row->cells[] = $cell;
}
$table->data[] = $row;
+2 -2
View File
@@ -70,8 +70,8 @@ echo $OUTPUT->heading(get_string('assignto', 'cohort', format_string($cohort->na
echo $OUTPUT->notification(get_string('removeuserwarning', 'core_cohort'));
// Get the user_selector we will need.
$potentialuserselector = new cohort_candidate_selector('addselect', array('cohortid'=>$cohort->id));
$existinguserselector = new cohort_existing_selector('removeselect', array('cohortid'=>$cohort->id));
$potentialuserselector = new cohort_candidate_selector('addselect', array('cohortid'=>$cohort->id, 'accesscontext'=>$context));
$existinguserselector = new cohort_existing_selector('removeselect', array('cohortid'=>$cohort->id, 'accesscontext'=>$context));
// Process incoming user assignments to the cohort
+3 -5
View File
@@ -157,8 +157,7 @@ bodyContent: '<div class="comment-delete-confirm"><a href="#" id="confirmdelete-
scope: scope
},
headers: {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'User-Agent': 'MoodleComment/3.0'
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
},
data: build_querystring(params)
};
@@ -184,7 +183,7 @@ bodyContent: '<div class="comment-delete-confirm"><a href="#" id="confirmdelete-
val = val.replace('___name___', list[i].fullname);
}
if (list[i]['delete']||newcmt) {
list[i].content = '<div class="comment-delete"><a href="#" id ="comment-delete-'+this.client_id+'-'+list[i].id+'" title="'+M.str.moodle.deletecomment+'"><img src="'+M.util.image_url('t/delete', 'core')+'" /></a></div>' + list[i].content;
list[i].content = '<div class="comment-delete"><a href="#" id ="comment-delete-'+this.client_id+'-'+list[i].id+'" title="'+M.str.moodle.deletecomment+'"><img alt="" src="'+M.util.image_url('t/delete', 'core')+'" /></a></div>' + list[i].content;
}
val = val.replace('___time___', list[i].time);
val = val.replace('___picture___', list[i].avatar);
@@ -472,8 +471,7 @@ bodyContent: '<div class="comment-delete-confirm"><a href="#" id="confirmdelete-
scope: this
},
headers: {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'User-Agent': 'MoodleComment/3.0'
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
},
data: build_querystring(data)
};
+1 -1
View File
@@ -38,7 +38,7 @@ $action = optional_param('action', '', PARAM_ALPHA);
$area = optional_param('area', '', PARAM_AREA);
$content = optional_param('content', '', PARAM_RAW);
$itemid = optional_param('itemid', '', PARAM_INT);
$returnurl = optional_param('returnurl', '/', PARAM_URL);
$returnurl = optional_param('returnurl', '/', PARAM_LOCALURL);
$component = optional_param('component', '', PARAM_COMPONENT);
// Currently this script can only add comments
+6
View File
@@ -0,0 +1,6 @@
{
"require-dev": {
"phpunit/phpunit": "3.7.*",
"phpunit/dbUnit": "1.2.*"
}
}
+2 -1
View File
@@ -367,7 +367,8 @@ $CFG->admin = 'admin';
//
// $CFG->themedir = '/location/of/extra/themes';
//
// It is possible to specify different cache and temp directories, use local fast filesystem.
// It is possible to specify different cache and temp directories, use local fast filesystem
// for normal web servers. Server clusters MUST use shared filesystem for cachedir!
// The directories must not be accessible via web.
//
// $CFG->tempdir = '/var/www/moodle/temp';
+8 -2
View File
@@ -144,6 +144,7 @@ if ($editingon && $sesskeyprovided) {
require_capability('moodle/course:visibility', $coursecontext);
// Set the visibility of the course. we set the old flag when user manually changes visibility of course.
$DB->update_record('course', array('id' => $course->id, 'visible' => $visible, 'visibleold' => $visible, 'timemodified' => time()));
add_to_log($course->id, "course", ($visible ? 'show' : 'hide'), "edit.php?id=$course->id", $course->id);
}
}
@@ -172,6 +173,7 @@ if ($editingon && $sesskeyprovided) {
}
$DB->set_field('course', 'sortorder', $swapcourse->sortorder, array('id' => $movecourse->id));
$DB->set_field('course', 'sortorder', $movecourse->sortorder, array('id' => $swapcourse->id));
add_to_log($movecourse->id, "course", "move", "edit.php?id=$movecourse->id", $movecourse->id);
}
}
@@ -191,6 +193,7 @@ if ($editingon && can_edit_in_category()) {
// Integrate into the admin tree only if the user can edit categories at the top level,
// otherwise the admin block does not appear to this user, and you get an error.
require_once($CFG->libdir . '/adminlib.php');
navigation_node::override_active_url(new moodle_url('/course/category.php', array('id' => $id)));
admin_externalpage_setup('coursemgmt', '', $urlparams, $CFG->wwwroot . '/course/category.php');
$PAGE->set_context($context); // Ensure that we are actually showing blocks etc for the cat context
@@ -434,8 +437,11 @@ if (!$courses) {
$movetocategories[$category->id] = get_string('moveselectedcoursesto');
echo '<tr><td colspan="3" align="right">';
echo html_writer::label(get_string('moveselectedcoursesto'), 'movetoid', false, array('class' => 'accesshide'));
echo html_writer::select($movetocategories, 'moveto', $category->id, null, array('id'=>'movetoid'));
$PAGE->requires->js_init_call('M.util.init_select_autosubmit', array('movecourses', 'movetoid', false));
echo html_writer::select($movetocategories, 'moveto', $category->id, null, array('id'=>'movetoid', 'class' => 'autosubmit'));
$PAGE->requires->yui_module('moodle-core-formautosubmit',
'M.core.init_formautosubmit',
array(array('selectid' => 'movetoid', 'nothing' => $category->id))
);
echo '<input type="hidden" name="id" value="'.$category->id.'" />';
echo '</td></tr>';
}
+7 -1
View File
@@ -548,7 +548,7 @@ M.course_dndupload = {
var extension = '';
var dotpos = file.name.lastIndexOf('.');
if (dotpos != -1) {
extension = file.name.substr(dotpos+1, file.name.length);
extension = file.name.substr(dotpos+1, file.name.length).toLowerCase();
}
for (var i=0; i<filehandlers.length; i++) {
@@ -728,6 +728,9 @@ M.course_dndupload = {
resel.icon.src = result.icon;
resel.a.href = result.link;
resel.namespan.innerHTML = result.name;
if (!parseInt(result.visible, 10)) {
resel.a.className = 'dimmed';
}
if (result.groupingname) {
resel.groupingspan.innerHTML = '(' + result.groupingname + ')';
@@ -915,6 +918,9 @@ M.course_dndupload = {
resel.icon.src = result.icon;
resel.a.href = result.link;
resel.namespan.innerHTML = result.name;
if (!parseInt(result.visible, 10)) {
resel.a.className = 'dimmed';
}
if (result.groupingname) {
resel.groupingspan.innerHTML = '(' + result.groupingname + ')';
+18 -2
View File
@@ -555,6 +555,15 @@ class dndupload_ajax_processor {
$this->cm->groupmode = $this->course->groupmode;
$this->cm->groupingid = $this->course->defaultgroupingid;
// Set the correct default for completion tracking.
$this->cm->completion = COMPLETION_TRACKING_NONE;
$completion = new completion_info($this->course);
if ($completion->is_enabled()) {
if (plugin_supports('mod', $this->cm->modulename, FEATURE_MODEDIT_DEFAULT_COMPLETION, true)) {
$this->cm->completion = COMPLETION_TRACKING_MANUAL;
}
}
if (!$this->cm->id = add_course_module($this->cm)) {
throw new coding_exception("Unable to create the course module");
}
@@ -611,12 +620,18 @@ class dndupload_ajax_processor {
throw new moodle_exception('errorcreatingactivity', 'moodle', '', $this->module->name);
}
// Note the section visibility
$visible = get_fast_modinfo($this->course)->get_section_info($this->section)->visible;
$DB->set_field('course_modules', 'instance', $instanceid, array('id' => $this->cm->id));
$sectionid = add_mod_to_section($this->cm);
$DB->set_field('course_modules', 'section', $sectionid, array('id' => $this->cm->id));
set_coursemodule_visible($this->cm->id, true);
set_coursemodule_visible($this->cm->id, $visible);
if (!$visible) {
$DB->set_field('course_modules', 'visibleold', 1, array('id' => $this->cm->id));
}
// Rebuild the course cache and retrieve the final info about this module.
rebuild_course_cache($this->course->id, true);
@@ -627,7 +642,7 @@ class dndupload_ajax_processor {
delete_course_module($this->cm->id);
throw new moodle_exception('errorcreatingactivity', 'moodle', '', $this->module->name);
}
$mod = $info->cms[$this->cm->id];
$mod = $info->get_cm($this->cm->id);
$mod->groupmodelink = $this->cm->groupmodelink;
$mod->groupmode = $this->cm->groupmode;
@@ -666,6 +681,7 @@ class dndupload_ajax_processor {
$resp->elementid = 'module-'.$mod->id;
$resp->commands = make_editing_buttons($mod, true, true, 0, $mod->sectionnum);
$resp->onclick = $mod->get_on_click();
$resp->visible = $mod->visible;
// if using groupings, then display grouping name
if (!empty($mod->groupingid) && has_capability('moodle/course:managegroups', $this->context)) {
+7 -13
View File
@@ -32,7 +32,11 @@ $categoryid = optional_param('category', 0, PARAM_INT); // course category - can
$returnto = optional_param('returnto', 0, PARAM_ALPHANUM); // generic navigation return page switch
$PAGE->set_pagelayout('admin');
$PAGE->set_url('/course/edit.php');
$pageparams = array('id'=>$id);
if (empty($id)) {
$pageparams = array('category'=>$categoryid);
}
$PAGE->set_url('/course/edit.php', $pageparams);
// basic access control checks
if ($id) { // editing course
@@ -46,7 +50,6 @@ if ($id) { // editing course
$category = $DB->get_record('course_categories', array('id'=>$course->category), '*', MUST_EXIST);
$coursecontext = get_context_instance(CONTEXT_COURSE, $course->id);
require_capability('moodle/course:update', $coursecontext);
$PAGE->url->param('id',$id);
} else if ($categoryid) { // creating new course in this category
$course = null;
@@ -54,7 +57,6 @@ if ($id) { // editing course
$category = $DB->get_record('course_categories', array('id'=>$categoryid), '*', MUST_EXIST);
$catcontext = get_context_instance(CONTEXT_COURSECAT, $category->id);
require_capability('moodle/course:create', $catcontext);
$PAGE->url->param('category',$categoryid);
$PAGE->set_context($catcontext);
} else {
@@ -128,16 +130,8 @@ if ($editform->is_cancelled()) {
}
rebuild_course_cache($course->id);
switch ($returnto) {
case 'category':
case 'topcat': //redirecting to where the new course was created by default.
$url = new moodle_url($CFG->wwwroot.'/course/category.php', array('id'=>$categoryid));
break;
default:
$url = new moodle_url($CFG->wwwroot.'/course/view.php', array('id'=>$course->id));
break;
}
redirect($url);
// Redirect user to newly created/updated course.
redirect(new moodle_url('/course/view.php', array('id' => $course->id)));
}
+6 -2
View File
@@ -126,7 +126,11 @@ class course_edit_form extends moodleform {
$mform->addHelpButton('coursedisplay', 'coursedisplay');
$mform->setDefault('coursedisplay', $courseconfig->coursedisplay);
for ($i = 0; $i <= $courseconfig->maxsections; $i++) {
$max = $courseconfig->maxsections;
if (!isset($max) || !is_numeric($max)) {
$max = 52;
}
for ($i = 0; $i <= $max; $i++) {
$sectionmenu[$i] = "$i";
}
$mform->addElement('select', 'numsections', get_string('numberweeks'), $sectionmenu);
@@ -253,7 +257,7 @@ class course_edit_form extends moodleform {
array(0=>get_string('completiondisabled','completion'), 1=>get_string('completionenabled','completion')));
$mform->setDefault('enablecompletion', $courseconfig->enablecompletion);
$mform->addElement('checkbox', 'completionstartonenrol', get_string('completionstartonenrol', 'completion'));
$mform->addElement('advcheckbox', 'completionstartonenrol', get_string('completionstartonenrol', 'completion'));
$mform->setDefault('completionstartonenrol', $courseconfig->completionstartonenrol);
$mform->disabledIf('completionstartonenrol', 'enablecompletion', 'eq', 0);
} else {
+3
View File
@@ -102,6 +102,7 @@ if ($mform->is_cancelled()) {
$newcategory->theme = $data->theme;
}
$logaction = 'update';
if ($id) {
// Update an existing category.
$newcategory->id = $category->id;
@@ -119,10 +120,12 @@ if ($mform->is_cancelled()) {
$category = create_course_category($newcategory);
$newcategory->id = $category->id;
$categorycontext = $category->context;
$logaction = 'add';
}
$newcategory = file_postupdate_standard_editor($newcategory, 'description', $editoroptions, $categorycontext, 'coursecat', 'description', 0);
$DB->update_record('course_categories', $newcategory);
add_to_log(SITEID, "category", $logaction, "editcategory.php?id=$newcategory->id", $newcategory->id);
fix_course_sortorder();
redirect('category.php?id='.$newcategory->id.'&categoryedit=on');
+1 -1
View File
@@ -57,7 +57,7 @@ if (!empty($CFG->enableavailability)) {
}
$mform = new editsection_form($PAGE->url, array('course' => $course, 'editoroptions' => $editoroptions,
'cs' => $section, 'showavailability' => $section->showavailability));
'cs' => $section));
$mform->set_data($section); // set current value
$returnurl = course_get_url($course, $sectionreturn);
+49 -9
View File
@@ -12,10 +12,13 @@ class editsection_form extends moodleform {
$mform = $this->_form;
$course = $this->_customdata['course'];
$mform->addElement('checkbox', 'usedefaultname', get_string('sectionusedefaultname'));
$mform->setDefault('usedefaultname', true);
$mform->addElement('text', 'name', get_string('sectionname'), array('size'=>'30'));
$elementgroup = array();
$elementgroup[] = $mform->createElement('text', 'name', '', array('size' => '30'));
$elementgroup[] = $mform->createElement('checkbox', 'usedefaultname', '', get_string('sectionusedefaultname'));
$mform->addGroup($elementgroup, 'name_group', get_string('sectionname'), ' ', false);
$mform->setDefault('usedefaultname', true);
$mform->setType('name', PARAM_TEXT);
$mform->disabledIf('name','usedefaultname','checked');
@@ -54,11 +57,19 @@ class editsection_form extends moodleform {
$mform->addHelpButton('groupingid', 'groupingsection', 'group');
}
// Date and time conditions
// Available from/to defaults to midnight because then the display
// will be nicer where it tells users when they can access it (it
// shows only the date and not time).
$date = usergetdate(time());
$midnight = make_timestamp($date['year'], $date['mon'], $date['mday']);
// Date and time conditions.
$mform->addElement('date_time_selector', 'availablefrom',
get_string('availablefrom', 'condition'), array('optional' => true));
get_string('availablefrom', 'condition'),
array('optional' => true, 'defaulttime' => $midnight));
$mform->addElement('date_time_selector', 'availableuntil',
get_string('availableuntil', 'condition'), array('optional' => true));
get_string('availableuntil', 'condition'),
array('optional' => true, 'defaulttime' => $midnight));
// Conditions based on grades
$gradeoptions = array();
@@ -162,8 +173,6 @@ class editsection_form extends moodleform {
CONDITION_STUDENTVIEW_HIDE => get_string('showavailabilitysection_hide', 'condition'));
$mform->addElement('select', 'showavailability',
get_string('showavailabilitysection', 'condition'), $showhide);
$mform->setDefault('showavailability', $this->_customdata['showavailability']);
}
$this->add_action_buttons();
@@ -174,10 +183,41 @@ class editsection_form extends moodleform {
// Conditions: Don't let them set dates which make no sense
if (array_key_exists('availablefrom', $data) &&
$data['availablefrom'] && $data['availableuntil'] &&
$data['availablefrom'] > $data['availableuntil']) {
$data['availablefrom'] >= $data['availableuntil']) {
$errors['availablefrom'] = get_string('badavailabledates', 'condition');
}
// Conditions: Verify that the grade conditions are numbers, and make sense.
if (array_key_exists('conditiongradegroup', $data)) {
foreach ($data['conditiongradegroup'] as $i => $gradedata) {
if ($gradedata['conditiongrademin'] !== '' &&
!is_numeric(unformat_float($gradedata['conditiongrademin']))) {
$errors["conditiongradegroup[{$i}]"] = get_string('gradesmustbenumeric', 'condition');
continue;
}
if ($gradedata['conditiongrademax'] !== '' &&
!is_numeric(unformat_float($gradedata['conditiongrademax']))) {
$errors["conditiongradegroup[{$i}]"] = get_string('gradesmustbenumeric', 'condition');
continue;
}
if ($gradedata['conditiongrademin'] !== '' && $gradedata['conditiongrademax'] !== '' &&
unformat_float($gradedata['conditiongrademax']) <= unformat_float($gradedata['conditiongrademin'])) {
$errors["conditiongradegroup[{$i}]"] = get_string('badgradelimits', 'condition');
continue;
}
if ($gradedata['conditiongrademin'] === '' && $gradedata['conditiongrademax'] === '' &&
$gradedata['conditiongradeitemid']) {
$errors["conditiongradegroup[{$i}]"] = get_string('gradeitembutnolimits', 'condition');
continue;
}
if (($gradedata['conditiongrademin'] !== '' || $gradedata['conditiongrademax'] !== '') &&
!$gradedata['conditiongradeitemid']) {
$errors["conditiongradegroup[{$i}]"] = get_string('gradelimitsbutnoitem', 'condition');
continue;
}
}
}
return $errors;
}
}
+1 -2
View File
@@ -212,7 +212,7 @@ class core_course_external extends external_api {
array(
'id' => new external_value(PARAM_INT, 'activity id'),
'url' => new external_value(PARAM_URL, 'activity url', VALUE_OPTIONAL),
'name' => new external_value(PARAM_TEXT, 'activity module name'),
'name' => new external_value(PARAM_RAW, 'activity module name'),
'description' => new external_value(PARAM_RAW, 'activity description', VALUE_OPTIONAL),
'visible' => new external_value(PARAM_INT, 'is the module visible', VALUE_OPTIONAL),
'modicon' => new external_value(PARAM_URL, 'activity icon url'),
@@ -1254,7 +1254,6 @@ class core_course_external extends external_api {
$newcategory = new stdClass();
$newcategory->name = $category['name'];
$newcategory->parent = $category['parent'];
$newcategory->sortorder = 999; // Same as in the course/editcategory.php .
// Format the description.
if (!empty($category['description'])) {
$newcategory->description = $category['description'];
+38 -14
View File
@@ -175,7 +175,8 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
}
$o.= html_writer::end_tag('div');
$o .= $this->section_availability_message($section);
$o .= $this->section_availability_message($section,
has_capability('moodle/course:viewhiddensections', $context));
return $o;
}
@@ -305,7 +306,9 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
$o.= html_writer::end_tag('div');
$o.= $this->section_activity_summary($section, $course, $mods);
$o.= $this->section_availability_message($section);
$context = context_course::instance($course->id);
$o .= $this->section_availability_message($section,
has_capability('moodle/course:viewhiddensections', $context));
$o .= html_writer::end_tag('div');
$o .= html_writer::end_tag('li');
@@ -388,22 +391,42 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
}
/**
* If section is not visible to current user, display the message about that
* ('Not available until...', that sort of thing). Otherwise, returns blank.
* If section is not visible, display the message about that ('Not available
* until...', that sort of thing). Otherwise, returns blank.
*
* For users with the ability to view hidden sections, it shows the
* information even though you can view the section and also may include
* slightly fuller information (so that teachers can tell when sections
* are going to be unavailable etc). This logic is the same as for
* activities.
*
* @param stdClass $section The course_section entry from DB
* @param bool $canviewhidden True if user can view hidden sections
* @return string HTML to output
*/
protected function section_availability_message($section) {
protected function section_availability_message($section, $canviewhidden) {
global $CFG;
$o = '';
if (!$section->uservisible || $section->availableinfo) {
if (!$section->uservisible) {
$o .= html_writer::start_tag('div', array('class' => 'availabilityinfo'));
if (!empty($section->availableinfo)) {
$o .= $section->availableinfo;
} else {
$o .= get_string('notavailable');
}
// Note: We only get to this function if availableinfo is non-empty,
// so there is definitely something to print.
$o .= $section->availableinfo;
$o .= html_writer::end_tag('div');
} else if ($canviewhidden && !empty($CFG->enableavailability) && $section->visible) {
// The CONDITION_MISSING_EXTRATABLE is to hide a performance warning that
// only applies in 2.3 because of the way we construct section objects on
// the FIRST view of a course. In future views, we shouldn't have anything
// missing.
$ci = new condition_info_section($section, CONDITION_MISSING_EXTRATABLE);
$fullinfo = $ci->get_full_information();
if ($fullinfo) {
$o .= html_writer::start_tag('div', array('class' => 'availabilityinfo'));
$o .= get_string(
($section->showavailability ? 'userrestriction_visible' : 'userrestriction_hidden'),
'condition', $fullinfo);
$o .= html_writer::end_tag('div');
}
}
return $o;
}
@@ -677,9 +700,10 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
$thissection->showavailability = 0;
}
// Show the section if the user is permitted to access it, OR if it's not available
// but showavailability is turned on
// but showavailability is turned on (and there is some available info text).
$showsection = $thissection->uservisible ||
($thissection->visible && !$thissection->available && $thissection->showavailability);
($thissection->visible && !$thissection->available && $thissection->showavailability
&& !empty($thissection->availableinfo));
if (!$showsection) {
// Hidden section message is overridden by 'unavailable' control
// (showavailability option).
@@ -716,7 +740,7 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
continue;
}
echo $this->stealth_section_header($section);
print_section($course, $thissection, $mods, $modnamesused, true, "100%", false, $displaysection);
print_section($course, $thissection, $mods, $modnamesused, true, "100%", false, 0);
echo $this->stealth_section_footer();
}
+22 -2
View File
@@ -40,7 +40,7 @@ M.course.format.swap_sections = function(Y, node1, node2) {
};
var sectionlist = Y.Node.all('.'+CSS.COURSECONTENT+' '+M.course.format.get_section_selector(Y));
// Swap menus
// Swap menus.
sectionlist.item(node1).one('.'+CSS.SECTIONADDMENUS).swap(sectionlist.item(node2).one('.'+CSS.SECTIONADDMENUS));
}
@@ -56,12 +56,32 @@ M.course.format.swap_sections = function(Y, node1, node2) {
M.course.format.process_sections = function(Y, sectionlist, response, sectionfrom, sectionto) {
var CSS = {
SECTIONNAME : 'sectionname'
},
SELECTORS = {
SECTIONLEFTSIDE : '.left .section-handle img'
};
if (response.action == 'move') {
// update titles in all affected sections
// If moving up swap around 'sectionfrom' and 'sectionto' so the that loop operates.
if (sectionfrom > sectionto) {
var temp = sectionto;
sectionto = sectionfrom;
sectionfrom = temp;
}
// Update titles and move icons in all affected sections.
var ele, str, stridx, newstr;
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');
stridx = str.lastIndexOf(' ');
newstr = str.substr(0, stridx +1) + i;
ele.setAttribute('alt', newstr);
ele.setAttribute('title', newstr); // For FireFox as 'alt' is not refreshed.
}
}
}
+22 -2
View File
@@ -40,7 +40,7 @@ M.course.format.swap_sections = function(Y, node1, node2) {
};
var sectionlist = Y.Node.all('.'+CSS.COURSECONTENT+' '+M.course.format.get_section_selector(Y));
// Swap menus
// Swap menus.
sectionlist.item(node1).one('.'+CSS.SECTIONADDMENUS).swap(sectionlist.item(node2).one('.'+CSS.SECTIONADDMENUS));
}
@@ -56,12 +56,32 @@ M.course.format.swap_sections = function(Y, node1, node2) {
M.course.format.process_sections = function(Y, sectionlist, response, sectionfrom, sectionto) {
var CSS = {
SECTIONNAME : 'sectionname'
},
SELECTORS = {
SECTIONLEFTSIDE : '.left .section-handle img'
};
if (response.action == 'move') {
// update titles in all affected sections
// If moving up swap around 'sectionfrom' and 'sectionto' so the that loop operates.
if (sectionfrom > sectionto) {
var temp = sectionto;
sectionto = sectionfrom;
sectionfrom = temp;
}
// Update titles and move icons in all affected sections.
var ele, str, stridx, newstr;
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');
stridx = str.lastIndexOf(' ');
newstr = str.substr(0, stridx +1) + i;
ele.setAttribute('alt', newstr);
ele.setAttribute('title', newstr); // For FireFox as 'alt' is not refreshed.
}
}
}
+8 -9
View File
@@ -67,12 +67,11 @@ $straction = get_string('action');
$strfulllistofcourses = get_string('fulllistofcourses');
/// Unless it's an editing admin, just print the regular listing of courses/categories
// Unless it's an editing admin, just print the regular listing of courses/categories.
if (!$adminediting) {
/// Print form for creating new categories
$showaddcoursebutton = true;
// Print form for creating new categories.
$countcategories = $DB->count_records('course_categories');
if ($countcategories > 1 || ($countcategories == 1 && $DB->count_records('course') > 200)) {
$strcourses = get_string('courses');
$strcategories = get_string('categories');
@@ -96,14 +95,13 @@ if (!$adminediting) {
echo $OUTPUT->header();
echo $OUTPUT->skip_link_target();
echo $OUTPUT->box_start('courseboxes');
print_courses(0);
$showaddcoursebutton = print_courses(0);
echo $OUTPUT->box_end();
}
echo $OUTPUT->container_start('buttons');
if (has_capability('moodle/course:create', $systemcontext)) {
/// Print link to create a new course
/// Get the 1st available category
if (has_capability('moodle/course:create', $systemcontext) && $showaddcoursebutton) {
// Print link to create a new course, for the 1st available category.
$options = array('category' => $CFG->defaultrequestcategory);
echo $OUTPUT->single_button(new moodle_url('edit.php', $options), get_string('addnewcourse'), 'get');
}
@@ -232,6 +230,7 @@ if ((!empty($moveup) or !empty($movedown)) 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));
add_to_log(SITEID, "category", "move", "editcategory.php?id=$movecategory->id", $movecategory->id);
}
// finally reorder courses
@@ -254,7 +253,7 @@ $parentlist = array();
$displaylist[0] = get_string('top');
make_categories_list($displaylist, $parentlist);
echo '<table class="generalbox editcourse boxaligncenter"><tr class="header">';
echo '<table class="generaltable editcourse boxaligncenter"><tr class="header">';
echo '<th class="header" scope="col">'.$strcategories.'</th>';
echo '<th class="header" scope="col">'.$strcourses.'</th>';
echo '<th class="header" scope="col">'.$stredit.'</th>';
+109 -55
View File
@@ -60,6 +60,7 @@ function make_log_url($module, $url) {
case 'lib':
case 'admin':
case 'calendar':
case 'category':
case 'mnet course':
if (strpos($url, '../') === 0) {
$url = ltrim($url, '.');
@@ -583,7 +584,7 @@ function print_log_csv($course, $user, $date, $order='l.time DESC', $modname,
$ld = $DB->get_record('log_display', array('module'=>$log->module, 'action'=>$log->action));
$ldcache[$log->module][$log->action] = $ld;
}
if ($ld && !empty($log->info)) {
if ($ld && is_numeric($log->info)) {
// ugly hack to make sure fullname is shown correctly
if (($ld->mtable == 'user') and ($ld->field == $DB->sql_concat('firstname', "' '" , 'lastname'))) {
$log->info = fullname($DB->get_record($ld->mtable, array('id'=>$log->info)), true);
@@ -600,7 +601,7 @@ function print_log_csv($course, $user, $date, $order='l.time DESC', $modname,
$firstField = format_string($courses[$log->course], true, array('context' => $coursecontext));
$fullname = fullname($log, has_capability('moodle/site:viewfullnames', $coursecontext));
$row = array($firstField, userdate($log->time, $strftimedatetime), $log->ip, $fullname, $log->module.' '.$log->action, $log->info);
$actionurl = $CFG->wwwroot. make_log_url($log->module,$log->url);
$actionurl = $CFG->wwwroot. make_log_url($log->module,$log->url);
$row = array($firstField, userdate($log->time, $strftimedatetime), $log->ip, $fullname, $log->module.' '.$log->action.' ('.$actionurl.')', $log->info);
$text = implode("\t", $row);
echo $text." \n";
@@ -655,7 +656,7 @@ function print_log_xls($course, $user, $date, $order='l.time DESC', $modname,
// Creating worksheets
for ($wsnumber = 1; $wsnumber <= $nroPages; $wsnumber++) {
$sheettitle = get_string('logs').' '.$wsnumber.'-'.$nroPages;
$worksheet[$wsnumber] =& $workbook->add_worksheet($sheettitle);
$worksheet[$wsnumber] = $workbook->add_worksheet($sheettitle);
$worksheet[$wsnumber]->set_column(1, 1, 30);
$worksheet[$wsnumber]->write_string(0, 0, get_string('savedat').
userdate(time(), $strftimedatetime));
@@ -684,7 +685,7 @@ function print_log_xls($course, $user, $date, $order='l.time DESC', $modname,
$ld = $DB->get_record('log_display', array('module'=>$log->module, 'action'=>$log->action));
$ldcache[$log->module][$log->action] = $ld;
}
if ($ld && !empty($log->info)) {
if ($ld && is_numeric($log->info)) {
// ugly hack to make sure fullname is shown correctly
if (($ld->mtable == 'user') and ($ld->field == $DB->sql_concat('firstname', "' '" , 'lastname'))) {
$log->info = fullname($DB->get_record($ld->mtable, array('id'=>$log->info)), true);
@@ -769,7 +770,7 @@ function print_log_ods($course, $user, $date, $order='l.time DESC', $modname,
// Creating worksheets
for ($wsnumber = 1; $wsnumber <= $nroPages; $wsnumber++) {
$sheettitle = get_string('logs').' '.$wsnumber.'-'.$nroPages;
$worksheet[$wsnumber] =& $workbook->add_worksheet($sheettitle);
$worksheet[$wsnumber] = $workbook->add_worksheet($sheettitle);
$worksheet[$wsnumber]->set_column(1, 1, 30);
$worksheet[$wsnumber]->write_string(0, 0, get_string('savedat').
userdate(time(), $strftimedatetime));
@@ -798,7 +799,7 @@ function print_log_ods($course, $user, $date, $order='l.time DESC', $modname,
$ld = $DB->get_record('log_display', array('module'=>$log->module, 'action'=>$log->action));
$ldcache[$log->module][$log->action] = $ld;
}
if ($ld && !empty($log->info)) {
if ($ld && is_numeric($log->info)) {
// ugly hack to make sure fullname is shown correctly
if (($ld->mtable == 'user') and ($ld->field == $DB->sql_concat('firstname', "' '" , 'lastname'))) {
$log->info = fullname($DB->get_record($ld->mtable, array('id'=>$log->info)), true);
@@ -1484,15 +1485,16 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
$modcontext = context_module::instance($mod->id);
$canviewhidden = has_capability('moodle/course:viewhiddenactivities', $modcontext);
$accessiblebutdim = false;
$conditionalhidden = false;
if ($canviewhidden) {
$accessiblebutdim = !$mod->visible;
if (!empty($CFG->enableavailability)) {
$accessiblebutdim = $accessiblebutdim ||
$mod->availablefrom > time() ||
$conditionalhidden = $mod->availablefrom > time() ||
($mod->availableuntil && $mod->availableuntil < time()) ||
count($mod->conditionsgrade) > 0 ||
count($mod->conditionscompletion) > 0;
}
$accessiblebutdim = $conditionalhidden || $accessiblebutdim;
}
$liclasses = array();
@@ -1548,8 +1550,12 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
$linkclasses = '';
$textclasses = '';
if ($accessiblebutdim) {
$linkclasses .= ' dimmed conditionalhidden';
$textclasses .= ' dimmed_text conditionalhidden';
$linkclasses .= ' dimmed';
$textclasses .= ' dimmed_text';
if ($conditionalhidden) {
$linkclasses .= ' conditionalhidden';
$textclasses .= ' conditionalhidden';
}
$accesstext = '<span class="accesshide">'.
get_string('hiddenfromstudents').': </span>';
} else {
@@ -1705,14 +1711,25 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
} else {
$extraclass = '';
}
echo "
<form class='togglecompletion$extraclass' method='post' action='".$CFG->wwwroot."/course/togglecompletion.php'><div>
<input type='hidden' name='id' value='{$mod->id}' />
<input type='hidden' name='modulename' value='".s($mod->name)."' />
<input type='hidden' name='sesskey' value='".sesskey()."' />
<input type='hidden' name='completionstate' value='$newstate' />
<input type='image' src='$imgsrc' alt='$imgalt' title='$imgtitle' />
</div></form>";
echo html_writer::start_tag('form', array(
'class' => 'togglecompletion' . $extraclass,
'method' => 'post',
'action' => $CFG->wwwroot . '/course/togglecompletion.php'));
echo html_writer::start_tag('div');
echo html_writer::empty_tag('input', array(
'type' => 'hidden', 'name' => 'id', 'value' => $mod->id));
echo html_writer::empty_tag('input', array(
'type' => 'hidden', 'name' => 'modulename',
'value' => $mod->name));
echo html_writer::empty_tag('input', array(
'type' => 'hidden', 'name' => 'sesskey', 'value' => sesskey()));
echo html_writer::empty_tag('input', array(
'type' => 'hidden', 'name' => 'completionstate',
'value' => $newstate));
echo html_writer::empty_tag('input', array(
'type' => 'image', 'src' => $imgsrc, 'alt' => $imgalt, 'title' => $imgtitle));
echo html_writer::end_tag('div');
echo html_writer::end_tag('form');
} else {
// In auto mode, or when editing, the icon is just an image
echo "<span class='autocompletion'>";
@@ -1732,17 +1749,20 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
if (!$mod->uservisible) {
echo '<div class="availabilityinfo">'.$mod->availableinfo.'</div>';
} else if ($canviewhidden && !empty($CFG->enableavailability)) {
$visibilityclass = '';
if (!$mod->visible) {
$visibilityclass = 'accesshide';
}
$ci = new condition_info($mod);
$fullinfo = $ci->get_full_information();
if($fullinfo) {
echo '<div class="availabilityinfo '.$visibilityclass.'">'.get_string($mod->showavailability
? 'userrestriction_visible'
: 'userrestriction_hidden','condition',
$fullinfo).'</div>';
// Don't add availability information if user is not editing and activity is hidden.
if ($mod->visible || $PAGE->user_is_editing()) {
$hidinfoclass = '';
if (!$mod->visible) {
$hidinfoclass = 'hide';
}
$ci = new condition_info($mod);
$fullinfo = $ci->get_full_information();
if($fullinfo) {
echo '<div class="availabilityinfo '.$hidinfoclass.'">'.get_string($mod->showavailability
? 'userrestriction_visible'
: 'userrestriction_hidden','condition',
$fullinfo).'</div>';
}
}
}
@@ -1864,7 +1884,7 @@ function print_section_add_menus($course, $section, $modnames, $vertical=false,
// The module chooser link
$modchooser = html_writer::start_tag('div', array('class' => 'mdl-right'));
$modchooser.= html_writer::start_tag('div', array('class' => 'section-modchooser'));
$icon = $OUTPUT->pix_icon('t/add', $straddeither);
$icon = $OUTPUT->pix_icon('t/add', '');
$span = html_writer::tag('span', $straddeither, array('class' => 'section-modchooser-text'));
$modchooser .= html_writer::tag('span', $icon . $span, array('class' => 'section-modchooser-link'));
$modchooser.= html_writer::end_tag('div');
@@ -1916,7 +1936,7 @@ function get_module_metadata($course, $modnames, $sectionreturn = null) {
if (!course_allowed_module($course, $modname)) {
continue;
}
if (isset($modlist[$modname])) {
if (isset($modlist[$course->id][$modname])) {
// This module is already cached
$return[$modname] = $modlist[$course->id][$modname];
continue;
@@ -1932,7 +1952,8 @@ function get_module_metadata($course, $modnames, $sectionreturn = null) {
// NOTE: this is legacy stuff, module subtypes are very strongly discouraged!!
$gettypesfunc = $modname.'_get_types';
if (function_exists($gettypesfunc)) {
if ($types = $gettypesfunc()) {
$types = $gettypesfunc();
if (is_array($types) && count($types) > 0) {
$group = new stdClass();
$group->name = $modname;
$group->icon = $OUTPUT->pix_icon('icon', '', $modname, array('class' => 'icon'));
@@ -1981,7 +2002,11 @@ function get_module_metadata($course, $modnames, $sectionreturn = null) {
$module->archetype = plugin_supports('mod', $modname, FEATURE_MOD_ARCHETYPE, MOD_ARCHETYPE_OTHER);
$modlist[$course->id][$modname] = $module;
}
$return[$modname] = $modlist[$course->id][$modname];
if (isset($modlist[$course->id][$modname])) {
$return[$modname] = $modlist[$course->id][$modname];
} else {
debugging("Invalid module metadata configuration for {$modname}");
}
}
return $return;
@@ -2438,7 +2463,9 @@ function update_category_button($categoryid = 0) {
}
/**
* Category is 0 (for all courses) or an object
* Print courses in category. If category is 0 then all courses are printed.
* @param int|stdClass $category category object or id.
* @return bool true if courses found and printed, else false.
*/
function print_courses($category) {
global $CFG, $OUTPUT;
@@ -2486,8 +2513,10 @@ function print_courses($category) {
echo html_writer::start_tag('div', array('class'=>'addcoursebutton'));
echo $OUTPUT->single_button(new moodle_url('/course/edit.php', $options), get_string("addnewcourse"));
echo html_writer::end_tag('div');
return false;
}
}
return true;
}
/**
@@ -2587,6 +2616,7 @@ function print_course($course, $highlightterms = '') {
if ($icons = enrol_get_course_info_icons($course)) {
echo html_writer::start_tag('div', array('class'=>'enrolmenticons'));
foreach ($icons as $icon) {
$icon->attributes["alt"] .= ": ". format_string($coursename, true, array('context'=>$context));
echo $OUTPUT->render($icon);
}
echo html_writer::end_tag('div'); // End of enrolmenticons div
@@ -2689,14 +2719,14 @@ function print_course_search($value="", $return=false, $format="plain") {
$output = '<form id="'.$id.'" action="'.$CFG->wwwroot.'/course/search.php" method="get">';
$output .= '<fieldset class="coursesearchbox invisiblefieldset">';
$output .= '<label for="shortsearchbox">'.$strsearchcourses.': </label>';
$output .= '<input type="text" id="shortsearchbox" size="12" name="search" alt="'.s($strsearchcourses).'" value="'.s($value).'" />';
$output .= '<input type="text" id="shortsearchbox" size="12" name="search" value="'.s($value).'" />';
$output .= '<input type="submit" value="'.get_string('go').'" />';
$output .= '</fieldset></form>';
} else if ($format == 'navbar') {
$output = '<form id="coursesearchnavbar" action="'.$CFG->wwwroot.'/course/search.php" method="get">';
$output .= '<fieldset class="coursesearchbox invisiblefieldset">';
$output .= '<label for="navsearchbox">'.$strsearchcourses.': </label>';
$output .= '<input type="text" id="navsearchbox" size="20" name="search" alt="'.s($strsearchcourses).'" value="'.s($value).'" />';
$output .= '<input type="text" id="navsearchbox" size="20" name="search" value="'.s($value).'" />';
$output .= '<input type="submit" value="'.get_string('go').'" />';
$output .= '</fieldset></form>';
}
@@ -2818,6 +2848,7 @@ function add_mod_to_section($mod, $beforemod=NULL) {
}
$DB->set_field("course_sections", "sequence", $newsequence, array("id"=>$section->id));
$DB->set_field("course_modules", "section", $section->id, array("id" => $mod->coursemodule));
return $section->id; // Return course_sections ID that was used.
} else { // Insert a new record
@@ -2827,7 +2858,9 @@ function add_mod_to_section($mod, $beforemod=NULL) {
$section->summary = "";
$section->summaryformat = FORMAT_HTML;
$section->sequence = $mod->coursemodule;
return $DB->insert_record("course_sections", $section);
$section->id = $DB->insert_record("course_sections", $section);
$DB->set_field("course_modules", "section", $section->id, array("id" => $mod->coursemodule));
return $section->id;
}
}
@@ -2855,6 +2888,13 @@ function set_coursemodule_visible($id, $visible, $prevstateoverrides=false) {
if (!$cm = $DB->get_record('course_modules', array('id'=>$id))) {
return false;
}
// Create events and propagate visibility to associated grade items if the value has changed.
// Only do this if it's changed to avoid accidently overwriting manual showing/hiding of student grades.
if ($cm->visible == $visible) {
return true;
}
if (!$modulename = $DB->get_field('modules', 'name', array('id'=>$cm->module))) {
return false;
}
@@ -2868,7 +2908,7 @@ function set_coursemodule_visible($id, $visible, $prevstateoverrides=false) {
}
}
// hide the associated grade items so the teacher doesn't also have to go to the gradebook and hide them there
// Hide the associated grade items so the teacher doesn't also have to go to the gradebook and hide them there.
$grade_items = grade_item::fetch_all(array('itemtype'=>'mod', 'itemmodule'=>$modulename, 'iteminstance'=>$cm->instance, 'courseid'=>$cm->course));
if ($grade_items) {
foreach ($grade_items as $grade_item) {
@@ -3125,13 +3165,16 @@ function moveto_module($mod, $section, $beforemod=NULL) {
/// Update module itself if necessary
if ($mod->section != $section->id) {
$mod->section = $section->id;
$DB->update_record("course_modules", $mod);
// if moving to a hidden section then hide module
if (!$section->visible) {
set_coursemodule_visible($mod->id, 0);
}
// If moving to a hidden section then hide module.
if (!$section->visible && $mod->visible) {
// Set this in the object because it is sent as a response to ajax calls.
set_coursemodule_visible($mod->id, 0, true);
$mod->visible = 0;
}
if ($section->visible && !$mod->visible) {
set_coursemodule_visible($mod->id, 1, true);
// Set this in the object because it is sent as a response to ajax calls.
$mod->visible = $mod->visibleold;
}
/// Add the module into the new section
@@ -3464,6 +3507,7 @@ function category_delete_full($category, $showfeedback=true) {
// finally delete the category and it's context
$DB->delete_records('course_categories', array('id'=>$category->id));
delete_context(CONTEXT_COURSECAT, $category->id);
add_to_log(SITEID, "category", "delete", "index.php", "$category->name (ID $category->id)");
events_trigger('course_category_deleted', $category);
@@ -3519,6 +3563,7 @@ function category_delete_move($category, $newparentid, $showfeedback=true) {
// finally delete the category and it's context
$DB->delete_records('course_categories', array('id'=>$category->id));
delete_context(CONTEXT_COURSECAT, $category->id);
add_to_log(SITEID, "category", "delete", "index.php", "$category->name (ID $category->id)");
events_trigger('course_category_deleted', $category);
@@ -3565,6 +3610,7 @@ function move_courses($courseids, $categoryid) {
}
$DB->update_record('course', $course);
add_to_log($course->id, "course", "move", "edit.php?id=$course->id", $course->id);
$context = get_context_instance(CONTEXT_COURSE, $course->id);
context_moved($context, $newparent);
@@ -3597,6 +3643,7 @@ function course_category_hide($category) {
$DB->set_field('course', 'visible', 0, array('category' => $cat->id));
}
}
add_to_log(SITEID, "category", "hide", "editcategory.php?id=$category->id", $category->id);
}
/**
@@ -3620,6 +3667,7 @@ function course_category_show($category) {
$DB->execute("UPDATE {course} SET visible = visibleold WHERE category = ?", array($cat->id));
}
}
add_to_log(SITEID, "category", "show", "editcategory.php?id=$category->id", $category->id);
}
/**
@@ -3652,6 +3700,9 @@ function move_category($category, $newparentcat) {
// now make it last in new category
$DB->set_field('course_categories', 'sortorder', MAX_COURSES_IN_CATEGORY*MAX_COURSE_CATEGORIES, array('id'=>$category->id));
// Log action.
add_to_log(SITEID, "category", "move", "editcategory.php?id=$category->id", $category->id);
// and fix the sortorders
fix_course_sortorder();
@@ -4407,16 +4458,18 @@ class course_request {
* @param stdClass $currentcontext Current context of block
*/
function course_page_type_list($pagetype, $parentcontext, $currentcontext) {
// if above course context ,display all course fomats
list($currentcontext, $course, $cm) = get_context_info_array($currentcontext->id);
if ($course->id == SITEID) {
return array('*'=>get_string('page-x', 'pagetype'));
} else {
return array('*'=>get_string('page-x', 'pagetype'),
'course-*'=>get_string('page-course-x', 'pagetype'),
'course-view-*'=>get_string('page-course-view-x', 'pagetype')
);
// $currentcontext could be null, get_context_info_array() will throw an error if this is the case.
if (isset($currentcontext)) {
// if above course context ,display all course fomats
list($currentcontext, $course, $cm) = get_context_info_array($currentcontext->id);
if ($course->id == SITEID) {
return array('*'=>get_string('page-x', 'pagetype'));
}
}
return array('*'=>get_string('page-x', 'pagetype'),
'course-*'=>get_string('page-course-x', 'pagetype'),
'course-view-*'=>get_string('page-course-view-x', 'pagetype')
);
}
/**
@@ -4537,6 +4590,7 @@ function include_course_ajax($course, $usedmodules = array(), $enabledmodules =
'courseid' => $course->id,
'pagetype' => $PAGE->pagetype,
'pagelayout' => $PAGE->pagelayout,
'subpage' => $PAGE->subpage,
'regions' => $PAGE->blocks->get_regions(),
);
$PAGE->requires->yui_module('moodle-core-blocks', 'M.core_blocks.init_dragdrop', array($params), null, true);
@@ -4579,7 +4633,7 @@ function include_course_ajax($course, $usedmodules = array(), $enabledmodules =
// Add the module chooser
$PAGE->requires->yui_module('moodle-course-modchooser',
'M.course.init_chooser',
array(array('courseid' => $course->id))
array(array('courseid' => $course->id, 'closeButtonTitle' => get_string('close', 'editor')))
);
$PAGE->requires->strings_for_js(array(
'addresourceoractivity',
+1
View File
@@ -481,6 +481,7 @@ if ($mform->is_cancelled()) {
// make sure visibility is set correctly (in particular in calendar)
// note: allow them to set it even without moodle/course:activityvisibility
set_coursemodule_visible($fromform->coursemodule, $fromform->visible);
$DB->set_field('course_modules', 'visibleold', 1, array('id' => $fromform->coursemodule));
if (isset($fromform->cmidnumber)) { //label
// set cm idnumber - uniqueness is already verified by form validation
+1 -1
View File
@@ -332,7 +332,7 @@ abstract class moodleform_mod extends moodleform {
continue;
}
if ($gradedata['conditiongrademin'] !== '' && $gradedata['conditiongrademax'] !== '' &&
unformat_float($gradedata['conditiongrademax']) < unformat_float($gradedata['conditiongrademin'])) {
unformat_float($gradedata['conditiongrademax']) <= unformat_float($gradedata['conditiongrademin'])) {
$errors["conditiongradegroup[{$i}]"] = get_string('badgradelimits', 'condition');
continue;
}
+1 -1
View File
@@ -78,7 +78,7 @@ if ($backup->get_stage() !== backup_ui::STAGE_COMPLETE) {
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('publishcourseon', 'hub', !empty($hubname)?$hubname:$huburl), 3, 'main');
if ($backup->enforce_changed_dependencies()) {
echo $renderer->dependency_notification(get_string('dependenciesenforced', 'backup'));
debugging('Your settings have been altered due to unmet dependencies', DEBUG_DEVELOPER);
}
echo $renderer->progress_bar($backup->get_progress_bar());
echo $backup->display($renderer);
+3
View File
@@ -99,6 +99,9 @@ class recent_form extends moodleform {
$mform->addElement('select', 'user', get_string('participants'), $options);
$mform->setAdvanced('user');
} else {
// Default to no user.
$mform->addElement('hidden', 'user', 0);
}
$options = array(''=>get_string('allactivities'));
+10 -6
View File
@@ -123,6 +123,7 @@ class core_course_renderer extends plugin_renderer_base {
if ($hascourses) {
$content .= html_writer::start_tag('div', array('class'=>'courses'));
$coursecount = 0;
$strinfo = new lang_string('info');
foreach ($category->courses as $course) {
$classes = array('course');
$linkclass = 'course_link';
@@ -143,8 +144,9 @@ class core_course_renderer extends plugin_renderer_base {
}
if ($course->summary) {
$url = new moodle_url('/course/info.php', array('id' => $course->id));
$image = html_writer::empty_tag('img', array('src'=>$this->output->pix_url('i/info'), 'alt'=>$this->strings->summary));
$content .= html_writer::link(new moodle_url('/course/info.php', array('id'=>$course->id)), $image, array('title'=>$this->strings->summary));
$content .= $this->action_link($url, $image, new popup_action('click', $url, 'courseinfo'), array('title' => $this->strings->summary));
}
$content .= html_writer::end_tag('div');
$content .= html_writer::end_tag('div');
@@ -188,17 +190,19 @@ class core_course_renderer extends plugin_renderer_base {
// Put all options into one tag 'alloptions' to allow us to handle scrolling
$formcontent .= html_writer::start_tag('div', array('class' => 'alloptions'));
// Activities
$activities = array_filter($modules,
create_function('$mod', 'return ($mod->archetype !== MOD_CLASS_RESOURCE);'));
// Activities
$activities = array_filter($modules, function($mod) {
return ($mod->archetype !== MOD_ARCHETYPE_RESOURCE && $mod->archetype !== MOD_ARCHETYPE_SYSTEM);
});
if (count($activities)) {
$formcontent .= $this->course_modchooser_title('activities');
$formcontent .= $this->course_modchooser_module_types($activities);
}
// Resources
$resources = array_filter($modules,
create_function('$mod', 'return ($mod->archetype === MOD_CLASS_RESOURCE);'));
$resources = array_filter($modules, function($mod) {
return ($mod->archetype === MOD_ARCHETYPE_RESOURCE);
});
if (count($resources)) {
$formcontent .= $this->course_modchooser_title('resources');
$formcontent .= $this->course_modchooser_module_types($resources);
+5
View File
@@ -107,6 +107,11 @@ class course_reset_form extends moodleform {
$defaults = array ('reset_events'=>1, 'reset_logs'=>1, 'reset_roles_local'=>1, 'reset_gradebook_grades'=>1, 'reset_notes'=>1);
// Set student as default in unenrol user list, if role with student archetype exist.
if ($studentrole = get_archetype_roles('student')) {
$defaults['unenrol_users'] = array_keys($studentrole);
}
if ($allmods = $DB->get_records('modules') ) {
foreach ($allmods as $mod) {
$modname = $mod->name;
+9 -1
View File
@@ -138,6 +138,7 @@ switch($requestmethod) {
}
moveto_module($cm, $section, $beforemod);
echo json_encode(array('visible' => $cm->visible));
break;
case 'gettitle':
require_capability('moodle/course:manageactivities', $modcontext);
@@ -150,6 +151,7 @@ switch($requestmethod) {
break;
case 'updatetitle':
require_capability('moodle/course:manageactivities', $modcontext);
require_once($CFG->libdir . '/gradelib.php');
$cm = get_coursemodule_from_id('', $id, 0, false, MUST_EXIST);
$module = new stdClass();
$module->id = $cm->instance;
@@ -167,10 +169,16 @@ switch($requestmethod) {
$module->name = $cm->name;
}
// Attempt to update the grade item if relevant
$grademodule = $DB->get_record($cm->modname, array('id' => $cm->instance));
$grademodule->cmidnumber = $cm->idnumber;
$grademodule->modname = $cm->modname;
grade_update_mod_grades($grademodule);
// We need to return strings after they've been through filters for multilang
$stringoptions = new stdClass;
$stringoptions->context = $coursecontext;
echo json_encode(array('instancename' => format_string($module->name, true, $stringoptions)));
echo json_encode(array('instancename' => html_entity_decode(format_string($module->name, true, $stringoptions))));
break;
}
rebuild_course_cache($course->id);
+22 -22
View File
@@ -175,13 +175,11 @@ if (!empty($moveto) and $data = data_submitted() and confirm_sesskey()) { // S
if (!empty($blocklist) and confirm_sesskey()) {
$blockname = $DB->get_field('block', 'name', array('id' => $blocklist));
$courses = array();
$courses = $DB->get_records_sql("
SELECT * FROM {course} WHERE id IN (
SELECT DISTINCT ctx.instanceid
FROM {context} ctx
JOIN {block_instances} bi ON bi.parentcontextid = ctx.id
WHERE ctx.contextlevel = " . CONTEXT_COURSE . " AND bi.blockname = ?)",
array($blockname));
list($select, $join) = context_instance_preload_sql('c.id', CONTEXT_COURSE, 'ctx');
$sql = "SELECT c.* $select FROM {course} c
$join JOIN {block_instances} bi ON bi.parentcontextid = ctx.id
WHERE bi.blockname = ?";
$courses = $DB->get_records_sql($sql, array($blockname));
$totalcount = count($courses);
// Keep only chunk of array which you want to display
if ($totalcount > $perpage) {
@@ -193,26 +191,24 @@ if (!empty($blocklist) and confirm_sesskey()) {
}
} elseif (!empty($modulelist) and confirm_sesskey()) { // get list of courses containing modules
$modulename = $modulelist;
$sql = "SELECT DISTINCT c.id FROM {".$modulelist."} module, {course} c"
." WHERE module.course=c.id";
$courseids = $DB->get_records_sql($sql);
list($select, $join) = context_instance_preload_sql('c.id', CONTEXT_COURSE, 'ctx');
$sql = "SELECT c.* $select FROM {course} c $join
WHERE c.id IN (SELECT DISTINCT cc.id FROM {".$modulelist."} module, {course} cc
WHERE module.course = cc.id)";
$courselist = $DB->get_records_sql($sql);
$courses = array();
if (!empty($courseids)) {
if (!empty($courselist)) {
$firstcourse = $page*$perpage;
$lastcourse = $page*$perpage + $perpage -1;
$i = 0;
foreach ($courseids as $courseid) {
foreach ($courselist as $course) {
if ($i >= $firstcourse && $i <= $lastcourse) {
$courses[$courseid->id] = $DB->get_record('course', array('id'=> $courseid->id));
$courses[$course->id] = $course;
}
$i++;
}
$totalcount = count($courseids);
}
else {
$totalcount = 0;
}
$totalcount = count($courselist);
} else if (!empty($searchterm)) {
// Donot do search for empty search request.
$courses = get_courses_search($searchterms, "fullname ASC", $page, $perpage, $totalcount);
@@ -294,6 +290,7 @@ if ($courses) {
foreach ($courses as $course) {
context_helper::preload_from_record($course);
$coursecontext = context_course::instance($course->id);
$linkcss = $course->visible ? "" : " class=\"dimmed\" ";
@@ -313,7 +310,7 @@ if ($courses) {
echo "<tr>\n";
echo "<td><a $linkcss href=\"view.php?id=$course->id\">"
. highlight($search, format_string($course->fullname)) . "</a></td>\n";
. highlight($search, $coursecontext->get_context_name(false)) . "</a></td>\n";
echo "<td>".$displaylist[$course->category]."</td>\n";
echo "<td>\n";
@@ -378,8 +375,11 @@ if ($courses) {
echo "<input type=\"button\" onclick=\"checknone()\" value=\"$strdeselectall\" />\n";
// Select box should only show categories in which user has min capability to move course.
echo html_writer::label(get_string('moveselectedcoursesto'), 'movetoid', false, array('class' => 'accesshide'));
echo html_writer::select($usercatlist, 'moveto', '', array(''=>get_string('moveselectedcoursesto')), array('id'=>'movetoid'));
$PAGE->requires->js_init_call('M.util.init_select_autosubmit', array('movecourses', 'movetoid', false));
echo html_writer::select($usercatlist, 'moveto', '', array(''=>get_string('moveselectedcoursesto')), array('id'=>'movetoid', 'class' => 'autosubmit'));
$PAGE->requires->yui_module('moodle-core-formautosubmit',
'M.core.init_formautosubmit',
array(array('selectid' => 'movetoid', 'nothing' => false))
);
echo "</td>\n</tr>\n";
echo "</table>\n</form>";
@@ -432,4 +432,4 @@ function print_navigation_bar($totalcount, $page, $perpage, $encodedsearch, $mod
echo "<a href=\"search.php?search=$encodedsearch".$modulelink."&amp;perpage=".$defaultperpage."\">".get_string("showperpage", "", $defaultperpage)."</a>";
echo "</p></center>";
}
}
}
+2 -2
View File
@@ -35,7 +35,7 @@ require_once($CFG->dirroot.'/course/lib.php');
$id = required_param('id', PARAM_INT);
$switchrole = optional_param('switchrole',-1, PARAM_INT);
$returnurl = optional_param('returnurl', false, PARAM_URL);
$returnurl = optional_param('returnurl', false, PARAM_LOCALURL);
$PAGE->set_url('/course/switchrole.php', array('id'=>$id));
@@ -86,4 +86,4 @@ if ($returnurl === false) {
$returnurl = new moodle_url('/course/view.php', array('id' => $course->id));
}
redirect($returnurl);
redirect($returnurl);
+64
View File
@@ -226,4 +226,68 @@ class courselib_testcase extends advanced_testcase {
$this->assertGreaterThanOrEqual($category2->sortorder, $category3->sortorder);
$this->assertGreaterThanOrEqual($category1->sortorder, $category3->sortorder);
}
public function test_move_module_in_course() {
global $DB;
$this->resetAfterTest(true);
// Setup fixture
$course = $this->getDataGenerator()->create_course(array('numsections'=>5), array('createsections' => true));
$forum = $this->getDataGenerator()->create_module('forum', array('course'=>$course->id));
$cms = get_fast_modinfo($course)->get_cms();
$cm = reset($cms);
$newsection = get_fast_modinfo($course)->get_section_info(3);
$oldsectionid = $cm->section;
// Perform the move
$result = moveto_module($cm, $newsection);
$this->assertTrue($result);
// get_fast_modinfo(reset) is usually called the code calling moveto_module so call it here
$reset = 'reset';
get_fast_modinfo($reset);
$cms = get_fast_modinfo($course)->get_cms();
$cm = reset($cms);
// Check that the old section's sequence no longer contains this ID
$oldsection = $DB->get_record('course_sections', array('id' => $oldsectionid));
$oldsequences = explode(',', $newsection->sequence);
$this->assertFalse(in_array($cm->id, $oldsequences));
// Check that the new section's sequence now contains this ID
$newsection = $DB->get_record('course_sections', array('id' => $newsection->id));
$newsequences = explode(',', $newsection->sequence);
$this->assertTrue(in_array($cm->id, $newsequences));
// Check that the section number has been changed in the cm
$this->assertEquals($newsection->id, $cm->section);
// Perform a second move as some issues were only seen on the second move
$newsection = get_fast_modinfo($course)->get_section_info(2);
$oldsectionid = $cm->section;
$result = moveto_module($cm, $newsection);
$this->assertTrue($result);
// get_fast_modinfo(reset) is usually called the code calling moveto_module so call it here
$reset = 'reset';
get_fast_modinfo($reset);
$cms = get_fast_modinfo($course)->get_cms();
$cm = reset($cms);
// Check that the old section's sequence no longer contains this ID
$oldsection = $DB->get_record('course_sections', array('id' => $oldsectionid));
$oldsequences = explode(',', $newsection->sequence);
$this->assertFalse(in_array($cm->id, $oldsequences));
// Check that the new section's sequence now contains this ID
$newsection = $DB->get_record('course_sections', array('id' => $newsection->id));
$newsequences = explode(',', $newsection->sequence);
$this->assertTrue(in_array($cm->id, $newsequences));
// Check that the section number has been changed in the cm
$this->assertEquals($newsection->id, $cm->section);
}
}
+44 -9
View File
@@ -76,6 +76,9 @@ class core_course_external_testcase extends externallib_advanced_testcase {
$createdcats = core_course_external::create_categories($categories);
// We need to execute the return values cleaning process to simulate the web service server.
$createdcats = external_api::clean_returnvalue(core_course_external::create_categories_returns(), $createdcats);
// Initially confirm that base data was inserted correctly.
$this->assertEquals($category1->name, $createdcats[0]['name']);
$this->assertEquals($category2->name, $createdcats[1]['name']);
@@ -93,6 +96,9 @@ class core_course_external_testcase extends externallib_advanced_testcase {
$createdsubcats = core_course_external::create_categories($subcategories);
// We need to execute the return values cleaning process to simulate the web service server.
$createdsubcats = external_api::clean_returnvalue(core_course_external::create_categories_returns(), $createdsubcats);
// Confirm that sub categories were inserted correctly.
$this->assertEquals($category3->name, $createdsubcats[0]['name']);
@@ -105,8 +111,12 @@ class core_course_external_testcase extends externallib_advanced_testcase {
$category2 = $DB->get_record('course_categories', array('id' => $category2->id));
$category3 = $DB->get_record('course_categories', array('id' => $category3->id));
$this->assertGreaterThanOrEqual($category1->sortorder, $category3->sortorder);
$this->assertGreaterThanOrEqual($category2->sortorder, $category3->sortorder);
// sortorder sequence (and sortorder) must be:
// category 1
// category 3
// category 2
$this->assertGreaterThan($category1->sortorder, $category3->sortorder);
$this->assertGreaterThan($category3->sortorder, $category2->sortorder);
// Call without required capability
$this->unassignUserCapability('moodle/category:manage', $contextid, $roleid);
@@ -197,6 +207,9 @@ class core_course_external_testcase extends externallib_advanced_testcase {
array('key' => 'id', 'value' => $category1->id),
array('key' => 'visible', 'value' => 1)), 1);
// We need to execute the return values cleaning process to simulate the web service server.
$categories = external_api::clean_returnvalue(core_course_external::get_categories_returns(), $categories);
// Check we retrieve the good total number of categories.
$this->assertEquals(2, count($categories));
@@ -214,6 +227,10 @@ class core_course_external_testcase extends externallib_advanced_testcase {
array('key' => 'id', 'value' => $category1->id),
array('key' => 'idnumber', 'value' => $category1->idnumber),
array('key' => 'visible', 'value' => 1)), 0);
// We need to execute the return values cleaning process to simulate the web service server.
$categories = external_api::clean_returnvalue(core_course_external::get_categories_returns(), $categories);
$this->assertEquals(1, count($categories));
// Retrieve categories from parent.
@@ -223,6 +240,10 @@ class core_course_external_testcase extends externallib_advanced_testcase {
// Retrieve all categories.
$categories = core_course_external::get_categories();
// We need to execute the return values cleaning process to simulate the web service server.
$categories = external_api::clean_returnvalue(core_course_external::get_categories_returns(), $categories);
$this->assertEquals($DB->count_records('course_categories'), count($categories));
// Call without required capability (it will fail cause of the search on idnumber).
@@ -305,6 +326,9 @@ class core_course_external_testcase extends externallib_advanced_testcase {
$this->resetAfterTest(true);
// Enable course completion.
set_config('enablecompletion', 1);
// Set the required capabilities by the external function
$contextid = context_system::instance()->id;
$roleid = $this->assignUserCapability('moodle/course:create', $contextid);
@@ -343,6 +367,9 @@ class core_course_external_testcase extends externallib_advanced_testcase {
$createdcourses = core_course_external::create_courses($courses);
// We need to execute the return values cleaning process to simulate the web service server.
$createdcourses = external_api::clean_returnvalue(core_course_external::create_courses_returns(), $createdcourses);
// Check that right number of courses were created.
$this->assertEquals(2, count($createdcourses));
@@ -376,13 +403,8 @@ class core_course_external_testcase extends externallib_advanced_testcase {
$this->assertEquals($dbcourse->theme, $course2['forcetheme']);
}
if (completion_info::is_enabled_for_site()) {
$this->assertEquals($dbcourse->enablecompletion, $course2['enabledcompletion']);
$this->assertEquals($dbcourse->completionstartonenrol, $course2['completionstartonenrol']);
} else {
$this->assertEquals($dbcourse->enablecompletion, 0);
$this->assertEquals($dbcourse->completionstartonenrol, 0);
}
$this->assertEquals($dbcourse->enablecompletion, $course2['enablecompletion']);
$this->assertEquals($dbcourse->completionstartonenrol, $course2['completionstartonenrol']);
} else if ($createdcourse['shortname'] == $course1['shortname']) {
$courseconfig = get_config('moodlecourse');
@@ -475,6 +497,9 @@ class core_course_external_testcase extends externallib_advanced_testcase {
$courses = core_course_external::get_courses(array('ids' =>
array($course1->id, $course2->id)));
// We need to execute the return values cleaning process to simulate the web service server.
$courses = external_api::clean_returnvalue(core_course_external::get_courses_returns(), $courses);
// Check we retrieve the good total number of categories.
$this->assertEquals(2, count($courses));
@@ -508,6 +533,10 @@ class core_course_external_testcase extends externallib_advanced_testcase {
// Get all courses in the DB
$courses = core_course_external::get_courses(array());
// We need to execute the return values cleaning process to simulate the web service server.
$courses = external_api::clean_returnvalue(core_course_external::get_courses_returns(), $courses);
$this->assertEquals($DB->count_records('course'), count($courses));
}
@@ -535,6 +564,9 @@ class core_course_external_testcase extends externallib_advanced_testcase {
$courses = core_course_external::get_course_contents($course->id, array());
// We need to execute the return values cleaning process to simulate the web service server.
$courses = external_api::clean_returnvalue(core_course_external::get_course_contents_returns(), $courses);
// Check that the course has the 3 created modules
$this->assertEquals(3, count($courses[0]['modules']));
}
@@ -578,6 +610,9 @@ class core_course_external_testcase extends externallib_advanced_testcase {
$duplicate = core_course_external::duplicate_course($course->id, $newcourse['fullname'],
$newcourse['shortname'], $newcourse['categoryid'], $newcourse['visible'], $newcourse['options']);
// We need to execute the return values cleaning process to simulate the web service server.
$duplicate = external_api::clean_returnvalue(core_course_external::duplicate_course_returns(), $duplicate);
// Check that the course has been duplicated.
$this->assertEquals($newcourse['shortname'], $duplicate['shortname']);
}
+12 -2
View File
@@ -45,6 +45,11 @@ if ($courseid) {
require_login($course);
$completion = new completion_info($course);
if (!$completion->is_enabled()) {
throw new moodle_exception('completionnotenabled', 'completion');
} elseif (!$completion->is_tracked_user($USER->id)) {
throw new moodle_exception('nottracked', 'completion');
}
// Check if we are marking a user complete via the completion report
$user = optional_param('user', 0, PARAM_INT);
@@ -133,12 +138,17 @@ if (isguestuser() or !confirm_sesskey()) {
print_error('error');
}
// Now change state
// Set up completion object and check it is enabled.
$completion = new completion_info($course);
if (!$completion->is_enabled()) {
die;
throw new moodle_exception('completionnotenabled', 'completion');
}
// NOTE: All users are allowed to toggle their completion state, including
// users for whom completion information is not directly tracked. (I.e. even
// if you are a teacher, or admin who is not enrolled, you can still toggle
// your own completion state. You just don't appear on the reports.)
// Check completion state is manual
if($cm->completion != COMPLETION_TRACKING_MANUAL) {
error_or_ajax('cannotmanualctrack', $fromajax);
+3
View File
@@ -385,6 +385,9 @@ YUI.add('moodle-course-dragdrop', function(Y) {
spinner.show();
},
success: function(tid, response) {
var responsetext = Y.JSON.parse(response.responseText);
var params = {element: dragnode, visible: responsetext.visible};
M.course.coursebase.invoke_function('set_visibility_resource_ui', params);
this.unlock_drag_handle(drag, CSS.EDITINGMOVE);
window.setTimeout(function(e) {
spinner.hide();
+3
View File
@@ -152,6 +152,9 @@ YUI.add('moodle-course-modchooser', function(Y) {
{
NAME : MODCHOOSERNAME,
ATTRS : {
maxheight : {
value : 800
}
}
});
M.course = M.course || {};
+25 -20
View File
@@ -37,7 +37,7 @@ YUI.add('moodle-course-toolboxes', function(Y) {
CONDITIONALHIDDEN : 'conditionalhidden',
AVAILABILITYINFODIV : 'div.availabilityinfo',
SHOWCLASS : 'editing_show',
ACCESSHIDECLASS : 'accesshide'
HIDECLASS : 'hide'
};
/**
@@ -99,7 +99,7 @@ YUI.add('moodle-course-toolboxes', function(Y) {
var availabilityinfo = element.one(CSS.AVAILABILITYINFODIV);
if (availabilityinfo) {
availabilityinfo.toggleClass(CSS.ACCESSHIDECLASS);
availabilityinfo.toggleClass(CSS.HIDECLASS);
}
return value;
},
@@ -259,15 +259,6 @@ YUI.add('moodle-course-toolboxes', function(Y) {
},
_setup_for_resource : function(toolboxtarget) {
toolboxtarget = Y.one(toolboxtarget);
// "Disable" show/hide icons (change cursor to not look clickable) if section is hidden
var showhide = toolboxtarget.all(CSS.COMMANDSPAN + ' ' + CSS.HIDE);
showhide.concat(toolboxtarget.all(CSS.COMMANDSPAN + ' ' + CSS.SHOW));
showhide.each(function(node) {
var section = node.ancestor(CSS.SECTIONLI);
if (section && section.hasClass(CSS.SECTIONHIDDENCLASS)) {
node.setStyle('cursor', 'auto');
}
});
// Set groupmode attribute for use by this.toggle_groupmode()
var groups;
@@ -479,7 +470,6 @@ YUI.add('moodle-course-toolboxes', function(Y) {
.setAttribute('href', newlink)
.setAttribute('title', left_string);
anchor.appendChild(newicon);
anchor.on('click', this.move_left, this);
moveright.insert(anchor, 'before');
},
/**
@@ -567,8 +557,9 @@ YUI.add('moodle-course-toolboxes', function(Y) {
// Cancel the edit if we lose focus or the escape key is pressed
thisevent = editor.on('blur', cancel_edittitle);
listenevents.push(thisevent);
thisevent = Y.one('document').on('keyup', function(e) {
if (e.keyCode == 27) {
thisevent = Y.one('document').on('keydown', function(e) {
if (e.keyCode === 27) {
e.preventDefault();
cancel_edittitle(e);
}
});
@@ -601,6 +592,26 @@ YUI.add('moodle-course-toolboxes', function(Y) {
}
}, this);
listenevents.push(thisevent);
},
/**
* Set the visibility of the current resource (identified by the element)
* to match the hidden parameter (this is not a toggle).
* Only changes the visibility in the browser (no ajax update).
* @param args An object with 'element' being the A node containing the resource
* and 'visible' being the state that the visiblity should be set to.
* @return void
*/
set_visibility_resource_ui: function(args) {
var element = args.element;
var shouldbevisible = args.visible;
var buttonnode = element.one(CSS.SHOW);
var visible = (buttonnode === null);
if (visible) {
buttonnode = element.one(CSS.HIDE);
}
if (visible != shouldbevisible) {
this.toggle_hide_resource_ui(buttonnode);
}
}
}, {
NAME : 'course-resource-toolbox',
@@ -708,12 +719,6 @@ YUI.add('moodle-course-toolboxes', function(Y) {
if (Y.Array.indexOf(response.resourcestotoggle, activityid) != -1) {
this.toggle_hide_resource_ui(button);
}
if (value == 0) {
button.setStyle('cursor', 'auto');
} else {
button.setStyle('cursor', 'pointer');
}
}, this);
},
toggle_highlight : function(e) {
+3 -98
View File
@@ -3,102 +3,7 @@ ENROLMENT MODULES
(Yes, that's the correct English spelling ;-) )
enrol.class.php contains a simple 'factory' method that
will instantiate your class when called. For an example
of a complete class, take a look at the 'manual' class.
Each plugin is in a subfolder here.
Except for the configuration methods, most methods
defined in the API are optional -- callers will use
method_exists() to determine whether your plugin offers
the functionality they are after.
Mandatory methods
=================
config_form()
process_config()
Login-time methods
==================
Before Moodle 1.7
-----------------
get_student_courses()
get_teacher_courses()
You probably will want to offer at least get_student_courses().
These methods are triggered when a user logs in successfully,
and they are expected to populate $USER->student and
$USER->teacher arrays and maintain (add/delete) entries from
user_students and user_teachers.
These methods are relevant for most plugins, and are the main
interest for plugins that work with a read-only backend such
as LDAP or a database.
Note that with the multi-enrol infrastructure two things have
changed. We now have an 'enrol' field in those tables, and
each plugin must maintain only its own enrolment records.
Conversely, the $USER->student and ->teacher arrays have the
enrolment type as value, like
$USER->student = array ( $courseid => $plugintype );
Moodle 1.7 and later
--------------------
setup_enrolments()
With the advent of roles, there could well not be students and
teachers any more, so enrolment plugins have to be more flexible
about how they map outside data to the internal roles.
This one method should do everything, calling functions from
lib/accesslib.php as necessary to set up relationships.
Interactive enrolment methods
=============================
print_entry()
check_entry()
check_group_entry()
get_access_icons()
These methods are for enrolment plugins that allow for user
driven enrolment. These methods are relevant for plugins
that implement payment gateways (credit card, paypal),
as well as "magic password" schemes.
Only one interactive enrolment method can be active for
a given course. The site default can be set from
Admin->Enrolment, and then individual courses can be
set to specific interactive enrolment methods.
Cron
====
If your class offers a cron() method, it will be invoked by
the standard Moodle cron every time it is called. Note that if the
tasks are not lightweight you must control how frequently they
execute, perhaps offering a config option.
For really heavy cron processing, an alternative is to have
a separate script to be called separately. Currently the LDAP
and DB plugins have external scripts.
Guilty Parties
--------------
Martin Dougiamas and Shane Elliott, Moodle.com
Martin Langhoff and Patrick Li, Catalyst IT
All enrolment modules must extend base class enrol_plugin
which is defined in lib/enrollib.php. You can find documentation
of each method in the base class.
+16 -4
View File
@@ -20,6 +20,7 @@ YUI.add('moodle-enrol_cohort-quickenrolment', function(Y) {
AJAXURL = 'ajaxurl',
MANUALENROLMENT = 'manualEnrolment',
CSS = {
CLOSEBTN : 'close-button',
COHORT : 'qce-cohort',
COHORTS : 'qce-cohorts',
COHORTBUTTON : 'qce-cohort-button',
@@ -52,13 +53,16 @@ YUI.add('moodle-enrol_cohort-quickenrolment', function(Y) {
this.publish('cohortsloaded');
this.publish('defaultcohortroleloaded', {fireOnce:true});
var finishbutton = Y.Node.create('<div class="'+CSS.CLOSEBTN+'"></div>')
.append(Y.Node.create('<input type="button" value="'+M.str.enrol.finishenrollingusers+'" />'));
var base = Y.Node.create('<div class="'+CSS.PANELCONTENT+'"></div>')
.append(Y.Node.create('<div class="'+CSS.PANELROLES+'"></div>'))
.append(Y.Node.create('<div class="'+CSS.PANELCOHORTS+'"></div>'))
.append(Y.Node.create('<div class="'+CSS.FOOTER+'"></div>')
.append(Y.Node.create('<div class="'+CSS.SEARCH+'"><label>'+M.str.enrol_cohort.cohortsearch+':</label></div>')
.append(Y.Node.create('<div class="'+CSS.SEARCH+'"><label for="enrolcohortsearch">'+M.str.enrol_cohort.cohortsearch+':</label></div>')
.append(Y.Node.create('<input type="text" id="enrolcohortsearch" value="" />'))
)
.append(finishbutton)
)
.append(Y.Node.create('<div class="'+CSS.LIGHTBOX+' '+CSS.HIDDEN+'"></div>')
.append(Y.Node.create('<img alt="loading" class="'+CSS.LOADINGICON+'" />')
@@ -99,6 +103,7 @@ YUI.add('moodle-enrol_cohort-quickenrolment', function(Y) {
this.on('defaultcohortroleloaded', this.updateContent, this, panel);
Y.on('key', this.hide, document.body, 'down:27', this);
close.on('click', this.hide, this);
finishbutton.on('click', this.hide, this);
Y.all('.enrol_cohort_plugin input').each(function(node){
if (node.getAttribute('type', 'submit')) {
@@ -117,6 +122,11 @@ YUI.add('moodle-enrol_cohort-quickenrolment', function(Y) {
this.getCohorts(e, false);
this.getAssignableRoles();
this.fire('show');
var rolesselect = Y.one('#id_enrol_cohort_assignable_roles');
if (rolesselect) {
rolesselect.focus();
}
},
updateContent : function(e, panel) {
var content, i, roles, cohorts, count=0, supportmanual = this.get(MANUALENROLMENT), defaultrole;
@@ -154,13 +164,14 @@ YUI.add('moodle-enrol_cohort-quickenrolment', function(Y) {
break;
case 'assignablerolesloaded':
roles = this.get(ASSIGNABLEROLES);
content = Y.Node.create('<select></select>');
content = Y.Node.create('<select id="id_enrol_cohort_assignable_roles"></select>');
for (i in roles) {
content.append(Y.Node.create('<option value="'+i+'">'+roles[i]+'</option>'));
}
panel.get('contentBox').one('.'+CSS.PANELROLES).setContent(Y.Node.create('<div><label>'+M.str.role.assignroles+':</label></div>').append(content));
panel.get('contentBox').one('.'+CSS.PANELROLES).setContent(Y.Node.create('<div><label for="id_enrol_cohort_assignable_roles">'+M.str.role.assignroles+':</label></div>').append(content));
this.getDefaultCohortRole();
Y.one('#id_enrol_cohort_assignable_roles').focus();
break;
case 'defaultcohortroleloaded':
defaultrole = this.get(DEFAULTCOHORTROLE);
@@ -280,7 +291,8 @@ YUI.add('moodle-enrol_cohort-quickenrolment', function(Y) {
new M.core.ajaxException(result);
} else {
if (result.response && result.response.message) {
new M.core.alert(result.response);
var alertpanel = new M.core.alert(result.response);
Y.Node.one('#id_yuialertconfirm-' + alertpanel.COUNT).focus();
}
var enrolled = Y.Node.create('<div class="'+CSS.COHORTBUTTON+' alreadyenrolled">'+M.str.enrol.synced+'</div>');
node.one('.'+CSS.COHORT+' #cohortid_'+cohort.get(COHORTID)).replace(enrolled);
+4 -4
View File
@@ -43,7 +43,7 @@ class enrol_database_plugin extends enrol_plugin {
if (!enrol_is_enabled('database')) {
return true;
}
if (!$this->get_config('dbtype') or !$this->get_config('dbhost') or !$this->get_config('remoteenroltable') or !$this->get_config('remotecoursefield') or !$this->get_config('remoteuserfield')) {
if (!$this->get_config('dbtype') or !$this->get_config('remoteenroltable') or !$this->get_config('remotecoursefield') or !$this->get_config('remoteuserfield')) {
return true;
}
@@ -99,7 +99,7 @@ class enrol_database_plugin extends enrol_plugin {
global $CFG, $DB;
// we do not create courses here intentionally because it requires full sync and is slow
if (!$this->get_config('dbtype') or !$this->get_config('dbhost') or !$this->get_config('remoteenroltable') or !$this->get_config('remotecoursefield') or !$this->get_config('remoteuserfield')) {
if (!$this->get_config('dbtype') or !$this->get_config('remoteenroltable') or !$this->get_config('remotecoursefield') or !$this->get_config('remoteuserfield')) {
return;
}
@@ -288,7 +288,7 @@ class enrol_database_plugin extends enrol_plugin {
global $CFG, $DB;
// we do not create courses here intentionally because it requires full sync and is slow
if (!$this->get_config('dbtype') or !$this->get_config('dbhost') or !$this->get_config('remoteenroltable') or !$this->get_config('remotecoursefield') or !$this->get_config('remoteuserfield')) {
if (!$this->get_config('dbtype') or !$this->get_config('remoteenroltable') or !$this->get_config('remotecoursefield') or !$this->get_config('remoteuserfield')) {
if ($verbose) {
mtrace('User enrolment synchronisation skipped.');
}
@@ -593,7 +593,7 @@ class enrol_database_plugin extends enrol_plugin {
global $CFG, $DB;
// make sure we sync either enrolments or courses
if (!$this->get_config('dbtype') or !$this->get_config('dbhost') or !$this->get_config('newcoursetable') or !$this->get_config('newcoursefullname') or !$this->get_config('newcourseshortname')) {
if (!$this->get_config('dbtype') or !$this->get_config('newcoursetable') or !$this->get_config('newcoursefullname') or !$this->get_config('newcourseshortname')) {
if ($verbose) {
mtrace('Course synchronisation skipped.');
}
+5 -1
View File
@@ -67,7 +67,11 @@ class core_adodb_testcase extends advanced_testcase {
case 'pgsql_native_moodle_database':
set_config('dbtype', 'postgres7', 'enrol_database');
set_config('dbsetupsql', 'SET NAMES \'UTF-8\'', 'enrol_database');
$setupsql = "SET NAMES 'UTF-8'";
if (!empty($CFG->dboptions['dbschema'])) {
$setupsql .= "; SET search_path = '".$CFG->dboptions['dbschema']."'";
}
set_config('dbsetupsql', $setupsql, 'enrol_database');
set_config('dbsybasequoting', '0', 'enrol_database');
if (!empty($CFG->dboptions['dbsocket']) and ($CFG->dbhost === 'localhost' or $CFG->dbhost === '127.0.0.1')) {
if (strpos($CFG->dboptions['dbsocket'], '/') !== false) {
+4 -4
View File
@@ -151,7 +151,7 @@ class enrol_flatfile_plugin extends enrol_plugin {
if(! @unlink($filename)) {
$eventdata = new stdClass();
$eventdata->modulename = 'moodle';
$eventdata->component = 'course';
$eventdata->component = 'enrol_flatfile';
$eventdata->name = 'flatfile_enrolment';
$eventdata->userfrom = get_admin();
$eventdata->userto = get_admin();
@@ -169,7 +169,7 @@ class enrol_flatfile_plugin extends enrol_plugin {
// Send mail to admin
$eventdata = new stdClass();
$eventdata->modulename = 'moodle';
$eventdata->component = 'course';
$eventdata->component = 'enrol_flatfile';
$eventdata->name = 'flatfile_enrolment';
$eventdata->userfrom = get_admin();
$eventdata->userto = get_admin();
@@ -280,7 +280,7 @@ class enrol_flatfile_plugin extends enrol_plugin {
$eventdata = new stdClass();
$eventdata->modulename = 'moodle';
$eventdata->component = 'course';
$eventdata->component = 'enrol_flatfile';
$eventdata->name = 'flatfile_enrolment';
$eventdata->userfrom = $teacher;
$eventdata->userto = $user;
@@ -303,7 +303,7 @@ class enrol_flatfile_plugin extends enrol_plugin {
$eventdata = new stdClass();
$eventdata->modulename = 'moodle';
$eventdata->component = 'course';
$eventdata->component = 'enrol_flatfile';
$eventdata->name = 'flatfile_enrolment';
$eventdata->userfrom = $user;
$eventdata->userto = $teacher;
+6 -3
View File
@@ -272,9 +272,10 @@ class course_enrolment_manager {
* @param bool $searchanywhere
* @param int $page Defaults to 0
* @param int $perpage Defaults to 25
* @param int $addedenrollment Defaults to 0
* @return array Array(totalusers => int, users => array)
*/
public function get_potential_users($enrolid, $search='', $searchanywhere=false, $page=0, $perpage=25) {
public function get_potential_users($enrolid, $search='', $searchanywhere=false, $page=0, $perpage=25, $addedenrollment=0) {
global $DB, $CFG;
// Add some additional sensible conditions
@@ -312,7 +313,7 @@ class course_enrolment_manager {
$order = ' ORDER BY u.lastname ASC, u.firstname ASC';
$params['enrolid'] = $enrolid;
$totalusers = $DB->count_records_sql($countfields . $sql, $params);
$availableusers = $DB->get_records_sql($fields . $sql . $order, $params, $page*$perpage, $perpage);
$availableusers = $DB->get_records_sql($fields . $sql . $order, $params, ($page*$perpage) - $addedenrollment, $perpage);
return array('totalusers'=>$totalusers, 'users'=>$availableusers);
}
@@ -792,7 +793,9 @@ class course_enrolment_manager {
break;
}
}
$users[$userrole->id]['roles'] = array();
if (!isset($users[$userrole->id]['roles'])) {
$users[$userrole->id]['roles'] = array();
}
$users[$userrole->id]['roles'][$userrole->roleid] = array(
'text' => $roletext,
'unchangeable' => !$changeable

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