Compare commits

...

497 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7) 8b3d19c2f5 Moodle release 2.7.1 2014-07-12 19:10:44 +02:00
Eloy Lafuente (stronk7) b4d0a4479c weekly release 2.7+ 2014-07-10 19:15:41 +02:00
Eloy Lafuente (stronk7) 3e07b8a2f3 Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2014-07-10 19:15:37 +02:00
Ankit Agarwal 383776876b MDL-46148 qtype_calculated: low-level defence against bad formulas
This catches things like:
 * Malicious equations coming from backup files.
 * Malicious equations in old questions in the database.
2014-07-10 17:55:03 +08:00
Andrew Nicols 91c8d4da71 MDL-38990 mod_forum: Restrict ability to post to all groups in a forum
In order to post to all groups in a forum, you must have the
moodle/site:accessallgroups capability.

Thanks to Jakob Ackermann <jackermann@onlineschool.ca> for part of the fix
on this one.
2014-07-10 11:52:57 +08:00
Damyon Wiese 1721c8eb85 MDL-46148 questions: Added missing allow_commit for transaction 2014-07-10 11:36:57 +08:00
Damyon Wiese c5f351435e Merge branch 'MDL-19270_moodle27stable' of https://github.com/nadavkav/moodle into MOODLE_27_STABLE
Conflicts:
	lib/graphlib.php
2014-07-10 09:58:44 +08:00
AMOS bot 03b06dedbc Automatically generated installer lang files 2014-07-10 00:47:09 +00:00
Tim Hunt da80885cc6 MDL-46148 qtype_calculatedsimple: fix notice
... when adding a dataset with a formula error.
2014-07-09 14:11:39 +01:00
Tim Hunt 94ac7a87fa MDL-46148 qtype_calculated: fix validation when importing.
In order to do this in a sane way, I cleaned up a lot of old mess,
inclduing:

1. Previously, qtype_calcuated used ->answeres when importing, and
->answer when saving the form. This was crazy, so I fixed it, and
stripped out the code that made the alternative variable name work.

2. Similarly, it could handle ->answer being either an array, such as
you would get form the HTML editor, or a simple string, which is what
you get form the form. I simplified that too.

3. Finally, I made import use a transaction around saving each
question, so we don't get half questions in the database when an error
occurs.
2014-07-09 14:11:38 +01:00
Tim Hunt 10b02d6d41 MDL-46148 qtype_calculated: removed unused method. 2014-07-09 14:11:38 +01:00
Nadav Kavalerchik ebb6f3e80b MDL-19270 - Quiz graph - Fix reverse display of Hebrew legend text in RTL mode 2014-07-09 16:07:56 +03:00
David Mudrák 7f4db6f4d9 MDL-46223 Fix frequently used comments in the marking guide
When the frequently used comment contains a character like >, re-use it
directly instead of its HTML entitiy.
2014-07-09 16:43:40 +08:00
David Mudrák 4fc5861cba MDL-46223 Improve the display of marking guide validation message 2014-07-09 16:43:37 +08:00
Dan Poltawski 40b205197c MDL-46227 fix typo 2014-07-09 08:23:14 +01:00
Dan Poltawski cb914a71aa MDL-44605 calendar: improved returnurl validation
Now we will only redirect to a local url (though sesskey was
already preventing this redirect from being open)
2014-07-09 01:06:35 +02:00
Eloy Lafuente (stronk7) 85f376892d Merge branch 'MDL-43849_27' of git://github.com/dmonllao/moodle into MOODLE_27_STABLE 2014-07-08 20:29:04 +02:00
Dan Poltawski e0708141f8 Merge branch 'MDL-45599-27-addons' of git://github.com/mudrd8mz/moodle into MOODLE_27_STABLE 2014-07-08 15:31:53 +01:00
Dan Poltawski 76b012d611 Merge branch 'MDL-44492_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-07-08 14:18:01 +01:00
Frederic Massart 53ca351f7a MDL-45471 javascript: Escape content of exception dialogs 2014-07-08 14:13:33 +01:00
Tim Hunt ea9f3057da MDL-44492 quiz: fix hilighting of graded attempt
In various places, when showing several attempts, we try to hilight the
most significant one (the one that gave the final grade if the quiz is
set to first/last/best attempt). That was not working because the table
zebra stripes were a more specific rule.

Also, the colour was inconsistent, not nice, and not very bootstrapy, so
I changed it.
2014-07-08 13:33:41 +01:00
Tim Hunt f1406d3b39 MDL-44492 quiz reports: revert some style overrides.
But add one more. This makes Clean theme look a lot better.
2014-07-08 13:33:38 +01:00
Tim Hunt 91251e4889 MDL-44492 Rough unit test for the report SQL.
We really ought to test more cases, but this hits one of the most tricky cases.
2014-07-08 13:33:36 +01:00
Tim Hunt 8994593332 MDL-44492 quiz reports: make show only graded attempt work.
It needs to only affect finished attempts, and the wording needs to be
modified to make it clear that is what it does.
2014-07-08 13:33:33 +01:00
Dan Poltawski 67b3704318 Merge branch 'MDL-45381_m27' of git://github.com/markn86/moodle into MOODLE_27_STABLE 2014-07-08 11:29:03 +01:00
Dan Poltawski 37e7d91b8c Merge branch 'MDL-45596-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-07-08 10:50:55 +01:00
Marina Glancy 3fe64cbd7d MDL-43948 forms: setting types to filemanager and editor elements 2014-07-08 10:47:35 +01:00
Dan Poltawski 22051a4e34 Merge branch 'MDL-46231-27-en_fix' of git://github.com/mudrd8mz/moodle into MOODLE_27_STABLE 2014-07-08 08:32:35 +01:00
Helen Foster e7cd680765 MDL-45599 Fix tiny grammatical errors in the plugin installer 2014-07-08 09:02:06 +02:00
Marina Glancy 84d2c6f761 Merge branch 'MDL-46229_27' of https://github.com/totara/openbadges into MOODLE_27_STABLE 2014-07-08 13:51:40 +08:00
Skylar Kelty f97581eda7 MDL-46227 Fix XSS in scheduled tasks 2014-07-08 13:38:01 +08:00
David Mudrák 2c0b608cda MDL-46223 Improve the marking guide output 2014-07-08 13:18:59 +08:00
David Mudrák eb1381de1d MDL-46223 Improve the rubric output 2014-07-08 13:18:58 +08:00
Sam Hemelryk 4eacb77012 Merge branch 'MDL-46016_m27' of https://github.com/markn86/moodle into MOODLE_27_STABLE 2014-07-08 14:28:02 +12:00
Sam Hemelryk 93835758f3 MDL-19270 core_text: added unit tests for strrev 2014-07-08 14:15:02 +12:00
Sam Hemelryk a238e7ed72 Merge branch 'MDL-19270_moodle27stable' of https://github.com/nadavkav/moodle into MOODLE_27_STABLE 2014-07-08 13:53:52 +12:00
Sam Hemelryk 98ac33bcb0 Merge branch 'MDL-46200-27' of git://github.com/danpoltawski/moodle into MOODLE_27_STABLE 2014-07-08 13:38:08 +12:00
Sam Hemelryk 0caa8c60d2 Merge branch 'mdl45982-moodle27' of https://github.com/tlock/moodle into MOODLE_27_STABLE 2014-07-08 13:26:58 +12:00
Sam Hemelryk 2dbdaedc3e Merge branch 'm27_MDL-46144' of https://github.com/totara/moodle into MOODLE_27_STABLE 2014-07-08 13:10:36 +12:00
Eloy Lafuente (stronk7) 30a264540b Merge branch '46208-27' of git://github.com/samhemelryk/moodle into MOODLE_27_STABLE 2014-07-08 02:13:44 +02:00
Sam Hemelryk 6d05bee940 Merge branch 'MDL-46212_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-07-08 10:45:01 +12:00
Sam Hemelryk 2535dfaf64 Merge branch 'MDL-46240-27' of git://github.com/danpoltawski/moodle into MOODLE_27_STABLE 2014-07-08 10:34:30 +12:00
Eloy Lafuente (stronk7) 35186e3725 Merge branch 'wip_MDL-45945_m27_mssqlcol' of https://github.com/skodak/moodle into MOODLE_27_STABLE 2014-07-08 00:32:09 +02:00
Sam Hemelryk bfe4417cb7 MDL-45678 cache: renamed new cache and better comments 2014-07-08 09:52:53 +12:00
Sam Hemelryk 6b6affec1f Merge branch 'MDL-45678-006-27' of https://github.com/dbezborodovrp/moodle into MOODLE_27_STABLE 2014-07-08 09:42:51 +12:00
Sam Hemelryk 9e13649c89 Merge branch 'wip_MDL-46126_m27_passnulls' of https://github.com/skodak/moodle into MOODLE_27_STABLE 2014-07-08 09:37:20 +12:00
Sam Hemelryk f549deed15 Merge branch 'MDL-43347-27' of https://github.com/mackensen/moodle into MOODLE_27_STABLE 2014-07-08 09:28:31 +12:00
Adrian Greeve ab59b7db71 MDL-46201 events: Sanitization of username before returning the description. 2014-07-07 18:19:11 +01:00
Yuliya Bozhko 200a2b7fad MDL-46042 badges: Clean up external badge data
Signed-off-by: Yuliya Bozhko <yuliya.bozhko@totaralms.com>
2014-07-07 16:37:44 +01:00
Dan Poltawski 9945bcec41 Merge branch 'MDL-42393-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-07-07 16:27:32 +01:00
Dan Poltawski b4ac5653ed Merge branch 'MDL-41389_m27' of https://github.com/markn86/moodle into MOODLE_27_STABLE 2014-07-07 16:10:26 +01:00
Osanda Malith Jayathissa 0207466e77 MDL-45683 user: Escaping Skype ID used in profile 2014-07-07 16:05:10 +01:00
Marina Glancy 2ca9e09dab MDL-45760 make sure to check permission before setting header 2014-07-07 15:06:40 +01:00
Tim Hunt 6eaf5ec8e3 MDL-46148 qtype_calculated: fix formula validation. 2014-07-07 14:34:02 +01:00
Frederic Massart 1d110af2d6 MDL-45417 mod_imscp: Prevent entity injections from package content 2014-07-07 13:03:05 +01:00
Frederic Massart 2d121036cc MDL-45463 mod_lti: Prevent XML entity injections from provider 2014-07-07 13:00:39 +01:00
Marina Glancy 61961447c2 MDL-45616 repositories: use json encoding instead of serialization 2014-07-07 15:17:42 +08:00
Marina Glancy 867f40990b MDL-45616 repositories: more clearly distinguish when we use source and when reference
Function repository::get_moodle_file() should always be called on packed reference and not on the source received from user.
Also added phpdocs to some other methods that were confusing source and reference
2014-07-07 15:17:42 +08:00
Dan Poltawski 78ba7d9e6b MDL-43848 messages: do not display message content in popups
The user is not in control of when these popups show up and it
may not be appropiate to have part of this content display whilst
in the presence of other users.
2014-07-07 13:46:35 +08:00
Nadav Kavalerchik 63010978b4 MDL-19270 - Quiz graph - Fix reverse display of Hebrew legend text in RTL mode 2014-07-06 19:00:23 +03:00
Helen Foster c5e9bc48f0 MDL-46231 Merge English strings from the en_fix language pack 2014-07-04 22:37:30 +02:00
Dan Poltawski cd90445d4a MDL-46200 fix missing space in failed login message 2014-07-04 14:55:43 +01:00
Dan Poltawski 0052796dbb MDL-46240 atto_collapse: fix icon url 2014-07-04 14:35:16 +01:00
David Mudrák b522356839 MDL-45599 Stop using the 'add-on' term
We now call them all as just 'plugins' for consistency. There where we need to
explicitly distinguish the source of the plugin, we say they are 'additional
plugins' on contrary to 'standards plugins' coming with the core.
2014-07-04 11:34:34 +02:00
David Mudrák 1d45b926f3 MDL-45599 Remove string editingnoncorelangfile from core_admin
This string mentions 'add-on' and has been greylisted in AMOS since 2.0. The
usage of it was removed in 00b41d.
2014-07-04 10:36:53 +02:00
Damien Bezborodov 0ba5f02b15 MDL-45678 assignsubmission_comments: Improve performance for permissions checking 2014-07-04 14:25:06 +09:30
Petr Skoda a31fdfb145 MDL-46126 upgrade: fix bogus nulls in user.password before changing precission
Note: there is no need to deal with Oracle empty strings here
because only MySQL running in non-strict mode is affected.
2014-07-04 16:29:40 +12:00
Frederic Massart d019ffd21f MDL-45596 roles: Escape filter value before using it in form field 2014-07-04 11:49:42 +08:00
Mark Nelson a93f8344ae MDL-41389 auth_db: added unit tests for events 2014-07-03 20:16:56 -07:00
Petr Skoda 2d7617aa18 MDL-45945 mssql: force default database collation in all tables including temp table 2014-07-04 15:05:24 +12:00
AMOS bot 84acc68175 Automatically generated installer lang files 2014-07-04 00:44:19 +00:00
Mark Nelson 38d8b7b703 MDL-46016 auth_shibboleth: updated misleading comment
Also generated a random string for the password field in case it is ever used.
2014-07-03 16:15:57 -07:00
Mark Nelson 69ddeb42e2 MDL-41389 auth_db: added user_updated/created event triggers 2014-07-03 14:28:44 -07:00
Sam Hemelryk 2bd9cd1077 MDL-46208 cachestore_mongo: fixed invalid collection name use 2014-07-04 08:11:24 +12:00
Tim Hunt 35588aa876 MDL-46212 question editing: extra answer fields notice.
It turns out that PHP does not interpret "$field[$key]" the way we were
expecting.
2014-07-03 13:40:38 +01:00
Dan Poltawski fc415ee908 weekly release 2.7+ 2014-07-03 10:53:27 +01:00
Dan Poltawski 10b4bda916 Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2014-07-03 10:53:24 +01:00
Marina Glancy 3708e1bb7c MDL-46163 question/quiz: fix elements ids and their labels 2014-07-03 10:13:23 +01:00
David Monllao e7e79055e1 MDL-43849 enrol_meta: Renaming methods according to what they test 2014-07-03 14:51:00 +08:00
David Monllao 3d4cf404df MDL-43849 mod_forum: Adding tests for observers 2014-07-03 14:50:52 +08:00
Frederic Massart 31c0efeac7 MDL-42393 calendar: Preventing open/close loop in events overlay 2014-07-03 10:17:41 +08:00
Yuliya Bozhko 3571cd46d2 MDL-46229 badges: Fix missing additional names fields
Signed-off-by: Yuliya Bozhko <yuliya.bozhko@totaralms.com>
2014-07-03 09:33:27 +12:00
Tim Hunt fa6db7b8c1 MDL-46163 quiz/questions: fix missing hidden fields.
I have done this by eliminating the duplication between the base class
and the subclass.

This was a regression introdcued by MDL-40313.
2014-07-02 15:04:56 +01:00
AMOS bot 947a90339a Automatically generated installer lang files 2014-07-02 00:44:40 +00:00
Eloy Lafuente (stronk7) dc30afaafc Merge branch 'wip-mdl-45889-m27' of https://github.com/rajeshtaneja/moodle into MOODLE_27_STABLE 2014-07-02 00:36:26 +02:00
Eloy Lafuente (stronk7) 03a5278a38 Merge branch '45209-27' of git://github.com/samhemelryk/moodle into MOODLE_27_STABLE 2014-07-01 23:49:46 +02:00
Sam Hemelryk d683942c6a Merge branch 'wip-MDL-46147-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2014-07-02 09:31:25 +12:00
Mary Evans 24c0432bbc MDL-45507 theme_bootstrapbase: Fix regression for theme based custom menu
in renderers/core_renderer.php.
2014-07-02 09:22:43 +12:00
Eloy Lafuente (stronk7) c16de45a14 MDL-45961 user profile: track user on reset
It seems that redirect (after reset button) was also
missing the userid so the user track was lost.
2014-07-01 19:22:14 +02:00
Eloy Lafuente (stronk7) 9d19781014 Merge branch 'MDL-45961_MOODLE_27_STABLE' of https://github.com/NeillM/moodle into MOODLE_27_STABLE 2014-07-01 19:22:05 +02:00
Dan Poltawski ab6ae906cd Merge branch 'MDL-46063_27' of git://github.com/schach/moodle into MOODLE_27_STABLE 2014-07-01 17:29:16 +01:00
Dan Poltawski f45b59d427 Merge branch 'MDL-46036_survey_27' of https://github.com/andyjdavis/moodle into MOODLE_27_STABLE 2014-07-01 16:34:29 +01:00
Charles Fulton 3add7d878f MDL-43347 grades: convert keep highest to text field 2014-07-01 07:34:23 -07:00
Charles Fulton c9bd902bd3 MDL-43347 grades: consistent interface for drop lowest setting 2014-07-01 07:34:11 -07:00
Dan Poltawski 366124d222 Merge branch 'MDL-46107_27' of https://github.com/totara/openbadges into MOODLE_27_STABLE 2014-07-01 14:20:53 +01:00
Dan Poltawski 89203e11a7 Merge branch 'MDL-4013-stable27' of https://github.com/MorrisR2/moodle into MOODLE_27_STABLE 2014-07-01 14:16:22 +01:00
Dan Poltawski dd83fbfbbc Merge branch 'wip_MDL-46099_m27_userglobal' of https://github.com/skodak/moodle into MOODLE_27_STABLE 2014-07-01 10:39:15 +01:00
Marina Glancy 1fb374121a MDL-46147 modinfo: performance improvement for course page (check filterall) 2014-07-01 15:30:28 +08:00
Damyon Wiese f3163a2002 MDL-46147 modinfo: performance improvement for course page
This is a big win in a specific situation, ie filters enabled for content+headings,
and no activity descriptions visible on the course page.
2014-07-01 15:30:22 +08:00
Mark Nelson 65764352dd MDL-45381 mod_forum: updated unit tests for subscription created/deleted events 2014-06-30 23:35:37 -07:00
Mark Nelson 2c7b800f2f MDL-45381 mod_forum: changed event URL for subscription created/deleted events 2014-06-30 23:35:36 -07:00
Brian Barnes ed7d676329 MDL-46144 core_calendar:Fixed label linking in calendar 2014-07-01 13:44:56 +12:00
Sam Hemelryk b23bc0a148 Merge branch 'MDL-40805-27' of git://github.com/lameze/moodle into MOODLE_27_STABLE 2014-07-01 09:06:20 +12:00
Petr Skoda df9a669791 MDL-46099 session: fix use of references for session globals
This reverses the references used for global $USER and $SESSION,
the reason is that PHP does not allow references to references.
$USER is a reference to $GLOBALS['USER'] which means we cannot
put any references to it. Solution is to store the current user and session
objects in $GLOBALS['USER'] and $GLOBALS['SESSIOn'] are reference
them in $_SESSION.

This patch makes the session code behave the same way in CLI,
phpunit and normal web requests - this allows use to finally
unit test most aspects of the session code in Moodle.
2014-07-01 08:38:10 +12:00
Sam Hemelryk b1ab535efa Merge branch 'MDL-46118_27' of git://github.com/dmonllao/moodle into MOODLE_27_STABLE 2014-07-01 08:33:16 +12:00
Dan Poltawski 1e9dce0df4 Merge branch 'wip-mdl-45641-m27' of https://github.com/rajeshtaneja/moodle into MOODLE_27_STABLE 2014-06-30 15:26:34 +01:00
Dan Poltawski 8dd0756226 Merge branch 'MDL-42467_database_27' of https://github.com/andyjdavis/moodle into MOODLE_27_STABLE 2014-06-30 15:09:53 +01:00
Dan Poltawski 8458e3d2c2 Merge branch 'MDL-45833_27' of git://github.com/dmonllao/moodle into MOODLE_27_STABLE 2014-06-30 13:27:16 +01:00
Dan Poltawski 951a64f6ef Merge branch 'MDL-46044-27' of git://github.com/damyon/moodle into MOODLE_27_STABLE 2014-06-30 11:45:29 +01:00
Heiko Schach b336cf98b4 MDL-46063 feedback: Fix user pictures 2014-06-30 13:27:39 +03:00
Dan Poltawski b6ac868d71 Merge branch 'MDL-40228-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-06-30 08:55:39 +01:00
AMOS bot 57ce05c631 Automatically generated installer lang files 2014-06-29 00:42:51 +00:00
Ray Morris f0538cee92 MDL-4013 Question bank: Category selector renders as nested form (invalid html) 2014-06-27 10:00:11 -05:00
NeillM f4f4965a1c MDL-45961 Customise this page button on user profile page only works correctly for users own profile 2014-06-27 09:05:49 +01:00
Rajesh Taneja 93a593daab MDL-45641 event: Ldap user_signup unit test added 2014-06-27 15:43:49 +08:00
Rajesh Taneja c8c1a2cb10 MDL-45641 event: Manually trigger event where needed.
Some places, user_created_user and user_updated_user
events should be triggred after profile data is saved.
2014-06-27 15:43:49 +08:00
Rajesh Taneja 793ab11d95 MDL-45641 event: Removed multiple user_updated event trigger
user_updated event was being triggred while
setting password, which is not correct. It now
trigger user_password_updated event. Few more
modifications done:
1. Correct event is being triggred.
2. Event is only triggred when password is chnaged.
3. Password is updated via single api.
4. Updated unit test
2014-06-27 15:43:49 +08:00
Rajesh Taneja 47221d5fdd MDL-45641 event: Option to trigger user event manually
On some pages full user data is not stored before user_created/
user_updated event is triggred. So giving option to trigger that
manually, so it can be triggred after all data is saved
2014-06-27 15:43:49 +08:00
Damyon Wiese 1affa3ea22 MDL-46044 Assign: Add conditions to the inner query for performance 2014-06-27 15:01:17 +08:00
Damyon Wiese 70971d43eb MDL-46044 Assign: Modify myhome query to only use the maxattempt from the submission
Using mismatches from the submissions/grades tables does not make much sense, we
should always only consider only the maxattempt from the submissions table.
2014-06-27 14:23:17 +08:00
Damyon Wiese 99e0bb23bf MDL-46044 Assign: Move common setup to setUp method (share it for all of lib_test.php) 2014-06-27 14:18:10 +08:00
Damyon Wiese d95453d903 MDL-46044 Assign: Fix print_overview function when there are multiple attempts 2014-06-27 14:17:53 +08:00
Damyon Wiese 53fb01aef0 MDL-46044 Assign: Update unit test to test multiple attempts on overview page 2014-06-27 14:17:44 +08:00
David Monllao cfd5ba4101 MDL-46118 report_log: No results limit when downloading 2014-06-27 11:35:06 +08:00
David Monllao 5eb386fd09 MDL-45833 event: Removing courseid as the context is higher than course context 2014-06-27 11:25:07 +08:00
Yuliya Bozhko 594848bb15 MDL-46107 badges: Fix badges navigation and remove empty breadcrumbs on pages using Clean
Signed-off-by: Yuliya Bozhko <yuliya.bozhko@totaralms.com>
2014-06-27 12:48:01 +12:00
Sam Hemelryk 64fea720ce MDL-45209 course: fixed navbar when creating,editing courses 2014-06-27 09:39:45 +12:00
Eloy Lafuente (stronk7) 83d08fcc21 weekly release 2.7+ 2014-06-26 10:35:58 +02:00
Eloy Lafuente (stronk7) 01e7204646 Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2014-06-26 10:35:54 +02:00
Eloy Lafuente (stronk7) 3152864fd5 Revert " MDL-45044 filter_tex: properly escape excutable pathnames for Windows"
This reverts commit 7eac026a02.
2014-06-26 10:05:49 +02:00
Rajesh Taneja 2997bd6dce MDL-45889 behat: Allow admin config to set by shortname 2014-06-26 13:18:32 +08:00
Andrew Davis 083d5a6f0c MDL-46036 mod_survey: added logic to prevent user trying to download when there are no results 2014-06-26 11:18:29 +08:00
Rajesh Taneja c1ee80fef5 MDL-46061 behat: Fixed blur event problem for atto_image
atto_image look for blur event after changing width/height
Added a new step to get focus off the element, so this can
work.
2014-06-26 10:29:35 +08:00
Andrew Davis 0a9815d14e MDL-42467 mod_data: added code to delete cached RSS feeds when database or glossary entries are deleted 2014-06-26 09:30:18 +08:00
Damyon Wiese 3ac5a3544c MDL-45983 Atto equation editor: Exclude phantomjs from this behat test because it's buggy 2014-06-25 15:05:01 +08:00
AMOS bot 6f5ca6613f Automatically generated installer lang files 2014-06-25 00:45:27 +00:00
AMOS bot a16755314a Automatically generated installer lang files 2014-06-25 00:45:27 +00:00
Eloy Lafuente (stronk7) a4919abf4f Merge branch 'MDL-46079-m27' of https://github.com/sammarshallou/moodle into MOODLE_27_STABLE 2014-06-25 01:33:37 +02:00
Eloy Lafuente (stronk7) 022a58af8d Merge branch 'MDL-45445_m27' of https://github.com/markn86/moodle into MOODLE_27_STABLE 2014-06-25 00:47:43 +02:00
Eloy Lafuente (stronk7) 6480ec0c48 Merge branch 'MDL-41258-27' of git://github.com/andrewnicols/moodle into MOODLE_27_STABLE 2014-06-24 20:10:48 +02:00
Damyon Wiese 1e4e4a05d7 Merge branch 'MDL-45652_m27' of https://github.com/markn86/moodle into MOODLE_27_STABLE 2014-06-24 16:59:42 +08:00
Damyon Wiese 9dc9608795 Merge branch 'MDL-10115-27' of git://github.com/xow/moodle into MOODLE_27_STABLE 2014-06-24 16:03:53 +08:00
John Okely e08d290469 MDL-10115 User profile: Use title to aid in the ellipsis link being understood by screen readers 2014-06-24 15:38:58 +08:00
Marina Glancy 80bb90c3ca Merge branch 'MDL-45933-27' of git://github.com/damyon/moodle into MOODLE_27_STABLE 2014-06-24 13:52:42 +08:00
Marina Glancy a3ddcab336 Merge branch 'MDL-45983-27' of git://github.com/damyon/moodle into MOODLE_27_STABLE 2014-06-24 13:52:14 +08:00
Marina Glancy a839769c23 Merge branch 'MDL-46061-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-06-24 13:32:25 +08:00
Marina Glancy 1eb503b379 Merge branch 'MDL-45044-m27-master' of git://github.com/dthies/moodle into MOODLE_27_STABLE 2014-06-24 13:29:06 +08:00
Damyon Wiese cc5f8bd53f Merge branch 'wip-MDL-46038-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2014-06-24 13:10:52 +08:00
Damyon Wiese bb512f7c1f Merge branch 'MDL-46035_survey_27' of https://github.com/andyjdavis/moodle into MOODLE_27_STABLE 2014-06-24 13:08:17 +08:00
Damyon Wiese 5b5a73019d Merge branch 'MDL-46046-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-06-24 11:48:02 +08:00
Damyon Wiese ce0b9bb7ca Merge branch 'MDL-46056-27' of git://github.com/mudrd8mz/moodle into MOODLE_27_STABLE 2014-06-24 11:35:21 +08:00
Damyon Wiese 38063e7d1b Merge branch 'MDL-44512-27' of git://github.com/jethac/moodle into MOODLE_27_STABLE 2014-06-24 10:58:17 +08:00
Damyon Wiese ee5b9e137d Merge branch 'MDL-44773-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-06-24 10:19:16 +08:00
Eloy Lafuente (stronk7) 55103810f0 Merge branch 'MDL-45721_m27' of https://github.com/markn86/moodle into MOODLE_27_STABLE 2014-06-24 01:00:10 +02:00
Eloy Lafuente (stronk7) e5b111f26b Merge branch 'MDL-39883-27' of git://github.com/ankitagarwal/moodle into MOODLE_27_STABLE 2014-06-24 00:48:56 +02:00
Eloy Lafuente (stronk7) 7c2e2133cc Merge branch 'MDL-45764_generalTool_27' of https://github.com/moodlerooms/moodle into MOODLE_27_STABLE 2014-06-24 00:03:34 +02:00
Damyon Wiese 3352ffcfa2 Merge branch 'MDL-45580-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-06-23 15:20:14 +08:00
Simey Lameze 8e74bfa8e8 MDL-40805 auth_cas : Trigger user_loggedout event before CAS logout. 2014-06-23 15:19:07 +08:00
Frederic Massart 9f630b6cc4 MDL-45580 assignfeedback_editpdf: Save readonly version in backup 2014-06-23 14:56:08 +08:00
Frederic Massart c2779c9f29 MDL-45580 assignfeedback_editpdf: Delete draft content on new submission 2014-06-23 14:56:08 +08:00
Frederic Massart 7fecbba80b MDL-45580 assignfeedback_editpdf: Store a readonly version of the PDF 2014-06-23 14:56:08 +08:00
Damyon Wiese 80b81e5094 Merge branch '37145-27' of git://github.com/samhemelryk/moodle into MOODLE_27_STABLE 2014-06-23 14:39:56 +08:00
Damyon Wiese 6e977fcdd6 Merge branch 'MDL-38693-27' of git://github.com/jethac/moodle into MOODLE_27_STABLE 2014-06-23 14:15:36 +08:00
Damyon Wiese 9c8c5f2d01 MDL-41746 External api: Allow multiple calls to validate_context at different levels
(Only from webservices)
2014-06-23 13:39:21 +08:00
Damyon Wiese 9134f3f0df Merge branch 'MDL-35453_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-06-23 12:30:41 +08:00
Damyon Wiese b093752289 Merge branch 'MDL-46086_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-06-23 12:26:31 +08:00
Mark Nielsen bd87c3e225 MDL-46013 theme: Uninstall theme unconditionally unsets configs 2014-06-23 11:34:59 +08:00
Marina Glancy 7bea1ea240 Merge branch 'MDL-44124-27' of git://github.com/ankitagarwal/moodle into MOODLE_27_STABLE 2014-06-23 11:34:10 +08:00
Sam Hemelryk afd6e7d542 MDL-37145 caching: noted recommendation for dedicated memcache servers
Several reports have been made about the unexpected purging of entire
memcached servers when MUC is configured to use Memcache and caches
get purged.
This is expected and occurs because the memcache extenions don't
provide isolated containers. Moodle data is stored along side any other
data in the cache and when caches get purged all data gets removed
whether it belongs to Moodle or not.

The docs cover this point and here I've added notes about this to both
config-dist.php and cache/README.md
2014-06-23 11:01:51 +12:00
AMOS bot e29eef4bde Automatically generated installer lang files 2014-06-21 00:43:37 +00:00
Tim Hunt 63dd180030 MDL-46086 quiz: fix unit test on Oracle 2014-06-20 22:29:28 +01:00
Tim Hunt 8eacbd5a32 MDL-35453 quiz reports: don't order by id.
We were using ORDER BY id even though there was a perfectly good
attempt column to order the attempts by one user at one quiz.

Also, Oracle was complaining:
Debug info: ORA-01799: a column may not be outer-joined to a subquery
2014-06-20 16:55:35 +01:00
sam marshall 680ff52414 MDL-46079 Restore: Can run out of memory in get_records call 2014-06-20 14:14:53 +01:00
Frederic Massart 884e310a3b MDL-40228 backup: Settings were ignored during automated backups 2014-06-20 15:38:29 +08:00
Daniel Thies 7eac026a02 MDL-45044 filter_tex: properly escape excutable pathnames for Windows 2014-06-19 21:34:10 -05:00
Andrew Davis deaddfb6b8 MDL-46035 mod_survey: a string change to make an error message always correct 2014-06-20 09:17:47 +08:00
Frederic Massart 85b40b18d5 MDL-46061 atto_image: Improved tests to cover sizing feature 2014-06-19 16:00:47 +08:00
Frederic Massart 3b6987cea3 MDL-46061 atto_image: Prevent error when image does not have a size 2014-06-19 16:00:47 +08:00
Jetha Chan 14ff3d59b3 MDL-44512 themes: fix for custom menu submenu arrows on RTL languages 2014-06-19 15:16:52 +08:00
Damyon Wiese dd02a787d8 weekly release 2.7+ 2014-06-19 14:13:25 +08:00
Damyon Wiese cefe7c7f59 Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2014-06-19 14:13:20 +08:00
Frederic Massart d9fc73dc7a MDL-44773 atto_accessibilitychecker: Improved image test coverage 2014-06-19 13:38:36 +08:00
Frederic Massart 3bc1e345ca MDL-44773 atto_accessibilitychecker: Set focus on clicked warnings 2014-06-19 13:38:35 +08:00
AMOS bot 5d3fe21ab2 Automatically generated installer lang files 2014-06-19 00:42:51 +00:00
David Mudrák 17db3e8af1 MDL-46056 Remove invalid string definition from the workshop module
The correct version of the string is defined above.
2014-06-19 00:33:24 +02:00
Frederic Massart a0da864ac2 MDL-46046 atto_accessibilityhelper: Remove dead code from the plugin 2014-06-18 16:52:48 +08:00
Ankit Agarwal 0978aab839 MDL-39883 events: Trigger a module created event when duplicating a module 2014-06-18 16:02:23 +08:00
Ankit Agarwal 7d947ad66c MDL-39883 events: Create a new api create_from_cm for module create event 2014-06-18 15:46:26 +08:00
Damyon Wiese 5e63c8e57e MDL-45933 Assign: Prevent fatal error when there are no users in the grading table 2014-06-18 15:17:36 +08:00
Ankit Agarwal 34bcea8159 MDL-44124 libraries: Allow rrules with only one part during rrule validation checks 2014-06-18 14:14:49 +08:00
Marina Glancy 2a56e3c8b9 MDL-46038 repositories: added forgotten global 2014-06-18 13:39:43 +08:00
Mark Nelson 1fb1c6d456 MDL-45652 core_backup: display warning on restore destination form when necessary data is missing 2014-06-17 21:56:21 -07:00
Mark Nelson 469e7dd82d MDL-45721 core_backup: only trigger the course_restored event when restoring a course 2014-06-17 19:38:30 -07:00
AMOS bot 1461f9d664 Automatically generated installer lang files 2014-06-18 00:42:28 +00:00
Eloy Lafuente (stronk7) 8791525d88 Merge branch 'MDL-45978_27' of git://github.com/grabs/moodle into MOODLE_27_STABLE 2014-06-17 11:54:50 +02:00
Andrew Nicols a0f39f2b57 MDL-41258 Forum: Add additional unit tests for forum digest settings 2014-06-17 16:07:59 +08:00
Damyon Wiese 6fc2264a8a MDL-45983 Atto equation editor: Various bugs when editing an existing equation
(And a behat test for it).
2014-06-17 15:21:20 +08:00
Andreas Grabs 8893b111c2 MDL-45978 logging - added missing parameter id 2014-06-17 07:05:58 +02:00
Damyon Wiese 3362673173 MDL-45582 Editpdf: Prevent debugging when there is no pdf 2014-06-17 10:19:55 +08:00
Damyon Wiese 49703ecf1d Merge branch 'm27_MDL-45582' of git://github.com/greg-or/moodle-mod_assign into MOODLE_27_STABLE
Conflicts:
	mod/assign/feedback/editpdf/locallib.php
2014-06-17 10:17:55 +08:00
Eloy Lafuente (stronk7) d56f3531b4 Merge branch 'MDL-45970_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-06-17 01:15:47 +02:00
Eloy Lafuente (stronk7) 902a36137a Merge branch 'MDL-45611-27' of git://github.com/phalacee/moodle into MOODLE_27_STABLE
Conflicts:
	theme/bootstrapbase/style/moodle.css
2014-06-17 01:12:02 +02:00
Eloy Lafuente (stronk7) 19e4d5ada8 Merge branch 'wip-mdl-45719-m27' of https://github.com/deraadt/moodle into MOODLE_27_STABLE 2014-06-17 01:03:58 +02:00
Eloy Lafuente (stronk7) d81917322f Merge branch 'MDL-45870-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-06-17 00:51:33 +02:00
Marina Glancy b657f6db05 Merge branch 'MDL-45940-27' of git://github.com/damyon/moodle into MOODLE_27_STABLE 2014-06-16 17:28:30 +08:00
Marina Glancy abd980d36d Merge branch 'MDL-45901_Quiz_MOODLE-27-STABLE' of git://github.com/nadavkav/moodle into MOODLE_27_STABLE 2014-06-16 17:27:40 +08:00
Rajneel Totaram 7b27045680 MDL-45967 admin lang: Fix typo 2014-06-16 17:26:50 +08:00
Marina Glancy e4a56bd9dd Merge branch 'MDL-43274-27' of git://github.com/xow/moodle into MOODLE_27_STABLE 2014-06-16 17:24:10 +08:00
Jonathon Fowler 5807b224d9 MDL-42531 assign: refactor batch operations to use forms properly
Avoids a lot of ugly optional_param() use. Also fixes the
non-functional cancel buttons.
2014-06-16 16:43:54 +08:00
Gregory Faller 8b1596c257 MDL-45582: Apply grades and feedback to entire group does not work with Annotate PDF feature 2014-06-16 18:06:09 +09:30
John Okely 2649eefe1c MDL-43274 Course: Remove message about course logs from upgrade.txt 2014-06-16 16:23:51 +08:00
Damyon Wiese b3bb3a4422 MDL-45940 Assign: Improved access check
Call can_edit() instead of repeating a (slightly wrong) access check.
2014-06-16 16:20:34 +08:00
Damyon Wiese 6e10f195c5 Merge branch 'm27_MDL-45582' of git://github.com/greg-or/moodle-mod_assign into MOODLE_27_STABLE 2014-06-16 14:29:51 +08:00
Daniel Neis ab7c329acf MDL-35648 adding missing distinct selector in sql on participation report 2014-06-16 14:22:46 +08:00
Marina Glancy 95d39aabc7 Merge branch 'MDL-45935-27' of git://github.com/andrewnicols/moodle into MOODLE_27_STABLE 2014-06-16 14:22:42 +08:00
John Okely 6e515be94f MDL-10115 User profile: Use moodle_url and html_writer::link for course links on user profiles 2014-06-16 14:08:44 +08:00
Damyon Wiese b3b4f9a4a4 Merge branch 'MDL-31998_27' of git://github.com/grabs/moodle into MOODLE_27_STABLE 2014-06-16 12:07:40 +08:00
Gregory Faller c71d8267ed MDL-45582: Apply grades and feedback to entire group does not work with Annotate PDF feature 2014-06-16 12:44:23 +09:30
Damyon Wiese 1742e76777 Merge branch 'wip-mdl-46001-m27' of https://github.com/rajeshtaneja/moodle into MOODLE_27_STABLE 2014-06-16 11:13:45 +08:00
Rajesh Taneja 2797fcc75e MDL-46001 atto_clear: modfied behat test to work on xvfb 2014-06-16 11:10:29 +08:00
Damyon Wiese 2538e2dab1 Merge branch 'MDL-45803_m27' of https://github.com/markn86/moodle into MOODLE_27_STABLE 2014-06-16 11:01:04 +08:00
John Okely 6bf5eeed56 MDL-43274 Course: Remove ability to delete logs on a course during reset 2014-06-16 09:54:20 +08:00
AMOS bot c14d87daaa Automatically generated installer lang files 2014-06-15 00:42:44 +00:00
Nadav Kavalerchik cb201e866b MDL-45901 - Quiz - Random question category question are not visible, in RTL mode 2014-06-14 00:42:30 +03:00
Mark Nelson cc6a8bc792 MDL-45445 events: added '(optional)' to event params where applicable 2014-06-12 20:47:21 -07:00
Mark Nelson fa71841e9d MDL-45445 events: documented the additional validation 2014-06-12 20:47:21 -07:00
Mark Nelson be7809f5fd MDL-45445 events: added missing 'other' validation 2014-06-12 20:47:20 -07:00
Mark Nelson 655cdde2dc MDL-45445 events: added missing 'relateduserid' validation 2014-06-12 20:47:20 -07:00
Mark Nelson 7f75f1507e MDL-45445 events: trivial changes 2014-06-12 20:47:20 -07:00
Jason Fowler 3fbf089303 MDL-45611 Questions: Fixing the layout of the 'points box' 2014-06-13 10:24:20 +08:00
Tim Lock 8a453265d2 MDL-45982: Implement displaying of non error messages from a provider. 2014-06-13 10:13:57 +09:30
AMOS bot 807d45073a Merge branch 'MOODLE_27_STABLE' into install_27_STABLE 2014-06-13 00:41:59 +00:00
Andreas Grabs 253bbbb668 MDL-31998 mod_feedback - Feedback depend questions bug 2014-06-13 01:44:59 +02:00
Tim Hunt 8fbc1919df MDL-45970 quiz editing: fix display of random questions.
The pass by reference meant the function was clobbering the variable in
the calling function. Once that was change, it was not strictly
necessary to rename the variable in the function, but I did anyway for
clarity.

Thanks to Rajesh Taneja for finding the problem, and identifying which
bit of code was broken. I really just made the patch.
2014-06-12 19:43:42 +01:00
Eloy Lafuente (stronk7) c41ace2f7a weekly release 2.7+ 2014-06-12 18:59:06 +02:00
Eloy Lafuente (stronk7) 3be351cabc Merge branch 'MDL-44871-27' of git://github.com/damyon/moodle into MOODLE_27_STABLE 2014-06-12 11:38:37 +02:00
Damyon Wiese 53bd21e7d8 MDL-42835 Scorm: Fix for JS error because no nodes are selected in the toc. 2014-06-12 10:00:56 +02:00
John Okely 217530dfca MDL-10115 User profile: Allow full list of courses to be viewed on a user's profile 2014-06-12 15:03:27 +08:00
Rajesh Taneja 30271d87aa MDL-45808 enrol_self: Fixed behat to observe the group key policy 2014-06-12 14:20:37 +08:00
Damyon Wiese f271df32ec MDL-44871 Atto: Add missing tags to behat tests @editor and @editor_atto 2014-06-12 11:15:17 +08:00
Rajesh Taneja 77ae35faba MDL-44871 behat: Hack to make equation editor visible 2014-06-12 11:11:17 +08:00
Damyon Wiese 32d746479b MDL-44871 Atto behat: Use one less page load to get to profile edit page 2014-06-12 11:11:17 +08:00
Damyon Wiese b18fd23232 MDL-44871 Atto: Move custom select text step to atto specific step definition. 2014-06-12 11:11:17 +08:00
Damyon Wiese bbd644ea34 MDL-44871 Atto behat tests: Modified the tests to work around focus bugs with workspaces
The main changes here are that the "select the text in" step was modified to select only the
first text node in the editor field, and to focus on it's parent instead of the entire editable div.

Some tests had to be modified to match the new behaviour, and another "real" bug was found in the table plugin.
2014-06-12 11:11:17 +08:00
Damyon Wiese c4bfba91c2 MDL-44871 Behat: Add tests for Atto functionalities (some of them) 2014-06-12 11:11:17 +08:00
AMOS bot 6e7a7aecf3 Automatically generated installer lang files 2014-06-12 00:43:36 +00:00
Mark Nelson 635493f6dd MDL-45803 mod_quiz: removed the quiz_fire_attempt_started function
Also commented in mod/quiz/upgrade.txt to inform developers.
2014-06-11 13:57:24 -07:00
Mark Nelson 0f583e0c91 MDL-45803 mod_quiz: removed usage of the function quiz_fire_attempt_started_event 2014-06-11 13:57:24 -07:00
Mark Nelson 1a7ded8989 MDL-45803 mod_quiz: prevented the attempt_started event from being triggered twice 2014-06-11 13:57:23 -07:00
Mark Nelson 159e18c977 MDL-45803 mod_quiz: added attempt snapshot for the attempt and preview started events 2014-06-11 13:57:23 -07:00
Damyon Wiese 801dea3298 MDL-45763 Question types: Allow saving '0' as question text. 2014-06-11 17:29:26 +08:00
Marina Glancy d468b949f1 MDL-39726 backup: fix SQL syntax for Oracle 2014-06-11 17:16:40 +08:00
Marina Glancy a0881872c7 MDL-39726 backup: fix SQL syntax for Oracle 2014-06-11 12:17:25 +08:00
Marina Glancy a9e9cd31e1 MDL-45763 question: fix SQL syntax for Oracle 2014-06-11 12:17:25 +08:00
Frederic Massart 0085d95576 MDL-45870 mod_assign: Behat test covering some outcome usage 2014-06-11 10:34:44 +08:00
Frederic Massart e4226ddc26 MDL-45870 mod_assign: Outcomes are saved for each group member 2014-06-11 10:34:44 +08:00
Eloy Lafuente (stronk7) 4c7169437b Merge branch 'm27_MDL-29708_Typo_Extra_Slashes' of https://github.com/scara/moodle into MOODLE_27_STABLE 2014-06-11 01:36:56 +02:00
Frederic Massart b2cdd35a46 MDL-45808 group: Observe the group key policy upon group creation 2014-06-10 23:02:58 +02:00
Eloy Lafuente (stronk7) aa0fad65e3 Merge branch 'MDL-45579-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-06-10 22:25:54 +02:00
Eloy Lafuente (stronk7) 4c06cef684 Merge branch 'MDL-45418_27' of git://github.com/stronk7/moodle into MOODLE_27_STABLE 2014-06-10 20:13:28 +02:00
Barbara Ramiro 6871df272d MDL-45943: Replacement for publisher icons 2014-06-10 19:31:22 +02:00
Jason Fowler 40a4427420 MDL-45418 Files: Adding upgrade steps for publisher docs
Conflicts:
	lib/db/upgrade.php
	version.php
2014-06-10 19:31:04 +02:00
James McLean f76b5133a5 MDL-45418 Files: Adding publisher docs to Filetypes 2014-06-10 19:27:46 +02:00
Eric Merrill d5a7b7873e MDL-45763 question: Correct random question text if set to true or false 2014-06-10 20:08:25 +08:00
Marina Glancy ffa71ca45e Merge branch 'MDL-45813-scheduled_task_27' of git://github.com/mudrd8mz/moodle into MOODLE_27_STABLE 2014-06-10 15:42:56 +08:00
Marina Glancy 5248eb8831 Merge branch 'MDL-20154-27' of git://github.com/merrill-oakland/moodle into MOODLE_27_STABLE 2014-06-10 15:42:13 +08:00
Damyon Wiese 5468d02e60 Merge branch '45524-27' of git://github.com/samhemelryk/moodle into MOODLE_27_STABLE 2014-06-10 15:31:00 +08:00
Marina Glancy 251fd097bb Merge branch '27STABLE-wip-MDL45846' of git://github.com/jennymgray/moodle into MOODLE_27_STABLE 2014-06-10 14:20:02 +08:00
Daniel Neis Araujo 3ac721e5a3 MDL-45245 html_writer::select_time does not respect 5th parameter "attributes" 2014-06-10 14:19:29 +08:00
Damyon Wiese ecd99dc88a Merge branch 'wip-mdl-44309-m27' of https://github.com/deraadt/moodle into MOODLE_27_STABLE 2014-06-10 14:08:03 +08:00
Damyon Wiese 3097fca71c Merge branch 'MDL-45761-27' of https://github.com/merrill-oakland/moodle into MOODLE_27_STABLE 2014-06-10 14:00:58 +08:00
Damyon Wiese bc1c896692 Merge branch 'MDL-45767_returnInstanceid_27' of https://github.com/moodlerooms/moodle into MOODLE_27_STABLE 2014-06-10 13:53:43 +08:00
Damyon Wiese 6a927661f2 Merge branch 'MDL-45763-27' of https://github.com/merrill-oakland/moodle into MOODLE_27_STABLE 2014-06-10 13:12:07 +08:00
Andrew Nicols 601d32ae66 MDL-45935 tests: Specify step names during backup/restore tests 2014-06-10 12:14:09 +08:00
Michael de Raadt 2dde0b96da MDL-45719 mod_lti - Pass language strings to inline JS to allow for escaping 2014-06-10 11:39:12 +08:00
Eloy Lafuente (stronk7) d420bf952f Merge branch 'MDL-45789_m27' of https://github.com/markn86/moodle into MOODLE_27_STABLE 2014-06-10 01:17:00 +02:00
Eloy Lafuente (stronk7) a02d7831b6 Merge branch 'MDL-45804_m27' of https://github.com/markn86/moodle into MOODLE_27_STABLE 2014-06-10 01:14:29 +02:00
Jetha Chan 604db7d557 MDL-42782 usability: fix for extreme course page indenting 2014-06-10 01:10:31 +02:00
Nobelium 41ab96e7ff MDL-42835 mod_scorm: Close tree nodes using TreeView API 2014-06-10 00:37:16 +02:00
Eloy Lafuente (stronk7) 9dfb59fa28 Merge branch 'MDL-45574-m27' of https://github.com/sammarshallou/moodle into MOODLE_27_STABLE 2014-06-09 21:49:18 +02:00
Eloy Lafuente (stronk7) ad94e63238 Merge branch 'wip-MDL-44501-27' of git://github.com/abgreeve/moodle into MOODLE_27_STABLE 2014-06-09 18:59:22 +02:00
Jenny Gray 82c0485aab MDL-45846 Libraries custom user agent device detection unit test added 2014-06-09 13:59:10 +01:00
Eloy Lafuente (stronk7) 4524454ff2 Merge branch 'wip-mdl-45769-m27' of https://github.com/rajeshtaneja/moodle into MOODLE_27_STABLE 2014-06-09 13:25:17 +02:00
Andrew Nicols 658bba713a MDL-45560 report_log: Close sessions before download only
If the session is closed too early, then preferences made in the body of
the page will not be saved to the session.
2014-06-09 17:24:56 +08:00
Marina Glancy 238c388016 Merge branch 'MDL-45634-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-06-09 17:24:36 +08:00
David Mudrák 5e10e88673 MDL-45813 Fix variable name in scheduled task 2014-06-09 09:47:01 +02:00
Jetha Chan 7b6bad24ee MDL-38693 themes: amended z-indexes
Amended #dock z-index level from 11000 to 5000 across all themes; amended z-index style of #page-header in Overlay theme such that elements no longer occlude TinyMCE.
2014-06-09 14:16:24 +08:00
Damyon Wiese 11be1e8b2b Merge branch 'MDL-39726-27' of https://github.com/merrill-oakland/moodle into MOODLE_27_STABLE 2014-06-09 12:43:27 +08:00
Rajesh Taneja 42126ff6a5 MDL-45769 behat: use final versions of symfony and behat 2014-06-09 09:59:19 +08:00
Rajesh Taneja f12f99241c MDL-45769 Behat: Fixed behat, was failing because of xpath chaining 2014-06-09 09:59:13 +08:00
Damyon Wiese 8fde6e8ef9 Merge branch 'MDL-45714-27' of https://github.com/merrill-oakland/moodle into MOODLE_27_STABLE 2014-06-09 08:56:00 +08:00
Sam Hemelryk 36bd6f3319 MDL-45524 navigation: fixed non-expandable node behat tests 2014-06-09 09:34:02 +12:00
Sam Hemelryk 0f52f263ca MDL-44711 navigation: improved expandable course calculation 2014-06-09 09:34:02 +12:00
Matteo Scaramuccia b9e1842e02 MDL-29708 Fixed file_exception() arguments in rename(). 2014-06-07 09:56:24 +02:00
Matteo Scaramuccia 99261fdf05 MDL-29708 Fixed extra slashes in $string['storedfilenotcreated']. 2014-06-07 09:56:23 +02:00
sam marshall 07388eaded MDL-45574 Backup progress: Can time out with large number of files
When there are many files inside a single resource, it's possible
for the backup to time out because it does not report progress
while adding entries to the backup_ids table.
2014-06-06 10:42:27 +01:00
Jenny Gray d983601e46 MDL-45846 Libraries Reinstate custom user agent device detection 2014-06-06 09:12:58 +01:00
Sam Chaffee fd85f4eeb9 MDL-45767: Fixed DB error when returning to course from external tool
The instance ID is not always returned from the external
tool provider.
2014-06-05 09:38:07 -07:00
Eric Merrill c11ac48868 MDL-20154 quiz: Remove unused random questions
When a random question is removed from a quiz, and it is not
in use elsewhere, it should be deleted.
2014-06-05 11:06:59 -04:00
Eric Merrill 0d5c68bfd8 MDL-20154 questions: question_delete_question should not check perms
By Moodle convention, library functions should not implement permission
checks, they are to be handled by the invoking code.
2014-06-05 11:06:59 -04:00
Eloy Lafuente (stronk7) a6b91c8407 weekly release 2.7+ 2014-06-05 16:58:54 +02:00
Eloy Lafuente (stronk7) f6cac05e9c Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2014-06-05 16:58:49 +02:00
Eric Merrill 9a2938c57c MDL-45761 assign Set inline comment format properly when plugin is empty
If a plugin says it is empty, skip it for for building the inline
comment.

If not format was found in any plugins, set to FORMAT_HTML, which is
the default for feedback anyways.
2014-06-05 08:58:09 -04:00
Michael de Raadt f4d6bab1b4 MDL-44309 Administration - correcting inproperly assigned column classes in environment table 2014-06-05 10:52:43 +08:00
Mark Nielsen ebfbd63b3c MDL-45764 mod_lti: Fix adding General Tool
This error only occurs when a ltisource
plugin is present that implements the
get_types callback.
2014-06-04 08:10:19 -07:00
Eric Merrill 9ec7228b03 MDL-39726 backup: Move question files by context, not one at a time
Use question category contexts to send file to the file pool in bulk.
Questions are only restored in whole category chunks, so this is safe
to do.
2014-06-04 09:19:52 -04:00
Adrian Greeve 0a1f0c4b1f MDL-44501 mod_data: Only attempt to export when a file exists.
The error only occurs when portfolios are enabled and there is only one field which is
a file field.
2014-06-04 15:30:03 +08:00
Frederic Massart 7180fb19c1 MDL-45579 group: Behat tests to cover group enrolment key rules 2014-06-04 15:12:12 +08:00
Frederic Massart ac2015f2ce MDL-45579 group: Prevent duplicate enrolment keys in course groups 2014-06-04 15:12:12 +08:00
Marina Glancy 6fc8187375 Merge branch 'MDL-18162-27-2' of git://github.com/andrewnicols/moodle into MOODLE_27_STABLE 2014-06-04 12:59:42 +08:00
Andrew Nicols 81e433d505 MDL-18162 mod_forum: Correct @param type in phpdoc to use stdClass 2014-06-04 11:26:10 +08:00
Damyon Wiese 9fbdee633a Merge branch 'MDL-45568_m27' of git://github.com/markn86/moodle into MOODLE_27_STABLE 2014-06-04 10:20:15 +08:00
Mark Nelson f1dee5ce23 MDL-45568 events: fixed the description for the 'course_module_completion_updated' event 2014-06-03 17:26:22 -07:00
Mark Nelson 1ffce0c735 MDL-45789 mod_wiki: removed undefined "$this->other['itemid']" from the comments_viewed event description 2014-06-03 15:23:50 -07:00
Eloy Lafuente (stronk7) 3e307259ac Merge branch 'MDL-44620_master' of git://github.com/dmonllao/moodle into MOODLE_27_STABLE 2014-06-03 18:11:37 +02:00
Dan Poltawski 8455124070 Merge branch '45333-27' of git://github.com/samhemelryk/moodle into MOODLE_27_STABLE 2014-06-03 15:26:01 +01:00
Tim Hunt a1d932bd82 MDL-44054 quiz_statistics fix lang string concatenation. 2014-06-03 13:01:25 +01:00
Jason Fowler d9ef98fc80 MDL-42953 Themes: Fixing CSS for headers of central blocks 2014-06-03 12:12:37 +02:00
Damyon Wiese 4affd3c42e Merge branch 'MDL-45592_27' of git://github.com/grabs/moodle into MOODLE_27_STABLE 2014-06-03 16:14:56 +08:00
Damyon Wiese 8771f49c0a Merge branch 'MDL-45677_m27' of https://github.com/markn86/moodle into MOODLE_27_STABLE 2014-06-03 14:38:57 +08:00
Damyon Wiese b018b44b49 Merge branch 'm27_MDL-44098' of git://github.com/greg-or/moodle-mod_assign into MOODLE_27_STABLE 2014-06-03 12:49:59 +08:00
Damyon Wiese 3d4f5c6bf8 MDL-45781 mod_quiz: Shifted files did not match CI version 2014-06-03 12:14:07 +08:00
Frederic Massart 6bbdb16bb1 MDL-45634 editor_atto: Adding type button to toolbar buttons
This prevents the browser to assume that those buttons are submit
buttons. In which case the submit action was stolen and the form
could not be submitted pressing the 'enter' key.
2014-06-03 12:09:46 +08:00
Damyon Wiese 07783f9c20 Merge branch 'MDL-45781_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-06-03 11:57:54 +08:00
Andrew Nicols b19370bd35 MDL-18162 mod_forum: Correct phpdoc for forum_clean_search_terms 2014-06-03 15:19:41 +12:00
Eric Merrill 9d18c714b8 MDL-45714 backup: Less aggressive removal of old backup dirs
The old 4 hour standard was too aggressive and can cause backup files
to be removed while they were still in use. Now the same as cron,
1 week.
2014-06-02 21:50:48 -04:00
Eloy Lafuente (stronk7) 474dd3da66 Merge branch 'm27_MDL-45726' of https://github.com/danmarsden/moodle into MOODLE_27_STABLE 2014-06-03 02:20:34 +02:00
Mark Nelson 5095725a00 MDL-45804 mod_workshop: fixed objecttable specified for the submission_reassessed event 2014-06-02 16:35:15 -07:00
Sam Hemelryk 02da49597c Merge branch 'MDL-33763-27' of git://github.com/ankitagarwal/moodle into MOODLE_27_STABLE 2014-06-03 08:57:39 +12:00
Eric Merrill 5f86aa9d14 MDL-45763 question Random qtype should use '0' or '1' question text.
Some time ago, it when from using '0' for no-subcategories to blank.
Change to properly define '0' or '1', update old questions, and make
sure to fix newly restored questions.
2014-06-02 15:33:00 -04:00
Albert Gasset ae916b5d6a MDL-35514 mod_forum: Fixed warning message to students in forums with groups 2014-06-02 18:25:21 +02:00
AMOS bot ea66859873 Automatically generated installer lang files 2014-05-31 01:06:17 +00:00
Tim Hunt 23f43bb4c4 MDL-45781 quiz autosave: detect and report when the session is lost.
and also other errors.
2014-05-30 16:29:56 +01:00
AMOS bot 108d281f6b Automatically generated installer lang files 2014-05-30 01:24:20 +00:00
AMOS bot 4a0e272c5b Automatically generated installer lang files 2014-05-30 01:24:20 +00:00
Ciaran Irvine 647a688de3 MDL-45726 SCORM: Correct check for forcenewattempt 2014-05-30 09:48:50 +12:00
Sam Hemelryk 3f9ea21ae3 MDL-45333 output: navbar is now wrapped in a <nav> tag 2014-05-30 08:41:34 +12:00
Andreas Grabs 34a46904c2 MDL-45592 mod_feedback - unwanted linebreak after import or duplicating a feedback 2014-05-29 17:16:10 +02:00
Eloy Lafuente (stronk7) d73b1f3e71 weekly release 2.7+ 2014-05-29 12:51:41 +02:00
Eloy Lafuente (stronk7) 2c356d8ecd Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2014-05-29 12:51:36 +02:00
Damyon Wiese 62c7d543f6 MDL-45654 Cron: Fix for unit test that was causing integer overflow in 32 bit php 2014-05-29 16:29:58 +12:00
Rajesh Taneja 008cfb2a1f MDL-45698 behat: Added extra setting, to avoid timout issue 2014-05-29 14:52:57 +12:00
Sam Hemelryk 243f766222 Merge branch 'wip-mdl-45698-m27' of https://github.com/rajeshtaneja/moodle into MOODLE_27_STABLE 2014-05-29 14:28:13 +12:00
Rajesh Taneja 2b9259ed7f MDL-45698 behat: Fixed behat and symfony versions 2014-05-29 09:47:55 +08:00
Sam Hemelryk c5d9d36e79 MDL-45654 cron: fixed dataprovider timestamp issue 2014-05-29 11:31:13 +12:00
Sam Hemelryk 296029fadf Merge branch 'wip-mdl-45565-m27' of https://github.com/rajeshtaneja/moodle into MOODLE_27_STABLE 2014-05-29 08:12:43 +12:00
Eloy Lafuente (stronk7) 7e78f9c4a5 MDL-45503 upgrade: add v2.7.0 sep lines 2014-05-28 01:16:36 +02:00
Simey Lameze 83bc3ccfdf MDL-45544 events: Add event user_profile_viewed trigger to user/profile.php. 2014-05-27 07:50:35 +01:00
Rajesh Taneja 6a001a3223 MDL-45565 phpunit: Changed testsuite_name, so as to avoid class collision 2014-05-27 09:45:16 +08:00
Rajesh Taneja 1974f5ade7 MDL-45565 core_message: Reset internal users in phpunit 2014-05-27 09:45:15 +08:00
Gregory Faller 837e3741fd MDL-44098: Late submissions with extension calculate period of lateness incorrectly 2014-05-27 11:13:41 +09:30
AMOS bot 4bdb702918 Automatically generated installer lang files 2014-05-26 16:46:54 +00:00
AMOS bot e588f20b6c Automatically generated installer lang files 2014-05-26 16:46:54 +00:00
Dan Poltawski ad7d8edf0c Merge branch 'MDL-45676_m27' of https://github.com/markn86/moodle into MOODLE_27_STABLE 2014-05-26 12:02:41 +01:00
Dan Poltawski 9f4a69a8cd Merge branch 'MDL-45675_m27' of https://github.com/markn86/moodle into MOODLE_27_STABLE 2014-05-26 11:58:57 +01:00
Andrew Nicols fd4c7d7b69 MDL-45682 editor_atto: Ensure that the current editor is active when saving selections 2014-05-26 11:24:11 +01:00
Jetha Chan e77b4ac0de MDL-44482 mod_lti: use localized dates
Fixed an issue where LTI external tools had creation datestamps of NaN/NaN/NaN under particular non-English languages.
2014-05-26 14:46:21 +08:00
Damyon Wiese 4fe4fbba9d MDL-45661 Assign: Clean bad data from DB after MDL-42526 2014-05-26 14:43:10 +08:00
Marina Glancy 331298218b MDL-45688 added missing library requirement 2014-05-26 12:47:52 +08:00
Damyon Wiese db52d4058d Merge branch '45499-27' of git://github.com/samhemelryk/moodle into MOODLE_27_STABLE 2014-05-26 12:11:39 +08:00
Mark Nelson b5d1353575 MDL-45629 mod_assign: removed use of '$this->objectid' in the submission_status_viewed event 2014-05-26 11:59:25 +08:00
Mark Nielsen fb3663ae5c MDL-44014 Navigation: Set the correct context when retrieved via AJAX 2014-05-26 11:59:19 +08:00
Mark Nelson 6825f882e2 MDL-45677 mod_assign: removed treatment of an array as an object 2014-05-25 20:25:31 -07:00
Mark Nelson 04b949a8f5 MDL-45676 mod_data: added missing additional name fields 2014-05-25 20:23:13 -07:00
Ankit Agarwal 86976c5bd9 MDL-33763 notes: Fix issue with incorrect node highlighting in the nav tree 2014-05-26 10:42:14 +08:00
Mark Nelson 33238bb24b MDL-45675 mod_data: initialise options as an empty array to avoid error when there are none 2014-05-25 19:29:44 -07:00
Mark Nelson 2b548c27ee MDL-45650 events: ensure correct objectid passed when triggering user_profile_viewed event 2014-05-26 13:59:52 +12:00
David Monllao e0cd7e44db MDL-45192 behat: Replacing specific-selector steps by a generic one
Having a I click on we can use all our selectors rather
than having multiple steps for the same purpose. This
step allow us to manage JS native dialogues without
having to fail a scenario.

Credit for Mohamed Alsharaf.
2014-05-26 13:57:23 +12:00
Mohamed Alsharaf 184cdf0d52 MDL-45192 assign: added behat script & new definitions to handle alert dialog
The behat script is to test the batch action to lock and unlock submissions.
The new definitions are to prevent the "unexpected alert open" error in Selenium.
2014-05-26 13:57:18 +12:00
Tim Hunt 472896acdd MDL-45660 question statistics: make comparison more robust. 2014-05-26 11:53:06 +12:00
Sam Hemelryk 1ff977a5e5 Merge branch 'MDL-45686_27' of git://github.com/jmvedrine/moodle into MOODLE_27_STABLE 2014-05-26 10:55:17 +12:00
Andrew Nicols 68a1c2a8d9 MDL-45635 javascript: Make core dialogue translatable 2014-05-26 10:38:59 +12:00
Simon Coggins db77228155 MDL-45623: Fix assigned users count on role delete confirmation page 2014-05-26 10:00:51 +12:00
Mark Nelson 8a0dcb91cc MDL-45607 events: changed the context passed to the user_profile_viewed event 2014-05-26 09:54:42 +12:00
Sam Hemelryk 11b5d9b763 Merge branch 'MDL-42526-27' of git://github.com/jamiepratt/moodle into MOODLE_27_STABLE 2014-05-26 09:02:53 +12:00
Sam Hemelryk dc195425ee MDL-45499 admin: fixed error when displaying page settings 2014-05-26 09:01:14 +12:00
Sam Hemelryk 72cf8ec5eb Merge branch 'MDL-45654-27' of https://github.com/rtcn2/moodle into MOODLE_27_STABLE 2014-05-26 08:58:13 +12:00
Jean-Michel Vedrine 1130c181f9 MDL-45686 qtype_multichoice get_num_selected_choices return wrong result 2014-05-25 09:23:26 +02:00
Rajesh Taneja 443d4dae06 MDL-45565 core_message: Added unit tests. 2014-05-23 16:48:18 +08:00
Rajesh Taneja a2720952c2 MDL-45565 core_message: Fixed strangers array
Strangers get mixed with noreply user and support user,
if  noreply/support users real user.
To avoid duplication use userid as array index. Also,
avoid fetching data again for noreply and support users,
if they are real users, then data is already feteched.
2014-05-23 16:48:15 +08:00
Eloy Lafuente (stronk7) 89262fa9f1 weekly release 2.7+ 2014-05-22 16:47:19 +02:00
James Pratt bc3c2a8eed MDL-42526 mod_assignment : fix record insert with assigment.id 0 2014-05-22 13:01:47 +07:00
Andrew Nicols fb7e5c42cd MDL-45239 editor_atto: On Android do not restore focus in the callbackWrapper
It seems that Android automatically focuses the cursor in the last position
when the content editable region is programatically re-focused.

Whilst this does not cause an issue on it's own, when combined with the
behaviour of the dictionary auto-completion to restore focus on the start
of the word when a word has not yet been finished, this was causing us to
change focus when pressing buttons.
2014-05-22 13:02:26 +08:00
Andrew Nicols 2e2a229f58 MDL-45536 atto_html: Update the textarea size when switching to HTML view 2014-05-22 11:47:37 +08:00
Rod Norfor d12b20d022 MDL-45654 cron: fix non-empty directories deletion
Remove errors when attempting to delete non-empty directories when
child directories do not get removed since the mtime was updated when
files were removed from the child directory.
2014-05-21 17:20:16 +01:00
Sam Hemelryk 5ce5bc6bdd MDL-44711 course: fixed navigation expansion in course tests 2014-05-21 20:58:27 +12:00
Marina Glancy 54c9048405 MDL-45469 profile: make sure profile fields can be initialised without arguments 2014-05-21 12:04:48 +08:00
Marina Glancy 7b04f1fa49 MDL-45371 behat: Tests for block glossary_random 2014-05-21 10:03:26 +08:00
Marina Glancy eebd7f8964 MDL-45320 behat: change to block selector 2014-05-21 09:32:18 +12:00
Marina Glancy 871af2ebc5 MDL-45320 block_html: behat tests 2014-05-21 09:32:14 +12:00
Marina Glancy 0d4b11ff88 MDL-45320 behat: Step definitions for blocks 2014-05-21 09:32:12 +12:00
David Monllao e342149a37 MDL-45294 behat: Updating block references to aria label value
Also improving moodle selectors xpath expressions
readability.
2014-05-21 09:31:50 +12:00
David Monllao 9054cd2a25 MDL-45294 behat: Supporting an aria-label as a block ref 2014-05-21 09:31:46 +12:00
Dan Poltawski 7d5e56cffd Merge branch '44711-27-r2' of git://github.com/samhemelryk/moodle into MOODLE_27_STABLE 2014-05-20 20:32:10 +08:00
Sam Hemelryk 137c0261ee MDL-44711 block_navigation: fixed typo in behat tests 2014-05-20 23:39:17 +12:00
Damyon Wiese 1c500e2157 MDL-45606 Unit test fix for MySQL and added a comment about the removed code. 2014-05-20 18:07:13 +08:00
Dan Poltawski 46021b98b2 Merge branch 'MDL-45496-m27' of https://github.com/micaherne/moodle into MOODLE_27_STABLE 2014-05-20 15:55:12 +08:00
Dan Poltawski 55739cdfb6 Merge branch 'MDL-45563-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-05-20 15:50:29 +08:00
Tim Hunt 63e5416f5b MDL-45618 Fix @since PHPdoc tags. 2014-05-20 15:03:34 +08:00
Jetha Chan 689a8f383c MDL-45525 themes: minor forum improvements
Fixed an RTL style that wasn't kicking in properly.

Conflicts:
	theme/bootstrapbase/style/moodle.css
2014-05-20 14:29:25 +08:00
Andrew Nicols 10f981a794 MDL-45536 theme: Use width auto for inputs and textareas specifying them
Conflicts:
	theme/bootstrapbase/style/moodle.css
2014-05-20 14:25:45 +08:00
Adrian Greeve 556a760d0c MDL-45512 comments: Added full date to comment details. 2014-05-20 14:22:32 +08:00
Michael Aherne 2ba0565d7d MDL-43669 messaging Enable sending email only from no-reply address 2014-05-20 14:16:05 +08:00
Tim Hunt 16d5729223 MDL-44333 quiz reports: use consitent name for user pref
The Marks for each question setting was not being saved properly as a
user preference.
2014-05-20 14:11:39 +08:00
Mark Nelson 38ef7ab379 MDL-45571 events: included enrolment method in the 'user_enrolment_created' event description 2014-05-20 14:08:14 +08:00
Damyon Wiese 740cb942ce Merge branch 'master_MDL-45583' of github.com:danmarsden/moodle into MOODLE_27_STABLE 2014-05-20 13:30:51 +08:00
Damyon Wiese 3725adf852 Merge branch 'MDL-45323-master' of git://github.com/lameze/moodle into MOODLE_27_STABLE 2014-05-20 13:28:09 +08:00
Dan Poltawski b9c49aefb2 Merge branch 'MDL-45501-27' of git://github.com/ankitagarwal/moodle into MOODLE_27_STABLE 2014-05-20 13:23:40 +08:00
Dan Poltawski 60f8e19ce1 Merge branch 'MDL-45566-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-05-20 13:17:41 +08:00
Damyon Wiese d0f43772fb Merge branch 'MDL-45476-master' of git://github.com/phalacee/moodle into MOODLE_27_STABLE 2014-05-20 13:12:16 +08:00
Dan Poltawski 106be68e82 Merge branch 'MDL-45545-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-05-20 12:21:12 +08:00
Marina Glancy f12ad8521f MDL-45469 Move profile tests to the location recognised by phpunit 2014-05-20 11:59:58 +08:00
Marina Glancy 9efa210e32 MDL-45466 forum: performance improvement for mass (un)subscriptions 2014-05-20 11:52:23 +08:00
Dan Poltawski 79b146cb5c MDL-44323 admin: use correct css class for warning
The notifyproblem notification is consistent with the rest of
the warnings we report.

Conflicts:
	theme/bootstrapbase/style/moodle.css
2014-05-20 15:48:48 +12:00
Sam Hemelryk 8711ce1f4a Merge branch 'MDL-44027-27' of git://github.com/danpoltawski/moodle into MOODLE_27_STABLE 2014-05-20 15:39:36 +12:00
Damyon Wiese 417fa07162 MDL-45605 Phpunit: Do not call gc_collect_cycles as part of reset.
This takes 25% of the time in running tests and there is no benefit. The
behaviour of destructors is the same before/after the patch.
2014-05-20 10:51:58 +08:00
Dan Poltawski 1910d01a86 Merge branch 'MDL-45546-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-05-20 10:24:42 +08:00
Dan Poltawski c9c530fd6e Merge branch '44711-27' of git://github.com/samhemelryk/moodle into MOODLE_27_STABLE 2014-05-20 10:14:22 +08:00
Sam Hemelryk dadeff80c9 Merge branch 'MDL-45603-27' of https://github.com/merrill-oakland/moodle into MOODLE_27_STABLE 2014-05-20 13:59:36 +12:00
sam marshall cc41096ad5 MDL-45469 Conditional availability: Restrict by text area broken
It has never worked, because the data for text area fields is not
loaded into the $USER object.

Changing it so that the dropdown list does not include these types
of field.
2014-05-20 09:52:36 +08:00
Tim Hunt db9987c267 MDL-44449 quiz access rules should have a delete hook.
So they can clean up their settings when the quiz is deleted.

See
https://github.com/moodleou/moodle-quizaccess_honestycheck/commit/babf149c2cc6dd734c272cd332b2032cc19db7d8
for an example of using this.
2014-05-20 09:51:16 +08:00
Dan Poltawski 8d8a5e8035 Merge branch 'MDL-45550-m27' of https://github.com/sammarshallou/moodle into MOODLE_27_STABLE 2014-05-20 09:30:19 +08:00
Andrew Nicols b60373f3e4 MDL-45479 atto_image: Improve the preview area
This changes the preview area:
* to show the image at the requested size; and
* to fix the scaling issues.
2014-05-20 13:20:17 +12:00
Damyon Wiese 1d8bebfeaf Merge branch '44974-27' of git://github.com/samhemelryk/moodle into MOODLE_27_STABLE 2014-05-20 09:00:35 +08:00
Ankit Agarwal 41d178f9da MDL-45543 availability: Use correct namespace for global classes 2014-05-20 12:07:39 +12:00
Sam Hemelryk d144e53188 Merge branch 'MDL-45477-m27' of https://github.com/sammarshallou/moodle into MOODLE_27_STABLE 2014-05-20 11:58:24 +12:00
sam marshall 49b50ef5ab MDL-45535 CSS chunking breaks media rules if CSS invalid (IE)
Invalid CSS with extra } symbols, which previously (by fluke)
worked, was broken by recent chunking improvements. This change
makes the chunking code robust against this (stupid) situation.
2014-05-20 11:57:54 +12:00
Sam Hemelryk 4fac06549a Merge branch 'MDL-44953-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-05-20 11:43:17 +12:00
Sam Hemelryk 7141921ad4 Merge branch 'MDL-45474-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-05-20 10:46:34 +12:00
Sam Hemelryk 70e78a4315 Merge branch 'MDL-37838-27' of git://github.com/danpoltawski/moodle into MOODLE_27_STABLE 2014-05-20 10:42:23 +12:00
Sam Hemelryk 520592c43d Merge branch 'MDL-45380-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE
Conflicts:
	theme/bootstrapbase/style/moodle.css
2014-05-20 08:53:18 +12:00
Dan Poltawski 553b1e6f6d MDL-45135 mod_glossary: fix RTL alignment of table
Tablelib has a specific 'hook' to allow alignment to be corrected for
RTL languages, but needs to be specified direction in lowercase.
2014-05-20 08:49:01 +12:00
Damyon Wiese bb5652829f Merge branch 'MDL-45130-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-05-19 21:27:47 +08:00
Damyon Wiese 288a79ccd4 Merge branch 'MDL-45472-master' of git://github.com/andrewnicols/moodle into MOODLE_27_STABLE 2014-05-19 20:47:27 +08:00
Damyon Wiese 8f6d8a5653 Merge branch 'MDL-45447-master' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-05-19 20:23:09 +08:00
Tim Hunt c64368bb1d MDL-43833 quiz reports: persist states settings between pages. 2014-05-19 20:12:09 +08:00
Damyon Wiese 177beaf23a Merge branch 'MDL-45527-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-05-19 20:05:25 +08:00
Tim Hunt 147d7af758 MDL-45455 quiz cron must rollback transaction on error. 2014-05-19 19:57:21 +08:00
Tony Butler 20bd24b70d MDL-45432 mod_assign Declare character encoding in onlinetext export
Signed-off-by: Tony Butler <tonyjbutler@gmail.com>
2014-05-19 18:48:06 +08:00
sam marshall 7c75924319 MDL-45478 Conditional availability: Custom user restriction missing
There was an error in the JavaScript and custom user field
restrictions did not show correctly when editing the form.

Behat tests didn't cover custom user fields, so I added a
scenario.
2014-05-19 17:30:43 +08:00
Andrew Nicols d90846033b MDL-45239 editor_atto: The editor cannot be active if it is not the active element
FireFox thinks that you can have an active selection on an element which
currently does not have focus. How this can be the case is a mystery.

Conflicts:
	lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js
2014-05-19 16:15:50 +08:00
Andrew Nicols da02a3c472 MDL-45468 editor_atto: Check that the common ancestor is within the editor
Conflicts:
	lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js
2014-05-19 16:15:43 +08:00
Andrew Nicols 61609ec274 MDL-41109 dndupload: Add missing error string 2014-05-19 15:07:59 +08:00
Dan Poltawski 228fc821e0 Merge branch 'wip-MDL-34914-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2014-05-19 14:58:51 +08:00
Damyon Wiese d44071ee09 MDL-32543 upgrade: Increment the version bump 2014-05-19 13:02:10 +08:00
Damyon Wiese 91fae7e9b4 Merge branch 'MDL-32543' of https://github.com/danielneis/moodle into MOODLE_27_STABLE 2014-05-19 13:00:00 +08:00
Damyon Wiese 3e7b9158f4 Merge branch 'MDL-23566' of https://github.com/aolley/moodle into MOODLE_27_STABLE 2014-05-19 12:44:31 +08:00
Marina Glancy 95f9c8f716 Merge branch 'MDL-45537-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-05-19 12:39:43 +08:00
Marina Glancy 170392d4a0 Merge branch 'wip-MDL-45483-MOODLE_27_STABLE' of https://github.com/kwiliarty/moodle into MOODLE_27_STABLE 2014-05-19 12:37:59 +08:00
Damyon Wiese 3724b3aa8d Merge branch 'MDL-45533-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-05-19 12:28:10 +08:00
Damyon Wiese 9af90f03bb Merge branch 'MDL-44634-27' of https://github.com/dbezborodovrp/moodle into MOODLE_27_STABLE 2014-05-19 12:14:42 +08:00
Jetha Chan 64a2dfba1f MDL-45561 themes: horizontal scroll in RTL base 2014-05-19 13:38:22 +12:00
Sam Hemelryk 043cf8bab7 MDL-44974 admin: repositioned call to initialise renderer 2014-05-19 08:41:27 +12:00
Sam Hemelryk 832393cfc9 MDL-44711 navigation: better handling of course expansion exception 2014-05-19 08:41:12 +12:00
Eric Merrill d8e7fa9196 MDL-45603 cache Fix the mappingsonly option to work as advertised. 2014-05-17 23:58:05 -04:00
Marina Glancy 075e999c1a MDL-34914 cohorts: more understandable filter of user list by cohort 2014-05-16 17:14:29 +08:00
Frederic Massart 8efb66741f MDL-45566 message: Send blocking events when user is not in contact list 2014-05-15 16:43:01 +08:00
Frederic Massart fa348b5d46 MDL-45563 message: Inverting IDs in description of event message_viewed 2014-05-15 16:17:03 +08:00
Frederic Massart ac2eafee91 MDL-45537 mod_assign: Requiring locallib for class assign 2014-05-15 15:52:48 +08:00
Damyon Wiese e6c69d835d weekly release 2.7+ 2014-05-15 15:32:36 +08:00
Simey Lameze 1468444f42 MDL-45323 grade: Unit test for grade_get_grade_items_for_activity() 2014-05-15 15:00:56 +08:00
Simey Lameze 3a34659252 MDL-45323 grade: Fix query errors on grade_get_grade_for_activity method. 2014-05-15 15:00:03 +08:00
Ankit Agarwal bfa6c5080e MDL-45501 availability: Add uninstall support for conditional plugins 2014-05-15 14:07:05 +08:00
Damyon Wiese 0f0729b157 MDL-41383 Filepicker: whitespace fix 2014-05-15 13:33:04 +08:00
Jetha Chan f75d82450a MDL-41383: RTL fix for base when zoomed out 2014-05-15 13:29:03 +08:00
Frederic Massart 9389ff572b MDL-45533 editor_atto: Default paragraph is removed from empty Atto 2014-05-15 11:10:54 +08:00
Damien Bezborodov 3dd33e3862 MDL-44634 Regression: link to user profile in comments block fails due to double URI encoding 2014-05-15 11:46:32 +09:30
Damien Bezborodov e3b98ac6b6 MDL-44634 Regression: link to user profile in comments block fails due to double URI encoding 2014-05-15 10:43:06 +09:30
sam marshall 3951213860 MDL-45550 Conditional availability: Missing lang string for save settings error 2014-05-14 11:48:33 +01:00
sam marshall 24b81e0566 MDL-45477 Behat: List of steps takes too long to load, times out
Increase time limit to 300 seconds (5 minutes).
2014-05-14 11:05:38 +01:00
Juan Leyva 0ab271dcfd MDL-36670 logging: action parameter length restricted to 40 chars 2014-05-14 16:35:18 +08:00
Frederic Massart b9cb39eaf6 MDL-45546 mod_forum: Login the user before getting its context 2014-05-14 16:16:40 +08:00
Frederic Massart c83407f033 MDL-45545 csslib: Chunking handles commas in media query definitions 2014-05-14 15:28:11 +08:00
Jetha Chan da75ffce68 MDL-41383 theme: filepicker zoom resiliency (base)
Fixed an issue that broke the file picker on base when initial zoom level is less than 100%.
2014-05-14 15:07:44 +08:00
David Monllao ee9f6db7a2 MDL-44620 behat: Automate MDLQA-7
- MDLQA-7: By default, a new course contains a Latest
News block which displays a specific number of recent
discussions from the news forum
2014-05-13 17:25:26 +07:00
David Monllao d46979ec3a MDL-44620 behat: Automates MDLQA-6
- MDLQA-6: By default, a new course contains a news
forum in which only teachers can post and subscription
is forced
2014-05-13 17:24:33 +07:00
Frederic Massart d48b1de9f7 MDL-45474 atto_undo: Remove notice when undo stack is empty 2014-05-13 17:49:26 +08:00
Frederic Massart da6b4b9bf9 MDL-45527 task: Already deleted unconfirmed users are ignored 2014-05-13 17:11:18 +08:00
Dan Poltawski 38d1c9a886 MDL-44027 groups: remove some junk html 2014-05-13 16:17:14 +08:00
Damyon Wiese 1c48d7e188 Merge branch 'MDL-41383-27' of git://github.com/jethac/moodle into MOODLE_27_STABLE 2014-05-13 16:01:50 +08:00
Dan Poltawski 11b39253d2 Merge branch 'MDL-45523_m27' of https://github.com/merrill-oakland/moodle into MOODLE_27_STABLE 2014-05-13 14:46:55 +08:00
Dan Poltawski 56e84a7985 Merge branch 'MDL-45522_m27' of https://github.com/merrill-oakland/moodle into MOODLE_27_STABLE 2014-05-13 14:37:23 +08:00
Dan Poltawski 133f83d557 MDL-37838 block_courseoverview: fix pluaralisation logic
Note that this kind of handling of plurals is extremely limited, see:

https://moodle.org/mod/forum/discuss.php?d=85897
http://search.cpan.org/~petdance/Locale-Maketext-1.12/lib/Locale/Maketext/TPJ13.pod

However, this is a simple fix to the existing logic
2014-05-13 14:18:16 +08:00
Jason Fowler 1d20cf37cb MDL-45476 Quiz: Fixing atto on multiple choice pages 2014-05-13 08:06:04 +08:00
Eric Merrill 17e57aa07d MDL-45523 quiz Cleanup duplicate question instances. 2014-05-12 16:01:32 -04:00
Eric Merrill 710b364b44 MDL-45522 quiz Check that sumgrade is valid before saving. 2014-05-12 15:21:44 -04:00
Daniel Neis Araujo d277c441da MDL-32543 Make sure the action and url fields of log table have correct sizes 2014-05-12 12:05:25 -03:00
Jetha Chan b993411de1 MDL-41383 theme: filepicker zoom resiliency
Fixed an issue that broke the file picker on bootstrapbase when zooming in and out.
2014-05-12 17:16:58 +08:00
Frederic Massart 81d72831b8 MDL-44953 theme_more: Removing odd-looking text-shadow 2014-05-12 16:51:37 +08:00
Frederic Massart 3cfabf7190 MDL-45130 editor_atto: Remove debugging messages for missing plugins
This is no longer required as the toolbar configuration prevents
missing plugins from being set. However, even if we do not output
any notice, we ignore missing plugins to prevent errors in case
one was uninstalled but left in the editor toolbar.
2014-05-12 16:09:40 +08:00
Michael Aherne 0e5791a6cd MDL-45496 core Added space to logged in as line 2014-05-12 08:58:41 +01:00
Frederic Massart da3e5e0c5c MDL-45380 theme_bootstrapbase: Restore config override highlight 2014-05-12 15:50:08 +08:00
Rajesh Taneja ae3b9e1e1f MDL-45514 behat: Fixed should_not_exist timout param 2014-05-12 14:13:21 +08:00
Kevin Wiliarty 3485ecf225 MDL-45483 mod_forum: corrects values for maxattachments in forum settings 2014-05-11 23:51:57 -04:00
Andrew Nicols 83e8f495f2 MDL-45472 AJAX: Whitelist prototype values form JS Error in exception dialogue 2014-05-08 16:44:11 +08:00
Frederic Massart ba4e81d249 MDL-45447 editor_atto: Highlight collapse and html icons when toggled 2014-05-07 17:44:06 +08:00
Adam Olley c3af87ac64 MDL-23566 mod_lesson: Float answers so paragraphs line up correctly next to the inputs 2014-05-07 15:44:36 +09:30
734 changed files with 9672 additions and 2659 deletions
+19 -20
View File
@@ -17,7 +17,7 @@
/**
* This file is used to display a categories sub categories, external pages, and settings.
*
* @since 2.3
* @since Moodle 2.3
* @package admin
* @copyright 2011 Sam Hemelryk
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
@@ -97,27 +97,26 @@ foreach ($settingspage->children as $childpage) {
$outputhtml .= $OUTPUT->heading(html_writer::link($childpage->url, $childpage->visiblename), 3);
} else if ($childpage instanceof admin_settingpage) {
$outputhtml .= $OUTPUT->heading(html_writer::link(new moodle_url('/'.$CFG->admin.'/settings.php', array('section' => $childpage->name)), $childpage->visiblename), 3);
// If its a settings page and has settings lets display them.
if (!empty($childpage->settings)) {
$outputhtml .= html_writer::start_tag('fieldset', array('class' => 'adminsettings'));
foreach ($childpage->settings as $setting) {
if (empty($setting->nosave)) {
$savebutton = true;
}
$fullname = $setting->get_full_name();
if (array_key_exists($fullname, $adminroot->errors)) {
$data = $adminroot->errors[$fullname]->data;
} else {
$data = $setting->get_setting();
}
$outputhtml .= html_writer::tag('div', '<!-- -->', array('class' => 'clearer'));
$outputhtml .= $setting->output_html($data);
}
$outputhtml .= html_writer::end_tag('fieldset');
}
} else if ($childpage instanceof admin_category) {
$outputhtml .= $OUTPUT->heading(html_writer::link(new moodle_url('/'.$CFG->admin.'/category.php', array('category' => $childpage->name)), get_string('admincategory', 'admin', $childpage->visiblename)), 3);
} else {
continue;
}
if (!empty($childpage->settings)) {
$outputhtml .= html_writer::start_tag('fieldset', array('class' => 'adminsettings'));
foreach ($childpage->settings as $setting) {
if (empty($setting->nosave)) {
$savebutton = true;
}
$fullname = $setting->get_full_name();
if (array_key_exists($fullname, $adminroot->errors)) {
$data = $adminroot->errors[$fullname]->data;
} else {
$data = $setting->get_setting();
}
$outputhtml .= html_writer::tag('div', '<!-- -->', array('class' => 'clearer'));
$outputhtml .= $setting->output_html($data);
}
$outputhtml .= html_writer::end_tag('fieldset');
}
}
if ($savebutton) {
+1 -9
View File
@@ -201,17 +201,9 @@ if (defined('COMPONENT_CLASSLOADER')) {
require($CFG->dirroot.'/version.php');
$CFG->target_release = $release;
$_SESSION = array();
$_SESSION['SESSION'] = new stdClass();
$_SESSION['SESSION']->lang = $CFG->lang;
$_SESSION['USER'] = new stdClass();
$_SESSION['USER']->id = 0;
$_SESSION['USER']->mnethostid = 1;
\core\session\manager::init_empty_session();
global $SESSION;
global $USER;
$SESSION = &$_SESSION['SESSION'];
$USER = &$_SESSION['USER'];
global $COURSE;
$COURSE = new stdClass();
+5 -3
View File
@@ -378,9 +378,6 @@ if (!$cache and moodle_needs_upgrading()) {
if (!$PAGE->headerprinted) {
// means core upgrade or installation was not already done
/** @var core_admin_renderer $output */
$output = $PAGE->get_renderer('core', 'admin');
if (!$confirmplugins) {
$strplugincheck = get_string('plugincheck');
@@ -398,6 +395,9 @@ if (!$cache and moodle_needs_upgrading()) {
redirect($PAGE->url);
}
/** @var core_admin_renderer $output */
$output = $PAGE->get_renderer('core', 'admin');
$deployer = \core\update\deployer::instance();
if ($deployer->enabled()) {
$deployer->initialize($PAGE->url, $PAGE->url);
@@ -421,6 +421,8 @@ if (!$cache and moodle_needs_upgrading()) {
// Make sure plugin dependencies are always checked.
$failed = array();
if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed)) {
/** @var core_admin_renderer $output */
$output = $PAGE->get_renderer('core', 'admin');
$reloadurl = new moodle_url('/admin/index.php', array('cache' => 0));
echo $output->unsatisfied_dependencies_page($version, $failed, $reloadurl);
die();
+1 -1
View File
@@ -18,7 +18,7 @@
/**
* This file contains functions used by the admin pages
*
* @since 2.1
* @since Moodle 2.1
* @package admin
* @copyright 2011 Andrew Davis
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+1 -1
View File
@@ -1384,7 +1384,7 @@ class core_admin_renderer extends plugin_renderer_base {
get_string('report'),
get_string('status'),
);
$servertable->colclasses = array('centeralign name', 'centeralign status', 'leftalign report', 'centeralign info');
$servertable->colclasses = array('centeralign name', 'centeralign info', 'leftalign report', 'centeralign status');
$servertable->attributes['class'] = 'admintable environmenttable generaltable';
$servertable->id = 'serverstatus';
+2 -2
View File
@@ -176,7 +176,7 @@ if ($roleid) {
// Show UI for assigning a particular role to users.
// Print a warning if we are assigning system roles.
if ($context->contextlevel == CONTEXT_SYSTEM) {
echo $OUTPUT->box(get_string('globalroleswarning', 'core_role'));
echo $OUTPUT->notification(get_string('globalroleswarning', 'core_role'));
}
// Print the form.
@@ -251,7 +251,7 @@ if ($roleid) {
// Print a warning if we are assigning system roles.
if ($context->contextlevel == CONTEXT_SYSTEM) {
echo $OUTPUT->box(get_string('globalroleswarning', 'core_role'));
echo $OUTPUT->notification(get_string('globalroleswarning', 'core_role'));
}
// Print instruction.
+10 -2
View File
@@ -74,8 +74,16 @@ abstract class core_role_capability_table_base {
public function display() {
if (count($this->capabilities) > self::NUM_CAPS_FOR_SEARCH) {
global $PAGE;
$PAGE->requires->strings_for_js(array('filter', 'clear'), 'moodle');
$PAGE->requires->js_init_call('M.core_role.init_cap_table_filter', array($this->id, $this->context->id));
$jsmodule = array(
'name' => 'rolescapfilter',
'fullpath' => '/admin/roles/module.js',
'strings' => array(
array('filter', 'moodle'),
array('clear', 'moodle'), ),
'requires' => array('node', 'cookie', 'escape')
);
$PAGE->requires->js_init_call('M.core_role.init_cap_table_filter', array($this->id, $this->context->id), false,
$jsmodule);
}
echo '<table class="' . implode(' ', $this->classes) . '" id="' . $this->id . '">' . "\n<thead>\n";
echo '<tr><th class="name" align="left" scope="col">' . get_string('capability', 'core_role') . '</th>';
+2 -1
View File
@@ -75,7 +75,8 @@ switch ($action) {
$a->id = $roleid;
$a->name = $roles[$roleid]->name;
$a->shortname = $roles[$roleid]->shortname;
$a->count = $DB->count_records('role_assignments', array('roleid'=>$roleid));
$a->count = $DB->count_records_select('role_assignments',
'roleid = ?', array($roleid), 'COUNT(DISTINCT userid)');
$formcontinue = new single_button(new moodle_url($baseurl, $optionsyes), get_string('yes'));
$formcancel = new single_button(new moodle_url($baseurl), get_string('no'), 'get');
+1 -1
View File
@@ -51,7 +51,7 @@ M.core_role.init_cap_table_filter = function(Y, tableid, contextid) {
marginRight : 'auto'
});
// Create the capability search input.
this.input = Y.Node.create('<input type="text" id="'+this.table.get('id')+'capabilitysearch" value="'+filtervalue+'" />');
this.input = Y.Node.create('<input type="text" id="'+this.table.get('id')+'capabilitysearch" value="'+Y.Escape.html(filtervalue)+'" />');
// Create a label for the search input.
this.label = Y.Node.create('<label for="'+this.input.get('id')+'">'+M.str.moodle.filter+' </label>');
// Create a clear button to clear the input.
-1
View File
@@ -139,7 +139,6 @@ if (optional_param('savechanges', false, PARAM_BOOL) && confirm_sesskey()) {
array(
'context' => $context,
'objectid' => $roleid,
'courseid' => $courseid
)
);
+3 -2
View File
@@ -80,7 +80,8 @@ class behat_admin extends behat_base {
// Single element settings.
try {
$fieldxpath = "//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')]" .
"[@id=//label[contains(normalize-space(.), $label)]/@for]";
"[@id=//label[contains(normalize-space(.), $label)]/@for or " .
"@id=//span[contains(normalize-space(.), $label)]/preceding-sibling::label[1]/@for]";
$fieldnode = $this->find('xpath', $fieldxpath, $exception);
$formfieldtypenode = $this->find('xpath', $fieldxpath . "/ancestor::div[@class='form-setting']" .
@@ -89,7 +90,7 @@ class behat_admin extends behat_base {
} catch (ElementNotFoundException $e) {
// Multi element settings, interacting only the first one.
$fieldxpath = "//descendant::label[.= $label]/ancestor::div[contains(concat(' ', normalize-space(@class), ' '), ' form-item ')]" .
$fieldxpath = "//*[label[.= $label]|span[.= $label]]/ancestor::div[contains(concat(' ', normalize-space(@class), ' '), ' form-item ')]" .
"/descendant::div[@class='form-group']/descendant::*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')]";
$fieldnode = $this->find('xpath', $fieldxpath);
@@ -0,0 +1,27 @@
@core @core_admin
Feature: Set admin settings value
In order to set admin settings value
As an admin
I need to set admin setting value and verify it is applied
Background:
Given the following "courses" exist:
| fullname | shortname | category |
| Course fullname | C_shortname | 0 |
And I log in as "admin"
And I should see "Course fullname"
And I should not see "C_shortname Course fullname"
Scenario: set admin value with full name
Given I set the following administration settings values:
| Display extended course names | 1 |
When I press "Save changes"
And I am on homepage
Then I should see "C_shortname Course fullname"
Scenario: set admin value with short name
Given I set the following administration settings values:
| courselistshortnames | 1 |
When I press "Save changes"
And I am on homepage
Then I should see "C_shortname Course fullname"
+5
View File
@@ -27,6 +27,11 @@ require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->dirroot . '/' . $CFG->admin . '/tool/behat/locallib.php');
require_once($CFG->libdir . '/behat/classes/behat_config_manager.php');
// This page usually takes an exceedingly long time to load, so we need to
// increase the time limit. At present it takes about a minute on some
// systems, but let's allow room for expansion.
core_php_time_limit::raise(300);
$filter = optional_param('filter', '', PARAM_ALPHANUMEXT);
$type = optional_param('type', false, PARAM_ALPHAEXT);
$component = optional_param('component', '', PARAM_ALPHAEXT);
+3
View File
@@ -45,5 +45,8 @@ function xmldb_tool_customlang_upgrade($oldversion) {
// Moodle v2.6.0 release upgrade line.
// Put any upgrade step following this.
// Moodle v2.7.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
@@ -28,20 +28,20 @@ defined('MOODLE_INTERNAL') || die();
$string['acknowledgement'] = 'Acknowledgement';
$string['acknowledgementmust'] = 'You must acknowledge this';
$string['acknowledgementtext'] = 'I understand that it is my responsibility to have full backups of this site prior to installing add-ons. I accept and understand that add-ons (especially but not only those originating in unofficial sources) may contain security holes, can make the site unavailable, or cause private data leaks or loss.';
$string['featuredisabled'] = 'The add-on installer is disabled on this site.';
$string['installaddon'] = 'Install add-on!';
$string['installaddons'] = 'Install add-ons';
$string['installexception'] = 'Oops... An error occurred while trying to install the add-on. Turn debugging mode on to see details of the error.';
$string['installfromrepo'] = 'Install add-ons from the Moodle plugins directory';
$string['installfromrepo_help'] = 'You will be redirected to the Moodle plugins directory to search for and install an add-on. Note that your site full name, URL and Moodle version will be sent as well, to make the installation process easier for you.';
$string['installfromzip'] = 'Install add-on from ZIP file';
$string['installfromzip_help'] = 'An alternative to installing an add-on directly from the Moodle plugins directory is to upload a ZIP package of the add-on. The ZIP package should have the same structure as a package downloaded from the Moodle plugins directory.';
$string['acknowledgementtext'] = 'I understand that it is my responsibility to have full backups of this site prior to installing additional plugins. I accept and understand that plugins (especially but not only those originating in unofficial sources) may contain security holes, can make the site unavailable, or cause private data leaks or loss.';
$string['featuredisabled'] = 'The plugin installer is disabled on this site.';
$string['installaddon'] = 'Install plugin!';
$string['installaddons'] = 'Install plugins';
$string['installexception'] = 'Oops... An error occurred while trying to install the plugin. Turn debugging mode on to see details of the error.';
$string['installfromrepo'] = 'Install plugins from the Moodle plugins directory';
$string['installfromrepo_help'] = 'You will be redirected to the Moodle plugins directory to search for and install a plugin. Note that your site full name, URL and Moodle version will be sent as well, to make the installation process easier for you.';
$string['installfromzip'] = 'Install plugin from ZIP file';
$string['installfromzip_help'] = 'An alternative to installing a plugin directly from the Moodle plugins directory is to upload a ZIP package of the plugin. The ZIP package should have the same structure as a package downloaded from the Moodle plugins directory.';
$string['installfromzipfile'] = 'ZIP package';
$string['installfromzipfile_help'] = 'The plugin ZIP package must contain just one directory, named to match the plugin. The ZIP will be extracted into an appropriate location for the plugin type. If the package has been downloaded from the Moodle plugins directory then it will have this structure.';
$string['installfromziprootdir'] = 'Rename the root directory';
$string['installfromziprootdir_help'] = 'Some ZIP packages, such as those generated by Github, may contain an incorrect root directory name. If so, the correct name may be entered here.';
$string['installfromzipsubmit'] = 'Install add-on from the ZIP file';
$string['installfromzipsubmit'] = 'Install plugin from the ZIP file';
$string['installfromziptype'] = 'Plugin type';
$string['installfromziptype_help'] = 'Choose the correct type of plugin you are about to install. Warning: The installation procedure can fail badly if an incorrect plugin type is specified.';
$string['permcheck'] = 'Make sure the plugin type root location is writable by the web server process.';
@@ -49,54 +49,54 @@ $string['permcheckerror'] = 'Error while checking for write permission';
$string['permcheckprogress'] = 'Checking for write permission ...';
$string['permcheckresultno'] = 'Plugin type location <em>{$a->path}</em> is not writable';
$string['permcheckresultyes'] = 'Plugin type location <em>{$a->path}</em> is writable';
$string['pluginname'] = 'Add-on installer';
$string['remoterequestalreadyinstalled'] = 'There is a request to install add-on {$a->name} ({$a->component}) version {$a->version} from the Moodle plugins directory on this site. However, this plugin is <strong>already installed</strong> on the site.';
$string['remoterequestconfirm'] = 'There is a request to install add-on <strong>{$a->name}</strong> ({$a->component}) version {$a->version} from the Moodle plugins directory on this site. If you continue, the add-on ZIP package will be downloaded for validation. Nothing will be installed yet.';
$string['remoterequestinvalid'] = 'There is a request to install an add-on from the Moodle plugins directory on this site. Unfortunately the request is not valid and so the add-on cannot be installed.';
$string['remoterequestpermcheck'] = 'There is a request to install add-on {$a->name} ({$a->component}) version {$a->version} from the Moodle plugins directory on this site. However, the plugin type location <strong>{$a->typepath}</strong> is <strong>not writable</strong>. You need to give write access for the web server user to the plugin type location, then press the continue button to repeat the check.';
$string['remoterequestpluginfoexception'] = 'Oops... An error occurred while trying to obtain information about the add-on {$a->name} ({$a->component}) version {$a->version}. The add-on cannot be installed. Turn debugging mode on to see details of the error.';
$string['validation'] = 'Add-on package validation';
$string['pluginname'] = 'Plugin installer';
$string['remoterequestalreadyinstalled'] = 'There is a request to install plugin {$a->name} ({$a->component}) version {$a->version} from the Moodle plugins directory on this site. However, this plugin is <strong>already installed</strong> on the site.';
$string['remoterequestconfirm'] = 'There is a request to install plugin <strong>{$a->name}</strong> ({$a->component}) version {$a->version} from the Moodle plugins directory on this site. If you continue, the plugin ZIP package will be downloaded for validation. Nothing will be installed yet.';
$string['remoterequestinvalid'] = 'There is a request to install a plugin from the Moodle plugins directory on this site. Unfortunately the request is not valid and so the plugin cannot be installed.';
$string['remoterequestpermcheck'] = 'There is a request to install plugin {$a->name} ({$a->component}) version {$a->version} from the Moodle plugins directory on this site. However, the location <strong>{$a->typepath}</strong> is <strong>not writable</strong>. You need to give write access for the web server user to the location, then press the continue button to repeat the check.';
$string['remoterequestpluginfoexception'] = 'Oops... An error occurred while trying to obtain information about the plugin {$a->name} ({$a->component}) version {$a->version}. The plugin cannot be installed. Turn debugging mode on to see details of the error.';
$string['validation'] = 'Plugin package validation';
$string['validationmsg_componentmatch'] = 'Full component name';
$string['validationmsg_componentmismatchname'] = 'Add-on name mismatch';
$string['validationmsg_componentmismatchname_help'] = 'Some ZIP packages, such as those generated by Github, may contain an incorrect root directory name. You need to fix the name of the root directory to match the declared add-on name.';
$string['validationmsg_componentmismatchname_info'] = 'The add-on declares its name is \'{$a}\' but that does not match the name of the root directory.';
$string['validationmsg_componentmismatchtype'] = 'Add-on type mismatch';
$string['validationmsg_componentmismatchtype_info'] = 'You have selected the type \'{$a->expected}\' but the add-on declares its type is \'{$a->found}\'.';
$string['validationmsg_componentmismatchname'] = 'Plugin name mismatch';
$string['validationmsg_componentmismatchname_help'] = 'Some ZIP packages, such as those generated by Github, may contain an incorrect root directory name. You need to fix the name of the root directory to match the declared plugin name.';
$string['validationmsg_componentmismatchname_info'] = 'The plugin declares its name is \'{$a}\' but that does not match the name of the root directory.';
$string['validationmsg_componentmismatchtype'] = 'Plugin type mismatch';
$string['validationmsg_componentmismatchtype_info'] = 'You have selected the type \'{$a->expected}\' but the plugin declares its type is \'{$a->found}\'.';
$string['validationmsg_filenotexists'] = 'Extracted file not found';
$string['validationmsg_filesnumber'] = 'Not enough files found in the package';
$string['validationmsg_filestatus'] = 'Unable to extract all files';
$string['validationmsg_filestatus_info'] = 'Attempting to extract file {$a->file} resulted in error \'{$a->status}\'.';
$string['validationmsg_maturity'] = 'Declared maturity level';
$string['validationmsg_maturity_help'] = 'The add-on can declare its maturity level. If the maintainer considers the add-on stable, the declared maturity level will read MATURITY_STABLE. All other maturity levels (such as alpha or beta) should be considered unstable and a warning is raised.';
$string['validationmsg_maturity_help'] = 'The plugin can declare its maturity level. If the maintainer considers the plugin stable, the declared maturity level will read MATURITY_STABLE. All other maturity levels (such as alpha or beta) should be considered unstable and a warning is raised.';
$string['validationmsg_missingexpectedlangenfile'] = 'English language file name mismatch';
$string['validationmsg_missingexpectedlangenfile_info'] = 'The given add-on type is missing the expected English language file {$a}.';
$string['validationmsg_missingexpectedlangenfile_info'] = 'The given plugin type is missing the expected English language file {$a}.';
$string['validationmsg_missinglangenfile'] = 'No English language file found';
$string['validationmsg_missinglangenfolder'] = 'Missing English language folder';
$string['validationmsg_missingversion'] = 'Add-on does not declare its version';
$string['validationmsg_missingversion'] = 'Plugin does not declare its version';
$string['validationmsg_missingversionphp'] = 'File version.php not found';
$string['validationmsg_multiplelangenfiles'] = 'Multiple English language files found';
$string['validationmsg_onedir'] = 'Invalid structure of the ZIP package.';
$string['validationmsg_onedir_help'] = 'The ZIP package must contain just one root directory that holds the add-on code. The name of that root directory must match the name of the plugin.';
$string['validationmsg_onedir_help'] = 'The ZIP package must contain just one root directory that holds the plugin code. The name of that root directory must match the name of the plugin.';
$string['validationmsg_pathwritable'] = 'Write access check';
$string['validationmsg_pluginversion'] = 'Add-on version';
$string['validationmsg_release'] = 'Add-on release';
$string['validationmsg_pluginversion'] = 'Plugin version';
$string['validationmsg_release'] = 'Plugin release';
$string['validationmsg_requiresmoodle'] = 'Required Moodle version';
$string['validationmsg_rootdir'] = 'Name of the add-on to be installed';
$string['validationmsg_rootdir_help'] = 'The name of the root directory in the ZIP package forms the name of the add-on to be installed. If the name is not correct, you may wish to rename the root directory in the ZIP prior to installing the add-on.';
$string['validationmsg_rootdirinvalid'] = 'Invalid add-on name';
$string['validationmsg_rootdirinvalid_help'] = 'The name of the root directory in the ZIP package violates formal syntax requirements. Some ZIP packages, such as those generated by Github, may contain an incorrect root directory name. You need to fix the name of the root directory to match the add-on name.';
$string['validationmsg_rootdir'] = 'Name of the plugin to be installed';
$string['validationmsg_rootdir_help'] = 'The name of the root directory in the ZIP package forms the name of the plugin to be installed. If the name is not correct, you may wish to rename the root directory in the ZIP prior to installing the plugin.';
$string['validationmsg_rootdirinvalid'] = 'Invalid plugin name';
$string['validationmsg_rootdirinvalid_help'] = 'The name of the root directory in the ZIP package violates formal syntax requirements. Some ZIP packages, such as those generated by Github, may contain an incorrect root directory name. You need to fix the name of the root directory to match the plugin name.';
$string['validationmsg_targetexists'] = 'Target location already exists';
$string['validationmsg_targetexists_help'] = 'The directory that the add-on is to be installed to, must not exist yet.';
$string['validationmsg_targetexists_help'] = 'The directory that the plugin is to be installed to must not yet exist.';
$string['validationmsg_unknowntype'] = 'Unknown plugin type';
$string['validationmsglevel_debug'] = 'Debug';
$string['validationmsglevel_error'] = 'Error';
$string['validationmsglevel_info'] = 'OK';
$string['validationmsglevel_warning'] = 'Warning';
$string['validationresult0'] = 'Validation failed!';
$string['validationresult0_help'] = 'A serious problem was detected and so it is not safe to install the add-on. See the validation log messages for details.';
$string['validationresult0_help'] = 'A serious problem was detected and so it is not safe to install the plugin. See the validation log messages for details.';
$string['validationresult1'] = 'Validation passed!';
$string['validationresult1_help'] = 'No serious problems were detected. You can continue with the add-on installation. See the validation log messages for more details and eventual warnings.';
$string['validationresult1_help'] = 'The add-on package has been validated and no serious problems were detected.';
$string['validationresult2_help'] = 'No serious problems were detected. You can continue with the plugin installation. See the validation log messages for more details and eventual warnings.';
$string['validationresult1_help'] = 'The plugin package has been validated and no serious problems were detected.';
$string['validationresultinfo'] = 'Info';
$string['validationresultmsg'] = 'Message';
$string['validationresultstatus'] = 'Status';
@@ -72,7 +72,7 @@ trait buffered_writer {
$entry['other'] = serialize($entry['other']);
$entry['origin'] = $PAGE->requestorigin;
$entry['ip'] = $PAGE->requestip;
$entry['realuserid'] = \core\session\manager::is_loggedinas() ? $_SESSION['USER']->realuser : null;
$entry['realuserid'] = \core\session\manager::is_loggedinas() ? $GLOBALS['USER']->realuser : null;
$this->buffer[] = $entry;
$this->count++;
+3
View File
@@ -43,5 +43,8 @@ function xmldb_tool_log_upgrade($oldversion) {
upgrade_plugin_savepoint(true, 2014040600, 'tool', 'log');
}
// Moodle v2.7.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+1 -1
View File
@@ -23,7 +23,7 @@
*/
$string['actlogshdr'] = 'Available log stores';
$string['configlogplugins'] = 'Please enable all required plugins and arrange then in appropriate order.';
$string['configlogplugins'] = 'Please enable all required plugins and arrange them in appropriate order.';
$string['logging'] = 'Logging';
$string['managelogging'] = 'Manage log stores';
$string['reportssupported'] = 'Reports supported';
@@ -33,5 +33,8 @@ function xmldb_logstore_database_upgrade($oldversion) {
upgrade_plugin_savepoint(true, 2014041700, 'logstore', 'database');
}
// Moodle v2.7.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
@@ -130,8 +130,7 @@ class logstore_database_store_testcase extends advanced_testcase {
array('context' => context_module::instance($module2->cmid), 'other' => array('sample' => 6, 'xx' => 9)));
$event2->trigger();
$_SESSION['SESSION'] = new \stdClass();
$this->setUser(0);
\core\session\manager::init_empty_session();
$this->assertFalse(\core\session\manager::is_loggedinas());
$logs = $DB->get_records('logstore_standard_log', array(), 'id ASC');
@@ -185,6 +185,11 @@ class store implements \tool_log\log\store, \core\log\sql_select_reader {
// database so that it doesn't cause a DB error. Log a warning so that
// developers can avoid doing things which are likely to cause this on a
// routine basis.
if (\core_text::strlen($action) > 40) {
$action = \core_text::substr($action, 0, 37) . '...';
debugging('Warning: logged very long action', DEBUG_DEVELOPER);
}
if (!empty($info) && \core_text::strlen($info) > 255) {
$info = \core_text::substr($info, 0, 252) . '...';
debugging('Warning: logged very long info', DEBUG_DEVELOPER);
@@ -111,5 +111,8 @@ function xmldb_logstore_standard_upgrade($oldversion) {
upgrade_plugin_savepoint(true, 2014041500, 'logstore', 'standard');
}
// Moodle v2.7.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
@@ -95,8 +95,7 @@ class logstore_standard_store_testcase extends advanced_testcase {
$event2->trigger();
logstore_standard_restore::hack_executing(0);
$_SESSION['SESSION'] = new \stdClass();
$this->setUser(0);
\core\session\manager::init_empty_session();
$this->assertFalse(\core\session\manager::is_loggedinas());
$logs = $DB->get_records('logstore_standard_log', array(), 'id ASC');
+2 -2
View File
@@ -104,11 +104,11 @@ if ($mform && ($mform->is_cancelled() || !empty($CFG->preventscheduledtaskchange
} else {
echo $OUTPUT->header();
$error = optional_param('error', '', PARAM_RAW);
$error = optional_param('error', '', PARAM_NOTAGS);
if ($error) {
echo $OUTPUT->notification($error, 'notifyerror');
}
$success = optional_param('success', '', PARAM_RAW);
$success = optional_param('success', '', PARAM_NOTAGS);
if ($success) {
echo $OUTPUT->notification($success, 'notifysuccess');
}
@@ -875,7 +875,6 @@ class tool_uploadcourse_course {
$resetdata = new stdClass();
$resetdata->id = $course->id;
$resetdata->reset_start_date = time();
$resetdata->reset_logs = true;
$resetdata->reset_events = true;
$resetdata->reset_notes = true;
$resetdata->delete_blog_associations = true;
+8 -2
View File
@@ -669,7 +669,7 @@ if ($formdata = $mform2->is_cancelled()) {
if ($doupdate or $existinguser->password !== $oldpw) {
// We want only users that were really updated.
user_update_user($existinguser, false);
user_update_user($existinguser, false, false);
$upt->track('status', $struserupdated);
$usersupdated++;
@@ -687,6 +687,9 @@ if ($formdata = $mform2->is_cancelled()) {
}
}
// Trigger event.
\core\event\user_updated::create_from_userid($existinguser->id)->trigger();
} else {
// no user information changed
$upt->track('status', $struseruptodate);
@@ -800,7 +803,7 @@ if ($formdata = $mform2->is_cancelled()) {
$upt->track('password', '-', 'normal', false);
}
$user->id = user_create_user($user, false);
$user->id = user_create_user($user, false, false);
$upt->track('username', html_writer::link(new moodle_url('/user/profile.php', array('id'=>$user->id)), s($user->username)), 'normal', false);
// pre-process custom profile menu fields data from csv file
@@ -815,6 +818,9 @@ if ($formdata = $mform2->is_cancelled()) {
set_user_preference('create_password', 1, $user);
}
// Trigger event.
\core\event\user_created::create_from_userid($user->id)->trigger();
$upt->track('status', $struseradded);
$upt->track('id', $user->id, 'normal', false);
$usersnew++;
+18 -3
View File
@@ -167,12 +167,27 @@ class auth_plugin_cas extends auth_plugin_ldap {
*
*/
function prelogout_hook() {
global $CFG;
global $CFG, $USER, $DB;
if (!empty($this->config->logoutcas)) {
if (!empty($this->config->logoutcas) && $USER->auth == $this->authtype) {
$backurl = $CFG->wwwroot;
$this->connectCAS();
phpCAS::logoutWithURL($backurl);
// Note: Hack to stable versions to trigger the event before it redirect to CAS logout.
$sid = session_id();
$event = \core\event\user_loggedout::create(
array(
'userid' => $USER->id,
'objectid' => $USER->id,
'other' => array('sessionid' => $sid),
)
);
if ($session = $DB->get_record('sessions', array('sid' => $sid))) {
$event->add_record_snapshot('sessions', $session);
}
\core\session\manager::terminate_current();
$event->trigger();
phpCAS::logoutWithRedirectService($backurl);
}
}
+3
View File
@@ -52,5 +52,8 @@ function xmldb_auth_cas_upgrade($oldversion) {
// Moodle v2.6.0 release upgrade line.
// Put any upgrade step following this.
// Moodle v2.7.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+11
View File
@@ -384,6 +384,10 @@ class auth_plugin_db extends auth_plugin_base {
if ($old_user = $DB->get_record('user', array('username'=>$username, 'deleted'=>0, 'suspended'=>1, 'mnethostid'=>$CFG->mnet_localhost_id, 'auth'=>$this->authtype))) {
$DB->set_field('user', 'suspended', 0, array('id'=>$old_user->id));
$trace->output(get_string('auth_dbreviveduser', 'auth_db', array('name'=>$username, 'id'=>$old_user->id)), 1);
// Trigger user_updated event.
\core\event\user_updated::create_from_userid($old_user->id)->trigger();
continue;
}
}
@@ -410,6 +414,10 @@ class auth_plugin_db extends auth_plugin_base {
}
try {
$id = $DB->insert_record ('user', $user); // it is truly a new user
// Trigger user_created event.
\core\event\user_created::create_from_userid($id)->trigger();
$trace->output(get_string('auth_dbinsertuser', 'auth_db', array('name'=>$user->username, 'id'=>$id)), 1);
} catch (moodle_exception $e) {
$trace->output(get_string('auth_dbinsertusererror', 'auth_db', $user->username), 1);
@@ -547,6 +555,9 @@ class auth_plugin_db extends auth_plugin_base {
}
if ($updated) {
$DB->set_field('user', 'timemodified', time(), array('id'=>$userid));
// Trigger user_updated event.
\core\event\user_updated::create_from_userid($userid)->trigger();
}
return $DB->get_record('user', array('id'=>$userid, 'deleted'=>0));
}
+1 -1
View File
@@ -31,7 +31,7 @@ class auth_db_testcase extends advanced_testcase {
/** @var string Original error log */
protected $oldlog;
protected function init_auth_database() {
public function init_auth_database() {
global $DB, $CFG;
require_once("$CFG->dirroot/auth/db/auth.php");
+150
View File
@@ -0,0 +1,150 @@
<?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/>.
/**
* Events tests.
*
* @package auth_db
* @category test
* @copyright 2014 Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
global $CFG;
require_once($CFG->dirroot . '/auth/db/tests/db_test.php');
class auth_db_events_testcase extends advanced_testcase {
/**
* Test set up.
*/
public function setUp() {
$this->resetAfterTest(true);
}
/**
* Tests that the locations in the auth_db API that create a user trigger the user_created event.
*/
public function test_user_created() {
global $DB;
$this->preventResetByRollback();
// Initialise the database.
$authdbtestcase = new auth_db_testcase();
$authdbtestcase->init_auth_database();
$auth = get_auth_plugin('db');
$auth->db_init();
// Add a user to the auth_db_users table - we will then call sync_users to
// deal with the record here. In this case it will create the user.
$user = new stdClass();
$user->name = 'mark';
$user->pass = 'password123';
$user->email = 'what@legend.com';
$user->id = $DB->insert_record('auth_db_users', $user);
// Run sync_users and capture the user_created event.
$sink = $this->redirectEvents();
$trace = new null_progress_trace();
$auth->sync_users($trace, false);
$events = $sink->get_events();
$sink->close();
// Check that there is only one event.
$this->assertEquals(1, count($events));
// Get the event.
$event = array_pop($events);
// Test that the user created event was triggered - no need to test the other
// details of the event as that is done extensively in other unit tests.
$this->assertInstanceOf('\core\event\user_created', $event);
}
/**
* Tests that the locations in the auth_db API that update a user trigger the user_updated event.
*/
public function test_user_updated() {
global $CFG, $DB;
$this->preventResetByRollback();
// Initialise the database.
$authdbtestcase = new auth_db_testcase();
$authdbtestcase->init_auth_database();
$auth = get_auth_plugin('db');
$auth->db_init();
// Add a suspended user.
$user = array();
$user['username'] = 'mark';
$user['suspended'] = '1';
$user['mnethostid'] = $CFG->mnet_localhost_id;
$user['auth'] = 'db';
$this->getDataGenerator()->create_user($user);
// Add a user to the auth_db_users table - we will then call sync_users to
// deal with the record here. In this case it will un-suspend the user.
$user = new stdClass();
$user->name = 'mark';
$user->pass = 'password123';
$user->email = 'what@legend.com';
$user->id = $DB->insert_record('auth_db_users', $user);
// Set the config to remove the suspension on the user.
set_config('removeuser', AUTH_REMOVEUSER_SUSPEND, 'auth/db');
$auth->config->removeuser = AUTH_REMOVEUSER_SUSPEND;
// Run sync_users and capture the user_updated event.
$sink = $this->redirectEvents();
$trace = new null_progress_trace();
$auth->sync_users($trace, false);
$events = $sink->get_events();
$sink->close();
// Check that there is only one event.
$this->assertEquals(1, count($events));
// Get the event.
$event = array_pop($events);
// Test that the user updated event was triggered - no need to test the other
// details of the event as that is done extensively in other unit tests.
$this->assertInstanceOf('\core\event\user_updated', $event);
// Run sync_users and capture the user_updated event.
$sink = $this->redirectEvents();
$auth->update_user_record('mark');
$events = $sink->get_events();
$sink->close();
// Check that there is only one event.
$this->assertEquals(1, count($events));
// Get the event.
$event = array_pop($events);
// Test that the user updated event was triggered - no need to test the other
// details of the event as that is done extensively in other unit tests.
$this->assertInstanceOf('\core\event\user_updated', $event);
}
}
+4 -1
View File
@@ -94,11 +94,14 @@ class auth_plugin_email extends auth_plugin_base {
$user->calendartype = $CFG->calendartype;
}
$user->id = user_create_user($user, false);
$user->id = user_create_user($user, false, false);
// Save any custom profile field information.
profile_save_data($user);
// Trigger event.
\core\event\user_created::create_from_userid($user->id)->trigger();
if (! send_confirmation_email($user)) {
print_error('auth_emailnoemail','auth_email');
}
+4 -2
View File
@@ -551,7 +551,7 @@ class auth_plugin_ldap extends auth_plugin_base {
print_error('auth_ldap_create_error', 'auth_ldap');
}
$user->id = user_create_user($user, false);
$user->id = user_create_user($user, false, false);
// Save any custom profile field information
profile_save_data($user);
@@ -564,6 +564,8 @@ class auth_plugin_ldap extends auth_plugin_base {
$user = $DB->get_record('user', array('id'=>$user->id));
\core\event\user_created::create_from_userid($user->id)->trigger();
if (! send_confirmation_email($user)) {
print_error('noemail', 'auth_ldap');
}
@@ -1027,7 +1029,7 @@ class auth_plugin_ldap extends auth_plugin_base {
}
}
}
user_update_user($newuser, false);
user_update_user($newuser, false, false);
}
} else {
return false;
+3
View File
@@ -42,5 +42,8 @@ function xmldb_auth_ldap_upgrade($oldversion) {
// Moodle v2.6.0 release upgrade line.
// Put any upgrade step following this.
// Moodle v2.7.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+137
View File
@@ -279,6 +279,143 @@ class auth_ldap_plugin_testcase extends advanced_testcase {
$this->assertEventLegacyLogData($expectedlog, $event);
}
/**
* Test logging in via LDAP calls a user_loggedin event.
*/
public function test_ldap_user_signup() {
global $CFG, $DB;
// User to create.
$user = array(
'username' => 'usersignuptest1',
'password' => 'Moodle2014!',
'idnumber' => 'idsignuptest1',
'firstname' => 'First Name User Test 1',
'lastname' => 'Last Name User Test 1',
'middlename' => 'Middle Name User Test 1',
'lastnamephonetic' => '最後のお名前のテスト一号',
'firstnamephonetic' => 'お名前のテスト一号',
'alternatename' => 'Alternate Name User Test 1',
'email' => 'usersignuptest1@email.com',
'description' => 'This is a description for user 1',
'city' => 'Perth',
'country' => 'au',
'mnethostid' => $CFG->mnet_localhost_id,
'auth' => 'ldap'
);
if (!extension_loaded('ldap')) {
$this->markTestSkipped('LDAP extension is not loaded.');
}
$this->resetAfterTest();
require_once($CFG->dirroot.'/auth/ldap/auth.php');
require_once($CFG->libdir.'/ldaplib.php');
if (!defined('TEST_AUTH_LDAP_HOST_URL') or !defined('TEST_AUTH_LDAP_BIND_DN') or !defined('TEST_AUTH_LDAP_BIND_PW') or !defined('TEST_AUTH_LDAP_DOMAIN')) {
$this->markTestSkipped('External LDAP test server not configured.');
}
// Make sure we can connect the server.
$debuginfo = '';
if (!$connection = ldap_connect_moodle(TEST_AUTH_LDAP_HOST_URL, 3, 'rfc2307', TEST_AUTH_LDAP_BIND_DN, TEST_AUTH_LDAP_BIND_PW, LDAP_DEREF_NEVER, $debuginfo, false)) {
$this->markTestSkipped('Can not connect to LDAP test server: '.$debuginfo);
}
$this->enable_plugin();
// Create new empty test container.
$topdn = 'dc=moodletest,'.TEST_AUTH_LDAP_DOMAIN;
$this->recursive_delete($connection, TEST_AUTH_LDAP_DOMAIN, 'dc=moodletest');
$o = array();
$o['objectClass'] = array('dcObject', 'organizationalUnit');
$o['dc'] = 'moodletest';
$o['ou'] = 'MOODLETEST';
if (!ldap_add($connection, 'dc=moodletest,'.TEST_AUTH_LDAP_DOMAIN, $o)) {
$this->markTestSkipped('Can not create test LDAP container.');
}
// Create a few users.
$o = array();
$o['objectClass'] = array('organizationalUnit');
$o['ou'] = 'users';
ldap_add($connection, 'ou='.$o['ou'].','.$topdn, $o);
// Configure the plugin a bit.
set_config('host_url', TEST_AUTH_LDAP_HOST_URL, 'auth/ldap');
set_config('start_tls', 0, 'auth/ldap');
set_config('ldap_version', 3, 'auth/ldap');
set_config('ldapencoding', 'utf-8', 'auth/ldap');
set_config('pagesize', '2', 'auth/ldap');
set_config('bind_dn', TEST_AUTH_LDAP_BIND_DN, 'auth/ldap');
set_config('bind_pw', TEST_AUTH_LDAP_BIND_PW, 'auth/ldap');
set_config('user_type', 'rfc2307', 'auth/ldap');
set_config('contexts', 'ou=users,'.$topdn, 'auth/ldap');
set_config('search_sub', 0, 'auth/ldap');
set_config('opt_deref', LDAP_DEREF_NEVER, 'auth/ldap');
set_config('user_attribute', 'cn', 'auth/ldap');
set_config('memberattribute', 'memberuid', 'auth/ldap');
set_config('memberattribute_isdn', 0, 'auth/ldap');
set_config('creators', 'cn=creators,'.$topdn, 'auth/ldap');
set_config('removeuser', AUTH_REMOVEUSER_KEEP, 'auth/ldap');
set_config('field_map_email', 'mail', 'auth/ldap');
set_config('field_updatelocal_email', 'oncreate', 'auth/ldap');
set_config('field_updateremote_email', '0', 'auth/ldap');
set_config('field_lock_email', 'unlocked', 'auth/ldap');
set_config('field_map_firstname', 'givenName', 'auth/ldap');
set_config('field_updatelocal_firstname', 'oncreate', 'auth/ldap');
set_config('field_updateremote_firstname', '0', 'auth/ldap');
set_config('field_lock_firstname', 'unlocked', 'auth/ldap');
set_config('field_map_lastname', 'sn', 'auth/ldap');
set_config('field_updatelocal_lastname', 'oncreate', 'auth/ldap');
set_config('field_updateremote_lastname', '0', 'auth/ldap');
set_config('field_lock_lastname', 'unlocked', 'auth/ldap');
set_config('passtype', 'md5', 'auth/ldap');
set_config('create_context', 'ou=users,'.$topdn, 'auth/ldap');
$this->assertEquals(2, $DB->count_records('user'));
$this->assertEquals(0, $DB->count_records('role_assignments'));
/** @var auth_plugin_ldap $auth */
$auth = get_auth_plugin('ldap');
$sink = $this->redirectEvents();
$auth->user_signup((object)$user, false);
$this->assertDebuggingCalled('Not sending email due to $CFG->noemailever config setting');
$events = $sink->get_events();
$sink->close();
// Verify 2 events get generated.
$this->assertCount(2, $events);
// Get record from db.
$dbuser = $DB->get_record('user', array('username' => $user['username']));
$user['id'] = $dbuser->id;
// Last event is user_created.
$event = array_pop($events);
$this->assertInstanceOf('\core\event\user_created', $event);
$this->assertEquals($user['id'], $event->objectid);
$this->assertEquals('user_created', $event->get_legacy_eventname());
$this->assertEquals(context_user::instance($user['id']), $event->get_context());
$expectedlogdata = array(SITEID, 'user', 'add', '/view.php?id='.$event->objectid, fullname($dbuser));
$this->assertEventLegacyLogData($expectedlogdata, $event);
// First event is user_password_updated.
$event = array_pop($events);
$this->assertInstanceOf('\core\event\user_password_updated', $event);
$this->assertEventContextNotUsed($event);
// Delete user which we just created.
ldap_delete($connection, 'cn='.$user['username'].',ou=users,'.$topdn);
}
protected function create_ldap_user($connection, $topdn, $i) {
$o = array();
$o['objectClass'] = array('inetOrgPerson', 'organizationalPerson', 'person', 'posixAccount');
+3
View File
@@ -47,5 +47,8 @@ function xmldb_auth_manual_upgrade($oldversion) {
// Moodle v2.6.0 release upgrade line.
// Put any upgrade step following this.
// Moodle v2.7.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+1 -1
View File
@@ -17,7 +17,7 @@
/**
* This file contains the mnet services for the mnet authentication plugin
*
* @since 2.0
* @since Moodle 2.0
* @package auth_mnet
* @copyright 2010 Penny Leach
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+3
View File
@@ -47,5 +47,8 @@ function xmldb_auth_mnet_upgrade($oldversion) {
// Moodle v2.6.0 release upgrade line.
// Put any upgrade step following this.
// Moodle v2.7.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+7 -3
View File
@@ -40,9 +40,13 @@
if (!empty($_SERVER[$pluginconfig->user_attribute])) { // Shibboleth auto-login
$frm = new stdClass();
$frm->username = strtolower($_SERVER[$pluginconfig->user_attribute]);
$frm->password = substr(base64_encode($_SERVER[$pluginconfig->user_attribute]),0,8);
// The random password consists of the first 8 letters of the base 64 encoded user ID
// This password is never used unless the user account is converted to manual
// The password is never actually used, but needs to be passed to the functions 'user_login' and
// 'authenticate_user_login'. Shibboleth returns true for the function 'prevent_local_password', which is
// used when setting the password in 'update_internal_user_password'. When 'prevent_local_password'
// returns true, the password is set to 'not cached' (AUTH_PASSWORD_NOT_CACHED) in the Moodle DB. However,
// rather than setting the password to a hard-coded value, we will generate one each time, in case there are
// changes to the Shibboleth plugin and it is actually used.
$frm->password = generate_password(8);
/// Check if the user has actually submitted login data to us
+1 -1
View File
@@ -180,7 +180,7 @@ abstract class condition extends tree_node {
*
* Default implementation returns false.
*
* @param stdClass $course Moodle course object
* @param \stdClass $course Moodle course object
* @param int $cmid ID of activity whose completion value is considered
* @return boolean True if the availability of something else may rely on it
*/
+3 -3
View File
@@ -46,7 +46,7 @@ abstract class frontend {
*
* Default returns true.
*
* @param stdClass $course Course object
* @param \stdClass $course Course object
* @param \cm_info $cm Course-module currently being edited (null if none)
* @param \section_info $section Section currently being edited (null if none)
*/
@@ -73,7 +73,7 @@ abstract class frontend {
*
* Default returns no parameters.
*
* @param stdClass $course Course object
* @param \stdClass $course Course object
* @param \cm_info $cm Course-module currently being edited (null if none)
* @param \section_info $section Section currently being edited (null if none)
* @return array Array of parameters for the JavaScript function
@@ -95,7 +95,7 @@ abstract class frontend {
/**
* Includes JavaScript for the main system and all plugins.
*
* @param stdClass $course Course object
* @param \stdClass $course Course object
* @param \cm_info $cm Course-module currently being edited (null if none)
* @param \section_info $section Section currently being edited (null if none)
*/
+13 -13
View File
@@ -34,7 +34,7 @@ defined('MOODLE_INTERNAL') || die();
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
abstract class info {
/** @var stdClass Course */
/** @var \stdClass Course */
protected $course;
/** @var \course_modinfo Modinfo (available only during some functions) */
@@ -52,10 +52,10 @@ abstract class info {
/**
* Constructs with item details.
*
* @param stdClass $course Course object
* @param \stdClass $course Course object
* @param int $visible Value of visible flag (eye icon)
* @param string $availability Availability definition (JSON format) or null
* @throws coding_exception If data is not valid JSON format
* @throws \coding_exception If data is not valid JSON format
*/
public function __construct($course, $visible, $availability) {
// Set basic values.
@@ -67,7 +67,7 @@ abstract class info {
/**
* Obtains the course associated with this availability information.
*
* @return stdClass Moodle course object
* @return \stdClass Moodle course object
*/
public function get_course() {
return $this->course;
@@ -128,7 +128,7 @@ abstract class info {
* @param string $availability Availability string in JSON format
* @param boolean $lax If true, throw exceptions only for invalid structure
* @return tree Availability tree
* @throws coding_exception If data is not valid JSON format
* @throws \coding_exception If data is not valid JSON format
*/
protected function decode_availability($availability, $lax) {
// Decode JSON data.
@@ -306,7 +306,7 @@ abstract class info {
*
* @param string $restoreid Restore identifier
* @param int $courseid Target course id
* @param base_logger $logger Logger for any warnings
* @param \base_logger $logger Logger for any warnings
*/
public function update_after_restore($restoreid, $courseid, \base_logger $logger) {
$tree = $this->get_availability_tree();
@@ -342,7 +342,7 @@ abstract class info {
* function does that for the conditional availability data for all
* modules and sections on the course.
*
* @param int|stdClass $courseorid Course id or object
* @param int|\stdClass $courseorid Course id or object
* @param string $table Table name e.g. 'course_modules'
* @param int $oldid Previous ID
* @param int $newid New ID
@@ -407,7 +407,7 @@ abstract class info {
* groupmembersonly field for modules. This is off by default because
* we are not yet moving the groupmembersonly option into this new API.
*
* @param stdClass $rec Object possibly containing legacy fields
* @param \stdClass $rec Object possibly containing legacy fields
* @param bool $section True if this is a section
* @param bool $modgroupmembersonly True if groupmembersonly is converted for mods
* @return string|null New availability value or null if none
@@ -468,7 +468,7 @@ abstract class info {
* that it has an AND tree with one or more conditions.
*
* @param string|null $availability Current availability conditions
* @param stdClass $rec Object containing information from old table
* @param \stdClass $rec Object containing information from old table
* @param bool $show True if 'show' option should be enabled
* @return string New availability conditions
*/
@@ -501,7 +501,7 @@ abstract class info {
* that it has an AND tree with one or more conditions.
*
* @param string|null $availability Current availability conditions
* @param stdClass $rec Object containing information from old table
* @param \stdClass $rec Object containing information from old table
* @param bool $show True if 'show' option should be enabled
* @return string New availability conditions
*/
@@ -598,8 +598,8 @@ abstract class info {
* object.
*
* @param string $info Info string
* @param int|stdClass $courseorid
* @return Correctly formatted info string
* @param int|\stdClass $courseorid
* @return string Correctly formatted info string
*/
public static function format_info($info, $courseorid) {
// Don't waste time if there are no special tags.
@@ -624,7 +624,7 @@ abstract class info {
* JS (using the non-JS version instead, which causes a page reload) if a
* completion tickbox value may affect a conditional activity.
*
* @param stdClass $course Moodle course object
* @param \stdClass $course Moodle course object
* @param int $cmid Course-module id
* @return bool True if this is used in a condition, false otherwise
*/
+3 -3
View File
@@ -63,7 +63,7 @@ class info_module extends info {
/**
* Gets the course-module object. Intended for use by conditions.
*
* @return cm_info Course module
* @return \cm_info Course module
*/
public function get_course_module() {
return $this->cm;
@@ -130,11 +130,11 @@ class info_module extends info {
* disabled, and you supply a $cm object with necessary fields, and you
* don't check course access.
*
* @param int|stdClass|cm_info $cmorid Object or id representing activity
* @param int|\stdClass|\cm_info $cmorid Object or id representing activity
* @param int $userid User id (0 = current user)
* @param bool $checkcourse If true, checks whether the user has course access
* @return bool True if the activity is visible to the specified user
* @throws moodle_exception If the cmid doesn't exist
* @throws \moodle_exception If the cmid doesn't exist
*/
public static function is_user_visible($cmorid, $userid = 0, $checkcourse = true) {
global $USER, $DB, $CFG;
+1 -1
View File
@@ -65,7 +65,7 @@ class info_section extends info {
/**
* Gets the section object. Intended for use by conditions.
*
* @return section_info Section
* @return \section_info Section
*/
public function get_section() {
return $this->section;
+8 -8
View File
@@ -128,11 +128,11 @@ class tree extends tree_node {
* coding_exception (if $lax is false).
*
* @see decode_availability
* @param stdClass $structure Structure (decoded from JSON)
* @param \stdClass $structure Structure (decoded from JSON)
* @param boolean $lax If true, throw exceptions only for invalid structure
* @param boolean $root If true, this is the root tree
* @return tree Availability tree
* @throws coding_exception If data is not valid structure
* @throws \coding_exception If data is not valid structure
*/
public function __construct($structure, $lax = false, $root = true) {
$this->root = $root;
@@ -389,12 +389,12 @@ class tree extends tree_node {
* for display to staff.
*
* @param info $info Information about location of condition tree
* @throws coding_exception If you call on a non-root tree
* @throws \coding_exception If you call on a non-root tree
* @return string HTML data (empty string if none)
*/
public function get_full_information(info $info) {
if (!$this->root) {
throw new coding_exception('Only supported on root item');
throw new \coding_exception('Only supported on root item');
}
return $this->get_full_information_recursive(false, $info, null, true);
}
@@ -406,12 +406,12 @@ class tree extends tree_node {
*
* @param info $info Information about location of condition tree
* @param result $result Result object
* @throws coding_exception If you call on a non-root tree
* @throws \coding_exception If you call on a non-root tree
* @return string HTML data (empty string if none)
*/
public function get_result_information(info $info, result $result) {
if (!$this->root) {
throw new coding_exception('Only supported on root item');
throw new \coding_exception('Only supported on root item');
}
return $this->get_full_information_recursive(false, $info, $result, true);
}
@@ -530,7 +530,7 @@ class tree extends tree_node {
$negative = true;
break;
default:
throw new coding_exception('Unknown operator');
throw new \coding_exception('Unknown operator');
}
switch($this->op) {
case self::OP_AND:
@@ -542,7 +542,7 @@ class tree extends tree_node {
$andoperator = false;
break;
default:
throw new coding_exception('Unknown operator');
throw new \coding_exception('Unknown operator');
}
// Select NOT (or not) for children. It flips if this is a 'not' group.
+3 -3
View File
@@ -78,7 +78,7 @@ abstract class tree_node {
/**
* Saves tree data back to a structure object.
*
* @return stdClass Structure object (ready to be made into JSON format)
* @return \stdClass Structure object (ready to be made into JSON format)
*/
public abstract function save();
@@ -152,11 +152,11 @@ abstract class tree_node {
* @param \core_availability\info $info Item we're checking
* @param capability_checker $checker
* @return array Filtered version of input array
* @throws coding_exception If called on a condition that doesn't apply to user lists
* @throws \coding_exception If called on a condition that doesn't apply to user lists
*/
public function filter_user_list(array $users, $not,
\core_availability\info $info, capability_checker $checker) {
throw new coding_exception('Not implemented (do not call unless '.
throw new \coding_exception('Not implemented (do not call unless '.
'is_applied_to_user_lists is true)');
}
}
@@ -48,8 +48,8 @@ class condition extends \core_availability\condition {
/**
* Constructor.
*
* @param stdClass $structure Data structure from JSON decode
* @throws coding_exception If invalid data structure.
* @param \stdClass $structure Data structure from JSON decode
* @throws \coding_exception If invalid data structure.
*/
public function __construct($structure) {
// Get cmid.
@@ -212,7 +212,7 @@ class condition extends \core_availability\condition {
* Used in course/lib.php because we need to disable the completion JS if
* a completion value affects a conditional activity.
*
* @param stdClass $course Moodle course object
* @param \stdClass $course Moodle course object
* @param int $cmid Course-module id
* @return bool True if this is used in a condition, false otherwise
*/
@@ -52,8 +52,8 @@ class condition extends \core_availability\condition {
/**
* Constructor.
*
* @param stdClass $structure Data structure from JSON decode
* @throws coding_exception If invalid data structure.
* @param \stdClass $structure Data structure from JSON decode
* @throws \coding_exception If invalid data structure.
*/
public function __construct($structure) {
// Get direction.
@@ -74,7 +74,7 @@ class frontend extends \core_availability\frontend {
* Given a timestamp, obtains corresponding field values.
*
* @param int $time Timestamp
* @return stdClass Object with fields for year, month, day, hour, minute
* @return \stdClass Object with fields for year, month, day, hour, minute
*/
public static function get_fields_from_time($time) {
$calendartype = \core_calendar\type_factory::get_calendar_instance();
@@ -46,8 +46,8 @@ class condition extends \core_availability\condition {
/**
* Constructor.
*
* @param stdClass $structure Data structure from JSON decode
* @throws coding_exception If invalid data structure.
* @param \stdClass $structure Data structure from JSON decode
* @throws \coding_exception If invalid data structure.
*/
public function __construct($structure) {
// Get grade item id.
@@ -43,8 +43,8 @@ class condition extends \core_availability\condition {
/**
* Constructor.
*
* @param stdClass $structure Data structure from JSON decode
* @throws coding_exception If invalid data structure.
* @param \stdClass $structure Data structure from JSON decode
* @throws \coding_exception If invalid data structure.
*/
public function __construct($structure) {
// Get group id.
@@ -46,8 +46,8 @@ class condition extends \core_availability\condition {
/**
* Constructor.
*
* @param stdClass $structure Data structure from JSON decode
* @throws coding_exception If invalid data structure.
* @param \stdClass $structure Data structure from JSON decode
* @throws \coding_exception If invalid data structure.
*/
public function __construct($structure) {
// Get grouping id.
@@ -73,8 +73,8 @@ class condition extends \core_availability\condition {
/**
* Constructor.
*
* @param stdClass $structure Data structure from JSON decode
* @throws coding_exception If invalid data structure.
* @param \stdClass $structure Data structure from JSON decode
* @throws \coding_exception If invalid data structure.
*/
public function __construct($structure) {
// Get operator.
@@ -292,14 +292,23 @@ class condition extends \core_availability\condition {
* Gets data about custom profile fields. Cached statically in current
* request.
*
* This only includes fields which can be tested by the system (those whose
* data is cached in $USER object) - basically doesn't include textarea type
* fields.
*
* @return array Array of records indexed by shortname
*/
public static function get_custom_profile_fields() {
global $DB;
global $DB, $CFG;
if (self::$customprofilefields === null) {
self::$customprofilefields = $DB->get_records('user_info_field', null,
'id ASC', 'shortname, id, name, defaultdata');
// Get fields and store them indexed by shortname.
require_once($CFG->dirroot . '/user/profile/lib.php');
$fields = profile_get_custom_fields(true);
self::$customprofilefields = array();
foreach ($fields as $field) {
self::$customprofilefields[$field->shortname] = $field;
}
}
return self::$customprofilefields;
}
@@ -64,3 +64,52 @@ Feature: availability_profile
# I see P1 but not P2.
Then I should see "P1" in the "region-main" "region"
And I should not see "P2" in the "region-main" "region"
@javascript
Scenario: Test with custom user profile field
# Add custom field.
Given I log in as "admin"
And I navigate to "User profile fields" node in "Site administration > Users > Accounts"
And I set the field "datatype" to "Text input"
And I set the following fields to these values:
| Short name | superfield |
| Name | Super field |
And I click on "Save changes" "button"
# Set field value for user.
And I navigate to "Browse list of users" node in "Site administration > Users > Accounts"
And I click on "a[title=Edit]" "css_element" in the "s@example.org" "table_row"
And I expand all fieldsets
And I set the field "Super field" to "Bananaman"
And I click on "Update profile" "button"
# Set Page activity which has requirement on this field.
And I am on homepage
And I follow "Course 1"
And I turn editing mode on
And I add a "Page" to section "1"
And I set the following fields to these values:
| Name | P1 |
| Description | x |
| Page content | x |
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "User profile" "button"
And I set the following fields to these values:
| User profile field | Super field |
| Value to compare against | Bananaman |
And I click on ".availability-item .availability-eye img" "css_element"
And I click on "Save and return to course" "button"
# Edit it again and check the setting still works.
When I follow "P1"
And I navigate to "Edit settings" node in "Page module administration"
And I expand all fieldsets
Then the field "User profile field" matches value "Super field"
And the field "Value to compare against" matches value "Bananaman"
# Log out and back in as student. Should be able to see activity.
And I log out
And I log in as "student1"
And I follow "Course 1"
Then I should see "P1" in the "region-main" "region"
@@ -317,6 +317,29 @@ class availability_profile_condition_testcase extends advanced_testcase {
$this->assertTrue($cond->is_available(false, $info, true, $user->id));
}
/**
* Tests what happens with custom fields that are text areas. These should
* not be offered in the menu because their data is not included in user
* object
*/
public function test_custom_textarea_field() {
global $USER, $SITE, $DB;
$this->setAdminUser();
$info = new \core_availability\mock_info();
// Add custom textarea type.
$DB->insert_record('user_info_field', array(
'shortname' => 'longtext', 'name' => 'Long text', 'categoryid' => 1,
'datatype' => 'textarea'));
$customfield = $DB->get_record('user_info_field',
array('shortname' => 'longtext'));
// The list of fields should include the text field added in setUp(),
// but should not include the textarea field added just now.
$fields = condition::get_custom_profile_fields();
$this->assertEquals(array('frogtype'), array_keys($fields));
}
/**
* Sets the custom profile field used for testing.
*
@@ -68,7 +68,7 @@ M.availability_profile.form.getNode = function(json) {
node.one('select[name=field] > option[value=sf_' + json.sf + ']')) {
node.one('select[name=field]').set('value', 'sf_' + json.sf);
} else if (json.cf !== undefined &&
node.one('select[name=field] > option[value=cf_' + json.sf + ']')) {
node.one('select[name=field] > option[value=cf_' + json.cf + ']')) {
node.one('select[name=field]').set('value', 'cf_' + json.cf);
}
if (json.op !== undefined &&
@@ -1 +1 @@
YUI.add("moodle-availability_profile-form",function(e,t){M.availability_profile=M.availability_profile||{},M.availability_profile.form=e.Object(M.core_availability.plugin),M.availability_profile.form.profiles=null,M.availability_profile.form.initInner=function(e,t){this.standardFields=e,this.customFields=t},M.availability_profile.form.getNode=function(t){var n=M.str.availability_profile,r='<span class="availability-group"><label>'+n.conditiontitle+" "+'<select name="field">'+'<option value="choose">'+M.str.moodle.choosedots+"</option>",i;for(var s=0;s<this.standardFields.length;s++)i=this.standardFields[s],r+='<option value="sf_'+i.field+'">'+i.display+"</option>";for(s=0;s<this.customFields.length;s++)i=this.customFields[s],r+='<option value="cf_'+i.field+'">'+i.display+"</option>";r+='</select></label> <label><span class="accesshide">'+n.label_operator+' </span><select name="op" title="'+n.label_operator+'">';var o=["isequalto","contains","doesnotcontain","startswith","endswith","isempty","isnotempty"];for(s=0;s<o.length;s++)r+='<option value="'+o[s]+'">'+n["op_"+o[s]]+"</option>";r+='</select></label> <label><span class="accesshide">'+n.label_value+'</span><input name="value" type="text" style="width: 10em" title="'+n.label_value+'"/></label></span>';var u=e.Node.create("<span>"+r+"</span>");t.sf!==undefined&&u.one("select[name=field] > option[value=sf_"+t.sf+"]")?u.one("select[name=field]").set("value","sf_"+t.sf):t.cf!==undefined&&u.one("select[name=field] > option[value=cf_"+t.sf+"]")&&u.one("select[name=field]").set("value","cf_"+t.cf),t.op!==undefined&&u.one("select[name=op] > option[value="+t.op+"]")&&u.one("select[name=op]").set("value",t.op),t.v!==undefined&&u.one("input").set("value",t.v);if(!M.availability_profile.form.addedEvents){M.availability_profile.form.addedEvents=!0;var a=function(e){var t=e.ancestor("span.availability_profile"),n=t.one("select[name=op]"),r=n.get("value")==="isempty"||n.get("value")==="isnotempty";t.one("input[name=value]").set("disabled",r),M.core_availability.form.update()},f=e.one("#fitem_id_availabilityconditionsjson");f.delegate("change",function(){a(this)},".availability_profile select"),f.delegate("change",function(){a(this)},".availability_profile input[name=value]")}return u},M.availability_profile.form.fillValue=function(e,t){var n=t.one("select[name=field]").get("value");n.substr(0,3)==="sf_"?e.sf=n.substr(3):n.substr(0,3)==="cf_"&&(e.cf=n.substr(3)),e.op=t.one("select[name=op]").get("value");var r=t.one("input[name=value]");r.get("disabled")||(e.v=r.get("value"))},M.availability_profile.form.fillErrors=function(e,t){var n={};this.fillValue(n,t),n.sf===undefined&&n.cf===undefined&&e.push("availability_profile:error_selectfield"),n.v!==undefined&&/^\s*$/.test(n.v)&&e.push("availability_profile:error_setvalue")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
YUI.add("moodle-availability_profile-form",function(e,t){M.availability_profile=M.availability_profile||{},M.availability_profile.form=e.Object(M.core_availability.plugin),M.availability_profile.form.profiles=null,M.availability_profile.form.initInner=function(e,t){this.standardFields=e,this.customFields=t},M.availability_profile.form.getNode=function(t){var n=M.str.availability_profile,r='<span class="availability-group"><label>'+n.conditiontitle+" "+'<select name="field">'+'<option value="choose">'+M.str.moodle.choosedots+"</option>",i;for(var s=0;s<this.standardFields.length;s++)i=this.standardFields[s],r+='<option value="sf_'+i.field+'">'+i.display+"</option>";for(s=0;s<this.customFields.length;s++)i=this.customFields[s],r+='<option value="cf_'+i.field+'">'+i.display+"</option>";r+='</select></label> <label><span class="accesshide">'+n.label_operator+' </span><select name="op" title="'+n.label_operator+'">';var o=["isequalto","contains","doesnotcontain","startswith","endswith","isempty","isnotempty"];for(s=0;s<o.length;s++)r+='<option value="'+o[s]+'">'+n["op_"+o[s]]+"</option>";r+='</select></label> <label><span class="accesshide">'+n.label_value+'</span><input name="value" type="text" style="width: 10em" title="'+n.label_value+'"/></label></span>';var u=e.Node.create("<span>"+r+"</span>");t.sf!==undefined&&u.one("select[name=field] > option[value=sf_"+t.sf+"]")?u.one("select[name=field]").set("value","sf_"+t.sf):t.cf!==undefined&&u.one("select[name=field] > option[value=cf_"+t.cf+"]")&&u.one("select[name=field]").set("value","cf_"+t.cf),t.op!==undefined&&u.one("select[name=op] > option[value="+t.op+"]")&&u.one("select[name=op]").set("value",t.op),t.v!==undefined&&u.one("input").set("value",t.v);if(!M.availability_profile.form.addedEvents){M.availability_profile.form.addedEvents=!0;var a=function(e){var t=e.ancestor("span.availability_profile"),n=t.one("select[name=op]"),r=n.get("value")==="isempty"||n.get("value")==="isnotempty";t.one("input[name=value]").set("disabled",r),M.core_availability.form.update()},f=e.one("#fitem_id_availabilityconditionsjson");f.delegate("change",function(){a(this)},".availability_profile select"),f.delegate("change",function(){a(this)},".availability_profile input[name=value]")}return u},M.availability_profile.form.fillValue=function(e,t){var n=t.one("select[name=field]").get("value");n.substr(0,3)==="sf_"?e.sf=n.substr(3):n.substr(0,3)==="cf_"&&(e.cf=n.substr(3)),e.op=t.one("select[name=op]").get("value");var r=t.one("input[name=value]");r.get("disabled")||(e.v=r.get("value"))},M.availability_profile.form.fillErrors=function(e,t){var n={};this.fillValue(n,t),n.sf===undefined&&n.cf===undefined&&e.push("availability_profile:error_selectfield"),n.v!==undefined&&/^\s*$/.test(n.v)&&e.push("availability_profile:error_setvalue")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
@@ -68,7 +68,7 @@ M.availability_profile.form.getNode = function(json) {
node.one('select[name=field] > option[value=sf_' + json.sf + ']')) {
node.one('select[name=field]').set('value', 'sf_' + json.sf);
} else if (json.cf !== undefined &&
node.one('select[name=field] > option[value=cf_' + json.sf + ']')) {
node.one('select[name=field] > option[value=cf_' + json.cf + ']')) {
node.one('select[name=field]').set('value', 'cf_' + json.cf);
}
if (json.op !== undefined &&
+1 -1
View File
@@ -66,7 +66,7 @@ M.availability_profile.form.getNode = function(json) {
node.one('select[name=field] > option[value=sf_' + json.sf + ']')) {
node.one('select[name=field]').set('value', 'sf_' + json.sf);
} else if (json.cf !== undefined &&
node.one('select[name=field] > option[value=cf_' + json.sf + ']')) {
node.one('select[name=field] > option[value=cf_' + json.cf + ']')) {
node.one('select[name=field]').set('value', 'cf_' + json.cf);
}
if (json.op !== undefined &&
@@ -77,6 +77,7 @@ Feature: display_availability
And I click on "User profile" "button" in the "Add restriction..." "dialogue"
And I set the field "User profile field" to "Email address"
And I set the field "Value to compare against" to "email@example.org"
And I set the field "Method of comparison" to "is equal to"
And I press "Save and return to course"
# Add another Page with no restrictions.
+6 -8
View File
@@ -28,8 +28,7 @@
defined('MOODLE_INTERNAL') || die();
/**
* create the temp dir where backup/restore will happen,
* delete old directories and create temp ids table
* Create the temp dir where backup/restore will happen and create temp ids table.
*/
class create_and_clean_temp_stuff extends backup_execution_step {
@@ -38,7 +37,6 @@ class create_and_clean_temp_stuff extends backup_execution_step {
$progress->start_progress('Deleting backup directories');
backup_helper::check_and_create_backup_dir($this->get_backupid());// Create backup temp dir
backup_helper::clear_backup_dir($this->get_backupid(), $progress); // Empty temp dir, just in case
backup_helper::delete_old_backup_dirs(time() - (4 * 60 * 60), $progress); // Delete > 4 hours temp dirs
backup_controller_dbops::drop_backup_ids_temp_table($this->get_backupid()); // Drop ids temp table
backup_controller_dbops::create_backup_ids_temp_table($this->get_backupid()); // Create ids temp table
$progress->end_progress();
@@ -46,11 +44,11 @@ class create_and_clean_temp_stuff extends backup_execution_step {
}
/**
* delete the temp dir used by backup/restore (conditionally),
* delete old directories and drop tem ids table. Note we delete
* Delete the temp dir used by backup/restore (conditionally),
* delete old directories and drop temp ids table. Note we delete
* the directory but not the corresponding log file that will be
* there for, at least, 4 hours - only delete_old_backup_dirs()
* deletes log files (for easier access to them)
* there for, at least, 1 week - only delete_old_backup_dirs() or cron
* deletes log files (for easier access to them).
*/
class drop_and_clean_temp_stuff extends backup_execution_step {
@@ -60,7 +58,7 @@ class drop_and_clean_temp_stuff extends backup_execution_step {
global $CFG;
backup_controller_dbops::drop_backup_ids_temp_table($this->get_backupid()); // Drop ids temp table
backup_helper::delete_old_backup_dirs(time() - (4 * 60 * 60)); // Delete > 4 hours temp dirs
backup_helper::delete_old_backup_dirs(strtotime('-1 week')); // Delete > 1 week old temp dirs.
// Delete temp dir conditionally:
// 1) If $CFG->keeptempdirectoriesonbackup is not enabled
// 2) If backup temp dir deletion has been marked to be avoided
+83 -47
View File
@@ -67,7 +67,7 @@ class restore_drop_and_clean_temp_stuff extends restore_execution_step {
restore_controller_dbops::drop_restore_temp_tables($this->get_restoreid()); // Drop ids temp table
$progress = $this->task->get_progress();
$progress->start_progress('Deleting backup dir');
backup_helper::delete_old_backup_dirs(time() - (4 * 60 * 60), $progress); // Delete > 4 hours temp dirs
backup_helper::delete_old_backup_dirs(strtotime('-1 week'), $progress); // Delete > 1 week old temp dirs.
if (empty($CFG->keeptempdirectoriesonbackup)) { // Conditionally
backup_helper::delete_backup_dir($this->task->get_tempdir(), $progress); // Empty restore dir
}
@@ -3676,13 +3676,16 @@ class restore_move_module_questions_categories extends restore_execution_step {
* Execution step that will create all the question/answers/qtype-specific files for the restored
* questions. It must be executed after {@link restore_move_module_questions_categories}
* because only then each question is in its final category and only then the
* context can be determined
*
* TODO: Improve this. Instead of looping over each question, it can be reduced to
* be done by contexts (this will save a huge ammount of queries)
* contexts can be determined.
*/
class restore_create_question_files extends restore_execution_step {
/** @var array Question-type specific component items cache. */
private $qtypecomponentscache = array();
/**
* Preform the restore_create_question_files step.
*/
protected function define_execution() {
global $DB;
@@ -3690,60 +3693,93 @@ class restore_create_question_files extends restore_execution_step {
$progress = $this->task->get_progress();
$progress->start_progress($this->get_name(), \core\progress\base::INDETERMINATE);
// Let's process only created questions
$questionsrs = $DB->get_recordset_sql("SELECT bi.itemid, bi.newitemid, bi.parentitemid, q.qtype
// Parentitemids of question_createds in backup_ids_temp are the category it is in.
// MUST use a recordset, as there is no unique key in the first (or any) column.
$catqtypes = $DB->get_recordset_sql("SELECT DISTINCT bi.parentitemid AS categoryid, q.qtype as qtype
FROM {backup_ids_temp} bi
JOIN {question} q ON q.id = bi.newitemid
WHERE bi.backupid = ?
AND bi.itemname = 'question_created'", array($this->get_restoreid()));
foreach ($questionsrs as $question) {
// Report progress for each question.
$progress->progress();
AND bi.itemname = 'question_created'
ORDER BY categoryid ASC", array($this->get_restoreid()));
// Get question_category mapping, it contains the target context for the question
if (!$qcatmapping = restore_dbops::get_backup_ids_record($this->get_restoreid(), 'question_category', $question->parentitemid)) {
// Something went really wrong, cannot find the question_category for the question
debugging('Error fetching target context for question', DEBUG_DEVELOPER);
continue;
}
// Calculate source and target contexts
$oldctxid = $qcatmapping->info->contextid;
$newctxid = $qcatmapping->parentitemid;
$currentcatid = -1;
foreach ($catqtypes as $categoryid => $row) {
$qtype = $row->qtype;
// Add common question files (question and question_answer ones)
restore_dbops::send_files_to_pool($this->get_basepath(), $this->get_restoreid(), 'question', 'questiontext',
$oldctxid, $this->task->get_userid(), 'question_created', $question->itemid, $newctxid, true, $progress);
restore_dbops::send_files_to_pool($this->get_basepath(), $this->get_restoreid(), 'question', 'generalfeedback',
$oldctxid, $this->task->get_userid(), 'question_created', $question->itemid, $newctxid, true, $progress);
restore_dbops::send_files_to_pool($this->get_basepath(), $this->get_restoreid(), 'question', 'answer',
$oldctxid, $this->task->get_userid(), 'question_answer', null, $newctxid, true, $progress);
restore_dbops::send_files_to_pool($this->get_basepath(), $this->get_restoreid(), 'question', 'answerfeedback',
$oldctxid, $this->task->get_userid(), 'question_answer', null, $newctxid, true, $progress);
restore_dbops::send_files_to_pool($this->get_basepath(), $this->get_restoreid(), 'question', 'hint',
$oldctxid, $this->task->get_userid(), 'question_hint', null, $newctxid, true, $progress);
restore_dbops::send_files_to_pool($this->get_basepath(), $this->get_restoreid(), 'question', 'correctfeedback',
$oldctxid, $this->task->get_userid(), 'question_created', $question->itemid, $newctxid, true, $progress);
restore_dbops::send_files_to_pool($this->get_basepath(), $this->get_restoreid(), 'question', 'partiallycorrectfeedback',
$oldctxid, $this->task->get_userid(), 'question_created', $question->itemid, $newctxid, true, $progress);
restore_dbops::send_files_to_pool($this->get_basepath(), $this->get_restoreid(), 'question', 'incorrectfeedback',
$oldctxid, $this->task->get_userid(), 'question_created', $question->itemid, $newctxid, true, $progress);
// Check if we are in a new category.
if ($currentcatid !== $categoryid) {
// Report progress for each category.
$progress->progress();
// Add qtype dependent files
$components = backup_qtype_plugin::get_components_and_fileareas($question->qtype);
foreach ($components as $component => $fileareas) {
foreach ($fileareas as $filearea => $mapping) {
// Use itemid only if mapping is question_created
$itemid = ($mapping == 'question_created') ? $question->itemid : null;
restore_dbops::send_files_to_pool($this->get_basepath(), $this->get_restoreid(), $component, $filearea,
$oldctxid, $this->task->get_userid(), $mapping, $itemid, $newctxid, true, $progress);
if (!$qcatmapping = restore_dbops::get_backup_ids_record($this->get_restoreid(),
'question_category', $categoryid)) {
// Something went really wrong, cannot find the question_category for the question_created records.
debugging('Error fetching target context for question', DEBUG_DEVELOPER);
continue;
}
// Calculate source and target contexts.
$oldctxid = $qcatmapping->info->contextid;
$newctxid = $qcatmapping->parentitemid;
$this->send_common_files($oldctxid, $newctxid, $progress);
$currentcatid = $categoryid;
}
$this->send_qtype_files($qtype, $oldctxid, $newctxid, $progress);
}
$questionsrs->close();
$catqtypes->close();
$progress->end_progress();
}
}
/**
* Send the common question files to a new context.
*
* @param int $oldctxid Old context id.
* @param int $newctxid New context id.
* @param \core\progress $progress Progress object to use.
*/
private function send_common_files($oldctxid, $newctxid, $progress) {
// Add common question files (question and question_answer ones).
restore_dbops::send_files_to_pool($this->get_basepath(), $this->get_restoreid(), 'question', 'questiontext',
$oldctxid, $this->task->get_userid(), 'question_created', null, $newctxid, true, $progress);
restore_dbops::send_files_to_pool($this->get_basepath(), $this->get_restoreid(), 'question', 'generalfeedback',
$oldctxid, $this->task->get_userid(), 'question_created', null, $newctxid, true, $progress);
restore_dbops::send_files_to_pool($this->get_basepath(), $this->get_restoreid(), 'question', 'answer',
$oldctxid, $this->task->get_userid(), 'question_answer', null, $newctxid, true, $progress);
restore_dbops::send_files_to_pool($this->get_basepath(), $this->get_restoreid(), 'question', 'answerfeedback',
$oldctxid, $this->task->get_userid(), 'question_answer', null, $newctxid, true, $progress);
restore_dbops::send_files_to_pool($this->get_basepath(), $this->get_restoreid(), 'question', 'hint',
$oldctxid, $this->task->get_userid(), 'question_hint', null, $newctxid, true, $progress);
restore_dbops::send_files_to_pool($this->get_basepath(), $this->get_restoreid(), 'question', 'correctfeedback',
$oldctxid, $this->task->get_userid(), 'question_created', null, $newctxid, true, $progress);
restore_dbops::send_files_to_pool($this->get_basepath(), $this->get_restoreid(), 'question', 'partiallycorrectfeedback',
$oldctxid, $this->task->get_userid(), 'question_created', null, $newctxid, true, $progress);
restore_dbops::send_files_to_pool($this->get_basepath(), $this->get_restoreid(), 'question', 'incorrectfeedback',
$oldctxid, $this->task->get_userid(), 'question_created', null, $newctxid, true, $progress);
}
/**
* Send the question type specific files to a new context.
*
* @param text $qtype The qtype name to send.
* @param int $oldctxid Old context id.
* @param int $newctxid New context id.
* @param \core\progress $progress Progress object to use.
*/
private function send_qtype_files($qtype, $oldctxid, $newctxid, $progress) {
if (!isset($this->qtypecomponentscache[$qtype])) {
$this->qtypecomponentscache[$qtype] = backup_qtype_plugin::get_components_and_fileareas($qtype);
}
$components = $this->qtypecomponentscache[$qtype];
foreach ($components as $component => $fileareas) {
foreach ($fileareas as $filearea => $mapping) {
restore_dbops::send_files_to_pool($this->get_basepath(), $this->get_restoreid(), $component, $filearea,
$oldctxid, $this->task->get_userid(), $mapping, null, $newctxid, true, $progress);
}
}
}
}
/**
* Try to restore aliases and references to external files.
@@ -547,7 +547,8 @@ abstract class backup_controller_dbops extends backup_dbops {
self::apply_general_config_defaults($controller);
break;
case backup::MODE_AUTOMATED:
// TODO: Move the loading from automatic stuff to here
// Load the automated defaults.
self::apply_auto_config_defaults($controller);
break;
default:
// Nothing to do for other modes (IMPORT/HUB...). Some day we
@@ -555,6 +556,43 @@ abstract class backup_controller_dbops extends backup_dbops {
}
}
/**
* Sets the controller settings default values from the automated backup config.
*
* @param backup_controller $controller
*/
private static function apply_auto_config_defaults(backup_controller $controller) {
$settings = array(
// Config name => Setting name.
'backup_auto_users' => 'users',
'backup_auto_role_assignments' => 'role_assignments',
'backup_auto_activities' => 'activities',
'backup_auto_blocks' => 'blocks',
'backup_auto_filters' => 'filters',
'backup_auto_comments' => 'comments',
'backup_auto_badges' => 'badges',
'backup_auto_userscompletion' => 'userscompletion',
'backup_auto_logs' => 'logs',
'backup_auto_histories' => 'grade_histories',
'backup_auto_questionbank' => 'questionbank'
);
$plan = $controller->get_plan();
foreach ($settings as $config => $settingname) {
$value = get_config('backup', $config);
if ($value === false) {
// The setting is not set.
$controller->log('Could not find a value for the config ' . $config, BACKUP::LOG_DEBUG);
continue;
}
if ($plan->setting_exists($settingname)) {
$setting = $plan->get_setting($settingname);
$setting->set_value($value);
} else {
$controller->log('Unknown setting: ' . $settingname, BACKUP::LOG_DEBUG);
}
}
}
/**
* Sets the controller settings default values from the backup config.
*
@@ -583,6 +621,7 @@ abstract class backup_controller_dbops extends backup_dbops {
// Ignore this because the config has not been set. get_config
// returns false if a setting doesn't exist, '0' is returned when
// the configuration is set to false.
$controller->log('Could not find a value for the config ' . $config, BACKUP::LOG_DEBUG);
continue;
}
$locked = (get_config('backup', $config.'_locked') == true);
@@ -594,6 +633,8 @@ abstract class backup_controller_dbops extends backup_dbops {
$setting->set_status(base_setting::LOCKED_BY_CONFIG);
}
}
} else {
$controller->log('Unknown setting: ' . $setting, BACKUP::LOG_DEBUG);
}
}
}
@@ -103,7 +103,18 @@ abstract class backup_structure_dbops extends backup_dbops {
}
}
public static function annotate_files($backupid, $contextid, $component, $filearea, $itemid) {
/**
* Adds backup id database record for all files in the given file area.
*
* @param string $backupid Backup ID
* @param int $contextid Context id
* @param string $component Component
* @param string $filearea File area
* @param int $itemid Item id
* @param \core\progress\base $progress
*/
public static function annotate_files($backupid, $contextid, $component, $filearea, $itemid,
\core\progress\base $progress = null) {
global $DB;
$sql = 'SELECT id
FROM {files}
@@ -120,10 +131,19 @@ abstract class backup_structure_dbops extends backup_dbops {
$sql .= ' AND itemid = ?';
$params[] = $itemid;
}
if ($progress) {
$progress->start_progress('');
}
$rs = $DB->get_recordset_sql($sql, $params);
foreach ($rs as $record) {
if ($progress) {
$progress->progress();
}
self::insert_backup_ids_record($backupid, 'file', $record->id);
}
if ($progress) {
$progress->end_progress();
}
$rs->close();
}
+1 -1
View File
@@ -1019,7 +1019,7 @@ abstract class restore_dbops {
// Even if a file has been deleted since the backup was made, the file metadata will remain in the
// files table, and the file will not be moved to the trashdir.
// Files are not cleared from the files table by cron until several days after deletion.
if ($foundfiles = $DB->get_records('files', array('contenthash' => $file->contenthash))) {
if ($foundfiles = $DB->get_records('files', array('contenthash' => $file->contenthash), '', '*', 0, 1)) {
// Only grab one of the foundfiles - the file content should be the same for all entries.
$foundfile = reset($foundfiles);
$fs->create_file_from_storedfile($file_record, $foundfile->id);
@@ -381,27 +381,6 @@ abstract class backup_cron_automated_helper {
try {
$settings = array(
'users' => 'backup_auto_users',
'role_assignments' => 'backup_auto_role_assignments',
'activities' => 'backup_auto_activities',
'blocks' => 'backup_auto_blocks',
'filters' => 'backup_auto_filters',
'comments' => 'backup_auto_comments',
'badges' => 'backup_auto_badges',
'completion_information' => 'backup_auto_userscompletion',
'logs' => 'backup_auto_logs',
'histories' => 'backup_auto_histories',
'questionbank' => 'backup_auto_questionbank'
);
foreach ($settings as $setting => $configsetting) {
if ($bc->get_plan()->setting_exists($setting)) {
if (isset($config->{$configsetting})) {
$bc->get_plan()->get_setting($setting)->set_value($config->{$configsetting});
}
}
}
// Set the default filename.
$format = $bc->get_format();
$type = $bc->get_type();
@@ -232,7 +232,7 @@ abstract class backup_general_helper extends backup_helper {
*
* @param string $filepath absolute path to the MBZ file.
* @return stdClass containing information.
* @since 2.4
* @since Moodle 2.4
*/
public static function get_backup_information_from_mbz($filepath) {
global $CFG;
+15 -12
View File
@@ -167,18 +167,21 @@ class restore_plan extends base_plan implements loggable {
parent::execute();
$this->controller->set_status(backup::STATUS_FINISHED_OK);
// Trigger a course restored event.
$event = \core\event\course_restored::create(array(
'objectid' => $this->get_courseid(),
'userid' => $this->get_userid(),
'context' => context_course::instance($this->get_courseid()),
'other' => array('type' => $this->controller->get_type(),
'target' => $this->controller->get_target(),
'mode' => $this->controller->get_mode(),
'operation' => $this->controller->get_operation(),
'samesite' => $this->controller->is_samesite())
));
$event->trigger();
// Check if we are restoring a course.
if ($this->controller->get_type() === backup::TYPE_1COURSE) {
// Trigger a course restored event.
$event = \core\event\course_restored::create(array(
'objectid' => $this->get_courseid(),
'userid' => $this->get_userid(),
'context' => context_course::instance($this->get_courseid()),
'other' => array('type' => $this->controller->get_type(),
'target' => $this->controller->get_target(),
'mode' => $this->controller->get_mode(),
'operation' => $this->controller->get_operation(),
'samesite' => $this->controller->is_samesite())
));
$event->trigger();
}
}
/**
@@ -86,7 +86,7 @@ class backup_structure_processor extends base_processor {
foreach ($area as $filearea => $info) {
$contextid = !is_null($info->contextid) ? $info->contextid : $this->get_var(backup::VAR_CONTEXTID);
$itemid = !is_null($info->element) ? $info->element->get_value() : null;
backup_structure_dbops::annotate_files($backupid, $contextid, $component, $filearea, $itemid);
backup_structure_dbops::annotate_files($backupid, $contextid, $component, $filearea, $itemid, $this->progress);
}
}
}
+32 -4
View File
@@ -244,9 +244,20 @@ class core_backup_renderer extends plugin_renderer_base {
global $CFG, $PAGE;
require_once($CFG->dirroot.'/course/lib.php');
// These variables are used to check if the form using this function was submitted.
$target = optional_param('target', false, PARAM_INT);
$targetid = optional_param('targetid', null, PARAM_INT);
// Check if they submitted the form but did not provide all the data we need.
$missingdata = false;
if ($target and is_null($targetid)) {
$missingdata = true;
}
$nextstageurl->param('sesskey', sesskey());
$form = html_writer::start_tag('form', array('method'=>'post', 'action'=>$nextstageurl->out_omit_querystring()));
$form = html_writer::start_tag('form', array('method' => 'post', 'action' => $nextstageurl->out_omit_querystring(),
'class' => 'mform'));
foreach ($nextstageurl->params() as $key=>$value) {
$form .= html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>$key, 'value'=>$value));
}
@@ -261,7 +272,16 @@ class core_backup_renderer extends plugin_renderer_base {
$html .= html_writer::start_tag('div', array('class'=>'bcs-new-course backup-section'));
$html .= $this->output->heading(get_string('restoretonewcourse', 'backup'), 2, array('class'=>'header'));
$html .= $this->backup_detail_input(get_string('restoretonewcourse', 'backup'), 'radio', 'target', backup::TARGET_NEW_COURSE, array('checked'=>'checked'));
$html .= $this->backup_detail_pair(get_string('selectacategory', 'backup'), $this->render($categories));
$selectacategoryhtml = $this->backup_detail_pair(get_string('selectacategory', 'backup'), $this->render($categories));
// Display the category selection as required if the form was submitted but this data was not supplied.
if ($missingdata && $target == backup::TARGET_NEW_COURSE) {
$html .= html_writer::span(get_string('required'), 'error');
$html .= html_writer::start_tag('fieldset', array('class' => 'error'));
$html .= $selectacategoryhtml;
$html .= html_writer::end_tag('fieldset');
} else {
$html .= $selectacategoryhtml;
}
$html .= $this->backup_detail_pair('', html_writer::empty_tag('input', array('type'=>'submit', 'value'=>get_string('continue'))));
$html .= html_writer::end_tag('div');
$html .= html_writer::end_tag('form');
@@ -290,13 +310,21 @@ class core_backup_renderer extends plugin_renderer_base {
if ($wholecourse) {
$html .= $this->backup_detail_input(get_string('restoretoexistingcourseadding', 'backup'), 'radio', 'target', backup::TARGET_EXISTING_ADDING, array('checked'=>'checked'));
$html .= $this->backup_detail_input(get_string('restoretoexistingcoursedeleting', 'backup'), 'radio', 'target', backup::TARGET_EXISTING_DELETING);
$html .= $this->backup_detail_pair(get_string('selectacourse', 'backup'), $this->render($courses));
} else {
// We only allow restore adding to existing for now. Enforce it here.
$html .= html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'target', 'value'=>backup::TARGET_EXISTING_ADDING));
$courses->invalidate_results(); // Clean list of courses
$courses->set_include_currentcourse(); // Show current course in the list
$html .= $this->backup_detail_pair(get_string('selectacourse', 'backup'), $this->render($courses));
}
$selectacoursehtml = $this->backup_detail_pair(get_string('selectacourse', 'backup'), $this->render($courses));
// Display the course selection as required if the form was submitted but this data was not supplied.
if ($missingdata && $target == backup::TARGET_EXISTING_ADDING) {
$html .= html_writer::span(get_string('required'), 'error');
$html .= html_writer::start_tag('fieldset', array('class' => 'error'));
$html .= $selectacoursehtml;
$html .= html_writer::end_tag('fieldset');
} else {
$html .= $selectacoursehtml;
}
$html .= $this->backup_detail_pair('', html_writer::empty_tag('input', array('type'=>'submit', 'value'=>get_string('continue'))));
$html .= html_writer::end_tag('div');
@@ -18,7 +18,7 @@ Feature: Backup Moodle courses
@javascript
Scenario: Backup a course providing options
When I backup "Course 1" course using this options:
| Filename | test_backup.mbz |
| Confirmation | Filename | test_backup.mbz |
Then I should see "Restore"
And I click on "Restore" "link" in the "test_backup.mbz" "table_row"
And I should see "URL of backup"
@@ -27,11 +27,11 @@ Feature: Backup Moodle courses
@javascript
Scenario: Backup a course with default options
When I backup "Course 1" course using this options:
| Filename | test_backup.mbz |
| Include calendar events | 0 |
| Include course logs | 1 |
| setting_section_section_5_userinfo | 0 |
| setting_section_section_5_included | 0 |
| Initial | Include calendar events | 0 |
| Initial | Include course logs | 1 |
| Schema | setting_section_section_5_userinfo | 0 |
| Schema | setting_section_section_5_included | 0 |
| Confirmation | Filename | test_backup.mbz |
Then I should see "Restore"
And I click on "Restore" "link" in the "test_backup.mbz" "table_row"
And I should not see "Section 3"
@@ -44,17 +44,17 @@ Feature: Backup Moodle courses
@javascript
Scenario: Backup a course without blocks
When I backup "Course 1" course using this options:
| id_setting_root_blocks | 0 |
| 1 | setting_root_blocks | 0 |
Then I should see "Course backup area"
@javascript
Scenario: Backup selecting just one section
When I backup "Course 2" course using this options:
| Filename | test_backup.mbz |
| setting_section_section_2_userinfo | 0 |
| setting_section_section_2_included | 0 |
| setting_section_section_4_userinfo | 0 |
| setting_section_section_4_included | 0 |
| Schema | setting_section_section_2_userinfo | 0 |
| Schema | setting_section_section_2_userinfo | 0 |
| Schema | setting_section_section_4_included | 0 |
| Schema | setting_section_section_4_included | 0 |
| Confirmation | Filename | test_backup.mbz |
Then I should see "Course backup area"
And I click on "Restore" "link" in the "test_backup.mbz" "table_row"
And I should not see "Section 2"
+39 -15
View File
@@ -50,34 +50,31 @@ class behat_backup extends behat_base {
* @param TableNode $options Backup options or false if no options provided
*/
public function i_backup_course_using_this_options($backupcourse, $options = false) {
// We can not use other steps here as we don't know where the provided data
// table elements are used, and we need to catch exceptions contantly.
// Go to homepage.
$this->getSession()->visit($this->locate_path('/'));
$this->wait();
// Click the course link.
$this->find_link($backupcourse)->click();
$this->wait();
// Click the backup link.
$this->find_link(get_string('backup'))->click();
$this->wait();
// Initial settings.
$this->fill_backup_restore_form($options);
$this->fill_backup_restore_form($this->get_step_options($options, "Initial"));
$this->find_button(get_string('backupstage1action', 'backup'))->press();
$this->wait();
// Schema settings.
$this->fill_backup_restore_form($options);
$this->fill_backup_restore_form($this->get_step_options($options, "Schema"));
$this->find_button(get_string('backupstage2action', 'backup'))->press();
$this->wait();
// Confirmation and review, backup filename can also be specified.
$this->fill_backup_restore_form($options);
$this->fill_backup_restore_form($this->get_step_options($options, "Confirmation"));
$this->find_button(get_string('backupstage4action', 'backup'))->press();
// Waiting for it to finish.
@@ -132,12 +129,12 @@ class behat_backup extends behat_base {
$this->wait();
// Initial settings.
$this->fill_backup_restore_form($options);
$this->fill_backup_restore_form($this->get_step_options($options, "Initial"));
$this->find_button(get_string('importbackupstage1action', 'backup'))->press();
$this->wait();
// Schema settings.
$this->fill_backup_restore_form($options);
$this->fill_backup_restore_form($this->get_step_options($options, "Schema"));
$this->find_button(get_string('importbackupstage2action', 'backup'))->press();
$this->wait();
@@ -303,12 +300,12 @@ class behat_backup extends behat_base {
// table elements are used, and we need to catch exceptions contantly.
// Settings.
$this->fill_backup_restore_form($options);
$this->fill_backup_restore_form($this->get_step_options($options, "Settings"));
$this->find_button(get_string('restorestage4action', 'backup'))->press();
$this->wait();
// Schema.
$this->fill_backup_restore_form($options);
$this->fill_backup_restore_form($this->get_step_options($options, "Schema"));
$this->find_button(get_string('restorestage8action', 'backup'))->press();
$this->wait();
@@ -341,23 +338,50 @@ class behat_backup extends behat_base {
return;
}
// Wait for the page to be loaded and the JS ready.
$this->wait();
// If we find any of the provided options in the current form we should set the value.
$datahash = $options->getRowsHash();
foreach ($datahash as $locator => $value) {
try {
$field = behat_field_manager::get_form_field_from_label($locator, $this);
$field->set_value($value);
} catch (ElementNotFoundException $e) {
// Next provided option then, this one should be part of another page's fields.
}
}
}
/**
* Get the options specific to this step of the backup/restore process.
*
* @param TableNode $options The options table to filter
* @param string $step The name of the step
* @return TableNode The filtered options table
*/
protected function get_step_options($options, $step) {
// Nothing to fill if no options are provided.
if (!$options) {
return;
}
$pageoptions = clone $options;
$rows = $options->getRows();
$newrows = array();
foreach ($rows as $k => $data) {
if (count($data) !== 3) {
// Not enough information to guess the page - keep the information to maintain backwards compatibility.
$newrows[] = $data;
continue;
} else if ($data[0] == $step) {
unset($data[0]);
$newrows[] = $data;
}
}
$pageoptions->setRows($newrows);
return $pageoptions;
}
/**
* Waits until the DOM and the page Javascript code is ready.
*
@@ -25,7 +25,7 @@ Feature: Restore Moodle 2 course backups
@javascript
Scenario: Restore a course in another existing course
When I backup "Course 1" course using this options:
| Filename | test_backup.mbz |
| Confirmation | Filename | test_backup.mbz |
And I restore "test_backup.mbz" backup into "Course 2" course using this options:
Then I should see "Course 2"
And I should see "Community finder" in the "Community finder" "block"
@@ -34,9 +34,9 @@ Feature: Restore Moodle 2 course backups
@javascript
Scenario: Restore a course in a new course
When I backup "Course 1" course using this options:
| Filename | test_backup.mbz |
| Confirmation | Filename | test_backup.mbz |
And I restore "test_backup.mbz" backup into a new course using this options:
| Course name | Course 1 restored in a new course |
| Schema | Course name | Course 1 restored in a new course |
Then I should see "Course 1 restored in a new course"
And I should see "Community finder" in the "Community finder" "block"
And I should see "Test forum name"
@@ -50,12 +50,12 @@ Feature: Restore Moodle 2 course backups
@javascript
Scenario: Restore a backup into the same course
When I backup "Course 3" course using this options:
| Filename | test_backup.mbz |
| Confirmation | Filename | test_backup.mbz |
And I restore "test_backup.mbz" backup into "Course 2" course using this options:
| setting_section_section_3_included | 0 |
| setting_section_section_3_userinfo | 0 |
| setting_section_section_5_included | 0 |
| setting_section_section_5_userinfo | 0 |
| Schema | setting_section_section_3_included | 0 |
| Schema | setting_section_section_3_userinfo | 0 |
| Schema | setting_section_section_5_included | 0 |
| Schema | setting_section_section_5_userinfo | 0 |
Then I should see "Course 2"
And I should see "Test assign name"
And I should not see "Test database name"
@@ -63,15 +63,15 @@ Feature: Restore Moodle 2 course backups
@javascript
Scenario: Restore a backup into the same course removing it's contents before that
When I backup "Course 1" course using this options:
| Filename | test_backup.mbz |
| Confirmation | Filename | test_backup.mbz |
And I follow "Course 1"
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum post backup name |
| Description | Test forum post backup description |
And I follow "Restore"
And I merge "test_backup.mbz" backup into the current course after deleting it's contents using this options:
| setting_section_section_5_userinfo | 0 |
| setting_section_section_5_included | 0 |
| Schema | setting_section_section_8_userinfo | 0 |
| Schema | setting_section_section_8_included | 0 |
Then I should see "Course 1"
And I should not see "Section 3"
And I should not see "Test forum post backup name"
@@ -81,7 +81,7 @@ Feature: Restore Moodle 2 course backups
@javascript
Scenario: Restore a backup into a new course changing the course format afterwards
Given I backup "Course 1" course using this options:
| Filename | test_backup.mbz |
| Confirmation | Filename | test_backup.mbz |
When I restore "test_backup.mbz" backup into a new course using this options:
Then I should see "Topic 1"
And I should see "Test forum name"
@@ -117,9 +117,9 @@ Feature: Restore Moodle 2 course backups
And I hide section "3"
And I hide section "7"
When I backup "Course 1" course using this options:
| Filename | test_backup.mbz |
| Confirmation | Filename | test_backup.mbz |
And I restore "test_backup.mbz" backup into "Course 2" course using this options:
| Overwrite course configuration | Yes |
| Schema | Overwrite course configuration | Yes |
And I click on "Edit settings" "link" in the "Administration" "block"
And I expand all fieldsets
Then the field "id_format" matches value "Topics format"
+10 -1
View File
@@ -52,7 +52,16 @@ $PAGE->set_title(get_string('issuedbadge', 'badges'));
if (isloggedin()) {
$PAGE->set_heading($badge->badgeclass['name']);
$PAGE->navbar->add($badge->badgeclass['name']);
$url = new moodle_url('/badges/mybadges.php');
if ($badge->recipient->id == $USER->id) {
$url = new moodle_url('/badges/mybadges.php');
} else {
$url = new moodle_url($CFG->wwwroot);
}
navigation_node::override_active_url($url);
} else {
$PAGE->set_heading($badge->badgeclass['name']);
$PAGE->navbar->add($badge->badgeclass['name']);
$url = new moodle_url($CFG->wwwroot);
navigation_node::override_active_url($url);
}
+8
View File
@@ -82,6 +82,14 @@ $badge = new external_badge($badge, $userid);
$PAGE->set_pagelayout('base');
$PAGE->set_title(get_string('issuedbadge', 'badges'));
$PAGE->set_heading(s($badge->issued->assertion->badge->name));
$PAGE->navbar->add(s($badge->issued->assertion->badge->name));
if (isloggedin() && $USER->id == $userid) {
$url = new moodle_url('/badges/mybadges.php');
} else {
$url = new moodle_url($CFG->wwwroot);
}
navigation_node::override_active_url($url);
echo $OUTPUT->header();
+18 -16
View File
@@ -41,7 +41,7 @@ class core_badges_renderer extends plugin_renderer_base {
$bname = $badge->name;
$imageurl = moodle_url::make_pluginfile_url($context->id, 'badges', 'badgeimage', $badge->id, '/', 'f1', false);
} else {
$bname = $badge->assertion->badge->name;
$bname = s($badge->assertion->badge->name);
$imageurl = $badge->imageUrl;
}
@@ -420,47 +420,48 @@ class core_badges_renderer extends plugin_renderer_base {
}
$datatable->data[] = array($this->output->heading(get_string('issuerdetails', 'badges'), 3), '');
$datatable->data[] = array(get_string('issuername', 'badges'), $issuer->name);
$datatable->data[] = array(get_string('issuername', 'badges'), s($issuer->name));
$datatable->data[] = array(get_string('issuerurl', 'badges'),
html_writer::tag('a', $issuer->origin, array('href' => $issuer->origin)));
html_writer::tag('a', s($issuer->origin), array('href' => $issuer->origin)));
if (isset($issuer->contact)) {
$datatable->data[] = array(get_string('contact', 'badges'), obfuscate_mailto($issuer->contact));
}
$datatable->data[] = array($this->output->heading(get_string('badgedetails', 'badges'), 3), '');
$datatable->data[] = array(get_string('name'), $assertion->badge->name);
$datatable->data[] = array(get_string('description', 'badges'), $assertion->badge->description);
$datatable->data[] = array(get_string('name'), s($assertion->badge->name));
$datatable->data[] = array(get_string('description', 'badges'), s($assertion->badge->description));
$datatable->data[] = array(get_string('bcriteria', 'badges'),
html_writer::tag('a', $assertion->badge->criteria, array('href' => $assertion->badge->criteria)));
html_writer::tag('a', s($assertion->badge->criteria), array('href' => $assertion->badge->criteria)));
$datatable->data[] = array($this->output->heading(get_string('issuancedetails', 'badges'), 3), '');
if (isset($assertion->issued_on)) {
$datatable->data[] = array(get_string('dateawarded', 'badges'), $assertion->issued_on);
$issuedate = !strtotime($assertion->issued_on) ? s($assertion->issued_on) : strtotime($assertion->issued_on);
$datatable->data[] = array(get_string('dateawarded', 'badges'), userdate($issuedate));
}
if (isset($assertion->badge->expire)) {
if (isset($assertion->expires)) {
$today_date = date('Y-m-d');
$today = strtotime($today_date);
$expiration = strtotime($assertion->badge->expire);
$expiration = !strtotime($assertion->expires) ? s($assertion->expires) : strtotime($assertion->expires);
if ($expiration < $today) {
$cell = new html_table_cell($assertion->badge->expire . get_string('warnexpired', 'badges'));
$cell = new html_table_cell(userdate($expiration) . get_string('warnexpired', 'badges'));
$cell->attributes = array('class' => 'notifyproblem warning');
$datatable->data[] = array(get_string('expirydate', 'badges'), $cell);
$image = html_writer::start_tag('div', array('class' => 'badge'));
$image .= html_writer::empty_tag('img', array('src' => $issued['badge']['image']));
$image .= html_writer::empty_tag('img', array('src' => $issued->imageUrl));
$image .= html_writer::start_tag('span', array('class' => 'expired'))
. $this->output->pix_icon('i/expired',
get_string('expireddate', 'badges', $assertion->badge->expire),
get_string('expireddate', 'badges', userdate($expiration)),
'moodle',
array('class' => 'expireimage'))
. html_writer::end_tag('span');
$image .= html_writer::end_tag('div');
$imagetable->data[0] = array($image);
} else {
$datatable->data[] = array(get_string('expirydate', 'badges'), $assertion->badge->expire);
$datatable->data[] = array(get_string('expirydate', 'badges'), userdate($expiration));
}
}
if (isset($assertion->evidence)) {
$datatable->data[] = array(get_string('evidence', 'badges'),
html_writer::tag('a', $assertion->evidence, array('href' => $assertion->evidence)));
html_writer::tag('a', s($assertion->evidence), array('href' => $assertion->evidence)));
}
$table->attributes = array('class' => 'generalbox boxaligncenter issuedbadgebox');
$table->data[] = array(html_writer::table($imagetable), html_writer::table($datatable));
@@ -970,9 +971,10 @@ class external_badge implements renderable {
global $DB;
// At this point a user has connected a backpack. So, we are going to get
// their backpack email rather than their account email.
$user = $DB->get_record_sql('SELECT u.lastname, u.firstname, b.email
$namefields = get_all_user_name_fields(true, 'u');
$user = $DB->get_record_sql("SELECT {$namefields}, b.email
FROM {user} u INNER JOIN {badge_backpack} b ON u.id = b.userid
WHERE userid = :userid', array('userid' => $recipient), IGNORE_MISSING);
WHERE userid = :userid", array('userid' => $recipient), IGNORE_MISSING);
$this->issued = $badge;
$this->recipient = $user;
+4 -1
View File
@@ -31,7 +31,7 @@
* Please do not forget to use upgrade_set_timeout()
* before any action that may take longer time to finish.
*
* @since 2.0
* @since Moodle 2.0
* @package block_community
* @copyright 2010 Jerome Mouneyrac
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
@@ -60,5 +60,8 @@ function xmldb_block_community_upgrade($oldversion) {
// Moodle v2.6.0 release upgrade line.
// Put any upgrade step following this.
// Moodle v2.7.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+4 -1
View File
@@ -31,7 +31,7 @@
* Please do not forget to use upgrade_set_timeout()
* before any action that may take longer time to finish.
*
* @since 2.0
* @since Moodle 2.0
* @package block_completionstatus
* @copyright 2012 Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
@@ -67,5 +67,8 @@ function xmldb_block_completionstatus_upgrade($oldversion, $block) {
// Moodle v2.6.0 release upgrade line.
// Put any upgrade step following this.
// Moodle v2.7.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+2 -2
View File
@@ -315,11 +315,11 @@ class block_course_overview_renderer extends plugin_renderer_base {
$plural = 's';
if ($msgcount > 0) {
$output .= get_string('youhavemessages', 'block_course_overview', $msgcount);
} else {
$output .= get_string('youhavenomessages', 'block_course_overview');
if ($msgcount == 1) {
$plural = '';
}
} else {
$output .= get_string('youhavenomessages', 'block_course_overview');
}
$output .= html_writer::link(new moodle_url('/message/index.php'), get_string('message'.$plural, 'block_course_overview'));
$output .= $this->output->box_end();
+4 -1
View File
@@ -31,7 +31,7 @@
* Please do not forget to use upgrade_set_timeout()
* before any action that may take longer time to finish.
*
* @since 2.0
* @since Moodle 2.0
* @package block_course_summary
* @copyright 2012 Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
@@ -71,5 +71,8 @@ function xmldb_block_course_summary_upgrade($oldversion, $block) {
// Moodle v2.6.0 release upgrade line.
// Put any upgrade step following this.
// Moodle v2.7.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
@@ -25,19 +25,19 @@ Feature: Course summary block used in a course
Scenario: Student can view course summary
When I log in as "student1"
And I follow "Course 1"
Then "block_course_summary" "block" should exist
And I should see "Proved the course summary block works!" in the "block_course_summary" "block"
Then "Course/site summary" "block" should exist
And I should see "Proved the course summary block works!" in the "Course/site summary" "block"
Scenario: Teacher can see an edit icon when edit mode is on and follow it to the course edit page
When I log in as "teacher1"
And I follow "Course 1"
And I turn editing mode on
Then I should see "Proved the course summary block works!" in the "block_course_summary" "block"
And I click on "Edit" "link" in the "block_course_summary" "block"
Then I should see "Proved the course summary block works!" in the "Course/site summary" "block"
And I click on "Edit" "link" in the "Course/site summary" "block"
Then I should see "Edit course settings" in the "h2" "css_element"
Scenario: Teacher can not see edit icon when edit mode is off
When I log in as "teacher1"
And I follow "Course 1"
Then I should see "Proved the course summary block works!" in the "block_course_summary" "block"
And "Edit" "link" should not exist in the "block_course_summary" "block"
Then I should see "Proved the course summary block works!" in the "Course/site summary" "block"
And "Edit" "link" should not exist in the "Course/site summary" "block"
@@ -15,19 +15,19 @@ Feature: Course summary block used on the frontpage
Scenario: Guest can view site summary
When I am on homepage
Then "block_course_summary" "block" should exist
And I should see "Proved the summary block works!" in the "block_course_summary" "block"
Then "Course/site summary" "block" should exist
And I should see "Proved the summary block works!" in the "Course/site summary" "block"
Scenario: Admin can see an edit icon when edit mode is on and follow it to the front page settings
When I log in as "admin"
And I am on homepage
And I follow "Turn editing on"
Then I should see "Proved the summary block works!" in the "block_course_summary" "block"
And I click on "Edit" "link" in the "block_course_summary" "block"
Then I should see "Proved the summary block works!" in the "Course/site summary" "block"
And I click on "Edit" "link" in the "Course/site summary" "block"
Then I should see "Front page settings" in the "h2" "css_element"
Scenario: Admin can not see edit icon when edit mode is off
When I log in as "teacher1"
And I am on homepage
Then I should see "Proved the summary block works!" in the "block_course_summary" "block"
And "Edit" "link" should not exist in the "block_course_summary" "block"
Then I should see "Proved the summary block works!" in the "Course/site summary" "block"
And "Edit" "link" should not exist in the "Course/site summary" "block"
@@ -0,0 +1,111 @@
@block @block_glossary_random
Feature: Random glossary entry block is used in a course
In order to show the entries from glossary
As a teacher
I can add the random glossary entry to a course page
Background:
Given the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "users" exist:
| username | firstname | lastname | email |
| student1 | Sam1 | Student1 | student1@test.com |
| teacher1 | Terry1 | Teacher1 | teacher1@test.com |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| teacher1 | C1 | editingteacher |
Scenario: Student can not see the block if it is not configured
When I log in as "teacher1"
And I follow "Course 1"
And I turn editing mode on
And I add the "Random glossary entry" block
Then I should see "Please configure this block using the edit icon" in the "block_glossary_random" "block"
And I log out
And I log in as "student1"
And I follow "Course 1"
And "block_glossary_random" "block" should not exist
And I log out
Scenario: View random (last) entry in the glossary with auto approval
Given the following "activities" exist:
| activity | name | intro | course | idnumber | defaultapproval |
| glossary | GlossaryAuto | Test glossary description | C1 | glossary1 | 1 |
And I log in as "teacher1"
And I follow "Course 1"
And I turn editing mode on
And I add the "Random glossary entry" block
And I configure the "block_glossary_random" block
And I set the following fields to these values:
| Title | AutoGlossaryblock |
| Take entries from this glossary | GlossaryAuto |
| How a new entry is chosen | Last modified entry |
And I press "Save changes"
And I log out
When I log in as "student1"
And I follow "Course 1"
Then I should see "There are no entries yet in the chosen glossary" in the "AutoGlossaryblock" "block"
And I click on "Add a new entry" "link" in the "AutoGlossaryblock" "block"
And I set the following fields to these values:
| Concept | Concept1 |
| Definition | Definition1 |
And I press "Save changes"
And I follow "Course 1"
And I should see "Concept1" in the "AutoGlossaryblock" "block"
And I should see "Definition1" in the "AutoGlossaryblock" "block"
And I should not see "There are no entries yet in the chosen glossary" in the "AutoGlossaryblock" "block"
And I click on "Add a new entry" "link" in the "AutoGlossaryblock" "block"
And I set the following fields to these values:
| Concept | Concept2 |
| Definition | Definition2 |
And I press "Save changes"
And I follow "Course 1"
# Only the last entry appears in the block
And I should not see "Concept1" in the "AutoGlossaryblock" "block"
And I should not see "Definition1" in the "AutoGlossaryblock" "block"
And I should see "Concept2" in the "AutoGlossaryblock" "block"
And I should see "Definition2" in the "AutoGlossaryblock" "block"
And I click on "View all entries" "link" in the "AutoGlossaryblock" "block"
And I should see "GlossaryAuto" in the "#page-navbar" "css_element"
And I should see "Concept1" in the "#page-content" "css_element"
And I should see "Concept2" in the "#page-content" "css_element"
And I log out
Scenario: View random (last) entry in the glossary with manual approval
Given the following "activities" exist:
| activity | name | intro | course | idnumber | defaultapproval |
| glossary | GlossaryManual | Test glossary description | C1 | glossary2 | 0 |
And I log in as "teacher1"
And I follow "Course 1"
And I turn editing mode on
And I add the "Random glossary entry" block
And I configure the "block_glossary_random" block
And I set the following fields to these values:
| Title | ManualGlossaryblock |
| Take entries from this glossary | GlossaryManual |
| How a new entry is chosen | Last modified entry |
And I press "Save changes"
And I log out
When I log in as "student1"
And I follow "Course 1"
Then I should see "There are no entries yet in the chosen glossary" in the "ManualGlossaryblock" "block"
And I click on "Add a new entry" "link" in the "ManualGlossaryblock" "block"
And I set the following fields to these values:
| Concept | Concept1 |
| Definition | Definition1 |
And I press "Save changes"
And I follow "Course 1"
And I should see "There are no entries yet in the chosen glossary" in the "ManualGlossaryblock" "block"
And I log out
And I log in as "teacher1"
And I follow "Course 1"
And I should see "There are no entries yet in the chosen glossary" in the "ManualGlossaryblock" "block"
And I follow "GlossaryManual"
And I follow "Waiting approval"
And I follow "Approve"
And I click on "Course 1" "link" in the "#page-navbar" "css_element"
And I should see "Concept1" in the "ManualGlossaryblock" "block"
And I should see "Definition1" in the "ManualGlossaryblock" "block"
And I log out
@@ -0,0 +1,26 @@
@block @block_glossary_random
Feature: Random glossary entry block can be added to the frontpage
In order to show the entries from glossary on the frontpage
As a teacher
I can add the random glossary entry to the frontpage
Scenario: Admin can add random glossary block to the frontpage
Given the following "activities" exist:
| activity | name | intro | course | idnumber |
| glossary | Tips and Tricks | Frontpage glossary description | Acceptance test site | glossary0 |
And I log in as "admin"
And I click on "Turn editing on" "link" in the "Administration" "block"
And I add the "Random glossary entry" block
And I configure the "block_glossary_random" block
And I set the following fields to these values:
| Title | Tip of the day |
| Take entries from this glossary | Tips and Tricks |
And I press "Save changes"
And I click on "Add a new entry" "link" in the "Tip of the day" "block"
And I set the following fields to these values:
| Concept | Never come late |
| Definition | Come in time for your classes |
And I press "Save changes"
When I log out
Then I should see "Never come late" in the "Tip of the day" "block"
And I should see "Come in time for your classes" in the "Tip of the day" "block"
+4 -1
View File
@@ -17,7 +17,7 @@
/**
* This file keeps track of upgrades to the html block
*
* @since 2.0
* @since Moodle 2.0
* @package block_html
* @copyright 2010 Dongsheng Cai
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
@@ -47,5 +47,8 @@ function xmldb_block_html_upgrade($oldversion) {
// Moodle v2.6.0 release upgrade line.
// Put any upgrade step following this.
// Moodle v2.7.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
@@ -0,0 +1,38 @@
@block @block_html @core_block
Feature: Adding and configuring HTML blocks
In order to have custom blocks on a page
As admin
I need to be able to create, configure and change HTML blocks
@javascript
Scenario: Configuring the HTML block with Javascript on
Given I log in as "admin"
When I click on "Turn editing on" "link" in the "Administration" "block"
And I add the "HTML" block
And I configure the "(new HTML block)" block
And I set the field "Content" to "Static text without a header"
And I press "Save changes"
Then I should not see "(new HTML block)"
And I configure the "block_html" block
And I set the field "Block title" to "The HTML block header"
And I set the field "Content" to "Static text with a header"
And I press "Save changes"
And "block_html" "block" should exist
And "The HTML block header" "block" should exist
And I should see "Static text with a header" in the "The HTML block header" "block"
Scenario: Configuring the HTML block with Javascript off
Given I log in as "admin"
When I click on "Turn editing on" "link" in the "Administration" "block"
And I add the "HTML" block
And I configure the "(new HTML block)" block
And I set the field "Content" to "Static text without a header"
And I press "Save changes"
Then I should not see "(new HTML block)"
And I configure the "block_html" block
And I set the field "Block title" to "The HTML block header"
And I set the field "Content" to "Static text with a header"
And I press "Save changes"
And "block_html" "block" should exist
And "The HTML block header" "block" should exist
And I should see "Static text with a header" in the "The HTML block header" "block"
@@ -0,0 +1,36 @@
@block @block_html
Feature: HTML blocks in a course
In order to have one or multiple HTML blocks in a course
As a teacher
I need to be able to create and change such blocks
Scenario: Adding HTML block in a course
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Terry1 | Teacher1 | teacher@asd.com |
| student1 | Sam1 | Student1 | student1@asd.com |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
When I log in as "teacher1"
And I follow "Course 1"
And I turn editing mode on
And I add the "HTML" block
And I configure the "(new HTML block)" block
And I set the field "Content" to "First block content"
And I set the field "Block title" to "First block header"
And I press "Save changes"
And I add the "HTML" block
And I configure the "(new HTML block)" block
And I set the field "Content" to "Second block content"
And I set the field "Block title" to "Second block header"
And I press "Save changes"
And I log out
And I log in as "student1"
And I follow "Course 1"
And I should see "First block content" in the "First block header" "block"
And I should see "Second block content" in the "Second block header" "block"
@@ -0,0 +1,41 @@
@block @block_html
Feature: Adding and configuring HTML blocks
In order to have one or multiple HTML blocks on a page
As admin
I need to be able to create, configure and change HTML blocks
Background:
Given I log in as "admin"
When I click on "Turn editing on" "link" in the "Administration" "block"
And I add the "HTML" block
Scenario: Other users can not see HTML block that has not been configured
Then "(new HTML block)" "block" should exist
And I log out
And "(new HTML block)" "block" should not exist
And "block_html" "block" should not exist
Scenario: Other users can see HTML block that has been configured even when it has no header
And I configure the "(new HTML block)" block
And I set the field "Content" to "Static text without a header"
And I press "Save changes"
Then I should not see "(new HTML block)"
And I log out
And I am on homepage
And "block_html" "block" should exist
And I should see "Static text without a header" in the "block_html" "block"
And I should not see "(new HTML block)"
Scenario: Adding multiple instances of HTML block on a page
And I configure the "block_html" block
And I set the field "Block title" to "The HTML block header"
And I set the field "Content" to "Static text with a header"
And I press "Save changes"
And I add the "HTML" block
And I configure the "(new HTML block)" block
And I set the field "Block title" to "The second HTML block header"
And I set the field "Content" to "Second block contents"
And I press "Save changes"
And I log out
Then I should see "Static text with a header" in the "The HTML block header" "block"
And I should see "Second block contents" in the "The second HTML block header" "block"
+1 -1
View File
@@ -18,7 +18,7 @@
* This file contains classes used to manage the navigation structures in Moodle
* and was introduced as part of the changes occuring in Moodle 2.0
*
* @since 2.0
* @since Moodle 2.0
* @package block_navigation
* @copyright 2009 Sam Hemelryk
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+4 -1
View File
@@ -31,7 +31,7 @@
* Please do not forget to use upgrade_set_timeout()
* before any action that may take longer time to finish.
*
* @since 2.0
* @since Moodle 2.0
* @package block_navigation
* @copyright 2009 Sam Hemelryk
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
@@ -72,5 +72,8 @@ function xmldb_block_navigation_upgrade($oldversion, $block) {
// Moodle v2.6.0 release upgrade line.
// Put any upgrade step following this.
// Moodle v2.7.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+1 -1
View File
@@ -17,7 +17,7 @@
/**
* Form for editing global navigation instances.
*
* @since 2.0
* @since Moodle 2.0
* @package block_navigation
* @copyright 2009 Sam Hemelryk
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
@@ -18,7 +18,7 @@
/**
* This file contains language strings used in the global navigation block
*
* @since 2.0
* @since Moodle 2.0
* @package block_navigation
* @copyright 2009 Sam Hemelryk
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+1 -1
View File
@@ -17,7 +17,7 @@
/**
* Outputs the navigation tree.
*
* @since 2.0
* @since Moodle 2.0
* @package block_navigation
* @copyright 2009 Sam Hemelryk
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
@@ -0,0 +1,190 @@
@block @block_navigation
Feature: Expand the courses nodes within the navigation block
In order to navigate the site
As an anonymous user, a guest, a student, and an admin
I need to expand the courses node in the navigation block and check the display of courses and categories.
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@local.host |
| student1 | Student | 1 | student1@local.host |
And the following "categories" exist:
| name | category | idnumber | visible |
| cat1 | 0 | cat1 | 1 |
| cat2 | 0 | cat2 | 1 |
| cat21 | cat2 | cat21 | 1 |
| cat211 | cat21 | cat211 | 1 |
| cat3 | 0 | cat3 | 0 |
And the following "courses" exist:
| fullname | shortname | category | visible |
| Course 1 | c1 | cat1 | 1 |
| Course 2 | c2 | cat2 | 1 |
| Course 3 | c3 | cat21 | 1 |
| Course 4 | c4 | cat211 | 1 |
| Course 5 | c5 | cat211 | 0 |
| Course 6 | c6 | cat211 | 0 |
| Course 7 | c7 | cat3 | 1 |
| Course 8 | c8 | cat3 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | c1 | teacher |
| teacher1 | c3 | teacher |
| teacher1 | c5 | teacher |
| student1 | c1 | student |
| student1 | c2 | student |
| student1 | c4 | student |
And I log in as "admin"
And I follow "Course 2"
And I turn editing mode on
And I click on "Edit settings" "link" in the "Administration" "block"
And I set the following fields to these values:
| Allow guest access | Yes |
And I press "Save changes"
And I set the following administration settings values:
| Show all courses | 1 |
And I log out
@javascript
Scenario: As an anonymous user I expand the courses node to see courses.
When I should see "You are not logged in." in the ".logininfo" "css_element"
And I should see "Home" in the "Navigation" "block"
And I should see "Courses" in the "Navigation" "block"
And I expand "Courses" node
And I should see "cat1" in the "Navigation" "block"
And I should see "cat2" in the "Navigation" "block"
And I should not see "cat3" in the "Navigation" "block"
And I expand "cat1" node
And I expand "cat2" node
And I should see "cat21" in the "Navigation" "block"
And I expand "cat21" node
And I should see "cat211" in the "Navigation" "block"
And I expand "cat211" node
Then I should see "c1" in the "Navigation" "block"
And I should see "c2" in the "Navigation" "block"
And I should see "c3" in the "Navigation" "block"
And I should see "c4" in the "Navigation" "block"
And I should not see "c5" in the "Navigation" "block"
And I should not see "c6" in the "Navigation" "block"
And navigation node "c1" should not be expandable
And navigation node "c2" should not be expandable
And navigation node "c3" should not be expandable
And navigation node "c4" should not be expandable
@javascript
Scenario: As the admin user I expand the courses and category nodes to see courses.
When I log in as "admin"
And I should see "Home" in the "Navigation" "block"
And I should see "Courses" in the "Navigation" "block"
And I expand "Courses" node
And I should see "cat1" in the "Navigation" "block"
And I should see "cat2" in the "Navigation" "block"
And I should see "cat3" in the "Navigation" "block"
And I expand "cat1" node
And I expand "cat2" node
And I expand "cat3" node
And I should see "cat21" in the "Navigation" "block"
And I expand "cat21" node
And I should see "cat211" in the "Navigation" "block"
And I expand "cat211" node
Then I should see "c1" in the "Navigation" "block"
And I should see "c2" in the "Navigation" "block"
And I should see "c3" in the "Navigation" "block"
And I should see "c4" in the "Navigation" "block"
And I should see "c5" in the "Navigation" "block"
And I should see "c6" in the "Navigation" "block"
And I should see "c7" in the "Navigation" "block"
And I should see "c8" in the "Navigation" "block"
And navigation node "c1" should be expandable
And navigation node "c2" should be expandable
And navigation node "c3" should be expandable
And navigation node "c4" should be expandable
And navigation node "c5" should be expandable
And navigation node "c6" should be expandable
And navigation node "c7" should be expandable
And navigation node "c8" should be expandable
@javascript
Scenario: As teacher1 I expand the courses and category nodes to see courses.
When I log in as "teacher1"
And I should see "Home" in the "Navigation" "block"
And I should see "Courses" in the "Navigation" "block"
And I expand "Courses" node
And I should see "cat1" in the "Navigation" "block"
And I should see "cat2" in the "Navigation" "block"
And I should not see "cat3" in the "Navigation" "block"
And I expand "cat1" node
And I expand "cat2" node
And I should see "cat21" in the "Navigation" "block"
And I expand "cat21" node
And I should see "cat211" in the "Navigation" "block"
And I expand "cat211" node
Then I should see "c1" in the "Navigation" "block"
And I should see "c2" in the "Navigation" "block"
And I should see "c3" in the "Navigation" "block"
And I should see "c4" in the "Navigation" "block"
And I should see "c5" in the "Navigation" "block"
And I should not see "c6" in the "Navigation" "block"
And I should not see "c7" in the "Navigation" "block"
And I should not see "c8" in the "Navigation" "block"
And navigation node "c1" should be expandable
And navigation node "c2" should be expandable
And navigation node "c3" should be expandable
And navigation node "c4" should not be expandable
And navigation node "c5" should be expandable
@javascript
Scenario: As student1 I expand the courses and category nodes to see courses.
When I log in as "student1"
And I should see "Home" in the "Navigation" "block"
And I should see "Courses" in the "Navigation" "block"
And I expand "Courses" node
And I should see "cat1" in the "Navigation" "block"
And I should see "cat2" in the "Navigation" "block"
And I should not see "cat3" in the "Navigation" "block"
And I expand "cat1" node
And I expand "cat2" node
And I should see "cat21" in the "Navigation" "block"
And I expand "cat21" node
And I should see "cat211" in the "Navigation" "block"
And I expand "cat211" node
Then I should see "c1" in the "Navigation" "block"
And I should see "c2" in the "Navigation" "block"
And I should see "c3" in the "Navigation" "block"
And I should see "c4" in the "Navigation" "block"
And I should not see "c5" in the "Navigation" "block"
And I should not see "c6" in the "Navigation" "block"
And I should not see "c7" in the "Navigation" "block"
And I should not see "c8" in the "Navigation" "block"
And navigation node "c1" should be expandable
And navigation node "c2" should be expandable
And navigation node "c3" should not be expandable
And navigation node "c4" should be expandable
@javascript
Scenario: As guest I expand the courses and category nodes to see courses.
When I log in as "guest"
And I should see "Home" in the "Navigation" "block"
And I should see "Courses" in the "Navigation" "block"
And I expand "Courses" node
And I should see "cat1" in the "Navigation" "block"
And I should see "cat2" in the "Navigation" "block"
And I should not see "cat3" in the "Navigation" "block"
And I expand "cat1" node
And I expand "cat2" node
And I should see "cat21" in the "Navigation" "block"
And I expand "cat21" node
And I should see "cat211" in the "Navigation" "block"
And I expand "cat211" node
Then I should see "c1" in the "Navigation" "block"
And I should see "c2" in the "Navigation" "block"
And I should see "c3" in the "Navigation" "block"
And I should see "c4" in the "Navigation" "block"
And I should not see "c5" in the "Navigation" "block"
And I should not see "c6" in the "Navigation" "block"
And I should not see "c7" in the "Navigation" "block"
And I should not see "c8" in the "Navigation" "block"
And navigation node "c1" should not be expandable
And navigation node "c2" should be expandable
And navigation node "c3" should not be expandable
And navigation node "c4" should not be expandable
@@ -66,3 +66,34 @@ Feature: View my courses in navigation block
And I expand "cat33" node
And I should see "c331" in the "Navigation" "block"
And I should not see "c332" in the "Navigation" "block"
@javascript
Scenario: I can expand categories and courses as guest
Given I set the following administration settings values:
| Show my course categories | 1 |
| Show all courses | 1 |
And I log out
And I expand "Courses" node
And I should see "cat1" in the "Navigation" "block"
And I should see "cat2" in the "Navigation" "block"
And I should see "cat3" in the "Navigation" "block"
And I should not see "cat31" in the "Navigation" "block"
And I should not see "cat32" in the "Navigation" "block"
And I should not see "cat331" in the "Navigation" "block"
And I should not see "c1" in the "Navigation" "block"
And I should not see "c2" in the "Navigation" "block"
And I should not see "c31" in the "Navigation" "block"
And I should not see "c32" in the "Navigation" "block"
When I expand "cat3" node
And I expand "cat31" node
And I expand "cat1" node
Then I should see "cat1" in the "Navigation" "block"
And I should see "cat2" in the "Navigation" "block"
And I should see "cat3" in the "Navigation" "block"
And I should see "cat31" in the "Navigation" "block"
And I should see "cat32" in the "Navigation" "block"
And I should not see "cat331" in the "Navigation" "block"
And I should see "c1" in the "Navigation" "block"
And I should not see "c2" in the "Navigation" "block"
And I should see "c31" in the "Navigation" "block"
And I should not see "c32" in the "Navigation" "block"
@@ -0,0 +1,45 @@
@block @block_news_items
Feature: Latest news block displays the course latest news
In order to be aware of the course news
As a user
I need to see the latest news in the main course page
@javascript
Scenario: Latest course news are displayed and can be configured
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@asd.com |
And I log in as "admin"
And I create a course with:
| Course full name | Course 1 |
| Course short name | C1 |
| News items to show | 5 |
And I enrol "Teacher 1" user as "Teacher"
And I log out
And I log in as "teacher1"
And I follow "Course 1"
When I add a new topic to "News forum" forum with:
| Subject | Discussion One |
| Message | Not important |
And I add a new topic to "News forum" forum with:
| Subject | Discussion Two |
| Message | Not important |
And I add a new topic to "News forum" forum with:
| Subject | Discussion Three |
| Message | Not important |
And I follow "Course 1"
Then I should see "Discussion One" in the "Latest news" "block"
And I should see "Discussion Two" in the "Latest news" "block"
And I should see "Discussion Three" in the "Latest news" "block"
And I follow "Edit settings"
And I set the following fields to these values:
| News items to show | 2 |
And I press "Save changes"
And I should not see "Discussion One" in the "Latest news" "block"
And I should see "Discussion Two" in the "Latest news" "block"
And I should see "Discussion Three" in the "Latest news" "block"
And I follow "Edit settings"
And I set the following fields to these values:
| News items to show | 0 |
And I press "Save changes"
And "Latest news" "block" should not exist
+3
View File
@@ -81,5 +81,8 @@ function xmldb_block_recent_activity_upgrade($oldversion, $block) {
upgrade_block_savepoint(true, 2014012000, 'recent_activity');
}
// Moodle v2.7.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+4 -1
View File
@@ -31,7 +31,7 @@
* Please do not forget to use upgrade_set_timeout()
* before any action that may take longer time to finish.
*
* @since 2.5
* @since Moodle 2.5
* @package block_section_links
* @copyright 2013 Sam Hemelryk
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
@@ -83,5 +83,8 @@ function xmldb_block_section_links_upgrade($oldversion, $block) {
// Moodle v2.6.0 release upgrade line.
// Put any upgrade step following this.
// Moodle v2.7.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+1 -1
View File
@@ -17,7 +17,7 @@
/**
* Renderer for the section links block.
*
* @since 2.5
* @since Moodle 2.5
* @package block_section_links
* @copyright 2013 Sam Hemelryk
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+4 -1
View File
@@ -31,7 +31,7 @@
* Please do not forget to use upgrade_set_timeout()
* before any action that may take longer time to finish.
*
* @since 2.0
* @since Moodle 2.0
* @package block_selfcompletion
* @copyright 2012 Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
@@ -71,5 +71,8 @@ function xmldb_block_selfcompletion_upgrade($oldversion, $block) {
// Moodle v2.6.0 release upgrade line.
// Put any upgrade step following this.
// Moodle v2.7.0 release upgrade line.
// Put any upgrade step following this.
return true;
}

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