Compare commits

..

1100 Commits

Author SHA1 Message Date
moodler 367dfbd905 Updating for 1.7.2 release 2007-03-30 08:40:02 +00:00
toyomoyo b17e52001c fix for MDL-9021, missing add_to_log() call 2007-03-30 08:04:07 +00:00
gbateson 153fd875b5 fix the display of the special chars keypad (in JCloze and JQuiz) 2007-03-30 03:41:04 +00:00
moodler a43dc9df02 Automatic installer.php lang files by installer_builder (20070330) 2007-03-30 03:35:59 +00:00
toyomoyo f9f150290f adding a missing string 2007-03-30 02:27:27 +00:00
toyomoyo 8779cb8b46 changing help file as helen suggested 2007-03-30 02:23:19 +00:00
tjhunt d7378d19ec MDL-9094 - Penalty factor is meaningless for Essay questions, so remove it from the editing form. 2007-03-29 22:59:09 +00:00
skodak 6219022575 MDL-4313 LDAP doesn't properly escape extra quotes in course details; backported from MOODLE_18_STABLE 2007-03-29 21:57:11 +00:00
andreabix d9ec40f57f Fixed "Call to undefined function print_box()" 2007-03-29 18:42:20 +00:00
tjhunt ea790c7db1 MDL-6269, MDL-8958, MDL-8990 - Major fix to do with each attempt builds on last:
It used not to work with random questions, and there were problems with the computation of the grade, and regrading. Fix thanks to Paulo Matos, who not only fixed the bug and tested it, but was also incredibly patient waiting for me to have time to commit the changes to CVS.

This commit also includes a backport of a small state logic changes to the 1.7 stable branch.
2007-03-29 16:35:14 +00:00
csantossaenz f0403cbba2 Fixed problem with the popup window options. Now, they are saved when you update an SCORM activity and you change those options. 2007-03-29 08:18:35 +00:00
toyomoyo 88b5f9b726 fix for MDL-8983. hidden assignment requires a help file 2007-03-29 06:39:11 +00:00
toyomoyo 4d0ec2a375 file hiddenassign.html was added on branch MOODLE_17_STABLE on 2007-03-29 06:39:11 +0000 2007-03-29 06:38:35 +00:00
tjhunt 7cb4fb6a88 MDL-9061 - Only show global assign roles warning if you are assigning roles in the global context! Also, change name of admin menu entry to reduce confusion. Backported from MOODLE_18_STABLE. 2007-03-28 16:57:45 +00:00
csantossaenz 504317a519 Fixed backup problem for scorm module. Now, it includes needed files in moddata/scorm. even though the backup is done without user data and files 2007-03-28 15:04:57 +00:00
toyomoyo 110351a2a6 fix for MDL-7764, site role definitions not passed down 2007-03-28 07:50:35 +00:00
moodler 9599ee24b9 dos2unix and removed some XHTML brokenness 2007-03-28 02:47:12 +00:00
moodler 78baa1aaad Latest cornflower from Jeff for MDL-9009 2007-03-28 02:40:28 +00:00
moodler 1f4025a70e file hdbgend.jpg was added on branch MOODLE_17_STABLE on 2007-03-28 02:40:30 +0000 2007-03-28 02:24:36 +00:00
moodler 7e147392e1 file hdbg.jpg was added on branch MOODLE_17_STABLE on 2007-03-28 02:40:30 +0000 2007-03-28 02:24:35 +00:00
moodler b7f0d27621 file cornflower.css was added on branch MOODLE_17_STABLE on 2007-03-28 02:40:28 +0000 2007-03-28 02:24:34 +00:00
nicolasconnault 0428d11d76 MDL-9061 2007-03-27 07:28:20 +00:00
nicolasconnault b5a5a482bd MDL-9034: Brought lang file up to sync. The field_mapping string doesn't exist anywhere, it was a typo in enrol/database/config.html, and should have been remote_fields_mapping. 2007-03-27 05:46:11 +00:00
moodler 699768ebbc Merged fix for MDL-9052 from 1.8 2007-03-27 05:14:18 +00:00
moodler 6bd9066b7f Automatic installer.php lang files by installer_builder (20070327) 2007-03-27 03:52:08 +00:00
toyomoyo 6af4e1c8c4 applying inaki's patch for MDL-9012, course autocreation doesn't work in enrol/database 2007-03-26 06:50:56 +00:00
toyomoyo a5c41b6a5a fix for MDL-9010, course request button should not appear if it's disabled 2007-03-26 05:51:28 +00:00
toyomoyo 0bffc5576e fix for MDL-8336, lacking of viewuseractivitiesreport 2007-03-26 04:11:48 +00:00
toyomoyo 21982b71a6 fix for MDL-9035, backporting get_role_users() with hidden param 2007-03-26 02:11:45 +00:00
stronk7 41a5c34f91 Fix a problem with glossary not being able to sort by firstname.
Backported from MOODLE_18_STABLE
2007-03-24 01:00:29 +00:00
stronk7 d08b6757e6 One default was causing author view not being able to sortby firstname or lastname.
Backported from MOODLE_18_STABLE
2007-03-24 00:39:30 +00:00
skodak dfeb385672 MDL-9017 add mime type for ico files; backported from MOODLE_18_STABLE 2007-03-23 13:07:50 +00:00
toyomoyo b36064f742 fix for MDL-9016, clearing context cache after remove_course_content() 2007-03-23 07:20:16 +00:00
moodler 3dfb5e4379 Automatic installer.php lang files by installer_builder (20070323) 2007-03-23 03:42:39 +00:00
toyomoyo 7f9f7ec944 fix for MDL-8987, guests should not be allowed to view blogs flagged as site blogs 2007-03-23 01:42:19 +00:00
skodak 1828849b1e MDL-8347 Cannot create new glossary category if category with same name exists in another course on site; patch by Ray Lawrence; backported from MOODLE_18_STABLE 2007-03-22 22:45:51 +00:00
tjhunt ff7253c2c1 MDL-7241 - Manual grading report, sort by completed time didn't. Merged from MOODLE_16_STABLE. 2007-03-22 21:31:27 +00:00
moodler 52257f15d7 Automatic installer.php lang files by installer_builder (20070322) 2007-03-22 03:56:14 +00:00
toyomoyo 4c1af19cf6 MDL-7164, Mark Nielson's patch for remove_course_content not calling instance_destroy() 2007-03-22 02:09:54 +00:00
tjhunt 48a2b5ad42 MDL-7259 - Item analysis report does not use the right format_text settings. Merged from MOODLE_16_STABLE. 2007-03-21 23:25:23 +00:00
tjhunt 9e8cabd7eb Fix whitespace problems and Eclipse warnings in Item Analysis quiz report. 2007-03-21 23:04:27 +00:00
skodak e28cc09b24 MDL-7647 Broken links on confirmation email (or others) - patch by Paulo Matos 2007-03-21 21:57:00 +00:00
thepurpleblob 6282be2fd9 Check for empty text strings. Thanks to Quedoc. 2007-03-21 11:13:48 +00:00
toyomoyo e6b8565063 adding a string 2007-03-21 06:19:08 +00:00
toyomoyo bce83e8c76 backporting changes for MDL-8981, roles assigned at site level may result in a lot of default subscriptions 2007-03-21 06:05:13 +00:00
moodler e2bf5eec99 Automatic installer.php lang files by installer_builder (20070321) 2007-03-21 03:51:04 +00:00
toyomoyo 87ab475575 fix for MDL-7552, hidden assignments for 1.7 2007-03-21 00:48:41 +00:00
tjhunt 9022696d6d MDL-8978 - Regression from MDL-6386. Merged from MOODLE_16_STABLE. 2007-03-21 00:13:33 +00:00
tjhunt 418cc2032b MDL-8299 - Wrong capability on review.php. 2007-03-20 22:44:32 +00:00
tjhunt 25769ccd61 MDL-8140 Other units disappear from the editing form when there is no unit with multiplier 1. 2007-03-20 22:22:00 +00:00
skodak d0e6183436 MDL-8975 fix parameter handling in repository plugin; backported from MOODLE_18_STABLE 2007-03-20 19:47:58 +00:00
skodak ca3c1ddf40 SC#374 removing obsoleted utf8migration code 2007-03-20 16:24:11 +00:00
tjhunt ec9f7c117e MDL-6386/MDL-6462 - yet more special character issues with multianswer. I think I have got them all this time. Backported from HEAD. 2007-03-20 14:31:26 +00:00
moodler 7f0984c1f3 Automatic installer.php lang files by installer_builder (20070320) 2007-03-20 03:36:20 +00:00
stronk7 dc8207c52a small typo in var name
Merged from MOODLE_16_STABLE
2007-03-19 16:11:01 +00:00
skodak 4419fe33a5 MDL-8759 reverted + backported fix for cron logs 2007-03-19 10:11:27 +00:00
toyomoyo ba0dabcc31 backporting coursemanagers to 1.7 2007-03-19 06:40:59 +00:00
martinlanghoff 3810ca294d Auto-linking filters: fix serious caching bug in forum mailouts
Autolinking of glossaries, activity, resources and wiki names were using a
trivial single-entry cache implemented with static vars. The cache was _not_
keyed on course.

This bug was visible during forum_cron() which walks many courses. The cache
would get "stuck" on the first course that had something to put in the cache.
All mailouts from there onwards would autolink to stuff in the wrong course.
2007-03-19 06:13:13 +00:00
toyomoyo f493763e04 backporting MDL-8578, students can post and reply in news forum 2007-03-19 02:47:30 +00:00
toyomoyo 3140dc600d backporting MDL-8578 students can post and reply in news forums 2007-03-19 02:46:33 +00:00
moodler 30739f6651 Automatic installer.php lang files by installer_builder (20070318) 2007-03-18 03:29:57 +00:00
poltawski 071d36c917 MDL-6386 - Regression from MDL-6462, lost stripslashes in CLOZE question,
thanks to Joseph Joseph Rézeau  for his attention to this issue
Backported from MOODLE_18_STABLE
2007-03-17 22:57:06 +00:00
pichetp 0540d3479c adding </p> lines 110,112 2007-03-16 22:34:06 +00:00
skodak 721a2de984 MDL-8883 fixed double backslashes problem in filter settings; backported from MOODLE_18_STABLE 2007-03-16 22:19:07 +00:00
mark-nielsen 78d68eb5b2 Was missing context in has_capability() call. This was found in MDL-8196 2007-03-16 03:44:04 +00:00
toyomoyo 5c5cb3ec7e back porting changes for MDL-8820, users with moodle/user:editprofile assigned at user context should be able to edit them 2007-03-16 01:35:34 +00:00
bobopinna b06855297c Changed coursepacket string with package 2007-03-15 20:42:41 +00:00
stronk7 dbd0f586a2 Fix small bug only reproduced in tests about changing field names and
amldb_field object becoming modified. Novice OOP bug :-(
2007-03-15 19:58:47 +00:00
bobopinna eb2a36fb55 Fixed the problem with asset and review mode checkbox in view.php 2007-03-15 19:35:25 +00:00
stronk7 a45296043e Testing comments and default clauses containing chars to be escaped. 2007-03-15 19:13:17 +00:00
stronk7 4bf57cbfa6 DB escaping comments. MDL-8918 2007-03-15 18:59:02 +00:00
bobopinna 43d78a231d Removed the last word course in scorm module 2007-03-15 17:40:45 +00:00
bobopinna 45d44e7e80 Fixed a problem with external packages 2007-03-15 15:54:36 +00:00
bobopinna ff6bc9fbc2 Fixed bug MDL-8161 also here 2007-03-15 15:49:33 +00:00
bobopinna 4bdf76ae71 removed a couple of debugging print 2007-03-15 15:25:51 +00:00
tjhunt 97feab527e MDL-6462 - Cloze (multianswer) question special character issues. Merged from MOODLE_16_STABLE. 2007-03-15 12:59:20 +00:00
tjhunt 903f3f54ed Fix notice. 2007-03-15 12:53:07 +00:00
bobopinna a1fec0e3ce fixed a typo (ThaNck Andrea) 2007-03-15 10:49:39 +00:00
toyomoyo e07f4ac436 fix for MDL-8908, draft blogs should not be visible 2007-03-15 06:14:08 +00:00
toyomoyo 25a37d70ff fix for MDL-7939, teachers, non-editting teachers and course creators should see hidden courses 2007-03-15 04:24:28 +00:00
moodler 5446beaa73 Automatic installer.php lang files by installer_builder (20070315) 2007-03-15 03:32:10 +00:00
tjhunt cb6281b339 MDL-8127 - bad use of DESCRIPTION constant in quiz module causes upgrade to fail. Thanks to Pavel Krejci for the fix. Merged from MOODLE_17_STABLE. 2007-03-14 21:24:54 +00:00
tjhunt 3696a3723e Oops, reverting. Eloy had already fixed it. 2007-03-14 21:10:59 +00:00
tjhunt 8fa821d514 MDL-8232 - can't use = on TEXT colums with MSSQL - was breaking numerical question type upgrade. 2007-03-14 21:08:23 +00:00
poltawski 9bb4b97e3d Fixed check for section for MDL-8360, merged from MOODLE_18_STABLE 2007-03-14 16:35:10 +00:00
thepurpleblob 87c39bf549 Fixed true/false bug due to new 'correctanswer' field. 2007-03-14 15:15:27 +00:00
ethem 91f54796bd Code cleanup 2007-03-14 13:43:19 +00:00
poltawski fd52f257ff MDL-8360 - Currently can't bookmark admin searches, so disable the ability to bookmark
the search page
2007-03-14 11:50:53 +00:00
skodak 94c9630d78 MDL-8897 fixed shell commands in tex and algebra filters 2007-03-14 11:10:22 +00:00
toyomoyo 84718c0056 fix for MDL-8885, teachers should not be able to hide courses if they can not view hidden courses 2007-03-14 04:34:54 +00:00
moodler 0a16d1722a Automatic installer.php lang files by installer_builder (20070314) 2007-03-14 03:50:40 +00:00
toyomoyo abb8f34ecf MDL-8885, do not show bulk messaging option if user has no capability 2007-03-14 01:52:36 +00:00
toyomoyo 8af16cbfdb MDL-8885 editting teachers should be able to see all messages in a course 2007-03-14 01:39:43 +00:00
bobopinna 54c5ce36db Fixed bug MDL-8725
Just a typo in regular expression
2007-03-13 21:04:44 +00:00
tjhunt 0b17d072cf Eliminate bizarre use of function_exists. 2007-03-13 17:42:51 +00:00
tjhunt cd4469af52 Entity decoding only done the right number of times on import, not once too often.
Also, fix a notice and and Eclipse warning.
Backported from HEAD.
2007-03-13 16:27:52 +00:00
tjhunt 01d0a4f289 Use the right string processing when outputting question text on import/export. Backported from HEAD 2007-03-13 16:24:36 +00:00
tjhunt 8f8f6e7c92 Use the right string processing functions when outputting question names. Backported from HEAD 2007-03-13 16:21:07 +00:00
poltawski 90fe299739 Regression using the wrong config variables, see MDL-8257 2007-03-13 14:31:56 +00:00
moodler bceb6eb9d8 MERGED MDL-8872 from 1.8 removed "course" mentions from scorm interface 2007-03-13 08:47:52 +00:00
toyomoyo 7989f2ee28 allow guests to see the reply link 2007-03-13 04:46:55 +00:00
toyomoyo 78a0f36730 fixing a warning 2007-03-13 04:33:54 +00:00
toyomoyo b2a48214f8 fix for MDL-8864, reply link bug for users with replypost set to prevent 2007-03-13 04:28:39 +00:00
toyomoyo 76d9513015 fix for MDL-8767, when doing forum_cron, loop by user instead of post, backporting to 1.7 2007-03-13 03:38:06 +00:00
moodler 4d89cba698 Automatic installer.php lang files by installer_builder (20070313) 2007-03-13 03:33:55 +00:00
moodler e8189c3074 fixing a broken has_capability call 2007-03-13 00:54:25 +00:00
thepurpleblob af17ae8a1b MDL-8857
Make numerical and essay question formats more consistent.
2007-03-12 16:29:45 +00:00
skodak 8626d4bc24 MDL-5229 and MDL-6196 adding gb18030 mime header encoding; partial backport from MOODLE_18_STABLE 2007-03-12 08:45:02 +00:00
moodler f0b99a9fec fix for forceloginforprofile for parents 2007-03-12 01:20:32 +00:00
skodak fcb9e23701 MDL-8849 use proper value quoting; backported from MOODLE_18_STABLE 2007-03-11 20:01:15 +00:00
moodler ab496d313c Merged from head MDL-8842 2007-03-10 14:51:51 +00:00
moodler 0e53408ad7 Automatic installer.php lang files by installer_builder (20070310) 2007-03-10 03:29:07 +00:00
tjhunt 4b1f48e2ae MDL-8177 - Random questions selected deleted questions. Backported from MOODLE_18_STABLE. 2007-03-10 00:34:35 +00:00
pichetp 5530732c16 merge from 18 merged 2007-03-09 06:02:16 +00:00
moodler 5b4e26864a Automatic installer.php lang files by installer_builder (20070309) 2007-03-09 03:46:00 +00:00
moodler 1081ccc99b back porting MDL-8681 course import creates duplicate role into 1.7 2007-03-09 02:41:48 +00:00
skodak c0ad0e5a98 MDL-8814 fixed typo; backported from MOODLE_18_STABLE 2007-03-08 15:24:44 +00:00
moodler b6db8ab49d fix for MDL-7552, backporting hidden assignments (teacher) for 1.7 2007-03-08 05:25:42 +00:00
moodler ce455a9a79 merged do not force parents to log in 2007-03-07 06:25:36 +00:00
moodler b6d3fccd59 Merged fixes for MDL-8785 from 1.8
BIG SPEED INCREASE!!!!!!
2007-03-07 05:00:05 +00:00
moodler 78be3cdb8b backporting code to fix hidden teacher upgrade 2007-03-07 01:38:41 +00:00
tjhunt 837588a772 MDL-8349 - responses not being filtered in history display. Backported from MOODLE_18_STABLE. 2007-03-06 18:00:39 +00:00
nicolasconnault f398c77963 MDL-8759 - Unset $USER 2007-03-06 06:09:44 +00:00
nicolasconnault 2fd2fdbdb9 MDL-8771 - Restricted has_capability() sanity checks to DEVELOPER debug mode 2007-03-06 05:29:00 +00:00
moodler 92d3d576fb fix for MDL-8589, found more than one record in get_record_sql 2007-03-06 01:37:54 +00:00
moodler ef06f7f85b Added new string locations to 1.7 2007-03-05 12:28:58 +00:00
moodler e7a5ad8da9 Fix for MDL-8318, show cost info on info page 2007-03-05 05:41:21 +00:00
moodler d8882ec822 Automatic installer.php lang files by installer_builder (20070304) 2007-03-04 03:41:18 +00:00
gbateson e21f0b1042 set JQuiz[7]=false, to fix checking answers for JQuiz Hybrid questions when in ShortAnswer mode 2007-03-04 01:19:42 +00:00
skodak b6057d4afa MDL-8733 fixed approving logic when editing; merged from MOODLE_16_STABLE 2007-03-03 12:25:40 +00:00
pichetp bf18b2aa09 ggrading small numbers MDL-8478 merge from 18_STABLE 2007-03-02 21:14:48 +00:00
skodak db365a121d sesskey added to logout.php MDL-8727 ; backported from HEAD 2007-03-02 17:05:25 +00:00
moodler d243cd17c5 Commenting this out for now for performance reasons, should be fixed soon!
See MDL-8385
2007-03-02 10:10:52 +00:00
stronk7 01be5c29cc Skipping thousands of require_once() calls because PHP5
is really slow (and heavy) with them. MDL-8700
2007-03-02 09:39:50 +00:00
moodler 1ac2df9163 adding backward compatibility for question restore 2007-03-02 08:01:47 +00:00
nicolasconnault 800fa68224 MDL-8633 - Initialised $output at head of function. 2007-03-02 05:48:03 +00:00
moodler 4876f94726 should be manualcomment 2007-03-02 05:20:39 +00:00
moodler c5c47d0c43 fix for MDL-8491, feed back for essay questions not backed up 2007-03-02 04:51:31 +00:00
mjollnir_ 731f877fdb Merged from MOODLE_16_STABLE: fixing bug MDL-8651: import course data should clean up after itself 2007-03-02 01:43:15 +00:00
moodler acb417721d Fixed unenrol_student MDL-8591 2007-03-01 08:04:03 +00:00
moodler 60f8f5bf42 Don't redirect guests to mymoodle page! MDL-8594 2007-03-01 07:56:24 +00:00
nicolasconnault df18c3141e MDL-8693 Fixed the double-equal typos (2) 2007-03-01 07:28:20 +00:00
defacer 4edc434002 Merging from MOODLE_16_STABLE:
Fix for MDL-8515: Prefixing chat messages with a slash should not hide the
user's name unless it's a special command we handle.

I completely removed the emoticon handling case, but it seems like it was
not needed for a long time now? Emoticons work just fine without it.
2007-03-01 07:03:29 +00:00
martinlanghoff 3ce66e9f7b MDL-7385 - stats_cron_daily() - If a module is missing, continue processing 2007-02-28 03:04:05 +00:00
martinlanghoff fb3501f935 Fixing MDL-6795 - Stats never runs. stats_monthly table gets very full - avoid double tz calculations in stats_getmidnight() 2007-02-28 02:51:11 +00:00
martinlanghoff 757d66b504 Stopping warning and possible errors in graphlib.php caused by bugs in statsgraph.php
Ported from LDC (1.5) branch


Author: Andrew Walbran <andrew.walbran@catalyst.net.nz>
2007-02-28 00:32:16 +00:00
martinlanghoff 9861a3997a hotpot: Fixing db upgrade script
Note MySQL upgrade (earlier on by version)


Author: Andrew Walbran <andrew.walbran@catalyst.net.nz>
2007-02-28 00:28:39 +00:00
martinlanghoff e05e5d132e (Fixing upgrade script) Only try to disable lams if it is installed
Author: Andrew Walbran <andrew.walbran@catalyst.net.nz>
2007-02-28 00:25:46 +00:00
martinlanghoff 6488b3be2e blocks: Making UTF8 migration script work with blocks not on course page, etc.
Author: Andrew Walbran <andrew.walbran@catalyst.net.nz>
2007-02-28 00:10:12 +00:00
martinlanghoff 748e20f006 Fixing 1.5->1.7 upgrade bug (get_courses was used unnecessarily in upgrade process, and relies on roles)
Author: Andrew Walbran <andrew.walbran@catalyst.net.nz>
2007-02-28 00:07:22 +00:00
stronk7 da0dcaef1b Fixing RSS link to source. http://moodle.org/mod/forum/discuss.php?d=65762 2007-02-27 18:19:47 +00:00
stronk7 9babd808f8 Fix some warnings generated after enrol because of the LAMS module. MDL-8078 2007-02-27 17:39:48 +00:00
defacer 57c07037a7 Not needing this anymore, we now have Moodle Docs. 2007-02-27 14:40:55 +00:00
defacer 2eb862ba18 Merging from MOODLE_16_STABLE:
Fix for MDL-4701: Event URLs now include anchor so that the event is immediately visible.
2007-02-27 14:30:33 +00:00
defacer e5c482b517 Merging from MOODLE_16_STABLE:
Bugfix: skodak's fix for MDL-5991 is needed here as well.
2007-02-27 13:58:56 +00:00
defacer 61c7621b80 Changing email addresses that caught my eye in the comments. 2007-02-27 13:48:49 +00:00
defacer 595687a2f1 Fix for MDL-8402:
$CFG->calendar_weekdays wasn't saved correctly and misbehaved.

I took the opportunity to rewrite a little HTML too.
2007-02-27 12:17:58 +00:00
moodler 6e2e65e499 fixing wrong capability check 2007-02-27 05:48:15 +00:00
moodler 997a36bb09 fix for MDL-8666, groups import broken 2007-02-27 05:42:01 +00:00
moodler 8b03cdac79 fixing typos 2007-02-27 04:38:05 +00:00
defacer 6b0bfc914c Bugfix: $CFG->calendar_adminseesall was not working at all, Moodle behaved
as if it were always on. Reported at http://moodle.org/mod/forum/discuss.php?d=65500.
2007-02-27 00:33:18 +00:00
moodler 9f5ceda372 Automatic installer.php lang files by installer_builder (20070226) 2007-02-26 03:39:18 +00:00
mjollnir_ d550a1409b fixing MDL-8662 2007-02-26 00:18:02 +00:00
defacer e56a129d56 Merged from MOODLE_16_STABLE:
Fix for MDL-4940: Social Activities block disappears when editing course settings.
2007-02-24 23:24:43 +00:00
moodler 9a8d870765 Automatic installer.php lang files by installer_builder (20070224) 2007-02-24 03:37:11 +00:00
mark-nielsen be724f381e [Fixed] MDL-8637: lesson_answers answer field can be null 2007-02-23 17:27:13 +00:00
thepurpleblob c6a0fc48df MDL-8602
Don't count modules where course=0 (ie, they must exist in real courses)
2007-02-21 14:57:18 +00:00
tjhunt 61e6471fce Another wretched adslashes problem. Roll on placeholder. Thanks to Howard Miller. 2007-02-20 15:17:45 +00:00
moodler 3ad11e88b2 fix for MDL-8568, users in modules with sepearate groups can not revert to all participants mode 2007-02-20 03:13:37 +00:00
moodler 156f63c804 applying nick's patch to MDL-8534, typo in restorelib.php 2007-02-20 01:02:32 +00:00
lamsdev ca9de648a8 Changed from using lib/soap/nusoap.lib library directly to using lib/soaplib.php.
Fix for MDL-6224
2007-02-20 00:34:57 +00:00
stronk7 66d6716a02 Changing iso-8859-1 encoding of excel files to windows-1252. It adds support for
some more (a few) characters. MDL-7993

Merged from MOODLE_16_STABLE
2007-02-19 23:21:33 +00:00
stronk7 19906f7074 Backporting excellib with support to $CFG->excelisofiles to 17_STABLE.
MDL-7993. http://moodle.org/mod/forum/discuss.php?d=53302
2007-02-19 22:26:54 +00:00
skodak b8dececceb MDL-8570 outdate flv player; backported from HEAD 2007-02-19 13:59:12 +00:00
ethem 068be51fa0 Removed unnecesary code. 2007-02-19 12:01:54 +00:00
tjhunt 85a430d5be MDL-8145 - Add more options to the add random questions dropdown. 2007-02-19 04:24:09 +00:00
moodler 3b00cdbff0 Automatic installer.php lang files by installer_builder (20070219) 2007-02-19 03:33:45 +00:00
koenr 9e0bad4909 MDL-8400 Changed currency of peru to Nuevo Sol 2007-02-17 23:37:03 +00:00
tjhunt b430f84c4c MDL-8154 - Typo in course search code. Fix thanks to Anthony Borrow. 2007-02-17 17:16:41 +00:00
vyshane 014161956c Fix for MDL-7796 "Default permissions for Course Creators are too permissive". Changed some permissions from allow to inherit. Changed course deletion checks to allow course creators to delete courses. 2007-02-16 08:15:02 +00:00
moodler 5f842b21bd Automatic installer.php lang files by installer_builder (20070216) 2007-02-16 03:38:46 +00:00
moodler ca3a97b8c1 adding missing capability check for manage roles page 2007-02-16 02:39:28 +00:00
moodler 5b6af116c1 fixed wrong context, it should be possible to manage a single block 2007-02-16 01:24:30 +00:00
skodak a9fd5db642 MDL-7722 fixed wrong cleaning in backup paths; backported from HEAD 2007-02-15 10:06:10 +00:00
moodler 2f26b36af3 Merged environment checks during upgrade from 1.8 and 1.9 2007-02-15 06:59:32 +00:00
moodler c2fe49c5e7 Added new strings for upgrade environment checks. MDL-8527 2007-02-15 06:52:34 +00:00
vyshane 7df5ccc871 Fix for MDL-8072 - 'In the "Quiz" activity with the "Adaptive Mode" on, the "Multiple Choice" a message informing the student was penalized with the Penalty Factor is displayed when the answer given by the student is correct.' 2007-02-15 06:05:01 +00:00
stronk7 cf507be4c0 PHP 4 assignment is by value so course_header (containing edited names)
wasn't being modified. MDL-8298
2007-02-14 23:50:04 +00:00
skodak 9e8bc0e590 MDL-8268 fixed block get_string, patch by Mark Nielsen; backported from HEAD 2007-02-14 23:02:15 +00:00
skodak b50965414e MDL-8268 fixed get_user_capability_course(), patch by Mark Nielsen; backported from HEAD 2007-02-14 22:51:17 +00:00
skodak f2592eb65e MDL-8469 increase memory limit in cron due to changed calculation of used memory in PHP 5.2.x - the real memory useage is the same, but the reported size of used memory is now more accurate; backported from HEAD 2007-02-14 21:00:58 +00:00
vyshane e9d837a1a2 Fix for MDL-3681 "Duplicate Message-IDs in Forum mail". 2007-02-14 07:20:18 +00:00
moodler a650e7bb3a Automatic installer.php lang files by installer_builder (20070214) 2007-02-14 03:49:50 +00:00
vyshane 974dde3777 Simple fix for MDL-3583 "tabs text confusing". 2007-02-14 02:54:48 +00:00
vyshane 0ba544e97d Fix for MDL-3370. Forum: Unread messages shouldn't link to read. 2007-02-14 01:57:34 +00:00
stronk7 72395f4d2a Some minor js problems. MDL-7811 and MDL-6481
Merged from MOODLE_16_STABLE
2007-02-13 23:39:21 +00:00
watcanz 74780decb8 Corrected for 1.6.4 2007-02-13 21:05:41 +00:00
skodak f167056a18 MDL-8490 Glossary student not being able to edit entries; backported from HEAD 2007-02-13 19:29:51 +00:00
nfreear 375016e822 Fix for MDL-8507 "Local language pack-name can appear in language code" (merge from HEAD.) 2007-02-13 13:40:58 +00:00
nfreear ec6c6dae3f Fixes bug MDL-7257, "stylesheet bug: text color undefined" (merged from HEAD). 2007-02-13 12:12:36 +00:00
skodak 463b6cbe64 MDL-8498 Assignment - Notification of feedback e-mails to students not being sent 2007-02-13 08:41:26 +00:00
moodler 08f4e03f53 FIxes so that no-one can "login as" users who have "doanything". MDL-8411 2007-02-13 08:30:25 +00:00
vyshane 593d5992c0 Fix for MDL-8431 "In qanda forum: Undefined property: object::$id" 2007-02-13 05:24:32 +00:00
moodler 671a35735b Automatic installer.php lang files by installer_builder (20070213) 2007-02-13 03:51:43 +00:00
toyomoyo c7bbf43c12 fix for MDL-8480, external db user lang sync problem 2007-02-13 03:09:01 +00:00
vyshane 8dd4116941 Added get_my_courses() to forum_get_readable_forums(). Thanks Eloy for patch :-) This is related to MDL-8385. See tracker for discussion. 2007-02-13 02:22:05 +00:00
toyomoyo 821a2a750b fix for MDL-8358, wrong count for not graded assignments 2007-02-12 06:49:37 +00:00
moodler 4351ce8a6b Automatic installer.php lang files by installer_builder (20070212) 2007-02-12 03:51:39 +00:00
vyshane d97feb678a Fix for MDL-8459 (Indent left bug). 2007-02-09 05:15:52 +00:00
toyomoyo 1f49b80193 fix for MDL-8399, can not unassign admin at course level 2007-02-09 03:08:17 +00:00
vyshane 2edb2fbaf1 Fixes for MDL-8420 and MDL-8385. 2007-02-09 01:35:46 +00:00
vyshane 7aa8c1329f Small cleanup 2007-02-09 01:27:34 +00:00
stronk7 04f64ffbe0 Limit table comments to 60cc for MySQL. MDL-7765 2007-02-09 00:32:32 +00:00
stronk7 bdc1bb3358 Delete backup records on course delete. MDL-8314
Merged from MOODLE_16_STABLE
2007-02-09 00:11:45 +00:00
vyshane 8e42353e0e Added new function get_all_subcategories() 2007-02-08 08:04:35 +00:00
vyshane 1ab3830750 Removed IE-specific hack for resource deletion. 2007-02-08 05:34:44 +00:00
vyshane 45ce915b79 Updated YUI Library to 0.12.2. This seems to have fixed MDL-8287. 2007-02-08 05:30:18 +00:00
vyshane 2a28db59c3 file yahoo-dom-event.js was added on branch MOODLE_17_STABLE on 2007-02-08 05:30:57 +0000 2007-02-08 05:19:48 +00:00
vyshane f18d2309fb file utilities.js was added on branch MOODLE_17_STABLE on 2007-02-08 05:30:52 +0000 2007-02-08 05:19:48 +00:00
vyshane bc516d11c1 file README was added on branch MOODLE_17_STABLE on 2007-02-08 05:30:56 +0000 2007-02-08 05:19:48 +00:00
vyshane 75ee3dfa69 file README was added on branch MOODLE_17_STABLE on 2007-02-08 05:30:51 +0000 2007-02-08 05:19:48 +00:00
vyshane 7dac46e80c file tabview.js was added on branch MOODLE_17_STABLE on 2007-02-08 05:30:41 +0000 2007-02-08 05:19:47 +00:00
vyshane 23cbd7e82b file tabview-min.js was added on branch MOODLE_17_STABLE on 2007-02-08 05:30:40 +0000 2007-02-08 05:19:47 +00:00
vyshane e2612a5522 file tabview-debug.js was added on branch MOODLE_17_STABLE on 2007-02-08 05:30:40 +0000 2007-02-08 05:19:47 +00:00
vyshane 41fd2c3924 file reset-fonts-grids.css was added on branch MOODLE_17_STABLE on 2007-02-08 05:30:37 +0000 2007-02-08 05:19:47 +00:00
vyshane 7020a2ac33 file border_tabs.css was added on branch MOODLE_17_STABLE on 2007-02-08 05:30:42 +0000 2007-02-08 05:19:47 +00:00
vyshane cf3f87a641 file README was added on branch MOODLE_17_STABLE on 2007-02-08 05:30:39 +0000 2007-02-08 05:19:47 +00:00
vyshane 2500eb7ead file README was added on branch MOODLE_17_STABLE on 2007-02-08 05:30:37 +0000 2007-02-08 05:19:47 +00:00
thepurpleblob 0115262560 MDL-8349 Some of the overidden methods had got out of sync with parent class. 2007-02-07 11:34:53 +00:00
thepurpleblob 7c944b7cbe MDL-8450 Added support for including question categories in a quiz export. Also a bit of format tidy up and fix a misshandled sesskey. 2007-02-07 10:27:13 +00:00
thepurpleblob e264752381 MDL-8450 Added support for including question categories in a quiz export. 2007-02-07 10:12:36 +00:00
thepurpleblob 075f61025c MDL-8450 Added support for including question categories in a quiz export. 2007-02-07 09:56:57 +00:00
vyshane 085fecaf86 Changed require to require_once to fix function redeclaration error. 2007-02-07 07:08:02 +00:00
moodler 970d2432d7 Automatic installer.php lang files by installer_builder (20070207) 2007-02-07 03:34:57 +00:00
stronk7 0d8057b119 Fixed two schema-fk typos. MDL-8427 2007-02-06 15:50:03 +00:00
stronk7 2786c8fd73 Generators can use ddllib.php stuff (I missed this some days ago) 2007-02-05 17:01:37 +00:00
moodler e1555199db Merged site name apostrophe problem in MDL-8416 2007-02-05 06:53:22 +00:00
stronk7 6defede491 Fixing one little-little bug about user->ajax being nullable. MDL-8421 2007-02-04 20:05:09 +00:00
gbateson 47e1151f92 allow empty JQuiz questions (which have at least one answer) 2007-02-03 01:12:05 +00:00
gbateson e8dc4c6cb1 omit empty answers from JQuiz import 2007-02-03 00:35:54 +00:00
vyshane db8598ca48 Made default for forceloginforprofiles to be 1. Related to MDL-8385. 2007-02-02 08:13:07 +00:00
vyshane b0252a5c00 Fix for MDL-8385. 2007-02-02 07:55:30 +00:00
moodler 47cc07674c Added some help link text for Moodle 1.7 MDL-8378 2007-02-02 06:22:47 +00:00
moodler 29f26fd747 Added missing help file to MOodle 1.7 MDL-8378 2007-02-02 06:16:48 +00:00
moodler 9c336062b7 file switchrole.html was added on branch MOODLE_17_STABLE on 2007-02-02 06:16:48 +0000 2007-02-02 06:15:39 +00:00
mark-nielsen 594f4f574a The main layout table was left aligning in safari. Now matches that in action/continue.html 2007-02-02 03:57:13 +00:00
moodler 3802128b59 Automatic installer.php lang files by installer_builder (20070202) 2007-02-02 03:48:09 +00:00
mark-nielsen 657ed64b03 BugFix for MDL-8390: Changing nullability of field useranswer on table lesson_attempts to null. 2007-02-02 03:42:26 +00:00
mark-nielsen b39a349ec4 BugFix for MDL-8375:
* Student answer and teacher response are now cleaned using PARAM_RAW and are always passed through s() before printing
2007-02-02 02:16:59 +00:00
stronk7 8c30f7fc26 Delete some non cros-db boolean uses from queries, delegating them to PHP. MDL-8164 2007-02-01 23:53:47 +00:00
stronk7 81de99d733 Adding missing tags in code. Credit goes to Greg Lyon. MDL-8383. 2007-02-01 22:35:06 +00:00
moodler 7235680eed $switchroleactive is now passed recursively so switchroles actually works now :-/ 2007-02-01 08:11:32 +00:00
moodler ce5a0d7b65 Automatic installer.php lang files by installer_builder (20070201) 2007-02-01 03:31:34 +00:00
skodak 89719f7030 MDL-8366 not possible to use old en with iso-8859-1 encoding in 1.7 2007-01-31 23:17:51 +00:00
skodak 1d03d41680 MDL-8376 Course list option missing in frontpageloggedin when there are more than 200 courses; backported from HEAD 2007-01-31 22:38:45 +00:00
stronk7 de161d3c49 Restoring one deleted by error }. Grrr. 2007-01-31 18:44:57 +00:00
stronk7 509b0c983d Changing nullability of field response on table lesson_answers to null.
Versions in 17_STABLE are the same, so no problems. MDL-8351
2007-01-31 18:36:53 +00:00
thepurpleblob 877d109b01 MDL-8342 PHP5 migration thing causing string offset fatal error when data not present in XML file. Added some checks. 2007-01-30 15:12:49 +00:00
thepurpleblob dc5ea21614 Changed remark about additional formats to direct to Modules & Plugins database. 2007-01-30 14:03:33 +00:00
thepurpleblob 4a08d3bac9 Output was missing utf8 meta tag. 2007-01-30 13:54:43 +00:00
stronk7 f555bfac15 nothing interesting, just a comment. 2007-01-30 00:21:22 +00:00
stronk7 5fb8a656c1 Applying new rs_xxx() functions everywhere. MDL-8134 2007-01-29 23:55:42 +00:00
stronk7 bfc8a717df Applying new rs_xxx() functions everywhere. MDL-8134 2007-01-29 23:44:58 +00:00
stronk7 b65b99cab8 Applying new rs_xxx() functions everywhere. MDL-8134 2007-01-29 22:14:36 +00:00
koenr 296f9b6a82 typo MDL-8350 2007-01-29 20:41:08 +00:00
stronk7 7409a0e99a Applying new rs_xxx() functions everywhere. MDL-8134 2007-01-29 19:14:49 +00:00
tjhunt f08318d7fb Fix type on close tag. 2007-01-29 16:22:29 +00:00
stronk7 890cdce488 Applying new rs_xxx() functions everywhere. MDL-8134 2007-01-29 12:07:14 +00:00
stronk7 5a739340da Applying new rs_xxx() functions everywhere. MDL-8134 2007-01-29 11:20:44 +00:00
stronk7 751ad21e9c Applying new rs_xxx() functions everywhere. MDL-8134 2007-01-29 11:05:15 +00:00
stronk7 a9a72d76f9 Applying new rs_xxx() functions everywhere. MDL-8134 2007-01-29 10:53:14 +00:00
stronk7 31e0c05036 Applying new rs_xxx() functions everywhere. MDL-8134 2007-01-29 10:44:45 +00:00
vyshane 2a0d5695b3 Made non-AJAX deletion of resources only apply to IE browsers. 2007-01-29 07:54:48 +00:00
vyshane cf9281719f Fix for MDL-7847. 2007-01-29 07:36:07 +00:00
mark-nielsen 8cde300d8c Fix for MDL-8137: turned off autocomplete for all forms for which students enter data. 2007-01-29 06:32:17 +00:00
vyshane 50d1bd1c2a Fix for MDL-7415. 2007-01-29 06:00:23 +00:00
vyshane 58cac329b7 Temporarily disabling ajax for module/resource deletions. Related to MDL-8287. 2007-01-29 02:21:12 +00:00
stronk7 011dd960f4 This seems to be the damned line! db must be CFG 2007-01-29 01:11:43 +00:00
stronk7 0389288693 First real test of the new rs_fetchXXX() functions. Applying it
to get_my_courses(). MDL-8134
2007-01-29 00:15:14 +00:00
stronk7 e5b094bed6 Added Oracle DIRTY HACK to both rs_fetchXX functions.
Detecting of EOF in rs_fetch_record()
Big improvement of rs_fetch_next_record() by using FethRow()
with speeds near native fields[]. MDL-8134
2007-01-28 23:08:14 +00:00
skodak 4a0d23143a MDL-6128 special chars and messaging system; backported from HEAD 2007-01-28 21:46:14 +00:00
stronk7 bdd5bba791 Initial commit of the new rs_XXX() functions to fetch, advance and close
ADOdb recordsets in a standard way. Not finished yet but I need them in CVS.
MDL-8134
2007-01-28 20:10:33 +00:00
stronk7 1159927f08 Backported fix for annoying typo from HEAD. 2007-01-28 18:30:42 +00:00
gbateson b9a69f5b1f correct the display of the "Update this Hot Potatoes Quiz" button in Danish (da_utf8) and German (de_utf8) - see mdl-8322 2007-01-28 00:02:55 +00:00
moodler 947e63afb8 Automatic installer.php lang files by installer_builder (20070127) 2007-01-27 03:20:44 +00:00
skodak d221dc7482 MDL-8308 placement of load_all_capabilities() in login page; backported from HEAD 2007-01-26 21:15:25 +00:00
stronk7 14da408e08 Adding two helper functions and modify upgrade to
work properly under MSSQL and Oracle. MDL-8303
2007-01-26 20:44:57 +00:00
stronk7 4ca9e54f7f Oracle doesn't like ; at the end of execute_sql() 2007-01-26 19:25:53 +00:00
vyshane 154877b2ff Some small cleanups. 2007-01-25 04:28:07 +00:00
vyshane 303c064224 Commented out text node addition while moving resources. No idea why it was needed? This was adding extra vertical spaces and screwing up the display after a move in IE 7. 2007-01-24 05:58:14 +00:00
gbateson e521d0f799 added "print_standard_coursemodule_settings" (group and visible settings) to add/update HotPot page, "mod.html" 2007-01-24 02:52:14 +00:00
gbateson 4d4b237efb remove DB dependant code and references to NULL in field values mdl-8169 2007-01-24 02:44:23 +00:00
vyshane 727929f1fa Fixes for MDL-6966. 2007-01-23 06:10:48 +00:00
moodler 26e8b7a96e Fixed site identifier 2007-01-23 04:59:22 +00:00
moodler 4d59b9d9fa Automatic installer.php lang files by installer_builder (20070123) 2007-01-23 03:26:10 +00:00
stronk7 7c018f428c Changing some stripslashes() to stripslashes_safe() because it
was causing some real backslashes to be lost in some qtypes. MDL-8217
2007-01-22 23:13:47 +00:00
moodler 3c3ff8ace3 Automatic installer.php lang files by installer_builder (20070119) 2007-01-19 03:22:34 +00:00
bobopinna 70c6b92b97 Fixed an error in $score initialization 2007-01-18 20:33:02 +00:00
skodak b27229da41 do not send passowrd hashes to other sites SC#353; merged from MOODLE_16_STABLE 2007-01-17 20:10:25 +00:00
skodak 0801278026 force login in course calendar SC#349; backported from HEAD 2007-01-17 19:54:35 +00:00
moodler d9bda8a421 Bump to post 1.7.1 2007-01-17 04:31:01 +00:00
moodler 42f8e247d2 Bump to 1.7.1 2007-01-17 04:11:14 +00:00
moodler ed3ee5e357 Automatic installer.php lang files by installer_builder (20070117) 2007-01-17 03:21:07 +00:00
mchurch 8b4a8f616f Fixing bug where quizzes from 1.4 will lose their answers when upgraded to later versions.
Fixes MDL-8207.
2007-01-16 21:31:14 +00:00
tjhunt f470cf47b7 Fix multiple-choice multiple-answer grading code. 2007-01-16 17:50:18 +00:00
thepurpleblob e43202e7a3 MDL-8100, defaultgrade not imported. Question obect initialisation and value import wrong way round - whoops! 2007-01-16 12:10:40 +00:00
thepurpleblob e70d37080c MDL-8130 Number of improvements to check name length and improve HTML Entity handling. Thanks to Paul Ortman. 2007-01-16 11:19:49 +00:00
moodler 98d6d9288b Automatic installer.php lang files by installer_builder (20070116) 2007-01-16 03:18:51 +00:00
vyshane 1c2ecdd3dd Fix for MDL-8099. 2007-01-16 02:43:12 +00:00
martinlanghoff 1d94add47e enrol/database: fix fields not read from external database MDL-7712 2007-01-15 20:00:01 +00:00
martinlanghoff dd1ac4af5c auth/db: fix fields not read from external database MDL-7712 2007-01-15 19:58:58 +00:00
stronk7 9982cf19c9 Avoiding some itarations. MDL-7902. Thanks Samuli! 2007-01-14 12:10:37 +00:00
moodler 7d72568ba9 Automatic installer.php lang files by installer_builder (20070113) 2007-01-13 10:22:57 +00:00
moodler 2ad6c7b8fe Automatic installer.php lang files by installer_builder (20070113) 2007-01-12 17:49:16 +00:00
moodler c73628d1dc file installer.php was added on branch MOODLE_17_STABLE on 2007-01-12 17:49:16 +0000 2007-01-12 17:43:29 +00:00
vyshane d976a7d9dc Fix for MDL-8146. Clicking on "No" when asked to confirm deletion of a post will now always take the user back to that post in the relevant discussion. 2007-01-12 05:03:57 +00:00
moodler 2683c51739 Automatic installer.php lang files by installer_builder (20070112) 2007-01-12 03:18:54 +00:00
ethem 7262b0c5a9 MDL-7861 xhtml transient fixes for not closed input fields; Backported from HEAD 2007-01-11 10:13:14 +00:00
moodler 26be3a96c4 Very likely fix for MDL-8067 2007-01-09 04:58:46 +00:00
skodak 33ca51fbdf backported fixes for warnings when exporting logs in excel format 2007-01-08 22:24:16 +00:00
skodak 642a7105e5 fixed options array initialisation 2007-01-08 21:55:14 +00:00
skodak 4233e8b7b6 MDL-8115 fixed $$submission typo 2007-01-08 21:42:17 +00:00
stronk7 f7352c8340 Environment checks support mysqli. MDL-8113 2007-01-08 19:53:34 +00:00
stronk7 90b7248055 Minor change to be able to install 1.7 unicode under mysqli
(mysqli is going to be supported only by Moodle 1.8. This is
one exception to be able to have 1.7 working in dev environments)
2007-01-08 18:59:21 +00:00
moodler 3c13c14e59 Automatic installer.php lang files by installer_builder (20070108) 2007-01-08 03:22:26 +00:00
gbateson 0cf15fb3e6 prevent backslashes being inserted before #-sign in HTML entities by converting html-entities to UTF-8 when importing from Hot Potatoes quizzes into Moodle 's standard Quiz module 2007-01-07 12:37:37 +00:00
skodak c966aa2c71 revised adobe XSS protection SC#346 - backported from HEAD 2007-01-06 15:24:14 +00:00
thepurpleblob d367b64be3 MDL-6769 and http://moodle.org/mod/forum/discuss.php?d=60209 the default for shuffleanswers is now set to the configured value. 2007-01-05 11:55:01 +00:00
thepurpleblob 862dd9d01a MDL-7913 Improved category detection (again) to extract all characters. 2007-01-05 10:33:05 +00:00
thepurpleblob 675c2419d1 Added some cleaning to the category path for some safety. 2007-01-05 10:05:27 +00:00
moodler 3453faf411 Automatic installer.php lang files by installer_builder (20070105) 2007-01-05 03:31:39 +00:00
skodak 9fcb7001e6 Adobe Acrobat JavaScript Execution Bug SC#346 2007-01-04 00:05:07 +00:00
moodler 6a9c63b3c4 Strict DOCTYPE 2007-01-03 09:01:03 +00:00
moodler f248698fed Automatic installer.php lang files by installer_builder (20070103) 2007-01-03 03:23:27 +00:00
moodler 5510929c42 Automatic installer.php lang files by installer_builder (20070102) 2007-01-02 03:17:18 +00:00
moodler 8cbaea4f7a Automatic installer.php lang files by installer_builder (20061231) 2006-12-31 03:20:32 +00:00
skodak bb52c312de MDL-7829 zipping with binary zip broken under windows when moodledata on different disk; backported from HEAD 2006-12-29 22:53:35 +00:00
skodak 152fa94009 MDL-7828 Backup with error PCLZIP_ERR_MISSING_FILE (-4) under windows when moodledata on different disk - patch by Yves Roy; backported from HEAD 2006-12-29 22:36:38 +00:00
skodak a59462f1a4 MDL-7837 auth_ldap_bulk_insert() fails when user data contains single quotes - patch by Iñaki Arenaza; backported from HEAD 2006-12-29 21:18:37 +00:00
skodak 8f08bf55d9 MDL-8007 mimetype support for htc files, see http://support.microsoft.com/kb/306231; backported from HEAD 2006-12-29 20:59:36 +00:00
skodak 85c23c24f6 MDL-8021 resource "Link to a file or web site", when created, doesn't open in a new window - fixed recourse typo; backported from HEAD 2006-12-29 20:17:14 +00:00
moodler 174e5dfc05 Automatic installer.php lang files by installer_builder (20061229) 2006-12-29 03:12:45 +00:00
moodler 3ed3433efd Automatic installer.php lang files by installer_builder (20061228) 2006-12-28 03:14:53 +00:00
martinlanghoff 6cb344928f redirect(): fix protocol name in redirection header() 2006-12-27 01:48:22 +00:00
martinlanghoff 2c56bea007 raise_memory_limit() earlier -- resolves OOM on 64-bit platforms
On 64-bit platforms the in-memory footprint of our libraries is quite a bit
larger than usual, and we hit the 8MB default memory limit before we call
raise_memory_limit(). This patch moves raise_memory_limit() and
get_realsize() to setuplib so we can call them earlier, and moves the
call to _before_ we include the libraries.

On AMD64, for MOODLE_17_STABLE the footprint is about 9.5MB. Diet time? :-)
2006-12-26 22:47:36 +00:00
moodler 6ac70d87d4 Automatic installer.php lang files by installer_builder (20061226) 2006-12-26 03:17:04 +00:00
stronk7 e58d9e9f8e Add support for multilang titles in forum->posts 2006-12-20 16:40:12 +00:00
stronk7 80f91aad31 Added one missing format_string() to post->subject 2006-12-20 09:57:08 +00:00
vyshane fa1df4db7b Fixed some warnings with role mappings. 2006-12-19 04:59:42 +00:00
skodak ce499284a0 MDL-7903 Guests can not enter course that allows guests with key 2006-12-18 19:20:14 +00:00
skodak 5359b97581 MDL-7974 Weekend Days Settings Chooses Wrong Day after Saving; backported from HEAD 2006-12-18 18:08:53 +00:00
tjhunt f3f60456ff MDL-7975 - Make import and export of truefalse questions more reliable. Merged from MOODLE_16_STABLE. 2006-12-18 18:06:56 +00:00
tjhunt e0e1d29889 MDL-7972 - improve GIFT import export for truefalse questions.
Also clean up whitespace in question/format/gift/format.php - Merged from MOODLE_16_STABLE.

MDL-7928 - Numerical question type should use * for the match anything answer - GIFT format part.
2006-12-18 16:38:02 +00:00
vyshane 42ce3dfc9f Fix for cases where the resource being removed is the only DOM node in the section's div. 2006-12-18 06:24:53 +00:00
moodler 71338fc369 Automatic installer.php lang files by installer_builder (20061218) 2006-12-18 03:45:21 +00:00
moodler 7aae797ec1 And another bit of MDL-7961 2006-12-18 02:00:38 +00:00
moodler c5749e312f Fixed a backwards logic bug preventing format changes sometimes MDL-7961 2006-12-18 01:58:59 +00:00
skodak 17f32ca725 MDL-7941Installation on Windows makes reference to libgd.dll in php.ini; backported from HEAD 2006-12-17 22:26:36 +00:00
gbateson 7648eae997 Modified the README.TXT to reflect the fact that this version fo the HotPot module, v2.2.x, is only compatible with Moodle 1.7 2006-12-17 02:11:43 +00:00
tjhunt 62a29aa8e0 MDL-7928 - Numerical question type should use * for the match anything answer. 2006-12-15 18:30:14 +00:00
tjhunt 93727c9b8e MDL-7926 - set_field_select function 2006-12-15 18:23:15 +00:00
tjhunt b2681766d7 MDL-7925 - description question types were being created with defaultgrade = 1. It should be zero, so fix the bug, and reset any wrong ones in the database. 2006-12-15 15:41:32 +00:00
moodler afd38cb133 Automatic installer.php lang files by installer_builder (20061215) 2006-12-15 03:19:57 +00:00
mits d3fcae7237 Fixed a missing closing brace }. 2006-12-14 20:12:48 +00:00
tjhunt 6b66913982 Correct comment punctuation. 2006-12-14 11:45:28 +00:00
skodak 68875532e6 SC#341 fixed initilaization of navtail variable; backported from HEAD 2006-12-14 08:15:11 +00:00
vyshane 519c36a6fb Fixes for MDL-7674. 2006-12-14 08:09:29 +00:00
vyshane 93f30556b3 Fix for MDL-7753. Credits to Andrew Walker. 2006-12-14 07:45:44 +00:00
vyshane b3f180f91b Added missing / in link tag 2006-12-14 04:46:32 +00:00
vyshane ac76e8c5bf Fix for MDL-6980. 2006-12-14 03:03:21 +00:00
tjhunt 3c4e7ea962 MDL-7602 - Multianswer question type only works with invalid HTML. 2006-12-12 08:58:25 +00:00
tjhunt 3d83f4255a MDL-7896 - error from random question type in adaptive mode. Merged from MOODLE_16_STABLE. 2006-12-11 23:46:01 +00:00
mark-nielsen 21e5dd9414 Fix for MDL-7477 2006-12-11 18:42:10 +00:00
tjhunt 9b6b1f3afa MDL-7886 - typo in overview report javascript. 2006-12-11 14:03:09 +00:00
toyomoyo 148c0decf6 adding missing helpfile 2006-12-11 06:28:59 +00:00
toyomoyo 0df7a3d616 removed warning 2006-12-11 05:30:25 +00:00
toyomoyo 46385c64bd fix for MDL-7270, fixing warnings 2006-12-11 03:13:07 +00:00
skodak 91b890f705 MDL-7857 uninitialized context in mod/data/index.php; backported from HEAD 2006-12-10 20:21:58 +00:00
skodak 683b038d09 MDL-6668 Database mod search error on Postgres; patch by Lorenzo Nicora; backported from HEAD 2006-12-10 19:28:17 +00:00
skodak a04aa7c7df MDL-6613 Apostrophe in locked field prevents user updating profile - patch by Iñaki Arenaza; backported from HEAD 2006-12-10 17:41:12 +00:00
skodak 8e2958d1a1 MDL-7855 Sanitize field type when importing presents into data mod; backported from HEAD 2006-12-10 17:31:17 +00:00
gbateson 39d860b52d added details of the columns in the hotpot click report table 2006-12-10 05:28:38 +00:00
moodler 7c37e6755c Automatic installer.php lang files by installer_builder (20061210) 2006-12-10 03:06:58 +00:00
skodak d21dbfd55d MDL-7734 fixed warning when $course not defined when printing help button 2006-12-09 13:33:09 +00:00
moodler 723a084744 Automatic installer.php lang files by installer_builder (20061209) 2006-12-09 03:15:45 +00:00
skodak 1ace15420e MDL-6519 Dollar ($) signs in data module text fields not preserved; backported from HEAD 2006-12-08 22:36:42 +00:00
skodak 1df5e775ff MDL-7848 Database presets import breaks non-null restriction on description; backported from HEAD 2006-12-08 22:25:22 +00:00
mark-nielsen b547c1396f Added more information regarding supported file types. Related to MDL-7418 fix 2006-12-08 18:46:38 +00:00
mark-nielsen ffbbe44116 Added lang entry for MDL-7418 fix 2006-12-08 18:45:55 +00:00
mark-nielsen 7a7056e0bb Fixed MDL-7418: added support for images and added a default support which is that the file is available for download 2006-12-08 18:45:08 +00:00
toyomoyo ab505564c9 fix for MDL-7766 calenar not displaying course events 2006-12-08 07:54:27 +00:00
toyomoyo 527bd0664c fix for MDL-7819, admins still in participants list 2006-12-08 04:26:47 +00:00
gbateson 6285e5af65 abandoned attempts are now included in all reports 2006-12-08 04:18:17 +00:00
toyomoyo 792f362b93 fix for MDL-7794, inconsistent field length for city 2006-12-08 03:07:45 +00:00
moodler db69332665 Automatic installer.php lang files by installer_builder (20061208) 2006-12-08 03:06:22 +00:00
gbateson 94a7bfecb0 fix undefined property "cr_timefinish", when viewing click report 2006-12-08 02:42:51 +00:00
toyomoyo 8665733354 fix for MDL-7592, get_course_students() bug 2006-12-08 02:21:32 +00:00
skodak a6abb7fda7 MDL-7839 Fixed use of capabilities in database entry rating; backported from HEAD 2006-12-07 20:12:14 +00:00
toyomoyo 380199a948 implementing moodle/user:viewdetails 2006-12-07 06:08:02 +00:00
toyomoyo 2da1b09809 fix for MDL-7770, prevent users with no capability to view user profile 2006-12-07 05:05:18 +00:00
toyomoyo a75dde8a5c fix for MDL-7696, adding addslash for bulk messaging 2006-12-07 03:01:16 +00:00
toyomoyo 3c98b96d40 fix for MDL-7734, making help links respect course langs 2006-12-07 02:17:11 +00:00
skodak 3bd8388689 MDL-7821 wrong use of cm in data mod and added proper require_login(); backported from HEAD 2006-12-06 20:24:19 +00:00
skodak 5ceee287f3 MDL-7812 warning in sorting form in data module when no fields defined; backported from HEAD 2006-12-06 09:58:43 +00:00
skodak 319e0b4d9a MDL-7806 Login results in fatal PHP error on enrol/database connect failure (patch by Clinton Graham); backported from HEAD 2006-12-06 09:49:55 +00:00
toyomoyo 84bed3d71b avoid the use of deprecated functions 2006-12-06 06:24:20 +00:00
toyomoyo 381b712d96 fix for MDL-7784, reference to user_student tables 2006-12-06 06:07:19 +00:00
moodler 87c9582273 It's now impossible to access the home page if:
- mymoodleredirect is active, and
   - you are logged on, and
   - you don't have site config ability

MDL-7584   MDL-7583
2006-12-06 05:07:11 +00:00
toyomoyo ae9910b3aa multiple assignments should only be counted once 2006-12-06 04:26:50 +00:00
mark-nielsen 91607e97ed Media file link was being squished. Gave it 150px space 2006-12-06 02:25:09 +00:00
moodler 71c7eb7260 Non-editing teachers should NOT have course import rights by default 2006-12-06 02:23:37 +00:00
mark-nielsen 5b6037f3ac Fix for MDL-2006 2006-12-06 01:59:53 +00:00
tjhunt d2ae521e17 MDL-7804 - Essay questions do not backup properly. Merged from MOODLE_16_STABLE. 2006-12-05 18:47:12 +00:00
tjhunt 11f0eb9979 Add $level parameters to each backup method. Merged from MOODLE_16_STABLE. 2006-12-05 18:14:32 +00:00
skodak 4e1af8f1b3 require_login not working properly MDL-7800; backported from HEAD 2006-12-05 09:21:39 +00:00
vyshane a68c438d5c Removed extra ; 2006-12-05 08:14:42 +00:00
vyshane 9a7b7e38b9 Fixed bug: cannot edit post in each user forum type. 2006-12-05 08:12:27 +00:00
moodler 43e57712eb Clear the capability cache when adding roles to current user, just to be sure 2006-12-05 07:12:22 +00:00
moodler 55ebb7277b Fixed last access time for my moodle, MDL-7609. 2006-12-05 06:59:34 +00:00
moodler 0ca2898178 FIx for MDL-7605 where switchroles was not working properly
There were two issues:

1) When switch roles is active we don't want to progress up to parents of the
   course looking for capabilities


2) We need to clear the capability cache after switching roles because the
   cached values may not be accurate (because of the above difference)
2006-12-05 05:39:11 +00:00
moodler d1910944e2 Automatic installer.php lang files by installer_builder (20061205) 2006-12-05 03:22:50 +00:00
tjhunt 257343b354 MDL-7719 - Essay question feedback box too small. 2006-12-04 16:21:31 +00:00
tjhunt 7989c3edc6 Typo in help. Thanks to Ken Wilson. 2006-12-04 16:07:52 +00:00
tjhunt accaf2e9f6 Typo. 2006-12-04 11:54:35 +00:00
skodak 15f93e462f MDL-7767 Guests should not be able to hide course sections - section hiding is not stored in db for guests, only session is used now 2006-12-04 08:53:21 +00:00
vyshane d628dcedd2 Fix for MDL-7760 2006-12-04 08:02:57 +00:00
moodler 8b42d3bbb7 Added new DST timezone changes for Perth, Western Australia
(Yes, we have joined the rest of the world with DST ... :-(   )
2006-12-04 06:59:24 +00:00
moodler c92a464165 Automatic installer.php lang files by installer_builder (20061204) 2006-12-04 03:14:45 +00:00
toyomoyo 08410ed897 stop admins from showing up in participants list 2006-12-04 03:04:04 +00:00
toyomoyo aea1aa849b fixed a bug where admin can't unassign himself from non admin roles at site context 2006-12-04 01:53:43 +00:00
toyomoyo fe2f0270d3 fix for MDL-7773, restore_to options not set for creators 2006-12-04 01:13:35 +00:00
skodak bd6cea2f98 MDL-7783 Non-internal authentication change password URL doesn't work - patch by Iñaki Arenaza; backported from HEAD 2006-12-03 20:08:03 +00:00
skodak b13b2b54a6 MDL-7757 URL check is too restrictive, allow port; backported from HEAD 2006-12-03 10:24:59 +00:00
stronk7 5a16abc079 Dictionary name wasn't being saved, so aspell didn't worked under 1.7
if the setting had been edited. MDL-7762
2006-12-01 17:32:20 +00:00
thepurpleblob 0dd1864b73 Added/improved help re. switching categories in import files. 2006-12-01 16:18:02 +00:00
thepurpleblob c23b03b50c Improved regexp for category switch 2006-12-01 16:04:46 +00:00
skodak c5c150c146 MDL-7234 Smilies don't load in HTML editor for some languages; backported from HEAD 2006-12-01 09:50:44 +00:00
skodak a555df3d69 Forgotten password page does not check secret MDL-7755; backported from HEAD 2006-12-01 09:15:12 +00:00
vyshane 87b270ef6a Added check for guest user in forum_subscribed_users. Guest user should never be subsctibed to a forum. 2006-12-01 05:20:14 +00:00
vyshane 3f8f8601e2 We check for gecko build number when deciding whether ajax should be enabled or not. This is more reliable since the advent of Iceweasel etc. 2006-12-01 03:46:02 +00:00
vyshane ad0957be6d Fix for MDL-7732. Patch by Andrew Walker. 2006-12-01 02:39:15 +00:00
skodak 5bdb86e23b MDL-7749 fixed stripslashes when saving admin configuration values; backported from HEAD 2006-11-30 20:39:35 +00:00
urs_hunkler cb55f92d17 'added clear:left and a little top distance to the htmlarea in adminsettings. If this works in all places a more general rule for all quickforms should be entered' 2006-11-30 12:10:57 +00:00
ethem 9c3d643dad No urlencode 2006-11-30 09:14:15 +00:00
ethem af053ebd3e Brushed up a string. 2006-11-30 08:43:32 +00:00
ethem f241382c56 + More more more security.
* Don't show login name, password and transaction key at the configuration page.
* RC4Encrypt these fields and move to the config_plugins table from the config table.
* Config page is fully https.

Backported from HEAD.
2006-11-30 08:11:22 +00:00
skodak 055d04ad68 MDL-7741 missing ? in start php tag; backported from HEAD 2006-11-29 22:31:36 +00:00
thepurpleblob 02cac21426 Question category can now be specified in Moodle XML format. 2006-11-29 14:26:47 +00:00
thepurpleblob ee031ca12d Added ability to specify destination category within GIFT file.
MDL-4163
2006-11-29 13:33:44 +00:00
thepurpleblob 2332c5b8da Fixed a notice. Tidied up format class call a bit. Added provision
for categories to be specified within import files - MDL-4163.
2006-11-29 13:30:41 +00:00
thepurpleblob a2842bc86c Added function to find or add a path of categories.
For categories specified in import files. MDL-4163
2006-11-29 13:27:40 +00:00
thepurpleblob 8d0db8766b Help information for specifying categories in GIFT file. MDL-4163 2006-11-29 13:22:54 +00:00
thepurpleblob 746be7faee Added strings for selecting category inside import file. MDL-4163 2006-11-29 13:06:10 +00:00
tjhunt 3b117ede45 MDL-7720 - non-unicode-safe case-insensitive string comparison in shortanswer question type. 2006-11-28 18:43:44 +00:00
tjhunt af5f09db42 Put back spaces in code that Martin Dougiamass stripped out of the lang strings without thinking about the consequences. 2006-11-28 18:38:59 +00:00
nfreear 48988ba271 Fix for MDL-6685 (and MDL-7122 "breadcrumb separator missing"). 2006-11-28 15:25:00 +00:00
thepurpleblob 1060c5998e Fix for MDL-7703 - scope problem sorted by moving all functions inside the class
Also fixed a bunch of notices
2006-11-28 15:13:25 +00:00
thepurpleblob 9f5d13105d Examview 'SA' type questions now supported. Maps to Essay questions 2006-11-28 11:49:58 +00:00
thepurpleblob 777816e6c7 Fixed typo and a notice when question type is not supported. 2006-11-28 09:25:52 +00:00
mark-nielsen 0e0fd96278 Fix for MDL-7707. Also had to update index.php to show students the same score as in the gradebook. 2006-11-28 05:45:52 +00:00
mark-nielsen 5aa3fe9c10 Missing help file from MDL-7352 2006-11-28 03:54:34 +00:00
mark-nielsen 882a1343ab [Fixed] MDL-7614 2006-11-28 03:39:52 +00:00
moodler cb48f665eb Automatic installer.php lang files by installer_builder (20061128) 2006-11-28 03:17:33 +00:00
moodler 0a786db090 Better checks when loading datamodel 2006-11-28 03:02:38 +00:00
moodler e9dec637ff the version was blank on a package I tried ... this now gives it some sort of
reasonable default (scorm_12)
2006-11-28 02:50:37 +00:00
skodak 954e74f2dd Broken handling of magic quotes in admin settings and set_config in general MDL-7668; backported from HEAD 2006-11-27 08:48:52 +00:00
vyshane dc3906acce Fix for MDL-7676 2006-11-27 04:48:06 +00:00
ikawhero 4fc9ea71f9 Added missing string 2006-11-27 04:05:40 +00:00
vyshane abe58b4a43 Fix for MDL-7682 2006-11-27 03:21:26 +00:00
moodler 662231384d Automatic installer.php lang files by installer_builder (20061127) 2006-11-27 03:16:41 +00:00
skodak c76465c42b MDL-7631 Incorrect grading when Each attempt builds on the last and questions on more than one page; backported from HEAD 2006-11-26 23:02:06 +00:00
skodak e2a73d8a93 Double quotes breaking short answers in a multianswer/cloze question MDL-6676; backported from HEAD 2006-11-26 21:58:31 +00:00
skodak 7764cd6cc7 incorrect table width in Exercise MDL-7690; backported from HEAD 2006-11-26 21:38:03 +00:00
stronk7 0a870ce21a Typo causing continue button in closed quizzes to fail. MDL-7685 2006-11-25 17:12:06 +00:00
moodler 55be7faa95 Automatic installer.php lang files by installer_builder (20061125) 2006-11-25 03:21:13 +00:00
skodak 60afff1419 Fix course overview graph broken by notices MDL-7680; backported from HEAD 2006-11-24 18:32:38 +00:00
thepurpleblob 1c8d340d1b Added note that : is a control character and can be escaped. 2006-11-24 13:02:07 +00:00
thepurpleblob 31d3c58089 Colon characters in GIFT files can now be escaped.
Resolves MDL-6915
2006-11-24 12:02:08 +00:00
moodler 4a900a1e3b fix for MDL-7448, added enableForm() call to prevent chat lock up. Thanks Kok Chee Kean! 2006-11-24 04:17:15 +00:00
toyomoyo 2564d898d3 fixing a warning 2006-11-24 01:59:48 +00:00
skodak cea03e39c7 Missing s() on current value in admin_setting_configtext class MDL-7666; backported from HEAD 2006-11-23 21:01:23 +00:00
skodak e38e49335c Students cannot enrol with PayPal plugin when using PHP4 MDL-7529; backported from HEAD 2006-11-23 20:17:23 +00:00
ethem 8d137d3be6 We are expecting multiple records! 2006-11-23 16:26:07 +00:00
moodler 766b1926ed Removed two unenecessary lines from a cut-and-paste 2006-11-23 09:09:28 +00:00
vyshane 842721d87f Fixed bug in IE for resources/activities indentation. 2006-11-23 08:35:19 +00:00
moodler 247147c8dd Automatic installer.php lang files by installer_builder (20061123) 2006-11-23 03:12:06 +00:00
urs_hunkler 75108f21ad 'removed overflow:hidden because there are some display issues on some pages. min-width: 0 is enough to trigger IE7 hasLayout to avoid collapsing divs' 2006-11-22 20:37:38 +00:00
urs_hunkler 9fa06fc780 'removed overflow:hidden because there are some display issues on some pages. min-width: 0 is enough to trigger IE7 hasLayout to avoid collapsing divs' 2006-11-22 20:37:14 +00:00
vyshane ed90d891a1 Fix for MDL-7627. Credited to Andrew Walker. 2006-11-22 08:25:24 +00:00
ethem d8f6207bee MDL-7642 2006-11-22 08:18:06 +00:00
vyshane 381fd47442 Added POST connection for left and right indents. 2006-11-22 07:37:59 +00:00
vyshane f868caa529 Added indent left and indent right for resources 2006-11-22 07:35:53 +00:00
vyshane 4378a0456e Code for ajax indentation of activities and resources. 2006-11-22 07:01:16 +00:00
skodak f829d4a446 Social activities block always appears in edit mode to admin without turning editing on MDL-7639 2006-11-21 20:35:04 +00:00
urs_hunkler b49d086945 ajax move icon added 2006-11-21 13:50:45 +00:00
toyomoyo 0aa07c2fa0 adding capability checks 2006-11-21 05:31:03 +00:00
toyomoyo 4d15a1932a fix for MDL-7426, remove teacher.php link 2006-11-21 04:44:35 +00:00
vyshane c2540e76e1 Added class names in the html output for editing mode buttons. These will be used as hooks in the ajax course formats. 2006-11-21 04:22:47 +00:00
vyshane c3c4013f08 Editing mode buttons now check for class names instead of titiles when searching for the buttons to be 'ajaxified'. 2006-11-21 04:20:17 +00:00
vyshane 210deee299 Fixed button spacing. 2006-11-21 04:13:58 +00:00
toyomoyo 9c71a2396b fix for MDL-7540 wrong usage of context levels 2006-11-21 03:22:33 +00:00
moodler 6ba16921db Automatic installer.php lang files by installer_builder (20061121) 2006-11-21 03:19:26 +00:00
toyomoyo 245505f928 removing hardcoded auth method "ldap" 2006-11-21 02:08:13 +00:00
tjhunt d086c991ee Fix column names - backported from head. 2006-11-20 18:04:24 +00:00
skodak c8c625a0be bellow spelling fixed; backported from HEAD 2006-11-20 17:40:45 +00:00
skodak a71dd3f315 Advanced uploading of file interface typo MDL-7628; backported from HEAD 2006-11-20 17:36:26 +00:00
ethem a40fe0a766 Daily echeck order notification 2006-11-20 14:53:17 +00:00
skodak b2a39ba822 fixed problem with apostrophe in role names and description when creating roles during install and restore MDL-7611; backported from HEAD 2006-11-20 14:11:39 +00:00
ethem 845c5d725b Help file: Uploading Authorize.net CSV file 2006-11-20 13:47:53 +00:00
skodak ac12e36125 PARAM_PATH can be used only for relative paths, there is no parameter type for absolute paths that would be compatible with win32 - use PARAM_RAW for now, add file_exists validation later MDL-7617; backported from HEAD 2006-11-20 13:35:36 +00:00
thepurpleblob 08a7bbc9ff Various improvements to Examview input.
Fixes MDL-7087 and MDL-7349. Partial fix for MDL-7184 (Examview part)
2006-11-20 13:00:34 +00:00
ethem 52b0b2684c Reference Transaction ID refers enrol_authorize.transid, not enrol_authorize_refunds.transid 2006-11-20 11:14:08 +00:00
ethem 7c96968699 It is time to refund for echeck (business checking). 2006-11-20 09:54:44 +00:00
ethem c629a2ef7f It is time to refund for echeck (business checking). 2006-11-20 09:54:44 +00:00
vyshane d500edf243 Removed subclass activity_class. The only logic in that class was for handling of groupmode buttons. These are now handled in resource_class.prototype.init_buttons() and resource_class.prototype.toggle_groupmode().
We basially look at whether the button is present in the html output, and if it is, we add it to the ajax frontend. We do not make the distinction that activities should have the button (as opposed to resources). The advantage is that some activities might not have groupmode.

This fixes MDL-6916.
2006-11-20 09:18:33 +00:00
vyshane b666f6f3aa Passing some more language strings to ajax frontend. Part of the fix for MDL-6916. 2006-11-20 09:15:24 +00:00
ethem f66e4015b8 Business checkings can be refunded only for echeck method. Not saving nor checking. 2006-11-20 08:07:42 +00:00
vyshane a84533fee3 Fix for MDL-7620 2006-11-20 02:28:07 +00:00
tjhunt b49beecf63 Fix function arguments. 2006-11-19 21:28:11 +00:00
moodler 74b111bc7f Automatic installer.php lang files by installer_builder (20061119) 2006-11-19 03:13:23 +00:00
stronk7 a8c5a14b7c Prevent some false-positives detecting uses of old user_XXX tables.
See http://moodle.org/mod/forum/discuss.php?d=58976
2006-11-18 20:25:52 +00:00
stronk7 f9ad31d809 PHP generated code must use $result instead of $status. MDL-7533 2006-11-18 19:02:13 +00:00
stronk7 db26bf99f5 PHP generated code must use $result instead of $status. MDL-7533 2006-11-18 18:51:42 +00:00
gbateson e4857c41fb fix sort order of questions in legend, which caused mismatch between question numbers used in Detailed Statistics report and those used in the legend 2006-11-18 08:54:00 +00:00
moodler 37d9720b15 Automatic installer.php lang files by installer_builder (20061118) 2006-11-18 03:14:19 +00:00
ethem 24e6ae8cc6 MDL-7533
Use $result instead of $status
2006-11-17 17:23:00 +00:00
ethem e31d492145 Changed db column(cclastfour) as refundinfo.
Because this field will be used to refund both cc and echeck.
Business checkings can be refunded, too; so mark as 1 this field for business checkings.
That is; refundinfo: is last four digit for credit cards, business checking for echecks.
2006-11-17 15:42:25 +00:00
vyshane e5708be88c Formatting cleanups. 2006-11-17 09:07:30 +00:00
ethem c34713bfca Business checks can be refunded. Point a flag for it. The cclastfour field will be renamed to refundinfo later. 2006-11-17 06:53:36 +00:00
vyshane 364f72aa05 Fix for MDL-7574. 2006-11-17 05:51:37 +00:00
moodler 4e5d63c403 Renamed function name that conflicted with PHP function MDL-7594 2006-11-17 04:02:11 +00:00
moodler 79bad718b6 Automatic installer.php lang files by installer_builder (20061117) 2006-11-17 03:13:25 +00:00
vyshane 01ed826fff Fix for MDL-7563. Added call to removeFromGroup() from block_class.delete_button(). Thanks Andrew Walker for the patch! 2006-11-17 02:56:58 +00:00
moodler d842884534 Removed B) smiley MDL-7589 2006-11-17 02:10:46 +00:00
tjhunt b51bfdd111 Typo in function name. 2006-11-16 16:45:55 +00:00
ethem db47e0ffbb choosemethod is too long for heading, added <br /> 2006-11-16 14:16:20 +00:00
tjhunt ceab443d08 MDL-7576 - review link does not work after attempt is closed. Thanks to Chad Badiyan for the fix. 2006-11-16 12:43:00 +00:00
vyshane 5675d86412 Changed http requests to uppercase: post to POST, delete to DELETE. 2006-11-16 05:29:16 +00:00
toyomoyo ad0d007abd fixed a problem where user is not shown when the user has not visited a course page. changed get_user_roles to take in additional parameter 2006-11-16 05:16:07 +00:00
vyshane 69e5d0ef95 Fix for MDL-7293. Added new function blocks_move_block() to replace blocks_execute_repositioning_atomic(). Reverted blocks_execute_repositioning() to what it was before the changes made whenblocks_execute_repositioning_atomic() was introduced. 2006-11-16 03:23:05 +00:00
vyshane f32f831749 Fix for MDL-7224. Switched from blocks_execute_repositioning_atomic() to blocks_move_block() for moving blocks. 2006-11-16 03:11:05 +00:00
vyshane cdd0bfcc1a MDL-7293. Switching the order of the classes around 2006-11-16 02:21:01 +00:00
skodak 6153b68ff9 Response file not uploading when grading student submission when using secureforms MDL-7566 2006-11-15 20:56:23 +00:00
skodak 716f1ef9f1 Broken next button when grading assignments MDL-7569 2006-11-15 19:38:07 +00:00
tjhunt 101fb762f1 MDL-7428 - Quiz regrade removes student answers from essay questions that have been graded. Merged from MOODLE_16_STABLE. 2006-11-15 17:32:54 +00:00
tjhunt 368cc39e7e MDL-7567 Numerical questions occasionally mix up the order of their answers. Merged from MOODLE_16_STABLE. 2006-11-15 16:56:02 +00:00
tjhunt 806b78fd12 MDL-7309 Add error checking to the Quiz DB upgrade script. This should prevent the mysterious failures that some people are seeing when upgrading quizzes from 1.5.x to 1.6.x. Merged from MOODLE_16_STABLE. 2006-11-15 12:58:00 +00:00
vyshane 6c619b41c8 Doh.. Should be a string 2006-11-15 08:33:24 +00:00
vyshane f02f53f09b Fix for MDL-7192. Added camino check. 2006-11-15 08:10:14 +00:00
vyshane c4acc71042 Added Camino check in check_browser_version() 2006-11-15 08:06:20 +00:00
toyomoyo a5fe571a1c adding missing fields 2006-11-15 06:27:53 +00:00
toyomoyo 9fa998f63b replacing deprecated functions 2006-11-15 06:22:28 +00:00
toyomoyo 4b6776536a fix for MDL-6928, correcting auth_iscreator check 2006-11-15 03:36:07 +00:00
vyshane b7a99c865f Fix for MDL-7293 2006-11-15 03:34:09 +00:00
vyshane 059c9be198 Fix for MDL-7293. We do not block_add() blocks that are pinned - for the ajax course formats. 2006-11-15 03:29:59 +00:00
moodler f132783767 Automatic installer.php lang files by installer_builder (20061115) 2006-11-15 03:17:44 +00:00
vyshane 26ee0fa9cd Small css selector change to accomdate fix for blocks move handle (should not be shown for pinned blocks in ajax course format). Thanks to Andrew Walker for suggested fix. 2006-11-15 02:41:17 +00:00
vyshane d3c653c13f Fix for move handle. The move handle should not be added for pinned blocks. See MDL-7293. Suggested fix by Andew Walker. 2006-11-15 02:39:46 +00:00
skodak 1f6823d18f MDL-7536 add proper slashing to data from paypal callback; backported from HEAD 2006-11-14 21:24:14 +00:00
moodler 4d833069bd Initial commit of gu_utf8 installer file 2006-11-14 19:57:27 +00:00
moodler 03b17f7a0d file installer.php was added on branch MOODLE_17_STABLE on 2006-11-14 19:57:26 +0000 2006-11-14 19:52:55 +00:00
stronk7 5b549b306d while working, it's better to compare with original data (un-slashed) 2006-11-14 16:27:20 +00:00
tjhunt 6c9ac19b6f MDL-7531 Fix SQL that does not work in Oracle. Thanks to Mark Hetherington for the fix. 2006-11-14 15:40:29 +00:00
vyshane 83523cccd6 MDL-7284 2006-11-14 05:33:37 +00:00
vyshane 4846e7e856 Fixed javascript error that occurs during the appending of block buttons. Some code formatting cleanups as well. 2006-11-14 05:03:14 +00:00
vyshane ad9c1a9966 Fix for MDL-7440. Suggested by Andrew Walker. 2006-11-14 03:05:38 +00:00
vyshane 67c80485b9 Fix for MDL-6969. Patch by Andrew Walker. 2006-11-14 02:04:26 +00:00
stronk7 b764301306 Set Assoc mode always after DB connection. Discovered by MDL-7443. 2006-11-13 22:58:59 +00:00
stronk7 993c547bd6 Fetchmode needs to be explicity set to ASSOC. Plus 1 missing library
added. MDL-7443
2006-11-13 22:44:54 +00:00
skodak 558bfc50fe MDL-7389 paypal plugin reports error when student correctly enrolled 2006-11-13 22:25:14 +00:00
exe-cutor dc13c4f8a3 User capabilities are now properly loaded. 2006-11-13 11:52:18 +00:00
ethem d485515725 Align right upload csv button. 2006-11-13 08:39:58 +00:00
ethem f8a7befdd5 New feature: Show my payments only for users who has_capability('enrol/authorize:managepayments') 2006-11-13 07:55:31 +00:00
ethem ad5cbccfd3 New feature: Show my payments only for users who has_capability('enrol/authorize:managepayments') 2006-11-13 07:43:49 +00:00
vyshane f07794ae81 Added error message string 2006-11-13 07:35:49 +00:00
vyshane 9930ae9e6b $SITE is not needed 2006-11-13 07:34:18 +00:00
vyshane 6bcb0ad140 Fix for MDL-7461. Related to MDL-7383. We still show the add discussion button to guests, but only if we are not in the site news. 2006-11-13 07:28:34 +00:00
ikawhero 78066f113a Replacing with working image 2006-11-13 06:29:29 +00:00
vyshane e2e91ea8ce Fixes for MDL-7461. Removed checks for legacy guest capability as well (redundant). 2006-11-13 06:02:49 +00:00
toyomoyo 3b0b90d5c1 fix for MDL-7441 wrong size for roles icon 2006-11-13 05:42:43 +00:00
vyshane ad890b4490 Fix for MDL-7383. Edit and Delete links aren't shown when printing posts if the user should not be able to do these (checks were already done in post.php as well). 2006-11-13 03:14:58 +00:00
stronk7 ea369699c4 This change wan't backported from HEAD and was causing unicode test
to fail always, showing some incorrect info to users. MDL-7475
2006-11-12 19:33:14 +00:00
ethem 87db2759da Merge fix 2006-11-12 13:23:34 +00:00
ethem 6bd4ab8c5e Get course before require_login(); Merged from 16stable. 2006-11-12 13:21:11 +00:00
moodler c887b2c522 Prevent admins from unassigning themselves MDL-7462 2006-11-12 06:10:47 +00:00
moodler 02f54468a8 Automatic installer.php lang files by installer_builder (20061112) 2006-11-12 03:12:32 +00:00
moodler d9316decdd Automatic installer.php lang files by installer_builder (20061111) 2006-11-11 03:17:37 +00:00
urs_hunkler 39cc4b9f1a 'added 11x11 size for roles icon in sideblock commands bar' 2006-11-10 12:33:15 +00:00
urs_hunkler 9cd9700ad6 changed icons 2006-11-10 12:31:29 +00:00
moodler 6c9ceb3c2e Automatic installer.php lang files by installer_builder (20061110) 2006-11-10 09:49:15 +00:00
urs_hunkler d52eafd9ae roles icon added 2006-11-10 09:01:03 +00:00
toyomoyo 14f409f698 fields should be backed up regardless of whether userdata is selected 2006-11-10 04:17:02 +00:00
toyomoyo 762b68827e fields should be restored regardless of user data is selected or not 2006-11-10 04:10:11 +00:00
moodler c4257b0ff9 Automatic installer.php lang files by installer_builder (20061110) 2006-11-10 03:18:38 +00:00
skodak 76e4168089 code improvement in count_courses_notin_metacourse() MDL-7424 - thanks Eloy! backported from HEAD 2006-11-09 23:36:07 +00:00
skodak a58e869ce2 Child courses import list empty MDL-7424; added new count_courses_notin_metacourse() function, the old one was kept for BC; backported from HEAD 2006-11-09 21:14:20 +00:00
moodler 8798f3049f FIxed problem where capability forum:nothrottling was not fully renamed and
was thus left useless.   MDL-7414
2006-11-09 09:26:32 +00:00
toyomoyo 0d163e9ece category page cleaning, MDL-7409 2006-11-09 06:21:06 +00:00
moodler cb7e142c73 Bumping post 1.7 2006-11-08 16:46:44 +00:00
moodler 17e05203ff Patch from Stefano Bagnatica, MDL-7121 (missing header) 2006-11-08 15:29:21 +00:00
moodler 92ac252418 Fix for missing "reply" links for guests doh! MDL-7393 2006-11-08 09:42:41 +00:00
toyomoyo c9dc31afe8 fix upgrading from 1.6 not redirecting problem 2006-11-08 06:23:06 +00:00
toyomoyo 493dd6c934 fix for MDL-6788, reformating blog edit page 2006-11-08 05:14:13 +00:00
toyomoyo a2adf92023 fixing wrong default gradebook role when upgrading from < 1.7 2006-11-08 02:41:58 +00:00
koenr 005072a3ef MDL-7379 typo 2006-11-08 00:03:43 +00:00
watcanz 8bed6c33cd Updated for 1.6/1.7 2006-11-07 13:49:18 +00:00
mudrd8mz 0ac7fcd7da Fixed bug MDL-7361 (creates $CFG->dataroot/lang if it does not exist). 2006-11-07 12:52:13 +00:00
moodler 8aec60b652 Fix for emoticon icon size MDL-7375 2006-11-07 12:49:07 +00:00
moodler d4f4fa2abe Better check for mssql, to cope with ODBTP (thanks, Eloy!) 2006-11-07 12:38:55 +00:00
moodler 7620c403ec Tweaked some strings for Unicode upgrade info 2006-11-07 09:29:06 +00:00
moodler df1a564fa6 Bumped to 1.7 2006-11-07 09:10:54 +00:00
skodak e20fd196ce new unicode environment check for 1.8 and 1.7 MDL-6332 2006-11-07 09:03:37 +00:00
toyomoyo fd10b9422d fixing MDL-6855 4b) changing not null to true for defaultrole 2006-11-07 08:58:53 +00:00
moodler 80f7504f86 New tags 2006-11-07 07:16:50 +00:00
toyomoyo a203cb09be fixing wrong comment 2006-11-07 03:12:33 +00:00
moodler 131015e234 Automatic installer.php lang files by installer_builder (20061107) 2006-11-07 03:12:00 +00:00
moodler 8494b4356c Temporary fix to hide simpletest when unsupported databases are active MDL-7337 2006-11-07 02:52:38 +00:00
mjollnir_ 3b1bd3405b fixed the journal upgrade. renaming a null column to not null is unhappy 2006-11-07 00:09:18 +00:00
skodak d4e2861046 prevent duplicate content in search engines MDL-7299 2006-11-06 21:48:04 +00:00
koenr 008809ad21 MDL-7328 - miner fix on quotes 2006-11-06 21:27:19 +00:00
skodak 89a750dbeb better param handling SC#331 2006-11-06 20:33:54 +00:00
moodler c0db85f0b2 Fix for googlebot detection ($USER was never empty) 2006-11-06 17:53:50 +00:00
stronk7 ef02670d09 Simple bump 2006-11-06 17:43:28 +00:00
stronk7 7764e1afe0 And, finally, IE is able to display IMS packages properly! B-)
One of the worst to solve bugs in my life! MDL-6417
2006-11-06 17:20:11 +00:00
moodler 2c36ba5bb8 Fixed up the URL after posting (too many #hash) 2006-11-06 16:28:20 +00:00
moodler 1f046e1625 Added upgrade_language_pack() for upgrade in non-english MDL-7351 2006-11-06 12:46:17 +00:00
toyomoyo 31a8a7e4e1 taking out warning 2006-11-06 08:26:56 +00:00
toyomoyo 120f722403 fixing capability of block contexts 2006-11-06 06:15:11 +00:00
toyomoyo 2854559b92 taking out extra isteahcer() 2006-11-06 02:32:35 +00:00
skodak 696d638772 MDL-7176 fixed comment 2006-11-05 18:27:03 +00:00
moodler 2e0b0c94f8 Dan's fix from MDL-7263 2006-11-05 12:39:39 +00:00
moodler d6070215b8 Checked in Dan's fix for MDL-7266 ... missing string 2006-11-05 12:25:32 +00:00
stronk7 7ca5f47dcb modify_database() will show the deprecated debugging after 2006101007
(Moodle 1.7 release version) MDL-5919
2006-11-05 09:44:05 +00:00
moodler 008c431636 DOn't show reply links to logged-in users if they can't reply 2006-11-05 09:34:09 +00:00
moodler 17e44aad44 Fix loginas at site level 2006-11-05 06:43:34 +00:00
moodler cad170cba8 Automatic installer.php lang files by installer_builder (20061105) 2006-11-05 03:16:55 +00:00
stronk7 b215544c31 Now GD is checked before displaying course overview graphs. MDL-7204 2006-11-04 23:28:51 +00:00
wildgirl 5d10e3f43d MDL-6474 fix 2006-11-04 22:21:00 +00:00
wildgirl 354cd59314 file langswitchstorage.html was added on branch MOODLE_17_STABLE on 2006-11-04 22:21:00 +0000 2006-11-04 21:56:42 +00:00
stronk7 1ede3a6712 Now all the get_records() functions support only one field
to be specified in the SELECT clause. Not needed anymore to
write double "SELECT id, id..." queries. Results returned
follow exactly the same structure than normal recordsets
(first field = key) MDL-5877
2006-11-04 16:59:52 +00:00
stronk7 8558e34ed5 Deprecating modify_database(). It shows debugging info
if release > 2006101004 (Beta2 +01) MDL-5919
2006-11-04 16:21:30 +00:00
moodler 614b05ec8b Bump release name to Beta 2 2006-11-03 16:32:45 +00:00
sam_marshall ed2bc33154 MDL-7344 Change 'import child course' timeout to 180 seconds per course because role creation takes a while for thousands of users. 2006-11-03 14:37:41 +00:00
ethem 1ab501974f Show site name at top when selecting courses. 2006-11-03 12:39:48 +00:00
ethem 87753e76d1 Get payment managers at COURSE level. 2006-11-03 12:04:57 +00:00
ethem 0b06840128 get_teacher() to get_users_by_capability(). Merged with HEAD. 2006-11-03 11:28:26 +00:00
toyomoyo 9abc42b262 fix for MDL-7300, mssql not null problem 2006-11-03 08:45:44 +00:00
moodler 90080d990a FIxed some problems with blog entries when not logged in (eg rss) 2006-11-03 08:37:46 +00:00
toyomoyo e7fcbec49e fix for MDL-7300, mssql query error on group creation 2006-11-03 08:17:33 +00:00
urs_hunkler 1576c4d233 'CSS update, mainly for MDL-7330' 2006-11-03 07:44:44 +00:00
urs_hunkler 6ac068ae5c 'CSS update, mainly for MDL-7330' 2006-11-03 07:44:17 +00:00
toyomoyo 7074cb559f fix for MDL-7031, removing control tags from add template 2006-11-03 03:26:33 +00:00
moodler 9138c1f9a8 Automatic installer.php lang files by installer_builder (20061103) 2006-11-03 03:06:18 +00:00
stronk7 98ed0ea1af Ending fied/key/index PHP generators. 2006-11-02 23:07:44 +00:00
stronk7 6abfa47012 Enablig rename_table() PHP generator 2006-11-02 22:43:16 +00:00
bobopinna 59b08215b2 removed white spaces 2006-11-02 15:55:56 +00:00
bobopinna c7c1adeb8d Fixed a small problem with whatgrade field 2006-11-02 15:19:40 +00:00
bobopinna 9230c9417b Added a missing variable definition 2006-11-02 15:17:48 +00:00
bobopinna 23f0f6f72d Fixed a storic problem with & in prerequisites definition
Now finally Moodle has a complete aicc_script conformity with SCORM 1.2
2006-11-02 15:15:06 +00:00
bobopinna 7eb1d32847 Fixed several RegExp to fit ADL Test Suite 2006-11-02 15:12:49 +00:00
bobopinna fadb4b239b Removed isadmin() calls 2006-11-02 15:10:20 +00:00
ethem f319b5bf61 Fix for enrolurl(admin/users.php). 2006-11-02 13:22:49 +00:00
toyomoyo 4a373dbaf9 fix for MDL-6721, wiki broken for SPG 2006-11-02 08:49:55 +00:00
moodler c612f884dc Petr's patch for MDL-7327 to modify require_capability login a bit 2006-11-02 08:11:39 +00:00
toyomoyo b543159952 fixing paging bar problem 2006-11-02 05:53:28 +00:00
toyomoyo 667fdd514e fix for MDL-7140, duplicate course name in header 2006-11-02 03:16:50 +00:00
moodler 951f480ab9 Automatic installer.php lang files by installer_builder (20061102) 2006-11-02 03:07:13 +00:00
toyomoyo bcbb41a0fa fix for MDL-7112 select distinct on text fields 2006-11-02 02:16:52 +00:00
toyomoyo ba39176b59 fix for MDL-7112 select distinct on text fields 2006-11-02 02:09:42 +00:00
toyomoyo 4305306220 fix for MDL 7112 select distinct on text field 2006-11-02 02:01:58 +00:00
skodak 8864d0f442 hack for problems with concurrent use of $nomoodlecookie and capabilities in RSS feeds, see MDL-7243 - it should be replaced once we get to codes in urls 2006-11-01 21:02:11 +00:00
ethem 741162fbbe Make authorize.net config page secure.
See: http://moodle.org/mod/forum/discuss.php?d=56728
Merged with HEAD.
2006-11-01 13:02:00 +00:00
ethem f1e4622ccb Make authorize.net config page secure.
See: http://moodle.org/mod/forum/discuss.php?d=56728
Merged with HEAD.
2006-11-01 12:46:19 +00:00
stronk7 4241549aed in/on/at too many ways to say "en" in Spanish. :-P 2006-11-01 11:51:13 +00:00
moodler 9e0d96f36b Tidied up string files 2006-11-01 09:37:06 +00:00
moodler 7e5b0b4e9c Clean up strings 2006-11-01 09:26:54 +00:00
moodler 9be2fc8f19 Cleaned up data.php 2006-11-01 09:24:15 +00:00
moodler f8cbf4713a Cleaned up language file 2006-11-01 09:19:21 +00:00
moodler 1a7d693572 Sorted and cleaned up this file 2006-11-01 09:18:04 +00:00
moodler 31922db550 Sorted and cleaned up language files 2006-11-01 09:15:50 +00:00
moodler 3cf94d16ed Added some strings that had been deleted MDL-6645 2006-11-01 09:14:24 +00:00
moodler ae471b7ab6 An untested patch for MDL-7211 to fix firstclass hole 2006-11-01 06:54:07 +00:00
moodler f00c241f7d Fixed SQL for Oracle (forum searching) MDL-7317 2006-11-01 06:29:08 +00:00
toyomoyo cbd20ae8ba fix for MDL-6928 LDAP course creation capability error 2006-11-01 03:50:21 +00:00
toyomoyo 7bbe252c59 restore fix for supporting pre granular version of moodle backups 2006-11-01 03:31:02 +00:00
skodak a7d6e5b0f7 fixed notice during restore 2006-10-31 22:45:28 +00:00
skodak e4edbb9e0b Fix errors in quiz overview download MDL-7316 2006-10-31 22:17:50 +00:00
skodak 80895066a2 fixed incorrect use of require_capability() in lesson mod MDL-7314 2006-10-31 22:01:24 +00:00
skodak 40385816cd fixed gradebookroles cfg default value MDL-7253 2006-10-31 21:51:20 +00:00
skodak 1be6adbd3e fixed capabilities in chat recent activity, removed broken optimization from message insert, fixed closing of box MDL-7313 2006-10-31 21:05:05 +00:00
stronk7 d416d809a1 Prevent +/- operators (REGEXP) on glossary searches for MSSQL and Oracle. MDL-7312 2006-10-31 20:33:25 +00:00
skodak bf3c381651 fixed group related typo in has_capability() 2006-10-31 20:22:52 +00:00
stronk7 9338d432f9 Prevent +/- operators (REGEXP) on messages search. MDL-7312 2006-10-31 20:21:13 +00:00
stronk7 b2ef8fc07e transform TOKEN searches into STRING searches and trim +- chars. MDL-7312 2006-10-31 20:15:23 +00:00
stronk7 53ff8d79ee Prevent +/- operators (REGEXP) on course searches for MSSQL and Oracle. MDL-7312 2006-10-31 19:53:25 +00:00
skodak ed55a25fd5 Commented out session dump in user profile when in debug mode MDL-7311 2006-10-31 19:31:26 +00:00
ethem c92727ae6b Show notice at bottom. Merged with HEAD. 2006-10-31 19:28:18 +00:00
stronk7 5cc8148eb8 Fixed searches, list of results and simplified SQL logic. All
those while trying to fix one LCASE() use. MDL-7310
2006-10-31 19:15:30 +00:00
danmarsden 92b2d0f2dd MDL-7171 Location of guest form should be above results - where the form for submitting results would appear. 2006-10-31 18:59:38 +00:00
stronk7 ec27637e08 Now wiki supports Unicode searches 2006-10-31 17:47:52 +00:00
tjhunt 319047dfb1 Improved help file as per Ralf Hilgenstock's suggestion: http://moodle.org/mod/forum/discuss.php?d=57400 2006-10-31 15:12:56 +00:00
moodler 67145bac78 Improved display of grades when grades should not be shown MDL-7150 2006-10-31 15:06:02 +00:00
moodler 7675f212ee Fix for MDL-7238 to hide authorize interface when necessary 2006-10-31 14:04:57 +00:00
tjhunt 25e0480339 MDL-5811 - Quiz editing outputs nasty junk before print_header sometimes. Second attempt at fixing. I forgot to mention the bug number in the previous commit to mod/quiz/edit.php. 2006-10-31 12:03:43 +00:00
tjhunt 8a286fda3e Make the close_window function better. 2006-10-31 11:54:14 +00:00
bobopinna 5e73ea768b Fixed a typo 2006-10-31 11:37:40 +00:00
tjhunt fdecc5c6da Fix junk being output before print_header, which happened sometimes. 2006-10-31 10:40:07 +00:00
tjhunt f3e4a7a514 Add return option to notify() 2006-10-31 10:37:38 +00:00
skodak f966e024ef Change name when file name contains more of a point MDL-6897 - patch submitted by Toni Mas 2006-10-31 10:15:23 +00:00
moodler f3410ae74b Fix for MDL-6975 2006-10-31 09:14:43 +00:00
skodak 7e70535f09 adding of user events into calendar and posting of blogs is now enabled by default - MDL-7297 and MDL-7245 2006-10-31 09:08:27 +00:00
moodler 8def180d7a Added information about guest exception 2006-10-31 08:59:41 +00:00
toyomoyo e123a4e191 fix for MDL-7302, tagid lost when turning on/off editting 2006-10-31 08:49:46 +00:00
moodler df5ee47979 Added some styles to make role descriptions a bit smaller MDL-6923 2006-10-31 08:10:29 +00:00
moodler b18207cd3a Added help links to Roles pages MDL-6923 2006-10-31 08:09:29 +00:00
moodler f750f104ca New help files for Roles MDL-6923 2006-10-31 08:04:14 +00:00
toyomoyo cc1b52fddf removing evil semicolon 2006-10-31 07:32:21 +00:00
urs_hunkler e6f1411d72 'changed header.html to the accessibility version as standardwhite' 2006-10-31 07:31:23 +00:00
martinlanghoff 90f08155c5 lib/textlib.class: Cache dir is now created correctly, allowing speed increase (SR# 595)
Previous logic had dir created only when mbstring wasn't used, but the
typo3 lib needs to cache some data regardless, for the specCharsToASCII
function, which uses internal translation tables.


Author: Luke Hudson <luke@catalyst.net.nz>
2006-10-31 05:00:32 +00:00
moodler 24f49eaa7e Killed infinite loop when upgrading teachers! 2006-10-31 04:37:55 +00:00
moodler 086617bac8 DIsplay count for all participants 2006-10-31 01:20:00 +00:00
stronk7 088f9942ef Oracle optimization. Texts under 4000cc can be handled directly as varchar2,
so they don't need the 2-phase (insert/update) handling of LOBs
2006-10-30 23:12:41 +00:00
stronk7 6befbe8050 Fixed one bug on Oracle produced when we were inserting
records with returnid disabled and containing LOBs
2006-10-30 22:58:04 +00:00
skodak 62385afcd3 Adding of calendar events broken MDL-7297 2006-10-30 22:32:27 +00:00
skodak b9f7637ea8 fixed double enableajax in previous commit MDL-7296 2006-10-30 21:03:08 +00:00
skodak 5e435e4635 Disabled global search by default and marked as experimental MDL-7296 and AJAX moved to experimental too 2006-10-30 20:57:08 +00:00
urs_hunkler 362af1586a 'changed header.html to the accessibility version as standardwhite' 2006-10-30 20:02:26 +00:00
urs_hunkler c8305b464f 'added table.navbar {width:100%;} again for themes still using tables in the header.' 2006-10-30 19:56:50 +00:00
stronk7 f5303bd518 Prevent Oracle to fail when inserting records with log->info empty
(will be solved once we got all those NOT NULL fields fixed)
2006-10-30 19:51:44 +00:00
stronk7 d040f940a2 Fixing display of pivots when they are author names 2006-10-30 19:31:33 +00:00
stronk7 c97ab4b00a Fixing some queries with duplicate column names. MDL-7294 2006-10-30 19:01:02 +00:00
stronk7 5e8720e3a3 Now glossary is using the proper sql_substr() function 2006-10-30 18:33:04 +00:00
stronk7 3cef39f10a New function sql_substr() returns the proper substr() function for each DB 2006-10-30 18:28:47 +00:00
stronk7 0e938d8e6c Now lcase() and ucase() are out from glossary 2006-10-30 17:58:56 +00:00
stronk7 6a9781ab1f sql_as() is deprecated. Column aliases ALWAYS must use the AS keyword. 2006-10-30 17:43:40 +00:00
stronk7 18ecdd56aa Deprecating sql_as (now the AS keyword os required in COLUMN aliases) 2006-10-30 17:39:55 +00:00
stronk7 f9452850dd Updating wood to show the nav-bar properly. 2006-10-30 16:51:34 +00:00
tjhunt d2925a9397 Make General feedback more tolerant of whitespace. 2006-10-30 16:35:21 +00:00
thepurpleblob 537cef4fdd Fixed notice 2006-10-30 16:21:16 +00:00
stronk7 8319d93b45 Added enablerecordcache setting to control the get_record() cache.
Note that some parts of Moodle can enable/disable it selectively.
2006-10-30 15:55:48 +00:00
stronk7 41a96d7c4d Added some strings for the enablerecordcache setting. 2006-10-30 15:52:04 +00:00
skodak 1b88c2ef22 Wrong "settings" link in course Administration block on module pages MDL-7286 2006-10-30 14:56:11 +00:00
ethem 0d4057f406 New string: All Pending Orders 2006-10-30 11:22:57 +00:00
ethem 07182b5324 New string: All Pending Orders 2006-10-30 11:12:32 +00:00
skodak 0070770144 Journal Module fixes fro 1.7 MDL-7159 2006-10-30 11:11:34 +00:00
sam_marshall 03240ae37b [MDL-7287] Lesson - tweaked continue.php to include a file via filesystem not HTTP because I couldn't see any reason to do it the latter way and it breaks under our loadbalancing system 2006-10-30 11:00:39 +00:00
ethem 0ee01f0cda Show a link for echeck payments if an user has_capability('enrol/authorize:uploadcsv'). 2006-10-30 10:14:57 +00:00
urs_hunkler 23febf1491 'changed the property to activate the move curser to the new body class drag: body#course-view.drag' 2006-10-30 09:54:25 +00:00
moodler cf299069d4 Added "drag" hook at the page level when dragging is enabled to make sure
the blocks have the right cursor styles.
2006-10-30 09:39:58 +00:00
gbateson b3abd77235 corrected the setting of fixed flag in JMatch quizzes 2006-10-30 08:54:22 +00:00
toyomoyo 45c65f2b7e fixing new gradebookroles settings 2006-10-30 08:43:41 +00:00
ethem 6ef50f6983 Get only courses made transactions. This lessens the course list; Merged from 16stable. 2006-10-30 08:25:41 +00:00
moodler 378d834f44 Made the AJAX setting look a little better when AJAX is off 2006-10-30 08:19:30 +00:00
moodler 9a1e5c1750 FIxed a typo 2006-10-30 07:56:07 +00:00
moodler 6a691a2dba Ooops. how did this get left in? MDL-7281 2006-10-30 07:47:05 +00:00
toyomoyo a44d38fc25 do not delete context information when removing the site course 2006-10-30 06:33:25 +00:00
toyomoyo 826153a73d fixing progress count 2006-10-30 05:39:52 +00:00
toyomoyo 1e76d6529c ignore site level course teacher assignments during upgrade from 1.6 or below 2006-10-30 05:25:53 +00:00
moodler 6dce2448c4 Better default for gradebookroles 2006-10-30 03:56:25 +00:00
toyomoyo 828a4b2350 fix for MDL-6895, adding optional_param, thanks for the patch 2006-10-30 03:45:19 +00:00
toyomoyo 8300665144 fixing keyword pivot by changing into glossarypivot, MDL-7267 2006-10-30 03:36:46 +00:00
moodler 4ccdd406cb Automatic installer.php lang files by installer_builder (20061030) 2006-10-30 03:08:23 +00:00
moodler fc5711d43c Tidied up Metal theme 2006-10-30 02:58:56 +00:00
koenr 1e35150951 MDL-6864 The links 'Language editing' could be more descriptive for 1.7 stable 2006-10-29 22:35:03 +00:00
koenr af6ca730d4 MDL-7042 Missing string on admin/roles/manage.php adding to 1.7 stable 2006-10-29 22:07:54 +00:00
moodler e60154c553 Users not logged in may have capabilities but no id 2006-10-29 15:56:36 +00:00
moodler b2a2b9af0c Slight bump for gradebookroles 2006-10-29 15:06:03 +00:00
moodler a3fcc4d416 Changed gradebook_roles to gradebookroles and fixed storage/defaults for
this setting.   And also better docs.  MDL-7253
2006-10-29 14:59:43 +00:00
moodler 1809c83ef3 Added a string that had been removed - MDL-7258 2006-10-29 13:55:21 +00:00
andreabix 88b5a2a15c Fix bug MDL-7248 2006-10-29 10:07:33 +00:00
moodler ee9534257d Added some help links 2006-10-29 08:13:38 +00:00
moodler 4b612862c7 Merged to stable 2006-10-29 08:09:59 +00:00
moodler 75bf99a13c file permissions.html was added on branch MOODLE_17_STABLE on 2006-10-29 08:09:59 +0000 2006-10-29 08:07:16 +00:00
moodler fd10cafb1a Enable record caching for workshop cron (which is sloow) 2006-10-29 07:22:38 +00:00
moodler 831a8bae99 Extra caching and efficiency in forum_cron 2006-10-29 05:39:26 +00:00
moodler 36b84580e0 Fixed up the appearance of user profiles when access is not allowed 2006-10-29 04:13:32 +00:00
moodler 4bb8788c44 Make regiatration code a bit more unique 2006-10-29 02:32:34 +00:00
stronk7 e8e5f86657 Adding PIVOT as MSSQL reserved word 2006-10-28 23:11:57 +00:00
stronk7 be310ffda8 Now record_cache is controlled by $CFG->enablerecordcache 2006-10-28 19:51:57 +00:00
stronk7 cacc23f041 Moved cache cleaning code near the begin of functions. Sometimes
it wasnt' executed due to function ending. MDL-7196
2006-10-28 17:51:43 +00:00
stronk7 72a4c9a290 Updating backup release to 1.7 final (to avoid forgetting it) 2006-10-28 11:02:09 +00:00
stronk7 5d68b50a62 Improve error output of install_from_xmldb_file(). Part of MDL-7262 2006-10-28 10:36:04 +00:00
moodler 6a1055bf37 Automatic installer.php lang files by installer_builder (20061028) 2006-10-28 03:13:13 +00:00
skodak 67e43279bb fix loginsteps string in moodle.php MDL-7249 2006-10-27 21:47:58 +00:00
skodak 3f4bcbd03a Blog RSS is not being generated MDL-7256 2006-10-27 21:41:36 +00:00
skodak 74acff4411 Finish strings for graderoles MDL-7253 2006-10-27 21:04:44 +00:00
skodak d6a54ada6e Turn AJAX off for now at site level MDL-7254 2006-10-27 20:32:01 +00:00
urs_hunkler d556c2aeaa 'changed top margin for h2 in sideblock content from 0 to 1.5 em' 2006-10-27 17:49:13 +00:00
stronk7 df313f0e94 Counting extra updates performed by Oracle & MSSQL in PERF 2006-10-27 17:48:41 +00:00
urs_hunkler 4d4ef0e0b8 1.7 updates 2006-10-27 17:24:28 +00:00
stronk7 9717970b60 I forgot to globalize $record_cache in delete_record_XXX() functions. 2006-10-27 17:13:36 +00:00
stronk7 4f2ae57c31 Minor improvements to the get_record() cache. Part of MDL-7196
1) Check the cache issset() before unset() it.
2) In the set_field() function, if fieldX = 'id',
   just delete such element from the cache,
   else the whole table
3) Add some more unset() operations against the cache in
   the delete_xxxx() dmllib functions.
2006-10-27 16:51:35 +00:00
sam_marshall 6266a81cf7 MDL-7250 typo ARGH sorry. 2006-10-27 16:26:02 +00:00
sam_marshall d0f6aa914a MDL-7250 update to previous change to do in SQL as suggested 2006-10-27 16:24:26 +00:00
moodler 4c7701a6d9 Made RSS feeds work again for blogs MDL-7251 2006-10-27 16:21:39 +00:00
sam_marshall b1d476b800 MDL-7250 Slight change to load_defaultuser_role so that it doesn't load 0s into $USER->capabilities. 2006-10-27 16:16:35 +00:00
urs_hunkler eae483c5a4 'added min-width: 0; and overflow: hidden; to clearfix to make clearing work in IE7 - better way than previous one.' 2006-10-27 13:30:54 +00:00
skodak 22da58c579 Comments in data print the "by" and then the date but no username MDL-7235 2006-10-27 07:49:25 +00:00
urs_hunkler 9b657e0dec 'corrected the collapsing navbar for IE7. I thought I had corrected that some time ago??? Set the navbar width to 98% and removed those different width settings.' 2006-10-27 07:33:15 +00:00
toyomoyo 8e6f38a406 taking care of a warning 2006-10-27 02:14:20 +00:00
gbateson 537515d8e8 fixed detection and display of fixed JMatch items (in jmt files) 2006-10-27 01:34:08 +00:00
stronk7 3c5f492e9d Deprecating old "upgrade" files. MDL-7214 2006-10-26 22:25:21 +00:00
stronk7 1301de5879 New upgrade.php file added for this module. MDL-7214
Merged from HEAD
2006-10-26 18:18:35 +00:00
stronk7 87698fefb6 file upgrade.php was added on branch MOODLE_17_STABLE on 2006-10-26 18:18:36 +0000 2006-10-26 18:12:43 +00:00
stronk7 7fd096aa14 file upgrade.php was added on branch MOODLE_17_STABLE on 2006-10-26 18:18:35 +0000 2006-10-26 18:12:42 +00:00
stronk7 78dea37dbc New upgrade.php file added for this module. MDL-7214
Merged from HEAD
2006-10-26 17:43:05 +00:00
stronk7 8117a6dc8a file upgrade.php was added on branch MOODLE_17_STABLE on 2006-10-26 17:43:11 +0000 2006-10-26 17:33:45 +00:00
stronk7 866002a1ef file upgrade.php was added on branch MOODLE_17_STABLE on 2006-10-26 17:43:09 +0000 2006-10-26 17:33:44 +00:00
stronk7 c4a0e8dab6 file upgrade.php was added on branch MOODLE_17_STABLE on 2006-10-26 17:43:08 +0000 2006-10-26 17:33:43 +00:00
stronk7 b3f66a5f13 file upgrade.php was added on branch MOODLE_17_STABLE on 2006-10-26 17:43:07 +0000 2006-10-26 17:33:42 +00:00
stronk7 78fb084d02 file upgrade.php was added on branch MOODLE_17_STABLE on 2006-10-26 17:43:06 +0000 2006-10-26 17:33:41 +00:00
stronk7 08f1de55d0 file upgrade.php was added on branch MOODLE_17_STABLE on 2006-10-26 17:43:05 +0000 2006-10-26 17:33:40 +00:00
stronk7 29949f0031 New upgrade.php file added for this module. MDL-7214
Merged from HEAD
2006-10-26 17:04:36 +00:00
stronk7 24dea5f76b file upgrade.php was added on branch MOODLE_17_STABLE on 2006-10-26 17:04:36 +0000 2006-10-26 17:02:31 +00:00
stronk7 f5f53ceb7a New upgrade.php file added for this module. MDL-7214
Merged from HEAD
2006-10-26 16:53:08 +00:00
stronk7 3638683cdd file upgrade.php was added on branch MOODLE_17_STABLE on 2006-10-26 16:53:11 +0000 2006-10-26 16:33:59 +00:00
stronk7 ed1061fd15 file upgrade.php was added on branch MOODLE_17_STABLE on 2006-10-26 16:53:10 +0000 2006-10-26 16:33:51 +00:00
stronk7 fab77ea872 file upgrade.php was added on branch MOODLE_17_STABLE on 2006-10-26 16:53:09 +0000 2006-10-26 16:33:50 +00:00
stronk7 ebb351fa65 file upgrade.php was added on branch MOODLE_17_STABLE on 2006-10-26 16:53:08 +0000 2006-10-26 16:33:49 +00:00
stronk7 c8bf751abf New upgrade.php file added for this module. MDL-7214
Merged from MOODLE_17_STABLE
2006-10-26 15:44:50 +00:00
stronk7 fc10786ff1 file upgrade.php was added on branch MOODLE_17_STABLE on 2006-10-26 15:44:50 +0000 2006-10-26 15:38:18 +00:00
moodler 841c716376 Search engines need to have all the capabilities of a guest user MDL-7229 2006-10-26 14:52:17 +00:00
ethem ca36c9581f I found a new function: user_has_role_assignment() 2006-10-26 14:38:22 +00:00
sam_marshall c03b88f607 The 'Activity is currently hidden' check in mod/forum/post.php incorrectly used 'manageactivities' capability instead of 'viewhiddenactivities', fixing. 2006-10-26 14:12:40 +00:00
skodak abf7820411 fixed breadcrums link 2006-10-26 10:32:54 +00:00
moodler 6cdd66e3c5 Added a top-level cache to has_capability() to make it perform better
in cases where it's called a lot with repetitive values (which happens
a lot in things like forum mailouts) with only a small memory cost.
2006-10-26 09:42:58 +00:00
skodak 316e201245 Cron.php workaround for IE & RFC2616 - MDL-7221 2006-10-26 08:53:59 +00:00
ethem 54c9dab53b get_courses() is only getting visible courses. This is a problem when an user wants to view old payments. 2006-10-26 08:47:48 +00:00
moodler c60272d855 Variation of Sam Marshall's patch to cache simple get_record calls MDL-7196 2006-10-26 07:52:00 +00:00
vyshane d7895072ac Turning ajax off because of backend issues found in rest.php 2006-10-26 07:34:58 +00:00
vyshane 3a1d81851f Some refactoring. 2006-10-26 07:34:13 +00:00
martinlanghoff 3e82837cc0 lib/locallib: changed local db upgrades now xmldb friendly (like lib/db)
Author: Jonathan Harker <jonathan@catalyst.net.nz>
2006-10-26 04:12:49 +00:00
toyomoyo 6f0c99c7a8 fixing a bug where context with override and assignments are adding 2006-10-26 03:56:38 +00:00
moodler 7dbf7695da Automatic installer.php lang files by installer_builder (20061026) 2006-10-26 03:23:28 +00:00
stronk7 0c64299b01 First model of new upgrade.php scripts and comments in old ones.
Need validation before extending them everywhere across core. MDL-7214
2006-10-25 23:26:54 +00:00
skodak 70f97a5995 MDL-7190 fixed wrong closing ) in cache md5 calculation, sorry! 2006-10-25 23:16:44 +00:00
skodak a9530ec147 MDL-7137 permission UI improvements merged into role overrides; s() used instead of htmlentities() 2006-10-25 21:17:33 +00:00
skodak fe5cf88b17 editting of permissions enabled when adding new role MDL-7137 2006-10-25 19:19:20 +00:00
moodler 9f79ed8a3c More rogue AS keywords MDL-7207 2006-10-25 09:02:30 +00:00
moodler 868d207889 Removed use of table as xxx MDL-7207 2006-10-25 08:50:25 +00:00
toyomoyo c28941370e added new config variables for what roles to be displayed in gradebooks. It is accessbile from admin->appearance->gradebookroles. 2006-10-25 08:49:54 +00:00
moodler 5c0cd26dbf ALtered new SQL in load_user_capability to make it more friendly with MS SQL 2006-10-25 08:33:40 +00:00
moodler 8e9aa7d060 Just some tidy-ups, removed redundant SITEIDs etc 2006-10-25 08:31:09 +00:00
skodak 49cb76f312 fixed add new blog entry and tag edit in blog block 2006-10-25 08:16:36 +00:00
toyomoyo d91d2fa6d3 use limited fields instead of u.* 2006-10-25 07:19:30 +00:00
martinlanghoff 20dbeadfb3 auth/fc/config.html: cleanup double newlines (leftover from whitespace cleanup) 2006-10-25 06:13:51 +00:00
moodler 8ed24b7dda Fixed CAS login to use new roles ... see MDL-6931 2006-10-25 05:46:12 +00:00
toyomoyo 1ca7a8001b fix for load_user_capability() when 2 contexts in overrides are not related 2006-10-25 03:47:05 +00:00
skodak 5aab521e4d better cleaning of rss feeds SC#328 2006-10-24 22:38:53 +00:00
skodak a1332df845 Strip ##TRUSTTEXT## when not in developer debug mode MDL-7190; minor format_text speedup; changed in md5 text cache calculation 2006-10-24 22:18:19 +00:00
stronk7 eb2d09c49c DeLIMITing Moodle core. Now the new $limitfrom,
$limitnum parameters are used instead. MDL-7168
2006-10-24 21:55:54 +00:00
skodak e2c0f78d63 select_color.php popup should specify charset MDL-7193 2006-10-24 21:37:36 +00:00
skodak d7440e481e Lang file for auth specifies incorrect file path in lang/en_utf8/auth.php MDL-7205 revisited - new patch by Martin Langhoff 2006-10-24 21:28:55 +00:00
skodak 5fd7a8cc89 Lang file for auth specifies incorrect file path in lang/en_utf8/auth.php MDL-7205 - found by Inaki Arenaza 2006-10-24 20:48:32 +00:00
skodak 7429a293b7 fixed When unassigning a role, forum_role_unassign unsubscribes the user even if you have other roles there MDL-7120 2006-10-24 20:20:50 +00:00
stronk7 a31fec1556 Dropping some hardocded "mdl" prefixes. MDL-7202 2006-10-24 18:27:31 +00:00
moodler a8cecdc232 It's OK to be a guest when looking at a discussion :-) 2006-10-24 15:55:52 +00:00
moodler b0d3c33001 Guests should always see two days of recent activity 2006-10-24 14:35:22 +00:00
vyshane b3ede2a6f5 Modified course page print_header function to accept more arguments. Needed for the AJAX course formats. 2006-10-24 09:40:48 +00:00
moodler a804689232 QUick checkin of some roles GUI improvements from Petr which I hacked on 2006-10-24 09:39:36 +00:00
vyshane 62e0242116 AJAX config for course format. 2006-10-24 08:15:09 +00:00
vyshane 0321eb66d0 AJAX config for course format 2006-10-24 08:14:09 +00:00
vyshane 604c996ca6 AJAX fixes. 2006-10-24 08:07:56 +00:00
skodak ba7b72a53d fixed risks associated with capabilitites in modules MDL-7174 2006-10-24 08:04:53 +00:00
skodak 077b7e99c1 fixed risks associated with main capabilitites MDL-7174 2006-10-24 08:00:32 +00:00
moodler 7099595c4d FIxed problem which was unenrolling some assigns at the site level! MDL-7189 2006-10-24 07:06:56 +00:00
toyomoyo e723db1680 fixing capabilities 2006-10-24 04:26:06 +00:00
vyshane 19043b2c61 Changed <noscript> to <div> since document.getElementById() can't seem to be able to access the <noscript> element in safari, and possibly in IE as well. See bug MDL-7057. 2006-10-24 03:25:48 +00:00
moodler 97b0c002ec Make the glossary block deal with trust text 2006-10-24 02:35:29 +00:00
moodler 3c9367fb62 Guests can't enrol. MDL-7182 2006-10-24 02:12:26 +00:00
toyomoyo a064e86c8b blog tag clean up 2006-10-24 02:09:45 +00:00
stronk7 f0cb717a7e Moving deprecated uses of sql_paging_limit() to the new $limitfrom,
$limitnum parameters in all the get_recordXXX() functions. MDL-7167
2006-10-23 22:56:41 +00:00
skodak ed14ae8128 fixed moodle/calendar:manageentries capability in calendar 2006-10-23 22:27:17 +00:00
skodak 05888cfc84 Assignment Reports incomplete MDL-6301 2006-10-23 21:01:41 +00:00
skodak cca1df961b Excel export returns a zero bytes file when system temp not writable MDL-7176 2006-10-23 19:25:13 +00:00
skodak fb4f768789 error message when adding a link in editor MDL-7180 2006-10-23 18:30:13 +00:00
stronk7 1fda1af9d2 Now insert_record() is using $db->GenID() to retrieve
sequence numbers for Oracle. Just wondering if the same
function should be used by PostgreSQL too.
2006-10-23 17:38:47 +00:00
stronk7 6d338ba5f9 Suppress all the uses of LIMIT in the get_field_sql() calls. MDL-7173 2006-10-23 15:55:22 +00:00
moodler 63d4e986d0 This new function called load_all_capabilities() should be used whenever
you want to completely reload the capabilities for the current user.

Basically it will deal nicely with the default site-wide permissions
depending on the current user.

More background in the comments on MDL-6963
2006-10-23 15:14:23 +00:00
moodler 9595f6a388 FIxed some rogue &nbsp characters (thanks, Samuli!) MDL-7179 2006-10-23 13:41:27 +00:00
moodler c50d4d9039 Make sure that guests see the button to add a new discussion (it will
prompt them to enrol later)
2006-10-23 13:19:46 +00:00
skodak 1a5d7ed12e Checkbox value not saved when saving changes from admin search page MDL-7177 + other fixes to make it behave more like settings.php 2006-10-23 12:04:30 +00:00
skodak e18bb176e1 yet another context fix for Roles tab - I hope this one is final 2006-10-23 11:26:12 +00:00
skodak 42fd053ddc glossary tabs (when updating a glossary) is not aligned properly MDL-7172 2006-10-23 11:16:26 +00:00
moodler d873273749 Several little fixes for online users
Guest user appears in local language and no links

sql_paging_limit not used
2006-10-23 07:42:49 +00:00
stronk7 cba3313110 strip "old" harcoded "limit" clauses from the sql passed and
debug about them. MDL-7173
2006-10-23 07:09:51 +00:00
moodler 122ea396cf Tidied up Choice a bit and now you can save choices again ;-) 2006-10-23 07:00:29 +00:00
moodler 1b068b9049 FIxed guest enrolment using course key MDL-6881 2006-10-23 06:37:06 +00:00
moodler 8069349d65 Fix strange zero lines in stats ... I thought the function above was supposed
to do that?   Penny, help!    MDL-7151
2006-10-23 05:17:38 +00:00
moodler 1de8317f92 Better handling for guest in forums MDL-7125 2006-10-23 04:53:56 +00:00
moodler 0ff7b38264 FIxed a bad capability ratepost -> rate 2006-10-23 03:28:53 +00:00
toyomoyo 9fc48040ba replacing studentcanpost with proper capability 2006-10-23 03:22:23 +00:00
moodler 1752044872 Unenrol now does the right thing after you unenrol yourself 2006-10-23 03:09:11 +00:00
moodler 685ecea312 Automatic installer.php lang files by installer_builder (20061023) 2006-10-23 03:03:57 +00:00
moodler ef90bd2c06 Improvements to the logic used when displaying choices and coping with
guests and various permission combinations    MDL-7171
2006-10-23 02:58:21 +00:00
toyomoyo bcf99ba3b9 replacing studentcanpost with capability 2006-10-23 02:48:24 +00:00
toyomoyo 48e385f582 student_can_post should be done properly using capabilities 2006-10-23 02:24:28 +00:00
stronk7 f9baa9c1cc Prevent MSSQL to return from insert_record() before
trying to execute the updating of LOBs.
2006-10-23 00:00:46 +00:00
stronk7 564f9b03e6 Debugging sql_paging_limit() as deprecated and
enforcing get_field_sql() to return 1 record max
2006-10-22 23:20:14 +00:00
stronk7 a270bb477a Killing all sql_paging_limit() uses 2006-10-22 22:57:27 +00:00
stronk7 23f4b83ec6 Killing all sql_paging_limit() uses 2006-10-22 22:47:58 +00:00
stronk7 28c5a47afc Adding limitfrom and limitnum parameters to a bunch of
rarely executed functions...
2006-10-22 22:35:26 +00:00
skodak b52e9a106c fixed incorrect context in user Outline report 2006-10-22 20:02:00 +00:00
skodak 0d2fdd9cd9 fixed $usercontext creation needed for Role tab when viewing user data 2006-10-22 19:58:06 +00:00
skodak 591234f350 fixed sql error when searching only by one letter and two radio buttons selected at the same time (visible in Konqueror) fixed as part of MDL-7160 2006-10-22 19:41:07 +00:00
skodak 1b2f2b82f0 fixed moodle/site:readallmessages MDL-7160 ; commented out unfinished buggy code 2006-10-22 19:17:48 +00:00
moodler 85e21f03a1 FIxed this script to match prtin_recent_activity MDL-7134 2006-10-22 08:29:50 +00:00
moodler 864dbb4ae7 Fixed a missing </span> 2006-10-22 08:25:19 +00:00
moodler 247475fc9f Fixed some HTML errors about & 2006-10-22 08:18:46 +00:00
moodler 2fb18d1cdc FIxed some HTML warnings 2006-10-22 08:12:14 +00:00
moodler 74f65d5ef6 FIxed some HTML warnings & -> &amp; 2006-10-22 08:11:55 +00:00
moodler 3443f0a7b2 Removed a HTML warning & --> &amp; 2006-10-22 07:59:04 +00:00
moodler ab05be1a23 Recent activity now again shows all the activity since your last session in
the course.   MDL-7134
2006-10-22 07:40:51 +00:00
moodler 0aba3fd198 Automatic installer.php lang files by installer_builder (20061022) 2006-10-22 03:11:23 +00:00
skodak 2466ff5d77 Seeing ####TRUSTTEXT#### in RSS feeds MDL-7147 - fixed RSS feeds in glossary 2006-10-21 21:14:30 +00:00
skodak fc0966ba1f Seeing ####TRUSTTEXT#### in RSS feeds MDL-7147 - fixed RSS discussion feed type too 2006-10-21 21:04:29 +00:00
skodak 83e674cd7f fix has_capability() to work when $nomoodlecookie = true; MDL-7156 - needed for RSS file.php that is serving feeds 2006-10-21 20:41:41 +00:00
skodak 9468a32a8e fixed undefined modcontext in forum 2006-10-21 20:29:30 +00:00
stronk7 01cd957389 Deleting some old oci8po files from CVS. 2006-10-21 18:31:00 +00:00
stronk7 d0d30cb9a0 Prevent add_field() to work if we are adding one not null field
to one non-empty table without specifying its default value.
2006-10-21 18:18:24 +00:00
stronk7 3bbc55a650 Added two more tests:
- To check adding numerial fields not null + default = 0
- To test set_field() with TEXT data
2006-10-21 17:22:31 +00:00
stronk7 0f1d2d8c94 Minor typo fixed. 2006-10-21 17:17:44 +00:00
moodler da8b22453c Fix for the My courses list (remove things you might be able to access but
aren't really enrolled as such)
2006-10-21 16:32:10 +00:00
stronk7 d490ba1476 One typo (!==) was preventing defaults to be properly calculated for integers.
Thanks to Nigel McNie for being on that!
2006-10-21 16:31:44 +00:00
moodler 408a5a1b03 Fix for the My courses list (remove things you might be able to access but
aren't really enrolled as such)
2006-10-21 16:30:23 +00:00
moodler 0ec5eaa5ca LAMS is now disabled by default so it doesn't confuse the heck out of
everyone.
2006-10-21 16:10:07 +00:00
moodler e4173bf72a Fixed a notice (not important) 2006-10-21 15:59:23 +00:00
moodler 55a96b2f3e Please please please be defensive about values returned from the database. Always.
In this case moodle.org had some bad data that caused this code to crash.

MDLSITE-55
2006-10-21 14:51:56 +00:00
moodler 1a42831794 Strip trusttext markers from text ... MDL-7147
Petr, can you review the whole thing?
2006-10-21 14:11:33 +00:00
moodler 571acdabaa Automatic installer.php lang files by installer_builder (20061021) 2006-10-21 03:03:54 +00:00
moodler f7396c7867 WHen a guest hits reply, they now get told they have to enrol and
get sent there.   In manual enrolment they are returned to the post
(eventually all the plugins should do that).
2006-10-20 17:48:59 +00:00
moodler c1bfa6076c Enrol/unenrol buttons in courses 2006-10-20 17:47:14 +00:00
moodler f9e8f1118d Exclude admins from the participant listing (site-wide doanything people)
(related to MDL-7117)
2006-10-20 08:25:39 +00:00
toyomoyo 8d1ea9fbed fix for MDL-7119, users with no role assign capability should not see roles tab 2006-10-20 08:09:09 +00:00
moodler 9197f258b9 Added Javascript, CSS etc on edit page for database. MDL-7100 2006-10-20 07:34:14 +00:00
toyomoyo bbaae076fa fix for MDL-7106, glossary capability check 2006-10-20 07:00:49 +00:00
moodler 7ba21c9f41 CHanged default capability for database to allow guests to view by default
MDL-7118
2006-10-20 06:58:28 +00:00
moodler 8f211852b7 New automatic installer lang file added (from HEAD) 2006-10-20 06:55:03 +00:00
moodler 0a1dc0b126 file installer.php was added on branch MOODLE_17_STABLE on 2006-10-20 06:55:03 +0000 2006-10-20 06:52:11 +00:00
moodler 104b23ff7f I've fixed how the forums look when guest is logged in, so that they
see the Reply link and if they press it get asked to log in properly.
2006-10-20 06:07:33 +00:00
toyomoyo d7355da165 fix for MDL-7115, teacher page replaced by generic role assign page 2006-10-20 05:47:49 +00:00
moodler 64a985181b Link to roles interface needs site context, not site id 2006-10-20 05:17:39 +00:00
moodler 9fb2199303 Don't let people message the user account 2006-10-20 05:14:12 +00:00
toyomoyo 0e4429dfec fixed an infinite loop 2006-10-20 05:08:42 +00:00
moodler 09a47d4232 Slight tidy-up for forum search form 2006-10-20 03:33:18 +00:00
vyshane f39c91312f Formatting fixes. 2006-10-20 03:16:40 +00:00
toyomoyo f0769c5367 fix for MDL-7107, missing capability check for assignroles link 2006-10-20 03:14:49 +00:00
moodler 68199074d8 Automatic installer.php lang files by installer_builder (20061020) 2006-10-20 03:05:31 +00:00
toyomoyo 8807ea9497 fix for MDL-7113, removing DISTINCT on TEXT fields 2006-10-20 02:43:32 +00:00
toyomoyo 60061f9d34 setting $CFG->unicodedb after successful db conversion, chaning order of if clause to save sqls executed 2006-10-20 02:07:00 +00:00
skodak 4cbb779866 temporary patch for the forum trouble that is breaking installs MDL-7114 2006-10-19 22:42:44 +00:00
skodak 7add89d356 fixed rolesactive notice during installation 2006-10-19 22:17:12 +00:00
skodak a3faf996f5 Internal zipping broken on win32 MDL-7105 ; we are now using the new method to specify file names in zip archive because the old PCLZIP_OPT_REMOVE_PATH option is broken on win32 platforms ; backported from HEAD 2006-10-19 22:14:42 +00:00
stronk7 1dd6d5a8a2 Adding support for the new mssql_n driver 2006-10-19 22:12:55 +00:00
stronk7 c4020445c4 Adding support for the new mssql_n driver 2006-10-19 22:01:56 +00:00
stronk7 3b455ec7d2 New ADOdb driver that extends the standard mssql one. All it does is
to prepend the 'N' char before any SQL literal sent to DB, mainly
because nobody (ODBTP, FreeTDS, ODBC, SQL*Server) seems to be doing
this task, and it prevents, in an high degree true cross-db compatibility.

Once we've moved to prepared statements and some of the developers for
any of the products above (hopefully MS, at server level) will avoid
the 'N', we'll be able to go back to another mssql drivers.

More info at:
  - http://docs.moodle.org/en/XMLDB_Problems (point 8)
  - http://tracker.moodle.org/browse/MDL-6877

Merged from HEAD
2006-10-19 21:58:54 +00:00
stronk7 760f271b07 file adodb-mssql_n.inc.php was added on branch MOODLE_17_STABLE on 2006-10-19 21:58:54 +0000 2006-10-19 21:57:23 +00:00
stronk7 bf28e6d08a Adding support for the new mssql_n driver
Two new strings added: mssql_n, databasesettingssub_mssql_n
One string modified: databasesettingssub_mssql
2006-10-19 18:55:39 +00:00
stronk7 13f366f87b Adding support for the new mssql_n driver 2006-10-19 18:44:07 +00:00
stronk7 c9c2c6df00 Adding support for the new mssql_n driver 2006-10-19 18:28:05 +00:00
stronk7 ba1fa71220 Addding support for the new mssql_n ADOdb driver that,
transparently, prepends the N char for all the string
literals being set to MSSQL (until MS Unicode - standard-
support will arrive).
2006-10-19 17:26:09 +00:00
thepurpleblob 08afbd8644 Focus is now loaded into Name edit box 2006-10-19 13:05:09 +00:00
tjhunt 3e1a16bbbc Fix problem with multichoice question grading. 2006-10-19 11:54:05 +00:00
tjhunt 2620831e61 Missing addslashes. 2006-10-19 10:22:38 +00:00
toyomoyo 040c22892d fix for MDL-6549, wrong publish to menu problem 2006-10-19 06:41:04 +00:00
toyomoyo 43059890b7 making the site context same as the site course context 2006-10-19 06:15:42 +00:00
vyshane 03796898f6 Fix for MDL-7086.
Some versions of IE choke if the second argument of insertBefore() is null. The code in section_class.prototype.insert_resource() wrongly assumed that the value of targetel would be null if that parameter was not passed to the function. The value is actually 'undefined' in this case. The checks that relied on comparison with null were therefore failing in IE (but worked fine in other browsers anyway). Two problems - wrong assumption in code, and IE being stupid.
2006-10-19 04:29:55 +00:00
moodler ecaa25ff09 Automatic installer.php lang files by installer_builder (20061019) 2006-10-19 03:03:48 +00:00
toyomoyo 9a055d09c9 adding check to change_db_encoding to make sure the db is not already in unicode. attempts to configure correct set names upon successful conversion 2006-10-19 02:13:32 +00:00
skodak c95fff4fa9 Delete user fails if apostrophe in email address MDL-4762 ; found and solution provided by Inaki Arenaza 2006-10-18 21:45:10 +00:00
skodak 324480d4b2 fixed access check when editting notes in advanced upload assignment type 2006-10-18 21:32:50 +00:00
skodak 4d4a11fd68 fixed Notices after assignment deletion in Recent Activity MDL-7089 2006-10-18 21:01:25 +00:00
skodak 89a8bdc8cc improved validation when deleting comments from glossary SC#325 2006-10-18 20:20:18 +00:00
skodak 8a2bccf264 Notice when creating one forum... MDL-7063 2006-10-18 19:58:13 +00:00
skodak f697f01e35 changed email obfuscation character to * MDL-6935 2006-10-18 19:40:27 +00:00
thepurpleblob 976fe7c655 Put cursor in edit box rather than do nothing for labels. 2006-10-18 13:02:53 +00:00
ethem e6ecbb498b Show results and send email to admin. 2006-10-18 12:38:44 +00:00
skodak 37e6138a3c Deleting uploaded files when deleting an assignment instance + fixed quoting style + trailing whitespace MDL-6387 2006-10-18 11:13:32 +00:00
skodak e7514ae3f1 Deleting uploaded files when deleting an assignment instance + fixed quoting style MDL-6387 2006-10-18 11:12:49 +00:00
skodak 81f9b42660 Deleting uploaded files when deleting an assignment instance MDL-6387 2006-10-18 11:11:53 +00:00
vyshane 7c5bebadf1 More IE timing issues 2006-10-18 09:43:12 +00:00
skodak d1a0531ca4 fix course reset unenrollment in to work with roles MDL-7069 2006-10-18 09:18:36 +00:00
vyshane 5f536e23ed Because IE is stupid. 2006-10-18 08:39:34 +00:00
toyomoyo 16d42c3776 fix for MDL-7067, proper capability for forum attachments 2006-10-18 08:00:00 +00:00
toyomoyo ca108ade8d fix for MDL-7066, users with replypost set to prohibit can not edit own post 2006-10-18 07:49:13 +00:00
vyshane 8997698305 Logger has issues with IE. Turning off first until new version of YUI has been tested. 2006-10-18 07:41:32 +00:00
toyomoyo 9cb996a977 added code to force chaging of mysql db to utf8 before fresh installation 2006-10-18 07:24:49 +00:00
vyshane 6f7fcae9f2 Removed YUI debug since this is handled in lib/ajaxlib.php 2006-10-18 07:09:54 +00:00
vyshane 44089f2cb4 Removed YUI debug since this is handled in lib/ajaxlib 2006-10-18 07:09:22 +00:00
vyshane 5140419a14 Added YUI logger console if debugging level is DEBUG_DEVELOPER. 2006-10-18 07:06:39 +00:00
vyshane d0bc1c59ae .error class is defined in Moodle as red colour. We want it to be black here because the yui error class has a red backgroun. 2006-10-18 07:02:58 +00:00
toyomoyo f3726ba3b2 fix for MDL-7055 - prohibts at site level not working 2006-10-18 06:44:45 +00:00
toyomoyo e1079fc4f1 fix for MDL-7065 adding translation string for breadcrumb 2006-10-18 05:40:39 +00:00
moodler a8500a96f8 Automatic installer.php lang files by installer_builder (20061018) 2006-10-18 03:04:33 +00:00
stronk7 325bbaaa17 Now insert/update/set of BINATY fields is supported by MSSQL
(and easier to add new DB in the furure) MDL-7062
2006-10-17 23:34:52 +00:00
stronk7 12961dfd4d Added 4 more tests to check CLOB/BLOB handling across all DBs. MDL-7062 2006-10-17 23:28:08 +00:00
tjhunt c646026617 MDL-6315 - Manually grading a question 0 marks was not being registered. I took the opportunity to clean up the logic in this function a bit. Merged from MOODLE_16_STABLE. 2006-10-17 23:21:24 +00:00
tjhunt 6dfa18dff6 MDL-6848 - Display problem with < > characters in shortanswer when outputting the correct answer. Merged from MOODLE_16_STABLE. 2006-10-17 22:17:05 +00:00
tjhunt 269a213980 MDL-6386 - stripslashes missing in multianswer qustions. Thank to Joseph Rezeau. Merged from MOODLE_16_STABLE. 2006-10-17 22:01:13 +00:00
tjhunt 311a061ce1 MDL-7054 - Prevent creation of question categories with blank names. Merged from MOODLE_16_STABLE. 2006-10-17 21:42:50 +00:00
skodak f152f333d0 fixed role_capabilities table name typo 2006-10-17 21:39:59 +00:00
skodak 24ec651269 Fix forum reset - remove "DELETE .. USING ... " mysqlisms MDL-7053 2006-10-17 21:05:34 +00:00
skodak 8abe956ca8 Automatic deletion of users when deleteunconfirmed is setted to 'never' MDL-6726 2006-10-17 20:42:49 +00:00
skodak 8e1ae566f2 Activitynames filter case insensitive again for non-ascii languages MDL-6054 - I hope it will not be choking on invalid UTF-8 data 2006-10-17 19:45:34 +00:00
skodak b0b359cd73 Broken longtimenosee option - PHP notice errors during cron MDL-7058; found and solution submitted by Jenny Gray 2006-10-17 19:15:38 +00:00
skodak 1ad395e023 moodle.php strings for log file restore needs some fix - xhtml compliance and removed \n - MDL-7056 again :-( 2006-10-17 18:52:19 +00:00
skodak b1e07b8879 moodle.php strings for log file restore needs some fix - xhtml compliance and removed \n - MDL-7056 2006-10-17 18:50:20 +00:00
stronk7 4d78c38a37 Fixed typo that was preventing correct BLOB storage under Oracle. 2006-10-17 18:29:35 +00:00
tjhunt bb9cae5afc MDL-6760 - cannot insert the string 'null' into the database. You can now. 2006-10-17 15:58:00 +00:00
tjhunt 9051e08619 Fix bug with numerical questions with multiple answers. 2006-10-17 15:56:40 +00:00
thepurpleblob cec1b35f86 fix for bug MDL-7070. Form focus not defined 2006-10-17 12:40:26 +00:00
tjhunt 2fe45c4a0a Fix bugs with GIFT import. 2006-10-17 10:51:44 +00:00
moodler b40e18c325 Cleaned up some navigation when posting 2006-10-17 09:07:26 +00:00
moodler d72975122f Fixed slashes problem on re-editing new post MDL-7052 2006-10-17 08:58:00 +00:00
vyshane 7508d0918f Merged from 1.6. Fixes for MDL-6363 2006-10-17 07:19:19 +00:00
skodak a91a3c5c79 RSS update and caching broken for some feeds MDL-7045 2006-10-17 07:07:37 +00:00
skodak a30e48bc6a Typo improvement in assignment.php string MDL-7046 2006-10-17 06:28:00 +00:00
toyomoyo 6cb0f10970 fix for MDL-6884 2006-10-17 06:24:54 +00:00
vyshane a0de778c07 Added browser check for AJAX 2006-10-17 05:31:36 +00:00
toyomoyo b866247504 fix for MDL-6968 2006-10-17 05:18:02 +00:00
toyomoyo 33dc359ccc proper fix for MDL-6926 2006-10-17 04:45:21 +00:00
toyomoyo 9b6c468b16 fix for MDL-6926 2006-10-17 04:37:18 +00:00
vyshane de028f7715 Added marker that shows the new position of a resource/activity being moved. Part of the fix for MDL-6991. 2006-10-17 03:57:42 +00:00
moodler 4be0a0c1b5 Automatic installer.php lang files by installer_builder (20061017) 2006-10-17 03:06:23 +00:00
stronk7 7873f331ea Added one more XMLDB test for find_sequence_name() 2006-10-16 17:56:30 +00:00
stronk7 f8961f9bc0 Added support for getSequenceFromDB() to PG. 2006-10-16 17:33:24 +00:00
tjhunt d0949f39e9 Changes to dmllib seem to have broken quiz backup. This makes it work again. 2006-10-16 14:53:34 +00:00
tjhunt 042699bf23 Related to MDL-6249 - unit tests for address_in_subnet. 2006-10-16 13:40:19 +00:00
tjhunt 49163d4fb6 MDL-6249 - easier way for human beings (as opposed to network engineers) to specify IP ranges. 2006-10-16 13:35:51 +00:00
urs_hunkler 6ad9639961 'changed the body border due to a YUI bug and added Bitstream Vera Serif for better display in Linux browsers. It looks better than Georgia on Windows ;-)' 2006-10-16 12:24:44 +00:00
urs_hunkler 694c70e8e6 'changed the body border due to a YUI bug and added Bitstream Vera Serif for better display in Linux browsers. It looks better than Georgia on Windows ;-)' 2006-10-16 12:16:42 +00:00
tjhunt 4398b01077 MDL-6650 - Previewing individual random questions from the quiz editing screen was not working, and anyway, I'm not sure it makes any sense, so I removed that preview link. 2006-10-16 11:04:18 +00:00
thompson697 95df21e3ae Apply modularity to the creation of the log file during restore to a new course.
Remove the responsibility for loging the application of the course start date offset,
from activity modules to the backup module.
2006-10-16 10:40:48 +00:00
tjhunt 6fe671e94a MDL-6984 - Problem with Blackboard 5 import in PHP5. Fix based on a suggestion from Arthur Manning. Merged from MOODLE_16_STABLE. 2006-10-16 10:13:38 +00:00
ethem 92fa909b5e + New consts for authorize_action() function:
* AN_RETURNZERO: No connection was made on authorize.net.
  * AN_APPROVED: The transaction was accepted.
  * AN_DECLINED: The transaction was declined.
  * AN_REVIEW: The transaction was held for review.

+ Fix: Speacial handling for echecks: REVIEW; 'Under Review', 'Approved Review', 'Review Failed'
+ New feature: Upload a CSV file for echecks (capability: enrol/authorize:uploadcsv level: user)
+ New feature: Search payments by orderid and transid
+ New function: send_welcome_messages()

merged from 17stable.
2006-10-16 09:43:15 +00:00
ethem 7b23572651 + New consts for authorize_action() function:
* AN_RETURNZERO: No connection was made on authorize.net.
  * AN_APPROVED: The transaction was accepted.
  * AN_DECLINED: The transaction was declined.
  * AN_REVIEW: The transaction was held for review.

+ Fix: Speacial handling for echecks: REVIEW; 'Under Review', 'Approved Review', 'Review Failed'
+ New feature: Upload a CSV file for echecks (capability: enrol/authorize:uploadcsv level: user)
+ New feature: Search payments by orderid and transid
+ New function: send_welcome_messages()
2006-10-16 09:26:04 +00:00
ethem e9369e5282 + New consts for authorize_action() function:
* AN_RETURNZERO: No connection was made on authorize.net.
  * AN_APPROVED: The transaction was accepted.
  * AN_DECLINED: The transaction was declined.
  * AN_REVIEW: The transaction was held for review.

+ Fix: Speacial handling for echecks: REVIEW; 'Under Review', 'Approved Review', 'Review Failed'
+ New feature: Upload a CSV file for echecks (capability: enrol/authorize:uploadcsv level: user)
+ New feature: Search payments by orderid and transid
+ New function: send_welcome_messages()
2006-10-16 09:09:14 +00:00
skodak 74b0c7ac01 MDL-6444 Typo in Course/Report/Participation/index.php, patch by Stephen Bourget 2006-10-16 09:05:48 +00:00
skodak e01a96ef15 reverting moved $SITE reinitialisation into setting method, it was not a good idea after all 2006-10-16 08:52:52 +00:00
skodak 00d69809d4 backported new adodb 4.93 from HEAD 2006-10-16 08:42:51 +00:00
skodak 02d7853dab MDL-6985 Role Short name cannot be modified 2006-10-16 08:33:45 +00:00
skodak 7f5f0ae62b fixed error message when empty site full or short name - moved $SITE reinitialisation into setting method 2006-10-16 07:52:52 +00:00
skodak b5a814308a PARAM_MULTILANG is now alias of PARAM_TEXT 2006-10-16 07:45:32 +00:00
skodak f22675fed9 fixed error message when empty site full or short name 2006-10-16 07:35:12 +00:00
skodak 1f45359727 moved header after the redirects and require_logout 2006-10-16 06:51:08 +00:00
moodler 7fe0a5d596 Automatic installer.php lang files by installer_builder (20061016) 2006-10-16 03:06:22 +00:00
vyshane e83bdb2c03 Removed 'student' from lang string for module visibility. 2006-10-16 02:52:15 +00:00
vyshane 3b253287d7 Removed 'student' from lang string for module visibility 2006-10-16 02:51:38 +00:00
vyshane bf252c1d4a Added rebuild_course_cache() call when a resource is deleted. Related to MDL-6912. 2006-10-16 02:42:59 +00:00
danmarsden cf0d9e996b Fix for MDL-6550 - patch from Graeme Byrne thanks! :-) 2006-10-15 23:59:18 +00:00
stronk7 670eea76db New block upgrade functions must be called:
xmldb_block_BLOCKNAME_upgrade()

Part of MDL-6786, just for consistency.
2006-10-15 23:02:07 +00:00
stronk7 59359cde79 Now set_field() supports Oracle LOBs. Better error handling of oracle_update_lobs() 2006-10-15 20:11:14 +00:00
stronk7 2794229c55 Now update_record() supports LOBs under Oracle. Plus prevent empty objects to be updated. 2006-10-15 19:37:58 +00:00
stronk7 626caefd89 Minor changes + debug info in UpdateXlob() 2006-10-15 18:34:38 +00:00
stronk7 6880e3bb16 - Introducing the first version of the new mssql_n adodb driver (not finished, just for experimenting).
- Now insert_record() is handling Oracle CLOBS and BLOBS properly (really annoying the number of hacks needed).
- Creating one new global object to cache $db->MetaColumns() calls per request, because it's being used
in a lot of places inside dmllib.
TODO: hack update_record() and set_field() to allow Oracle LOBs
      enclose all the Oracle function calls into one db transaction
2006-10-15 16:38:22 +00:00
moodler ed0dd58cf2 Automatic installer.php lang files by installer_builder (20061015) 2006-10-15 03:03:20 +00:00
moodler 1c52f98506 Removed fucks 2006-10-14 07:27:30 +00:00
moodler 5aac129459 Automatic installer.php lang files by installer_builder (20061014) 2006-10-14 03:05:28 +00:00
stronk7 43efbf3deb Now admin/index.php checks for proper prefixes (MDL-6230) 2006-10-13 23:47:19 +00:00
gustav_delius 408964a73b When javascript was turned off the group menu did not work because the Go button linked to course/view.php rather than mod/forum/view.php 2006-10-13 23:28:09 +00:00
stronk7 b0c015e156 Now installer:(MDL-6823)
- performs Oracle charset checks (both client and server)
- prefix checks
- shows differnt information foreach DB flavour
- provide one link to Moodle Docs for MSSQL and Oracle
- the ODBC connector has been marked as experimental due
  to confirmed problems by MS
2006-10-13 18:18:44 +00:00
stronk7 b47138f834 Some more strings added to the installer to make it more resposible. 2006-10-13 17:22:14 +00:00
stronk7 40652b156b Added new strings for DB select/configure. 2006-10-13 11:32:42 +00:00
nfreear afa39a8fa8 Fixes bug MDL-6896, "Global search block - relative form URL broken". Merged from MOODLE_17_STABLE branch. 2006-10-13 09:15:24 +00:00
moodler c52128df17 Automatic installer.php lang files by installer_builder (20061013) 2006-10-13 03:06:54 +00:00
toyomoyo c0234d300b fix warnings during restore 2006-10-13 02:53:03 +00:00
stronk7 ddc35e5bd5 First cut of the modified installer. TODO:
- Create the new databasesettingssub_XXXX strings with info foreach db.
- Check prefix rules (mandatory to everybody but MySQL and no longer than 2cc for Oracle
- Ignore "database" for odbc_mssql driver
- Check "oci8po" DB character set
- Beautify the strings showed in the popupmenu (Oracle, SQL*Server....) instead of
  showing the driver name
2006-10-12 17:42:42 +00:00
moodler fb904d1889 Automatic installer.php lang files by installer_builder (20061012) 2006-10-12 12:36:10 +00:00
stronk7 5d7850d42e Small change in rename_field() so objects won't become modified at all
in the process.
2006-10-12 12:25:03 +00:00
toyomoyo 52657c4298 fixing warnings 2006-10-12 08:32:16 +00:00
toyomoyo bd2930f2b1 fixing warnings 2006-10-12 08:25:46 +00:00
toyomoyo 6cebd028b9 fixing warnings during restore 2006-10-12 08:01:27 +00:00
toyomoyo 1e006c3d5f removing warnings during restore 2006-10-12 07:32:29 +00:00
moodler d5ebb85dce Made the page a lot friendlier when you access a course in a switched Guest role.
MDL-6885 has details
2006-10-12 07:27:18 +00:00
vyshane be653a00cc Some cleanups (mostly formatting). 2006-10-12 07:08:16 +00:00
moodler a1dfc10135 Documentation for stable branch numbering 2006-10-12 07:05:49 +00:00
toyomoyo e67dfebaca fixing notices 2006-10-12 06:57:39 +00:00
toyomoyo 33a9f3495e fixing warnings during restore 2006-10-12 06:12:00 +00:00
moodler e1f8632d26 Added some tooltips to the role buttons to help when you down the bottom of
the list and can't see the headings.   MDL-6886
2006-10-12 03:54:48 +00:00
toyomoyo 82192c1bd8 fix warnings during restore 2006-10-12 03:36:13 +00:00
toyomoyo b59efda13c fixing warnings during restore 2006-10-12 03:30:00 +00:00
moodler 044f9df97e Saving settings is now faster (no redirect), and you get better feedback on errors. 2006-10-12 03:24:49 +00:00
toyomoyo 3743bfe506 fixing warnings during restore 2006-10-12 02:48:47 +00:00
toyomoyo 90beaec2eb fixing warnings during restore 2006-10-12 02:39:17 +00:00
toyomoyo f758baa9ac fixing warnings during restore 2006-10-12 02:30:38 +00:00
toyomoyo 42a5861017 getting rid of wawrnings 2006-10-12 02:13:06 +00:00
tjhunt c9ddd414c7 Take out 8) smiliey that interfeers with ligitimate content like (1998). 2006-10-11 16:29:54 +00:00
moodler 6b0ee8e3d7 Merged version from MOODLE_16_STABLE which never got into HEAD 2006-10-11 09:21:30 +00:00
toyomoyo e4db399ca5 fix for MDL-6900 2006-10-11 07:38:14 +00:00
vyshane 43b3cb4230 Fix for MDL-6674. <ul> was being added before the wrong node when sections are initialised on page load. 2006-10-11 06:56:55 +00:00
toyomoyo 8bf4dbe31c just in case you don't have roles assignable 2006-10-11 06:34:22 +00:00
moodler 471a2de79c Non-editing teachers can't manage activities! MDL-6910 2006-10-11 06:24:10 +00:00
moodler a0ba79ded7 All the PREVENTS from the legacy roles have been removed
(and thus are treated as INHERIT by default).

See MDL-6907 for details.
2006-10-11 06:16:16 +00:00
moodler 252b76e7aa Switch roles now works properly for admins at module level! 2006-10-11 05:47:36 +00:00
vyshane fe6ed5c2c2 Fix for MDL-6912. The script was not deleting module instances properly. We need to call the module cleanup function <modname>_delete_instance() whenever we delete a module instance. 2006-10-11 05:41:41 +00:00
jamiesensei ea95720fe5 *** empty log message *** 2006-10-11 05:32:35 +00:00
toyomoyo 916ad6bf7e fix for MDL-6882 context check broken for calendar 2006-10-11 05:23:14 +00:00
toyomoyo ef10c059ef fixed wrong capability checks 2006-10-11 03:47:14 +00:00
toyomoyo 770f2e2ab1 fixed assign_capability() function so that it's no longer writing '0's into db 2006-10-11 02:13:46 +00:00
sam_marshall e364a5368d Wiki: fixed issue if you tried to set a page content to completely blank (you need to switch the html editor into text mode to get this, otherwise it puts in <br/>, but one of our QA people managed to find it anyway).
Also corrected whitespace on some of the lock stuff (weird - how did those tabs get in there? hrm)
2006-10-10 17:15:40 +00:00
65560 changed files with 773143 additions and 9207735 deletions
-185
View File
@@ -1,185 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Generates tsconfig.aliases.json for cross-component TypeScript imports.
*
* Moodle ESM source files can import from other components using the alias
* scheme @moodle/lms/<component>/* (e.g. @moodle/lms/core/SomeUtil). This
* file reads the Moodle component registry (.grunt/components.js), finds every
* component that has a js/esm/src/ directory, and writes the corresponding
* TypeScript path mappings to tsconfig.aliases.json.
*
* tsconfig.json extends tsconfig.aliases.json, so TypeScript picks up the
* mappings automatically. The file is skipped if its content is unchanged, to
* avoid unnecessary rebuilds.
*
* This must run before esbuild compilation. The Grunt `jsconfig` task calls
* generateAliases() so that both jsconfig.json and tsconfig.aliases.json are
* kept in sync. The `react` task depends on `jsconfig`, so aliases are always
* up to date before a React build.
*
* @copyright 2026 Adrian Greeve <adrian@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
import fs from "fs";
import path from "path";
import { createRequire } from "module";
const rootDir = process.cwd();
const tsconfigOut = path.join(rootDir, "tsconfig.aliases.json");
const TS_ALIASES_WARNING =
"// WARNING: Do not edit this file manually. It is generated by `grunt jsconfig`.\n";
/**
* Load Moodle component paths from `.grunt/components.js`.
*
* @returns {Record<string, string>} Map of component paths to component names.
*/
function loadComponentPathMap() {
const require = createRequire(import.meta.url);
// Load Moodle's components data from .grunt/components.js.
const { fetchComponentData } = require(
path.join(process.cwd(), ".grunt", "components.js")
);
// Format: `{ components: { "public/lib": "core", ... } }`.
const componentsData = fetchComponentData().components;
// Expected:
// `{ "public/lib": "core", "public/ai": "core_ai", ... }`.
return componentsData;
}
/**
* Compare two TypeScript `paths` maps for exact equality.
*
* @param {Record<string, string[]>} a First paths map.
* @param {Record<string, string[]>} b Second paths map.
* @returns {boolean} True when keys and values match in order.
*/
function pathsEqual(a, b) {
const aKeys = Object.keys(a);
const bKeys = Object.keys(b);
if (aKeys.length !== bKeys.length) {
return false;
}
for (const key of aKeys) {
if (!Object.prototype.hasOwnProperty.call(b, key)) {
return false;
}
const aArr = a[key] ?? [];
const bArr = b[key] ?? [];
if (aArr.length !== bArr.length) {
return false;
}
for (let i = 0; i < aArr.length; i++) {
if (aArr[i] !== bArr[i]) {
return false;
}
}
}
return true;
}
/**
* Parse JSON content and tolerate line comments.
*
* @param {string} content Raw JSON/JSONC file content.
* @returns {unknown}
*/
function parseJsonWithComments(content) {
const stripped = content
.replace(/^\uFEFF/, "")
.replace(/^\s*\/\/.*$/gm, "");
return JSON.parse(stripped);
}
/**
* Convert JSON output so single-value arrays are rendered on one line.
*
* @param {unknown} obj Data to stringify.
* @returns {string} JSON string with flattened single-value arrays.
*/
function stringifyFlatArrays(obj) {
const json = JSON.stringify(obj, null, 2);
return TS_ALIASES_WARNING + json.replace(/\[\s+\"(.*?)\"\s+\]/g, '["$1"]') + "\n";
}
/**
* Generate `tsconfig.aliases.json` from Moodle component metadata.
*
* Includes core aliases, discovers plugin React source aliases, and skips
* rewriting when aliases have not changed.
*
* @returns {void}
*/
export function generateAliases() {
const componentPathMap = loadComponentPathMap();
// Build TS paths for tsconfig.aliases.json
/** @type {Record<string, string[]>} */
const tsPaths = {
// Always include core alias.
"@moodle/lms/core/*": ["./public/lib/js/esm/src/*"],
};
for (const [componentPath, componentName] of Object.entries(componentPathMap)) {
const runtimeAliasKey = `@moodle/lms/${componentName}/*`;
const targetPattern = `./${path
.join(componentPath, "js", "esm", "src", "*")
.replace(/\\/g, "/")}`;
tsPaths[runtimeAliasKey] = [targetPattern];
}
const tsconfig = {
compilerOptions: { paths: tsPaths },
};
// If tsconfig paths didn't change, skip regeneration
let previousPaths = null;
let hasWarningHeader = false;
if (fs.existsSync(tsconfigOut)) {
try {
const previousContent = fs.readFileSync(tsconfigOut, "utf8");
hasWarningHeader = previousContent.startsWith(TS_ALIASES_WARNING);
const previousTsconfig = /** @type {{compilerOptions?: {paths?: Record<string, string[]>}}} */ (
parseJsonWithComments(previousContent)
);
previousPaths = previousTsconfig.compilerOptions?.paths ?? {};
} catch {
// ignore parse errors and treat as "no previous cache"
previousPaths = null;
}
}
if (previousPaths && hasWarningHeader && pathsEqual(previousPaths, tsPaths)) {
console.log("✓ Generating tsconfig.aliases.json was skipped. No alias modifications detected.");
return;
}
// Write tsconfig.aliases.json
fs.writeFileSync(tsconfigOut, stringifyFlatArrays(tsconfig));
console.log("✓ Generating tsconfig.aliases.json");
}
-324
View File
@@ -1,324 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Core esbuild library for Moodle ESM components.
*
* This is the single source of all build logic. The Grunt tasks
* (.grunt/tasks/react.js) import from here rather than duplicating
* configuration or build steps.
*
* Source layout convention:
* <component>/js/esm/src/**\/*.{ts,tsx} → <component>/js/esm/build/**\/*.js
*
* Exports:
* createBuildConfig(isDev) esbuild config object; pass isDev=true
* to disable minification / add sourcemaps.
* buildPluginComponents(isDev) Glob for every js/esm/src tree across
* core and plugins, compile all in parallel.
* buildSingleFile(filePath, isDev) Compile one source file; used by the
* Grunt watch task on incremental changes.
* watchComponents(isDev) Start esbuild's native watch mode so the
* compiler rebuilds affected files on save.
* resolveComponentPaths(entry) Map an absolute source path to its
* relative input path and output path.
*
* @copyright 2026 Adrian Greeve <adrian@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
import esbuild from "esbuild";
import { glob } from "glob";
import chalk from "chalk";
import path from "path";
import fs from "fs";
const projectRoot = process.cwd();
/**
* Resolve a path from the current project root.
*
* @param {...string} segments Path segments to resolve.
* @returns {string} Absolute path from project root.
*/
const fromRoot = (...segments) => path.resolve(projectRoot, ...segments);
/**
* Create an incremental dot progress indicator.
* Prints one dot per completed build and wraps lines for readability.
*
* @param {number} total Total number of items to build.
* @returns {{ start: () => void, tick: () => void, succeed: (msg: string) => void, fail: (msg: string) => void }}
*/
function createDotProgress(total) {
const dotsPerLine = 60;
let printed = 0;
return {
start: () => {
process.stdout.write(`${chalk.cyan("Building")} `);
},
tick: () => {
printed++;
process.stdout.write(chalk.cyan("."));
if (printed % dotsPerLine === 0 && printed < total) {
process.stdout.write(` ${chalk.dim(`[${printed}/${total}]`)}\n`);
}
},
succeed: (msg) => {
process.stdout.write(` ${chalk.dim(`[${printed}/${total}]`)}\n`);
process.stdout.write(`${chalk.green("✓")} ${msg}\n`);
},
fail: (msg) => {
process.stdout.write(` ${chalk.dim(`[${printed}/${total}]`)}\n`);
process.stdout.write(`${chalk.red("✗")} ${msg}\n`);
},
};
}
/**
* Build a single React component entry file.
*
* @param {string} entry Absolute entry file path.
* @param {import('esbuild').BuildOptions} buildConfig Shared esbuild configuration.
* @returns {Promise<{file: string, output?: string, error: Error|null}>}
*/
async function buildComponent(entry, buildConfig) {
const resolved = resolveComponentPaths(entry);
if (!resolved) {
return { file: entry, error: new Error(`Unknown path pattern: ${entry}`) };
}
const { file, output } = resolved;
fs.mkdirSync(path.dirname(output), { recursive: true });
try {
await esbuild.build({
...buildConfig,
entryPoints: [entry],
outfile: output,
});
return { file, output, error: null };
} catch (error) {
return { file, error: error instanceof Error ? error : new Error(String(error)) };
}
}
/**
* Resolve source and output paths for a component entry.
*
* @param {string} entry Absolute component source path.
* @returns {{file: string, output: string} | null} Relative file info and output path, or null for unsupported paths.
*/
export function resolveComponentPaths(entry) {
const rel = path.relative(projectRoot, entry);
if (rel.includes(path.join('esm', 'src'))) {
const [part, rawFile] = rel.split(path.join('esm', 'src'));
const file = rawFile.replace(/^[\/\\]/, '');
return {
file,
output: fromRoot(part, 'esm', 'build', file.replace(/\.(ts|tsx)$/, '.js')),
};
}
return null;
}
/**
* Run all builds in parallel, showing incremental dot progress.
*
* @param {string[]} entryPoints Absolute entry file paths.
* @param {import('esbuild').BuildOptions} buildConfig Shared esbuild configuration.
* @returns {Promise<{errors: {file: string, output?: string, error: Error|null}[]}>}
*/
async function runParallelBuilds(entryPoints, buildConfig) {
const total = entryPoints.length;
/** @type {{file: string, output?: string, error: Error|null}[]} */
const errors = [];
const startTime = Date.now();
const progress = createDotProgress(total);
progress.start();
await Promise.all(entryPoints.map(async (entry) => {
const result = await buildComponent(entry, buildConfig);
if (result.error) {
errors.push(result);
}
progress.tick();
}));
const elapsed = ((Date.now() - startTime) / 1000).toFixed(1);
const succeeded = total - errors.length;
if (errors.length > 0) {
progress.fail(`${succeeded}/${total} built · ${elapsed}s`);
for (const e of errors) {
console.error(chalk.red(`${e.file}: ${e.error?.message ?? ''}`));
}
} else {
progress.succeed(chalk.bold(`${total} components built`) + chalk.dim(` · ${elapsed}s`));
}
return { errors };
}
/**
* Create the shared esbuild build configuration.
*
* @param {boolean} isDev Whether development mode is enabled.
* @returns {import('esbuild').BuildOptions} esbuild configuration object.
*/
export function createBuildConfig(isDev) {
return {
bundle: true,
format: "esm",
external: ["react", "react/*", "react-dom", "react-dom/*", "@moodlehq/design-system", "@moodlehq/design-system/*", "@moodle/lms", "@moodle/lms/*"],
jsx: "automatic",
minify: !isDev,
sourcemap: isDev ? 'inline' : false,
jsxDev: isDev,
keepNames: isDev,
treeShaking: !isDev,
define: { 'process.env.NODE_ENV': isDev ? '"development"' : '"production"' },
};
}
/**
* Build all plugin and core React components.
*
* @param {boolean} isDev Whether development mode is enabled.
* @returns {Promise<void>}
*/
export async function buildPluginComponents(isDev) {
console.log(chalk.green('> Building components...'));
const entryPoints = glob.sync("**/js/esm/src/**/*.{ts,tsx}", {
cwd: projectRoot,
absolute: true,
ignore: [
`${process.cwd()}/node_modules/**`,
`${process.cwd()}/vendor/**`,
],
});
const buildConfig = createBuildConfig(isDev);
const { errors } = await runParallelBuilds(entryPoints, buildConfig);
if (errors.length > 0) {
throw new Error(`React build failed: ${errors.length} component(s) could not be built`);
}
}
/**
* Start esbuild in native watch mode over all React components.
*
* Creates a single incremental build context for all entry points so that
* esbuild can reuse its internal graph between rebuilds instead of starting
* from scratch on every file change.
*
* @param {boolean} isDev Whether to build in development mode.
* @param {((srcFiles: string[]) => void) | undefined} [onRebuild] Called with the rebuilt entry source
* files (relative to project root) after each non-initial successful rebuild. Use this to run
* follow-up tasks such as linting without coupling them to this module.
* @returns {Promise<import('esbuild').BuildContext|null>} The active context, or null if no source files exist.
*/
export async function watchComponents(isDev, onRebuild) {
const entryPoints = glob.sync("**/js/esm/src/**/*.{ts,tsx}", {
cwd: projectRoot,
absolute: true,
ignore: [
`${process.cwd()}/node_modules/**`,
`${process.cwd()}/vendor/**`,
],
});
if (entryPoints.length === 0) {
return null;
}
const buildConfig = createBuildConfig(isDev);
// Map each source file to an {in, out} pair so esbuild can write each
// component to its custom output directory while sharing a single context.
// The 'out' path is relative to outdir (projectRoot) and has no extension —
// esbuild appends the appropriate extension automatically.
// Build entry pairs and ensure output directories exist in a single pass.
const entryPairs = entryPoints.flatMap(entry => {
const resolved = resolveComponentPaths(entry);
if (!resolved) {
return [];
}
fs.mkdirSync(path.dirname(resolved.output), { recursive: true });
return [{ in: entry, out: path.relative(projectRoot, resolved.output).replace(/\.js$/, '') }];
});
// Report build results to the terminal after every build (initial and on each change).
// metafile: true populates result.metafile.outputs so we know which files were written.
// On a rebuild only the affected outputs appear, so it effectively names the changed file.
/** @type {import('esbuild').Plugin} */
const watchReporter = {
name: 'watch-reporter',
setup(build) {
let isInitial = true;
let startTime = 0;
build.onStart(() => {
startTime = Date.now();
});
build.onEnd(result => {
const now = new Date().toLocaleTimeString();
const elapsed = ((Date.now() - startTime) / 1000).toFixed(1);
if (result.errors.length > 0) {
console.error(chalk.red(`[${now}] ✗ Build failed (${result.errors.length} error(s))`) + chalk.dim(` · ${elapsed}s`));
return;
}
const outputs = Object.keys(result.metafile?.outputs ?? {});
console.log(chalk.green(`[${now}] ✓ ${outputs.length} component(s) built`) + chalk.dim(` · ${elapsed}s`));
if (isInitial) {
isInitial = false;
} else if (onRebuild) {
// entryPoint is the source file (relative to projectRoot) that triggered
// this rebuild. Pass it to the caller so they can run follow-up tasks
// (e.g. linting) without this module needing to know about them.
const srcFiles = Object.values(result.metafile?.outputs ?? {})
.map(output => output.entryPoint)
.filter(/** @param {string|undefined} f */ f => !!f);
onRebuild(/** @type {string[]} */ (srcFiles));
}
});
},
};
const ctx = await esbuild.context({
...buildConfig,
entryPoints: entryPairs,
outdir: projectRoot,
metafile: true,
plugins: [watchReporter],
});
await ctx.watch();
return ctx;
}
-266
View File
@@ -1,266 +0,0 @@
{
'plugins': [
'@babel',
'promise',
'jsdoc'
],
'extends': [
'eslint:recommended',
'plugin:promise/recommended'
],
'env': {
'browser': true,
// Enable ES6+ features by default.
// See http://eslint.org/docs/user-guide/configuring#specifying-environments
// Note: The YUI override must exactly match this when disabling the ES6+ version because those features are not supported by Shifter.
'es2020': true,
'amd': true
},
'globals': {
'M': true,
'Y': true
},
// Warn about unused eslint-disable statements.
'reportUnusedDisableDirectives': true,
'rules': {
// See http://eslint.org/docs/rules/ for all rules and explanations of all
// rules.
// === Possible Errors ===
'comma-dangle': 'off',
'no-console': 'error',
'no-empty': 'warn',
'no-extra-parens': 'off',
'no-prototype-builtins': 'off',
'no-unreachable': 'warn',
// === Best Practices ===
// (these mostly match our jshint config)
'array-callback-return': 'warn',
'block-scoped-var': 'warn',
'complexity': 'warn',
'consistent-return': 'warn',
'curly': 'error',
'dot-notation': 'warn',
'no-alert': 'warn',
'no-caller': 'error',
'no-div-regex': 'error',
'no-empty-function': 'warn',
'no-eq-null': 'error',
'no-eval': 'error',
'no-extend-native': 'error',
'no-extra-bind': 'warn',
'no-floating-decimal': 'warn',
'no-global-assign': 'warn',
'no-implied-eval': 'error',
'no-invalid-this': 'error',
'no-iterator': 'error',
'no-labels': 'error',
'no-loop-func': 'error',
'no-multi-spaces': 'warn',
'no-multi-str': 'error',
'no-new-func': 'error',
'no-new-wrappers': 'error',
'no-octal-escape': 'error',
'no-proto': 'error',
'no-redeclare': 'warn',
'no-restricted-globals': ['error', { 'name': 'Notification' }],
'no-return-assign': 'error',
'no-script-url': 'error',
'no-self-compare': 'error',
'no-sequences': 'warn',
'no-throw-literal': 'warn',
'no-unmodified-loop-condition': 'error',
'no-unused-expressions': 'error',
'no-useless-call': 'warn',
'no-useless-escape': 'warn',
'wrap-iife': ['error', 'any'],
// === Variables ===
'no-undef-init': 'error',
'no-unused-vars': ['error', { 'caughtErrors': 'none' }],
// === Stylistic Issues ===
'array-bracket-spacing': 'warn',
'block-spacing': 'warn',
'brace-style': ['warn', '1tbs'],
'camelcase': 'warn',
'capitalized-comments': ['warn', 'always', { 'ignoreConsecutiveComments': true }],
'comma-spacing': ['warn', { 'before': false, 'after': true }],
'comma-style': ['warn', 'last'],
'computed-property-spacing': 'error',
'consistent-this': 'off',
'eol-last': 'off',
'func-call-spacing': ['warn', 'never'],
'func-names': 'off',
'func-style': 'off',
// indent currently not doing well with our wrapping style, so disabled.
'indent': ['off', 4, { 'SwitchCase': 1 }],
'key-spacing': ['warn', { 'beforeColon': false, 'afterColon': true, 'mode': minimum }],
'keyword-spacing': 'warn',
'linebreak-style': ['error', 'unix'],
'lines-around-comment': 'off',
'max-len': ['error', 132],
'max-lines': 'off',
'max-depth': 'warn',
'max-nested-callbacks': ['warn', 5],
'max-params': 'off',
'max-statements': 'off',
'max-statements-per-line': ['warn', { max: 2 }],
'new-cap': ['warn', { 'properties': false }],
'new-parens': 'warn',
'newline-per-chained-call': 'off',
'no-array-constructor': 'off',
'no-bitwise': 'error',
'no-continue': 'off',
'no-inline-comments': 'off',
'no-lonely-if': 'off',
'no-mixed-operators': 'off',
'no-multiple-empty-lines': 'warn',
'no-negated-condition': 'off',
'no-nested-ternary': 'warn',
'no-new-object': 'off',
'no-plusplus': 'off',
'no-tabs': 'error',
'no-ternary': 'off',
'no-trailing-spaces': 'error',
'no-underscore-dangle': 'off',
'no-unneeded-ternary': 'off',
'no-whitespace-before-property': 'warn',
'object-curly-newline': 'off',
'object-curly-spacing': 'warn',
'object-property-newline': 'off',
'one-var': 'off',
'one-var-declaration-per-line': ['warn', 'initializations'],
'operator-assignment': 'off',
'operator-linebreak': 'off',
'padded-blocks': 'off',
'quote-props': ['warn', 'as-needed', {'unnecessary': false, 'keywords': true, 'numbers': true}],
'quotes': 'off',
'semi': 'error',
'semi-spacing': ['warn', {'before': false, 'after': true}],
'sort-vars': 'off',
'space-before-blocks': 'warn',
'space-before-function-paren': ['warn', 'never'],
'space-in-parens': 'warn',
'space-infix-ops': 'warn',
'space-unary-ops': 'warn',
'spaced-comment': 'warn',
'unicode-bom': 'error',
'wrap-regex': 'off',
// === Promises (override plugin:promise/recommended) ===
'promise/always-return': 'warn',
'promise/no-return-wrap': 'warn',
'promise/param-names': 'warn',
'promise/catch-or-return': ['warn', {terminationMethod: ['catch', 'fail', 'always'], allowFinally: true}],
'promise/no-native': 'warn',
'promise/avoid-new': 'warn',
// === Deprecations ===
"no-restricted-properties": ['warn', {
'object': 'M',
'property': 'str',
'message': 'Use "core/str" module or M.util.get_string()'
}],
},
overrides: [
{
files: ["**/yui/src/**/*.js"],
'env': {
// Disable ES6+ for YUI files.
'es2020': false,
},
// Disable some rules which we can't safely define for YUI rollups.
rules: {
'no-undef': 'off',
'no-unused-vars': 'off',
'no-unused-expressions': 'off',
// === JSDocs ===
"jsdoc/check-access": 'off',
"jsdoc/check-alignment": 'off',
"jsdoc/check-param-names": 'off',
"jsdoc/check-property-names": 'off',
"jsdoc/empty-tags": 'off',
"jsdoc/implements-on-classes": 'off',
"jsdoc/multiline-blocks": 'off',
"jsdoc/require-jsdoc": 'off',
"jsdoc/require-param": 'off',
"jsdoc/require-param-name": 'off',
"jsdoc/require-param-type": 'off',
"jsdoc/require-property": 'off',
"jsdoc/require-property-name": 'off',
"jsdoc/require-property-type": 'off',
}
},
{
files: ["**/amd/src/*.js", "**/amd/src/**/*.js", "Gruntfile.js", ".grunt/*.js", ".grunt/tasks/*.js", "jsdoc.conf.js"],
// We're using babel transpiling so use their parser
// for linting.
parser: '@babel/eslint-parser',
// Check AMD with some slightly stricter rules.
rules: {
'no-implicit-globals': 'error',
// Disable all of the rules that have babel versions.
'new-cap': 'off',
// Not using this rule for the time being because it isn't
// compatible with jQuery and ES6.
'no-invalid-this': 'off',
'object-curly-spacing': 'off',
'quotes': 'off',
'semi': 'off',
'no-unused-expressions': 'off',
// Enable all of the babel version of these rules.
'@babel/new-cap': ['warn', { 'properties': false }],
// Not using this rule for the time being because it isn't
// compatible with jQuery and ES6.
'@babel/no-invalid-this': 'off',
'@babel/object-curly-spacing': 'warn',
'@babel/semi': 'error',
'@babel/no-unused-expressions': 'error',
// === Promises ===
// We have Promise now that we're using ES6.
'promise/no-native': 'off',
'promise/avoid-new': 'off',
// === JSDocs ===
'jsdoc/check-access': 'error',
'jsdoc/check-alignment': 1, // Recommended.
'jsdoc/check-param-names': 'error',
'jsdoc/check-property-names': 'error',
'jsdoc/empty-tags': 'error',
'jsdoc/implements-on-classes': 'error',
'jsdoc/multiline-blocks': 'error',
'jsdoc/require-jsdoc': 'error',
'jsdoc/require-param': 'error',
'jsdoc/require-param-name': 'error',
'jsdoc/require-param-type': 'error',
'jsdoc/require-property': 'error',
'jsdoc/require-property-name': 'error',
'jsdoc/require-property-type': 'error'
},
parserOptions: {
'sourceType': 'module',
'requireConfigFile': false
}
},
{
files: ["**/*.ts", "**/*.tsx"],
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module',
ecmaFeatures: {
jsx: true
},
allowSyntheticDefaultImports: true
},
rules: {
// promise/no-native crashes on TypeScript ASTs (same reason it is
// disabled for AMD files above). Native Promises are standard in TS.
'promise/no-native': 'off',
'promise/avoid-new': 'off',
}
}
]
}
-24
View File
@@ -1,24 +0,0 @@
{
"indentation": ["on",{
"Feature": 0,
"Background": 2,
"Scenario": 2,
"Examples": 4,
"example": 6,
"Step": 4,
"given": 4,
"and": 4
}],
"no-dupe-feature-names": "on",
"no-dupe-scenario-names": "off",
"no-empty-file": "on",
"no-files-without-scenarios": "on",
"no-multiple-empty-lines": "on",
"no-partially-commented-tag-lines": "on",
"no-trailing-spaces": "on",
"no-unnamed-features": "on",
"no-unnamed-scenarios": "on",
"no-scenario-outlines-without-examples": "on",
"no-examples-in-scenarios": "on",
"new-line-at-eof": ["on", "yes"]
}
-9
View File
@@ -1,9 +0,0 @@
**/yui/build/** -diff
**/amd/build/** -diff
**.js.map -diff
**-min.js -diff
**.min.js -diff
# Remove composer lock file changes from standard diff views.
/composer.lock -diff
/lib/js/bundles/*/*.js -diff
-2
View File
@@ -1,2 +0,0 @@
# Primary donations pages.
custom: ["https://moodle.com/donations/"]
-7
View File
@@ -1,7 +0,0 @@
*** PLEASE DO NOT OPEN PULL REQUESTS VIA GITHUB ***
The moodle.git repository at Github is just a mirror of the official repository. We do not accept pull requests at Github.
See CONTRIBUTING.md guidelines for how to contribute patches for Moodle. Thank you.
--
-6
View File
@@ -1,6 +0,0 @@
> [!IMPORTANT]
> PLEASE DO NOT PUBLISH SECURITY FINDINGS PUBLICLY.
If you discover a potential security issue, please report it via our [Security Submission Form](https://moodle.org/security/report).
For more information about our security processes and responsible disclosure policy, see the [Security Procedures documentation](https://moodledev.io/general/development/process/security).
-1
View File
@@ -1 +0,0 @@
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1231.24 314.44" preserveAspectRatio="xMinYMid meet"><defs><style>.cls-1{fill:#f48020;}.cls-2,.cls-3{fill:#383738;stroke:#4a4a4c;}.cls-2{stroke-width:2.37px;}.cls-3{stroke-width:2.38px;}.cls-4{fill:#585858;}</style></defs><title>Moodle_Logo_UseonBlack_RGB</title><path class="cls-1" d="M1086.3,235.34a53.42,53.42,0,0,0,16.71,29q13.26,12.27,29.48,12.27,11.29,0,24.56-5.89,16.23-6.88,16.22-16.22l58-.49q-12.29,29-41.76,45.2-27.52,15.23-60.43,15.24-42.25,0-70-26.29t-27.75-68.54q0-43.73,27.75-69.51t72-25.8q48.15,0,75.17,31.94,25.07,29.47,25.06,79.1Zm89.91-33.91q-3.43-17.69-14.73-29-12.8-12.28-29.49-12.29-17.21,0-28.74,11.79t-15.47,29.48Z"/><path class="cls-1" d="M965.45,308.54V0h55V308.54Z"/><path class="cls-1" d="M892.69,308.54V290.36q-7.38,9.83-25.06,15.72a92.31,92.31,0,0,1-30,5.41q-39.31,0-63.13-27T750.7,217.65q0-39.3,23.34-65.84t62.15-26.53q43.71,0,56.5,23.58V0h53.55V308.54Zm0-102.68q0-14.75-14-28.26t-28.74-13.51q-21.12,0-33.41,17.2-10.8,15.24-10.8,37.33,0,21.63,10.8,36.85,12.29,17.71,33.41,17.69,12.78,0,27.76-12t15-24.81Z"/><path class="cls-1" d="M647,313.45q-41.77,0-69-26.53t-27.27-68.3q0-41.73,27.27-68.28t69-26.53q41.75,0,69.27,26.53t27.52,68.28q0,41.79-27.52,68.3T647,313.45ZM647,168q-19.89,0-30.58,15.07t-10.68,35.79q0,20.73,9.94,35.05,11.43,16.31,31.32,16.28t31.32-16.28q10.44-14.31,10.44-35.05t-9.94-35Q667.42,168,647,168Z"/><path class="cls-1" d="M448.07,313.45q-41.76,0-69-26.53t-27.27-68.3q0-41.73,27.27-68.28t69-26.53q41.74,0,69.28,26.53t27.5,68.28q0,41.79-27.5,68.3T448.07,313.45Zm0-145.43q-19.89,0-30.59,15.07t-10.69,35.79q0,20.73,9.94,35.05,11.43,16.31,31.34,16.28t31.32-16.28q10.42-14.31,10.44-35.05t-9.94-35Q468.45,168,448.07,168Z"/><path class="cls-1" d="M288.89,309.11V201q0-33.9-28-33.9t-28,33.9V309.11h-55V201q0-33.9-27.52-33.9-28,0-28,33.9V309.11h-55V194.65q0-35.37,24.56-53.54,21.61-16.22,58.46-16.22,37.35,0,55,19.16,15.23-19.16,55.51-19.16,36.86,0,58.45,16.22,24.57,18.16,24.57,53.54V309.11Z"/><path class="cls-2" d="M.76,145.76"/><path class="cls-3" d="M1.73,145.32"/><path class="cls-4" d="M173.86,116.85l55.08-40.1-.7-2.44C135,83.92,80.42,96.44,0,144.13l.73,2.38,21-.67c15.17.52,30.85,1.26,46,1.32-1,24.09.83,32.65.83,32.65,51.92,17.58,101.22,1.53,127.14-43.9A248.72,248.72,0,0,0,173.86,116.85Z"/><path class="cls-4" d="M113.78,110c-.3-1.08-2.23-1.48-4.28-.9a4.73,4.73,0,0,0-3.14,2.19c-18.53,5-49.16,13.72-70.73,21l-1.33.45c-16.68,5.61-24.73,8.49-25.22,12.55-2.29,18.44-.87,42.18-.86,42.48l.19,6.4c-9.74,27.56.06,49.6,8.38,69.77.06-24.92,1.07-45.22-6-71-.2-3.82-1.49-30.36.61-47.34.34-2.75,11.65-6.56,23.63-10.59l1.33-.44c22-7.42,53.57-16.39,71.9-21.29a6.75,6.75,0,0,0,2.29-.25C112.64,112.43,114.08,111.09,113.78,110Z"/></svg>

Before

Width:  |  Height:  |  Size: 2.7 KiB

-31
View File
@@ -1,31 +0,0 @@
name: 'Close Pull Requests'
on:
pull_request_target:
types: opened
workflow_dispatch:
jobs:
close:
# Avoid forks to run this job
if: github.repository_owner == 'moodle'
name: Close Pull Requests
runs-on: ubuntu-latest
steps:
- uses: dessant/repo-lockdown@v4
with:
process-only: prs
close-pr: true
skip-closed-pr-comment: true
pr-comment: >
**Please, don't open pull requests via GitHub.**
This repository (moodle.git) at GitHub is just a mirror of the official Moodle repository.
For how to contribute patches for Moodle see
[CONTRIBUTING.md](https://github.com/moodle/moodle/blob/main/CONTRIBUTING.md).
Closing this pull request.
-118
View File
@@ -1,118 +0,0 @@
name: Run tests in a Composed Moodle Setup
on:
push:
branches-ignore:
- main
- MOODLE_[0-9]+_STABLE
tags-ignore:
- v[0-9]+.[0-9]+.[0-9]+*
workflow_dispatch:
inputs:
phpunit_extra_options:
description: Additional options to apply to PHPUnit
required: false
default: ''
env:
php: 8.4
jobs:
PHPUnit:
runs-on: ${{ matrix.os }}
services:
exttests:
image: moodlehq/moodle-exttests
ports:
- 8080:80
redis:
image: redis
ports:
- 6379:6379
postgres:
image: ${{ matrix.db == 'pgsql' && 'postgres:16' || '' }}
env:
POSTGRES_DB: test
POSTGRES_USER: test
POSTGRES_PASSWORD: test
ports:
- 5432:5432
strategy:
fail-fast: false
matrix:
include:
# MySQL builds always run with the lowest PHP supported version.
- os: ubuntu-24.04
php: 8.3
extensions:
db: mysqli
# PostgreSQL builds always run with the highest PHP supported version.
- os: ubuntu-24.04
php: 8.4
db: pgsql
steps:
- name: Run MySQL Server
if: ${{ matrix.db == 'mysqli' }}
run: |
docker run --rm \
-e MYSQL_DATABASE=test \
-e MYSQL_USER=test \
-e MYSQL_PASSWORD=test \
-e MYSQL_ROOT_PASSWORD=test \
-p 3306:3306 \
-d \
--tmpfs /var/lib/mysql:rw,noexec,nosuid,size=1024M \
mysql:8.4 \
--skip-log-bin \
--collation-server=utf8mb4_bin
- name: Configuring git vars
uses: rlespinasse/github-slug-action@v5
- name: Setting up PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ matrix.extensions }}
ini-values: max_input_vars=5000
coverage: none
tools: composer
- name: Checking out code from ${{ env.GITHUB_REF_SLUG }}
uses: actions/checkout@v6
with:
path: 'moodle'
- name: 'Preparing the environment'
run: |
echo "pathtophp=$(which php)" >> $GITHUB_ENV # Inject installed pathtophp to env. The template config needs it.
sudo locale-gen en_AU.UTF-8
- name: Create the new Composer Project
run: |
mkdir testsite
cp moodle/.github/workflows/composed/composer.json testsite/composer.json
cp moodle/.github/workflows/composed/config.php testsite/config.php
mkdir -p testsite/data/moodledata
mkdir -p testsite/data/phpunitdata
- name: Install the Moodle test site
working-directory: testsite
run: |
composer install --no-interaction
- name: Setting up PHPUnit
working-directory: testsite
env:
dbtype: ${{ matrix.db }}
run: |
php moodle/public/admin/tool/phpunit/cli/init.php --no-composer-self-update
- name: Running PHPUnit tests
working-directory: testsite
env:
dbtype: ${{ matrix.db }}
phpunit_options: ${{ secrets.phpunit_options }}
run: |
vendor/bin/phpunit $phpunit_options ${{ inputs.phpunit_extra_options }}
-25
View File
@@ -1,25 +0,0 @@
{
"type": "project",
"require": {
"moodle/composer-installer": "^1",
"moodle/moodle-composer-scaffold": "^1",
"moodle/moodle": "@dev",
"moodle/moodle-testing": "^1.0"
},
"repositories": [
{
"name": "moodleundertest",
"type": "path",
"url": "../moodle"
}
],
"config": {
"audit": {
"block-insecure": false
},
"allow-plugins": {
"moodle/composer-installer": true,
"moodle/moodle-composer-scaffold": true
}
}
}
-67
View File
@@ -1,67 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Template configuraton file for GitHub Actions CI/CD using Composer.
*
* @package core
* @copyright 2020 onwards Eloy Lafuente (stronk7) {@link https://stronk7.com}
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
// This cannot be used out from a GitHub Actions workflow, so just exit.
getenv('GITHUB_WORKFLOW') || die; // phpcs:ignore moodle.Files.MoodleInternal.MoodleInternalGlobalState
unset($CFG);
global $CFG;
$CFG = new stdClass();
$CFG->dbtype = getenv('dbtype');
$CFG->dblibrary = 'native';
$CFG->dbhost = '127.0.0.1';
$CFG->dbname = 'test';
$CFG->dbuser = 'test';
$CFG->dbpass = 'test';
$CFG->prefix = 'm_';
$CFG->dboptions = ['dbcollation' => 'utf8mb4_bin'];
$host = 'localhost';
$CFG->wwwroot = "http://{$host}";
$CFG->dataroot = __DIR__ . '/data/moodledata';
$CFG->admin = 'admin';
$CFG->directorypermissions = 0777;
// Debug options - possible to be controlled by flag in future.
$CFG->debug = (E_ALL); // DEBUG_DEVELOPER.
$CFG->debugdisplay = 1;
$CFG->debugstringids = 1; // Add strings=1 to url to get string ids.
$CFG->perfdebug = 15;
$CFG->debugpageinfo = 1;
$CFG->allowthemechangeonurl = 1;
$CFG->passwordpolicy = 0;
$CFG->cronclionly = 0;
$CFG->pathtophp = getenv('pathtophp');
$CFG->phpunit_dataroot = __DIR__ . '/data/phpunitdata';
$CFG->phpunit_prefix = 't_';
$CFG->routerconfigured = true;
define('TEST_EXTERNAL_FILES_HTTP_URL', 'http://localhost:8080');
define('TEST_EXTERNAL_FILES_HTTPS_URL', 'http://localhost:8080');
define('TEST_SESSION_REDIS_HOST', 'localhost');
define('TEST_CACHESTORE_REDIS_TESTSERVERS', 'localhost');
-73
View File
@@ -1,73 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Template configuraton file for github actions CI/CD.
*
* @package core
* @copyright 2020 onwards Eloy Lafuente (stronk7) {@link https://stronk7.com}
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
// This cannot be used out from a github actions workflow, so just exit.
getenv('GITHUB_WORKFLOW') || die; // phpcs:ignore moodle.Files.MoodleInternal.MoodleInternalGlobalState
unset($CFG);
global $CFG;
$CFG = new stdClass();
$CFG->dbtype = getenv('dbtype');
$CFG->dblibrary = 'native';
$CFG->dbhost = '127.0.0.1';
$CFG->dbname = 'test';
$CFG->dbuser = 'test';
$CFG->dbpass = 'test';
$CFG->prefix = 'm_';
$CFG->dboptions = ['dbcollation' => 'utf8mb4_bin'];
$host = 'localhost';
$CFG->wwwroot = "http://{$host}";
$CFG->dataroot = realpath(dirname(__DIR__)) . '/moodledata';
$CFG->admin = 'admin';
$CFG->directorypermissions = 0777;
// Debug options - possible to be controlled by flag in future.
$CFG->debug = (E_ALL); // DEBUG_DEVELOPER.
$CFG->debugdisplay = 1;
$CFG->debugstringids = 1; // Add strings=1 to url to get string ids.
$CFG->perfdebug = 15;
$CFG->debugpageinfo = 1;
$CFG->allowthemechangeonurl = 1;
$CFG->passwordpolicy = 0;
$CFG->cronclionly = 0;
$CFG->pathtophp = getenv('pathtophp');
$CFG->phpunit_dataroot = realpath(dirname(__DIR__)) . '/phpunitdata';
$CFG->phpunit_prefix = 't_';
$CFG->routerconfigured = true;
define('TEST_EXTERNAL_FILES_HTTP_URL', 'http://localhost:8080');
define('TEST_EXTERNAL_FILES_HTTPS_URL', 'http://localhost:8080');
define('TEST_SESSION_REDIS_HOST', 'localhost');
define('TEST_CACHESTORE_REDIS_TESTSERVERS', 'localhost');
// TODO: add others (solr, mongodb, memcached, ldap...).
// Too much for now: define('PHPUNIT_LONGTEST', true); // Only leaves a few tests out and they are run later by CI.
require_once(__DIR__ . '/lib/setup.php');
-143
View File
@@ -1,143 +0,0 @@
name: One by One Testing
# Run all the individual unit tests one by one, with
# fully independent PHPUnit executions. Useful to
# detect issues with some tests that are using stuff
# that has been made available by others, but is not
# available when running individually.
#
# Note that we aren't using PHPUnit's own isolation
# here but completely separated runs, one for each
# test.
#
# The workflow will fail reporting all the tests
# that have failed (and will pass if no failure is
# detected, of course).
#
# It's only executed via workflow dispatch (automated
# or manual), not by push/tag. And acceptd configuration
# of phpunit, specially useful to run it with PHPUnit's
# own isolation or any other option.
on:
workflow_dispatch:
inputs:
phpunit_extra_options:
description: Additional options to apply to PHPUnit
required: false
default: ''
env:
chunks: 7
jobs:
collect:
name: Collect individual unit tests
runs-on: ubuntu-latest
outputs:
matrix: ${{steps.individual-tests.outputs.matrix }}
steps:
- name: Checking out code
uses: actions/checkout@v4
- name: Looking for all individual tests
id: individual-tests
run: |
count=0 # Number of individual tests found.
while read -r testfile; do # For each test file.
while read -r testname; do # For each unit test in a file.
count=$((count + 1))
# Sent it to the correct chunk file.
chunk=$(((($count % $chunks)) + 1))
echo "$testname $testfile" >> ./chunk_$chunk.txt
done < <(grep "function test_" "${testfile}" | sed -r "s/^.*function (test_[a-zA-Z0-9_]+).*/\1/")
done < <(find . -name "*_test.php" -not -path "*/fixtures/*")
# Generate the matrix to run tests.
echo "matrix=$(ls -1 chunk_*.txt | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
echo "$count individual tests collected in $chunks files"
- name: Upload individual tests files
uses: actions/upload-artifact@v4
with:
name: individual_tests
path: chunk_*.txt
retention-days: 1
test:
name: Run tests
needs: collect
runs-on: ubuntu-latest
services:
exttests:
image: moodlehq/moodle-exttests
ports:
- 8080:80
redis:
image: redis
ports:
- 6379:6379
strategy:
fail-fast: false
matrix:
file: ${{ fromJson(needs.collect.outputs.matrix) }}
steps:
- name: Setting up DB pgsql
uses: m4nu56/postgresql-action@v1
with:
postgresql version: 16
postgresql db: test
postgresql user: test
postgresql password: test
- name: Setting up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
ini-values: max_input_vars=5000
coverage: none
- name: Checking out code
uses: actions/checkout@v4
- name: Download individual test files
uses: actions/download-artifact@v4
with:
name: individual_tests # Make all the chunk files available for the next steps.
- name: Setting up PHPUnit
env:
dbtype: pgsql
run: |
echo "pathtophp=$(which php)" >> $GITHUB_ENV
cp .github/workflows/config-template.php config.php
mkdir ../moodledata
sudo locale-gen en_AU.UTF-8
php public/admin/tool/phpunit/cli/init.php --no-composer-self-update
- name: Run PHPUnit test (one by one)
env:
dbtype: pgsql
run: |
status=0
count=0
while read -r line; do # For each line in the chunk file
count=$((count + 1))
filter="${line% *}"
file="${line#* }"
# Run the individual unit test and report problems if needed to.
if ! php vendor/bin/phpunit \
--fail-on-empty-test-suite \
--fail-on-warning \
--fail-on-risky \
--filter "$filter" ${{ inputs.phpunit_extra_options }} \
"$file" >/dev/null 2>&1; then
if [ $status -eq 0 ]; then
echo "Problems found, list of PHPUnit commands failing:"
fi
echo "vendor/bin/phpunit --filter '${filter}' ${{ inputs.phpunit_extra_options }} $file"
status=$((status + 1))
fi
done < ${{ matrix.file }}
echo "Finished: $count individual tests executed, $status tests failed"
exit $status
-128
View File
@@ -1,128 +0,0 @@
name: Core
on:
push:
branches-ignore:
- main
- MOODLE_[0-9]+_STABLE
tags-ignore:
- v[0-9]+.[0-9]+.[0-9]+*
workflow_dispatch:
inputs:
phpunit_extra_options:
description: Additional options to apply to PHPUnit
required: false
default: ''
env:
php: 8.4
jobs:
Grunt:
runs-on: ubuntu-24.04
steps:
- name: Checking out code
uses: actions/checkout@v4
- name: Configuring node & npm
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Installing node stuff
run: npm install
- name: Running grunt
run: npx grunt
- name: Looking for uncommitted changes
# Add all files to the git index and then run diff --cached to see all changes.
# This ensures that we get the status of all files, including new files.
# We ignore npm-shrinkwrap.json to make the tasks immune to npm changes.
run: |
git add .
git reset -- npm-shrinkwrap.json
git diff --cached --exit-code
PHPUnit:
runs-on: ${{ matrix.os }}
services:
exttests:
image: moodlehq/moodle-exttests
ports:
- 8080:80
redis:
image: redis
ports:
- 6379:6379
postgres:
image: ${{ matrix.db == 'pgsql' && 'postgres:16' || '' }}
env:
POSTGRES_DB: test
POSTGRES_USER: test
POSTGRES_PASSWORD: test
ports:
- 5432:5432
strategy:
fail-fast: false
matrix:
include:
# MySQL builds always run with the lowest PHP supported version.
- os: ubuntu-24.04
php: 8.3
extensions:
db: mysqli
# PostgreSQL builds always run with the highest PHP supported version.
- os: ubuntu-24.04
php: 8.4
db: pgsql
steps:
- name: Run MySQL Server
if: ${{ matrix.db == 'mysqli' }}
run: |
docker run --rm \
-e MYSQL_DATABASE=test \
-e MYSQL_USER=test \
-e MYSQL_PASSWORD=test \
-e MYSQL_ROOT_PASSWORD=test \
-p 3306:3306 \
-d \
--tmpfs /var/lib/mysql:rw,noexec,nosuid,size=1024M \
mysql:8.4 \
--skip-log-bin \
--collation-server=utf8mb4_bin
- name: Configuring git vars
uses: rlespinasse/github-slug-action@v4
- name: Setting up PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ matrix.extensions }}
ini-values: max_input_vars=5000
coverage: none
- name: Checking out code from ${{ env.GITHUB_REF_SLUG }}
uses: actions/checkout@v4
- name: Setting up PHPUnit
env:
dbtype: ${{ matrix.db }}
run: |
echo "pathtophp=$(which php)" >> $GITHUB_ENV # Inject installed pathtophp to env. The template config needs it.
cp .github/workflows/config-template.php config.php
mkdir ../moodledata
sudo locale-gen en_AU.UTF-8
php public/admin/tool/phpunit/cli/init.php --no-composer-self-update
- name: Running PHPUnit tests
env:
dbtype: ${{ matrix.db }}
phpunit_options: ${{ secrets.phpunit_options }}
run: vendor/bin/phpunit $phpunit_options ${{ inputs.phpunit_extra_options }}
- name: Git status
run: git status
-23
View File
@@ -1,23 +0,0 @@
name: Web Installer Testing
on:
workflow_dispatch:
jobs:
InstallationTest:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: [8.3, 8.4]
steps:
- name: Construct repository URL
run: echo "REPOSITORY_URL=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}" >> $GITHUB_ENV
shell: bash
- uses: moodlehq/moodle-webinstaller-test@main
with:
repository: ${{ env.REPOSITORY_URL }}
branch: ${{ github.ref_name }}
php: ${{ matrix.php }}
-149
View File
@@ -1,149 +0,0 @@
name: Windows Testing
on:
workflow_dispatch:
inputs:
phpunit_extra_options:
description: Additional options to apply to PHPUnit
required: false
default: ''
env:
php: 8.4
jobs:
Grunt:
runs-on: windows-latest
steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checking out code
uses: actions/checkout@v4
- name: Configuring node & npm
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Installing node stuff
run: npm ci
- name: Running grunt
run: npx grunt
- name: Looking for uncommitted changes
# Add all files to the git index and then run diff --cached to see all changes.
# This ensures that we get the status of all files, including new files.
# We ignore npm-shrinkwrap.json to make the tasks immune to npm changes.
run: |
git add .
git reset -- npm-shrinkwrap.json
git diff --cached --exit-code
PHPUnit:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
php: 8.4
# Ideally we should use mysql/mariadb, but they are 4x slower without tweaks and configuration
# so let's run only postgres (1.5h vs 6h) only, If some day we want to improve the mysql runs,
# this is the place to enable them.
# db: mysqli
db: pgsql
extensions: exif, fileinfo, gd, intl, pgsql, mysql, redis, soap, sodium, zip
- os: windows-latest
php: 8.3
db: pgsql
extensions: exif, fileinfo, gd, intl, pgsql, mysql, redis, soap, sodium, zip
steps:
- name: Setting up DB mysql
if: ${{ matrix.db == 'mysqli' }}
uses: shogo82148/actions-setup-mysql@v1
with:
mysql-version: 8.4
user: test
password: test
- name: Creating DB mysql
if: ${{ matrix.db == 'mysqli' }}
run: mysql --host 127.0.0.1 -utest -ptest -e 'CREATE DATABASE IF NOT EXISTS test COLLATE = utf8mb4_bin;';
- name: Setting up DB pgsql
if: ${{ matrix.db == 'pgsql' }}
run: |
# TODO: Remove these conf. modifications when php74 or php80 are lowest.
# Change to old md5 auth, because php73 does not support it.
# #password_encryption = scram-sha-256
(Get-Content "$env:PGDATA\postgresql.conf"). `
replace('#password_encryption = scram-sha-256', 'password_encryption = md5') | `
Set-Content "$env:PGDATA\postgresql.conf"
(Get-Content "$env:PGDATA\pg_hba.conf"). `
replace('scram-sha-256', 'md5') | `
Set-Content "$env:PGDATA\pg_hba.conf"
$pgService = Get-Service -Name postgresql*
Set-Service -InputObject $pgService -Status running -StartupType automatic
Start-Process -FilePath "$env:PGBIN\pg_isready" -Wait -PassThru
& $env:PGBIN\psql --command="CREATE USER test PASSWORD 'test'" --command="\du"
- name: Creating DB pgsql
if: ${{ matrix.db == 'pgsql' }}
run: |
& $env:PGBIN\createdb --owner=test test
$env:PGPASSWORD = 'test'
& $env:PGBIN\psql --username=test --host=localhost --list test
- name: Configuring git vars
uses: rlespinasse/github-slug-action@v4
- name: Setting up PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ matrix.extensions }}
ini-values: max_input_vars=5000
coverage: none
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checking out code from ${{ env.GITHUB_REF_SLUG }}
uses: actions/checkout@v4
# Needs to be done after php is available, git configured and Moodle checkout has happened.
- name: Setting up moodle-exttests service
run: |
git clone https://github.com/moodlehq/moodle-exttests.git
nssm install php-built-in C:\tools\php\php.exe -S localhost:8080 -t D:\a\moodle\moodle\moodle-exttests
nssm start php-built-in
- name: Setting up redis service
run: |
choco install redis --version 5.0.7 --no-progress
nssm install redis redis-server
nssm start redis
- name: Setting up PHPUnit
env:
dbtype: ${{ matrix.db }}
shell: bash
run: |
echo "pathtophp=$(which php)" >> $GITHUB_ENV # Inject installed pathtophp to env. The template config needs it.
cp .github/workflows/config-template.php config.php
mkdir ../moodledata
php public/admin/tool/phpunit/cli/init.php --no-composer-self-update
- name: Running PHPUnit tests
env:
dbtype: ${{ matrix.db }}
phpunit_options: ${{ secrets.phpunit_options }}
run: vendor/bin/phpunit $phpunit_options ${{ inputs.phpunit_extra_options }}
-63
View File
@@ -1,63 +0,0 @@
# This file specifies intentionally untracked files that all Moodle git
# repositories should ignore. It is recommended not to modify this file in your
# local clone. Instead, use .git/info/exclude and add new records there as
# needed.
#
# Example: if you deploy a contributed plugin mod/foobar into your site, put
# the following line into .git/info/exclude file in your Moodle clone:
# /mod/foobar/
#
# See gitignore(5) man page for more details
#
# Swap files (vim)
[._]*.s[a-v][a-z]
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]
# Temporary files including undo
*~
#
/config.php
/tags
/TAGS
/cscope.*
/.patches/
/.idea/
.phpstorm.*
!/.phpstorm.meta.php/
/.phpstorm.meta.php/*
!/.phpstorm.meta.php/di.php
/nbproject/
CVS
.DS_Store
/.settings/
/.project
/.buildpath
/.cache
.phpunit.result.cache
phpunit.xml
# Composer support. Do not ignore composer.json, or composer.lock. These should be shipped by us.
composer.phar
/vendor/
/behat.yml
*/yui/build/*/*-coverage.js
/public/lib/yuilib/*/build/*/*-coverage.js
# lib/yuilib/version/module/module-coverage.js
/public/lib/yuilib/*/*/*-coverage.js
atlassian-ide-plugin.xml
/node_modules/
/.vscode/
moodle-plugin-ci.phar
.eslintignore
.stylelintignore
/jsdoc
/public/admin/tool/componentlibrary/docs
/public/admin/tool/componentlibrary/hugo/site/data/my-index.json
.hugo_build.lock
phpcs.xml
jsconfig.json
UPGRADING-CURRENT.md
.phpunit.cache
tsconfig.aliases.json
-169
View File
@@ -1,169 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This is a babel plugin to add the Moodle module names to the AMD modules
* as part of the transpiling process.
*
* In addition it will also add a return statement for the default export if the
* module is using default exports. This is a highly specific Moodle thing because
* we're transpiling to AMD and none of the existing Babel 7 plugins work correctly.
*
* This will fix the issue where an ES6 module using "export default Foo" will be
* transpiled into an AMD module that returns {default: Foo}; Instead it will now
* just simply return Foo.
*
* Note: This means all other named exports in that module are ignored and won't be
* exported.
*
* @copyright 2018 Ryan Wyllie <ryan@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
"use strict";
/* eslint-env node */
module.exports = ({template, types}) => {
const fs = require('fs');
const path = require('path');
const cwd = process.cwd();
const ComponentList = require(path.join(process.cwd(), '.grunt', 'components.js'));
/**
* Search the list of components that match the given file name
* and return the Moodle component for that file, if found.
*
* Throw an exception if no matching component is found.
*
* @throws {Error}
* @param {string} searchFileName The file name to look for.
* @return {string} Moodle component
*/
function getModuleNameFromFileName(searchFileName) {
searchFileName = fs.realpathSync(searchFileName);
const relativeFileName = searchFileName.replace(`${cwd}${path.sep}`, '').replace(/\\/g, '/');
const [componentPath, file] = relativeFileName.split('/amd/src/');
const fileName = file.replace('.js', '');
// Check subsystems first which require an exact match.
const componentName = ComponentList.getComponentFromPath(componentPath);
if (componentName) {
return `${componentName}/${fileName}`;
}
// This matches the previous PHP behaviour that would throw an exception
// if it couldn't parse an AMD file.
throw new Error(`Unable to find module name for ${searchFileName} (${componentPath}::${file}}`);
}
/**
* This is heavily inspired by the babel-plugin-add-module-exports plugin.
* See: https://github.com/59naga/babel-plugin-add-module-exports
*
* This is used when we detect a module using "export default Foo;" to make
* sure the transpiled code just returns Foo directly rather than an object
* with the default property (i.e. {default: Foo}).
*
* Note: This means that we can't support modules that combine named exports
* with a default export.
*
* @param {String} path
* @param {String} exportObjectName
*/
function addModuleExportsDefaults(path, exportObjectName) {
const rootPath = path.findParent(path => {
return path.key === 'body' || !path.parentPath;
});
// HACK: `path.node.body.push` instead of path.pushContainer(due doesn't work in Plugin.post).
// This is hardcoded to work specifically with AMD.
rootPath.node.body.push(template(`return ${exportObjectName}.default`)());
}
return {
pre() {
this.seenDefine = false;
this.addedReturnForDefaultExport = false;
},
visitor: {
// Plugin ordering is only respected if we visit the "Program" node.
// See: https://babeljs.io/docs/en/plugins.html#plugin-preset-ordering
//
// We require this to run after the other AMD module transformation so
// let's visit the "Program" node.
Program: {
exit(path) {
path.traverse({
CallExpression(path) {
// If we find a "define" function call.
if (!this.seenDefine && path.get('callee').isIdentifier({name: 'define'})) {
// We only want to modify the first instance of define that we find.
this.seenDefine = true;
// Get the Moodle component for the file being processed.
var moduleName = getModuleNameFromFileName(this.file.opts.filename);
// The function signature of `define()` is:
// define = function (name, deps, callback) {...}
// Ensure that if the moduel supplied its own name that it is replaced.
if (path.node.arguments.length > 0) {
// Ensure that there is only one name.
if (path.node.arguments[0].type === 'StringLiteral') {
// eslint-disable-next-line
console.log(`Replacing module name '${path.node.arguments[0].extra.rawValue}' with ${moduleName}`);
path.node.arguments.shift();
}
}
// Add the module name as the first argument to the define function.
path.node.arguments.unshift(types.stringLiteral(moduleName));
// Add a space after the define function in the built file so that previous versions
// of Moodle will not try to add the module name to the file when it's being served
// by PHP. This forces the regex in PHP to not match for this file.
path.node.callee.name = 'define ';
}
// Check for any Object.defineProperty('exports', 'default') calls.
if (!this.addedReturnForDefaultExport && path.get('callee').matchesPattern('Object.defineProperty')) {
const [identifier, prop] = path.get('arguments');
const objectName = identifier.get('name').node;
const propertyName = prop.get('value').node;
if ((objectName === 'exports' || objectName === '_exports') && propertyName === 'default') {
addModuleExportsDefaults(path, objectName);
this.addedReturnForDefaultExport = true;
}
}
},
AssignmentExpression(path) {
// Check for an exports.default assignments.
if (
!this.addedReturnForDefaultExport &&
(
path.get('left').matchesPattern('exports.default') ||
path.get('left').matchesPattern('_exports.default')
)
) {
const objectName = path.get('left.object.name').node;
addModuleExportsDefaults(path, objectName);
this.addedReturnForDefaultExport = true;
}
}
}, this);
}
}
}
};
};
-455
View File
@@ -1,455 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Helper functions for working with Moodle component names, directories, and sources.
*
* @copyright 2019 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
"use strict";
/* eslint-env node */
/** @var {Object} A list of subsystems in Moodle */
const componentData = {};
/**
* Load details of all moodle modules.
*
* @returns {object}
*/
const fetchComponentData = () => {
const fs = require('fs');
const path = require('path');
const glob = require('glob');
const gruntFilePath = process.cwd();
if (!Object.entries(componentData).length) {
componentData.subsystems = {};
componentData.pathList = [];
componentData.components = {};
componentData.standardComponents = {};
// Fetch the component definiitions from the distributed JSON file.
const components = JSON.parse(fs.readFileSync(`${gruntFilePath}/lib/components.json`));
const pluginData = JSON.parse(fs.readFileSync(`${gruntFilePath}/lib/plugins.json`));
componentData.pluginTypes = components.plugintypes
const standardPlugins = Object.entries(pluginData.standard).map(
([pluginType, pluginNames]) => {
return pluginNames.map(pluginName => `${pluginType}_${pluginName}`);
}
).reduce((acc, val) => acc.concat(val), []);
// Build the list of moodle subsystems.
componentData.subsystems['public/lib'] = 'core';
componentData.pathList.push(`${process.cwd()}/public/lib`);
for (const [component, thisPath] of Object.entries(components.subsystems)) {
if (thisPath) {
// Prefix "core_" to the front of the subsystems.
componentData.subsystems[thisPath] = `core_${component}`;
componentData.pathList.push(`${process.cwd()}/${thisPath}`);
}
}
// The list of components includes the list of subsystems.
componentData.components = Object.fromEntries(
Object.entries(componentData.subsystems)
.map(([path, name]) => ([path, name]))
);
const subpluginAdder = (subpluginType, subpluginTypePath) => {
glob.sync(`${subpluginTypePath}/*/version.php`).forEach(versionPath => {
const componentPath = fs.realpathSync(path.dirname(versionPath));
const componentName = path.basename(componentPath);
const frankenstyleName = `${subpluginType}_${componentName}`;
componentData.components[`${subpluginTypePath}/${componentName}`] = frankenstyleName;
componentData.pathList.push(componentPath);
});
};
// Go through each of the plugintypes.
Object.entries(components.plugintypes).forEach(([pluginType, pluginTypePath]) => {
// We don't allow any code in this place..?
glob.sync(`${pluginTypePath}/*/version.php`).forEach(versionPath => {
const componentPath = fs.realpathSync(path.dirname(versionPath));
const componentName = path.basename(componentPath);
const frankenstyleName = `${pluginType}_${componentName}`;
componentData.components[`${pluginTypePath}/${componentName}`] = frankenstyleName;
componentData.pathList.push(componentPath);
// Look for any subplugins.
const subPluginConfigurationFile = `${componentPath}/db/subplugins.json`;
if (fs.existsSync(subPluginConfigurationFile)) {
const subpluginList = JSON.parse(fs.readFileSync(fs.realpathSync(subPluginConfigurationFile)));
if (subpluginList.subplugintypes) {
Object.entries(subpluginList.subplugintypes).forEach(([subpluginType, subpluginTypePath]) => {
subpluginAdder(
subpluginType,
`${pluginTypePath}/${componentName}/${subpluginTypePath}`
);
});
} else if (subpluginList.plugintypes) {
Object.entries(subpluginList.plugintypes).forEach(([subpluginType, subpluginTypePath]) => {
subpluginAdder(subpluginType, `public/${subpluginTypePath}`);
});
}
}
});
});
// Create a list of the standard subsystem and plugins.
componentData.standardComponents = Object.fromEntries(
Object.entries(componentData.components).filter(([, name]) => {
if (name === 'core' || name.startsWith('core_')) {
return true;
}
return standardPlugins.indexOf(name) !== -1;
})
);
componentData.componentMapping = Object.fromEntries(
Object.entries(componentData.components).map(([path, name]) => [name, path])
);
}
return componentData;
};
/**
* Get the list of component paths.
*
* @param {string} relativeTo
* @returns {array}
*/
const getComponentPaths = (relativeTo = '') => fetchComponentData().pathList.map(componentPath => {
return componentPath.replace(relativeTo, '');
});
/**
* Get the list of paths to build AMD sources.
*
* @returns {Array}
*/
const getAmdSrcGlobList = () => {
const globList = [];
fetchComponentData().pathList.forEach(componentPath => {
globList.push(`${componentPath}/amd/src/*.js`);
globList.push(`${componentPath}/amd/src/**/*.js`);
});
return globList;
};
/**
* Get the list of paths to build YUI sources.
*
* @param {String} relativeTo
* @returns {Array}
*/
const getYuiSrcGlobList = relativeTo => {
const globList = [];
fetchComponentData().pathList.forEach(componentPath => {
const relativeComponentPath = componentPath.replace(relativeTo, '');
globList.push(`${relativeComponentPath}/yui/src/**/*.js`);
});
return globList;
};
/**
* Get the list of paths to thirdpartylibs.xml.
*
* @param {String} relativeTo
* @returns {Array}
*/
const getThirdPartyLibsList = relativeTo => {
const fs = require('fs');
const path = require('path');
const pathList = fetchComponentData().pathList
.map(componentPath => path.relative(relativeTo, componentPath) + '/thirdpartylibs.xml')
.map(componentPath => componentPath.replace(/\\/g, '/'))
.filter(path => fs.existsSync(path));
pathList.push('lib/thirdpartylibs.xml');
return pathList.sort();
};
/**
* Get the list of thirdparty library paths.
*
* @returns {array}
*/
const getThirdPartyPaths = () => {
const DOMParser = require('@xmldom/xmldom').DOMParser;
const fs = require('fs');
const path = require('path');
const xpath = require('xpath');
const thirdpartyfiles = getThirdPartyLibsList(fs.realpathSync('./'));
const libs = ['node_modules/', 'vendor/'];
const addLibToList = lib => {
if (!lib.match('\\*') && fs.statSync(lib).isDirectory()) {
// Ensure trailing slash on dirs.
lib = lib.replace(/\/?$/, '/');
}
// Look for duplicate paths before adding to array.
if (libs.indexOf(lib) === -1) {
libs.push(lib);
}
};
thirdpartyfiles.forEach(function(file) {
const dirname = path.dirname(file);
const xmlContent = fs.readFileSync(file, 'utf8');
const doc = new DOMParser().parseFromString(xmlContent);
const nodes = xpath.select("/libraries/library/location/text()", doc);
nodes.forEach(function(node) {
let lib = path.posix.join(dirname, node.toString());
addLibToList(lib);
});
});
return libs;
};
/**
* Find the name of the component matching the specified path.
*
* @param {String} path
* @returns {String|null} Name of matching component.
*/
const getComponentFromPath = path => {
const componentList = fetchComponentData().components;
if (componentList.hasOwnProperty(path)) {
return componentList[path];
}
return null;
};
/**
* Check whether the supplied path, relative to the Gruntfile.js, is in a known component.
*
* @param {String} checkPath The path to check. This can be with either Windows, or Linux directory separators.
* @returns {String|null}
*/
const getOwningComponentDirectory = checkPath => {
const path = require('path');
// Fetch all components into a reverse sorted array.
// This ensures that components which are within the directory of another component match first.
const pathList = Object.keys(fetchComponentData().components).sort().reverse();
for (const componentPath of pathList) {
// If the componentPath is the directory being checked, it will be empty.
// If the componentPath is a parent of the directory being checked, the relative directory will not start with ..
if (!path.relative(componentPath, checkPath).startsWith('..')) {
return componentPath;
}
}
return null;
};
/**
* Get the latest tag in a remote GitHub repository.
*
* @param {string} url The remote repository.
* @returns {Array}
*/
const getRepositoryTags = async(url) => {
const gtr = require('git-tags-remote');
try {
const tags = await gtr.get(url);
if (tags !== undefined) {
return tags;
}
} catch (error) {
return [];
}
return [];
};
/**
* Get the list of thirdparty libraries that could be upgraded.
*
* @returns {Array}
*/
const getThirdPartyLibsUpgradable = async() => {
const libraries = getThirdPartyLibsData().filter((library) => !!library.repository);
const upgradableLibraries = [];
const versionCompare = (a, b) => {
if (a === b) {
return 0;
}
const aParts = a.split('.');
const bParts = b.split('.');
for (let i = 0; i < Math.min(aParts.length, bParts.length); i++) {
const aPart = parseInt(aParts[i], 10);
const bPart = parseInt(bParts[i], 10);
if (aPart > bPart) {
// 1.1.0 > 1.0.9
return 1;
} else if (aPart < bPart) {
// 1.0.9 < 1.1.0
return -1;
} else {
// Same version.
continue;
}
}
if (aParts.length > bParts.length) {
// 1.0.1 > 1.0
return 1;
}
// 1.0 < 1.0.1
return -1;
};
for (let library of libraries) {
upgradableLibraries.push(
getRepositoryTags(library.repository).then((tagMap) => {
library.version = library.version.replace(/^v/, '');
const currentVersion = library.version.replace(/moodle-/, '');
const currentMajorVersion = library.version.split('.')[0];
const tags = [...tagMap]
.map((tagData) => tagData[0])
.filter((tag) => !tag.match(/(alpha|beta|rc)/))
.map((tag) => tag.replace(/^v/, ''))
.sort((a, b) => versionCompare(b, a));
if (!tags.length) {
library.warning = "Unable to find any comparable tags.";
return library;
}
library.latestVersion = tags[0];
tags.some((tag) => {
if (!tag) {
return false;
}
// See if the version part matches.
const majorVersion = tag.split('.')[0];
if (majorVersion === currentMajorVersion) {
library.latestSameMajorVersion = tag;
return true;
}
return false;
});
if (versionCompare(currentVersion, library.latestVersion) > 0) {
// Moodle somehow has a newer version than the latest version.
library.warning = `Newer version found: ${currentVersion} > ${library.latestVersion} for ${library.name}`;
return library;
}
if (library.version !== library.latestVersion) {
// Delete version and add it again at the end of the array. That way, current and new will stay closer.
delete library.version;
library.version = currentVersion;
return library;
}
return null;
})
);
}
return (await Promise.all(upgradableLibraries)).filter((library) => !!library);
};
/**
* Get the list of paths to build react sources.
*
* @param {string} relativeTo
* @returns {string[]}
*/
const getReactTsSrcGlobList = (relativeTo = '') => {
const globList = [];
fetchComponentData().pathList.forEach(componentPath => {
const relativeComponentPath = componentPath.replace(relativeTo, '');
globList.push(`${relativeComponentPath}/js/esm/src/**/*.ts`);
globList.push(`${relativeComponentPath}/js/esm/src/**/*.tsx`);
});
return globList.map(componentPath => componentPath.replace(/\\/g, '/'));
};
/**
* Get the list of thirdparty libraries.
*
* @returns {Array}
*/
const getThirdPartyLibsData = () => {
const DOMParser = require('@xmldom/xmldom').DOMParser;
const fs = require('fs');
const xpath = require('xpath');
const path = require('path');
const libraryList = [];
const libraryFields = [
'location',
'name',
'version',
'repository',
];
const thirdpartyfiles = getThirdPartyLibsList(fs.realpathSync('./'));
thirdpartyfiles.forEach(function(libraryPath) {
const xmlContent = fs.readFileSync(libraryPath, 'utf8');
const doc = new DOMParser().parseFromString(xmlContent);
const libraries = xpath.select("/libraries/library", doc);
for (const library of libraries) {
const libraryData = [];
for (const field of libraryFields) {
libraryData[field] = xpath.select(`${field}/text()`, library)?.toString();
}
libraryData.location = path.join(path.dirname(libraryPath), libraryData.location);
libraryList.push(libraryData);
}
});
return libraryList.sort((a, b) => a.location.localeCompare(b.location));
};
module.exports = {
fetchComponentData,
getAmdSrcGlobList,
getComponentFromPath,
getComponentPaths,
getOwningComponentDirectory,
getYuiSrcGlobList,
getThirdPartyLibsList,
getThirdPartyPaths,
getThirdPartyLibsUpgradable,
getReactTsSrcGlobList,
};
-19
View File
@@ -1,19 +0,0 @@
# Moodle JavaScript Documentation
```
.-..-.
_____ | || |
/____/-.---_ .---. .---. .-.| || | .---.
| | _ _ |/ _ \/ _ \/ _ || |/ __ \
* | | | | | || |_| || |_| || |_| || || |___/
|_| |_| |_|\_____/\_____/\_____||_|\_____)
Moodle - the world's open source learning platform
```
## About
This generated documentation includes API documentation for JavaScript written in the AMD and ES2015 module formats within Moodle.
## Related information
See [https://moodledev.io](https://moodledev.io) for other related Developer Documentation.
-131
View File
@@ -1,131 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Helper functions for working with Moodle component names, directories, and sources.
*
* @copyright 2019 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
"use strict";
/* eslint-env node */
// Do not include any plugins as stanard.
const plugins = [];
plugins.push('plugins/markdown');
/**
* Get the source configuration.
*
* @return {Object}
*/
const getSource = () => {
const glob = require('glob');
const path = require('path');
const ComponentList = require(path.resolve('.grunt/components.js'));
const thirdPartyPaths = ComponentList.getThirdPartyPaths();
const source = {
include: [],
includePattern: ".+\\.js$",
};
let includeList = [];
ComponentList.getAmdSrcGlobList().forEach(async pattern => {
includeList.push(...glob.sync(pattern));
});
const cwdLength = process.cwd().length + 1;
includeList.forEach(path => {
if (source.include.indexOf(path) !== -1) {
// Ensure no duplicates.
return;
}
const relPath = path.substring(cwdLength);
if (thirdPartyPaths.indexOf(relPath) !== -1) {
return;
}
source.include.push(path);
});
source.include.push('.grunt/jsdoc/README.md');
return source;
};
const tags = {
// Allow the use of unknown tags.
// We have a lot of legacy uses of these.
allowUnknownTags: true,
// We make use of jsdoc and closure dictionaries as standard.
dictionaries: [
'jsdoc',
'closure',
],
};
// Template configuraiton.
const templates = {
cleverLinks: false,
monospaceLinks: false,
};
module.exports = {
opts: {
destination: "./public/jsdoc/",
template: "node_modules/docdash",
},
plugins,
recurseDepth: 10,
source: getSource(),
sourceType: 'module',
tags,
templates,
docdash: {
collapse: true,
search: true,
sort: true,
sectionOrder: [
"Namespaces",
"Modules",
"Events",
"Classes",
"Externals",
"Mixins",
"Tutorials",
"Interfaces"
],
"menu": {
"Developer Docs": {
href: "https://moodledev.io",
target: "_blank",
"class": "menu-item",
id: "devdocs"
},
"MDN Docs": {
href: "https://developer.mozilla.org/en-US/docs/Web/JavaScript",
target: "_blank",
"class": "menu-item",
id: "mdndocs",
},
},
typedefs: true,
},
};
-138
View File
@@ -1,138 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
import * as Components from '../../components.js';
const componentData = Components.fetchComponentData();
/**
* The standard components shipped with core Moodle.
*
* @type {Object}
*/
export const standardComponents = componentData.standardComponents;
/**
* All components of the current Moodle instance.
*
* @type {Object}
*/
export const allComponents = componentData.components;
/**
* Get all components of the current Moodle instance.
*
* @returns {Array}
*/
export const getAllComponents = () => {
let components = new Map(Object.entries(componentData.pluginTypes).map(([value, path]) => ([path,{
path,
value,
name: `${value} (plugin type)`,
}])));
Object
.entries(componentData.components)
.filter(([path, value]) => Object.values(componentData.standardComponents).includes(value))
.forEach(([path, value]) => {
const entry = {
path,
value,
name: value,
};
if (Object.values(componentData.subsystems).includes(value)) {
if (components.has(path)) {
entry.name = `${value} (subsystem / plugintype)`;
} else {
entry.name = `${value} (subsystem)`;
}
}
components.set(path, entry);
});
return Array.from(components.values());
};
/**
* Whether the specified component is a standard component shipped with core Moodle.
*
* @param {string} componentName
* @returns {boolean}
*/
export const isStandardComponent = (componentName) => {
if (Object.values(componentData.standardComponents).includes(componentName)) {
return true;
}
if (Object.keys(componentData.pluginTypes).includes(componentName)) {
return true;
}
return false;
};
export const rewritePlugintypeAsSubsystem = (componentName) => {
if (Object.keys(componentData.pluginTypes).includes(componentName)) {
const pluginTypePath = componentData.pluginTypes[componentName];
if (Object.keys(componentData.subsystems).includes(pluginTypePath)) {
return true;
}
}
return false;
};
/**
* Whether the specified component is a community component.
*
* @param {string} componentName
* @returns {boolean}
*/
export const isCommunityComponent = (componentName) => {
if (isStandardComponent(componentName)) {
return false;
}
return Object.values(componentData.components).indexOf(componentName) !== -1;
};
/**
* Sort method for components.
*
* This method sorts components putting `core` first, followed by core subsystems, then everything else.
*
* @param {String} a
* @param {String} b
* @returns {Number}
*/
export const sortComponents = (a, b) => {
// Always put 'core' first.
if (a === 'core') {
return -1;
} else if (b === 'core') {
return 1;
}
// Put core subsystems next.
if (a.startsWith('core_') && !b.startsWith('core_')) {
return -1;
} else if (b.startsWith('core_') && !a.startsWith('core_')) {
return 1;
}
// Sort alphabetically for everything else.
return a.localeCompare(b);
};
-85
View File
@@ -1,85 +0,0 @@
#!/usr/bin/env node
// 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/>.
import inquirer from 'inquirer';
import chalk from 'chalk';
import { createNote } from './note.mjs';
import { getInitialValues, getIssueNumberFromBranchName } from './helpers.mjs';
import * as Prompts from './prompts.mjs';
import logger from './logger.mjs';
export default async (options) => {
// Processs the initial values.
const initialValues = getInitialValues(options);
// Fetch information.
const messages = [];
const { issueNumber } = await inquirer.prompt([
Prompts.getIssuePrompt(getIssueNumberFromBranchName()),
], initialValues);
let selection = {};
let notePath;
do {
selection = {};
selection = await inquirer.prompt([
Prompts.getComponentsPrompt(),
Prompts.getTypePrompt(),
Prompts.getMessagePromptInput(),
], initialValues);
if (selection.message === '') {
selection = Object.assign(
selection,
await inquirer.prompt([
Prompts.getMessagePromptEditor(),
]),
);
}
logger.info(`
Creating upgrade note with the following options:
- Issue: ${chalk.bold(issueNumber)}
- Component: ${chalk.bold(selection.components)}
- Type: ${chalk.bold(selection.type)}
- Message:
${chalk.bold(selection.message)}
`);
messages.push({
components: [selection.components],
type: selection.type,
message: selection.message,
});
// Save the note so far.
if (notePath) {
await createNote(issueNumber, messages, notePath);
logger.info(`Updated note at: ${chalk.underline(chalk.bold(notePath))}`);
} else {
notePath = await createNote(issueNumber, messages);
logger.info(`Note created at: ${chalk.underline(chalk.bold(notePath))}`);
}
selection = Object.assign(
selection,
await inquirer.prompt([
Prompts.getAddAnotherPrompt(),
], initialValues),
);
} while (selection.addAnother);
};
-357
View File
@@ -1,357 +0,0 @@
#!/usr/bin/env node
// 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/>.
import chalk from 'chalk';
import { getAllComponents } from './components.mjs';
import { getCombinedNotesByComponent, deleteAllNotes } from './note.mjs';
import { getNoteName } from './noteTypes.mjs';
import { writeFile, readFile, unlink } from 'fs/promises';
import { join as joinPath } from 'path';
import logger from './logger.mjs';
import { getCurrentVersion } from './helpers.mjs';
/**
* Helper to fetch the current notes from a file.
*
* @param {string} file
* @returns {Promise<string>}
*/
const getCurrentNotes = async (file) => {
try {
return await readFile(file, 'utf8');
} catch (error) {
return null;
}
}
/**
* Update the UPGRADING.md file.
*
* @param {string} upgradeNotes
* @param {Object} options
* @param {boolean} options.deleteNotes
* @returns {Promise<void>}
*/
const updateUpgradeNotes = async (upgradeNotes, options) => {
const fileName = 'UPGRADING.md';
// Write the notes to a file.
logger.info(`Writing notes to ${chalk.underline(chalk.bold(fileName))}`);
// Prepend to the existing file.
const existingContent = await getCurrentNotes(fileName);
if (existingContent) {
await writeFile(fileName, getUpdatedNotes(existingContent, upgradeNotes));
} else {
// This should not normally happen.
await writeFile(fileName, upgradeNotes);
}
if (options.deleteNotes) {
logger.warn(`>>> Deleting all notes <<<`)
// Delete the notes.
deleteAllNotes();
}
};
/**
* Create the current summary notes.
*
* @param {string} upgradeNotes
* @returns {Promise<void>}
*/
const createCurrentSummary = async (upgradeNotes) => {
const fileName = 'UPGRADING-CURRENT.md';
const notes = `# Moodle upgrade notes\n\n${upgradeNotes}`;
await writeFile(fileName, notes);
logger.info(`Running upgrade notes written to ${chalk.underline(chalk.bold(fileName))}`);
};
/**
* Get the indexes of the lines that contain the version headings.
*
* @param {array<string>} lines
* @returns {array<object>}
*/
const getVersionLineIndexes = (lines) => {
const h2Indexes = [];
lines.forEach((line, index) => {
const matches = line.match(/^##\s(?<version>.*)$/);
if (matches) {
h2Indexes.push({
index,
line,
version: matches.groups.version,
});
}
});
return h2Indexes;
};
/**
* Find the index of the Unreleased heading.
*
* @param {array<object>} versionHeadings
* @returns {number}
*/
const findUnreleasedHeadingIndex = (versionHeadings) => versionHeadings.findIndex((heading) => {
if (heading.version === 'Unreleased') {
// Used if version cannot be guessed.
return true;
}
if (heading.version.endsWith('+')) {
// Weekly release for a stable branch.
return true;
}
if (heading.version.match(/beta|rc\d/)) {
// Beta and RC rolls are treated as weeklies.
return true;
}
if (heading.version.endsWith('dev')) {
// Development version.
return true;
}
return false;
});
/**
* Get the before and after content, to facilitate replacing any existing Unreleased notes.
*
* @param {array<string>} lines
* @returns {Object} {beforeContent: string, afterContent: string}
*/
const getBeforeAndAfterContent = (lines) => {
const existingLines = lines.split('\n');
const versionHeadings = getVersionLineIndexes(existingLines);
if (versionHeadings.length > 0) {
const unreleasedHeadingIndex = findUnreleasedHeadingIndex(versionHeadings);
if (unreleasedHeadingIndex !== -1) {
const beforeContent = existingLines.slice(0, versionHeadings[unreleasedHeadingIndex].index).join('\n');
if (versionHeadings.length > unreleasedHeadingIndex + 1) {
const afterContent = existingLines.slice(versionHeadings[unreleasedHeadingIndex + 1].index).join('\n');
return {
beforeContent,
afterContent,
};
}
return {
beforeContent,
afterContent: '',
};
}
return {
beforeContent: existingLines.slice(0, versionHeadings[0].index).join('\n'),
afterContent: existingLines.slice(versionHeadings[0].index).join('\n'),
};
}
return {
beforeContent: existingLines.join('\n'),
afterContent: '',
}
};
/**
* Get the notes for the component.
*
* @param {string} types
* @param {Number} headingLevel
* @returns {string}
*/
const getNotesForComponent = (types, headingLevel) => {
let upgradeNotes = '';
Object.entries(types).forEach(([type, notes]) => {
upgradeNotes += '#'.repeat(headingLevel);
upgradeNotes += ` ${getNoteName(type)}\n\n`;
notes.forEach(({ message, issueNumber }) => {
// Split the message into lines, removing empty lines.
const messageLines = message
.split('\n')
// Remove empty lines between tables, and list entries, but not after lists.
.filter((line, index, lines) => {
if (line.trim().length === 0) {
// This line is empty.
// If it's the first line in the file, remove it.
if (index === 0) {
return false;
}
// This is the last line in the file, remove it.
if (index === lines.length - 1) {
return false;
}
// If the previous line relates to a table, remove this line.
if (lines[index - 1].match(/^\s*\|/)) {
return false;
}
// If the next line is also empty, do not remove this line.
if (lines[index + 1].trim().length === 0) {
return true;
}
// Do not remove the line if the previous line was a list item.
if (lines[index - 1].match(/^\s*[-*]\s/)) {
return true;
}
if (lines[index - 1].match(/^\s*\d+\.\s/)) {
return true;
}
// Preserve all other empty lines by default.
return true;
}
// Keep any line which has content.
return true;
});
const firstLine = messageLines.shift().trim();
upgradeNotes += `- ${firstLine}\n`;
messageLines
.forEach((line) => {
upgradeNotes += ` ${line}`.trimEnd() + `\n`;
});
upgradeNotes += `\n For more information see [${issueNumber}](https://tracker.moodle.org/browse/${issueNumber})\n`;
});
upgradeNotes += '\n';
});
return upgradeNotes;
};
/**
* Get the updated notes mixed with existing content.
*
* @param {string} existingContent
* @param {string} upgradeNotes
*/
const getUpdatedNotes = (existingContent, upgradeNotes) => {
const { beforeContent, afterContent } = getBeforeAndAfterContent(existingContent);
const newContent = `${beforeContent}\n${upgradeNotes}\n${afterContent}`
.split('\n')
.filter((line, index, lines) => {
if (line === '' && lines[index - 1] === '') {
// Remove multiple consecutive empty lines.
return false;
}
return true;
})
.join('\n');
return newContent;
};
/**
* Update the notes for each component.
*/
const updateComponentNotes = (
notes,
version,
notesFileName = 'UPGRADING.md',
removeEmpty = false,
) => {
return getAllComponents().map(async (component) => {
logger.verbose(`Updating notes for ${component.name} into ${component.path}`);
const fileName = joinPath(component.path, notesFileName);
const existingContent = await getCurrentNotes(fileName);
if (!existingContent) {
if (!notes[component.value]) {
// No existing notes, and no new notes to add.
return;
}
} else {
if (!notes[component.value]) {
// There is existing content, but nothing to add.
if (removeEmpty) {
logger.verbose(`Removing empty notes file ${fileName}`);
await unlink(fileName);
}
return;
}
}
const componentNotes = notes[component.value];
let upgradeNotes = `## ${version}\n\n`;
upgradeNotes += getNotesForComponent(componentNotes, 3);
if (existingContent) {
await writeFile(fileName, getUpdatedNotes(existingContent, upgradeNotes));
} else {
await writeFile(
fileName,
`# ${component.name} Upgrade notes\n\n${upgradeNotes}`,
);
}
});
}
/**
* Generate the upgrade notes for a new release.
*
* @param {string|undefined} version
* @param {Object} options
* @param {boolean} options.generateUpgradeNotes
* @param {boolean} options.deleteNotes
* @returns {Promise<void>}
*/
export default async (version, options = {}) => {
const notes = await getCombinedNotesByComponent();
if (Object.keys(notes).length === 0) {
logger.warn('No notes to generate');
return;
}
if (!version) {
version = await getCurrentVersion();
}
// Generate the upgrade notes for this release.
// We have
// - a title with the release name
// - the change types
// - which contain the components
// - which document each change
let upgradeNotes = `## ${version}\n\n`;
Object.entries(notes).forEach(([component, types]) => {
upgradeNotes += `### ${component}\n\n`;
upgradeNotes += getNotesForComponent(types, 4);
});
await Promise.all([
createCurrentSummary(upgradeNotes),
...updateComponentNotes(notes, version, 'UPGRADING-CURRENT.md', true),
]);
if (options.generateUpgradeNotes) {
await Promise.all(updateComponentNotes(notes, version));
await updateUpgradeNotes(upgradeNotes, options);
}
};
-244
View File
@@ -1,244 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
import chalk from 'chalk';
import branchName from 'current-git-branch';
import { isStandardComponent, isCommunityComponent, rewritePlugintypeAsSubsystem } from './components.mjs';
import { isValidNoteName } from './noteTypes.mjs';
import logger from './logger.mjs';
import { readFile } from 'fs/promises';
/**
* Validate an issue number input
*
* @param {string} input
* @returns {string|boolean}
*/
export const validateIssueNumber = (input) => {
if (!input) {
return 'You must provide a tracker issue number';
}
if (input.match(/^[a-zA-Z]*-\d+$/)) {
return true;
}
if (input.match(/^\d+$/)) {
return true;
}
return 'The issue number was not recognised as a valid issue number';
};
/**
* Format an issue number input.
*
* @param {string} input
* @returns {string}
*/
export const formatIssueNumber = (input) => {
if (input.match(/^[a-zA-Z]*-\d+$/)) {
return input;
}
if (input.match(/^\d+$/)) {
return `MDL-${input}`;
}
return input;
};
/**
* Get the issue number, based off current git branch name
*
* @returns {string|null}
*/
export const getIssueNumberFromBranchName = () => {
const issueNumber = String(branchName()).match(/^[a-zA-Z]*-\d+/);
if (issueNumber) {
return formatIssueNumber(issueNumber[0]);
}
return null;
};
/**
* Validate a component.
*
* @param {string} input
* @returns {string|boolean}
*/
export const validateComponent = (input) => {
if (isStandardComponent(input)) {
return true;
}
if (isCommunityComponent(input)) {
return 'Currently only core plugins are supported.';
}
return 'The component was not recognised as a standard component';
};
export const formatComponent = (input) => {
if (rewritePlugintypeAsSubsystem(input)) {
return `core_${input}`;
}
return input;
}
/**
* Get the initial values from the options.
*
* @param {object} options
* @returns {object}
*/
export const getInitialValues = (options) => {
const initialValues = {};
const type = getInitialTypeValue(options);
if (type) {
initialValues.type = type;
}
const issueNumber = getInitialIssueValue(options);
if (issueNumber) {
initialValues.issueNumber = issueNumber;
}
const component = getInitialComponentValue(options);
if (component) {
initialValues.components = component;
}
const message = getInitialMessageValue(options);
if (message) {
initialValues.message = message
initialValues.addAnother = false;
}
return initialValues;
};
/**
* Get the initial type value.
*
* @param {Object} options
* @returns {string|undefined}
*/
const getInitialTypeValue = (options) => {
if (!options.type) {
return;
}
options.type = options.type.trim().toLowerCase();
if (isValidNoteName(options.type)) {
return options.type;
}
logger.warn(`Note type "${chalk.underline(chalk.red(options.type))}" is not valid.`);
};
/**
* Get the initial issue number value.
*
* @param {Object} options
* @returns {string|undefined}
*/
const getInitialIssueValue = (options) => {
if (!options.issue) {
return;
}
options.issue = options.issue.trim().toUpperCase();
const issueNumberValidated = validateIssueNumber(options.issue);
if (issueNumberValidated === true) {
const issueNumber = formatIssueNumber(options.issue);
if (issueNumber !== options.issue) {
logger.warn(
`Issue number "${chalk.underline(chalk.red(options.issue))}" was updated to ` +
`"${chalk.underline(chalk.green(issueNumber))}"`
);
}
return issueNumber;
} else {
logger.warn(`Issue number "${chalk.underline(chalk.red(options.issue))}" is not valid: ${issueNumberValidated}`);
}
};
/**
* Get the initial component value.
*
* @param {Object} options
* @returns {string|undefined}
*/
const getInitialComponentValue = (options) => {
if (!options.component) {
return;
}
options.component = options.component.trim().toLowerCase();
const componentValidated = validateComponent(options.component);
if (componentValidated === true) {
const component = formatComponent(options.component);
if (component !== options.component) {
logger.warn(
`Component "${chalk.underline(chalk.red(options.component))}" was updated to ` +
`"${chalk.underline(chalk.green(component))}"`
);
}
return component;
} else {
logger.warn(`Component "${chalk.underline(chalk.red(options.component))}" is not valid: ${componentValidated}`);
}
};
/**
* Get the initial message value.
*
* @param {Object} options
* @returns {string|undefined}
*/
const getInitialMessageValue = (options) => {
if (!options.message) {
return;
}
return options.message.trim();
};
/**
* Get the current version from the project /version.php file.
*
* @returns {Promise<string>}
*/
export const getCurrentVersion = async () => {
const versionRegex = new RegExp(/^ *\$release *= *['\"](?<release>[^ \+]+\+?) *\(Build:.*/m);
try {
const versionFile = await readFile('public/version.php', 'utf8');
const match = versionFile.match(versionRegex);
if (match) {
return match.groups.release;
}
} catch(error) {
logger.error('Unable to read the version file');
}
return "Unreleased";
}
-30
View File
@@ -1,30 +0,0 @@
#!/usr/bin/env node
// 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/>.
import winston from 'winston';
const logger = winston.createLogger({
level: 'info',
format: winston.format.combine(
winston.format.colorize(),
winston.format.simple()
),
transports: [
new winston.transports.Console(),
],
});
export default logger;
-194
View File
@@ -1,194 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
import yaml from 'js-yaml';
import path from 'path';
import { writeFile, mkdir, readdir, readFile, unlink } from 'fs/promises';
import { isValidNoteName, sortNoteTypes } from './noteTypes.mjs';
import { sortComponents } from './components.mjs';
const unreleasedPath = path.resolve('.upgradenotes');
/**
* Get the filename for the note.
*
* @param {string} issueNumnber The issue number
* @returns {string}
*/
const getFilename = (issueNumber) => {
const dateTimeFormat = new Intl.DateTimeFormat(undefined, {
year: 'numeric',
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
fractionalSecondDigits: 2,
timeZone: 'UTC',
});
const date = Object.fromEntries(
dateTimeFormat.formatToParts(new Date())
.filter((p) => p.type !== 'literal')
.map((p) => ([p.type, p.value]))
);
const dateString = [
date.year,
date.month,
date.day,
date.hour,
date.minute,
date.second,
date.fractionalSecond,
].join('');
return `${issueNumber}-${dateString}.yml`;
};
/**
* Create a new note.
*
* @param {string} issueNumber
* @param {[type: string]: {message: string}} messages
* @returns {string} The path to the note on disk
*/
export const createNote = async (
issueNumber,
messages,
notePath,
) => {
const note = {
issueNumber,
notes: {},
};
messages.forEach(({components, type, message}) => {
note.notes[components] = note.notes[components] || [];
note.notes[components].push({message, type});
});
if (!notePath) {
notePath = path.resolve(unreleasedPath, getFilename(issueNumber));
}
const noteContent = yaml.dump(note);
await mkdir(unreleasedPath, {recursive: true});
await writeFile(notePath, noteContent);
return notePath;
};
/**
* Get all unreleased notes.
*
* @returns {Promise<{issueNumber: string, components: string[], types: {[type: string]: {message: string}[]}}[]>
*/
export const getAllNotes = async () => {
const files = await readdir(unreleasedPath);
const notes = files
.filter((file) => file.endsWith('.yml'))
.map(async (file) => {
const filePath = path.resolve(unreleasedPath, file);
const fileContent = await readFile(filePath, 'utf8');
return {
...yaml.load(fileContent),
filePath,
};
});
return Promise.all(notes);
};
/**
* Get the list of notes, grouped by note type, then component.
*
* @returns {Promise<{[type: string]: {[components: string]: {message: string, issueNumber: string}[]}}>}
*/
export const getCombinedNotes = async () => {
const notes = await getAllNotes();
const combinedNotes = {};
notes.forEach((note) => {
Object.entries(note.notes).forEach(([components, data]) => {
data.forEach((entry) => {
if (!isValidNoteName(entry.type)) {
throw new Error(`Invalid note type: "${entry.type}" in file ${note.filePath}`);
}
combinedNotes[entry.type] = combinedNotes[entry.type] || {};
combinedNotes[entry.type][components] = combinedNotes[entry.type][components] || [];
combinedNotes[entry.type][components].push({message: entry.message, issueNumber: note.issueNumber});
});
});
});
return combinedNotes;
};
/**
* Get the list of notes, grouped by component, then by note type.
*
* @returns {Promise<{[component: string]: {[type: string]: {message: string, issueNumber: string}[]}}>}
*/
export const getCombinedNotesByComponent = async () => {
const notes = await getAllNotes();
const combinedNotes = {};
notes.forEach((note) => {
Object.entries(note.notes).forEach(([component, data]) => {
combinedNotes[component] = combinedNotes[component] || {};
data.forEach((entry) => {
if (!isValidNoteName(entry.type)) {
throw new Error(`Invalid note type: "${entry.type}" in file ${note.filePath}`);
}
combinedNotes[component][entry.type] = combinedNotes[component][entry.type] || [];
combinedNotes[component][entry.type].push({
component,
message: entry.message,
issueNumber: note.issueNumber,
type: entry.type,
});
});
});
});
// Sort notes by note type.
Object.entries(combinedNotes).forEach(([component, types]) => {
combinedNotes[component] = Object.fromEntries(
Object.entries(types).sort(([a], [b]) => sortNoteTypes(a, b))
);
});
// Sort components.
return Object.fromEntries(
Object.entries(combinedNotes).sort(([a], [b]) => sortComponents(a, b))
);
};
/**
* Delete all unreleased notes.
*
* @returns {Promise<void>}
*/
export const deleteAllNotes = async () => {
const files = await readdir(unreleasedPath);
return Promise.all(
files
.filter((item, index) => files.indexOf(item) === index)
.filter((file) => file.endsWith('.yml'))
.map((file) => unlink(`${unreleasedPath}/${file}`))
);
};
-80
View File
@@ -1,80 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* The note types.
*
* Matches the suggested order in https://keepachangelog.com/en/1.1.0/.
* @type {Object<string, string>}
*/
const noteTypes = {
'improved': 'Added',
'changed': 'Changed',
'deprecated': 'Deprecated',
'removed': 'Removed',
'fixed': 'Fixed',
};
/**
* The preferred order of note types.
*
* @type {string[]}
*/
const preferredOrder = Object.keys(noteTypes);
/**
* Comparison method to sort note types.
*
* @param {String} a
* @param {String} b
* @returns {Number}
*/
export const sortNoteTypes = (a, b) => {
const aIndex = preferredOrder.indexOf(a);
const bIndex = preferredOrder.indexOf(b);
if (aIndex === -1) {
return 1;
}
if (bIndex === -1) {
return -1;
}
return aIndex - bIndex;
};
/**
* Get the note names.
*
* @returns {string[]}
*/
export const getNoteNames = () => Object.keys(noteTypes);
/**
* Get the human-readable note name.
*
* @param {string} type
* @returns {string}
*/
export const getNoteName = (type) => noteTypes[type];
/**
* Whether the note name is valid.
*
* @param {string} type
* @returns {boolean}
*/
export const isValidNoteName = (type) => noteTypes[type] !== undefined;
-153
View File
@@ -1,153 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
import inquirer from 'inquirer';
import SearchList from 'inquirer-search-list';
import { getNoteNames } from './noteTypes.mjs';
import { getAllComponents } from './components.mjs';
import {
formatComponent,
formatIssueNumber,
validateComponent,
validateIssueNumber,
} from './helpers.mjs';
/**
* A Search List which accepts an initial value.
*/
class SearchListWithInitialValue extends SearchList {
constructor(options, ...args) {
super(options, ...args);
if (options.default) {
const pointer = this.filterList.findIndex((item) => {
return item.value === options.default;
});
if (pointer > -1) {
this.pointer = pointer;
}
}
}
}
inquirer.registerPrompt('search-list', SearchListWithInitialValue);
/**
* Get the issue type prompt.
*
* @param {string} defaultData The initially selected value
* @returns {Object}
*/
export const getTypePrompt = (defaultData) => ({
default: defaultData,
type: 'search-list',
message: 'Type of change',
name: 'type',
choices: getNoteNames(),
validate: (selection) => {
if (selection.length < 1) {
return 'You must select at least one type of change';
}
return true;
},
});
/**
* Get the component prompt.
*
* @param {string} [defaultValue='core'] The initally selected value.
* @returns
*/
export const getComponentsPrompt = (defaultValue) => {
if (!defaultValue ) {
defaultValue = 'core';
}
return {
choices: getAllComponents(),
default: defaultValue,
type: 'search-list',
message: 'Component',
name: 'components',
validate: validateComponent,
filter: formatComponent,
};
};
/**
* Get the issue number prompt as an inline input.
*
* @param {string} defaultData
* @returns {object}
*/
export const getIssuePrompt = (defaultData) => ({
default: defaultData,
type: 'input',
message: 'Tracker issue number',
name: 'issueNumber',
validate: validateIssueNumber,
filter: formatIssueNumber,
});
/**
* Get a message prompt.
*
* @param {string} defaultData
* @returns
*/
export const getMessagePromptEditor = (defaultData) => ({
default: defaultData,
type: process.stdin.isTTY ? 'editor' : 'input',
postfix: '.md',
message: 'Message',
name: 'message',
waitUserInput: false,
validate: (input) => {
if (!input) {
return 'You must provide a message';
}
return true;
},
// Remove any trailing whitespace.
filter: (input) => input.split('\n').map((line) => line.trimEnd()).join('\n'),
});
/**
* Get a message prompt.
*
* @param {string} defaultData
* @returns
*/
export const getMessagePromptInput = (defaultData) => ({
default: defaultData,
type: 'input',
message: 'Message (leave empty to use editor)',
name: 'message',
filter: (input) => input.trim(),
});
/**
* Get a prompt to ask the user if they wish to add another entry.
*
* @returns {Object}
*/
export const getAddAnotherPrompt = () => ({
type: 'confirm',
message: 'Do you want to add another note?',
default: false,
name: 'addAnother',
});
-58
View File
@@ -1,58 +0,0 @@
#!/usr/bin/env node
// 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/>.
import { getAllComponents } from './components.mjs';
import { getCombinedNotesByComponent } from './note.mjs';
import logger from './logger.mjs';
import { existsSync } from 'fs';
/**
* Generate links to component-specific upgrade notes for each component.
*
* @param {string|undefined} tag The git tag to link to
* @returns {Promise<void>}
*/
export default async (tag) => {
const notes = await getCombinedNotesByComponent();
if (Object.keys(notes).length === 0) {
logger.warn('No notes to generate');
return;
}
if (!tag) {
logger.error('No tag provided');
return;
}
// Generate the links for the components which have upgrade notes in this release.
let upgradeNotes = `### Component API updates\n<!--cspell: disable -->\n\n`;
const componentList = Object.fromEntries(
Object.values(getAllComponents()).map(({path, value}) => [value, path]),
);
Object.entries(notes)
.map(([component]) => ({
component,
componentPath: componentList[component],
}))
.filter(({ componentPath }) => existsSync(`./${componentPath}/UPGRADING.md`))
.forEach(({component, componentPath}) => {
upgradeNotes += `- [${component}](https://github.com/moodle/moodle/blob/${tag}/${componentPath}/UPGRADING.md)\n`;
});
console.log(upgradeNotes);
};
-142
View File
@@ -1,142 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* Component Library build tasks.
*
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
/**
* Get a child path of the component library.
*
* @param {string} path
* @returns {string}
*/
const getCLPath = path => `public/admin/tool/componentlibrary/${path}`;
/**
* Get a spawn handler.
*
* This is a generic function to write the spawn output, and then to exit if required and mark the async task as
* complete.
*
* @param {Promise} done
* @returns {function}
*/
const getSpawnHandler = done => (error, result, code) => {
grunt.log.write(result);
if (error) {
grunt.log.error(result.stdout);
process.exit(code);
}
done();
};
/**
* Spawn a function against Node with the provided args.
*
* @param {array} args
* @returns {object}
*/
const spawnNodeCall = (args) => grunt.util.spawn({
cmd: 'node',
args,
}, getSpawnHandler(grunt.task.current.async()));
/**
* Build the docs using Hugo.
*
* @returns {Object} Reference to the spawned task
*/
const docsBuild = () => spawnNodeCall([
'node_modules/hugo-bin/cli.js',
'--config', getCLPath('config.yml'),
'--cleanDestinationDir',
]);
/**
* Build the docs index using the hugo-lunr-indexer.
*
* @returns {Object} Reference to the spawned task
*/
const indexBuild = () => spawnNodeCall([
'node_modules/hugo-lunr-indexer/bin/hli.js',
'-i', getCLPath('content/**'),
'-o', getCLPath('hugo/site/data/my-index.json'),
'-l', 'yaml',
'-d', '---',
]);
/**
* Build the hugo CSS.
*
* @returns {Object} Reference to the spawned task
*/
const cssBuild = () => spawnNodeCall([
'node_modules/sass/sass.js',
'--style', 'expanded',
'--source-map',
'--embed-sources',
'--precision', 6,
'--load-path', `${process.cwd()}/public`,
getCLPath('hugo/scss/docs.scss'),
getCLPath('hugo/dist/css/docs.css'),
]);
// Register the various component library tasks.
grunt.registerTask('componentlibrary:docsBuild', 'Build the component library', docsBuild);
grunt.registerTask('componentlibrary:cssBuild', 'Build the component library', cssBuild);
grunt.registerTask('componentlibrary:indexBuild', 'Build the component library', indexBuild);
grunt.registerTask('componentlibrary', 'Build the component library', [
'componentlibrary:docsBuild',
'componentlibrary:cssBuild',
'componentlibrary:indexBuild',
]);
grunt.config.merge({
watch: {
componentLibraryDocs: {
files: [
getCLPath('content/**/*.md'),
getCLPath('hugo'),
],
tasks: ['componentlibrary:docsBuild', 'componentlibrary:indexBuild'],
},
componentLibraryCSS: {
files: [
getCLPath('hugo/scss/**/*.scss'),
'hugo',
],
tasks: ['componentlibrary:cssBuild'],
},
},
});
// Add the 'componentlibrary' task as a startup task.
grunt.moodleEnv.startupTasks.push('componentlibrary');
return {
docsBuild,
cssBuild,
indexBuild,
};
};
-72
View File
@@ -1,72 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
const files = grunt.moodleEnv.files;
// Project configuration.
grunt.config.merge({
eslint: {
// Even though warnings dont stop the build we don't display warnings by default because
// at this moment we've got too many core warnings.
// To display warnings call: grunt eslint --show-lint-warnings
// To fail on warnings call: grunt eslint --max-lint-warnings=0
// Also --max-lint-warnings=-1 can be used to display warnings but not fail.
options: {
quiet: (!grunt.option('show-lint-warnings')) && (typeof grunt.option('max-lint-warnings') === 'undefined'),
maxWarnings: ((typeof grunt.option('max-lint-warnings') !== 'undefined') ? grunt.option('max-lint-warnings') : -1)
},
// Check AMD src files.
amd: {src: files ? files : grunt.moodleEnv.amdSrc},
// Check YUI module source files.
yui: {src: files ? files : grunt.moodleEnv.yuiSrc},
// Check React source files.
'react': {
options: {
fix: true,
},
src: files ? files : grunt.moodleEnv.reactSrc,
},
},
});
grunt.loadNpmTasks('grunt-eslint');
// On watch, we dynamically modify config to build only affected files. This
// method is slightly complicated to deal with multiple changed files at once (copied
// from the grunt-contrib-watch readme).
let changedFiles = Object.create(null);
const onChange = grunt.util._.debounce(function() {
const files = Object.keys(changedFiles);
grunt.config('eslint.amd.src', files);
grunt.config('eslint.yui.src', files);
changedFiles = Object.create(null);
}, 200);
grunt.event.on('watch', (action, filepath) => {
changedFiles[filepath] = action;
onChange();
});
};
-92
View File
@@ -1,92 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
/**
* Get the list of feature files to pass to the gherkin linter.
*
* @returns {Array}
*/
const getGherkinLintTargets = () => {
if (grunt.moodleEnv.files) {
// Specific files were requested. Only check these.
return grunt.moodleEnv.files;
}
if (grunt.moodleEnv.inComponent) {
return [`${grunt.moodleEnv.runDir}/tests/behat/*.feature`];
}
return ['**/tests/behat/*.feature'];
};
const handler = function() {
const done = this.async();
const options = grunt.config('gherkinlint.options');
// Grab the gherkin-lint linter and required scaffolding.
const linter = require('gherkin-lint/dist/linter.js');
const featureFinder = require('gherkin-lint/dist/feature-finder.js');
const configParser = require('gherkin-lint/dist/config-parser.js');
const formatter = require('gherkin-lint/dist/formatters/stylish.js');
// Run the linter.
return linter.lint(
featureFinder.getFeatureFiles(grunt.file.expand(options.files)),
configParser.getConfiguration(configParser.defaultConfigFileName)
)
.then(results => {
// Print the results out uncondtionally.
formatter.printResults(results);
return results;
})
.then(results => {
// Report on the results.
// The done function takes a bool whereby a falsey statement causes the task to fail.
return results.every(result => result.errors.length === 0);
})
.then(done); // eslint-disable-line promise/no-callback-in-promise
};
grunt.registerTask('gherkinlint', 'Run gherkinlint against the current directory', handler);
grunt.config.set('gherkinlint', {
options: {
files: getGherkinLintTargets(),
}
});
grunt.config.merge({
watch: {
gherkinlint: {
files: [grunt.moodleEnv.inComponent ? 'tests/behat/*.feature' : '**/tests/behat/*.feature'],
tasks: ['gherkinlint'],
},
},
});
// Add the 'gherkinlint' task as a startup task.
grunt.moodleEnv.startupTasks.push('gherkinlint');
return handler;
};
-139
View File
@@ -1,139 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
/**
* Generate the PHPCS configuration.
*
* @param {Object} thirdPartyPaths
*/
const phpcsIgnore = (thirdPartyPaths) => {
const {toXML} = require('jstoxml');
const config = {
_name: 'ruleset',
_attrs: {
name: "MoodleCore",
},
_content: [
{
rule: {
_attrs: {
ref: './phpcs.xml.dist',
},
},
},
],
};
thirdPartyPaths.forEach(library => {
config._content.push({
'exclude-pattern': library,
});
});
grunt.file.write('phpcs.xml', toXML(config, {
header: true,
indent: ' ',
}) + "\n");
};
/**
* Extracts ignore entries from a local ignore file.
*
* @param {string} componentPath the file path to the component, relative to the code base directory
* @param {string} ignoreFilePath the path to the ignore file
* @return {array} array of ignore paths to be included in the global ignore files
*/
const getEntriesFromLocalIgnoreFile = (componentPath, ignoreFilePath) => {
const ignorePaths = [];
if (grunt.file.exists(ignoreFilePath)) {
const ignoreFile = grunt.file.read(ignoreFilePath);
const entries = ignoreFile.split('\n');
entries.forEach(entry => {
entry = entry.trim();
if (entry.length > 0 && !entry.startsWith('#') && !entry.startsWith('!')) {
while (entry.startsWith('/')) {
entry = entry.substring(1);
}
ignorePaths.push(componentPath + '/' + entry);
}
});
}
return ignorePaths;
};
/**
* Generate ignore files (utilising thirdpartylibs.xml data)
*/
const handler = function() {
const path = require('path');
const ComponentList = require(path.join(process.cwd(), '.grunt', 'components.js'));
// An array of paths to third party directories.
const thirdPartyPaths = ComponentList.getThirdPartyPaths();
const localStylelintIgnorePaths = [];
const localEslintIgnorePaths = [];
ComponentList.getComponentPaths(process.cwd() + '/').forEach(componentPath => {
const localEslintIgnorePath = process.cwd() + '/' + componentPath + '/.eslintignore';
const localEslintIgnoreEntries = getEntriesFromLocalIgnoreFile(componentPath, localEslintIgnorePath);
if (localEslintIgnoreEntries.length > 0) {
localEslintIgnorePaths.push(...localEslintIgnoreEntries);
}
const localStylelintIgnorePath = process.cwd() + '/' + componentPath + '/.stylelintignore';
const localStylelintIgnoreEntries = getEntriesFromLocalIgnoreFile(componentPath, localStylelintIgnorePath);
if (localStylelintIgnoreEntries.length > 0) {
localStylelintIgnorePaths.push(...localStylelintIgnoreEntries);
}
});
// Generate .eslintignore.
const eslintIgnores = [
'# Generated by "grunt ignorefiles"',
// Do not ignore the .grunt directory.
'!/.grunt',
// Ignore all yui/src meta directories and build directories.
'*/**/yui/src/*/meta/',
'*/**/build/',
].concat(thirdPartyPaths).concat(localEslintIgnorePaths);
grunt.file.write('.eslintignore', eslintIgnores.join('\n') + '\n');
// Generate .stylelintignore.
const stylelintIgnores = [
'# Generated by "grunt ignorefiles"',
'**/yui/build/*',
'public/theme/boost/style/moodle.css',
'public/theme/classic/style/moodle.css',
'jsdoc/styles/*.css',
'public/admin/tool/componentlibrary/hugo/dist/css/docs.css',
].concat(thirdPartyPaths).concat(localStylelintIgnorePaths);
grunt.file.write('.stylelintignore', stylelintIgnores.join('\n') + '\n');
phpcsIgnore(thirdPartyPaths);
};
grunt.registerTask('ignorefiles', 'Generate ignore files for linters', handler);
return handler;
};
-218
View File
@@ -1,218 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Function to generate the destination for the minification task
* (e.g. build/file.min.js). This function will be passed to
* the rename property of files array when building dynamically:
* http://gruntjs.com/configuring-tasks#building-the-files-object-dynamically
*
* @param {String} destPath the current destination
* @param {String} srcPath the matched src path
* @return {String} The rewritten destination path.
*/
const babelRename = function(destPath, srcPath) {
destPath = srcPath.replace(`amd/src`, `amd/build`);
destPath = destPath.replace(/\.js$/, '.min.js');
return destPath;
};
module.exports = grunt => {
// Load the React build tasks.
require('./react')(grunt);
// Load the Ignorefiles tasks.
require('./ignorefiles')(grunt);
// Load the Shifter tasks.
require('./shifter')(grunt);
// Load ESLint.
require('./eslint')(grunt);
// Load jsconfig.
require('./jsconfig')(grunt);
// Load JSDoc.
require('./jsdoc')(grunt);
const path = require('path');
// Register JS tasks.
grunt.registerTask('yui', ['eslint:yui', 'shifter']);
grunt.registerTask('amd', ['ignorefiles', 'eslint:amd', 'rollup']);
grunt.registerTask('js', ['amd', 'yui', 'react']);
// Register NPM tasks.
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-rollup');
const babelTransform = require('@babel/core').transform;
const babel = (options = {}) => {
return {
name: 'babel',
transform: (code, id) => {
grunt.log.debug(`Transforming ${id}`);
options.filename = id;
const transformed = babelTransform(code, options);
return {
code: transformed.code,
map: transformed.map
};
}
};
};
// Note: We have to use a rate limit plugin here because rollup runs all tasks asynchronously and in parallel.
// When we kick off a full run, if we kick off a rollup of every file this will fork-bomb the machine.
// To work around this we use a concurrent Promise queue based on the number of available processors.
const rateLimit = () => {
const queue = [];
let queueRunner;
const startQueue = () => {
if (queueRunner) {
return;
}
queueRunner = setTimeout(() => {
const limit = Math.max(1, require('os').cpus().length / 2);
grunt.log.debug(`Starting rollup with queue size of ${limit}`);
runQueue(limit);
}, 100);
};
// The queue runner will run the next `size` items in the queue.
const runQueue = (size = 1) => {
queue.splice(0, size).forEach(resolve => {
grunt.log.debug(`Item resolved. Kicking off next one.`);
resolve();
});
};
return {
name: 'ratelimit',
// The options hook is run in parallel.
// We can return an unresolved Promise which is queued for later resolution.
options: async(options) => {
return new Promise(resolve => {
queue.push(resolve);
startQueue();
return options;
});
},
// When an item in the queue completes, start the next item in the queue.
generateBundle: (options, bundle) => {
grunt.log.debug(`Finished output phase for ${Object.keys(bundle).join(', ')}`);
runQueue();
},
};
};
const terser = require('rollup-plugin-terser').terser;
grunt.config.merge({
rollup: {
options: {
format: 'esm',
dir: 'output',
sourcemap: true,
treeshake: false,
context: 'window',
plugins: [
rateLimit(),
babel({
sourceMaps: true,
comments: false,
compact: false,
plugins: [
'transform-es2015-modules-amd-lazy',
'system-import-transformer',
// This plugin modifies the Babel transpiling for "export default"
// so that if it's used then only the exported value is returned
// by the generated AMD module.
//
// It also adds the Moodle plugin name to the AMD module definition
// so that it can be imported as expected in other modules.
path.resolve('.grunt/babel-plugin-add-module-to-define.js')
],
presets: [
['@babel/preset-env', {
modules: false,
useBuiltIns: false
}]
]
}),
terser({
// Do not mangle variables.
// Makes debugging easier.
mangle: false,
}),
],
},
dist: {
files: [{
expand: true,
src: grunt.moodleEnv.files ? grunt.moodleEnv.files : grunt.moodleEnv.amdSrc,
rename: babelRename
}],
},
},
});
grunt.config.merge({
watch: {
amd: {
files: grunt.moodleEnv.inComponent
? ['amd/src/*.js', 'amd/src/**/*.js']
: ['**/amd/src/**/*.js'],
tasks: ['amd']
},
},
});
// Add the 'js' task as a startup task.
grunt.moodleEnv.startupTasks.push('js');
// On watch, we dynamically modify config to build only affected files. This
// method is slightly complicated to deal with multiple changed files at once (copied
// from the grunt-contrib-watch readme).
let changedFiles = Object.create(null);
const onChange = grunt.util._.debounce(function() {
const files = Object.keys(changedFiles);
grunt.config('rollup.dist.files', [{expand: true, src: files, rename: babelRename}]);
changedFiles = Object.create(null);
}, 200);
grunt.event.on('watch', function(action, filepath) {
changedFiles[filepath] = action;
onChange();
});
return {
babelRename,
};
};
-83
View File
@@ -1,83 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
/* eslint-env node */
// @ts-nocheck
/**
* @copyright 2022 Andrew Lyons <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
const configuration = {
compilerOptions: {
baseUrl: ".",
paths: {
},
target: "es2015",
allowSyntheticDefaultImports: false,
},
exclude: [
"node_modules",
],
include: [],
};
/**
* Generate jsconfig.json with AMD module path aliases for all components.
*
* @param {object} grunt The Grunt instance.
*/
const generateJsconfig = (grunt) => {
const jsconfigData = Object.assign({}, configuration);
const path = require('path');
const {fetchComponentData} = require(path.join(process.cwd(), '.grunt', 'components.js'));
const componentData = fetchComponentData().components;
for (const [thisPath, component] of Object.entries(componentData)) {
jsconfigData.compilerOptions.paths[`${component}/*`] = [`${thisPath}/amd/src/*`];
jsconfigData.include.push(`${thisPath}/amd/src/**/*`);
}
grunt.file.write('jsconfig.json', JSON.stringify(jsconfigData, null, " ") + "\n");
grunt.log.write('✓ Generating jsconfig.json\n');
};
/**
* Generate tsconfig.aliases.json with TypeScript path aliases for all ESM components.
*
* @returns {Promise<void>}
*/
const generateTsAliases = async() => {
const {generateAliases} = await import('../../.esbuild/generate-aliases.mjs');
generateAliases();
};
module.exports = (grunt) => {
const handler = async function() {
const done = this.async();
try {
generateJsconfig(grunt);
await generateTsAliases();
done();
} catch (err) {
grunt.log.error(err.message);
done(false);
}
};
grunt.registerTask('jsconfig', 'Generate a jsconfig configuration compatible with the LSP', handler);
};
-52
View File
@@ -1,52 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = (grunt) => {
const path = require('path');
grunt.registerTask('jsdoc', 'Generate JavaScript documentation using jsdoc', function() {
const done = this.async();
const configuration = path.resolve('.grunt/jsdoc/jsdoc.conf.js');
grunt.util.spawn({
cmd: 'jsdoc',
args: [
'--configure',
configuration,
]
}, function(error, result, code) {
if (result.stdout) {
grunt.log.write(result.stdout);
}
if (result.stderr) {
grunt.log.error(result.stderr);
}
if (error) {
grunt.fail.fatal(`JSDoc failed with error code ${code}`);
} else {
grunt.log.write('JSDoc completed successfully'.green);
}
done();
});
});
};
-111
View File
@@ -1,111 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
/* eslint-env node */
// @ts-nocheck
/**
* Grunt tasks for building React components.
*
* @copyright Meirza <meirza.arson@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
/**
* Register react task — build or watch React components.
*
* Modes:
* grunt react — production build
* grunt react:dev — development build (sourcemaps, no minification)
* grunt react:watch — esbuild native watch (dev mode, incremental context)
*
* Note: react:watch uses esbuild's own context.watch() and is intentionally
* separate from grunt-contrib-watch. This keeps esbuild's incremental build
* graph alive between rebuilds rather than restarting from scratch on each change.
*/
grunt.registerTask('react', 'Build all React components', function(mode) {
const done = this.async();
const isWatch = mode === 'watch';
const isDev = isWatch || mode === 'dev';
if (isWatch) {
const path = require('path');
const {spawn} = require('child_process');
// Run ESLint on the rebuilt source files in check-only mode (no --fix)
// to avoid writing changes that would re-trigger esbuild.
const eslintBin = path.join(grunt.moodleEnv.gruntFilePath, 'node_modules', '.bin', 'eslint');
const onRebuild = (srcFiles) => {
if (srcFiles.length === 0) {
return;
}
const absSrcFiles = srcFiles.map(f => path.join(grunt.moodleEnv.gruntFilePath, f));
spawn(eslintBin, absSrcFiles, {stdio: 'inherit'})
.on('error', err => grunt.log.error(`ESLint: ${err.message}`));
};
(async() => {
try {
const {watchComponents} = await import('../../.esbuild/plugin/plugincomponents.mjs');
const { generateAliases } = await import('../../.esbuild/generate-aliases.mjs');
const { buildPluginComponents } = await import('../../.esbuild/plugin/plugincomponents.mjs');
generateAliases();
await buildPluginComponents(isDev);
const ctx = await watchComponents(true, onRebuild);
if (!ctx) {
grunt.log.warn('No React source files found. Nothing to watch.');
done();
return;
}
grunt.log.ok('esbuild is watching for React changes. Press Ctrl+C to stop.');
// Keep the process alive until the user interrupts. done() is intentionally
// not called here — grunt's async mechanism holds the process open.
process.on('SIGINT', async() => {
await ctx.dispose();
done();
});
} catch (err) {
grunt.log.error(err.message);
done(false);
}
})();
return;
}
grunt.log.writeln(`Building React components in ${isDev ? 'DEVELOPMENT' : 'PRODUCTION'} mode...`);
(async() => {
try {
const {generateAliases} = await import('../../.esbuild/generate-aliases.mjs');
const {buildPluginComponents} = await import('../../.esbuild/plugin/plugincomponents.mjs');
generateAliases();
await buildPluginComponents(isDev);
done();
} catch (err) {
grunt.log.error(err.message);
done(false);
}
})();
});
};
-43
View File
@@ -1,43 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
grunt.loadNpmTasks('grunt-sass');
grunt.config.merge({
sass: {
dist: {
files: {
"public/theme/boost/style/moodle.css": "public/theme/boost/scss/preset/default.scss",
"public/theme/classic/style/moodle.css": "public/theme/classic/scss/classicgrunt.scss"
}
},
options: {
implementation: require('sass'),
includePaths: [
"public/theme/boost/scss/",
"public/theme/classic/scss/",
]
}
},
});
};
-155
View File
@@ -1,155 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/* eslint-env node */
module.exports = grunt => {
/**
* Shifter task. Is configured with a path to a specific file or a directory,
* in the case of a specific file it will work out the right module to be built.
*
* Note that this task runs the invidiaul shifter jobs async (becase it spawns
* so be careful to to call done().
*/
const handler = function() {
const done = this.async();
const options = grunt.config('shifter.options');
const async = require('async');
const path = require('path');
// Run the shifter processes one at a time to avoid confusing output.
async.eachSeries(options.paths, function(src, filedone) {
var args = [];
args.push(path.normalize(process.cwd() + '/node_modules/shifter/bin/shifter'));
// Always ignore the node_modules directory.
args.push('--excludes', 'node_modules');
// Determine the most appropriate options to run with based upon the current location.
if (grunt.file.isMatch('**/yui/**/*.js', src)) {
// When passed a JS file, build our containing module (this happen with
// watch).
grunt.log.debug('Shifter passed a specific JS file');
src = path.dirname(path.dirname(src));
options.recursive = false;
} else if (grunt.file.isMatch('**/yui/src', src)) {
// When in a src directory --walk all modules.
grunt.log.debug('In a src directory');
args.push('--walk');
options.recursive = false;
} else if (grunt.file.isMatch('**/yui/src/*', src)) {
// When in module, only build our module.
grunt.log.debug('In a module directory');
options.recursive = false;
} else if (grunt.file.isMatch('**/yui/src/*/js', src)) {
// When in module src, only build our module.
grunt.log.debug('In a source directory');
src = path.dirname(src);
options.recursive = false;
}
if (grunt.option('watch')) {
grunt.fail.fatal('The --watch option has been removed, please use `grunt watch` instead');
}
// Add the stderr option if appropriate
if (grunt.option('verbose')) {
args.push('--lint-stderr');
}
if (grunt.option('no-color')) {
args.push('--color=false');
}
var execShifter = function() {
grunt.log.ok("Running shifter on " + src);
grunt.util.spawn({
cmd: "node",
args: args,
opts: {cwd: src, stdio: 'inherit', env: process.env}
}, function(error, result, code) {
if (code) {
grunt.fail.fatal('Shifter failed with code: ' + code);
} else {
grunt.log.ok('Shifter build complete.');
filedone();
}
});
};
// Actually run shifter.
if (!options.recursive) {
execShifter();
} else {
// Check that there are yui modules otherwise shifter ends with exit code 1.
if (grunt.file.expand({cwd: src}, '**/yui/src/**/*.js').length > 0) {
args.push('--recursive');
execShifter();
} else {
grunt.log.ok('No YUI modules to build.');
filedone();
}
}
}, done);
};
// Register the shifter task.
grunt.registerTask('shifter', 'Run Shifter against the current directory', handler);
// Configure it.
grunt.config.set('shifter', {
options: {
recursive: true,
// Shifter takes a relative path.
paths: grunt.moodleEnv.files ? grunt.moodleEnv.files : [grunt.moodleEnv.runDir]
}
});
grunt.config.merge({
watch: {
yui: {
files: grunt.moodleEnv.inComponent
? ['yui/src/*.json', 'yui/src/**/*.js']
: ['**/yui/src/**/*.js'],
tasks: ['yui']
},
},
});
// On watch, we dynamically modify config to build only affected files. This
// method is slightly complicated to deal with multiple changed files at once (copied
// from the grunt-contrib-watch readme).
let changedFiles = Object.create(null);
const onChange = grunt.util._.debounce(function() {
const files = Object.keys(changedFiles);
grunt.config('shifter.options.paths', files);
changedFiles = Object.create(null);
}, 200);
grunt.event.on('watch', (action, filepath) => {
changedFiles[filepath] = action;
onChange();
});
return handler;
};
-49
View File
@@ -1,49 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
/**
* Generate ignore files (utilising thirdpartylibs.xml data)
*/
const handler = function() {
const path = require('path');
// Are we in a YUI directory?
if (path.basename(path.resolve(grunt.moodleEnv.cwd, '../../')) == 'yui') {
grunt.task.run('yui');
// Are we in an AMD directory?
} else if (grunt.moodleEnv.inAMD) {
grunt.task.run('amd');
// Are we in an ESM source directory?
} else if (grunt.moodleEnv.inEsm) {
grunt.task.run('react');
} else {
// Run all of the requested startup tasks.
grunt.moodleEnv.startupTasks.forEach(taskName => grunt.task.run(taskName));
}
};
// Register the startup task.
grunt.registerTask('startup', 'Run the correct tasks for the current directory', handler);
return handler;
};
-35
View File
@@ -1,35 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
// Load the ignorefiles tasks.
require('./ignorefiles')(grunt);
// Load the Style Lint tasks.
require('./stylelint')(grunt);
// Load the SASS tasks.
require('./sass')(grunt);
// Add the 'css' task as a startup task.
grunt.moodleEnv.startupTasks.push('css');
};
-187
View File
@@ -1,187 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
const getCssConfigForFiles = files => {
return {
stylelint: {
css: {
// Use a fully-qualified path.
src: files,
options: {
quietDeprecationWarnings: true,
configOverrides: {
rules: {
// These rules have to be disabled in .stylelintrc for scss compat.
"at-rule-no-unknown": true,
}
}
}
},
},
};
};
const getScssConfigForFiles = files => {
return {
stylelint: {
scss: {
options: {
quietDeprecationWarnings: true,
customSyntax: 'postcss-scss',
},
src: files,
},
},
};
};
/**
* Register any stylelint tasks.
*
* @param {Object} grunt
* @param {Array} files
* @param {String} fullRunDir
*/
const registerStyleLintTasks = () => {
const glob = require('glob');
// The stylelinters do not handle the case where a configuration was provided but no files were included.
// Keep track of whether any files were found.
let hasCss = false;
let hasScss = false;
// The stylelint processors do not take a path argument. They always check all provided values.
// As a result we must check through each glob and determine if any files match the current directory.
const scssFiles = [];
const cssFiles = [];
const requestedFiles = grunt.moodleEnv.files;
if (requestedFiles) {
// Grunt was called with a files argument.
// Check whether each of the requested files matches either the CSS or SCSS source file list.
requestedFiles.forEach(changedFilePath => {
let matchesGlob;
// Check whether this watched path matches any watched SCSS file.
matchesGlob = grunt.moodleEnv.scssSrc.some(watchedPathGlob => {
return glob.sync(watchedPathGlob).indexOf(changedFilePath) !== -1;
});
if (matchesGlob) {
scssFiles.push(changedFilePath);
hasScss = true;
}
// Check whether this watched path matches any watched CSS file.
matchesGlob = grunt.moodleEnv.cssSrc.some(watchedPathGlob => {
return glob.sync(watchedPathGlob).indexOf(changedFilePath) !== -1;
});
if (matchesGlob) {
cssFiles.push(changedFilePath);
hasCss = true;
}
});
} else {
// Grunt was called without a list of files.
// The start directory (runDir) may be a child dir of the project.
// Check each scssSrc file to see if it's in the start directory.
// This means that we can lint just mod/*/styles.css if started in the mod directory.
grunt.moodleEnv.scssSrc.forEach(path => {
if (path.startsWith(grunt.moodleEnv.runDir)) {
scssFiles.push(path);
hasScss = true;
}
});
grunt.moodleEnv.cssSrc.forEach(path => {
if (path.startsWith(grunt.moodleEnv.runDir)) {
cssFiles.push(path);
hasCss = true;
}
});
}
// Register the tasks.
const scssTasks = ['sass'];
if (hasScss) {
grunt.config.merge(getScssConfigForFiles(scssFiles));
scssTasks.unshift('stylelint:scss');
}
scssTasks.unshift('ignorefiles');
const cssTasks = ['ignorefiles'];
if (hasCss) {
grunt.config.merge(getCssConfigForFiles(cssFiles));
cssTasks.push('stylelint:css');
}
// The tasks must be registered, even if empty to ensure a consistent command list.
// They jsut won't run anything.
grunt.registerTask('scss', scssTasks);
grunt.registerTask('rawcss', cssTasks);
};
// Register CSS tasks.
grunt.loadNpmTasks('grunt-stylelint');
// Register the style lint tasks.
registerStyleLintTasks();
grunt.registerTask('css', ['scss', 'rawcss']);
const getCoreThemeMatches = () => {
const scssMatch = 'scss/**/*.scss';
if (grunt.moodleEnv.inTheme) {
return [scssMatch];
}
if (grunt.moodleEnv.runDir.startsWith('theme')) {
return [`*/${scssMatch}`];
}
return [`theme/*/${scssMatch}`];
};
// Add the watch configuration for rawcss, and scss.
grunt.config.merge({
watch: {
rawcss: {
files: [
'**/*.css',
],
excludes: [
'**/moodle.css',
'**/editor.css',
'jsdoc/styles/*.css',
],
tasks: ['rawcss']
},
scss: {
files: getCoreThemeMatches(),
tasks: ['scss']
},
},
});
};
-42
View File
@@ -1,42 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2023 Sara Arjona <sara@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
/**
* Generate upgradable third-party libraries (utilising thirdpartylibs.xml data)
*/
grunt.registerTask('upgradablelibs', 'Generate upgradable third-party libraries', async function() {
const done = this.async();
const path = require('path');
const ComponentList = require(path.join(process.cwd(), '.grunt', 'components.js'));
// An array of third party libraries that have a newer version in their repositories.
const thirdPartyLibs = await ComponentList.getThirdPartyLibsUpgradable({progress: true});
for (let library of thirdPartyLibs) {
grunt.log.ok(JSON.stringify(Object.assign({}, library), null, 4));
}
done();
});
};
-276
View File
@@ -1,276 +0,0 @@
/**
* This is a wrapper task to handle the grunt watch command. It attempts to use
* Watchman to monitor for file changes, if it's installed, because it's much faster.
*
* If Watchman isn't installed then it falls back to the grunt-contrib-watch file
* watcher for backwards compatibility.
*/
/* eslint-env node */
module.exports = grunt => {
/**
* This is a wrapper task to handle the grunt watch command. It attempts to use
* Watchman to monitor for file changes, if it's installed, because it's much faster.
*
* If Watchman isn't installed then it falls back to the grunt-contrib-watch file
* watcher for backwards compatibility.
*/
const watchHandler = function() {
const async = require('async');
const watchTaskDone = this.async();
let watchInitialised = false;
let watchTaskQueue = {};
let processingQueue = false;
const watchman = require('fb-watchman');
const watchmanClient = new watchman.Client();
// Grab the tasks and files that have been queued up and execute them.
var processWatchTaskQueue = function() {
if (!Object.keys(watchTaskQueue).length || processingQueue) {
// If there is nothing in the queue or we're already processing then wait.
return;
}
processingQueue = true;
// Grab all tasks currently in the queue.
var queueToProcess = watchTaskQueue;
// Reset the queue.
watchTaskQueue = {};
async.forEachSeries(
Object.keys(queueToProcess),
function(task, next) {
var files = queueToProcess[task];
var filesOption = '--files=' + files.join(',');
grunt.log.ok('Running task ' + task + ' for files ' + filesOption);
// Spawn the task in a child process so that it doesn't kill this one
// if it failed.
var args = [task, filesOption];
if (grunt.option('force')) {
args.push('--force');
}
grunt.util.spawn(
{
// Spawn with the grunt bin.
grunt: true,
// Run from current working dir and inherit stdio from process.
opts: {
cwd: grunt.moodleEnv.fullRunDir,
stdio: 'inherit'
},
args: args
},
function(err, res, code) {
if (code !== 0) {
// The grunt task failed.
grunt.log.error(err);
}
// Move on to the next task.
next();
}
);
},
function() {
// No longer processing.
processingQueue = false;
// Once all of the tasks are done then recurse just in case more tasks
// were queued while we were processing.
processWatchTaskQueue();
}
);
};
const originalWatchConfig = grunt.config.get(['watch']);
const watchConfig = Object.keys(originalWatchConfig).reduce(function(carry, key) {
if (key == 'options') {
return carry;
}
const value = originalWatchConfig[key];
const taskNames = value.tasks;
const files = value.files;
let excludes = [];
if (value.excludes) {
excludes = value.excludes;
}
taskNames.forEach(function(taskName) {
carry[taskName] = {
files,
excludes,
};
});
return carry;
}, {});
watchmanClient.on('error', function(error) {
// We have to add an error handler here and parse the error string because the
// example way from the docs to check if Watchman is installed doesn't actually work!!
// See: https://github.com/facebook/watchman/issues/509
if (error.message.match('Watchman was not found')) {
// If watchman isn't installed then we should fallback to the other watch task.
grunt.log.ok('It is recommended that you install Watchman for better performance using the "watch" command.');
// Fallback to the old grunt-contrib-watch task.
grunt.renameTask('watch-grunt', 'watch');
grunt.task.run(['watch']);
// This task is finished.
watchTaskDone(0);
} else {
grunt.log.error(error);
// Fatal error.
watchTaskDone(1);
}
});
watchmanClient.on('subscription', function(resp) {
if (resp.subscription !== 'grunt-watch') {
return;
}
resp.files.forEach(function(file) {
grunt.log.ok('File changed: ' + file.name);
var fullPath = grunt.moodleEnv.fullRunDir + '/' + file.name;
Object.keys(watchConfig).forEach(function(task) {
const fileGlobs = watchConfig[task].files;
var match = fileGlobs.some(function(fileGlob) {
return grunt.file.isMatch(`**/${fileGlob}`, fullPath);
});
if (match) {
// If we are watching a subdirectory then the file.name will be relative
// to that directory. However the grunt tasks expect the file paths to be
// relative to the Gruntfile.js location so let's normalise them before
// adding them to the queue.
var relativePath = fullPath.replace(grunt.moodleEnv.gruntFilePath + '/', '');
if (task in watchTaskQueue) {
if (!watchTaskQueue[task].includes(relativePath)) {
watchTaskQueue[task] = watchTaskQueue[task].concat(relativePath);
}
} else {
watchTaskQueue[task] = [relativePath];
}
}
});
});
processWatchTaskQueue();
});
process.on('SIGINT', function() {
// Let the user know that they may need to manually stop the Watchman daemon if they
// no longer want it running.
if (watchInitialised) {
grunt.log.ok('The Watchman daemon may still be running and may need to be stopped manually.');
}
process.exit();
});
// Initiate the watch on the current directory.
watchmanClient.command(['watch-project', grunt.moodleEnv.fullRunDir], function(watchError, watchResponse) {
if (watchError) {
grunt.log.error('Error initiating watch:', watchError);
watchTaskDone(1);
return;
}
if ('warning' in watchResponse) {
grunt.log.error('warning: ', watchResponse.warning);
}
var watch = watchResponse.watch;
var relativePath = watchResponse.relative_path;
watchInitialised = true;
watchmanClient.command(['clock', watch], function(clockError, clockResponse) {
if (clockError) {
grunt.log.error('Failed to query clock:', clockError);
watchTaskDone(1);
return;
}
// Generate the expression query used by watchman.
// Documentation is limited, but see https://facebook.github.io/watchman/docs/expr/allof.html for examples.
// We generate an expression to match any value in the files list of all of our tasks, but excluding
// all value in the excludes list of that task.
//
// [anyof, [
// [allof, [
// [anyof, [
// ['match', validPath, 'wholename'],
// ['match', validPath, 'wholename'],
// ],
// [not,
// [anyof, [
// ['match', invalidPath, 'wholename'],
// ['match', invalidPath, 'wholename'],
// ],
// ],
// ],
var matchWholeName = fileGlob => ['match', fileGlob, 'wholename'];
var matches = Object.keys(watchConfig).map(function(task) {
const matchAll = [];
matchAll.push(['anyof'].concat(watchConfig[task].files.map(matchWholeName)));
if (watchConfig[task].excludes.length) {
matchAll.push(['not', ['anyof'].concat(watchConfig[task].excludes.map(matchWholeName))]);
}
return ['allof'].concat(matchAll);
});
matches = ['anyof'].concat(matches);
var sub = {
expression: matches,
// Which fields we're interested in.
fields: ["name", "size", "type"],
// Add our time constraint.
since: clockResponse.clock
};
if (relativePath) {
/* eslint-disable camelcase */
sub.relative_root = relativePath;
}
watchmanClient.command(['subscribe', watch, 'grunt-watch', sub], function(subscribeError) {
if (subscribeError) {
// Probably an error in the subscription criteria.
grunt.log.error('failed to subscribe: ', subscribeError);
watchTaskDone(1);
return;
}
grunt.log.ok('Listening for changes to files in ' + grunt.moodleEnv.fullRunDir);
});
});
});
};
// Rename the grunt-contrib-watch "watch" task because we're going to wrap it.
grunt.renameTask('watch', 'watch-grunt');
// Register the new watch handler.
grunt.registerTask('watch', 'Run tasks on file changes', watchHandler);
grunt.config.merge({
watch: {
options: {
nospawn: true // We need not to spawn so config can be changed dynamically.
},
},
});
return watchHandler;
};
-111
View File
@@ -1,111 +0,0 @@
#!/usr/bin/env node
// 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/>.
import { Argument, Option, program } from 'commander';
import chalk from 'chalk';
import { getNoteNames } from './notes/src/noteTypes.mjs';
import createAction from './notes/src/create.mjs';
import generateAction from './notes/src/generate.mjs';
import generateReleaseNotesLinks from './notes/src/releasenotes.mjs';
import logger from './notes/src/logger.mjs';
console.log(`
${chalk.bold(chalk.underline(chalk.green('Moodle Upgrade Notes Generator')))}
This tool is used to generate the upgrade notes for changes you make in Moodle.
Please remember that the intended audience of these changes is
${chalk.italic('plugin developers')} who need to know how to update their plugins
for a new Moodle version.
Upgrade notes should not be used to document changes for site administrators, or
for internal API changes which are not expected to be used outside of the
relevant component.
`)
program.configureHelp({
helpWidth: 100,
});
program.on('option:verbose', () => {
logger.level = 'verbose';
});
program.addOption(
new Option(
'-v, --verbose',
'Output more information during the generation process',
)
.default(false)
);
// Define the command line options.
program
.command('create')
.summary('Generate a new upgrade note')
.addOption(
new Option('-t, --type <type>', `The type of change to document. Valid types are: ${getNoteNames().join(', ')}`)
)
.addOption(new Option('-i, --issue <issue>', 'The tracker issue number'))
.addOption(new Option('-c, --component <component>', 'The component to write a note for'))
.addOption(new Option(
'-m, --message <message>',
'The message to use for the upgrade note',
))
.action((options) => createAction(options));
program
.command('summary')
.summary('Generate a local copy of the upgrade notes summary')
.addArgument(
new Argument('[version]', 'The Moodle version to create the summary notes for')
)
.action((version) => generateAction(version));
program
.command('releasenotes')
.summary('Generate a list of upgrade notes for individual components in markdown format for the release notes')
.addArgument(
new Argument('[tag]', 'The Moodle tag')
)
.action((tag) => generateReleaseNotesLinks(tag));
program
.command('release')
.summary('Generate the markdown copies of the upgrade notes for a Moodle release')
.addArgument(
new Argument('[version]', 'The Moodle version to create the release notes for')
)
.addOption(
new Option(
'--generate-upgrade-notes',
'Generate the UPGRADING.md notes for the release. ' +
'Note: This option is intended for use by the release manager when generating the upgrade notes.',
)
.default(true)
)
.addOption(
new Option(
'-d, --delete-notes',
'Delete the notes after generating the UPGRADING.md notes for the release. ' +
'Note: This option is intended for use by the release manager when generating the upgrade notes.' +
'This option has no effect unless --generate-upgrade-notes is also set.'
)
.default(false)
)
.action((version, options) => generateAction(version, options));
program.parse();
-2
View File
@@ -1,2 +0,0 @@
**/amd/**
/*.js
-58
View File
@@ -1,58 +0,0 @@
// NOTE: We use eslint now. This file is used only by shifter. We keep the configuration
// here because shifter uses jshint after modules have been concating. Eslint can't
// currently do this.
{
"asi": false,
"bitwise": true,
"boss": false,
"browser": true,
"curly": true,
"debug": false,
"eqeqeq": false,
"eqnull": false,
"es5": false,
"esnext": false,
"evil": false,
"expr": false,
"forin": false,
"funcscope": false,
"globalstrict": false,
"immed": true,
"indent": 4,
"iterator": false,
"lastsemic": false,
"latedef": true,
"laxbreak": true,
"laxcomma": false,
"loopfunc": false,
"maxerr": 500,
"maxlen": 132,
"multistr": false,
"newcap": true,
"noarg": true,
"noempty": true,
"nomen": false,
"onecase": false,
"onevar": false,
"passfail": false,
"plusplus": false,
"predef": [
"M",
"define",
"require"
],
"proto": false,
"regexdash": false,
"regexp": false,
"scripturl": false,
"shadow": false,
"smarttabs": false,
"strict": false,
"sub": false,
"supernew": false,
"trailing": true,
"undef": true,
"unused": true,
"white": false,
"yui": true
}
-1
View File
@@ -1 +0,0 @@
lts/jod
-40
View File
@@ -1,40 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Helper file for PhpStorm, and other IDEs, to provide better code completion.
*
* @package core
* @copyright 2024 Andrew Lyons <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace PHPSTORM_META;
// Assume that anything returned by \core\di::get('...') is an instance of the first argument.
override(\core\di::get(0), map([
'' => '@',
]));
// Assume that anything returned by \Psr\Container\ContainerInterface::get('...') is an instance of the first argument.
override(\Psr\Container\ContainerInterface::get(0), map([
'' => '@',
]));
// Assume that anything returned by \DI\Container::get('...') is an instance of the first argument.
override(\DI\Container::get(0), map([
'' => '@',
]));
-5
View File
@@ -1,5 +0,0 @@
{
"coverage": false,
"lint": "config",
"clean": true
}
-107
View File
@@ -1,107 +0,0 @@
{
"customSyntax": "postcss-scss",
"plugins": [
"stylelint-csstree-validator"
],
"rules": {
"csstree/validator": {
"syntaxExtensions": [
"sass"
]
},
"at-rule-empty-line-before": [ "always",
{"except": [ "blockless-after-blockless"], ignore: ["after-comment", "inside-block"]}
],
"at-rule-name-case": "lower",
"at-rule-name-space-after": "always-single-line",
"at-rule-no-unknown": null, # Enabled for non-scss in grunt.
"at-rule-semicolon-newline-after": "always",
"at-rule-semicolon-space-before": "never",
"block-closing-brace-newline-after": "always",
"block-closing-brace-newline-before": "always",
"block-closing-brace-space-before": "always-single-line",
"block-no-empty": true,
"block-opening-brace-newline-after": "always",
"block-opening-brace-space-after": "always-single-line",
"block-opening-brace-space-before": "always",
"color-hex-case": ["lower", { "severity": "warning" }],
"color-hex-length": ["short", { "severity": "warning" }],
"color-no-invalid-hex": true,
"declaration-bang-space-after": "never",
"declaration-bang-space-before": "always",
"declaration-block-no-duplicate-properties": true,
"declaration-block-no-shorthand-property-overrides": true,
"declaration-block-semicolon-newline-after": "always-multi-line",
"declaration-block-semicolon-space-after": "always-single-line",
"declaration-block-semicolon-space-before": "never",
"declaration-block-single-line-max-declarations": 1,
"declaration-block-trailing-semicolon": "always",
"declaration-colon-newline-after": "always-multi-line",
"declaration-colon-space-after": "always-single-line",
"declaration-colon-space-before": "never",
"declaration-no-important": true,
"font-family-no-duplicate-names": true,
"function-calc-no-unspaced-operator": true,
"function-comma-newline-after": "always-multi-line",
"function-comma-space-after": "always-single-line",
"function-comma-space-before": "never",
"function-linear-gradient-no-nonstandard-direction": true,
"function-max-empty-lines": 0,
"function-name-case": "lower",
"function-parentheses-newline-inside": "always-multi-line",
"function-parentheses-space-inside": "never-single-line",
"function-url-scheme-disallowed-list": ["data"],
"function-whitespace-after": "always",
"indentation": 4,
"keyframe-declaration-no-important": true,
"length-zero-no-unit": [true, { "severity": "warning" }],
"max-empty-lines": 2,
"max-line-length": [132, { "severity": "warning" }],
"media-feature-colon-space-after": "always",
"media-feature-colon-space-before": "never",
"media-feature-parentheses-space-inside": "never",
"media-feature-range-operator-space-after": "always",
"media-feature-range-operator-space-before": "always",
"media-query-list-comma-newline-after": "always-multi-line",
"media-query-list-comma-space-after": "always-single-line",
"media-query-list-comma-space-before": "never",
"no-empty-source": true,
"no-eol-whitespace": true,
"no-extra-semicolons": [true, { "severity": "warning" }],
"no-invalid-double-slash-comments": true,
"no-unknown-animations": true,
"property-case": "lower",
"property-no-unknown": true,
"selector-attribute-brackets-space-inside": "never",
"selector-attribute-operator-space-after": "never",
"selector-attribute-operator-space-before": "never",
"selector-combinator-space-after": "always",
"selector-combinator-space-before": "always",
"selector-list-comma-newline-after": "always",
"selector-list-comma-space-before": "never",
"selector-max-empty-lines": 0,
"selector-pseudo-class-case": "lower",
"selector-pseudo-class-no-unknown": true,
"selector-pseudo-class-parentheses-space-inside": "never",
"selector-pseudo-element-case": "lower",
"selector-pseudo-element-no-unknown": true,
"selector-type-case": "lower",
"selector-type-no-unknown": true,
"string-no-newline": true,
"time-min-milliseconds": 100,
"unit-disallowed-list": ["pt"],
"unit-case": "lower",
"unit-no-unknown": true,
"value-keyword-case": ["lower", {"ignoreKeywords": ["/(@|$)/"]}],
"value-list-comma-newline-after": "always-multi-line",
"value-list-comma-space-after": "always-single-line",
"value-list-comma-space-before": "never",
},
"overrides": [
{
"files": ["**/yui/**/*.css"],
"rules": {
}
}
]
}
@@ -1,7 +0,0 @@
issueNumber: MDL-51152
notes:
enrol_manual:
- message: >-
The unused parameter 'roleid' has been removed from the external
function `unenrol_users()`
type: removed
@@ -1,22 +0,0 @@
issueNumber: MDL-71368
notes:
core:
- message: >
The `arg_separator.output` has been changed from a default of `amp;` to
a default of `&` in line with PHP defaults.
If you were previously relying on the legacy default when using
`http_build_query()` then you should _actively_ specify the value as the
third
parameter, for example:
```
http_build_query($formdata, '', '&amp;');
```
type: changed
@@ -1,8 +0,0 @@
issueNumber: MDL-73602
notes:
core:
- message: >-
Removed `qtype_random` from core.
`core\component::is_valid_plugin_name` has an additional check to ensure no-one can create a new plugin called qtype_random,
as this would conflict with the support for restoring old backups.
type: removed
@@ -1,8 +0,0 @@
issueNumber: MDL-75067
notes:
tool_behat:
- message: >-
The `behat_session_trait::ensure_element_[does_not_]exists(...)` methods
now accept optional `$container` parameter to define the parent node to
look within
type: improved
@@ -1,5 +0,0 @@
issueNumber: MDL-77894
notes:
core:
- message: Appending an exclamation mark to template names ignores theme overrides
type: improved
@@ -1,10 +0,0 @@
issueNumber: MDL-78325
notes:
core_grades:
- message: >-
In Moodle 4.2, the legacy Gradebook base widget from 4.1 has been removed and
replaced with a simpler class-based system due to a breaking change and
excessive complexity in the old pattern. The files `core/grades/basewidget.js` and
templates in `grade/templates/searchwidget/` have been deleted,
with minimal expected third-party impact.
type: removed
@@ -1,13 +0,0 @@
issueNumber: MDL-79182
notes:
core:
- message: >
The following AMD modules have been removed following the final
deprecation process. It is no longer possible or necessary to manually
register modal types. See MDL-78324 for further details.
- `core/modal_registry`
- `core/modal_factory`
type: removed
@@ -1,7 +0,0 @@
issueNumber: MDL-79574
notes:
core:
- message: >-
The `\core\persistent::get_records(...)` class method now returns
instances keyed by record ID
type: changed
@@ -1,13 +0,0 @@
issueNumber: MDL-81514
notes:
core_group:
- message: >
`groups_print_activity_menu()` and `groups_get_activity_group()` now
include an additional `$participationonly` parameter, which is true by
default. This can be set false when we want the user to be able to
select a non-participation group within an activity, for example if a
teacher wants to filter assignment submissions by non-participation
groups. It should never be used when the menu is displayed to students,
as this may allow them to participate using non-participation groups.
Non-participation groups are labeled as such.
type: improved
@@ -1,8 +0,0 @@
issueNumber: MDL-81608
notes:
mod_quiz:
- message: >-
The language strings `addpagebreak` and `removepagebreak` have been
deprecated and should no longer be used. These have been replaced by
the `addpagebreakafter` and `removepagebreakafter` language strings.
type: deprecated
@@ -1,12 +0,0 @@
issueNumber: MDL-81961
notes:
core_question:
- message: |
core_question:
- message: |
Final deprecation of `moodle-question-chooser` YUI module.
type: removed
- message: |
Final deprecation of `core_question/qbank_chooser` template.
type: removed
type: removed
-13
View File
@@ -1,13 +0,0 @@
issueNumber: MDL-81962
notes:
core:
- message: The `moodle-core-notification-confirm` YUI module has been removed after an extensive deprecation period. Please use the AMD `core/modal` module as a replacement.
type: removed
- message: |
The following feaetures of the `moodle-core-notification` YUI module have been removed after an extensive deprecation process.:
- method: `keyDelegation`
- property: `lightbox`
There is no direct replacement for these features, but they were not widely used and their removal should not cause significant issues. If you were using these features, you will need to implement your own solutions for key delegation and lightbox functionality.
type: removed
@@ -1,7 +0,0 @@
issueNumber: MDL-82284
notes:
core:
- message: >-
Legacy constructors have been removed. These relate to PHP 4 and
earlier.
type: removed
@@ -1,15 +0,0 @@
issueNumber: MDL-83902
notes:
core_badges:
- message: >-
The following classes and functions are now also available in the following new
locations. They will continue to work in their old locations:
| Old classname/function | New classname/function |
| --- | --- |
| `\badge_award_selector_base` | `\core_badges\award_selector_base` |
| `\badge_potential_users_selector` | `\core_badges\potential_award_selector` |
| `\badge_existing_users_selector` | `\core_badges\existing_award_selector` |
| `process_manual_award()` | `\core_badges\award_manager::process_manual_award()` |
| `process_manual_revoke()` | `\core_badges\award_manager::process_manual_revoke()` |
type: improved
@@ -1,7 +0,0 @@
issueNumber: MDL-84082
notes:
core_reportbuilder:
- message: >-
The text filter "Contains" and "Not contains" operators now support `*`
and `?` wildcard characters for better text content filtering
type: improved
@@ -1,30 +0,0 @@
issueNumber: MDL-84960
notes:
core:
- message: >-
Several core web services now include a new initials field in user data
structures. This change is backward-compatible and only adds an optional
field; no existing fields or field semantics have been changed.
Client applications should ensure they can handle the additional initials
field in web service responses, but clients that ignore unknown fields can
continue working without changes. The affected web services are:
- core_enrol_get_enrolled_users
- core_enrol_get_enrolled_users_with_capability
- core_enrol_get_potential_users
- core_enrol_search_users
- core_user_get_users_by_field
- core_user_get_users
- core_user_get_course_user_profiles
- core_grades_get_enrolled_users_for_selector
- core_grades_get_gradable_users
- gradereport_grader_get_users_in_report
- core_message_get_contact_requests
- core_message_get_conversation_members
- core_message_message_search_users
- core_message_get_user_contacts
- core_message_get_member_info
- core_message_get_conversation_messages
- mod_assign_list_participants
- mod_assign_get_participant
- mod_forum_get_forum_discussions
type: improved
@@ -1,9 +0,0 @@
issueNumber: MDL-85233
notes:
core_filters:
- message: >-
MimeTeX support has been removed from both `filter_tex` and
`filter_algebra`. These filters now depend on LaTeX tools (`latex`,
`dvips`, and `convert`/`dvisvgm`), and as a result, the `pathmimetex`
setting has been removed.
type: removed
@@ -1,8 +0,0 @@
issueNumber: MDL-85322
notes:
block_html:
- message: >-
Treat Dashboard (pagetype 'my-index') as trusted in web services so
get_content_for_external preserves embedded HTML (e.g. iframes) on user
Dashboard.
type: changed
@@ -1,8 +0,0 @@
issueNumber: MDL-85336
notes:
core:
- message: >-
Redis connection timeout settings for cachestores and sessions have been
split into connection timeout and read timeout to allow for finer
control. These settings now also accept floats.
type: improved
@@ -1,9 +0,0 @@
issueNumber: MDL-85405
notes:
core_course:
- message: >-
The external function `core_course_get_course_contents` now includes the
`candisplay` property for each returned module. If this is false, the
module should not be displayed on the course page (for example, for
question banks).
type: improved
@@ -1,5 +0,0 @@
issueNumber: MDL-85621
notes:
core_badges:
- message: The create_issued_badge generator now returns the issued badge object.
type: changed
@@ -1,11 +0,0 @@
issueNumber: MDL-85621
notes:
core_badges:
- message: >-
The class core_badges_assertion has been deprecated and replaced by
\core_badges\achievement_credential.
The method badges_get_default_issuer() has also been deprecated because
it is no longer needed.
The file badges/endorsement.php has been removed because it stopped being used
when MDL-84323 was integrated.
type: deprecated
@@ -1,17 +0,0 @@
issueNumber: MDL-85975
notes:
core:
- message: >
`restore_qtype_plugin::unset_excluded_fields` now returns the modified
questiondata structure,
in order to support structures that contain arrays.
If your qtype plugin overrides
`restore_qtype_plugin::remove_excluded_question_data` without
calling the parent method, you may need to modify your overridden method
to use the returned
value.
type: fixed
@@ -1,8 +0,0 @@
issueNumber: MDL-86332
notes:
core_completion:
- message: >-
The `completion_info::clear_criteria` method takes an optional
`$removetypecriteria` to determine whether to remove course type
criteria from other courses that refer to the current course
type: changed
@@ -1,26 +0,0 @@
issueNumber: MDL-86493
notes:
mod_quiz:
- message: >-
The quiz overrides cache implementation has been replaced with a faster alternative with a different API.
This should be a transparent change but any direct references will still need to be updated.
type: deprecated
- message: >
`mod_quiz_cm_info_dynamic()` now uses the new `quiz_overrides` cache via `override_manager`, performing a single cache fetch per quiz/user.
This significantly reduces cache calls on course pages with many quizzes and groups.
The new `mod_quiz:quiz_overrides` cache is keyed by `quizid_userid` using datasource `\mod_quiz\cache\quiz_overrides_cache`.
This cache returns all applicable overrides for a user in a quiz (the user override, if any, plus all group overrides for groups they belong to in the quiz's course).
New class `\mod_quiz\local\quiz_overrides_cache_manager` to interact with the cache:
- `get_overrides(int $quizid, int $userid): array`
- `purge_for_user(int $quizid, int $userid): void`
- `purge_for_users(int $quizid, array $userids): void`
- `purge_for_group(int $quizid, int $groupid): void`
- `purge_for_group_members(int $groupid, array $userids): void`
Hook callbacks in `db/hooks.php` to keep the cache in sync with group
membership changes:
- `\core_group\hook\after_group_membership_added`
- `\core_group\hook\after_group_membership_removed`
type: improved
@@ -1,12 +0,0 @@
issueNumber: MDL-86524
notes:
core_question:
- message: >-
During restore of a question_set_reference, mapping of IDs in the
filtercondition is now delegated to qbank plugins.
If your qbank plugin defines a filter condition that uses database
IDs, add an override of `restore_filtercondition()` to the `condition`
class, which checks the condition's data and replaces the IDs with
mapped values if required. See
`qbank_managecategories\category_condition` for an example.
type: improved
@@ -1,7 +0,0 @@
issueNumber: MDL-86607
notes:
mod_feedback:
- message: >-
The method `feedback_init_feedback_session()` has been deprecated, along
with all other direct access to `$SESSION` from the module
type: deprecated
@@ -1,7 +0,0 @@
issueNumber: MDL-86660
notes:
core_courseformat:
- message: >-
The `$cm` attribute in `activityoverviewbase` has been updated to public
visibility, allowing direct access to the course module instance
type: changed
@@ -1,8 +0,0 @@
issueNumber: MDL-86660
notes:
core_courseformat:
- message: >-
A new `available` attribute has been added to `activityname_exporter`
class. It allows the external API to return the activity's availability
status relative to the current user.
type: changed
@@ -1,9 +0,0 @@
issueNumber: MDL-86660
notes:
core_courseformat:
- message: >-
Two new public static methods have been added to the `overviewtable`
class:
- `is_cm_displayable`: Determines if a course module should be listed in the overview table.
- `is_cm_available`: Checks if a course module is accessible to the user (and should therefore be rendered as a link).
type: changed
@@ -1,19 +0,0 @@
issueNumber: MDL-86678
notes:
core_reportbuilder:
- message: >-
The base entity class now implements a default `initialise` method, that
will automatically call each of the following methods to load entity
report data:
* `get_available_columns()`
* `get_available_filters()`
* `get_available_conditions()`
This change allows for a lot of boilerplate to be removed from report
entity classes
type: improved
@@ -1,12 +0,0 @@
issueNumber: MDL-86699
notes:
core_reportbuilder:
- message: >-
There are two new entities intended for reports specific to course
module data, in order to provide a baseline in terms of module reporting
and API usage:
*
`core_course\reportbuilder\local\entities\{course_module,course_module_base}`
type: improved
@@ -1,7 +0,0 @@
issueNumber: MDL-86699
notes:
mod_forum:
- message: >-
The forum report entity `->get_context_joins()` method is deprecated,
replaced with `->get_course_modules_joins(...)`
type: deprecated
@@ -1,17 +0,0 @@
issueNumber: MDL-86798
notes:
core_question:
- message: >
In order to prevent re-use of question version numbers after a version
is deleted, the `nextversion` column was added to
`question_bank_entries`. This serves as a counter incremented each time
a version is created.
Do not query this field directly. Instead use
`core_question\versions::get_next_version()` to read the value, which
will initialise it based on the existing versions if it is not set yet.
By default, it will increment the version number automatically, unless
you pass `increment: false`. Because of this, it is advisable to call
it inside a transaction, that is only committed after the version number
is used in a `question_versions` record.
type: fixed
@@ -1,7 +0,0 @@
issueNumber: MDL-86798
notes:
core_question:
- message: >-
`get_next_version()` from questionlib.php is now deprecated. Use
`\core_question\versions::get_next_version()` instead.
type: deprecated
@@ -1,5 +0,0 @@
issueNumber: MDL-86832
notes:
core_block:
- message: Removed block_activity_modules from Moodle 5.2.
type: removed
@@ -1,10 +0,0 @@
issueNumber: MDL-86839
notes:
core:
- message: >
"grunt watch" now accepts a force flag. Run "grunt watch -f" or "grunt
watch --force" to prevent grunt from cancelling builds when errors
occur. This is especially useful during development, because js build
files will be built even if, for example, jslint errors are still
present in the files.
type: improved
@@ -1,8 +0,0 @@
issueNumber: MDL-86846
notes:
core:
- message: >-
The `core/drag_handle` template has been modified to use a native HTML
button for a more accessible experience and a consistent look with other
buttons on the page.
type: changed
@@ -1,7 +0,0 @@
issueNumber: MDL-86854
notes:
core_courseformat:
- message: >-
Add core_courseformat\cmactions::move_before that will allow to move a coursemodule to a position before another coursemodule.
Add core_courseformat\cmactions::move_end_section that will allow to move a coursemodule the end of a section.
type: improved
@@ -1,8 +0,0 @@
issueNumber: MDL-86854
notes:
core_course:
- message: >-
Deprecates moveto_module (core_course) in favor of
cmactions::move_before or cmactions::move_end_section
(core_courseformat\local\cmactions).
type: deprecated
@@ -1,11 +0,0 @@
issueNumber: MDL-86855
notes:
qbank_columnsortorder:
- message: >-
The Behat selector `column move handle` for the `qbank_columnsortorder` plugin has been removed.
When interacting with the column's move handle, please use the move handle's accessible name and type.
For example:
- `And I drag "Move Created by" "button" and I drop it in "Move T" "button"`
type: removed
@@ -1,9 +0,0 @@
issueNumber: MDL-86856
notes:
core_course:
- message: >-
The following methods have been deprecated and should no longer be used:
- `course_delete_module`
- `course_module_flag_for_async_deletion`
Please consider using the equivalent methods, delete and delete_async, in `core_courseformat\local\cmactions` instead.
type: deprecated
@@ -1,5 +0,0 @@
issueNumber: MDL-86856
notes:
core_courseformat:
- message: Add delete method to the core_courseformat\cmactions
type: improved
@@ -1,7 +0,0 @@
issueNumber: MDL-86857
notes:
core_courseformat:
- message: >-
Add set_groupmode method to the core_courseformat\cmactions (course
format actions)
type: improved
@@ -1,7 +0,0 @@
issueNumber: MDL-86857
notes:
core_course:
- message: >-
Deprecates set_coursemodule_groupmode in favor of
core_courseformat\cmactions::set_groupmode
type: deprecated
@@ -1,7 +0,0 @@
issueNumber: MDL-86858
notes:
core_courseformat:
- message: >-
Create a new core_courseformat\cmactions::duplicate aiming to replace
the course/lib.php version
type: improved

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