Commit graph

67426 commits

Author SHA1 Message Date
sam marshall
8d1f33e122 MDL-44070 Conditional availability enhancements (6): core changes
Changes core code to use new API instead of the old one when
checking user access to activities and sections.

Includes changes to other libraries that are necessary after
adding the availability system and removing old conditional tables
etc.
2014-04-07 20:11:48 +01:00
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
38674ef91a MDL-44070 Conditional availability enhancements (4): backup
Implements backup and restore for the new conditional availability
data. This includes:

* Backup and restore of new field.
* Restore updates IDs in conditions, as required.
* Restore converts availability data from legacy (Moodle 2.6) backups.
* Unit tests for all this.
2014-04-07 20:11:41 +01:00
sam marshall
e01efa2cfd MDL-44070 Conditional availability enhancements (3): conditions
Includes all the conditions that were in previous Moodle versions:

* Date
* Grade
* Completion (of another activity)
* User profile field

Also includes conditions that are used to reimplement
groupmembersonly:

* Grouping
* Group

For each condition, the component plus unit tests are included.

PLEASE NOTE: The code to actually check each condition is reused
from previous Moodle versions and has not been modified except to
pass codechecker. This is intentional, to reduce the risk of the
change and maximise the chance that behaviour is preserved. Some
of this code might not be very good and might need updating but
that can happen separately.

AMOS BEGIN
 CPY [contains,core_condition],[op_contains,availability_profile]
 CPY [doesnotcontain,core_condition],[op_doesnotcontain,availability_profile]
 CPY [endswith,core_condition],[op_endswith,availability_profile]
 CPY [isempty,core_condition],[op_isempty,availability_profile]
 CPY [isequalto,core_condition],[op_isequalto,availability_profile]
 CPY [isnotempty,core_condition],[op_isnotempty,availability_profile]
 CPY [startswith,core_condition],[op_startswith,availability_profile]
 CPY [completion_fail,core_condition],[option_fail,availability_completion]
 CPY [completion_pass,core_condition],[option_pass,availability_completion]
 CPY [completion_complete,core_condition],[option_complete,availability_completion]
 CPY [completion_incomplete,core_condition],[option_incomplete,availability_completion]
AMOS END
2014-04-07 20:11:37 +01:00
sam marshall
d3db4b037c MDL-44070 Conditional availability enhancements (2): subsystem, API
This commit defines the new /availability root folder, with
/availability/classes, /availability/tests, and
/availability/condition where the condition plugins will live.
Condition plugin prefix is availability_, e.g. availability_date.

Rationale for this organisation:

1. I was originally going to put this in /lib/availability but
   it has been pointed out that putting even more junk in lib
   is probably bad.
2. 'availability' and 'condition' are the two names used in code
   to refer to this system ($CFG->enableavailability).
3. The prefix has to be short enough to allow database tables
   (although in practice I assume that condition plugins will not
   normally contain database tables).

The new API includes a Boolean tree structure that controls the
availability of an item.

AMOS BEGIN
 CPY [availabilityconditions,core_condition],[restrictaccess,core_availability]
 CPY [enableavailability,core_condition],[enableavailability,core_availability]
 CPY [configenableavailability,core_condition],[enableavailability_desc,core_availability]
AMOS END
2014-04-07 20:11:33 +01:00
sam marshall
8e97006ad0 MDL-44070 Conditional availability enhancements (1): DB upgrade
Converts existing data to new structure in database as part of
upgrade, including a progress bar.

Deletes the database tables and fields that were used by the old
system and are no longer needed.
2014-04-07 18:27:43 +01:00
sam marshall
15c8c47401 MDL-44891 Behat: Add step to check attribute
This commit creates a Behat step of the form:

Then the "title" attribute of "Toggle visibility" "button"
should contain "Show"

This is useful because unless I missed something there is currently
no step that checks attribute values; this seems like a simple
generic step. Behat is intended to check user-visible effects in
the resulting HTML, and sometimes these effects are implemented
using attribute values (two common examples are the alt= attribute,
which is visible to screenreader users, and the title= attribute,
which is visible to all users; there's also the src attribute of
images, and lots of other possibilities too).
2014-04-04 18:17:39 +01:00
Marina Glancy
1a727e121e weekly release 2.7dev 2014-04-03 12:39:44 +08:00
Frederic Massart
52329a32f1 MDL-44747 editor_atto: Improved configuration error messages 2014-04-03 11:24:05 +08:00
Rajesh Taneja
ae8c220fd5 MDL-44832 behat: Fixed behat test 2014-04-03 10:59:58 +08:00
Eloy Lafuente (stronk7)
fc7557677d MDL-44720 modinfo: whitespace fix 2014-04-02 23:17:10 +02:00
Eloy Lafuente (stronk7)
6b8798dedb Merge branch 'wip-MDL-44720-master' of git://github.com/marinaglancy/moodle 2014-04-02 21:32:42 +02:00
Damyon Wiese
c8afcb2e7b Merge branch 'master_MDL-44753' of https://github.com/danmarsden/moodle 2014-04-02 16:33:06 +08:00
Dan Poltawski
00f74dfd0d MDL-44590 course: fix deprecated behat step use 2014-04-02 15:58:29 +08:00
Dan Marsden
e067e6f0ad MDL-44753 SCORM: make correct selection of first sco - also fixes MDL-44896 2014-04-02 20:50:21 +13:00
Marina Glancy
bc348632e1 Merge branch 'MDL-44739-master-fixup' of git://github.com/FMCorz/moodle 2014-04-02 14:57:40 +08:00
Frederic Massart
c682844ae9 MDL-44739 theme_more: Force default settings to be set 2014-04-02 14:56:44 +08:00
Marina Glancy
ac32e42827 Merge branch 'MDL-42891-master' of git://github.com/ankitagarwal/moodle 2014-04-02 14:54:59 +08:00
Ankit Agarwal
2b0c88e2f6 MDL-42891 adminstration: update strings and display for login fails 2014-04-02 14:18:25 +08:00
Sam Hemelryk
e070ffd8ab Merge branch 'MDL-32729-im' of git://github.com/andrewnicols/moodle 2014-04-02 16:37:19 +13:00
Andrew Nicols
5c1af530db MDL-32729 Question: Load all hidden fields from the source form 2014-04-02 10:52:02 +08:00
Eloy Lafuente (stronk7)
c790670d77 Merge branch 'MDL-30085_grade_ws' of git://github.com/jleyva/moodle 2014-04-02 04:05:19 +02:00
Marina Glancy
a5af7087db Merge branch 'MDL-44749-master' of git://github.com/andrewnicols/moodle 2014-04-02 09:56:46 +08:00
Andrew Nicols
f87b22327f MDL-32729 Question: Correct button selection when openin qbank chooser
Some browsers do not bubble form submission events to the window, and we
had more than one form on the page in certain conditions. We need to select
all of the forms on a page and then test the action.
2014-04-02 09:54:32 +08:00
Andrew Nicols
9ad87e7900 MDL-44749 atto_collapse: Skip button inclusion if it will impact UX
Do not show the collapse button if:
* it's specified after the cut-off and would therefore be unusable; or
* the total number of groups matches the number of groups to display anyway.
2014-04-02 09:52:22 +08:00
Marina Glancy
0123472c87 Merge branch 'MDL-41063' of git://github.com/jmvedrine/moodle 2014-04-02 09:46:35 +08:00
Eloy Lafuente (stronk7)
2e20fc3742 Merge branch 'MDL-31262' of git://github.com/timhunt/moodle 2014-04-02 03:18:05 +02:00
Marina Glancy
cc7c745c7d Merge branch 'master_MDL-44753' of git://github.com/danmarsden/moodle 2014-04-02 09:15:33 +08:00
Eloy Lafuente (stronk7)
96eead3f6c MDL-24408 Whitespace fix. 2014-04-02 03:14:36 +02:00
Eloy Lafuente (stronk7)
bfa5acac64 Merge branch 'MDL-24408_2' of https://github.com/oasychev/moodle 2014-04-02 03:14:06 +02:00
Eloy Lafuente (stronk7)
6faa517856 Merge branch 'wip-MDL-34012-master' of git://github.com/marinaglancy/moodle 2014-04-02 02:57:15 +02:00
Eloy Lafuente (stronk7)
b224448ac6 Merge branch 'wip-MDL-43398-master' of git://github.com/marinaglancy/moodle 2014-04-02 02:47:59 +02:00
Eloy Lafuente (stronk7)
0555761203 Merge branch 'w14_MDL-44843_m27_localedash' of https://github.com/skodak/moodle 2014-04-02 02:22:51 +02:00
Eloy Lafuente (stronk7)
bd032a64f9 Merge branch 'wip-MDL-41102-master' of git://github.com/marinaglancy/moodle 2014-04-02 02:18:54 +02:00
Sam Hemelryk
3ed2a4b2cc Merge branch 'w14_MDL-44824_m27_subplugins' of https://github.com/skodak/moodle 2014-04-02 13:04:46 +13:00
Eloy Lafuente (stronk7)
57c92af7ad Merge branch 'MDL-42816-master' of https://github.com/StudiUM/moodle 2014-04-02 01:52:41 +02:00
Eloy Lafuente (stronk7)
929e32489f Merge branch 'MDL-28261-master' of git://github.com/andrewnicols/moodle 2014-04-02 01:12:52 +02:00
Eloy Lafuente (stronk7)
e154e9d8cd Merge branch 'MDL-44000-master' of git://github.com/damyon/moodle
Conflicts:
	lib/editor/atto/plugins/image/yui/build/moodle-atto_image-button/moodle-atto_image-button-min.js
2014-04-02 00:27:30 +02:00
Dan Marsden
c87a50cb45 MDL-44753 SCORM: add check during SCORM restore to make sure valid launch sco is set 2014-04-02 10:01:54 +13:00
Sam Hemelryk
067573bd02 Merge branch 'MDL-44832-master' of git://github.com/damyon/moodle 2014-04-02 09:54:33 +13:00
Sam Hemelryk
de878a38c8 Merge branch 'MDL-44719-master' of git://github.com/FMCorz/moodle
Conflicts:
	lib/deprecatedlib.php
2014-04-02 09:54:13 +13:00
Sam Hemelryk
8412561a3d Merge branch 'MDL-44756_help' of https://github.com/andyjdavis/moodle 2014-04-02 09:51:47 +13:00
Sam Hemelryk
53361c3087 Merge branch 'MDL-44772-master' of git://github.com/FMCorz/moodle
Conflicts:
	lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js
2014-04-02 09:43:25 +13:00
Sam Hemelryk
3b07cc1c4e Merge branch 'MDL-44762-master' of git://github.com/FMCorz/moodle 2014-04-02 09:29:11 +13:00
Sam Hemelryk
9b1a4cde78 Merge branch 'MDL-44834-master' of git://github.com/FMCorz/moodle
Conflicts:
	lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js
2014-04-02 09:28:49 +13:00
Sam Hemelryk
0ea11b7cee Merge branch 'MDL-32729-master' of git://github.com/andrewnicols/moodle
Conflicts:
	theme/bootstrapbase/style/moodle.css
2014-04-02 09:27:23 +13:00
Sam Hemelryk
b9c16d401a Merge branch 'MDL-43284-master' of git://github.com/phalacee/moodle
Conflicts:
	theme/bootstrapbase/style/moodle.css
2014-04-02 09:27:03 +13:00
Eloy Lafuente (stronk7)
eafbd56da9 Merge branch 'wip-MDL-35305-master' of git://github.com/marinaglancy/moodle 2014-04-01 21:50:09 +02:00
Marina Glancy
b3d75528de Merge branch 'w14_MDL-40910_m27_usergraded' of git://github.com/skodak/moodle 2014-04-01 17:40:35 +08:00
Marina Glancy
e3e9701113 Merge branch 'wip-MDL44021' of git://github.com/jennymgray/moodle 2014-04-01 17:40:22 +08:00