With this patch, the additional roles/groups/groupings columns get moved
to a special "enrolment details" view. To support this, the handling of
the $mode is revamped to use $mode constants.
To keep performance issues at bay, the enrolment details view is only
available when viewing paginated resultsets, and will reset itself to
'brief' if the conditions aren't met. The $mode is sticky, so it is
quite possible to have a mismatched $mode -- so he handle the case
explicitly.
The participants page will now show (to users that have
moodle/role:assign) the relevant enrolments for each participant.
This is done with a second SELECT using a WHERE id IN() so we are
limited to doing it with small datasets. This is for 2 reasons
- we cannot retrieve all teh data in the "main" SELECT because
the outer joins will bring dup rows, breaking LIMIT
- we cannot use the main SELECT as a subselect because we cannot
retrieve the LIMIT part of the statement with the current dmllib
- on large courses / sitecourse performance would be horrible
so it is limited to paginated datasets. It is doing 20 recs at a time,
the "extra" SELECT takes ~7ms on a some large Pg databases).
This will generate an extra DB query on Oracle (and any other DB that
cannot rewind the recordset) because we walk the main rs twice.
While at it, ensure we mark the unsortable columns thus...
MDL-11566 only site shortname, fullname and desc are required/displayed during installation
MDL-11567 fixed upgradesettings redirects if error in settings
MDL-11143 defaultfrontpageroleid moved to Frontpage settings page (easier to find), speedup
user/index: ensure each user appears only once in participants list
Regardless of the number of enrolments, ensure we list a single entry
per user using DISTINCT. Much easier to manage than a GROUP BY.
Memory usage was still high for long userlists. Use recordsets
to manage memory growth.
Note that we are still collecting a long long HTML table in memory
before we print it, so the footprint of the html itself is bit of an
issue.
With this patch, we fetch participants contexts in the main search
query. This cuts 1DBq per participant for the display.
Might fix MDL-11222 'global teacher viewing participants issues' where
we are getting OOM'd with many users.