59 Commits

Author SHA1 Message Date
Ankit Agarwal
e56e8e3a0e MDL-44985 libraries: Final deprecation of conditional classes and apis 2014-12-10 12:20:37 +05:30
sam marshall
6a601097a0 MDL-44070 Conditional availability enhancements (5): deprecate old lib
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.
2014-04-07 20:11:45 +01:00
sam marshall
597ac7e5d2 MDL-42582 Availability: Restriction display incorrect for multi-para Labels
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.
2013-11-15 12:45:32 +00:00
Dan Poltawski
c6cb4f8ec8 MDL-42533 conditionlib: Add clarifying comments 2013-11-04 22:04:01 +08:00
Dan Poltawski
07ba528bd4 Merge branch 'MDL-42533-master' of git://github.com/FMCorz/moodle 2013-11-04 21:51:57 +08:00
Marina Glancy
b4dba228a7 MDL-28463 conditionlib: use MUC for caching grades, reset when grades are changed 2013-11-01 16:48:50 +11:00
Marina Glancy
b85b9b7c29 MDL-28463 grades: inform conditionlib that grades changed 2013-10-29 11:33:21 +11:00
Frederic Massart
127816472e MDL-42533 conditionlib: Field name is translated for students 2013-10-25 09:46:36 +08:00
Marina Glancy
1cf1d6e62a MDL-41436 Save extra DB query since 'enablecompletion' is cached 2013-09-10 14:11:51 +10:00
Shane Elliott
0604e03bf9 MDL-40684 Fix conditional field name for custom user fields 2013-08-05 15:51:37 +12:00
Eloy Lafuente (stronk7)
f8c54a7469 MDL-37516 Translate fieldnames on output only.
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.
2013-07-02 20:39:05 +02:00
sam marshall
6316bfa0c7 MDL-37516 Conditional activities: user field condition display fixes 2013-07-02 20:00:17 +02:00
Damyon Wiese
e9df9e8f7a MDL-38289: Custom profile fields - added unit test
Added a unit test to cover the case when you are fetching a custom
profile field but you are not logged in.
2013-05-09 10:29:51 +08:00
Frederic Massart
b31bd82d60 MDL-38289 condition: Do not fetch profile fields when not logged in 2013-05-07 10:18:53 +08:00
sam marshall
acfee0d4ba MDL-38035 Conditional availability: Support multilang custom user fields 2013-03-20 15:57:53 +00:00
sam marshall
3a09f4dc64 MDL-38035 Activity settings: Support multilang names for custom user fields 2013-03-12 15:05:24 +00:00
sam marshall
6fea7a5f02 MDL-37792 Conditions: Interests condition offered but not implemented 2013-02-25 13:19:56 +00:00
Dan Poltawski
27885779bc Merge branch 'MDL-36991-master' of git://github.com/sammarshallou/moodle 2013-01-15 13:06:10 +08:00
Dan Poltawski
b93e0af3fe Revert "MDL-36704: wrap pending conditions in span tags"
This reverts commit 5e9fd83df8f2c175681fa5a81d36df5ee313cb1e.
2012-12-20 08:45:04 +08:00
Dan Poltawski
86575fa709 Merge branch 'MDL-36704-master' of git://github.com/sammarshallou/moodle 2012-12-18 14:57:43 +08:00
sam marshall
79e9e6049b MDL-37078: Restore - section restore fails with multiple availability conditions 2012-12-12 10:47:17 +00:00
Danny Wahl
9a8caba238 MDL-36991: Conditional activity restrictions should be displayed as list 2012-12-10 11:36:17 +00:00
Jay Knight
5e9fd83df8 MDL-36704: wrap pending conditions in span tags 2012-11-22 10:42:10 +00:00
Eloy Lafuente (stronk7)
2b64e24ebe MDL-35089 conditionals: detected one place missing sectioncache
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.
2012-08-28 01:38:09 +02:00
Aparup Banerjee
f36b0ba502 Merge branch 'wip-MDL-34285-m24' of git://github.com/samhemelryk/moodle 2012-07-23 17:22:14 +08:00
Dan Poltawski
147dc9dafd Merge branch 'wip-MDL-34286-m24' of git://github.com/samhemelryk/moodle 2012-07-23 15:00:26 +08:00
Petr Škoda
c8b3346cfd MDL-33180 delete the last traces of SimpleTest - ciao and thanks 2012-07-21 10:11:50 +02:00
Sam Hemelryk
2ede466e5f MDL-34286 conditionlib: Fixed up loading of user profile data for custom field conditions 2012-07-19 20:10:04 +12:00
Sam Hemelryk
1c8d09338e MDL-34285 condition: Fixed up missing operator 2012-07-19 19:29:47 +12:00
Sam Hemelryk
21a4e24cab MDL-34285 condition: Added is not empty option for user profile conditions and moved strings.
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
2012-07-19 19:27:00 +12:00
Sam Hemelryk
141d3c86d3 MDL-29538 condition: Tidied up user field condition code post merge 2012-07-09 11:45:44 +12:00
Mark Nelson
e01fbcf765 MDL-29538 core_condition: Integrated with the latest code, can now place user field conditions on sections as well 2012-06-26 15:18:53 +08:00
Sam Hemelryk
33e657c7e7 MDL-29538 core_condition: Pre-integration merge cleanup
* 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
2012-06-26 15:18:53 +08:00
Mark Nelson
33f30decce MDL-29538 core_condition: clear the userid from the user field cache when wiping the session 2012-06-26 15:18:53 +08:00
Mark Nelson
129e4a73ec MDL-29538 core_condition: cached result in usercondition array now stores all attributes 2012-06-26 15:18:53 +08:00
Mark Nelson
a8f84c287c MDL-29538 core_condition: code cleanup 2012-06-26 15:18:52 +08:00
Mark Nelson
e7b4bd3ef5 MDL-29538 core_condition: constants are no longer set using language strings 2012-06-26 15:18:52 +08:00
Mark Nelson
cb4492c200 MDL-29538 core_condition: changed the logic in the code so that it works with the new database structure as well as tidying up parts of the code 2012-06-26 15:18:52 +08:00
Mark Nelson
92fb7dd3a5 MDL-29538 core_condition: made changes to the DB structure - nb. had to rename the table due to length limit 2012-06-26 15:18:51 +08:00
Mark Nelson
76af15bb4c MDL-29538 core_condition: initial commit to add support for making things conditional on user profile fields 2012-06-26 15:18:51 +08:00
sam marshall
540f89d7d4 MDL-33212 Course page: Eye icon should override other conditions 2012-05-28 16:17:39 +01:00
Eloy Lafuente (stronk7)
94dc3c7d1e MDL-24419 (5): Coding style cleanup 2012-05-17 00:51:50 +02:00
sam marshall
ce4dfd2703 MDL-24419 (4): Add conditional availability support to sections; section cache
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).
2012-05-14 11:19:25 +01:00
Eloy Lafuente (stronk7)
47ee3c5569 MDL-30976 whitespace fixes 2012-03-07 02:19:59 +01:00
Ankit Kumar Agarwal
9ccadad391 MDL-30976 Docs Documenting Conditional APIs 2012-03-02 10:22:46 +08:00
sam marshall
6282381d05 MDL-27242 Conditional availability dates should support time as well as day
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.
2011-10-13 10:23:23 +01:00
Charles Fulton
fdef13e692 MDL-26507: improper use of assignment operater causes grade checks to fail 2011-02-21 12:54:37 +00:00
Petr Skoda
516c5eca68 MDL-24698 hopefully fixed all completion_info problems 2010-11-17 06:23:56 +00:00
Sam Marshall
72d021a927 Unit tests MDL-24976 Fixed conditionlib unit test (also added thing to ensure that debug warning in conditionlib is shown in unit test if applicable) 2010-11-02 15:04:21 +00:00
Petr Skoda
78bfb562a0 MDL-21249 improved php docs and adding direct access prevention in core libs 2010-07-25 13:35:05 +00:00