Compare commits

..

1049 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7) 36da7ed5df Moodle release 2.3.10 2013-11-10 01:58:33 +01:00
Damyon Wiese 7b9e0cd78c MDL-42780 Disable swf files in YUI2.
These swf files are attack vectors for XSS attacks and upstream no longer maintains them.
2013-11-08 17:35:00 +08:00
Petr Škoda 2474203e2b MDL-42780 remove YUI2 uploader 2013-11-08 09:44:22 +01:00
Damyon Wiese 18fd289e63 weekly release 2.3.9+ 2013-11-08 12:48:08 +08:00
Damyon Wiese 9f213270f6 Merge branch 'install_23_STABLE' of git://git.moodle.org/moodle-install into MOODLE_23_STABLE 2013-11-08 12:48:04 +08:00
AMOS bot 0b60fbac61 Automatically generated installer lang files 2013-11-08 00:43:11 +00:00
Petr Škoda fc7c554de6 MDL-38743 add private cache headers 2013-11-06 13:59:21 +08:00
Frederic Massart 759ad16cc7 MDL-41807 repository_filesystem: Prevent access to parent directories 2013-11-04 13:30:48 +08:00
Petr Škoda b95c8cc1d4 MDL-41941 clean message text 2013-11-04 11:43:50 +08:00
Tim Hunt aecb3a8a78 MDL-41820 XSS in the quiz responses report.
Thanks to Michael Hess for finding this bug and reporting it to us.
2013-11-04 11:06:14 +08:00
Dan Poltawski b1db14efe1 weekly release 2.3.9+ 2013-11-01 15:47:39 +08:00
Dan Poltawski 54c236dff8 Merge branch 'install_23_STABLE' of git://git.moodle.org/moodle-install into MOODLE_23_STABLE 2013-11-01 15:47:37 +08:00
Damyon Wiese b40036ac66 Merge branch 'MDL-36818-23' of git://github.com/danpoltawski/moodle into MOODLE_23_STABLE 2013-10-28 10:59:59 +08:00
AMOS bot 1ac5b0ad16 Automatically generated installer lang files 2013-10-28 00:46:48 +00:00
Eloy Lafuente (stronk7) 8e2b2206f4 weekly release 2.3.9+ 2013-10-25 13:03:22 +02:00
AMOS bot 55abae4375 Automatically generated installer lang files 2013-10-22 00:45:46 +00:00
AMOS bot 0ba77acca6 Automatically generated installer lang files 2013-10-19 00:47:38 +00:00
Dan Poltawski e1dd8c529c weekly release 2.3.9+ 2013-10-18 16:16:30 +08:00
Thijs Kinkhorst 2093a0c3c3 MDL-36818 cas: improve SSL validation 2013-10-14 10:13:14 +08:00
Eloy Lafuente (stronk7) 079364c25f weekly release 2.3.9+ 2013-10-11 13:20:48 +02:00
Sam Hemelryk 887b6d9599 weekly release 2.3.9+ 2013-10-04 15:43:36 +13:00
Marina Glancy fa6b2edf7b weekly release 2.3.9+ 2013-09-27 14:42:14 +10:00
AMOS bot 962f036b0f Automatically generated installer lang files 2013-09-24 00:42:04 +00:00
AMOS bot cd8f20d26a Automatically generated installer lang files 2013-09-19 00:44:14 +00:00
AMOS bot 854159f747 Automatically generated installer lang files 2013-09-16 00:40:30 +00:00
AMOS bot 77cb09867c Merge branch 'MOODLE_23_STABLE' into install_23_STABLE 2013-09-08 00:43:15 +00:00
Eloy Lafuente (stronk7) 7529b398a7 Moodle release 2.3.9 2013-09-07 14:23:01 +02:00
Dan Poltawski 3a986edd89 MDL-41623 rss: clean output rss content 2013-09-07 11:18:18 +08:00
Eloy Lafuente (stronk7) 090a5f635d MDL-41623 ensure all links are valid urls
For 23 and 24 we are modifying the default Sanitizer. Note that
for 24 and upwards we are doing the same with our extended
Sanitizer. So this is just an interim hack for those old versions.
2013-09-07 04:06:57 +02:00
AMOS bot 22c1afc8f9 Merge branch 'MOODLE_23_STABLE' into install_23_STABLE 2013-09-06 00:47:52 +00:00
Dan Poltawski 29d5e81473 Merge branch 'install_23_STABLE' of git://git.moodle.org/moodle-install into MOODLE_23_STABLE 2013-09-05 14:43:53 +08:00
Dan Poltawski fadb971dde weekly release 2.3.8+ 2013-09-05 13:35:03 +08:00
Dan Poltawski c65b3a048e MDL-40676 tests: fix null byte test. 2013-09-02 13:59:37 +08:00
Petr Škoda d756385a0c MDL-40676 ignore null bytes 2013-09-02 12:28:29 +08:00
AMOS bot ca2e480fb1 Automatically generated installer lang files 2013-08-30 00:41:52 +00:00
AMOS bot 902f5d70a7 Automatically generated installer lang files 2013-08-21 00:43:43 +00:00
AMOS bot 0be9bb55c4 Automatically generated installer lang files 2013-08-20 00:42:30 +00:00
AMOS bot c209ffaef3 Automatically generated installer lang files 2013-08-19 00:42:40 +00:00
AMOS bot f3f09491c8 Automatically generated installer lang files 2013-08-16 00:43:00 +00:00
Dan Poltawski cd829c9077 weekly release 2.3.8+ 2013-08-15 16:40:02 +08:00
AMOS bot cab5304902 Automatically generated installer lang files 2013-08-15 00:54:47 +00:00
Sam Hemelryk 99df9ea8ad weekly release 2.3.8+ 2013-08-08 16:26:30 +12:00
Sam Hemelryk 9ce818b6d7 Merge branch 'install_23_STABLE' of git://git.moodle.org/moodle-install into MOODLE_23_STABLE 2013-08-08 16:19:55 +12:00
AMOS bot 6209efbb2c Automatically generated installer lang files 2013-08-07 00:43:04 +00:00
Petr Škoda ef7c73d5d8 MDL-40889 prevent 304 when minimising JS 2013-08-02 16:31:30 +02:00
AMOS bot f7ef99e59e Automatically generated installer lang files 2013-08-02 00:38:35 +00:00
Sam Hemelryk b87b72955f weekly release 2.3.8+ 2013-08-02 08:23:03 +12:00
Sam Hemelryk 8dbc9cf753 Merge branch 'install_23_STABLE' of git://git.moodle.org/moodle-install into MOODLE_23_STABLE 2013-08-02 08:12:00 +12:00
Frederic Massart c5cb333a38 MDL-40615 Repository: Updated Amazon S3 library
Fixed insecure use of CURLOPT_SSL_VERIFYHOST
2013-07-30 09:05:18 +12:00
AMOS bot d4ce5e6e2d Automatically generated installer lang files 2013-07-28 00:42:34 +00:00
AMOS bot b47ef00098 Merge branch 'MOODLE_23_STABLE' into install_23_STABLE 2013-07-27 00:43:15 +00:00
Damyon Wiese 863d00ca29 weekly release 2.3.8+ 2013-07-26 11:29:03 +08:00
AMOS bot 7fe7fd5da7 Automatically generated installer lang files 2013-07-23 00:39:27 +00:00
Damyon Wiese 02e539c462 weekly release 2.3.8+ 2013-07-19 09:49:00 +08:00
Damyon Wiese 6d1ebb59dd Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2013-07-19 09:22:18 +08:00
AMOS bot d2f7fe83bd Automatically generated installer lang files 2013-07-15 00:44:30 +00:00
Tim Hunt 9bf7f10834 MDL-40633 filter_urltolink breaking some image links.
This was a regression caused by MDL-22390. HTML like
<img src="http://www.example.com/logo.gif" />
was being broken.
2013-07-12 13:06:09 +01:00
Damyon Wiese f830a2d729 weekly release 2.3.8+ 2013-07-12 09:51:39 +08:00
Damyon Wiese e670f3e8c2 Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2013-07-12 09:42:35 +08:00
AMOS bot 8ddf23ed3b Automatically generated installer lang files 2013-07-12 00:46:04 +00:00
Marina Glancy 8d296ea5e4 Merge branch 'm23_MDL-39832_Fix_Chrome_Issues_ETag_XSendfile_2ndRound' of https://github.com/scara/moodle into MOODLE_23_STABLE 2013-07-10 12:05:16 +10:00
Raymond Wijaya 17e37c57e4 MDL-40093 mod/assign: Remove count of drafts in offline assignment's grading summary screen 2013-07-10 11:40:55 +10:00
Tony Levi 94e36bc01f MDL-40035: Avoid rebuild_course_cache always for empty course 2013-07-09 13:56:30 +10:00
Tim Lock ffbb1a21c3 MDL-40436: auth_ldap: Fixed warning when adding new LDAP users 2013-07-08 23:03:41 +08:00
Matteo Scaramuccia 0ba744205e MDL-39832 Files: Fixed ETag format according with RFC2616.
ETag must be double quoted,
http://tools.ietf.org/html/rfc2616#section-3.11:

      entity-tag = [ weak ] opaque-tag
      weak       = "W/"
      opaque-tag = quoted-string
2013-07-07 09:21:37 +02:00
Matteo Scaramuccia 627dc76546 MDL-39832 Files: Revert MDL-39688 commit, 6ce0c9ce42
MDL-39688 has been successful in providing a solution for the issue but further
investigations done in MDL-39832 have got the evidence that the given solution
is more likely a workaround.
2013-07-07 09:21:35 +02:00
Eloy Lafuente (stronk7) 1a07c564c8 Moodle release 2.3.8 2013-07-06 17:53:38 +02:00
Damyon Wiese 0a7afb8746 weekly release 2.3.7+ 2013-07-04 15:32:32 +08:00
Damyon Wiese 392c581c45 MDL-40308: Fix javascript for lti mod_form
It was toggling the state of the hidden input - not the checkbox.
2013-07-04 13:47:53 +08:00
Michael Aherne 77182cd299 MDL-40275 core Improve documentation for block_base::has_config() 2013-07-02 21:55:45 +02:00
Damyon Wiese a251526d72 Merge branch 'wip-MDL-40353-m23' of git://github.com/marinaglancy/moodle into MOODLE_23_STABLE 2013-07-02 14:29:46 +08:00
Andreas Grabs a5a4a5ea1e MDL-39570 mod_feedback - Missing privilege check 2013-07-02 13:35:34 +08:00
Petr Škoda 7d2b47d265 MDL-40266 improve emulate_bound_params() for mssql driver
Looping over large numbers of items with array_shift() is expensive.
Reverse the array and fetch items from the top of the pile.

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

Credit goes to Martin Langhoff for original mysqli fix.
2013-07-02 13:33:38 +08:00
Dan Marsden c76c989420 MDL-39628 Chat: check mod/chat:chat capability when using daemon.
Thanks to Francois Gauthier for report/fix.
2013-07-02 12:23:31 +08:00
Jason Fowler 1adad7f783 MDL-37818 - RSS - Prevent access to blocks while RSS context errors are displayed 2013-07-02 10:10:26 +08:00
Martin Langhoff e13acecad7 MDL-40266 improve emulate_bound_params() for mysqli
Looping over large numbers of items with array_shift() is expensive.
Reverse the array and fetch items from the top of the pile.
2013-07-02 09:56:17 +08:00
Eloy Lafuente (stronk7) 490bf4e84f Merge branch 'get_users_by_capability_fix_m23' of http://github.com/timgus/moodle into MOODLE_23_STABLE 2013-07-02 00:47:00 +02:00
Rossiani Wijaya 919a40f31c MDL-39546 Lesson module: removed duplicate to decode special characters 2013-07-02 09:35:40 +12:00
Rossiani Wijaya de42137285 MDL-39546 Lesson module: fixed matching question issues 2013-07-02 09:35:29 +12:00
Eloy Lafuente (stronk7) 16b73cf30d Merge branch 'w27_MDL-39754_m23_evn26' of https://github.com/skodak/moodle into MOODLE_23_STABLE 2013-07-01 23:14:26 +02:00
Petr Škoda fcbba30ad4 MDL-39754 copy 2.5 requirements to Moodle 2.6
Optional features and warnings may be added later,
but we need at least required environment for 2.5.1

This includes database family cleanup and more realistic memory requirement.
2013-07-01 10:04:31 +02:00
Mark Nielsen 4e286e58a3 MDL-40308: Privacy settings do not change
Update LTI mod form so checkboxes always submit their value.
2013-07-01 11:27:22 +08:00
Sam Hemelryk fb17d60fde MDL-40344 navigation: expandable branch id is now properly unique 2013-06-28 09:59:04 +12:00
Eloy Lafuente (stronk7) 0b8f6159b2 weekly release 2.3.7+ 2013-06-27 20:11:07 +02:00
Eloy Lafuente (stronk7) 2624a2edf4 Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2013-06-27 20:05:44 +02:00
Marina Glancy 1d5932bf44 MDL-40353 fixed wrong redirection on course group page 2013-06-27 13:54:43 +10:00
AMOS bot d89ca90ca6 Automatically generated installer lang files 2013-06-27 00:40:27 +00:00
Eloy Lafuente (stronk7) 2928ac025c Merge branch 'MDL-40264-m23-essay-zero' of git://github.com/ktemkin/moodle into MOODLE_23_STABLE 2013-06-24 21:22:06 +02:00
Eloy Lafuente (stronk7) b19d21e26b Merge branch 'MDL-34610_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-06-24 20:21:55 +02:00
Eloy Lafuente (stronk7) c55a7ac5b0 Merge branch 'MDL-40255_M23' of git://github.com/lazydaisy/moodle into MOODLE_23_STABLE 2013-06-24 19:26:49 +02:00
Matteo Scaramuccia d158acc4ff MDL-40200 Administration: Return the invalid user message and stop there
To avoid adding duplicate code, 'invalid user' and 'user deleted' checks
have been merged together.

Conflicts:
	user/profile.php
2013-06-24 19:03:29 +02:00
Sam Chaffee 4010b22051 MDL-40258: Fixed invalid json string error in file-picker 2013-06-24 18:57:22 +02:00
Ankit Agarwal d306f96750 MDL-40250 phpunit: Add unit tests for core_files_external::upload() 2013-06-24 18:11:56 +02:00
Sam Hemelryk 410899e3b2 Merge branch 'MDL-39760-MOODLE_23_STABLE' of https://github.com/lucisgit/moodle into MOODLE_23_STABLE
Conflicts:
	mod/assign/locallib.php
2013-06-24 14:25:54 +12:00
Sam Hemelryk 6005edc60f MDL-38347 fixed whitespace 2013-06-24 11:29:45 +12:00
Sam Hemelryk a2e47d596a Merge branch 'wip-MDL-38347-stable23' of git://github.com/phalacee/moodle into MOODLE_23_STABLE 2013-06-24 11:20:27 +12:00
Sam Hemelryk c209e59206 Merge branch 'MDL-28124_M23' of git://github.com/lazydaisy/moodle into MOODLE_23_STABLE 2013-06-24 10:28:46 +12:00
Mary Evans d80a7da7c1 MDL-40255 theme_boxxie/theme_formfactor: Added block-region class to layout files to enable dnd file uploader to work. 2013-06-22 21:27:55 +01:00
Tim Hunt 80178c1c9e MDL-34610 remove legacy IE CSS. It breaks form layout 2013-06-21 21:57:51 +01:00
Kyle Temkin 3553982d6d MDL-40264 fix essay handling of zero-string response
Fixes an inappropriate behavior of the is_complete_response() function
for the Essay question type, which caused the string "0" to be
inappropriately marked as an incomplete response.

Also adds a set of unit tests for the Essay question type's
is_complete_response.
2013-06-21 03:39:23 -04:00
Dan Poltawski 6420fea64b weekly release 2.3.7+ 2013-06-21 13:27:50 +08:00
Tim Gus 66d0022594 MDL-40259 - For SCORM reports limit fields returned from
get_users_by_capability to user ID to decrease memory utilization
2013-06-20 15:57:27 -04:00
Ruslan Kabalin 78fa55b23e MDL-39760: mod_assign: Add few more callback methods.
Adds lock, unlock and release_to_draft. All of them accept single parameter -
an assign_submission record.
2013-06-19 15:38:34 +01:00
Ruslan Kabalin 7aec80dd9e MDL-39760: mod_assign: Make submit_for_grading accept submission as parameter 2013-06-19 15:38:34 +01:00
Marina Glancy 319b329367 Merge branch 'MDL-40207-23' of git://github.com/danpoltawski/moodle into MOODLE_23_STABLE 2013-06-18 15:41:36 +10:00
Marina Glancy 3ad26c86eb Merge branch 'MDL-39650-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2013-06-18 14:11:54 +10:00
Ruslan Kabalin d71021f601 MDL-33546: course: Fix current week hightlighting after dragging the section 2013-06-18 13:06:11 +10:00
Marina Glancy ade9bbc32e Merge branch 'MDL-40165-m23' of git://github.com/andrewnicols/moodle into MOODLE_23_STABLE 2013-06-18 12:54:40 +10:00
Marina Glancy 30b38ce4fa Merge branch 'MDL-38079_23' of git://github.com/mr-russ/moodle into MOODLE_23_STABLE 2013-06-18 11:15:54 +10:00
Eloy Lafuente (stronk7) f49cd5fcd8 Merge branch 'MDL-33562-23' of git://github.com/danpoltawski/moodle into MOODLE_23_STABLE
Conflicts:
	version.php
2013-06-18 00:48:50 +02:00
Sam Hemelryk 62c4ccef0e Merge branch 'MDL-30132_M23' of git://github.com/lazydaisy/moodle into MOODLE_23_STABLE 2013-06-18 10:26:10 +12:00
Sam Hemelryk df86b97f1a Merge branch 'wip-MDL-40159-m23' of git://github.com/marinaglancy/moodle into MOODLE_23_STABLE 2013-06-18 09:03:54 +12:00
Russell Smith 35c70d0425 MDL-38079 mod_feedback - Hide "add question to activity" button 2013-06-17 20:02:38 +10:00
Marina Glancy 7fb1afbb38 MDL-40159 Fixing bug with empty variable, regression from MDL-21097 2013-06-17 14:33:59 +10:00
Sam Hemelryk 4dac72bcc8 Merge branch 'm23_MDL-40095_Completion_locked_Error_on_save' of https://github.com/scara/moodle into MOODLE_23_STABLE 2013-06-17 16:09:36 +12:00
Sam Hemelryk 0b79440ddf Merge branch 'MDL-21933_23' of https://github.com/mr-russ/moodle into MOODLE_23_STABLE 2013-06-17 15:44:58 +12:00
Sam Hemelryk a971dd3992 Merge branch 'wip-MDL-40091-MOODLE_23_STABLE' of git://github.com/satrun77/moodle into MOODLE_23_STABLE 2013-06-17 15:42:55 +12:00
Dan Poltawski 5d447145ba MDL-40207 simplepie: reduce false failures in unit tests
The simplepie tests time out too quickly due to a low connect timeout,
to fix this, I converted the unit tests to use a high timeout value.
2013-06-17 10:56:27 +08:00
Sam Hemelryk 1691794cb1 Merge branch 'MDL-39761-MOODLE_23_STABLE' of https://github.com/lucisgit/moodle into MOODLE_23_STABLE 2013-06-17 14:24:37 +12:00
Sam Hemelryk 5838cbd4ff MDL-40142 navigation: fixed chainable issue with navigation JS 2013-06-17 09:15:51 +12:00
Mary Evans d63b6cf619 MDL-28124 admin/tool/customlang: Changed page layout from 'standard' to 'report'. 2013-06-15 00:13:53 +01:00
Mohamed Alsharaf dc7d68880a MDL-40091 book: revision must be incremented after editing a chapter 2013-06-14 21:25:33 +12:00
Marina Glancy eabe1d3b6b weekly release 2.3.7+ 2013-06-14 13:34:42 +10:00
Andrew Nicols 4ea0abedb0 MDL-40165 Backup: Split out test classes into multiple files 2013-06-13 08:58:30 +01:00
Dan Poltawski c5338156c5 Revert "MDL-39832 Files: Revert MDL-39688 commit, 6ce0c9ce42fa7849e67d7611a628ece51c336c5f"
This reverts commit 1cb1157809.
2013-06-13 13:58:00 +08:00
Dan Poltawski db1a0b53c5 Revert "MDL-39832 Files: Fixed ETag format according with RFC2616."
This reverts commit bf4a95e6a3.
2013-06-13 13:57:58 +08:00
Russell Smith e456edf9b7 MDL-21933 course: Allow users to search participants course permission
Capability checks are performed at the top of the page and do not need
to be completed again.

Search is an expected feature for users and it was confusion to only
appear after 3 pages.  This has been changed to enable search when
there are more records than are visible on the screen.  If users
are unable to use browser search, they will be able to use Moodle's
search.
2013-06-13 12:44:36 +10:00
Mary Evans eb38cf2d7a MDL-30312 User: Changed page layout from mydashboard to mypublic in user/profile.php 2013-06-12 21:18:44 +01:00
Sam Hemelryk 1d26199125 Merge branch 'MDL-25901-23' of git://github.com/danpoltawski/moodle into MOODLE_23_STABLE 2013-06-12 08:59:32 +12:00
Sam Hemelryk 3a2ad025e1 Merge branch 'MDL-26925-23' of git://github.com/danpoltawski/moodle into MOODLE_23_STABLE 2013-06-11 17:30:58 +12:00
Sam Hemelryk f3358600e7 Merge branch 'MDL-39505-migrate-file-backport_23' of git://github.com/mudrd8mz/moodle into MOODLE_23_STABLE 2013-06-11 17:15:47 +12:00
Sam Hemelryk 3343cd5d92 Merge branch 'MDL-22390_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-06-11 17:08:21 +12:00
Dan Poltawski 610f07c288 Merge branch 'm23_MDL-40002_ETag_value_must_be_a_quoted-string' of https://github.com/scara/moodle into MOODLE_23_STABLE 2013-06-11 12:54:59 +08:00
Marina Glancy d5bba86435 Merge branch 'MDL-39412_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-06-11 12:12:36 +10:00
Matteo Scaramuccia da297e7390 MDL-40095 SCORM: Trivial comments tidy up 2013-06-10 21:10:22 +02:00
Matteo Scaramuccia 0ec8a329bc MDL-40095 SCORM: Fixed DML error when saving with completion options locked
Regression caused by MDL-38315.
2013-06-10 21:10:07 +02:00
Dan Poltawski bb059c31ad Merge branch 'MDL-39947_23' of https://github.com/aolley/moodle into MOODLE_23_STABLE 2013-06-10 16:20:56 +08:00
Dan Poltawski 61603bb034 Merge branch 'm23_MDL-39832_Fix_Chrome_Issues_ETag_XSendfile' of https://github.com/scara/moodle into MOODLE_23_STABLE 2013-06-10 15:43:25 +08:00
Dan Poltawski 885c3f5824 Merge branch 'MDL-40018_M23' of git://github.com/lazydaisy/moodle into MOODLE_23_STABLE 2013-06-10 15:00:39 +08:00
David Mudrák 0a4dcf2ad7 MDL-40080 Remove unused strings from the core_hub subsystem 2013-06-10 14:42:25 +08:00
Dan Poltawski 1735fbc1ef Merge branch 'MDL-39667-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2013-06-10 12:51:51 +08:00
Sam Hemelryk 94be2b5074 Merge branch 'MDL-40009_m23' of https://github.com/markn86/moodle into MOODLE_23_STABLE 2013-06-10 15:54:34 +12:00
Sam Hemelryk 628e0528e8 Merge branch 'w24_MDL-39549_m23_cohortsearch' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2013-06-10 15:47:38 +12:00
Sam Hemelryk b87dc0e925 Merge branch 'MDL-39971_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-06-10 15:09:22 +12:00
Sam Hemelryk f83cd734f9 Merge branch 'w24_MDL-32480_m23_imscp' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2013-06-10 14:39:54 +12:00
Sam Hemelryk ad6976aae5 Merge branch 'MDL-36090_log2_23' of git://github.com/andyjdavis/moodle into MOODLE_23_STABLE 2013-06-10 12:30:24 +12:00
Matteo Scaramuccia 16b143ef22 MDL-40002 Files: ETag value must be a quoted-string.
ETag value must be double quoted, http://tools.ietf.org/html/rfc2616#section-3.11.
More details about potential impacts in MDL-39832: shortly, at least when using
HTTP Partial GET Requests (HTTP Status: 206) plus X-Sendfile HTTP Header.
In this commit, the impact is to be RFC2616 compliant when using the ETag Header.
2013-06-09 10:38:59 +02:00
Tim Hunt 206db13c8e MDL-22390 autolink filter: handle URLs in brackets better.
This breaks some legitimate URLs like
http://en.wikipedia.org/wiki/Slash_(punctuation).
This is a necessary trade-off. Many other web systems do not handle that
case correctly either. The work-around it so escape the ) as %29.

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

It also fixes a couple of other tricky cases that were spotted in
the forums while this was being discussed. See the new test cases.
2013-06-08 16:56:53 +01:00
Petr Škoda 92df65aedd MDL-39549 fix cohort search in course categories 2013-06-07 22:09:55 +02:00
Petr Škoda f296df5125 MDL-37780 fix 1.9 restore on windows 2013-06-07 10:23:41 +02:00
Petr Škoda 663e3ce8b2 MDL-32480 allow external https links in IMSCP too 2013-06-07 10:00:52 +02:00
Nicolas Dunand f3369f1607 MDL-32480 fix display of IMS content packages with external links 2013-06-07 10:00:52 +02:00
Matteo Scaramuccia bf4a95e6a3 MDL-39832 Files: Fixed ETag format according with RFC2616.
ETag must be double quoted,
http://tools.ietf.org/html/rfc2616#section-3.11:

      entity-tag = [ weak ] opaque-tag
      weak       = "W/"
      opaque-tag = quoted-string
2013-06-06 23:06:04 +02:00
Matteo Scaramuccia 1cb1157809 MDL-39832 Files: Revert MDL-39688 commit, 6ce0c9ce42
MDL-39688 has been successful in providing a solution for the issue but further
investigations done in MDL-39832 have got the evidence that the given solution
is more likely a workaround.
2013-06-06 23:06:02 +02:00
Dan Poltawski 4908daf0c1 MDL-26925 User selector: Set label when no results
Thanks to Jonathon Fowler for the fix!
2013-06-06 14:10:21 +08:00
Dan Poltawski 969e5b51a0 weekly release 2.3.7+ 2013-06-06 12:00:05 +08:00
Dan Poltawski 4abc48ac46 Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2013-06-06 11:55:56 +08:00
Dan Poltawski 7e05737fb4 MDL-25901 rss: do not copyright html tag
They copyright field does not permit html, it should be plain text
2013-06-06 11:31:13 +08:00
Eloy Lafuente (stronk7) a07b82a9bb Merge branch 'wip-MDL-21097-m23' of git://github.com/marinaglancy/moodle into MOODLE_23_STABLE
Conflicts:
	index.php
2013-06-05 10:45:19 +02:00
Marina Glancy a6ce14dfb5 MDL-21097 Correctly check capabilities for frontpage editing mode 2013-06-05 18:06:56 +10:00
Marina Glancy 3ffbbeea7c MDL-21097 corrected course editing roles 2013-06-05 16:42:47 +10:00
Marina Glancy 5e8de26794 MDL-21097 Correctly check capabilities for course settings items
- Make sure that items in course settings (and frontpage settings) are shown depending on user capabilities
- Make sure user is able to turn editing on on the page even if he has only limited number of seciton/modules capabilities
2013-06-05 16:42:47 +10:00
Dan Poltawski 330ae1764f Merge branch 'wip-MDL-21097-m23' of git://github.com/marinaglancy/moodle into MOODLE_23_STABLE 2013-06-05 13:11:58 +08:00
Marina Glancy 7072c3cdc6 MDL-21097 corrected course editing roles 2013-06-05 14:00:11 +10:00
Andrew Davis f2f5e4dd44 MDL-36090 core_grade: added logging of overriding of student grades 2013-06-05 08:58:26 +08:00
Eloy Lafuente (stronk7) f21e4e5b5f Merge branch 'w23_MDL-39416_m23_pagelog' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2013-06-05 02:44:11 +02:00
Eloy Lafuente (stronk7) 03cfbefbff Merge branch 'MDL-38731-23' of git://github.com/danpoltawski/moodle into MOODLE_23_STABLE 2013-06-05 02:31:10 +02:00
Eloy Lafuente (stronk7) c47cd3442f Merge branch 'MDL-37332-23' of git://github.com/danpoltawski/moodle into MOODLE_23_STABLE 2013-06-05 02:27:49 +02:00
Eloy Lafuente (stronk7) 92b8d952f1 Merge branch 'wip-MDL-21097-m23' of git://github.com/marinaglancy/moodle into MOODLE_23_STABLE 2013-06-05 01:43:34 +02:00
Mary Evans 62f0d51b4f MDL-40018 theme_sky_high: Fixed footer in admin pages. 2013-06-05 00:23:18 +01:00
Mark Nelson e5c2e2cfab MDL-40009 notes: corrected the form element names passed to setType 2013-06-04 18:11:12 +08:00
Tim Hunt 22be561eb6 MDL-39945 qtype multichoice was not comparing blank responses correctly. 2013-06-04 15:54:44 +08:00
Mary Evans 94572e5c93 MDL-39835 theme_sky_high: Fix for footer to display correctly in higher resolutions. 2013-06-04 14:45:34 +08:00
Dan Poltawski 7b21fa1712 Merge branch 'MDL-39536-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2013-06-04 13:25:38 +08:00
Frederic Massart 3454eea93e MDL-39536 completion: Unit tests for get_activities and has_activities 2013-06-04 12:57:42 +08:00
Frederic Massart 5f83d3d3d6 MDL-39536 completion: Prevent DB call when fetching activities 2013-06-04 12:57:41 +08:00
David Mudrák db70e53773 MDL-39939 Fix the basic SCORM report plugin name 2013-06-04 12:28:00 +08:00
Dan Poltawski 6bc6ddd29d Merge branch 'MDL-39317-23' of git://github.com/damyon/moodle into MOODLE_23_STABLE 2013-06-04 11:26:53 +08:00
Dan Poltawski 5f7c57ef85 Merge branch 'wip_23_mdl-34085' of https://github.com/iarenaza/moodle into MOODLE_23_STABLE 2013-06-04 10:43:28 +08:00
AMOS bot 09773eca4e Automatically generated installer lang files 2013-06-04 00:46:38 +00:00
Marina Glancy 4f8af9cbdf MDL-39801 navigation_node::remove does not allow to insert nodes afterwards 2013-06-04 02:06:09 +02:00
Marina Glancy 337c63aac4 MDL-39801 navigation_node::remove fails if first child does not have a key 2013-06-04 02:06:02 +02:00
Eloy Lafuente (stronk7) 266a68e840 MDL-39764 style: phpdoc changed to inline comments 2013-06-04 01:47:14 +02:00
Eloy Lafuente (stronk7) 7b78c24ba0 Merge branch 'wip-MDL-39764_M23_3' of git://github.com/gjb2048/moodle into MOODLE_23_STABLE 2013-06-04 01:44:57 +02:00
Gareth J Barnard d49e53b39f MDL-39764 course_format: Allow courses to have numsections > maxsections. 2013-06-04 00:07:46 +01:00
Eloy Lafuente (stronk7) 459b4e96a1 MDL-39465 Show env. info instead of part twice. 2013-06-04 00:51:18 +02:00
Eloy Lafuente (stronk7) db728b8e59 Merge branch 'w23_MDL-39465_m23_environment' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2013-06-04 00:01:24 +02:00
Eloy Lafuente (stronk7) b34fdf7d1f Merge branch 'MDL-39166-m23' of https://github.com/jfilip/moodle into MOODLE_23_STABLE 2013-06-03 23:55:54 +02:00
Eloy Lafuente (stronk7) 83165bec0b Merge branch 'MDL-39932_23' of git://github.com/grabs/moodle into MOODLE_23_STABLE 2013-06-03 19:11:03 +02:00
Eloy Lafuente (stronk7) 00e4ad0d17 Merge branch 'MDL-39487_23' of https://github.com/IOC/moodle into MOODLE_23_STABLE 2013-06-03 19:03:48 +02:00
Petr Škoda a3ccd8e86e MDL-39416 do not try to get detailed perflog info before PAGE int 2013-06-02 13:33:20 +02:00
Petr Škoda 2fd690e4b8 MDL-39465 detect environment problems in tests
This should help explain why something else fails.
2013-05-31 22:05:05 +02:00
Tim Hunt 1a3e7ab0d3 MDL-39971 each attempt builds on last broken for previews. 2013-05-31 20:34:17 +01:00
Dan Poltawski 417dbe3840 MDL-38731 course: split course group settings header
Allow translators to translate the heading differently.

AMOS BEGIN
  CPY [groups,group],[groupsettingsheader,group]
AMOS END

Conflicts:
	course/edit_form.php
2013-05-31 12:15:37 +08:00
Dan Poltawski dbe006d468 MDL-37332 portfolio: don't add double slashes
get_filepath() always returns trailing slash.

This breaks windows export - thanks to Jason Platts
2013-05-31 11:52:10 +08:00
Marina Glancy 39d0fe3693 MDL-21097 Correctly check capabilities for course settings items
- Make sure that items in course settings (and frontpage settings) are shown depending on user capabilities
- Make sure user is able to turn editing on on the page even if he has only limited number of seciton/modules capabilities
2013-05-31 13:21:56 +10:00
Frederic Massart e4b771cf0d MDL-39650 form: Type can be set on repeated elements in a group 2013-05-31 11:06:12 +08:00
Dan Poltawski 8feae80284 MDL-33562 lib: remove deleted user tokens 2013-05-31 10:31:42 +08:00
Dan Poltawski 9b61ac3fdc MDL-33562 lib: remove private keys when user deleted 2013-05-31 10:29:39 +08:00
AMOS bot 449f2f9b18 Automatically generated installer lang files 2013-05-31 00:43:11 +00:00
Adam Olley 8d148dd866 MDL-39947 mod_forum: Add safety check to variable assignment when counting unread posts 2013-05-31 09:51:24 +09:30
Andreas Grabs 3db65127c3 MDL-39932 mod_feedback - Mapping Feedback when Course is Deleted - thx to David N. Johnson 2013-05-30 23:25:24 +02:00
Iñaki Arenaza 689ba48b00 MDL-34085 Fix the backup options names in core_course_duplicate_course
Fix the option names to match those used by the backup subsystem.
2013-05-30 17:50:22 +02:00
Damyon Wiese ee2e56ee9e weekly release 2.3.7+ 2013-05-30 12:08:55 +08:00
Damyon Wiese c5fd8a39f2 Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2013-05-30 11:27:00 +08:00
AMOS bot 323af23325 Automatically generated installer lang files 2013-05-30 00:38:26 +00:00
Damyon Wiese cf697e3406 MDL-39317 assign: Fix for submitted filter on grading table.
Some old upgraded assignments have no timecreated column so use
a different one to check for a valid submission.
2013-05-29 14:51:23 +08:00
AMOS bot 8deed6fdc5 Automatically generated installer lang files 2013-05-29 00:39:25 +00:00
Jason Fowler ce7e354ae5 MDL-38347 - Calendar - Fixing arrow output on Android devices 2013-05-28 15:28:30 +08:00
Damyon Wiese 25534fde40 Merge branch 'w22_MDL-39802_m23_deletedusers' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2013-05-28 09:55:41 +08:00
AMOS bot 85b320becb Automatically generated installer lang files 2013-05-28 00:38:18 +00:00
Damyon Wiese ec928e8c14 Merge branch 'MDL-39640-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2013-05-27 16:17:19 +08:00
Dan Poltawski be5a3e6117 Merge branch 'MDL-38239-moodle23' of git://github.com/StudiUM/moodle into MOODLE_23_STABLE 2013-05-27 14:14:03 +08:00
Dan Poltawski 4aa5c142a1 Merge branch 'w22_MDL-39688_m23_etag' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2013-05-27 13:43:55 +08:00
Petr Škoda b2bcd0ff35 MDL-38408 validate PayPal dates and costs always 2013-05-25 22:19:28 +02:00
Petr Škoda 6ce0c9ce42 MDL-39688 do not set Etag when sending http ranges 2013-05-25 09:13:39 +02:00
Petr Škoda 5c713da067 MDL-39802 fix sloppy user deleting and creating in imsenterprise plugin 2013-05-24 21:20:45 +02:00
Petr Škoda f7da02f3b0 MDL-39802 add cli script for fixing of all deleted users
Use this script if something just set the user.deleted flag instead of calling the delete_user() method.
2013-05-24 21:20:19 +02:00
Damyon Wiese 7621b70368 weekly release 2.3.7+ 2013-05-24 13:24:03 +08:00
Damyon Wiese dc3d236a4b Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2013-05-24 13:11:32 +08:00
Eloy Lafuente (stronk7) 4a19404d65 Merge branch 'wip-MDL-39177-m23' of git://github.com/marinaglancy/moodle into MOODLE_23_STABLE 2013-05-23 16:00:33 +02:00
Marina Glancy 06535ae415 MDL-39177 make sure we don't remove existing directories when cleaning up unzip 2013-05-23 19:20:38 +10:00
AMOS bot c36e4e6ed8 Automatically generated installer lang files 2013-05-22 08:26:06 +00:00
Eloy Lafuente (stronk7) 748524f1b6 MDL-36482 Fix slipped error, thanks Petr! 2013-05-22 04:13:28 +02:00
Eloy Lafuente (stronk7) f23331836d Merge branch 'wip-MDL-39177-m23' of git://github.com/marinaglancy/moodle into MOODLE_23_STABLE 2013-05-22 02:13:27 +02:00
Gilles-Philippe Leblanc 96b821e126 MDL-38239 gradebook: Importing grades from a .txt file with commas for decimals causes an error 2013-05-21 14:18:35 -04:00
Marina Glancy 6d5bcdebf1 MDL-39177 Updating userid when file is overwritten 2013-05-21 10:57:44 +10:00
Eloy Lafuente (stronk7) 5724b42c03 Merge branch 'MDL-36482_23' of https://github.com/mr-russ/moodle into MOODLE_23_STABLE 2013-05-21 02:28:34 +02:00
Eloy Lafuente (stronk7) 0a18bd17cc Merge branch 'MDL-26120_23' of https://github.com/jacks92/moodle into MOODLE_23_STABLE 2013-05-21 00:55:42 +02:00
Eloy Lafuente (stronk7) 1b0528adf0 Merge branch 'MDL-31209-23' of git://github.com/mouneyrac/moodle into MOODLE_23_STABLE 2013-05-20 19:05:59 +02:00
Ruslan Kabalin 7e8514c5fd MDL-39761: mod_assign: Always check submission plugin status and visibility. 2013-05-20 16:39:57 +01:00
Damyon Wiese 95f982b0ac MDL-39412 Prevent developer warnings on upgrade from 24 to master 2013-05-20 12:42:52 +01:00
Tim Hunt 342dc2025c MDL-39412 disabling manual graded behaviour refinements
1. Change behaviour admin settings so you can only select enabled
behaviours.
2. During the upgrade, change admin settings that might be currently set
to manual graded, so that instead they are set to deferredfeedback (if
that is available. If not, we just take the first alphabetically.)
2013-05-20 12:42:19 +01:00
Tim Hunt 612dc9f648 MDL-39412 question behaviours: hide manual graded option
The ability to set all your quiz questions to require manual grading is
an interesting possibility, but practically almost useless.

If you set that accidentally, then you are badly stuck. There is no way
to fix it after the students have answered the quiz.

Therefore, we should set the config option to hide that option from the
UI. We do this for all Moodle sites as part of the upgrade, not just for
new installs.

If any admin wants to re-enable this, they can later.
2013-05-20 12:26:05 +01:00
Petr Škoda 98a0a2faaa MDL-39374 log only real folder edits
Credit goes to Florian Zillner, thanks.
2013-05-20 17:59:04 +08:00
Dan Poltawski 2b6e9bd10a Merge branch 'MDL-35859_idnumber_23' of https://github.com/andyjdavis/moodle into MOODLE_23_STABLE 2013-05-20 16:39:12 +08:00
Dan Poltawski 2d0669e775 Merge branch 'MDL-27748_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-05-20 15:49:09 +08:00
Dan Poltawski aaea60dea0 Merge branch 'MDL-39728_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-05-20 15:29:21 +08:00
Troy Lee 4126c81e32 MDL-36020 overview/report: fix quiz regrade session lock 2013-05-20 12:42:55 +08:00
Damyon Wiese 166e25fec7 Merge branch 'MDL-39363-m23' of git://github.com/ankitagarwal/moodle into MOODLE_23_STABLE 2013-05-20 12:17:19 +08:00
Kordan edcb7a0bc6 MDL-39198 theme_formal_white: resized and relocated the "Add..." drop down menu of the "Add a block" pseudo block 2013-05-20 11:49:24 +08:00
Dan Poltawski aa108f6125 Merge branch 'MDL-38369-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2013-05-20 10:26:14 +08:00
Tim Hunt 7f943085cd MDL-27748 question: grade options should be localised.
question_bank::fraction_options should use format_float to display
decimal pionts correctly.
2013-05-19 23:46:20 +01:00
Tim Hunt 8210b61ff7 MDL-39728 List all the classes in question/type/questionbase.php
This should make it easier for people to understand the type hierarchy.
2013-05-18 09:25:39 +01:00
AMOS bot 1318bf1bff Automatically generated installer lang files 2013-05-18 00:41:38 +00:00
Damyon Wiese d981c4b0fa Merge branch 'MDL-28250-23' of git://github.com/danpoltawski/moodle into MOODLE_23_STABLE 2013-05-17 12:12:01 +08:00
Petr Škoda cb3ab31fde MDL-39678 fix YUI 20130515 vulnerability 2013-05-15 22:03:50 +02:00
Dan Poltawski 6062d3f0bc MDL-28250 license: upgrade old versions of cc-nc
The url was incorectly defined in previous versions

Conflicts:
	version.php
    lib/db/upgrade.php
2013-05-15 11:28:02 +01:00
Wojciech Galiszek 81fe100cf8 MDL-28250 license: Correct cc-nc url 2013-05-15 11:26:44 +01:00
AMOS bot 23dc9305c7 Automatically generated installer lang files 2013-05-15 00:39:26 +00:00
Frederic Massart d35705102c MDL-39667 repository: Correct check for uniqueness of the name 2013-05-14 16:30:10 +08:00
Jerome Mouneyrac ad28e1b6a3 MDL-31209 web service error message: Indication about the service not containg the web service function is confusing 2013-05-14 15:47:56 +08:00
Marina Glancy 239eb7e230 MDL-39177 More comments about confusing files.source field 2013-05-14 17:07:55 +10:00
Marina Glancy 10fcc48782 MDL-39177 Ensure files are overwritten correctly on unzip 2013-05-14 17:07:54 +10:00
Marina Glancy 02890b991a MDL-39177 Perform all checks on draftfile area before saving the files 2013-05-14 17:07:54 +10:00
Marina Glancy 7627b9999c MDL-39177 Remove code duplication 2013-05-14 17:07:54 +10:00
Marina Glancy 77947f22ff MDL-39177 Update file in filearea only if original is present
Now when file was deleted in filemanager and new file with the same file was uploaded the references will be converted to copies exactly like UI warns in filemanager.
Also do not delete original information from draftfiles.
2013-05-14 17:07:54 +10:00
Marina Glancy 832db2f18f MDL-39177 Discard file origin when moving/renaming a file in filemanager
Created one function that handles file update to be used from both JS and nonJS filepicker
2013-05-14 17:07:54 +10:00
Marina Glancy ae55874269 MDL-39177 Original info is not preserved when overwriting a file in filemanager
original file location is used by filemanager to indicate that file is a source of reference and file the list of referencing files
2013-05-14 17:07:53 +10:00
Marina Glancy 73c6550ddb MDL-39177 File reference is not updated when overwriting the file 2013-05-14 17:07:53 +10:00
Marina Glancy 93cbd15ec8 MDL-33719 When overwriting a file the filemanager is not refreshed 2013-05-14 17:03:41 +10:00
AMOS bot fb46297f52 Automatically generated installer lang files 2013-05-14 00:37:47 +00:00
Eloy Lafuente (stronk7) f0d8c53ae0 Moodle release 2.3.7 2013-05-13 12:37:12 +02:00
Eloy Lafuente (stronk7) f26acbbf5b Merge branch 'MDL-39642-en_fix-23' of git://github.com/mudrd8mz/moodle into MOODLE_23_STABLE 2013-05-13 11:53:25 +02:00
Helen Foster 25dba50b9d MDL-39642 Merge English strings from the en_fix language pack 2013-05-13 11:34:34 +02:00
Frederic Massart 63e314128b MDL-39640 repository: Prevent notice when editing an instance 2013-05-13 17:31:12 +08:00
Ankit Agarwal 56e69c6188 MDL-39363 scorm: Accept 0 as a valid score 2013-05-13 11:48:54 +08:00
Andrew Davis 6250057612 MDL-35859 core_grade:fixed an optional parameter call to use the array version 2013-05-13 09:53:32 +08:00
Eloy Lafuente (stronk7) c9827a9135 weekly release 2.3.6+ 2013-05-10 17:33:28 +02:00
Eloy Lafuente (stronk7) 13a322f4b6 Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2013-05-10 17:18:12 +02:00
Eloy Lafuente (stronk7) 2e97c22310 Merge branch 'MDL-39518-23' of git://github.com/damyon/moodle into MOODLE_23_STABLE 2013-05-10 13:18:18 +02:00
Damyon Wiese 05933e48dc MDL-39518: Change hardcoded string MOOCH to Moodle.net 2013-05-10 14:26:10 +08:00
Sam Hemelryk a2d06016f4 Merge branch 'MDL-39488_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2013-05-10 16:30:29 +12:00
Rossiani Wijaya c0f177f19c MDL-39488: Lesson Module: Fixed the potential variable overwritting for answers 2013-05-10 11:17:46 +08:00
Damyon Wiese 4a727367e7 Merge branch 'MDL-39535_m23' of https://github.com/markn86/moodle into MOODLE_23_STABLE 2013-05-10 10:38:37 +08:00
Eloy Lafuente (stronk7) f6735ae534 Merge branch 'MDL-38885-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2013-05-10 03:17:55 +02:00
Eloy Lafuente (stronk7) 48265a6549 Merge branch 'MDL-29758_23' of git://github.com/jmvedrine/moodle into MOODLE_23_STABLE 2013-05-10 02:54:33 +02:00
Frederic Massart e4e1bd900a MDL-38885 form: Fix comments and stricter unit test 2013-05-10 08:38:02 +08:00
Eloy Lafuente (stronk7) 6185fa79e7 Merge branch 'MDL-39488_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2013-05-09 15:49:33 +02:00
Jean-Michel Vedrine ccc0b20a8f MDL-29758 make Cloze question feedback display more informative
as it was in Moodle 1.9
2013-05-09 09:06:15 +02:00
Frederic Massart ee87608e1a MDL-38885 form: Unit tests for data cleaning 2013-05-09 14:10:56 +08:00
Frederic Massart cc2fb80742 MDL-38885 form: Recursively clean parameters based on right type 2013-05-09 14:10:55 +08:00
AMOS bot 50269914ce Automatically generated installer lang files 2013-05-09 00:37:31 +00:00
Jerome Mouneyrac be6281e2cb MDL-37822 fix checkboxes that were always set to on by default 2013-05-09 02:09:04 +02:00
Jerome Mouneyrac 1fc34e37fd MDL-37822 move the default code above the set_config to not make the code less confusing 2013-05-09 02:09:04 +02:00
Jerome Mouneyrac 667eaec4d2 MDL-37822 Moodle send site information to a hub even though it's unchecked 2013-05-09 02:09:04 +02:00
Russell Smith 9dc1f6856e MDL-36482 activities block: Allow mod display without intro's 2013-05-09 10:00:34 +10:00
Eloy Lafuente (stronk7) 7f8cc6f777 Merge branch 'MDL-38487_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-05-09 00:55:28 +02:00
Jayesh Anandani 926e6170ce MDL-26120_23 mod_forum: use correct object 2013-05-09 00:52:41 +05:30
Damyon Wiese ce3fa5931d Merge branch 'MDL-31193-23' of git://github.com/mouneyrac/moodle into MOODLE_23_STABLE 2013-05-08 15:28:24 +08:00
Rajesh Taneja 8aa12adcf2 MDL-37245 Blog: Bloglevel is used for checking if blog is enabled 2013-05-08 14:54:27 +08:00
Rossiani Wijaya b26066bf68 MDL-39488 Lesson Module: Improve code performance 2013-05-08 13:49:41 +08:00
Rossiani Wijaya 9705bfa84f MDL-39488 Lesson Module: Fixed PHP error matching question,
if one or more options have not been selected.
2013-05-08 13:49:41 +08:00
Joseph Rézeau 152a040acd MDL-39488 Lesson Module: Fix for "Match question throws PHP error if one or more options have not been selected "
Signed-off-by: Joseph Rézeau <moodle@rezeau.org>
2013-05-08 13:49:30 +08:00
Damyon Wiese 6f9e83e892 Merge branch 'MDL-37552-23' of git://github.com/mouneyrac/moodle into MOODLE_23_STABLE 2013-05-08 12:44:46 +08:00
Andrew Davis bf5f227817 MDL-37475 core_grade:fixed the handling of show totals 2013-05-08 10:35:25 +12:00
Mark Nielsen 700b5b679e MDL-32301: Allow instructor custom parameters for LTI tools 2013-05-07 21:59:49 +02:00
Eloy Lafuente (stronk7) c6b1ff865f Merge branch 'MDL-34275-23' of git://github.com/danpoltawski/moodle into MOODLE_23_STABLE 2013-05-07 19:14:19 +02:00
Dan Poltawski 0edd01e943 Merge branch 'MDL-36223-23' of git://github.com/damyon/moodle into MOODLE_23_STABLE 2013-05-07 15:28:42 +01:00
Rajesh Taneja 4b5dcd72d5 MDL-37245 Blog: Fixed comments.
Conflicts:

	blog/lib.php

Signed-off-by: Rajesh Taneja <rajesh@moodle.com>

Conflicts:

	blog/lib.php
2013-05-07 14:58:34 +01:00
Rajesh Taneja 28772fb9e7 MDL-37245 Blog: Added permission check for blog comments
Conflicts:

	blog/index.php

Signed-off-by: Rajesh Taneja <rajesh@moodle.com>
2013-05-07 14:58:34 +01:00
Dan Poltawski 14b536dd6f Merge branch 'MDL-38500-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2013-05-07 11:54:32 +01:00
Jerome Mouneyrac d270524855 MDL-37552 external_format_text: missing require_once filelib.php (shared credits to Adam Fredericks for report and patch proposal) 2013-05-07 17:59:07 +08:00
Rex Lorenzo ee439acb1e MDL-34275 - Use default copyright license when restoring files 2013-05-07 09:10:23 +01:00
Damyon Wiese b8401ee7ac Merge branch 'MDL-31713_override_23' of git://github.com/andyjdavis/moodle into MOODLE_23_STABLE 2013-05-07 15:31:41 +08:00
Mark Nelson 955a081e3a MDL-39535 grade: only display grade errors once 2013-05-07 15:14:36 +08:00
Andrew Davis a035b96fd5 MDL-31713 core_grade: added updating of grade min and max to update_final_grade() 2013-05-07 12:27:39 +08:00
Maria Torres 55157bfc2e MDL-39169: Now the question's tags are added in backup/restore options 2013-05-06 15:44:18 +01:00
Damyon Wiese fc282e4ab3 Merge branch 'MDL-38315-m23' of git://github.com/sammarshallou/moodle into MOODLE_23_STABLE 2013-05-06 22:06:01 +08:00
Dan Poltawski 3565867b4f Merge branch 'MDL-39446_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-05-06 14:48:23 +01:00
Dan Poltawski 100da2dcfb Merge branch 'MDL-39491-workshop-media_23' of git://github.com/mudrd8mz/moodle into MOODLE_23_STABLE 2013-05-06 13:12:23 +01:00
Damyon Wiese b4eeee49cd MDL-38443 Assignment: Missing permissions check on downloadall submissions 2013-05-06 10:21:18 +01:00
Damyon Wiese ed8772d0f5 Merge branch 'MDL-39445_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-05-06 15:17:00 +08:00
AMOS bot 6679bfdbd3 Automatically generated installer lang files 2013-05-06 00:40:38 +00:00
Dan Poltawski 6d28ff14f0 Merge branch 'brokencalc_23' of git://github.com/andyjdavis/moodle into MOODLE_23_STABLE 2013-05-05 11:30:40 +01:00
AMOS bot b67bb742a0 Automatically generated installer lang files 2013-05-04 00:40:13 +00:00
David Mudrák b908e2fcd9 MDL-39491 Fix order of Workshop submission text processing
The order of format_text() and file_rewrite_pluginfile_urls() is
important to make filters work correctly.
2013-05-03 12:01:18 +02:00
Albert Gasset ec6ca49767 MDL-39487 mod/assign: fixed ID number of grade item changing 2013-05-03 11:07:56 +02:00
Jerome Mouneyrac fc9fedb375 MDL-31193 display the correct and translated token valid until date 2013-05-03 14:17:15 +08:00
Tim Hunt c8c3599cf4 MDL-39446 calculated qtype: make answer formula input bigger
This makes it easier for teachers editing questions.
2013-05-02 15:47:44 +01:00
Tim Hunt 0fabc84119 MDL-39445 get_plugin_list clean_param use is slow
get_plugin_list was calling clean_param($pluginname, PARAM_PLUGIN) a
lot (600+ times per page), and that is much slower than you would guess.
A specific function for this case, (which we then also use from
clean_param) is a performance win.
2013-05-02 15:47:08 +01:00
Tim Hunt c5602897c1 MDL-38487 qtype match restore: problem with blank ids.
As it happens, this field is useless, and has been removed from the DB
in 2.5. Therefore, we only need a work-around for stable branches.
2013-05-02 15:46:46 +01:00
Dan Poltawski 70d7e35499 weekly release 2.3.6+ 2013-05-02 14:36:56 +01:00
Dan Poltawski 76645b7e6c Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2013-05-02 14:32:32 +01:00
Damyon Wiese 6f0a4b8f24 Merge branch 'MDL-30775-23' of git://github.com/mouneyrac/moodle into MOODLE_23_STABLE 2013-05-02 16:22:48 +08:00
Damyon Wiese 53095b7ebe MDL-36223 Assign: User outline report grade display
Use str_long_grade for user outline report because it handles scales and
no grade.

Thanks to Jean-Daniel Descoteaux for suggesting this fix.
2013-05-02 15:48:09 +08:00
Frederic Massart 2d1fd9e244 MDL-38369 repository: Remove output before redirect 2013-05-02 12:03:38 +08:00
Andrew Davis abd110f8f9 MDL-32913 core_grade:made it more obvious when the gradebook is broken due to a broken calculation 2013-05-02 09:23:36 +08:00
AMOS bot ff198ea740 Automatically generated installer lang files 2013-05-02 00:38:16 +00:00
Eloy Lafuente (stronk7) c738cc946f Merge branch 'MDL-39444_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-05-01 16:54:06 +02:00
Tim Hunt 6137bc9ca2 MDL-39444 get_string: remove unnecessary clean_param
This clean_param was added as part of MDL-22015. It is a good idea when
developer debug is turned on, but it showed up as a surprisingly
expensive cost in our profiling.

This change:

1. Removes the check during string_extist. This will not change
behaviour, the method returns false if the string does not exist.

2. In get_string, it only does the check if debugging is set to
DEVELOPER level.
2013-05-01 10:18:24 +01:00
Frederic Massart 81c19f4d1f MDL-38500 repository: Instance names must be unique 2013-05-01 16:14:15 +08:00
AMOS bot f89ca0ea6e Automatically generated installer lang files 2013-05-01 00:39:27 +00:00
Eloy Lafuente (stronk7) 48c8137388 Merge branch 'wip-MDL-39432-m23' of git://github.com/samhemelryk/moodle into MOODLE_23_STABLE 2013-05-01 01:35:24 +02:00
Sam Hemelryk b6bfe3b35c Merge branch 'MDL-39422-23' of git://github.com/danpoltawski/moodle into MOODLE_23_STABLE 2013-05-01 11:14:12 +12:00
Sam Hemelryk 55d2126310 Merge branch 'wip-MDL-39099_M23' of git://github.com/gjb2048/moodle into MOODLE_23_STABLE 2013-05-01 11:04:33 +12:00
Sam Hemelryk 8617a082bb Merge branch 'MDL-39414-23' of git://github.com/danpoltawski/moodle into MOODLE_23_STABLE 2013-05-01 11:01:54 +12:00
Sam Hemelryk c9b3e9eb23 MDL-39432 course: converted closures to lambda functions 2013-05-01 10:41:53 +12:00
Sam Hemelryk c1163a13fe Merge branch 'MDL-36060-23' of git://github.com/danpoltawski/moodle into MOODLE_23_STABLE 2013-05-01 10:13:51 +12:00
Mark Nielsen 7281117d6e MDL-36060: Remove anonymous functions in mod/lti
This was breaking eaccelerator because it doesn't
support anonymous functions.
2013-04-30 17:50:36 +01:00
Dan Poltawski 10abf35eac MDL-39422 mod_forms: prevent long coruse module names
To prevent ugly DB errors.
2013-04-30 17:42:10 +01:00
Dan Poltawski 6b8f82e412 MDL-39422 course: prevent module names longer 255 chars
To prevent ugly DB errors.
2013-04-30 17:42:10 +01:00
Gareth J Barnard c594709cf4 MDL-39099 course_format: Allow section_summary() to be overridden. 2013-04-30 17:05:44 +01:00
Dan Poltawski cfbf324052 Merge branch 'MDL-35385_chat_23' of git://github.com/andyjdavis/moodle into MOODLE_23_STABLE 2013-04-30 14:08:32 +01:00
Dan Poltawski ff01692765 MDL-39414 portfolio: don't queue google portfolio exports
This is a bit of an ugly way of saying 'I dont support queued exports'.

The google plugins need a valid user session in order to export to the
google services, thereforce we are forcing the export to be interactive
and not queued through cron, as this wont work in the current
implmenetation.

It's possible we could add offline access to the plugins, but I don't
believe it is worth the benefit for the additional complexity.
2013-04-30 10:38:00 +01:00
Damyon Wiese ff6479d21c Merge branch 'MDL-39354_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-04-30 16:27:04 +08:00
Jerome Mouneyrac 46295524d7 MDL-30775 get_course_contents: remove warnings when the section is empty 2013-04-30 14:13:53 +08:00
Andrew Davis 12091f27cf MDL-31713 core_grade:added a unit test to replicate a raw grade max bug 2013-04-30 09:37:49 +08:00
Andrew Davis fa15dda773 MDL-35385 mod_chat: made sure no message popups display within the chat window 2013-04-30 09:10:11 +08:00
AMOS bot 8cee951622 Automatically generated installer lang files 2013-04-30 00:43:52 +00:00
Sam Hemelryk 503630ed47 Merge branch 'w17_MDL-39344_m23_lists' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2013-04-30 10:11:46 +12:00
Sam Hemelryk de0917ef7f Merge branch 'MDL-39303_m23' of https://github.com/markn86/moodle into MOODLE_23_STABLE 2013-04-30 09:59:32 +12:00
Sam Hemelryk b748564398 Merge branch 'MDL-39365-m23' of git://github.com/ankitagarwal/moodle into MOODLE_23_STABLE 2013-04-30 09:36:25 +12:00
Sam Hemelryk d0fc4cf539 Merge branch 'MDL-39398-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2013-04-30 09:31:31 +12:00
Tim Hunt 5ddfd45539 MDL-39354 put back a bit of margin on checkboxes. 2013-04-29 19:16:51 +01:00
Dan Poltawski e46515bd83 Merge branch 'MDL-39378_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-04-29 17:01:12 +01:00
Tim Hunt e47a7b904c MDL-39378 Improve s() performance.
These changes give about a 10% speed-up in this function. The significant changes are:
1. Simplify the if logic to remove unnecssary cases.
2. Dont pass default argument values to htmlspecialchars, just using the
   defaults is faster.
3. I can confirm that /i regex is faster than the equivalent regex without the i.

I also added more unit tests to test the edge cases.
2013-04-29 12:32:29 +01:00
Tim Hunt dc67a0e9b6 MDL-39378 s(): fix bad hex regex 2013-04-29 12:32:26 +01:00
Frederic Massart 81d6802709 MDL-39398 message: Prevent notice when sending Jabber messages
Not tracking the presence prevents a notice to be displayed during disconnect(),
where the the jabber server attempts to subscribe to $CFG->jabberusername presence.
As the server name does not include a resource identifier (stillwit@jabber.org/resource),
an explode('/') fails.
2013-04-29 19:17:47 +08:00
Dan Poltawski d3c575bd6f Merge branch 'MDL-27071_23' of git://github.com/stronk7/moodle into MOODLE_23_STABLE 2013-04-29 10:27:52 +01:00
Eloy Lafuente (stronk7) 08a1a195b4 MDL-27071 Add big IN() unit tests
Let's verify how all databases perform with a big
number of parameters (10000) using IN() SQL clauses.
Both using QM and NAMED parameters.

Ideally only Oracle fails, and only it will need fixing.
2013-04-29 10:03:53 +02:00
Eloy Lafuente (stronk7) e206f3ffcb MDL-27071 Allow Oracle IN() to use > 1000 items
By using a pivoting strategy, we modify the list
of params (QM and NAMED supported) into a
subquery, so the 1000 limit in Oracle (ORA-01795)
is not thrown anymore.

Conflicts:
	lib/dml/oci_native_moodle_database.php
2013-04-29 10:03:39 +02:00
Damyon Wiese 5402f64623 Merge branch 'MDL-39342_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-04-29 15:36:30 +08:00
Damyon Wiese 70f7ea9327 Merge branch 'MDL-30940-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2013-04-29 14:04:26 +08:00
Ankit Agarwal e1aaddef66 MDL-39365 scorm reports: Return correct track count 2013-04-29 13:22:58 +08:00
Damyon Wiese 018e8a9ad4 Merge branch 'MDL-37845_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-04-29 11:47:02 +08:00
Sam Hemelryk 2a6c9c1536 Merge branch 'MDL-39192_m23' of https://github.com/markn86/moodle into MOODLE_23_STABLE 2013-04-29 10:53:33 +12:00
Tim Hunt 50590afe38 MDL-37845 multichoice qtype: Fix some display issues.
1. Better handling of multi-line choices in the correct answer display.
2. Remove dangerous CSS that is no longer needed.
2013-04-25 17:20:46 +01:00
Dan Poltawski 092f45148a Merge branch 'MDL-34403-MOODLE_23_STABLE' of https://github.com/mpetrowi/moodle into MOODLE_23_STABLE 2013-04-25 12:59:31 +01:00
Jason Platts d9c557099c MDL-39342 stop users entering too long matching answers.
Since they lead to an ugly DB error.
2013-04-25 11:59:56 +01:00
Dan Poltawski 161f4e0d79 Merge branch 'MDL-29258_23' of git://github.com/dmonllao/moodle into MOODLE_23_STABLE 2013-04-25 10:32:28 +01:00
Petr Škoda 3c9175acb2 MDL-39344 revert enabling of broken lists plugin from MDL-38329 2013-04-25 09:06:40 +02:00
AMOS bot c464052692 Automatically generated installer lang files 2013-04-25 00:38:10 +00:00
Eloy Lafuente (stronk7) 5e00b9a6e7 weekly release 2.3.6+ 2013-04-25 01:09:23 +02:00
Eloy Lafuente (stronk7) 4b9ae9e997 Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2013-04-25 01:03:22 +02:00
Eloy Lafuente (stronk7) cddf19fccd Merge branch 'MDL-35364_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-04-24 23:37:17 +02:00
Justin Filip 9a6230c822 MDL-39166 auth_ldap Add triggers for user created/updated events. 2013-04-24 16:16:28 -04:00
Matt Petro c8b33aa772 MDL-34403 mod quiz: fix error during enrolment 2013-04-24 15:05:36 -04:00
Dan Poltawski f8028c2f30 Merge branch 'MDL-39283_23' of git://github.com/jmvedrine/moodle into MOODLE_23_STABLE 2013-04-24 14:36:26 +01:00
Ruslan Kabalin 6b59b89a1b MDL-34939: Fix clamdscan permissions-related issues
Use --fdpass parameter that passes the file descriptor permissions to clamd,
which allows to scan given file irrespective of directory and file
permissions. Changing file permissions is not required.
2013-04-24 15:00:00 +08:00
Mark Nelson b5163c5132 MDL-39303 mod_forum: prevent user from submitting when post threshold reached 2013-04-24 14:02:19 +08:00
Mark Nelson b4eb152f69 MDL-39192 mod_forum: do not need to check the posting threshold when editing a post 2013-04-24 12:32:08 +08:00
Jean-Michel Vedrine 5312d1fbeb MDL-39283 GIFT and XML question export broken for unsupported qtypes
Do no write any data to the export for unsupported qtypes
2013-04-23 09:59:31 +02:00
Damyon Wiese 3c719fafc5 Merge branch 'MDL-34933_23_STABLE' of https://github.com/mchurchward/moodle into MOODLE_23_STABLE
Conflicts:
	lib/db/upgrade.php
	version.php
2013-04-23 12:02:30 +08:00
David Monllao c7f7ad249d MDL-29258 core_portfolio: Fixing broken default breadcrumb 2013-04-23 11:24:22 +08:00
Tim Hunt 9d34eba78d MDL-35364 shorten text: don't return invalid HTML.
I also broke the unit tests into more, smaller, named tests, so that
when things start failing, more tests are run, and it is clearer what
the problem is.

In a couple of cases, I adjusted the $ideal lenght in the test. A
careful counting of the characters in the test input (added as comments)
suggests that the new values make for better tests.
2013-04-22 19:24:58 +01:00
Alex Leontiev 7d7824b0c1 MDL-37514 module.js: fix .js for auto quiz submission in preview mode
The issue: when we attempt the quiz as teacher/admin and timer is up,
quiz is not submitted, even though "Open attempts are submitted
automatically" is set. I've changed the javascript for a timer,
responsible for submission, removing the special behaviour in case of
preview mode. Note, that when the admin/teacher is taking a quiz, the
"preview" mode is automatically switched on.

It is a bit strange, since in the javascript there was clearly no
expressed intention to really submit quiz in preview, even when timer
hits. It does not really seem like a accidental bug, rather it looks
like some misunderstanding. Worse still, it may happen that I did not
understand the intentions of previous editor and ruined some
functionality. Because of this, and the fact that this is my first bug,
I would like to ask about the peer review! Please, see my comments in
bug discussion for the testing steps.
2013-04-22 14:05:47 +01:00
Mike Churchward 54f03faba2 MDL-34933 core_message: Adding index to improve database access on message_working table. 2013-04-22 08:35:44 -04:00
Jason Platts ced8b30bd5 MDL-37942 Images with non-alphanumeric chars in file name won't export 2013-04-22 12:44:16 +01:00
Damyon Wiese 42f64a01c7 MDL-39050 quiz access rules: $module->is_enabled() not available for 23 2013-04-22 10:37:44 +08:00
Damyon Wiese cf473c2189 Merge branch 'MDL-39050_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-04-22 10:31:30 +08:00
AMOS bot 5c728f6303 Automatically generated installer lang files 2013-04-22 00:38:30 +00:00
Sam Hemelryk cbf837ce04 Merge branch 'MDL-39172_23' of git://github.com/jmvedrine/moodle into MOODLE_23_STABLE 2013-04-22 11:01:42 +12:00
Dan Poltawski 18646a683b Merge branch 'MDL-38361_23' of https://github.com/prateeksachan/moodle into MOODLE_23_STABLE 2013-04-19 15:12:00 +01:00
Tim Hunt d519be4dab MDL-39050 quiz access rules: settings.php files should work. 2013-04-19 11:52:56 +01:00
Damyon Wiese 472ec72b2a Merge branch 'MDL-39084-moodle23' of github.com:StudiUM/moodle into MOODLE_23_STABLE 2013-04-19 14:07:38 +08:00
Damyon Wiese 8f6894b5f1 Merge branch 'MDL-39167_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-04-19 13:29:41 +08:00
Frederic Massart 50a40aed52 MDL-30940 form: Mutiple select work correctly without any selection 2013-04-19 11:06:12 +08:00
Sam Hemelryk 8be4f7da65 Merge branch 'MDL-39185_m23' of https://github.com/markn86/moodle into MOODLE_23_STABLE 2013-04-19 13:53:19 +12:00
Jean-Michel Vedrine d56837de60 MDL-39172 Import of .dat files is broken in blackboard_six import format 2013-04-18 17:54:02 +02:00
Dan Poltawski dd8e2dde96 weekly release 2.3.6+ 2013-04-18 12:48:44 +01:00
Dan Poltawski cd8dbd11a2 Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2013-04-18 12:43:54 +01:00
Dan Poltawski a5ce56011a Merge branch 'MDL-39203-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2013-04-18 08:36:32 +01:00
Frederic Massart ce51cb98a6 MDL-39203 repository: Fixed authentication errors with Dropbox 2013-04-18 14:50:47 +08:00
Dan Poltawski 32f2cceecc Merge branch 'MDL-38824-m23' of git://github.com/sammarshallou/moodle into MOODLE_23_STABLE 2013-04-17 14:38:18 +01:00
Tim Hunt ef8d4d590c MDL-39167 quiz access rules: need to validate their settings.
We were missing the hook in the form validation method. We had them
everywhere else they were needed.
2013-04-17 14:26:22 +01:00
Mark Nelson 534707ff8d MDL-39185 mod_forum: declare new object before creating member variables to prevent Strict Standards warning 2013-04-17 15:22:15 +08:00
Jean-Philippe Gaudreau ec934409e6 MDL-39084 grade: Capability checks are incoherent for the Course grade settings section 2013-04-16 09:30:19 -04:00
Dan Poltawski 387dc90072 Merge branch 'MDL-39080_M23' of git://github.com/kordan/moodle into MOODLE_23_STABLE 2013-04-16 12:45:14 +01:00
Daniel Neis Araujo 17c980cc80 MDL-38136: fix user_get_user_details doesn't return idnumber (thanks to Antonio Carlos Mariani) 2013-04-16 15:41:19 +08:00
Damyon Wiese 35c4301b2c Merge branch 'wip-MDL-38055-m23' of git://github.com/samhemelryk/moodle into MOODLE_23_STABLE 2013-04-16 15:14:19 +08:00
Dan Poltawski 770e8c02db Merge branch 'MDL-38880_23' of git://github.com/jmvedrine/moodle into MOODLE_23_STABLE 2013-04-15 16:25:30 +01:00
Dan Poltawski fd33a80fa1 Merge branch 'MDL-39000-m23' of git://github.com/sammarshallou/moodle into MOODLE_23_STABLE 2013-04-15 08:30:32 +01:00
Damyon Wiese f7f4494fb7 Merge branch 'MDL-39068_23' of git://github.com/stronk7/moodle into MOODLE_23_STABLE 2013-04-15 14:24:26 +08:00
Eloy Lafuente (stronk7) c7ed914077 Merge branch 'MDL-39089_23' of git://github.com/dmonllao/moodle into MOODLE_23_STABLE 2013-04-15 01:58:01 +02:00
Eloy Lafuente (stronk7) d84477702d MDL-39068 use cross-db text column ORDER BY
Credit goes to Valerii Kuznetsov, thanks!
2013-04-14 16:10:26 +02:00
AMOS bot 7f96a4dffe Automatically generated installer lang files 2013-04-13 00:37:26 +00:00
David Monllao 1b08751cfa MDL-38089 mod_wiki: Fix incorrect links 2013-04-12 13:18:56 +08:00
Damyon Wiese 38b18a142c MDL-29877 Grades - Remove hardcoded prefix from upgrade step. 2013-04-12 11:52:34 +08:00
Damyon Wiese 726e41abaa MDL-29877 Grades - version bump for upgrade step.
And whitespace...
2013-04-12 11:40:00 +08:00
Damyon Wiese d3b880b578 Merge branch 'MDL-29877_bad_grade_item_23' of git://github.com/andyjdavis/moodle into MOODLE_23_STABLE
Conflicts:
	version.php
2013-04-12 11:37:48 +08:00
Jayesh Anandani 7bfe54c41c MDL-39054 quiz statistics: move hard-coded text to lang file 2013-04-12 11:09:33 +08:00
Dan Poltawski 595ef991ee Merge branch 'MDL-37537-23' of git://github.com/srynot4sale/moodle into MOODLE_23_STABLE 2013-04-12 10:26:57 +08:00
Jean-Michel Vedrine 0b4c2c04f9 MDL-38880 Imported Cloze questions lose embedded images or other media 2013-04-11 22:12:57 +02:00
Jean-Philippe Gaudreau d110758759 MDL-38637 CAS Authentication: Undefined index: QUERY_STRING when executing cron 2013-04-11 10:52:56 -04:00
Aaron Barnes dce8cb0576 MDL-37537 completion: Fix incorrect lang string reference in block 2013-04-12 01:54:49 +12:00
Eloy Lafuente (stronk7) 7b9df2353c weekly release 2.3.6+ 2013-04-11 12:42:56 +02:00
Eloy Lafuente (stronk7) 2a564dc2bf Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2013-04-11 12:33:06 +02:00
Kordan bec7d18248 MDL-39080 theme_formal_white: modified "Main menu" block look to resemble the "Navigation" one 2013-04-11 11:03:10 +02:00
Dan Poltawski bf944109f0 Revert "MDL-38254 Assignment Module: add avaialble message to all assignment types"
This reverts commit 079a76bb37.
2013-04-11 16:53:33 +08:00
Damyon Wiese 932d87f841 MDL-35144 Categories - Allow editing by custom roles
Users with category:manage or course:create should be able to edit
the course/category.php page.
2013-04-11 14:10:29 +08:00
Eloy Lafuente (stronk7) f3d49933b0 Merge branch 'MDL-38525-23' of https://github.com/damyon/moodle into MOODLE_23_STABLE 2013-04-11 00:57:23 +02:00
Damyon Wiese 557383cd94 MDL-38525: Assignment upgrade - Error with comments for unenrolled students.
Students with comments on 'upload' assignments cause errors for the upgrade
tool if they are no longer enrolled. The solution is to allow siteadmin to
see student submissions even if the student is not currently enrolled (you
must be siteadmin to run the upgrade tool).
2013-04-10 16:18:35 +08:00
Ryan Panning 3b89216c24 MDL-38525: Assignment - print exception message when assignment upgrade fails.
Change to use getMessage() from the Exception class will prevent "{$a}" when
$e->error is null.
2013-04-10 16:18:31 +08:00
Dan Poltawski b3e792b946 Merge branch 'MDL-19072_23' of git://github.com/jmvedrine/moodle into MOODLE_23_STABLE 2013-04-10 14:11:03 +08:00
Howard Miller ea6ef858f5 MDL-35144 adding editing capabiltities to page 2013-04-10 12:24:08 +08:00
Dan Poltawski c01f9e8bc1 Merge branch 'wip-mdl-35883-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2013-04-10 12:16:58 +08:00
Dan Poltawski 7d042f6734 Merge branch 'MDL-38254_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2013-04-10 12:13:51 +08:00
Dan Poltawski 2967681e64 Merge branch 'MDL-38999_23' of git://github.com/stronk7/moodle into MOODLE_23_STABLE 2013-04-10 10:36:00 +08:00
Andrew Davis aeacefdb19 MDL-29877 core_grade:add some upgrade code to fix broken grade items introduced by bad restores 2013-04-10 08:34:04 +08:00
Petr Škoda b93ca5a53d MDL-38912 fix incorrect timeout reset 2013-04-10 00:07:51 +02:00
sam marshall 70c3c66943 MDL-39000 Conditional activities: Section condition restore errors 2013-04-09 17:40:55 +01:00
Jean-Michel Vedrine 59b50da6e9 MDL-19072 XHTML export for match questions fix for distractors 2013-04-09 11:49:18 +02:00
Dan Poltawski 650e0141fe Merge branch 'wip-MDL-38442-m23' of git://github.com/samhemelryk/moodle into MOODLE_23_STABLE 2013-04-09 15:40:38 +08:00
Dan Poltawski 112bb36c24 Merge branch 'MDL-38766/MOODLE_23_STABLE' of github.com:kemitix/moodle into MOODLE_23_STABLE 2013-04-09 10:38:22 +08:00
Dan Poltawski e37db6dc17 Merge branch 'wip-MDL-38541-m23' of git://github.com/marinaglancy/moodle into MOODLE_23_STABLE 2013-04-09 09:48:27 +08:00
Marina Glancy 1d05ecfd3e MDL-38541 Restrict calling rebuild_course_cache() from upgrade process
only plugins upgrade scripts can call rebuild_course_cache() and for clearing cache only.
2013-04-09 11:17:47 +10:00
AMOS bot fcb47c06b0 Automatically generated installer lang files 2013-04-09 00:37:52 +00:00
Eloy Lafuente (stronk7) 679620265a Merge branch 'w14_MDL-38753_m23_ocicount' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2013-04-09 02:25:54 +02:00
Petr Škoda 3848b9c8d5 MDL-39028 fix sqlsrv concat type conversion 2013-04-09 02:18:46 +02:00
Sam Hemelryk 0f16db943c MDL-38442 navigation: set_expansion_limit now only hides structural nodes 2013-04-09 12:08:59 +12:00
Petr Škoda 0992cee1de MDL-39024 fix MSSQL seek past the end of recordset 2013-04-09 02:00:04 +02:00
Petr Škoda 7cfccbb148 MDL-39022 fix MSSQL concat type conversion 2013-04-09 01:57:09 +02:00
Eloy Lafuente (stronk7) f3da6ac7aa Merge branch 'MDL-38912_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-04-09 01:40:06 +02:00
Eloy Lafuente (stronk7) 1b9d0b9e3e Merge branch 'MDL-39023-parentlang_23' of git://github.com/mudrd8mz/moodle into MOODLE_23_STABLE 2013-04-08 16:58:03 +02:00
Eloy Lafuente (stronk7) f80b096a5e MDL-38999 timezones: add some TZ/stamps know to be problematic to tests. 2013-04-08 16:33:01 +02:00
Eloy Lafuente (stronk7) 75899ed480 MDL-38999 timezones: fixed timezone information. 2013-04-08 16:32:53 +02:00
sam marshall 39525889eb MDL-38824 Activity completion: Automatic completion quotes not escaped 2013-04-08 14:55:51 +01:00
David Mudrák a82871d4f7 MDL-39023 Make get_language_dependencies() aware of circular dependency risk
The patch reimplements the core_string_manager::get_language_dependencies()
so that potentially mis-configured language packs with circular
dependencies or self dependency do not make the site unavailable.
Unit tests for the expected behaviour are added.
2013-04-08 15:02:59 +02:00
Petr Škoda 0dec339211 MDL-38753 tweak count SQL to make stupid Oracle happy 2013-04-08 12:35:33 +02:00
Damyon Wiese 2b705fc409 Merge branch 'MDL-38452-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2013-04-08 14:08:52 +08:00
Dan Poltawski c2217f57d0 Merge branch 'MDL-37676_23_STABLE' of git://github.com/appalachianstate/moodle into MOODLE_23_STABLE 2013-04-08 14:07:10 +08:00
Tim Lock 7dc59651b0 MDL-35868: quiz: Use correct attemptnumber when a last attempt exists. 2013-04-08 11:10:08 +08:00
AMOS bot ad20106a0b Automatically generated installer lang files 2013-04-08 00:36:07 +00:00
AMOS bot 68d6206d85 Automatically generated installer lang files 2013-04-07 00:37:27 +00:00
Tim Hunt d4aac8e4f6 MDL-38912 prevent time-outs during unit tests. 2013-04-05 18:39:25 +01:00
Dan Poltawski 7d253e0977 weekly release 2.3.6+ 2013-04-05 18:00:55 +08:00
Dan Poltawski 8318d25d49 Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2013-04-05 17:53:03 +08:00
Paul Campbell 927b7c29c8 MDL-38766 wiki2.0: fix redirects
Signed-off-by: Paul Campbell <pcampbell@carnegiecollege.ac.uk>
2013-04-05 09:38:05 +01:00
Rossiani Wijaya 3cee2ad262 MDL-38254 Assignment Module: add avaialble message to all assignment types 2013-04-04 11:13:31 +08:00
AMOS bot 3f8a77fb21 Automatically generated installer lang files 2013-04-04 00:36:11 +00:00
Eloy Lafuente (stronk7) a88b558c83 Merge branch 'MDL-38112-23' of git://github.com/danpoltawski/moodle into MOODLE_23_STABLE 2013-04-04 00:58:39 +02:00
Dan Poltawski f24fb2fec4 Merge branch 'MDL-38657_M23' of git://github.com/lazydaisy/moodle into MOODLE_23_STABLE 2013-04-03 16:51:39 +08:00
Aparup Banerjee 45d7974cc9 Merge branch 'MDL-38809_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-04-03 16:33:45 +08:00
AMOS bot 17dfe60da0 Automatically generated installer lang files 2013-04-03 00:35:47 +00:00
Rajesh Taneja 8cea78f500 MDL-35883 Accessibility: Added title for login as user link in header and footer for accessibility 2013-04-02 16:07:29 +08:00
Rajesh Taneja d82cef65c6 MDL-35883 Accessibility: Added title for user link in header and footer for accessibility
Conflicts:

	lib/outputrenderers.php
2013-04-02 16:07:29 +08:00
Dan Poltawski d6868e54b8 MDL-35603 backup: fix coding style issues
Conflicts:
	backup/util/ui/restore_ui_components.php
2013-04-02 14:34:15 +08:00
Dan Poltawski e53be83e10 Merge branch 'MDL-35603_23' of git://github.com/rlorenzo/moodle into MOODLE_23_STABLE 2013-04-02 14:27:39 +08:00
Damyon Wiese 772e6ab1bf Merge branch 'MDL-38713-23' of git://github.com/danpoltawski/moodle into MOODLE_23_STABLE 2013-04-02 13:24:19 +08:00
Damyon Wiese 2dc4d19f79 Merge branch 'MDL-38703-23' of git://github.com/danpoltawski/moodle into MOODLE_23_STABLE 2013-04-02 13:05:28 +08:00
Damyon Wiese 482823f2b6 Merge branch 'MDL-38700-23' of git://github.com/danpoltawski/moodle into MOODLE_23_STABLE 2013-04-02 12:31:52 +08:00
Dan Poltawski 8132e0f899 Merge branch 'MDL-38702_M23' of git://github.com/lazydaisy/moodle into MOODLE_23_STABLE 2013-04-02 10:04:56 +08:00
Mary Evans c74325d17a MDL-38657 theme_base: fixes misalignment issue in User Report page. 2013-03-31 02:25:47 +01:00
prateeksachan b4dcb723ff MDL-38361: Fixed typos in mod/assign/locallib.php 2013-03-31 00:29:18 +05:30
Tim Hunt ccf46ba2d9 MDL-38809 quiz manual grading: delete expensive unnecssary code. 2013-03-30 17:27:41 +00:00
Rex Lorenzo 13c708233e MDL-35603 - Backup - Course import/restore max results
* Unified UI for import and restore course search
2013-03-28 15:24:14 -07:00
Damyon Wiese 5a2c3ece38 weekly release 2.3.6+ 2013-03-28 14:47:18 +08:00
Damyon Wiese f6d596dd5d Merge branch 'MDL-25631_m23' of git://github.com/merrill-oakland/moodle into MOODLE_23_STABLE 2013-03-28 10:42:18 +08:00
Aparup Banerjee 9efd33dc61 Merge branch 'MDL-38659_23' of git://github.com/stronk7/moodle into MOODLE_23_STABLE 2013-03-27 10:39:10 +08:00
Eloy Lafuente (stronk7) 4984697c12 Merge branch 'MDL-38557_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-03-26 23:42:11 +01:00
Eloy Lafuente (stronk7) e721f2dec8 Merge branch 'MDL-38647_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-03-26 23:24:00 +01:00
Eric Merrill 4c31a15261 MDL-25631 backup Decoupling legacy files from course config settigs. If they are present, they will be restored. 2013-03-26 17:05:05 -04:00
Petr Škoda aca26e0641 MDL-37782 reset DB after each failed database test
Conflicts:
	lib/phpunit/classes/database_driver_testcase.php
2013-03-26 16:14:01 +01:00
Eloy Lafuente (stronk7) 9821beacb6 MDL-38659 environment: fix incorrect feedback messages 2013-03-26 15:37:36 +01:00
Dan Poltawski 642cbeec6b MDL-38713 course: correctly set visibleold on mod creation
Remove uncessary set of visibleold in the form
2013-03-26 16:19:47 +08:00
Dan Poltawski 47b17f9123 MDL-38703 course: backport visibility tests from MDL-36417 2013-03-26 15:58:58 +08:00
Dan Poltawski 470730c86b MDL-38703 course: moving a hidden course module unhides it
When moving to a non-hidden section because visibleold was not
being correctly set. visibleold should only be differnet from visible
when a CM is changed by section visibility
2013-03-26 15:48:28 +08:00
Damyon Wiese 2ec0ba91b8 MDL-38468 Filelib: Fix ordering of new mimetypes and upgrade step 2013-03-26 15:30:24 +08:00
Matteo Scaramuccia 4c1689ba52 MDL-38468 Files API: fixed the support for MTHML (MIME HTML: web page archive) files
Conflicts:

	version.php
2013-03-26 15:28:21 +08:00
Charles Fulton ba7c052171 MDL-38700 course: only change visibility if a module moves to a different section 2013-03-26 15:10:44 +08:00
Dan Poltawski 1a5d5334bf MDL-38700 course: add tests for moveto_module()
* Test visibility when moving around hidden sections
* Test for visiblity changes when moving around in the same sections.
2013-03-26 15:10:44 +08:00
Damyon Wiese 7e53f1a231 Merge branch 'wip-MDL-35875-stable23' of git://github.com/phalacee/moodle into MOODLE_23_STABLE 2013-03-26 14:48:10 +08:00
Damyon Wiese c50107c847 Merge branch 'MDL-30438_b_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2013-03-26 14:38:06 +08:00
Damyon Wiese 97707318c3 Merge branch 'MDL-38380_M23' of git://github.com/lazydaisy/moodle into MOODLE_23_STABLE 2013-03-26 13:25:16 +08:00
Dan Poltawski 1947345e42 MDL-38112 - update to the ISO list of countries
According to ISO 3166-1
2013-03-26 10:49:26 +08:00
Damyon Wiese 4523bbba8f Merge branch 'wip-mdl-36882-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2013-03-26 10:43:32 +08:00
Rajesh Taneja 44ee5acee4 MDL-36882 course: Added aria-live for manual completion
This is required so that assistive technologies can notify user about change on completion status
2013-03-26 10:28:27 +08:00
Damyon Wiese 25e348d6aa Merge branch 'wip-mdl-36125-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2013-03-26 10:15:08 +08:00
Mary Evans 3d2ec04484 MDL-38702 theme_mymobile: Replaced missing theme setting to disable CSS Optimiser.
The missing setting was a regression casued by MDL-33357.
2013-03-26 01:01:25 +00:00
Damyon Wiese 8a95402f94 Merge branch 'MDL-38668_23' of git://github.com/stronk7/moodle into MOODLE_23_STABLE 2013-03-25 15:51:56 +08:00
Jason Fowler e8eb6a1d50 MDL-35875 - Accessibility - Remove empty summary attribute for user information table in view user's profile 2013-03-25 11:16:40 +08:00
Damyon Wiese d196b17587 MDL-37033 Environment - Fix indenting in XML 2013-03-25 09:38:30 +08:00
Damyon Wiese 5320a265ab Merge branch 'MDL-37033_23' of git://github.com/stronk7/moodle into MOODLE_23_STABLE 2013-03-25 09:37:07 +08:00
Andrew Robert Nicols 12b6eebf37 MDL-38658 JavaScript: Correct fullpath for dndupload definition 2013-03-24 23:44:38 +01:00
Eloy Lafuente (stronk7) eea80d257c Merge branch 'MDL-36927-m23' of git://github.com/ankitagarwal/moodle into MOODLE_23_STABLE 2013-03-24 23:39:42 +01:00
Eloy Lafuente (stronk7) f54579f72a MDL-38668 timezones: update to tzdata 2013b 2013-03-24 10:46:33 +01:00
Eloy Lafuente (stronk7) e848bf1153 MDL-37033 environment: add 2.5 brach details 2013-03-22 18:42:15 +01:00
Fred Woolard 2e83fee85c MDL-37676 Use course grade category if mapping fails for manual grade items 2013-03-22 08:41:15 -04:00
Tim Hunt f466f71902 MDL-38647 quiz review question issue
Page URL should contain 'step=0' if necessary, but not 'step='.
2013-03-22 11:31:53 +00:00
Tim Hunt 23149b2e13 MDL-38557 quiz manual grading should check mod/quiz:grade 2013-03-22 10:19:53 +00:00
Damyon Wiese 8bb0c27f1b weekly release 2.3.6+ 2013-03-22 13:52:38 +08:00
Damyon Wiese 7c5fa92210 Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2013-03-22 13:35:42 +08:00
Rajesh Taneja 8dc10e915e MDL-36125 course: Added aria-describedby for editing activity title 2013-03-22 12:42:48 +08:00
Eloy Lafuente (stronk7) 3ea063fe7d Merge branch 'MDL-37664-23-int' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2013-03-21 10:56:31 +01:00
Frederic Massart 4174fc1176 MDL-37664 blocks: Unexisting function for RTL in drag & drop 2013-03-21 17:46:28 +08:00
AMOS bot 1fde603819 Automatically generated installer lang files 2013-03-21 00:37:32 +00:00
David Monllao 4f47ee6476 MDL-38364 phpunit: PHPUnit autoload uses capital A 2013-03-20 16:06:50 +08:00
Ankit Agarwal 63308668d6 MDL-36927 Reports: Page layout is not defined in course/recent.php 2013-03-20 14:13:09 +08:00
Damyon Wiese 4b226f3b37 MDL-38373 Auth - Additional strict warning fix for radius authentication 2013-03-20 12:41:39 +08:00
Damyon Wiese d3a9460d57 Merge branch 'MDL-38373_23' of git://github.com/stronk7/moodle into MOODLE_23_STABLE 2013-03-20 12:40:01 +08:00
Frederic Massart e004354787 MDL-38452 repositories: User logged in as have access to non-private repositories 2013-03-20 12:39:58 +08:00
Sam Hemelryk 4688b27ab3 MDL-38055 course: fixed double encoding of title properties
Conflicts:
	lib/navigationlib.php

Conflicts:
	blocks/course_overview/renderer.php
	lib/navigationlib.php
2013-03-20 17:35:24 +13:00
Eloy Lafuente (stronk7) 417c261001 Revert "MDL-38515 JavaScript: Correct module dependencies for core_filepicker"
This reverts commit e40c3f7cc4.
2013-03-20 00:58:04 +01:00
Eloy Lafuente (stronk7) e815163162 Merge branch 'MDL-38490_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-03-20 00:43:49 +01:00
Eloy Lafuente (stronk7) 665f13c50c Merge branch 'MDL-38370-m23' of git://github.com/ankitagarwal/moodle into MOODLE_23_STABLE 2013-03-20 00:32:09 +01:00
Eloy Lafuente (stronk7) 601054daca Merge branch 'w12_MDL-38364_m23_phpunitloading' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2013-03-20 00:21:58 +01:00
Eloy Lafuente (stronk7) a3a6b68ae9 Merge branch 'MDL-37664-MOODLE_23_STABLE' of https://github.com/lucisgit/moodle into MOODLE_23_STABLE 2013-03-19 23:37:49 +01:00
Eloy Lafuente (stronk7) c2879b7db8 Merge branch 'MDL-38424_m23' of git://github.com/kordan/moodle into MOODLE_23_STABLE 2013-03-19 23:18:59 +01:00
Eloy Lafuente (stronk7) 9146ab295d Merge branch 'MDL-38395_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-03-19 23:13:16 +01:00
Eloy Lafuente (stronk7) 14742ceb73 Merge branch 'MDL-38460_M23' of git://github.com/lazydaisy/moodle into MOODLE_23_STABLE 2013-03-19 21:17:19 +01:00
Eloy Lafuente (stronk7) 7a4605ae62 Merge branch 'wip-MDL-38422_M23' of git://github.com/gjb2048/moodle into MOODLE_23_STABLE 2013-03-19 21:13:22 +01:00
Eloy Lafuente (stronk7) e250e9ae29 Merge branch 'MDL-38363_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-03-19 21:07:29 +01:00
Eloy Lafuente (stronk7) a0b12848a4 Merge branch 'MDL-38355_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-03-19 21:01:24 +01:00
Eloy Lafuente (stronk7) 07c65a6029 Merge branch 'MDL-38388_23' of git://github.com/jonof/moodle into MOODLE_23_STABLE 2013-03-19 19:03:37 +01:00
Eloy Lafuente (stronk7) 7849c44376 Merge branch 'MDL-38412_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-03-19 18:23:04 +01:00
Eloy Lafuente (stronk7) e2c7333c2e Merge branch 'w12_MDL-38329_m23_webkit' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2013-03-19 18:18:05 +01:00
Petr Škoda ecd68bf7b6 MDL-38202 fix loginas logout redirection 2013-03-19 16:54:20 +01:00
Eloy Lafuente (stronk7) b2b512671d Merge branch 'MDL-38542_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-03-19 16:49:45 +01:00
Eloy Lafuente (stronk7) 6211a05866 Merge branch 'MDL-38444_23' of https://github.com/ppichet/moodle into MOODLE_23_STABLE 2013-03-19 16:35:41 +01:00
Tim Hunt e24cb35c18 MDL-38542 shortanswer qtype: was broken for responses of '0'.
This was a regression caused by MDL-37157 & MDL-37746.
2013-03-19 13:55:48 +00:00
Eloy Lafuente (stronk7) dd8ec00067 Merge branch 'MDL-38515-m23' of git://github.com/andrewnicols/moodle into MOODLE_23_STABLE 2013-03-19 12:58:42 +01:00
Eloy Lafuente (stronk7) a3db3bfac0 Merge branch 'MDL-38397_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2013-03-19 12:29:01 +01:00
Eloy Lafuente (stronk7) cf9b57d181 Merge branch 'wip-mdl-38431-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2013-03-19 10:24:45 +01:00
Eloy Lafuente (stronk7) 28896f12f7 Merge branch 'MDL-36872-m23' of git://github.com/ankitagarwal/moodle into MOODLE_23_STABLE 2013-03-19 09:37:31 +01:00
Damyon Wiese b100f948cb Merge branch 'MDL-38215-workshop-oracle_23' of git://github.com/mudrd8mz/moodle into MOODLE_23_STABLE 2013-03-18 11:46:15 +08:00
Petr Škoda 2de3def418 MDL-38329 use proper plugin name for the webkit lists workaround
Credit goes to Mauno Korpelainen, thanks.
2013-03-17 21:05:27 +01:00
Petr Škoda 5a3ebd5ea6 MDL-38364 rework PHPUnit autoloading
This is related to BC incompatibility introduced in https://github.com/sebastianbergmann/phpunit/issues/848
2013-03-17 19:57:37 +01:00
Andrew Robert Nicols e40c3f7cc4 MDL-38515 JavaScript: Correct module dependencies for core_filepicker 2013-03-17 16:56:18 +00:00
ppichet 475ba4478d MDL-38444 Saving datasets from edit_calculatedsimple_form.php
Bypassing the 3 steps savequestion() of calculated.
2013-03-16 22:39:52 -04:00
Eloy Lafuente (stronk7) 532c3d8803 MDL-25655 glossary: non full searches now working.
In the process of updting the module from 1.9 to
2.0 the (non) full search feature was lost without notice.

This restitutes it with the same behavior present in 1.9:

- fullsearch disabled: look into concepts and aliases.
- fullsearch enabled (default): look also into definitions.
2013-03-16 18:09:40 +01:00
Eloy Lafuente (stronk7) d312ce89e2 MDL-38373 Use correct PEAR->loadExtension()
Current use is wrong (static) and leads to strict standards notice.
2013-03-16 11:43:51 +01:00
Mary Evans 52a19fac1e MDL-38380 theme_magazine: Fixed typo in style/core.css. 2013-03-16 01:50:52 +00:00
Tim Hunt 682b737316 MDL-38412 fix quiz reports group mode weirdness.
Moodle currently selected group uses the session. This can cause weird
effects when you have two tabs open. This is particularly weird in the
quiz reports, where some actions like delete attempt are checked against
the currently selected group.

The solution is to put the currently selected group into the URL for all
actions like delete/regrade attempt, regrade all attempts, download and
sort table.
2013-03-15 12:02:31 +00:00
Tim Hunt b433c4cedf MDL-38363 qtype_calculated. Fix warnings. 2013-03-15 11:23:39 +00:00
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
Tim Hunt 340cba5b22 MDL-38395 question categories: wrong URLs after editing.
The problem was that array1 + array2 takes the values from
array1 when a key appears in both places.

While working on this area, I updated it to use html_writer.
2013-03-15 08:15:23 +00: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
Jonathon Fowler 2ffd3701f5 MDL-38388 qformat_blackboard_six: fix question image import
This works on the expectation that the returned array from readdata()
is opaque and will be fed directly into readquestions() since
filebase is different per file and needs to be set up appropriately
before each parse.
2013-03-15 09:09:27 +10:00
Tim Hunt e421b1524f MDL-38355 qtype_multianswer: input boxes too big in Russian.
... and any other language where the characters take multiple
bytes in UTF-8.

This fix was worked out by Dušan Ristić. I am just committing it.
2013-03-14 22:27:48 +00:00
Tim Hunt 0147d3da53 MDL-38397 question editing: only validate default mark if present.
Most qtypes have that field, but not all. multianswer is an example in core.
Also some contrib qtypes.
2013-03-14 22:13:56 +00:00
Tim Hunt d8a20b8828 MDL-38490 question preview, variant is attempt (not display) option 2013-03-14 17:22:37 +00:00
Eloy Lafuente (stronk7) 0f52118a4a weekly release 2.3.5+ 2013-03-14 15:46:58 +01:00
Ankit Agarwal 77df5b724d MDL-36872 reports: Fixing incorrect sorting of recent activites by timestamp 2013-03-14 14:45:11 +08: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
Mary Evans 951a9fcc67 MDL-38460 theme_mymobile: Fixes resources folders to show properly on first access. 2013-03-14 01:27:19 +00: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
David Mudrák 95c7d1d076 MDL-38215 Fix cross-db support in workshop SQL queries
The $sql used in these methods may contain multiple parts glued
together by the UNION operator. Simply appending the ORDER BY statement
to the end of the query does not work in all DBs (failure reported at
Oracle). Following the pattern already applied in MDL-30051, we wrap the
SQL into yet another SELECT statement and perform ordering there.

Credit goes to Sara Cenni for suggesting the fix.
2013-03-13 15:17:42 +01: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
Shamim Rezaie 831ecc9af3 MDL-37664 course: Fix drag & drop RTL mode issue 2013-03-12 15:49:35 +00:00
Kordan 42a42bcd46 MDL-38424 theme_formal_white: added suggestions to css custom styles description 2013-03-12 13:50:24 +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
Rossiani Wijaya 1d19d5c219 MDL-30438 Lesson Module: fixed input text editable capability after checking/unchecking unmask option for all browsers except IE8 or lower 2013-03-12 12:44:06 +08:00
Rajesh Taneja 14d6c90f81 MDL-38431 comment: profile url should be escaped, as it's used in html 2013-03-12 12:31:29 +08:00
Ankit Agarwal c1607b5378 MDL-38370 scorm: Fixing strict standard errors in outline report 2013-03-12 11:44:09 +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
Gareth J Barnard b5ef760c57 MDL-38422 theme_mymobile: TinyMCE editor difficulties. 2013-03-11 17:51:57 +00:00
Rossiani Wijaya f1192522c8 MDL-30438 Lesson Module: improve password field to disabled when password protect is set to no. 2013-03-11 14:48:45 +08: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
sam marshall 276d1134e2 MDL-38315 Completion: Bugs with 'locked' status in activity form 2013-03-05 16:40:18 +00: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
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
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
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
Frederic Massart ab4cb125e4 MDL-34435 reports: Log category actions
Conflicts:

	course/lib.php
	version.php
2013-01-10 15:14:18 +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
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
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
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
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
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
sam marshall b12d8cd881 MDL-36095 Section availability: Make behaviour consistent with activities 2013-01-07 15:55:12 +00: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
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
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
Petr Škoda 2a3af105e6 MDL-35185 import Flowplayer 3.2.14 2012-10-08 19:25:42 +02:00
632 changed files with 13413 additions and 5897 deletions
+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
+91
View File
@@ -0,0 +1,91 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This script fixed incorrectly deleted users.
*
* @package core
* @subpackage cli
* @copyright 2013 Petr Skoda (http://skodak.org)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('CLI_SCRIPT', true);
require(__DIR__.'/../../config.php');
require_once($CFG->libdir.'/clilib.php');
// Now get cli options.
list($options, $unrecognized) = cli_get_params(array('help'=>false),
array('h'=>'help'));
if ($unrecognized) {
$unrecognized = implode("\n ", $unrecognized);
cli_error(get_string('cliunknowoption', 'admin', $unrecognized));
}
if ($options['help']) {
$help =
"Fix incorrectly deleted users.
This scripts detects users that are marked as deleted instead
of calling delete_user().
Deleted users do not have original username, idnumber or email,
we must also delete all roles, enrolments, group memberships, etc.
Please note this script does not delete any public information
such as forum posts.
Options:
-h, --help Print out this help
Example:
\$sudo -u www-data /usr/bin/php admin/cli/fix_deleted_users.php
";
echo $help;
die;
}
cli_heading('Looking for sloppy user deletes');
// Look for sloppy deleted users where somebody only flipped the deleted flag.
$sql = "SELECT *
FROM {user}
WHERE deleted = 1 AND email LIKE '%@%' AND username NOT LIKE '%@%'";
$rs = $DB->get_recordset_sql($sql);
foreach ($rs as $user) {
echo "Redeleting user $user->id: $user->username ($user->email)\n";
delete_user($user);
}
cli_heading('Deleting all leftovers');
$DB->set_field('user', 'idnumber', '', array('deleted'=>1));
$DB->delete_records_select('role_assignments', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
$DB->delete_records_select('cohort_members', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
$DB->delete_records_select('groups_members', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
$DB->delete_records_select('user_enrolments', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
$DB->delete_records_select('user_preferences', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
$DB->delete_records_select('user_info_data', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
$DB->delete_records_select('user_lastaccess', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
$DB->delete_records_select('external_tokens', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
$DB->delete_records_select('external_services_users', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
exit(0);
+249 -20
View File
@@ -227,7 +227,7 @@
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_CHECK message="iconvrequired" />
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
@@ -237,7 +237,7 @@
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_CHECK message="curlrequired" />
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="optional">
@@ -277,12 +277,12 @@
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_CHECK message="simplexmlrequired" />
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_CHECK message="splrequired" />
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
@@ -344,7 +344,7 @@
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_CHECK message="iconvrequired" />
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
@@ -354,7 +354,7 @@
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_CHECK message="curlrequired" />
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="optional">
@@ -394,12 +394,12 @@
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_CHECK message="simplexmlrequired" />
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_CHECK message="splrequired" />
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
@@ -454,7 +454,7 @@
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_CHECK message="iconvrequired" />
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
@@ -464,7 +464,7 @@
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_CHECK message="curlrequired" />
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="optional">
@@ -504,12 +504,12 @@
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_CHECK message="simplexmlrequired" />
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_CHECK message="splrequired" />
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
@@ -569,7 +569,7 @@
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_CHECK message="iconvrequired" />
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
@@ -579,7 +579,7 @@
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_CHECK message="curlrequired" />
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="optional">
@@ -619,12 +619,12 @@
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_CHECK message="simplexmlrequired" />
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_CHECK message="splrequired" />
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
@@ -685,7 +685,7 @@
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_CHECK message="iconvrequired" />
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
@@ -695,7 +695,7 @@
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_CHECK message="curlrequired" />
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="optional">
@@ -735,12 +735,12 @@
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_CHECK message="simplexmlrequired" />
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_CHECK message="splrequired" />
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
@@ -776,4 +776,233 @@
</PHP_SETTING>
</PHP_SETTINGS>
</MOODLE>
<MOODLE version="2.5" requires="2.2">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mysql" version="5.1.33" />
<VENDOR name="postgres" version="8.3" />
<VENDOR name="mssql" version="9.0" />
<VENDOR name="odbc_mssql" version="9.0" />
<VENDOR name="mssql_n" version="9.0" />
<VENDOR name="oracle" version="10.2" />
<VENDOR name="sqlite" version="2.0" />
</DATABASE>
<PHP version="5.3.3" level="required">
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
<ON_CHECK message="pcreunicodewarning" />
</FEEDBACK>
</PCREUNICODE>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
<FEEDBACK>
<ON_CHECK message="mbstringrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="optional">
<FEEDBACK>
<ON_CHECK message="opensslrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="tokenizer" level="optional">
<FEEDBACK>
<ON_CHECK message="tokenizerrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlrpc" level="optional">
<FEEDBACK>
<ON_CHECK message="xmlrpcrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="soap" level="optional">
<FEEDBACK>
<ON_CHECK message="soaprecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="ctype" level="required">
<FEEDBACK>
<ON_ERROR message="ctyperequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zip" level="required">
<FEEDBACK>
<ON_ERROR message="ziprequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="gd" level="required">
<FEEDBACK>
<ON_ERROR message="gdrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="dom" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xml" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="intl" level="optional">
<FEEDBACK>
<ON_CHECK message="intlrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" level="required"/>
</PHP_EXTENSIONS>
<PHP_SETTINGS>
<PHP_SETTING name="memory_limit" value="40M" level="required">
<FEEDBACK>
<ON_ERROR message="settingmemorylimit" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="safe_mode" value="0" level="optional">
<FEEDBACK>
<ON_CHECK message="settingsafemode" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="file_uploads" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="settingfileuploads" />
</FEEDBACK>
</PHP_SETTING>
</PHP_SETTINGS>
</MOODLE>
<MOODLE version="2.6" requires="2.2">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mysql" version="5.1.33" />
<VENDOR name="postgres" version="8.3" />
<VENDOR name="mssql" version="9.0" />
<VENDOR name="oracle" version="10.2" />
</DATABASE>
<PHP version="5.3.3" level="required">
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
<ON_CHECK message="pcreunicodewarning" />
</FEEDBACK>
</PCREUNICODE>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
<FEEDBACK>
<ON_CHECK message="mbstringrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="optional">
<FEEDBACK>
<ON_CHECK message="opensslrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="tokenizer" level="optional">
<FEEDBACK>
<ON_CHECK message="tokenizerrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlrpc" level="optional">
<FEEDBACK>
<ON_CHECK message="xmlrpcrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="soap" level="optional">
<FEEDBACK>
<ON_CHECK message="soaprecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="ctype" level="required">
<FEEDBACK>
<ON_ERROR message="ctyperequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zip" level="required">
<FEEDBACK>
<ON_ERROR message="ziprequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="gd" level="required">
<FEEDBACK>
<ON_ERROR message="gdrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="dom" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xml" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="intl" level="optional">
<FEEDBACK>
<ON_CHECK message="intlrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" level="required"/>
</PHP_EXTENSIONS>
<PHP_SETTINGS>
<PHP_SETTING name="memory_limit" value="64M" level="required">
<FEEDBACK>
<ON_ERROR message="settingmemorylimit" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="safe_mode" value="0" level="optional">
<FEEDBACK>
<ON_CHECK message="settingsafemode" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="file_uploads" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="settingfileuploads" />
</FEEDBACK>
</PHP_SETTING>
</PHP_SETTINGS>
</MOODLE>
</COMPATIBILITY_MATRIX>
+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);
+10 -8
View File
@@ -244,6 +244,8 @@ class site_registration_form extends moodleform {
$questionsnumber = get_config('hub', 'site_questionsnumber_' . $cleanhuburl);
$resourcesnumber = get_config('hub', 'site_resourcesnumber_' . $cleanhuburl);
$mediancoursesize = get_config('hub', 'site_mediancoursesize_' . $cleanhuburl);
$participantnumberaveragecfg = get_config('hub', 'site_participantnumberaverage_' . $cleanhuburl);
$modulenumberaveragecfg = get_config('hub', 'site_modulenumberaverage_' . $cleanhuburl);
//hidden parameters
$mform->addElement('hidden', 'huburl', $huburl);
@@ -376,36 +378,36 @@ class site_registration_form extends moodleform {
if (HUB_MOODLEORGHUBURL != $huburl) {
$mform->addElement('checkbox', 'courses', get_string('sendfollowinginfo', 'hub'),
" " . get_string('coursesnumber', 'hub', $coursecount));
$mform->setDefault('courses', true);
$mform->setDefault('courses', $coursesnumber != -1);
$mform->addHelpButton('courses', 'sendfollowinginfo', 'hub');
$mform->addElement('checkbox', 'users', '',
" " . get_string('usersnumber', 'hub', $usercount));
$mform->setDefault('users', true);
$mform->setDefault('users', $usersnumber != -1);
$mform->addElement('checkbox', 'roleassignments', '',
" " . get_string('roleassignmentsnumber', 'hub', $roleassigncount));
$mform->setDefault('roleassignments', true);
$mform->setDefault('roleassignments', $roleassignmentsnumber != -1);
$mform->addElement('checkbox', 'posts', '',
" " . get_string('postsnumber', 'hub', $postcount));
$mform->setDefault('posts', true);
$mform->setDefault('posts', $postsnumber != -1);
$mform->addElement('checkbox', 'questions', '',
" " . get_string('questionsnumber', 'hub', $questioncount));
$mform->setDefault('questions', true);
$mform->setDefault('questions', $questionsnumber != -1);
$mform->addElement('checkbox', 'resources', '',
" " . get_string('resourcesnumber', 'hub', $resourcecount));
$mform->setDefault('resources', true);
$mform->setDefault('resources', $resourcesnumber != -1);
$mform->addElement('checkbox', 'participantnumberaverage', '',
" " . get_string('participantnumberaverage', 'hub', $participantnumberaverage));
$mform->setDefault('participantnumberaverage', true);
$mform->setDefault('participantnumberaverage', $participantnumberaveragecfg != -1);
$mform->addElement('checkbox', 'modulenumberaverage', '',
" " . get_string('modulenumberaverage', 'hub', $modulenumberaverage));
$mform->setDefault('modulenumberaverage', true);
$mform->setDefault('modulenumberaverage', $modulenumberaveragecfg != -1);
} else {
$mform->addElement('static', 'courseslabel', get_string('sendfollowinginfo', 'hub'),
" " . get_string('coursesnumber', 'hub', $coursecount));
+25 -1
View File
@@ -62,7 +62,18 @@ $siteregistrationform = new site_registration_form('',
$fromform = $siteregistrationform->get_data();
if (!empty($fromform) and confirm_sesskey()) {
//save the settings
// Set to -1 all optional data marked as "don't send" by the admin.
// The function get_site_info() will not calculate the optional data if config is set to -1.
$inputnames = array('courses', 'users', 'roleassignments', 'posts', 'questions', 'resources',
'modulenumberaverage', 'participantnumberaverage');
foreach ($inputnames as $inputname) {
if (empty($fromform->{$inputname})) {
$fromform->{$inputname} = -1;
}
}
// Save the settings.
$cleanhuburl = clean_param($huburl, PARAM_ALPHANUMEXT);
set_config('site_name_' . $cleanhuburl, $fromform->name, 'hub');
set_config('site_description_' . $cleanhuburl, $fromform->description, 'hub');
@@ -113,6 +124,19 @@ if ($update and confirm_sesskey()) {
if (!empty($fromform) and empty($update) and confirm_sesskey()) {
if (!empty($fromform) and confirm_sesskey()) { // if the register button has been clicked
// Retrieve the optional info (specially course number, user number, module number average...).
$siteinfo = $registrationmanager->get_site_info($huburl);
$fromform->courses = $siteinfo['courses'];
$fromform->users = $siteinfo['users'];
$fromform->enrolments = $siteinfo['enrolments'];
$fromform->posts = $siteinfo['posts'];
$fromform->questions = $siteinfo['questions'];
$fromform->resources = $siteinfo['resources'];
$fromform->modulenumberaverage = $siteinfo['modulenumberaverage'];
$fromform->participantnumberaverage = $siteinfo['participantnumberaverage'];
$fromform->street = $siteinfo['street'];
$params = (array) $fromform; //we are using the form input as the redirection parameters (token, url and name)
$unconfirmedhub = $registrationmanager->get_unconfirmedhub($huburl);
+2 -2
View File
@@ -38,7 +38,7 @@ class core_register_renderer extends plugin_renderer_base {
public function moodleorg_registration_message() {
$moodleorgurl = html_writer::link('http://moodle.org', 'Moodle.org');
$moodleorgstatsurl = html_writer::link('http://moodle.org/stats', get_string('statsmoodleorg', 'admin'));
$moochurl = html_writer::link(HUB_MOODLEORGHUBURL, 'MOOCH');
$moochurl = html_writer::link(HUB_MOODLEORGHUBURL, 'Moodle.net');
$moodleorgregmsg = get_string('registermoodleorg', 'admin', $moodleorgurl);
$items = array(get_string('registermoodleorgli1', 'admin'),
get_string('registermoodleorgli2', 'admin', $moodleorgstatsurl),
@@ -92,4 +92,4 @@ class core_register_renderer extends plugin_renderer_base {
return html_writer::table($table);
}
}
}
+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');
+1 -1
View File
@@ -32,7 +32,7 @@ $lng = required_param('lng', PARAM_LANG);
$currentpage = optional_param('p', 0, PARAM_INT);
$translatorsubmitted = optional_param('translatorsubmitted', 0, PARAM_BOOL);
$PAGE->set_pagelayout('standard');
$PAGE->set_pagelayout('report'); // Allows for wide page contents.
$PAGE->set_url('/admin/tool/customlang/edit.php', array('lng' => $lng));
navigation_node::override_active_url(new moodle_url('/admin/tool/customlang/index.php'));
$PAGE->set_title(get_string('pluginname', 'tool_customlang'));
+7 -5
View File
@@ -47,14 +47,16 @@ list($options, $unrecognized) = cli_get_params(
)
);
if (file_exists(__DIR__.'/../../../../vendor/autoload.php')) {
if (file_exists(__DIR__.'/../../../../vendor/phpunit/phpunit/PHPUnit/Autoload.php')) {
// Composer packages present.
require_once(__DIR__.'/../../../../vendor/autoload.php');
}
require_once(__DIR__.'/../../../../vendor/phpunit/phpunit/PHPUnit/Autoload.php');
// Verify PHPUnit libs can be loaded.
if (!include_once('PHPUnit/Autoload.php')) {
phpunit_bootstrap_error(PHPUNIT_EXITCODE_PHPUNITMISSING);
} else {
// Verify PHPUnit PEAR libs can be loaded.
if (!include('PHPUnit/Autoload.php')) {
phpunit_bootstrap_error(PHPUNIT_EXITCODE_PHPUNITMISSING);
}
}
if ($options['run']) {
@@ -69,7 +69,7 @@ $string['showsearch'] = 'Show the search for test files.';
$string['skip'] = 'Skip';
$string['stacktrace'] = 'Stack trace:';
$string['summary'] = '{$a->run}/{$a->total} test cases complete: <strong>{$a->passes}</strong> passes, <strong>{$a->fails}</strong> fails and <strong>{$a->exceptions}</strong> exceptions.';
$string['tablesnotsetup'] = 'Unit test tables are not yet built. Do you want to build them now?.';
$string['tablesnotsetup'] = 'Unit test tables are not yet built. Do you want to build them now?';
$string['testdboperations'] = 'Test database operations';
$string['testtablescsvfileunwritable'] = 'The test tables CSV file is not writable ({$a->filename})';
$string['testtablesneedupgrade'] = 'The test DB tables need to be upgraded. Do you wish to proceed with the upgrade now?';
@@ -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();
+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);
+3 -2
View File
@@ -32,8 +32,9 @@
//
// hack by Vangelis Haniotakis to handle the absence of $_SERVER['REQUEST_URI'] in IIS
//
if (!isset($_SERVER['REQUEST_URI'])) {
$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['QUERY_STRING'];
$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'];
if (isset($_SERVER['QUERY_STRING'])) {
$_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
}
//
+2 -2
View File
@@ -2160,7 +2160,7 @@ class CASClient
if ($this->_cas_server_cert != '' && $this->_cas_server_ca_cert != '') {
// This branch added by IDMS. Seems phpCAS implementor got a bit confused about the curl options CURLOPT_SSLCERT and CURLOPT_CAINFO
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_SSLCERT, $this->_cas_server_cert);
curl_setopt($ch, CURLOPT_CAINFO, $this->_cas_server_ca_cert);
curl_setopt($ch, CURLOPT_VERBOSE, '1');
@@ -2172,7 +2172,7 @@ class CASClient
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($ch, CURLOPT_CAINFO, $this->_cas_server_ca_cert);
} else {
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
}
+12
View File
@@ -549,6 +549,8 @@ class auth_plugin_ldap extends auth_plugin_base {
if ($user->firstaccess == 0) {
$DB->set_field('user', 'firstaccess', time(), array('id'=>$user->id));
}
$euser = $DB->get_record('user', array('id' => $user->id));
events_trigger('user_updated', $euser);
return AUTH_CONFIRM_OK;
}
} else {
@@ -710,6 +712,8 @@ class auth_plugin_ldap extends auth_plugin_base {
$updateuser->auth = 'nologin';
$DB->update_record('user', $updateuser);
echo "\t"; print_string('auth_dbsuspenduser', 'auth_db', array('name'=>$user->username, 'id'=>$user->id)); echo "\n";
$euser = $DB->get_record('user', array('id' => $user->id));
events_trigger('user_updated', $euser);
}
}
} else {
@@ -735,6 +739,8 @@ class auth_plugin_ldap extends auth_plugin_base {
$updateuser->auth = $this->authtype;
$DB->update_record('user', $updateuser);
echo "\t"; print_string('auth_dbreviveduser', 'auth_db', array('name'=>$user->username, 'id'=>$user->id)); echo "\n";
$euser = $DB->get_record('user', array('id' => $user->id));
events_trigger('user_updated', $euser);
}
} else {
print_string('nouserentriestorevive', 'auth_ldap');
@@ -848,6 +854,8 @@ class auth_plugin_ldap extends auth_plugin_base {
$id = $DB->insert_record('user', $user);
echo "\t"; print_string('auth_dbinsertuser', 'auth_db', array('name'=>$user->username, 'id'=>$id)); echo "\n";
$euser = $DB->get_record('user', array('id' => $id));
events_trigger('user_created', $euser);
if (!empty($this->config->forcechangepassword)) {
set_user_preference('auth_forcepasswordchange', 1, $id);
}
@@ -918,6 +926,10 @@ class auth_plugin_ldap extends auth_plugin_base {
}
}
}
if (!empty($updatekeys)) {
$euser = $DB->get_record('user', array('id' => $userid));
events_trigger('user_updated', $euser);
}
} else {
return false;
}
+1 -1
View File
@@ -105,7 +105,7 @@ class auth_plugin_radius extends auth_plugin_base {
}
$result = $rauth->send();
if (PEAR::isError($result)) {
if ($rauth->isError($result)) {
printf("Radius send failed: %s<br/>\n", $result->getMessage());
exit;
} else if ($result === true) {
+60 -1
View File
@@ -1040,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
*/
@@ -1191,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://') {
@@ -1736,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
*
@@ -1900,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') {
+12 -3
View File
@@ -1209,12 +1209,16 @@ class moodle1_file_manager implements loggable {
*/
public function migrate_file($sourcepath, $filepath = '/', $filename = null, $sortorder = 0, $timecreated = null, $timemodified = null) {
$sourcefullpath = $this->basepath.'/'.$sourcepath;
// Normalise Windows paths a bit.
$sourcepath = str_replace('\\', '/', $sourcepath);
if ($sourcefullpath !== clean_param($sourcefullpath, PARAM_PATH)) {
throw new moodle1_convert_exception('file_invalid_path', $sourcefullpath);
// PARAM_PATH must not be used on full OS path!
if ($sourcepath !== clean_param($sourcepath, PARAM_PATH)) {
throw new moodle1_convert_exception('file_invalid_path', $sourcepath);
}
$sourcefullpath = $this->basepath.'/'.$sourcepath;
if (!is_readable($sourcefullpath)) {
throw new moodle1_convert_exception('file_not_readable', $sourcefullpath);
}
@@ -1274,6 +1278,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();
}
+64 -7
View File
@@ -266,13 +266,6 @@ 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;
@@ -314,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());
+4 -2
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));
@@ -160,4 +162,4 @@ echo $renderer->progress_bar($backup->get_progress_bar());
echo $backup->display($renderer);
$backup->destroy();
unset($backup);
echo $OUTPUT->footer();
echo $OUTPUT->footer();
+13
View File
@@ -1764,6 +1764,10 @@ class backup_questions_structure_step extends backup_structure_step {
$qhint = new backup_nested_element('question_hint', array('id'), array(
'hint', 'hintformat', 'shownumcorrect', 'clearwrong', 'options'));
$tags = new backup_nested_element('tags');
$tag = new backup_nested_element('tag', array('id'), array('name', 'rawname'));
// Build the tree
$qcategories->add_child($qcategory);
@@ -1772,6 +1776,9 @@ class backup_questions_structure_step extends backup_structure_step {
$question->add_child($qhints);
$qhints->add_child($qhint);
$question->add_child($tags);
$tags->add_child($tag);
// Define the sources
$qcategory->set_source_sql("
@@ -1791,6 +1798,12 @@ class backup_questions_structure_step extends backup_structure_step {
ORDER BY id',
array('questionid' => backup::VAR_PARENTID));
$tag->set_source_sql("SELECT t.id, t.name, t.rawname
FROM {tag} t
JOIN {tag_instance} ti ON ti.tagid = t.id
WHERE ti.itemid = ?
AND ti.itemtype = 'question'", array(backup::VAR_PARENTID));
// don't need to annotate ids nor files
// (already done by {@link backup_annotate_all_question_files}
@@ -74,6 +74,8 @@ class restore_course_task extends restore_task {
// Restore course role assignments and overrides (internally will observe the role_assignments setting)
$this->add_step(new restore_ras_and_caps_structure_step('course_ras_and_caps', 'roles.xml'));
$this->add_step(new restore_course_legacy_files_step('legacy_files'));
// Restore course enrolments (plugins and membership). Conditionally prevented for any IMPORT/HUB operation
if ($this->plan->get_mode() != backup::MODE_IMPORT && $this->plan->get_mode() != backup::MODE_HUB) {
$this->add_step(new restore_enrolments_structure_step('course_enrolments', 'enrolments.xml'));
@@ -143,6 +143,9 @@ class restore_final_task extends restore_task {
$rules[] = new restore_log_rule('course', 'report stats', 'report/stats/index.php?id={course}', '{course}');
$rules[] = new restore_log_rule('course', 'view section', 'view.php?id={course}&sectionid={course_section}', '{course_section}');
// module 'grade' rules
$rules[] = new restore_log_rule('grade', 'update', 'report/grader/index.php?id={course}', null);
// module 'user' rules
$rules[] = new restore_log_rule('user', 'view', 'view.php?id={user}&course={course}', '{user}');
$rules[] = new restore_log_rule('user', 'change password', 'view.php?id={user}&course={course}', '{user}');
+66 -16
View File
@@ -150,6 +150,11 @@ class restore_gradebook_structure_step extends restore_structure_step {
if ($data->itemtype=='manual') {
// manual grade items store category id in categoryid
$data->categoryid = $this->get_mappingid('grade_category', $data->categoryid, NULL);
// if mapping failed put in course's grade category
if (NULL == $data->categoryid) {
$coursecat = grade_category::fetch_course_category($this->get_courseid());
$data->categoryid = $coursecat->id;
}
} else if ($data->itemtype=='course') {
// course grade item stores their category id in iteminstance
$coursecat = grade_category::fetch_course_category($this->get_courseid());
@@ -843,20 +848,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() {
@@ -1174,7 +1171,7 @@ class restore_section_structure_step extends restore_structure_step {
// Otherwise, when you restore to an existing course, it will mess up
// existing section availability entries.
if (!$this->get_mappingid('course_sections_availability', $data->id, false)) {
return;
continue;
}
// Update source cmid / grade id to new value.
@@ -1187,7 +1184,12 @@ class restore_section_structure_step extends restore_structure_step {
$data->gradeitemid = null;
}
$DB->update_record('course_sections_availability', $data);
// Delete the record if the condition wasn't found, otherwise update it.
if ($data->sourcecmid === null && $data->gradeitemid === null) {
$DB->delete_records('course_sections_availability', array('id' => $data->id));
} else {
$DB->update_record('course_sections_availability', $data);
}
}
}
}
@@ -1348,7 +1350,6 @@ class restore_course_structure_step extends restore_structure_step {
// Add course related files, without itemid to match
$this->add_related_files('course', 'summary', null);
$this->add_related_files('course', 'legacy', null);
// Deal with legacy allowed modules.
if ($this->legacyrestrictmodules) {
@@ -1375,6 +1376,29 @@ class restore_course_structure_step extends restore_structure_step {
}
}
/**
* Execution step that will migrate legacy files if present.
*/
class restore_course_legacy_files_step extends restore_execution_step {
public function define_execution() {
global $DB;
// Do a check for legacy files and skip if there are none.
$sql = 'SELECT count(*)
FROM {backup_files_temp}
WHERE backupid = ?
AND contextid = ?
AND component = ?
AND filearea = ?';
$params = array($this->get_restoreid(), $this->task->get_old_contextid(), 'course', 'legacy');
if ($DB->count_records_sql($sql, $params)) {
$DB->set_field('course', 'legacyfiles', 2, array('id' => $this->get_courseid()));
restore_dbops::send_files_to_pool($this->get_basepath(), $this->get_restoreid(), 'course',
'legacy', $this->task->get_old_contextid(), $this->task->get_userid());
}
}
}
/*
* Structure step that will read the roles.xml file (at course/activity/block levels)
@@ -2851,10 +2875,13 @@ class restore_create_categories_and_questions extends restore_structure_step {
$hint = new restore_path_element('question_hint',
'/question_categories/question_category/questions/question/question_hints/question_hint');
$tag = new restore_path_element('tag',
'/question_categories/question_category/questions/question/tags/tag');
// Apply for 'qtype' plugins optional paths at question level
$this->add_plugin_structure('qtype', $question);
return array($category, $question, $hint);
return array($category, $question, $hint, $tag);
}
protected function process_question_category($data) {
@@ -3001,6 +3028,29 @@ class restore_create_categories_and_questions extends restore_structure_step {
$this->set_mapping('question_hint', $oldid, $newitemid);
}
protected function process_tag($data) {
global $CFG, $DB;
$data = (object)$data;
$newquestion = $this->get_new_parentid('question');
if (!empty($CFG->usetags)) { // if enabled in server
// TODO: This is highly inneficient. Each time we add one tag
// we fetch all the existing because tag_set() deletes them
// so everything must be reinserted on each call
$tags = array();
$existingtags = tag_get_tags('question', $newquestion);
// Re-add all the existitng tags
foreach ($existingtags as $existingtag) {
$tags[] = $existingtag->rawname;
}
// Add the one being restored
$tags[] = $data->rawname;
// Send all the tags back to the question
tag_set('question', $newquestion, $tags);
}
}
protected function after_execute() {
global $DB;
+25 -8
View File
@@ -822,7 +822,7 @@ abstract class restore_dbops {
* @return array of result object
*/
public static function send_files_to_pool($basepath, $restoreid, $component, $filearea, $oldcontextid, $dfltuserid, $itemname = null, $olditemid = null, $forcenewcontextid = null, $skipparentitemidctxmatch = false) {
global $DB;
global $DB, $CFG;
$results = array();
@@ -917,6 +917,12 @@ abstract class restore_dbops {
// create the file in the filepool if it does not exist yet
if (!$fs->file_exists($newcontextid, $component, $filearea, $rec->newitemid, $file->filepath, $file->filename)) {
// If no license found, use default.
if ($file->license == null){
$file->license = $CFG->sitedefaultlicense;
}
$file_record = array(
'contextid' => $newcontextid,
'component' => $component,
@@ -1148,14 +1154,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 +1195,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 +1227,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 +1245,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
@@ -26,101 +26,6 @@ defined('MOODLE_INTERNAL') || die();
// Include all the needed stuff
global $CFG;
require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php');
require_once($CFG->dirroot . '/backup/util/includes/restore_includes.php');
/**
* Restore dbops tests (all).
*/
class restore_dbops_testcase extends advanced_testcase {
/**
* Verify the xxx_ids_cached (in-memory backup_ids cache) stuff works as expected.
*
* Note that those private implementations are tested here by using the public
* backup_ids API and later performing low-level tests.
*/
public function test_backup_ids_cached() {
global $DB;
$dbman = $DB->get_manager(); // We are going to use database_manager services.
$this->resetAfterTest(true); // Playing with temp tables, better reset once finished.
// Some variables and objects for testing.
$restoreid = 'testrestoreid';
$mapping = new stdClass();
$mapping->itemname = 'user';
$mapping->itemid = 1;
$mapping->newitemid = 2;
$mapping->parentitemid = 3;
$mapping->info = 'info';
// Create the backup_ids temp tables used by restore.
restore_controller_dbops::create_restore_temp_tables($restoreid);
// Send one mapping using the public api with defaults.
restore_dbops::set_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid);
// Get that mapping and verify everything is returned as expected.
$result = restore_dbops::get_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid);
$this->assertSame($mapping->itemname, $result->itemname);
$this->assertSame($mapping->itemid, $result->itemid);
$this->assertSame(0, $result->newitemid);
$this->assertSame(null, $result->parentitemid);
$this->assertSame(null, $result->info);
// Drop the backup_xxx_temp temptables manually, so memory cache won't be invalidated.
$dbman->drop_table(new xmldb_table('backup_ids_temp'));
$dbman->drop_table(new xmldb_table('backup_files_temp'));
// Verify the mapping continues returning the same info,
// now from cache (the table does not exist).
$result = restore_dbops::get_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid);
$this->assertSame($mapping->itemname, $result->itemname);
$this->assertSame($mapping->itemid, $result->itemid);
$this->assertSame(0, $result->newitemid);
$this->assertSame(null, $result->parentitemid);
$this->assertSame(null, $result->info);
// Recreate the temp table, just to drop it using the restore API in
// order to check that, then, the cache becomes invalid for the same request.
restore_controller_dbops::create_restore_temp_tables($restoreid);
restore_controller_dbops::drop_restore_temp_tables($restoreid);
// No cached info anymore, so the mapping request will arrive to
// DB leading to error (temp table does not exist).
try {
$result = restore_dbops::get_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid);
$this->fail('Expecting an exception, none occurred');
} catch (Exception $e) {
$this->assertTrue($e instanceof dml_exception);
$this->assertSame('Table "backup_ids_temp" does not exist', $e->getMessage());
}
// Create the backup_ids temp tables once more.
restore_controller_dbops::create_restore_temp_tables($restoreid);
// Send one mapping using the public api with complete values.
restore_dbops::set_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid,
$mapping->newitemid, $mapping->parentitemid, $mapping->info);
// Get that mapping and verify everything is returned as expected.
$result = restore_dbops::get_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid);
$this->assertSame($mapping->itemname, $result->itemname);
$this->assertSame($mapping->itemid, $result->itemid);
$this->assertSame($mapping->newitemid, $result->newitemid);
$this->assertSame($mapping->parentitemid, $result->parentitemid);
$this->assertSame($mapping->info, $result->info);
// Finally, drop the temp tables properly and get the DB error again (memory caches empty).
restore_controller_dbops::drop_restore_temp_tables($restoreid);
try {
$result = restore_dbops::get_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid);
$this->fail('Expecting an exception, none occurred');
} catch (Exception $e) {
$this->assertTrue($e instanceof dml_exception);
$this->assertSame('Table "backup_ids_temp" does not exist', $e->getMessage());
}
}
}
/**
* Backup dbops tests (all).
@@ -0,0 +1,122 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package core_backup
* @category phpunit
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
// Include all the needed stuff
global $CFG;
require_once($CFG->dirroot . '/backup/util/includes/restore_includes.php');
/**
* Restore dbops tests (all).
*/
class restore_dbops_testcase extends advanced_testcase {
/**
* Verify the xxx_ids_cached (in-memory backup_ids cache) stuff works as expected.
*
* Note that those private implementations are tested here by using the public
* backup_ids API and later performing low-level tests.
*/
public function test_backup_ids_cached() {
global $DB;
$dbman = $DB->get_manager(); // We are going to use database_manager services.
$this->resetAfterTest(true); // Playing with temp tables, better reset once finished.
// Some variables and objects for testing.
$restoreid = 'testrestoreid';
$mapping = new stdClass();
$mapping->itemname = 'user';
$mapping->itemid = 1;
$mapping->newitemid = 2;
$mapping->parentitemid = 3;
$mapping->info = 'info';
// Create the backup_ids temp tables used by restore.
restore_controller_dbops::create_restore_temp_tables($restoreid);
// Send one mapping using the public api with defaults.
restore_dbops::set_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid);
// Get that mapping and verify everything is returned as expected.
$result = restore_dbops::get_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid);
$this->assertSame($mapping->itemname, $result->itemname);
$this->assertSame($mapping->itemid, $result->itemid);
$this->assertSame(0, $result->newitemid);
$this->assertSame(null, $result->parentitemid);
$this->assertSame(null, $result->info);
// Drop the backup_xxx_temp temptables manually, so memory cache won't be invalidated.
$dbman->drop_table(new xmldb_table('backup_ids_temp'));
$dbman->drop_table(new xmldb_table('backup_files_temp'));
// Verify the mapping continues returning the same info,
// now from cache (the table does not exist).
$result = restore_dbops::get_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid);
$this->assertSame($mapping->itemname, $result->itemname);
$this->assertSame($mapping->itemid, $result->itemid);
$this->assertSame(0, $result->newitemid);
$this->assertSame(null, $result->parentitemid);
$this->assertSame(null, $result->info);
// Recreate the temp table, just to drop it using the restore API in
// order to check that, then, the cache becomes invalid for the same request.
restore_controller_dbops::create_restore_temp_tables($restoreid);
restore_controller_dbops::drop_restore_temp_tables($restoreid);
// No cached info anymore, so the mapping request will arrive to
// DB leading to error (temp table does not exist).
try {
$result = restore_dbops::get_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid);
$this->fail('Expecting an exception, none occurred');
} catch (Exception $e) {
$this->assertTrue($e instanceof dml_exception);
$this->assertSame('Table "backup_ids_temp" does not exist', $e->getMessage());
}
// Create the backup_ids temp tables once more.
restore_controller_dbops::create_restore_temp_tables($restoreid);
// Send one mapping using the public api with complete values.
restore_dbops::set_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid,
$mapping->newitemid, $mapping->parentitemid, $mapping->info);
// Get that mapping and verify everything is returned as expected.
$result = restore_dbops::get_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid);
$this->assertSame($mapping->itemname, $result->itemname);
$this->assertSame($mapping->itemid, $result->itemid);
$this->assertSame($mapping->newitemid, $result->newitemid);
$this->assertSame($mapping->parentitemid, $result->parentitemid);
$this->assertSame($mapping->info, $result->info);
// Finally, drop the temp tables properly and get the DB error again (memory caches empty).
restore_controller_dbops::drop_restore_temp_tables($restoreid);
try {
$result = restore_dbops::get_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid);
$this->fail('Expecting an exception, none occurred');
} catch (Exception $e) {
$this->assertTrue($e instanceof dml_exception);
$this->assertSame('Table "backup_ids_temp" does not exist', $e->getMessage());
}
}
}
@@ -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');
+24 -1
View File
@@ -521,6 +521,15 @@ class core_backup_renderer extends plugin_renderer_base {
$url = $component->get_url();
$output = html_writer::start_tag('div', array('class' => 'restore-course-search'));
$countstr = '';
if ($component->has_more_results()) {
$countstr = get_string('morecoursesearchresults', 'backup', $component->get_count());
} else {
$countstr = get_string('totalcoursesearchresults', 'backup', $component->get_count());
}
$output .= html_writer::tag('div', $countstr, array('class'=>'rcs-totalresults'));
$output .= html_writer::start_tag('div', array('class' => 'rcs-results'));
$table = new html_table();
@@ -590,8 +599,14 @@ class core_backup_renderer extends plugin_renderer_base {
return $output;
}
$output .= html_writer::tag('div', get_string('totalcoursesearchresults', 'backup', $component->get_count()), array('class'=>'ics-totalresults'));
$countstr = '';
if ($component->has_more_results()) {
$countstr = get_string('morecoursesearchresults', 'backup', $component->get_count());
} else {
$countstr = get_string('totalcoursesearchresults', 'backup', $component->get_count());
}
$output .= html_writer::tag('div', $countstr, array('class'=>'ics-totalresults'));
$output .= html_writer::start_tag('div', array('class' => 'ics-results'));
$table = new html_table();
@@ -610,6 +625,14 @@ class core_backup_renderer extends plugin_renderer_base {
);
$table->data[] = $row;
}
if ($component->has_more_results()) {
$cell = new html_table_cell(get_string('moreresults', 'backup'));
$cell->colspan = 3;
$cell->attributes['class'] = 'notifyproblem';
$row = new html_table_row(array($cell));
$row->attributes['class'] = 'rcs-course';
$table->data[] = $row;
}
$output .= html_writer::table($table);
$output .= html_writer::end_tag('div');
+16 -5
View File
@@ -65,6 +65,11 @@ abstract class restore_search_base implements renderable {
* @var array
*/
private $requiredcapabilities = array();
/**
* Indicates if we have more than maxresults found.
* @var boolean
*/
private $hasmoreresults = false;
/**
* Constructor
@@ -177,7 +182,7 @@ abstract class restore_search_base implements renderable {
foreach ($this->requiredcapabilities as $cap) {
$requiredcaps[] = $cap['capability'];
}
// Iterate while we have records and haven't reached MAXRESULTS
// Iterate while we have records and haven't reached $this->maxresults.
while ($totalcourses > $offs and $this->totalcount < self::$MAXRESULTS) {
$resultset = $DB->get_records_sql($sql, $params, $offs, $blocksz);
foreach ($resultset as $result) {
@@ -188,11 +193,14 @@ abstract class restore_search_base implements renderable {
continue;
}
}
$this->results[$result->id] = $result;
$this->totalcount++;
if ($this->totalcount >= self::$MAXRESULTS) {
// Check if we are over the limit.
if ($this->totalcount+1 > self::$MAXRESULTS) {
$this->hasmoreresults = true;
break;
}
// If not, then continue.
$this->totalcount++;
$this->results[$result->id] = $result;
}
$offs += $blocksz;
}
@@ -201,7 +209,10 @@ abstract class restore_search_base implements renderable {
}
final public function has_more_results() {
return $this->get_count() >= self::$MAXRESULTS;
if ($this->results === null) {
$this->search();
}
return $this->hasmoreresults;
}
/**
@@ -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
@@ -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)) {
+2 -2
View File
@@ -216,9 +216,9 @@ if (empty($completions)) {
echo '(<i>';
if ($agg == COMPLETION_AGGREGATION_ALL) {
echo strtolower(get_string('aggregateall', 'completion'));
echo strtolower(get_string('all', 'completion'));
} else {
echo strtolower(get_string('aggregateany', 'completion'));
echo strtolower(get_string('any', 'completion'));
}
echo '</i> '.strtolower(get_string('required')).')';
@@ -24,4 +24,4 @@
*/
$string['coursesummary'] = 'Course summary';
$string['pluginname'] = 'Course/Site description';
$string['pluginname'] = 'Course/site summary';
@@ -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 -46
View File
@@ -1,46 +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();
}
}
<?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();
}
}
+1 -1
View File
@@ -329,7 +329,7 @@ class block_base {
/**
* Subclasses should override this and return true if the
* subclass block has a config_global.html file.
* subclass block has a settings.php file.
*
* @return boolean
*/
+5 -1
View File
@@ -340,11 +340,15 @@ BRANCH.prototype = {
},
/**
* Attaches required events to the branch structure.
*
* @chainable
* @method wire
* @return {BRANCH} This function is chainable, it always returns itself.
*/
wire : function() {
this.node = this.node || Y.one('#'+this.get('id'));
if (!this.node) {
return false;
return this;
}
if (this.get('expandable')) {
this.event_ajaxload = this.node.on('ajaxload|click', this.ajaxLoad, this);
+34 -34
View File
@@ -1,34 +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;
}
}
<?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;
}
}
+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();
+6 -6
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();
@@ -85,15 +84,16 @@ if (!empty($rssrecord->preferredtitle)) {
$feedtitle = $rss->get_title();
}
echo '<table align="center" width="50%" cellspacing="1">'."\n";
echo '<tr><td colspan="2"><strong>'. $feedtitle .'</strong></td></tr>'."\n";
echo '<tr><td colspan="2"><strong>'. s($feedtitle) .'</strong></td></tr>'."\n";
foreach ($rss->get_items() as $item) {
echo '<tr><td valign="middle">'."\n";
echo '<a href="'. $item->get_link() .'" target="_blank"><strong>'. $item->get_title();
echo '<a href="'.$item->get_link().'" target="_blank"><strong>';
echo s($item->get_title());
echo '</strong></a>'."\n";
echo '</td>'."\n";
echo '</tr>'."\n";
echo '<tr><td colspan="2"><small>';
echo $item->get_description() .'</small></td></tr>'."\n";
echo format_text($item->get_description(), FORMAT_HTML) .'</small></td></tr>'."\n";
}
echo '</table>'."\n";
@@ -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;
}
+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 -7
View File
@@ -183,13 +183,7 @@ if (!empty($userid)) {
print_error('donothaveblog', 'blog');
}
} else {
$personalcontext = get_context_instance(CONTEXT_USER, $userid);
if (!has_capability('moodle/blog:view', $sitecontext) && !has_capability('moodle/user:readuserblogs', $personalcontext)) {
print_error('cannotviewuserblog', 'blog');
}
if (!blog_user_can_view_user_entry($userid)) {
if (!has_capability('moodle/blog:view', $sitecontext) || !blog_user_can_view_user_entry($userid)) {
print_error('cannotviewcourseblog', 'blog');
}
+39 -16
View File
@@ -65,35 +65,36 @@ function blog_user_can_view_user_entry($targetuserid, $blogentry=null) {
global $CFG, $USER, $DB;
if (empty($CFG->bloglevel)) {
return false; // blog system disabled
return false; // Blog system disabled.
}
if (isloggedin() && $USER->id == $targetuserid) {
return true; // can view own entries in any case
return true; // Can view own entries in any case.
}
$sitecontext = get_context_instance(CONTEXT_SYSTEM);
if (has_capability('moodle/blog:manageentries', $sitecontext)) {
return true; // can manage all entries
return true; // Can manage all entries.
}
// coming for 1 entry, make sure it's not a draft
// If blog is in draft state, then make sure user have proper capability.
if ($blogentry && $blogentry->publishstate == 'draft' && !has_capability('moodle/blog:viewdrafts', $sitecontext)) {
return false; // can not view draft of others
return false; // Can not view draft of others.
}
// coming for 0 entry, make sure user is logged in, if not a public blog
// If blog entry is not public, make sure user is logged in.
if ($blogentry && $blogentry->publishstate != 'public' && !isloggedin()) {
return false;
}
// If blogentry is not passed or all above checks pass, then check capability based on system config.
switch ($CFG->bloglevel) {
case BLOG_GLOBAL_LEVEL:
return true;
break;
case BLOG_SITE_LEVEL:
if (isloggedin()) { // not logged in viewers forbidden
if (isloggedin()) { // Not logged in viewers forbidden.
return true;
}
return false;
@@ -101,6 +102,7 @@ function blog_user_can_view_user_entry($targetuserid, $blogentry=null) {
case BLOG_USER_LEVEL:
default:
// If user is viewing other user blog, then user should have user:readuserblogs capability.
$personalcontext = get_context_instance(CONTEXT_USER, $targetuserid);
return has_capability('moodle/user:readuserblogs', $personalcontext);
break;
@@ -602,7 +604,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));
@@ -1001,6 +1003,8 @@ function blog_get_associated_count($courseid, $cmid=null) {
* may have switch to turn on/off comments option, this callback will
* affect UI display, not like pluginname_comment_validate only throw
* exceptions.
* blog_comment_validate will be called before viewing/adding/deleting
* comment, so don't repeat checks.
* Capability check has been done in comment->check_permissions(), we
* don't need to do it again here.
*
@@ -1017,7 +1021,17 @@ function blog_get_associated_count($courseid, $cmid=null) {
* @return array
*/
function blog_comment_permissions($comment_param) {
return array('post'=>true, 'view'=>true);
global $DB;
// If blog is public and current usre is guest, then don't let him post comments.
$blogentry = $DB->get_record('post', array('id' => $comment_param->itemid), 'publishstate', MUST_EXIST);
if ($blogentry->publishstate != 'public') {
if (!isloggedin() || isguestuser()) {
return array('post' => false, 'view' => true);
}
}
return array('post' => true, 'view' => true);
}
/**
@@ -1036,16 +1050,21 @@ function blog_comment_permissions($comment_param) {
* @return boolean
*/
function blog_comment_validate($comment_param) {
global $DB;
// validate comment itemid
if (!$entry = $DB->get_record('post', array('id'=>$comment_param->itemid))) {
throw new comment_exception('invalidcommentitemid');
global $CFG, $DB, $USER;
// Check if blogs are enabled user can comment.
if (empty($CFG->bloglevel) || empty($CFG->blogusecomments)) {
throw new comment_exception('nopermissiontocomment');
}
// validate comment area
// Validate comment area.
if ($comment_param->commentarea != 'format_blog') {
throw new comment_exception('invalidcommentarea');
}
// validation for comment deletion
$blogentry = $DB->get_record('post', array('id' => $comment_param->itemid), '*', MUST_EXIST);
// Validation for comment deletion.
if (!empty($comment_param->commentid)) {
if ($record = $DB->get_record('comments', array('id'=>$comment_param->commentid))) {
if ($record->commentarea != 'format_blog') {
@@ -1061,7 +1080,11 @@ function blog_comment_validate($comment_param) {
throw new comment_exception('invalidcommentid');
}
}
return true;
// Validate if user has blog view permission.
$sitecontext = context_system::instance();
return has_capability('moodle/blog:view', $sitecontext) &&
blog_user_can_view_user_entry($blogentry->userid, $blogentry);
}
/**
+7 -4
View File
@@ -214,11 +214,14 @@ class blog_entry {
$contentcell->text .= $template['body'];
$contentcell->text .= $attachedimages;
// Uniquehash is used as a link to an external blog
if (!empty($this->uniquehash)) {
$contentcell->text .= $OUTPUT->container_start('externalblog');
$contentcell->text .= html_writer::link($this->uniquehash, get_string('linktooriginalentry', 'blog'));
$contentcell->text .= $OUTPUT->container_end();
// Uniquehash is used as a link to an external blog
$url = clean_param($this->uniquehash, PARAM_URL);
if (!empty($url)) {
$contentcell->text .= $OUTPUT->container_start('externalblog');
$contentcell->text .= html_writer::link($url, get_string('linktooriginalentry', 'blog'));
$contentcell->text .= $OUTPUT->container_end();
}
}
// Links to tags
+6 -5
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'])) {
+2 -1
View File
@@ -77,6 +77,7 @@ $search .= html_writer::start_tag('div');
$search .= html_writer::label(get_string('searchcohort', 'cohort').':', 'cohort_search_q');
$search .= html_writer::empty_tag('input', array('id'=>'cohort_search_q', 'type'=>'text', 'name'=>'search', 'value'=>$searchquery));
$search .= html_writer::empty_tag('input', array('type'=>'submit', 'value'=>get_string('search', 'cohort')));
$search .= html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'contextid', 'value'=>$contextid));
$search .= html_writer::end_tag('div');
$search .= html_writer::end_tag('form');
echo $search;
@@ -137,4 +138,4 @@ if ($manager) {
echo $OUTPUT->single_button(new moodle_url('/cohort/edit.php', array('contextid'=>$context->id)), get_string('add'));
}
echo $OUTPUT->footer();
echo $OUTPUT->footer();
+2 -4
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)
};
@@ -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
@@ -520,7 +520,7 @@ class comment {
$c->format = $u->cformat;
$c->timecreated = $u->ctimecreated;
$url = new moodle_url('/user/view.php', array('id'=>$u->id, 'course'=>$this->courseid));
$c->profileurl = $url->out(false);
$c->profileurl = $url->out(true);
$c->fullname = fullname($u);
$c->time = userdate($c->timecreated, get_string('strftimerecent', 'langconfig'));
$c->content = format_text($c->content, $c->format, $formatoptions);
+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
View File
@@ -61,6 +61,12 @@ $context = $PAGE->context;
// And the object has been loaded for us no need for another DB call
$category = $PAGE->category;
// This needs to match caps checked in can_edit_in_category below.
$PAGE->set_other_editing_capability(array(
'moodle/category:manage',
'moodle/course:create'
));
$canedit = can_edit_in_category($category->id);
if ($canedit) {
if ($categoryedit !== -1) {
@@ -144,6 +150,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 +179,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);
}
}
+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 + ')';
+10 -3
View File
@@ -51,7 +51,7 @@ function dndupload_add_to_course($course, $modnames) {
// Add the javascript to the page.
$jsmodule = array(
'name' => 'coursedndupload',
'fullpath' => new moodle_url('/course/dndupload.js'),
'fullpath' => '/course/dndupload.js',
'strings' => array(
array('addfilehere', 'moodle'),
array('dndworkingfiletextlink', 'moodle'),
@@ -620,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);
@@ -636,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;
@@ -675,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)) {
+2 -10
View File
@@ -130,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)));
}
+11 -2
View File
@@ -130,6 +130,15 @@ class course_edit_form extends moodleform {
if (!isset($max) || !is_numeric($max)) {
$max = 52;
}
// Increase the number of sections combo box values if the user has increased the number of sections
// using the icon on the course page beyond course 'maxsections' or course 'maxsections' has been
// reduced below the number of sections already set for the course on the site administration course
// defaults page. This is so that the number of sections is not reduced leaving unintended orphaned
// activities / resources.
if (isset($course->numsections) && $course->numsections > $max) {
$max = $course->numsections;
}
for ($i = 0; $i <= $max; $i++) {
$sectionmenu[$i] = "$i";
}
@@ -201,7 +210,7 @@ class course_edit_form extends moodleform {
enrol_course_edit_form($mform, $course, $context);
//--------------------------------------------------------------------------------
$mform->addElement('header','', get_string('groups', 'group'));
$mform->addElement('header', '', get_string('groupsettingsheader', 'group'));
$choices = array();
$choices[NOGROUPS] = get_string('groupsnone', 'group');
@@ -257,7 +266,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;
}
}
+60 -58
View File
@@ -108,6 +108,7 @@ class core_course_external extends external_api {
$sections = get_all_sections($course->id);
//for each sections (first displayed to last displayed)
$modinfosections = $modinfo->get_sections();
foreach ($sections as $key => $section) {
$showsection = (has_capability('moodle/course:viewhiddensections', $context) or $section->visible or !$course->hiddensections);
@@ -126,62 +127,64 @@ class core_course_external extends external_api {
$sectioncontents = array();
//for each module of the section
foreach ($modinfo->sections[$section->section] as $cmid) { //matching /course/lib.php:print_section() logic
$cm = $modinfo->cms[$cmid];
if (!empty($modinfosections[$section->section])) {
foreach ($modinfosections[$section->section] as $cmid) {
$cm = $modinfo->cms[$cmid];
// stop here if the module is not visible to the user
if (!$cm->uservisible) {
continue;
}
$module = array();
//common info (for people being able to see the module or availability dates)
$module['id'] = $cm->id;
$module['name'] = format_string($cm->name, true);
$module['modname'] = $cm->modname;
$module['modplural'] = $cm->modplural;
$module['modicon'] = $cm->get_icon_url()->out(false);
$module['indent'] = $cm->indent;
$modcontext = get_context_instance(CONTEXT_MODULE, $cm->id);
if (!empty($cm->showdescription)) {
$module['description'] = $cm->get_content();
}
//url of the module
$url = $cm->get_url();
if ($url) { //labels don't have url
$module['url'] = $cm->get_url()->out();
}
$canviewhidden = has_capability('moodle/course:viewhiddenactivities',
get_context_instance(CONTEXT_MODULE, $cm->id));
//user that can view hidden module should know about the visibility
$module['visible'] = $cm->visible;
//availability date (also send to user who can see hidden module when the showavailabilyt is ON)
if ($canupdatecourse or ($CFG->enableavailability && $canviewhidden && $cm->showavailability)) {
$module['availablefrom'] = $cm->availablefrom;
$module['availableuntil'] = $cm->availableuntil;
}
$baseurl = 'webservice/pluginfile.php';
//call $modulename_export_contents
//(each module callback take care about checking the capabilities)
require_once($CFG->dirroot . '/mod/' . $cm->modname . '/lib.php');
$getcontentfunction = $cm->modname.'_export_contents';
if (function_exists($getcontentfunction)) {
if ($contents = $getcontentfunction($cm, $baseurl)) {
$module['contents'] = $contents;
// stop here if the module is not visible to the user
if (!$cm->uservisible) {
continue;
}
$module = array();
//common info (for people being able to see the module or availability dates)
$module['id'] = $cm->id;
$module['name'] = format_string($cm->name, true);
$module['modname'] = $cm->modname;
$module['modplural'] = $cm->modplural;
$module['modicon'] = $cm->get_icon_url()->out(false);
$module['indent'] = $cm->indent;
$modcontext = context_module::instance($cm->id);
if (!empty($cm->showdescription)) {
$module['description'] = $cm->get_content();
}
//url of the module
$url = $cm->get_url();
if ($url) { //labels don't have url
$module['url'] = $cm->get_url()->out();
}
$canviewhidden = has_capability('moodle/course:viewhiddenactivities',
context_module::instance($cm->id));
//user that can view hidden module should know about the visibility
$module['visible'] = $cm->visible;
//availability date (also send to user who can see hidden module when the showavailabilyt is ON)
if ($canupdatecourse or ($CFG->enableavailability && $canviewhidden && $cm->showavailability)) {
$module['availablefrom'] = $cm->availablefrom;
$module['availableuntil'] = $cm->availableuntil;
}
$baseurl = 'webservice/pluginfile.php';
//call $modulename_export_contents
//(each module callback take care about checking the capabilities)
require_once($CFG->dirroot . '/mod/' . $cm->modname . '/lib.php');
$getcontentfunction = $cm->modname.'_export_contents';
if (function_exists($getcontentfunction)) {
if ($contents = $getcontentfunction($cm, $baseurl)) {
$module['contents'] = $contents;
}
}
//assign result to $sectioncontents
$sectioncontents[] = $module;
}
//assign result to $sectioncontents
$sectioncontents[] = $module;
}
$sectionvalues['modules'] = $sectioncontents;
@@ -675,9 +678,9 @@ class core_course_external extends external_api {
"users" (int) Include users (default to 0 that is equal to no),
"role_assignments" (int) Include role assignments (default to 0 that is equal to no),
"comments" (int) Include user comments (default to 0 that is equal to no),
"completion_information" (int) Include user course completion information (default to 0 that is equal to no),
"userscompletion" (int) Include user course completion information (default to 0 that is equal to no),
"logs" (int) Include course logs (default to 0 that is equal to no),
"histories" (int) Include histories (default to 0 that is equal to no)'
"grade_histories" (int) Include histories (default to 0 that is equal to no)'
),
'value' => new external_value(PARAM_RAW, 'the value for the option 1 (yes) or 0 (no)'
)
@@ -739,9 +742,9 @@ class core_course_external extends external_api {
'users' => 0,
'role_assignments' => 0,
'comments' => 0,
'completion_information' => 0,
'userscompletion' => 0,
'logs' => 0,
'histories' => 0
'grade_histories' => 0
);
$backupsettings = array();
@@ -1254,7 +1257,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'];
+39 -15
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');
@@ -321,7 +324,7 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
* @param array $mods course modules indexed by id (from get_all_mods)
* @return string HTML to output.
*/
private function section_activity_summary($section, $course, $mods) {
protected function section_activity_summary($section, $course, $mods) {
if (empty($section->sequence)) {
return '';
}
@@ -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.
}
}
}
+30 -2
View File
@@ -40,8 +40,16 @@ 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));
if (sectionlist.item(node1).hasClass('current')) {
sectionlist.item(node1).removeClass('current');
sectionlist.item(node2).addClass('current');
} else if (sectionlist.item(node2).hasClass('current')) {
sectionlist.item(node2).removeClass('current');
sectionlist.item(node1).addClass('current');
}
}
/**
@@ -56,12 +64,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.
}
}
}
+13 -8
View File
@@ -44,6 +44,12 @@ $PAGE->set_url('/course/index.php');
$PAGE->set_context($systemcontext);
$PAGE->set_pagelayout('admin');
// This needs to match caps checked in can_edit_in_category below.
$PAGE->set_other_editing_capability(array(
'moodle/category:manage',
'moodle/course:create'
));
if (can_edit_in_category()) {
if ($categoryedit !== -1) {
$USER->editing = $categoryedit;
@@ -67,12 +73,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 +101,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 +236,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
+82 -32
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, '.');
@@ -93,6 +94,9 @@ function make_log_url($module, $url) {
case 'role':
$url = '/'.$url;
break;
case 'grade':
$url = "/grade/$url";
break;
default:
$url = "/mod/$module/$url";
break;
@@ -856,7 +860,9 @@ function print_overview($courses, array $remote_courses=array()) {
foreach ($courses as $course) {
$fullname = format_string($course->fullname, true, array('context' => get_context_instance(CONTEXT_COURSE, $course->id)));
echo $OUTPUT->box_start('coursebox');
$attributes = array('title' => s($fullname));
// decode &amp;'s. format_string above will have encoded them and html_writer will encode again when it processed the title
// attribute leading to double encoding.
$attributes = array('title' => str_replace('&amp;', '&', $fullname));
if (empty($course->visible)) {
$attributes['class'] = 'dimmed';
}
@@ -1726,13 +1732,15 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
'type' => 'hidden', 'name' => 'completionstate',
'value' => $newstate));
echo html_writer::empty_tag('input', array(
'type' => 'image', 'src' => $imgsrc, 'alt' => $imgalt, 'title' => $imgtitle));
'type' => 'image', 'src' => $imgsrc, 'alt' => $imgalt, 'title' => $imgtitle,
'aria-live' => 'polite'));
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'>";
echo "<img src='$imgsrc' alt='$imgalt' title='$imgalt' /></span>";
// In auto mode, or when editing, the icon is just an image.
echo html_writer::tag('span', html_writer::empty_tag('img', array(
'src' => $imgsrc, 'alt' => $imgalt, 'title' => $imgalt)),
array('class' => 'autocompletion'));
}
}
}
@@ -1951,7 +1959,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'));
@@ -2000,7 +2009,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;
@@ -2457,7 +2470,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;
@@ -2505,8 +2520,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;
}
/**
@@ -2606,6 +2623,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
@@ -2708,14 +2726,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>';
}
@@ -2837,6 +2855,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
@@ -2846,7 +2865,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;
}
}
@@ -2874,6 +2895,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;
}
@@ -2887,7 +2915,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) {
@@ -2895,16 +2923,23 @@ function set_coursemodule_visible($id, $visible, $prevstateoverrides=false) {
}
}
$cminfo = new stdClass();
$cminfo->id = $id;
$cminfo->visible = $visible;
if ($prevstateoverrides) {
if ($visible == '0') {
// Remember the current visible state so we can toggle this back.
$DB->set_field('course_modules', 'visibleold', $cm->visible, array('id'=>$id));
// If we making whole section visiblility change..
if ($visible == 0) {
// Retain previous visibility state.
$cminfo->visibleold = $cm->visible;
} else {
// Get the previous saved visible states.
return $DB->set_field('course_modules', 'visible', $cm->visibleold, array('id'=>$id));
// Restore previous visibility state.
$cminfo->visible = $cm->visibleold;
}
} else {
$cminfo->visibleold = $visible;
}
return $DB->set_field("course_modules", "visible", $visible, array("id"=>$id));
return $DB->update_record('course_modules', $cminfo);
}
/**
@@ -3144,12 +3179,17 @@ function moveto_module($mod, $section, $beforemod=NULL) {
/// Update module itself if necessary
// If moving to a hidden section then hide module.
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 (!$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;
}
}
@@ -3483,6 +3523,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);
@@ -3538,6 +3579,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);
@@ -3584,6 +3626,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);
@@ -3616,6 +3659,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);
}
/**
@@ -3639,6 +3683,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);
}
/**
@@ -3671,6 +3716,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();
@@ -4426,16 +4474,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')
);
}
/**
+10 -7
View File
@@ -4,13 +4,22 @@
require_once('../config.php');
require_once('lib.php');
$id = optional_param('id', SITEID, PARAM_INT); // course id
$id = optional_param('id', SITEID, PARAM_INT); // course id
$redirect = optional_param('redirect', 0, PARAM_BOOL);
$url = new moodle_url('/course/loginas.php', array('id'=>$id));
$PAGE->set_url($url);
/// Reset user back to their real self if needed, for security reasons you need to log out and log in again
if (session_is_loggedinas()) {
require_sesskey();
require_logout();
// We can not set wanted URL here because the session is closed.
redirect(new moodle_url($url, array('redirect'=>1)));
}
if ($redirect) {
if ($id and $id != SITEID) {
$SESSION->wantsurl = "$CFG->wwwroot/course/view.php?id=".$id;
} else {
@@ -25,12 +34,6 @@ if (session_is_loggedinas()) {
$userid = required_param('user', PARAM_INT); // login as this user
$url = new moodle_url('/course/loginas.php', array('user'=>$userid, 'sesskey'=>sesskey()));
if ($id !== SITEID) {
$url->param('id', $id);
}
$PAGE->set_url($url);
require_sesskey();
$course = $DB->get_record('course', array('id'=>$id), '*', MUST_EXIST);
+2 -1
View File
@@ -335,7 +335,7 @@ if ($mform->is_cancelled()) {
$cm->groupmembersonly = $fromform->groupmembersonly;
$completion = new completion_info($course);
if ($completion->is_enabled()) {
if ($completion->is_enabled() && !empty($fromform->completionunlocked)) {
// Update completion settings
$cm->completion = $fromform->completion;
$cm->completiongradeitemnumber = $fromform->completiongradeitemnumber;
@@ -412,6 +412,7 @@ if ($mform->is_cancelled()) {
$newcm->module = $fromform->module;
$newcm->instance = 0; // not known yet, will be updated later (this is similar to restore code)
$newcm->visible = $fromform->visible;
$newcm->visibleold = $fromform->visible;
$newcm->groupmode = $fromform->groupmode;
$newcm->groupingid = $fromform->groupingid;
$newcm->groupmembersonly = $fromform->groupmembersonly;
+6 -3
View File
@@ -303,8 +303,11 @@ abstract class moodleform_mod extends moodleform {
}
// Completion: Don't let them choose automatic completion without turning
// on some conditions
if (array_key_exists('completion', $data) && $data['completion']==COMPLETION_TRACKING_AUTOMATIC) {
// on some conditions. Ignore this check when completion settings are
// locked, as the options are then disabled.
if (array_key_exists('completion', $data) &&
$data['completion'] == COMPLETION_TRACKING_AUTOMATIC &&
!empty($data['completionunlocked'])) {
if (empty($data['completionview']) && empty($data['completionusegrade']) &&
!$this->completion_rule_enabled($data)) {
$errors['completion'] = get_string('badautocompletion', 'completion');
@@ -332,7 +335,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;
}
+23 -6
View File
@@ -30,6 +30,7 @@ require_once('recent_form.php');
$id = required_param('id', PARAM_INT);
$PAGE->set_url('/course/recent.php', array('id'=>$id));
$PAGE->set_pagelayout('report');
if (!$course = $DB->get_record('course', array('id'=>$id))) {
print_error("That's an invalid course id");
@@ -280,21 +281,37 @@ echo $OUTPUT->footer();
function compare_activities_by_time_desc($a, $b) {
// make sure the activities actually have a timestamp property
if ((!array_key_exists('timestamp', $a)) or (!array_key_exists('timestamp', $b))) {
return 0;
}
if ($a->timestamp == $b->timestamp)
if ((!array_key_exists('timestamp', $a)) && (!array_key_exists('timestamp', $b))) {
return 0;
}
// We treat instances without timestamp as if they have a timestamp of 0.
if ((!array_key_exists('timestamp', $a)) && (array_key_exists('timestamp', $b))) {
return 1;
}
if ((array_key_exists('timestamp', $a)) && (!array_key_exists('timestamp', $b))) {
return -1;
}
if ($a->timestamp == $b->timestamp) {
return 0;
}
return ($a->timestamp > $b->timestamp) ? -1 : 1;
}
function compare_activities_by_time_asc($a, $b) {
// make sure the activities actually have a timestamp property
if ((!array_key_exists('timestamp', $a)) or (!array_key_exists('timestamp', $b))) {
if ((!array_key_exists('timestamp', $a)) && (!array_key_exists('timestamp', $b))) {
return 0;
}
if ($a->timestamp == $b->timestamp)
// We treat instances without timestamp as if they have a timestamp of 0.
if ((!array_key_exists('timestamp', $a)) && (array_key_exists('timestamp', $b))) {
return -1;
}
if ((array_key_exists('timestamp', $a)) && (!array_key_exists('timestamp', $b))) {
return 1;
}
if ($a->timestamp == $b->timestamp) {
return 0;
}
return ($a->timestamp < $b->timestamp) ? -1 : 1;
}
+2 -6
View File
@@ -191,18 +191,14 @@ class core_course_renderer extends plugin_renderer_base {
$formcontent .= html_writer::start_tag('div', array('class' => 'alloptions'));
// Activities
$activities = array_filter($modules, function($mod) {
return ($mod->archetype !== MOD_ARCHETYPE_RESOURCE && $mod->archetype !== MOD_ARCHETYPE_SYSTEM);
});
$activities = array_filter($modules, create_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, function($mod) {
return ($mod->archetype === MOD_ARCHETYPE_RESOURCE);
});
$resources = array_filter($modules, create_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;
+13 -5
View File
@@ -87,7 +87,11 @@ foreach ($modinfo->cms as $cm) {
// preload instances
foreach ($resources as $modname=>$instances) {
$resources[$modname] = $DB->get_records_list($modname, 'id', $instances, 'id', 'id,name,intro,introformat,timemodified');
$additionalfields = '';
if (plugin_supports('mod', $modname, FEATURE_MOD_INTRO)) {
$additionalfields = ',intro,introformat';
}
$resources[$modname] = $DB->get_records_list($modname, 'id', $instances, 'id', 'id,name'.$additionalfields);
}
if (!$cms) {
@@ -112,8 +116,8 @@ foreach ($cms as $cm) {
continue;
}
$resource = $resources[$cm->modname][$cm->instance];
$printsection = '';
if ($usesections) {
$printsection = '';
if ($cm->sectionnum !== $currentsection) {
if ($cm->sectionnum) {
$printsection = get_section_name($course, $sections[$cm->sectionnum]);
@@ -123,8 +127,6 @@ foreach ($cms as $cm) {
}
$currentsection = $cm->sectionnum;
}
} else {
$printsection = '<span class="smallinfo">'.userdate($resource->timemodified)."</span>";
}
$extra = empty($cm->extra) ? '' : $cm->extra;
@@ -134,11 +136,17 @@ foreach ($cms as $cm) {
$icon = '<img src="'.$OUTPUT->pix_url('icon', $cm->modname).'" class="activityicon" alt="'.get_string('modulename', $cm->modname).'" /> ';
}
if (isset($resource->intro) && isset($resource->introformat)) {
$intro = format_module_intro('resource', $resource, $cm->id);
} else {
$intro = '';
}
$class = $cm->visible ? '' : 'class="dimmed"'; // hidden modules are dimmed
$table->data[] = array (
$printsection,
"<a $class $extra href=\"$CFG->wwwroot/mod/$cm->modname/view.php?id=$cm->id\">".$icon.format_string($resource->name)."</a>",
format_module_intro('resource', $resource, $cm->id));
$intro);
}
echo html_writer::table($table);
+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);
+325
View File
@@ -226,4 +226,329 @@ 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);
}
public function test_module_visibility() {
$this->setAdminUser();
$this->resetAfterTest(true);
// Create course and modules.
$course = $this->getDataGenerator()->create_course(array('numsections' => 5));
$forum = $this->getDataGenerator()->create_module('forum', array('course' => $course->id));
$page = $this->getDataGenerator()->create_module('page', array('duedate' => time(), 'course' => $course->id));
$modules = compact('forum', 'page');
// Hiding the modules.
foreach ($modules as $mod) {
set_coursemodule_visible($mod->cmid, 0);
$this->check_module_visibility($mod, 0, 0);
}
// Showing the modules.
foreach ($modules as $mod) {
set_coursemodule_visible($mod->cmid, 1);
$this->check_module_visibility($mod, 1, 1);
}
}
public function test_section_visibility() {
$this->setAdminUser();
$this->resetAfterTest(true);
// Create course.
$course = $this->getDataGenerator()->create_course(array('numsections' => 3), array('createsections' => true));
// Testing an empty section.
$sectionnumber = 1;
set_section_visible($course->id, $sectionnumber, 0);
$section_info = get_fast_modinfo($course)->get_section_info($sectionnumber);
$this->assertEquals($section_info->visible, 0);
set_section_visible($course->id, $sectionnumber, 1);
$section_info = get_fast_modinfo($course)->get_section_info($sectionnumber);
$this->assertEquals($section_info->visible, 1);
// Testing a section with visible modules.
$sectionnumber = 2;
$forum = $this->getDataGenerator()->create_module('forum', array('course' => $course->id),
array('section' => $sectionnumber));
$page= $this->getDataGenerator()->create_module('page', array('duedate' => time(),
'course' => $course->id), array('section' => $sectionnumber));
$modules = compact('forum', 'page');
set_section_visible($course->id, $sectionnumber, 0);
$section_info = get_fast_modinfo($course)->get_section_info($sectionnumber);
$this->assertEquals($section_info->visible, 0);
foreach ($modules as $mod) {
$this->check_module_visibility($mod, 0, 1);
}
set_section_visible($course->id, $sectionnumber, 1);
$section_info = get_fast_modinfo($course)->get_section_info($sectionnumber);
$this->assertEquals($section_info->visible, 1);
foreach ($modules as $mod) {
$this->check_module_visibility($mod, 1, 1);
}
// Testing a section with hidden modules, which should stay hidden.
$sectionnumber = 3;
$forum = $this->getDataGenerator()->create_module('forum', array('course' => $course->id),
array('section' => $sectionnumber));
$page = $this->getDataGenerator()->create_module('page', array('duedate' => time(),
'course' => $course->id), array('section' => $sectionnumber));
$modules = compact('forum', 'page');
foreach ($modules as $mod) {
set_coursemodule_visible($mod->cmid, 0);
$this->check_module_visibility($mod, 0, 0);
}
set_section_visible($course->id, $sectionnumber, 0);
$section_info = get_fast_modinfo($course)->get_section_info($sectionnumber);
$this->assertEquals($section_info->visible, 0);
foreach ($modules as $mod) {
$this->check_module_visibility($mod, 0, 0);
}
set_section_visible($course->id, $sectionnumber, 1);
$section_info = get_fast_modinfo($course)->get_section_info($sectionnumber);
$this->assertEquals($section_info->visible, 1);
foreach ($modules as $mod) {
$this->check_module_visibility($mod, 0, 0);
}
}
/**
* Helper function to assert that a module has correctly been made visible, or hidden.
*
* @param stdClass $mod module information
* @param int $visibility the current state of the module
* @param int $visibleold the current state of the visibleold property
* @return void
*/
public function check_module_visibility($mod, $visibility, $visibleold) {
global $DB;
rebuild_course_cache($mod->course);
$course = $DB->get_record('course', array('id' => $mod->course));
$cm = get_fast_modinfo($course)->get_cm($mod->cmid);
$this->assertEquals($visibility, $cm->visible);
$this->assertEquals($visibleold, $cm->visibleold);
// Check the module grade items.
$grade_items = grade_item::fetch_all(array('itemtype' => 'mod', 'itemmodule' => $cm->modname,
'iteminstance' => $cm->instance, 'courseid' => $cm->course));
if ($grade_items) {
foreach ($grade_items as $grade_item) {
if ($visibility) {
$this->assertFalse($grade_item->is_hidden(), "$cm->modname grade_item not visible");
} else {
$this->assertTrue($grade_item->is_hidden(), "$cm->modname grade_item not hidden");
}
}
}
// Check the events visibility.
if ($events = $DB->get_records('event', array('instance' => $cm->instance, 'modulename' => $cm->modname))) {
foreach ($events as $event) {
$calevent = new calendar_event($event);
$this->assertEquals($visibility, $calevent->visible, "$cm->modname calendar_event visibility");
}
}
}
/**
* Tests moving a module between hidden/visible sections and
* verifies that the course/module visiblity seettings are
* retained.
*/
public function test_moveto_module_between_hidden_sections() {
global $DB;
$this->resetAfterTest(true);
$course = $this->getDataGenerator()->create_course(array('numsections' => 4), array('createsections' => true));
$forum = $this->getDataGenerator()->create_module('forum', array('course' => $course->id));
$page = $this->getDataGenerator()->create_module('page', array('course' => $course->id));
$quiz= $this->getDataGenerator()->create_module('quiz', array('course' => $course->id));
// Set the page as hidden
set_coursemodule_visible($page->cmid, 0);
// Set sections 3 as hidden.
set_section_visible($course->id, 3, 0);
$modinfo = get_fast_modinfo($course);
$hiddensection = $modinfo->get_section_info(3);
// New section is definitely not visible:
$this->assertEquals($hiddensection->visible, 0);
$forumcm = $modinfo->cms[$forum->cmid];
$pagecm = $modinfo->cms[$page->cmid];
// Move the forum and the page to a hidden section.
moveto_module($forumcm, $hiddensection);
moveto_module($pagecm, $hiddensection);
// Reset modinfo cache.
$reset = 'reset';
get_fast_modinfo($reset);
$modinfo = get_fast_modinfo($course);
// Verify that forum and page have been moved to the hidden section and quiz has not.
$this->assertContains($forum->cmid, $modinfo->sections[3]);
$this->assertContains($page->cmid, $modinfo->sections[3]);
$this->assertNotContains($quiz->cmid, $modinfo->sections[3]);
// Verify that forum has been made invisible.
$forumcm = $modinfo->cms[$forum->cmid];
$this->assertEquals($forumcm->visible, 0);
// Verify that old state has been retained.
$this->assertEquals($forumcm->visibleold, 1);
// Verify that page has stayed invisible.
$pagecm = $modinfo->cms[$page->cmid];
$this->assertEquals($pagecm->visible, 0);
// Verify that old state has been retained.
$this->assertEquals($pagecm->visibleold, 0);
// Verify that quiz has been unaffected.
$quizcm = $modinfo->cms[$quiz->cmid];
$this->assertEquals($quizcm->visible, 1);
// Move forum and page back to visible section.
$visiblesection = $modinfo->get_section_info(2);
moveto_module($forumcm, $visiblesection);
moveto_module($pagecm, $visiblesection);
// Reset modinfo cache.
$reset = 'reset';
get_fast_modinfo($reset);
$modinfo = get_fast_modinfo($course);
// Verify that forum has been made visible.
$forumcm = $modinfo->cms[$forum->cmid];
$this->assertEquals($forumcm->visible, 1);
// Verify that page has stayed invisible.
$pagecm = $modinfo->cms[$page->cmid];
$this->assertEquals($pagecm->visible, 0);
// Move the page in the same section (this is what mod duplicate does_
moveto_module($pagecm, $visiblesection, $forumcm);
// Reset modinfo cache.
$reset = 'reset';
get_fast_modinfo($reset);
// Verify that the the page is still hidden
$modinfo = get_fast_modinfo($course);
$pagecm = $modinfo->cms[$page->cmid];
$this->assertEquals($pagecm->visible, 0);
}
/**
* Tests moving a module around in the same section. moveto_module()
* is called this way in modduplicate.
*/
public function test_moveto_module_in_same_section() {
global $DB;
$this->resetAfterTest(true);
$course = $this->getDataGenerator()->create_course(array('numsections' => 3), array('createsections' => true));
$page = $this->getDataGenerator()->create_module('page', array('course' => $course->id));
$forum = $this->getDataGenerator()->create_module('forum', array('course' => $course->id));
// Simulate inconsistent visible/visibleold values (MDL-38713).
$cm = $DB->get_record('course_modules', array('id' => $page->cmid), '*', MUST_EXIST);
$cm->visible = 0;
$cm->visibleold = 1;
$DB->update_record('course_modules', $cm);
$modinfo = get_fast_modinfo($course);
$forumcm = $modinfo->cms[$forum->cmid];
$pagecm = $modinfo->cms[$page->cmid];
// Verify that page is hidden.
$this->assertEquals($pagecm->visible, 0);
// Verify section 0 is where all mods added.
$section = $modinfo->get_section_info(0);
$this->assertEquals($section->id, $forumcm->section);
$this->assertEquals($section->id, $pagecm->section);
// Move the forum and the page to a hidden section.
moveto_module($pagecm, $section, $forumcm);
// Reset modinfo cache.
$reset = 'reset';
get_fast_modinfo($reset);
// Verify that the the page is still hidden
$modinfo = get_fast_modinfo($course);
$pagecm = $modinfo->cms[$page->cmid];
$this->assertEquals($pagecm->visible, 0);
}
}
+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);
+5
View File
@@ -124,7 +124,12 @@
$PAGE->set_pagelayout('course');
$PAGE->set_pagetype('course-view-' . $course->format);
$PAGE->set_other_editing_capability('moodle/course:update');
$PAGE->set_other_editing_capability('moodle/course:manageactivities');
$PAGE->set_other_editing_capability('moodle/course:activityvisibility');
if (course_format_uses_sections($course->format)) {
$PAGE->set_other_editing_capability('moodle/course:sectionvisibility');
}
if ($reset_user_allowed_editing) {
// ugly hack
+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 || {};
+27 -18
View File
@@ -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;
@@ -517,7 +508,9 @@ YUI.add('moodle-course-toolboxes', function(Y) {
.setAttrs({
'name' : 'title',
'value' : titletext,
'autocomplete' : 'off'
'autocomplete' : 'off',
'aria-describedby' : 'id_editinstructions',
'maxLength' : '255'
})
.addClass('titleeditor');
var editform = Y.Node.create('<form />')
@@ -527,6 +520,7 @@ YUI.add('moodle-course-toolboxes', function(Y) {
var editinstructions = Y.Node.create('<span />')
.addClass('editinstructions')
.setAttrs({'id' : 'id_editinstructions'})
.set('innerHTML', M.util.get_string('edittitleinstructions', 'moodle'));
// Clear the existing content and put the editor in
@@ -566,8 +560,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);
}
});
@@ -600,6 +595,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',
@@ -707,12 +722,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) {
+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.');
}
+1 -1
View File
@@ -87,7 +87,7 @@ class core_enrol_external extends external_api {
}
list($enrolledsqlselect, $enrolledparams) = get_enrolled_sql($context);
$enrolledsql = "SELECT COUNT(*) FROM ($enrolledsqlselect) AS enrolleduserids";
$enrolledsql = "SELECT COUNT('x') FROM ($enrolledsqlselect) enrolleduserids";
$enrolledusercount = $DB->count_records_sql($enrolledsql, $enrolledparams);
$result[] = array('id'=>$course->id, 'shortname'=>$course->shortname, 'fullname'=>$course->fullname, 'idnumber'=>$course->idnumber,'visible'=>$course->visible, 'enrolledusercount'=>$enrolledusercount);
+16 -8
View File
@@ -514,13 +514,19 @@ function process_person_tag($tagcontents){
// Now if the recstatus is 3, we should delete the user if-and-only-if the setting for delete users is turned on
// In the "users" table we can do this by setting deleted=1
if($recstatus==3){
if($imsdeleteusers){ // If we're allowed to delete user records
// Make sure their "deleted" field is set to one
$DB->set_field('user', 'deleted', 1, array('username'=>$person->username));
$this->log_line("Marked user record for user '$person->username' (ID number $person->idnumber) as deleted.");
// Do not dare to hack the user.deleted field directly in database!!!
if ($user = $DB->get_record('user', array('username'=>$person->username, 'mnethostid'=>$CFG->mnet_localhost_id, 'deleted'=>0))) {
if (delete_user($user)) {
$this->log_line("Deleted user '$person->username' (ID number $person->idnumber).");
} else {
$this->log_line("Error deleting '$person->username' (ID number $person->idnumber).");
}
} else {
$this->log_line("Can not delete user '$person->username' (ID number $person->idnumber) - user does not exist.");
}
}else{
$this->log_line("Ignoring deletion request for user '$person->username' (ID number $person->idnumber).");
}
@@ -539,8 +545,10 @@ function process_person_tag($tagcontents){
} else {
// If they don't exist and they have a defined username, and $createnewusers == true, we create them.
$person->lang = 'manual'; //TODO: this needs more work due tu multiauth changes
$person->auth = $CFG->auth;
$person->lang = $CFG->lang;
$auth = explode(',', $CFG->auth); //TODO: this needs more work due tu multiauth changes, use first auth for now
$auth = reset($auth);
$person->auth = $auth;
$person->confirmed = 1;
$person->timemodified = time();
$person->mnethostid = $CFG->mnet_localhost_id;
@@ -568,8 +576,8 @@ function process_person_tag($tagcontents){
} elseif ($createnewusers) {
$this->log_line("User record already exists for user '$person->username' (ID number $person->idnumber).");
// Make sure their "deleted" field is set to zero.
$DB->set_field('user', 'deleted', 0, array('idnumber'=>$person->idnumber));
// It is totally wrong to mess with deleted users flag directly in database!!!
// There is no official way to undelete user, sorry..
}else{
$this->log_line("No user record found for '$person->username' (ID number $person->idnumber).");
}
+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
+3 -1
View File
@@ -67,7 +67,9 @@ switch ($action) {
$enrolid = required_param('enrolid', PARAM_INT);
$search = optional_param('search', '', PARAM_RAW);
$page = optional_param('page', 0, PARAM_INT);
$outcome->response = $manager->get_potential_users($enrolid, $search, true, $page);
$addedenrollment = optional_param('enrolcount', 0, PARAM_INT);
$perpage = optional_param('perpage', 25, PARAM_INT); // This value is hard-coded to 25 in quickenrolment.js
$outcome->response = $manager->get_potential_users($enrolid, $search, true, $page, $perpage, $addedenrollment);
$extrafields = get_extra_user_fields($context);
foreach ($outcome->response['users'] as &$user) {
$user->picture = $OUTPUT->user_picture($user);
+18 -3
View File
@@ -22,7 +22,9 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
DEFAULTDURATION : 'defaultDuration',
ASSIGNABLEROLES : 'assignableRoles',
DISABLEGRADEHISTORY : 'disableGradeHistory',
RECOVERGRADESDEFAULT : 'recoverGradesDefault'
RECOVERGRADESDEFAULT : 'recoverGradesDefault',
ENROLCOUNT : 'enrolCount',
PERPAGE : 'perPage'
};
/** CSS classes for nodes in structure **/
var CSS = {
@@ -304,6 +306,9 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
params['action'] = 'searchusers';
params['search'] = this.get(UEP.SEARCH).get('value');
params['page'] = this.get(UEP.PAGE);
params['enrolcount'] = this.get(UEP.ENROLCOUNT);
params['perpage'] = this.get(UEP.PERPAGE);
if (this.get(UEP.MULTIPLE)) {
alert('oh no there are multiple');
} else {
@@ -371,7 +376,7 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
var content = create('<div class="'+CSS.SEARCHRESULTS+'"></div>')
.append(create('<div class="'+CSS.TOTALUSERS+'">'+usersstr+'</div>'))
.append(users);
if (result.response.totalusers > (this.get(UEP.PAGE)+1)*25) {
if (result.response.totalusers > (this.get(UEP.PAGE)+1)*this.get(UEP.PERPAGE)) {
var fetchmore = create('<div class="'+CSS.MORERESULTS+'"><a href="#">'+M.str.enrol.ajaxnext25+'</a></div>');
fetchmore.on('click', this.search, this, true);
content.append(fetchmore)
@@ -379,7 +384,7 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
this.setContent(content);
Y.delegate("click", this.enrolUser, users, '.'+CSS.USER+' .'+CSS.ENROL, this, args);
} else {
if (result.response.totalusers <= (this.get(UEP.PAGE)+1)*25) {
if (result.response.totalusers <= (this.get(UEP.PAGE)+1)*this.get(UEP.PERPAGE)) {
this.get(UEP.BASE).one('.'+CSS.MORERESULTS).remove();
}
}
@@ -415,6 +420,8 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
args.userNode.addClass(CSS.ENROLLED);
args.userNode.one('.'+CSS.ENROL).remove();
this.set(UEP.REQUIREREFRESH, true);
var countenrol = this.get(UEP.ENROLCOUNT)+1;
this.set(UEP.ENROLCOUNT, countenrol);
}
} catch (e) {
new M.core.exception(e);
@@ -527,6 +534,14 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
},
recoverGradesDefault : {
value : ''
},
enrolCount : {
value : 0,
validator : Y.Lang.isNumber
},
perPage : {
value: 25,
Validator: Y.Lang.isNumber
}
}
});
+5 -7
View File
@@ -93,15 +93,13 @@ class enrol_paypal_edit_form extends moodleform {
list($instance, $plugin, $context) = $this->_customdata;
if ($data['status'] == ENROL_INSTANCE_ENABLED) {
if (!empty($data['enrolenddate']) and $data['enrolenddate'] < $data['enrolstartdate']) {
$errors['enrolenddate'] = get_string('enrolenddaterror', 'enrol_paypal');
}
if (!empty($data['enrolenddate']) and $data['enrolenddate'] < $data['enrolstartdate']) {
$errors['enrolenddate'] = get_string('enrolenddaterror', 'enrol_paypal');
}
if (!is_numeric($data['cost'])) {
$errors['cost'] = get_string('costerror', 'enrol_paypal');
if (!is_numeric($data['cost'])) {
$errors['cost'] = get_string('costerror', 'enrol_paypal');
}
}
return $errors;
+11 -5
View File
@@ -56,7 +56,6 @@ YUI.add('moodle-enrol-rolemanager', function(Y) {
Y.extend(ROLE, Y.Base, {
users : [],
roleAssignmentPanel : null,
panelsubmitevent : null,
rolesLoadedEvent : null,
escCloseEvent : null,
initializer : function(config) {
@@ -75,14 +74,16 @@ YUI.add('moodle-enrol-rolemanager', function(Y) {
this.rolesLoadedEvent = this.on('assignablerolesloaded', function(){
this.rolesLoadedEvent.detach();
var panel = this._getRoleAssignmentPanel();
this.panelsubmitevent = panel.on('submit', this.addRoleCallback, this);
panel.hide().display(user);
panel.hide();
panel.submitevent = panel.on('submit', this.addRoleCallback, this);
panel.display(user);
}, this);
this._loadAssignableRoles();
},
addRoleCallback : function(e, roleid, userid) {
this.panelsubmitevent.detach();
var panel = this._getRoleAssignmentPanel();
panel.submitevent.detach();
panel.submitevent = null;
Y.io(M.cfg.wwwroot+'/enrol/ajax.php', {
method:'POST',
data:'id='+this.get(COURSEID)+'&action=assign&sesskey='+M.cfg.sesskey+'&roleid='+roleid+'&user='+userid,
@@ -350,6 +351,7 @@ YUI.add('moodle-enrol-rolemanager', function(Y) {
Y.extend(ROLEPANEL, Y.Base, {
user : null,
roles : [],
submitevent : null,
initializer : function() {
var i, m = this.get(MANIPULATOR);
var element = Y.Node.create('<div class="enrolpanel roleassign"><div class="container"><div class="header"><h2>'+M.str.role.assignroles+'</h2><div class="close"></div></div><div class="content"></div></div></div>');
@@ -398,6 +400,10 @@ YUI.add('moodle-enrol-rolemanager', function(Y) {
this.roles = [];
this.user = null;
this.get('elementNode').removeClass('visible');
if (this.submitevent) {
this.submitevent.detach();
this.submitevent = null;
}
this.displayed = false;
return this;
},
@@ -416,4 +422,4 @@ YUI.add('moodle-enrol-rolemanager', function(Y) {
}
}
}, '@VERSION@', {requires:['base','node','io-base','json-parse','test','moodle-enrol-notification']});
}, '@VERSION@', {requires:['base','node','io-base','json-parse','test','moodle-enrol-notification']});
+4 -1
View File
@@ -304,7 +304,10 @@ class core_files_renderer extends plugin_renderer_base {
private function fm_js_template_mkdir() {
$rv = '
<div class="filemanager fp-mkdir-dlg">
<div class="fp-mkdir-dlg-text">'.get_string('newfoldername','repository').'<br/><input type="text" /></div>
<div class="fp-mkdir-dlg-text">
<label>' . get_string('newfoldername', 'repository') . '</label><br/>
<input type="text" />
</div>
<button class="{!}fp-dlg-butcreate">'.get_string('makeafolder').'</button>
<button class="{!}fp-dlg-butcancel">'.get_string('cancel').'</button>
</div>';
+127
View File
@@ -0,0 +1,127 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* PHPunit tests for external files API.
*
* @package core_files
* @category external
* @copyright 2013 Ankit Agarwal
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @since Moodle 2.6
*/
defined('MOODLE_INTERNAL') || die();
global $CFG;
require_once($CFG->dirroot . '/webservice/tests/helpers.php');
require_once($CFG->dirroot . '/files/externallib.php');
class test_external_files extends advanced_testcase {
/*
* Test core_files_external::upload().
*/
public function test_upload() {
global $USER;
$this->resetAfterTest();
$this->setAdminUser();
$context = context_user::instance($USER->id);
$contextid = $context->id;
$component = "user";
$filearea = "private";
$itemid = 0;
$filepath = "/";
$filename = "Simple.txt";
$filecontent = base64_encode("Let us create a nice simple file");
$browser = get_file_browser();
// Make sure no file exists.
$file = $browser->get_file_info($context, $component, $filearea, $itemid, $filepath, $filename);
$this->assertEmpty($file);
// Call the api to create a file.
core_files_external::upload($contextid, $component, $filearea, $itemid, $filepath, $filename, $filecontent);
// Make sure the file was created.
$file = $browser->get_file_info($context, $component, $filearea, $itemid, $filepath, $filename);
$this->assertNotEmpty($file);
// Make sure no file exists.
$itemid = 2;
$filename = "Simple2.txt";
$file = $browser->get_file_info($context, $component, $filearea, $itemid, $filepath, $filename);
$this->assertEmpty($file);
// Call the api to create a file.
$fileinfo = core_files_external::upload($contextid, $component, $filearea, $itemid, $filepath, $filename, $filecontent);
// Make sure itemid is always set to 0.
$this->assertEquals(0, $fileinfo['itemid']);
// Make sure the same file cannot be created again.
$this->setExpectedException("moodle_exception");
core_files_external::upload($contextid, $component, $filearea, $itemid, $filepath, $filename, $filecontent);
}
/*
* Make sure only user component is allowed in core_files_external::upload().
*/
public function test_upload_param_component() {
global $USER;
$this->resetAfterTest();
$this->setAdminUser();
$context = context_user::instance($USER->id);
$contextid = $context->id;
$component = "backup";
$filearea = "private";
$itemid = 0;
$filepath = "/";
$filename = "Simple3.txt";
$filecontent = base64_encode("Let us create a nice simple file");
// Make sure exception is thrown.
$this->setExpectedException("coding_exception");
core_files_external::upload($contextid, $component, $filearea, $itemid, $filepath, $filename, $filecontent);
}
/*
* Make sure only private area is allowed in core_files_external::upload().
*/
public function test_upload_param_area() {
global $USER;
$this->resetAfterTest();
$this->setAdminUser();
$context = context_user::instance($USER->id);
$contextid = $context->id;
$component = "user";
$filearea = "draft";
$itemid = 0;
$filepath = "/";
$filename = "Simple4.txt";
$filecontent = base64_encode("Let us create a nice simple file");
// Make sure exception is thrown.
$this->setExpectedException("coding_exception");
core_files_external::upload($contextid, $component, $filearea, $itemid, $filepath, $filename, $filecontent);
}
}
+18 -11
View File
@@ -122,19 +122,26 @@ class filter_urltolink extends moodle_text_filter {
$unicoderegexp = @preg_match('/\pL/u', 'a'); // This will fail silently, returning false,
}
//todo: MDL-21296 - use of unicode modifiers may cause a timeout
if ($unicoderegexp) { //We can use unicode modifiers
$text = preg_replace('#(?<!=["\'])(((http(s?))://)(((([\pLl0-9]([\pLl0-9]|-)*[\pLl0-9]|[\pLl0-9])\.)+([\pLl]([\pLl0-9]|-)*[\pLl0-9]|[\pLl]))|(([0-9]{1,3}\.){3}[0-9]{1,3}))(:[\pL0-9]*)?(/([\pLl0-9\.!$&\'\(\)*+,;=_~:@-]|%[a-fA-F0-9]{2})*)*(\?([\pLl0-9\.!$&\'\(\)*+,;=_~:@/?-]|%[a-fA-F0-9]{2})*)?(\#[\pLl0-9\.!$&\'\(\)*+,;=_~:@/?-]*)?)(?<![,.;])#iu',
'<a href="\\1" class="_blanktarget">\\1</a>', $text);
$text = preg_replace('#(?<!=["\']|//)((www\.([\pLl0-9]([\pLl0-9]|-)*[\pLl0-9]|[\pLl0-9])\.)+([\pLl]([\pLl0-9]|-)*[\pLl0-9]|[\pLl])(:[\pL0-9]*)?(/([\pLl0-9\.!$&\'\(\)*+,;=_~:@-]|%[a-fA-F0-9]{2})*)*(\?([\pLl0-9\.!$&\'\(\)*+,;=_~:@/?-]|%[a-fA-F0-9]{2})*)?(\#[\pLl0-9\.!$&\'\(\)*+,;=_~:@/?-]*)?)(?<![,.;])#iu',
'<a href="http://\\1" class="_blanktarget">\\1</a>', $text);
} else { //We cannot use unicode modifiers
$text = preg_replace('#(?<!=["\'])(((http(s?))://)(((([a-z0-9]([a-z0-9]|-)*[a-z0-9]|[a-z0-9])\.)+([a-z]([a-z0-9]|-)*[a-z0-9]|[a-z]))|(([0-9]{1,3}\.){3}[0-9]{1,3}))(:[a-zA-Z0-9]*)?(/([a-z0-9\.!$&\'\(\)*+,;=_~:@-]|%[a-f0-9]{2})*)*(\?([a-z0-9\.!$&\'\(\)*+,;=_~:@/?-]|%[a-fA-F0-9]{2})*)?(\#[a-z0-9\.!$&\'\(\)*+,;=_~:@/?-]*)?)(?<![,.;])#i',
'<a href="\\1" class="_blanktarget">\\1</a>', $text);
$text = preg_replace('#(?<!=["\']|//)((www\.([a-z0-9]([a-z0-9]|-)*[a-z0-9]|[a-z0-9])\.)+([a-z]([a-z0-9]|-)*[a-z0-9]|[a-z])(:[a-zA-Z0-9]*)?(/([a-z0-9\.!$&\'\(\)*+,;=_~:@-]|%[a-f0-9]{2})*)*(\?([a-z0-9\.!$&\'\(\)*+,;=_~:@/?-]|%[a-fA-F0-9]{2})*)?(\#[a-z0-9\.!$&\'\(\)*+,;=_~:@/?-]*)?)(?<![,.;])#i',
'<a href="http://\\1" class="_blanktarget">\\1</a>', $text);
// TODO MDL-21296 - use of unicode modifiers may cause a timeout
$urlstart = '(?:http(s)?://|(?<!://)(www\.))';
$domainsegment = '(?:[\pLl0-9][\pLl0-9-]*[\pLl0-9]|[\pLl0-9])';
$numericip = '(?:(?:[0-9]{1,3}\.){3}[0-9]{1,3})';
$port = '(?::\d*)';
$pathchar = '(?:[\pL0-9\.!$&\'\(\)*+,;=_~:@-]|%[a-f0-9]{2})';
$path = "(?:/$pathchar*)*";
$querystring = '(?:\?(?:[\pL0-9\.!$&\'\(\)*+,;=_~:@/?-]|%[a-fA-F0-9]{2})*)';
$fragment = '(?:\#(?:[\pL0-9\.!$&\'\(\)*+,;=_~:@/?-]|%[a-fA-F0-9]{2})*)';
$regex = "(?<!=[\"'])$urlstart((?:$domainsegment\.)+$domainsegment|$numericip)" .
"($port?$path$querystring?$fragment?)(?<![]),.;])";
if ($unicoderegexp) {
$regex = '#' . $regex . '#ui';
} else {
$regex = '#' . preg_replace(array('\pLl', '\PL'), 'a-z', $regex) . '#i';
}
$text = preg_replace($regex, '<a href="http$1://$2$3$4" class="_blanktarget">$0</a>', $text);
if (!empty($ignoretags)) {
$ignoretags = array_reverse($ignoretags); /// Reversed so "progressive" str_replace() will solve some nesting problems.
$text = str_replace(array_keys($ignoretags),$ignoretags,$text);
+39 -17
View File
@@ -44,7 +44,7 @@ class filter_urltolink_testcase extends basic_testcase {
'$1<a href="http://www.$2$3" target="_blank">www.$2$3</a>', $text);
}
function test_convert_urls_into_links() {
function get_convert_urls_into_links_test_cases() {
$texts = array (
//just a url
'http://moodle.org - URL' => '<a href="http://moodle.org" class="_blanktarget">http://moodle.org</a> - URL',
@@ -57,13 +57,26 @@ class filter_urltolink_testcase extends basic_testcase {
'URL: https://moodle.org/s/i=1&j=2' => 'URL: <a href="https://moodle.org/s/i=1&j=2" class="_blanktarget">https://moodle.org/s/i=1&j=2</a>',
//url with port and params
'URL: http://moodle.org:8080/s/i=1' => 'URL: <a href="http://moodle.org:8080/s/i=1" class="_blanktarget">http://moodle.org:8080/s/i=1</a>',
//url in brackets
// URL with complex fragment.
'Most voted issues: https://tracker.moodle.org/browse/MDL#selectedTab=com.atlassian.jira.plugin.system.project%3Apopularissues-panel' => 'Most voted issues: <a href="https://tracker.moodle.org/browse/MDL#selectedTab=com.atlassian.jira.plugin.system.project%3Apopularissues-panel" class="_blanktarget">https://tracker.moodle.org/browse/MDL#selectedTab=com.atlassian.jira.plugin.system.project%3Apopularissues-panel</a>',
// Domain with more parts
'URL: www.bbc.co.uk.' => 'URL: <a href="http://www.bbc.co.uk" class="_blanktarget">www.bbc.co.uk</a>.',
// URL in brackets.
'(http://moodle.org) - URL' => '(<a href="http://moodle.org" class="_blanktarget">http://moodle.org</a>) - URL',
'(www.moodle.org) - URL' => '(<a href="http://www.moodle.org" class="_blanktarget">www.moodle.org</a>) - URL',
//url in square brackets
// URL in brackets with a path.
'(http://example.com/index.html) - URL' => '(<a href="http://example.com/index.html" class="_blanktarget">http://example.com/index.html</a>) - URL',
'(www.example.com/index.html) - URL' => '(<a href="http://www.example.com/index.html" class="_blanktarget">www.example.com/index.html</a>) - URL',
// URL in brackets with anchor.
'(http://moodle.org/main#anchor) - URL' => '(<a href="http://moodle.org/main#anchor" class="_blanktarget">http://moodle.org/main#anchor</a>) - URL',
'(www.moodle.org/main#anchor) - URL' => '(<a href="http://www.moodle.org/main#anchor" class="_blanktarget">www.moodle.org/main#anchor</a>) - URL',
// URL in square brackets.
'[http://moodle.org] - URL' => '[<a href="http://moodle.org" class="_blanktarget">http://moodle.org</a>] - URL',
'[www.moodle.org] - URL' => '[<a href="http://www.moodle.org" class="_blanktarget">www.moodle.org</a>] - URL',
//url in brackets with anchor
// URL in square brackets with a path.
'[http://example.com/index.html] - URL' => '[<a href="http://example.com/index.html" class="_blanktarget">http://example.com/index.html</a>] - URL',
'[www.example.com/index.html] - URL' => '[<a href="http://www.example.com/index.html" class="_blanktarget">www.example.com/index.html</a>] - URL',
// URL in square brackets with anchor.
'[http://moodle.org/main#anchor] - URL' => '[<a href="http://moodle.org/main#anchor" class="_blanktarget">http://moodle.org/main#anchor</a>] - URL',
'[www.moodle.org/main#anchor] - URL' => '[<a href="http://www.moodle.org/main#anchor" class="_blanktarget">www.moodle.org/main#anchor</a>] - URL',
//brackets within the url
@@ -71,7 +84,8 @@ class filter_urltolink_testcase extends basic_testcase {
'URL: www.cc.org/url_(withpar)_go/?i=2' => 'URL: <a href="http://www.cc.org/url_(withpar)_go/?i=2" class="_blanktarget">www.cc.org/url_(withpar)_go/?i=2</a>',
'URL: http://cc.org/url_(with)_(par)_go/?i=2' => 'URL: <a href="http://cc.org/url_(with)_(par)_go/?i=2" class="_blanktarget">http://cc.org/url_(with)_(par)_go/?i=2</a>',
'URL: www.cc.org/url_(with)_(par)_go/?i=2' => 'URL: <a href="http://www.cc.org/url_(with)_(par)_go/?i=2" class="_blanktarget">www.cc.org/url_(with)_(par)_go/?i=2</a>',
'http://en.wikipedia.org/wiki/Slash_(punctuation)'=>'<a href="http://en.wikipedia.org/wiki/Slash_(punctuation)" class="_blanktarget">http://en.wikipedia.org/wiki/Slash_(punctuation)</a>',
// URL legitimately ending in a bracket. Commented out as part of MDL-22390. See next tests for work-arounds.
// 'http://en.wikipedia.org/wiki/Slash_(punctuation)'=>'<a href="http://en.wikipedia.org/wiki/Slash_(punctuation)" class="_blanktarget">http://en.wikipedia.org/wiki/Slash_(punctuation)</a>',
'http://en.wikipedia.org/wiki/%28#Parentheses_.28_.29 - URL' => '<a href="http://en.wikipedia.org/wiki/%28#Parentheses_.28_.29" class="_blanktarget">http://en.wikipedia.org/wiki/%28#Parentheses_.28_.29</a> - URL',
'http://en.wikipedia.org/wiki/(#Parentheses_.28_.29 - URL' => '<a href="http://en.wikipedia.org/wiki/(#Parentheses_.28_.29" class="_blanktarget">http://en.wikipedia.org/wiki/(#Parentheses_.28_.29</a> - URL',
//escaped brackets in url
@@ -94,8 +108,6 @@ class filter_urltolink_testcase extends basic_testcase {
'URL: www.moodle.org?u=1.23' => 'URL: <a href="http://www.moodle.org?u=1.23" class="_blanktarget">www.moodle.org?u=1.23</a>',
//escaped space in url
'URL: www.moodle.org?u=test+param&' => 'URL: <a href="http://www.moodle.org?u=test+param&" class="_blanktarget">www.moodle.org?u=test+param&</a>',
//odd characters in url param
'URL: www.moodle.org?param=:)' => 'URL: <a href="http://www.moodle.org?param=:)" class="_blanktarget">www.moodle.org?param=:)</a>',
//multiple urls
'URL: http://moodle.org www.moodle.org'
=> 'URL: <a href="http://moodle.org" class="_blanktarget">http://moodle.org</a> <a href="http://www.moodle.org" class="_blanktarget">www.moodle.org</a>',
@@ -125,11 +137,13 @@ class filter_urltolink_testcase extends basic_testcase {
'<br />This is some text. www.moodle.com then some more text<br />' => '<br />This is some text. <a href="http://www.moodle.com" class="_blanktarget">www.moodle.com</a> then some more text<br />',
//check we aren't modifying img tags
'image<img src="http://moodle.org/logo/logo-240x60.gif" />' => 'image<img src="http://moodle.org/logo/logo-240x60.gif" />',
'image<img src="www.moodle.org/logo/logo-240x60.gif" />' => 'image<img src="www.moodle.org/logo/logo-240x60.gif" />',
'image<img src="www.moodle.org/logo/logo-240x60.gif" />' => 'image<img src="www.moodle.org/logo/logo-240x60.gif" />',
'image<img src="http://www.example.com/logo.gif" />' => 'image<img src="http://www.example.com/logo.gif" />',
//and another url within one tag
'<td background="http://moodle.org">&nbsp;</td>' => '<td background="http://moodle.org">&nbsp;</td>',
'<td background="www.moodle.org">&nbsp;</td>' => '<td background="www.moodle.org">&nbsp;</td>',
'<form name="input" action="http://moodle.org/submit.asp" method="get">'=>'<form name="input" action="http://moodle.org/submit.asp" method="get">',
'<td background="https://www.moodle.org">&nbsp;</td>' => '<td background="https://www.moodle.org">&nbsp;</td>',
//partially escaped img tag
'partially escaped img tag &lt;img src="http://moodle.org/logo/logo-240x60.gif" />' => 'partially escaped img tag &lt;img src="http://moodle.org/logo/logo-240x60.gif" />',
//fully escaped img tag. Commented out as part of MDL-21183
@@ -151,17 +165,25 @@ class filter_urltolink_testcase extends basic_testcase {
//'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN http://www.w3.org/TR/html4/strict.dtd">'=>'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN http://www.w3.org/TR/html4/strict.dtd">'
);
$data = array();
foreach ($texts as $text => $correctresult) {
$data[] = array($text, $correctresult);
}
return $data;
}
/**
* @dataProvider get_convert_urls_into_links_test_cases
*/
function test_convert_urls_into_links($text, $correctresult) {
$testablefilter = new testable_filter_urltolink();
$testablefilter->convert_urls_into_links($text);
$this->assertEquals($correctresult, $text);
}
function test_convert_urls_into_links_performance() {
$testablefilter = new testable_filter_urltolink();
foreach ($texts as $text => $correctresult) {
$msg = "Testing text: ". str_replace('%', '%%', $text) . ": %s"; // Escape original '%' so sprintf() wont get confused
$testablefilter->convert_urls_into_links($text);
$this->assertEquals($text, $correctresult, $msg);
}
//performance testing
$reps = 1000;
$text = file_get_contents(__DIR__ . '/fixtures/sample.txt');
$time_start = microtime(true);
+1 -1
View File
@@ -30,7 +30,7 @@ require_once('import_outcomes_form.php');
$courseid = optional_param('courseid', 0, PARAM_INT);
$action = optional_param('action', '', PARAM_ALPHA);
$scope = optional_param('scope', 'global', PARAM_ALPHA);
$scope = optional_param('scope', 'custom', PARAM_ALPHA);
$PAGE->set_url('/grade/edit/outcome/import.php', array('courseid' => $courseid));

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