The old conditionlib.php, which is replaced by the new availability
API, has been deprecated.
* Code which uses the key functions (is_available,
get_full_information) should still work. These now show
deprecated warnings and then pass through to equivalents in the
new API.
* I have created new unit tests for these functions.
* The old language file has been removed (reused strings already
moved with AMOS).
* Most other functions throw exceptions because it was impossible
(due to fundamental API differences) or difficult to reimplement.
* I don't really expect that non-core code (outside unit tests) will
have used any of the other functions.
When a label has multiple paragraphs, its name (converted to plain text)
contains a line feed. Due to an error in regular expressions that don't
accept the line feed, this caused incorrect display on the course page
when that label is shown as a requirement for accessing another activity.
This reverts a change performed by the previous commit where user
fieldnames were being translated (and cached) when fetched,
causing the information to remain static later, not responding
to language switches (and perhaps leading to other problems if those
structures are used lated for DB / $USER comparisons.
With the commit, the translation happens on output, so no
potential interferences will happen and, also, the information
changes dynamically on lang switching.
Thanks to MDL-34936 and unit tests this was discovered like 2 new
places calling to get_fast_modinfo() without the sectioncache
column contents. Potential performance problem, leading to
reseting and recalculation of caches all the time.
As part of this change I added a new condition for user fields: is not equal.
I also copied the strings being used from the filters lang file to the condition
lang file and changed the uses in code.
AMOS BEGIN
CPY [contains,filters],[contains,condition]
CPY [doesnotcontain,filters],[doesnotcontain,condition]
CPY [isequalto,filters],[isequalto,condition]
CPY [startswith,filters],[startswith,condition]
CPY [endswith,filters],[endswith,condition]
CPY [isempty,filters],[isempty,condition]
AMOS END
* Fixed up database installation and upgrade code
* Reverted some whitespace optimisations to minimise conflicts
* Optimised commits made by Mark to reduce complexity and add tracker issue numbers
Credit: original version done by Kirill Astashov of NetSpot (netspot.com.au),
finished and tweaked by sam.
This change adds conditional availability support for sections analagous to
that already available for activities. (Backend, UI, backup/restore.)
In order that this feature does not reduce performance, section cacheing has
also been added using a new course 'sectioncache' field analagous to modinfo.
The new feature integrates with activity availability so that activities
inside sections which are not available are automatically not available
themselves (meaning it works to restrict access).
Change also adds minor feature to date-time selector so you can specify the time it uses as default when the value is 0 (disabled).
Credit: This feature was developed collaboratively by Charles Fulton, Neill Magill, and me.