When concatenating column fields in order to perform aggregation on
them (e.g. group concatenation), we need to preserve all null values
in the data passed to each column callback.
Co-authored-by: Carlos Castillo <carlos.castillo@moodle.com>
Both entities define columns and filters for related tags (referred
to as "interests" for users).
Create new generic tags filter type to facilitate this, which can be
re-used by any entities for components which support tagging.
When a schedule is created with "No recurrence", it should only be
sent when both conditions are true: it's start time is after the
current time; and the time it was last sent is before it's start
time (either 0/never sent; or a time it was manually sent).
As the 'average' and 'percentage' aggregation types both return
float values, we should ensure they are output with localised
formatting (e.g. decimal separator).
When using the "Count distinct" aggregation type on a column that
selects multiple fields, we should account for each of them in the
returned SQL.
Move helper method to facilitate this to the base aggregation class
so it can be re-used between all types.
This is specifically for Oracle, which treats empty strings and NULL
in an inconsistent manner unless passed as query parameters. Increase
test coverage of the same.
Co-authored-by: Carlos Castillo <carlos.castillo@moodle.com>
Changes since the original implementation in e55abd71 mean that
relative date filtering (by last/next day/week, etc) is now based
on the actual current time, rather than the start or end of the
current time unit.
These are the only cases 100% safe to apply the renaming of the
testcase class names to match the file names.
All other cases are not safe, because they are missing namespace
and may enter into name conflicts. Adding namespaces is not as
simple as imagined because it implies to, also, add a good number
of modifications to core. See the issue for more details.
Create the base audience class, to be extended by all audience types
across the site. Implement types allowing audiences to be created per
user, cohort or system role assignment.
The helper class is used for interrogating report audience instances
and retrieving access lists of those users able to view specific
reports.
Co-authored-by: Paul Holden <paulh@moodle.com>
The group concatenation types now consistently sort the returned values
and support aggregating columns containing multiple fields and those
with defined callbacks.
Refinements to how columns can be defined in relation to available
aggregation methods:
* Disable aggregation types;
* Set column GROUP BY during aggregation;
* Defer column sorting to that of the aggregation method