60 Commits

Author SHA1 Message Date
Paul Holden
610d2b0812 MDL-75192 reportbuilder: observe start day in current week filter.
Ensure we observe the site configuration/preference for calendar
first day of the week, in the current week date filter.
2022-09-28 12:09:08 +01:00
David Matamoros
131a97406b
MDL-75639 reportbuilder: Add new option to date filter
- In the past: to filter by all dates in the past
- In the future: to filter by all dates in the future
2022-09-09 10:15:28 +02:00
Ilya Tregubov
96dbcc0840 Merge branch 'MDL-75245' of https://github.com/paulholden/moodle 2022-08-30 14:59:50 +04:00
Sara Arjona
87db68a0ce Merge branch 'MDL-75191' of https://github.com/paulholden/moodle 2022-08-30 09:48:29 +02:00
Víctor Déniz
e1c4d1644b Merge branch 'MDL-75290' of https://github.com/paulholden/moodle 2022-08-23 09:02:19 +01:00
Paul Holden
4b8f076560 MDL-75191 reportbuilder: use column callbacks in avg/sum aggregation.
When aggregating a column using either method, for numeric types we
should execute column callbacks to ensure consistent formatting.
2022-08-18 17:04:33 +01:00
Paul Holden
0304508926 MDL-75245 reportbuilder: re-factor current tag elements to new entity.
Update previous implementation of tags (9ebd801c) in report sources to
use equivalent tag entity columns and filters.
2022-08-18 17:01:21 +01:00
Nathan Nguyen
f32913dc65 MDL-67685 core_reportbuilder: Add autocomplete filter 2022-08-02 18:21:37 +07:00
Paul Holden
0d1aadc361 MDL-75290 reportbuilder: show user identity data on access tab.
Observe configured user identity for the site to determine additional
columns and filters to display on custom report access tab.
2022-07-28 20:35:34 +01:00
Paul Holden
5582bc2ded MDL-74656 reportbuilder: ensure nulls preserved in column callbacks.
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>
2022-07-19 08:23:54 +01:00
Paul Holden
721f7a01e8 MDL-74777 reportbuilder: report filter by category/sub-categories.
AMOS BEGIN
 CPY [choosecategory,core_grades],[categoryselect,core_reportbuilder]
AMOS END
2022-06-24 11:44:50 +01:00
Jun Pataleta
86676d6811 Merge branch 'MDL-72184' of https://github.com/paulholden/moodle 2022-06-15 10:27:56 +08:00
Paul Holden
9ebd801c07 MDL-73842 reportbuilder: add tags elements to course/user entities.
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.
2022-06-12 19:53:24 +01:00
Paul Holden
f9b4611156 MDL-72184 reportbuilder: make use of new methods moved to drivers. 2022-06-12 19:31:34 +01:00
Shamim Rezaie
0d61bf1b87 Merge branch 'MDL-73693' of https://github.com/paulholden/moodle 2022-06-10 13:12:35 +02:00
Paul Holden
9ec385a533 MDL-73693 reportbuilder: report filter by specific user. 2022-06-06 09:12:56 +01:00
Ilya Tregubov
3a9b097f5c Merge branch 'MDL-74600' of https://github.com/paulholden/moodle 2022-06-06 12:52:16 +06:00
Sara Arjona
7d317cdc5d Merge branch 'MDL-73988' of https://github.com/paulholden/moodle 2022-05-31 17:04:23 +02:00
Paul Holden
40c574cd74 MDL-73988 reportbuilder: support for getting entity joins in reports.
This allow reports using multiple entities to more easily define the
relationship between them, specifically when they share common joined
tables.
2022-05-19 16:35:09 +01:00
Paul Holden
ea45aefe62 MDL-74675 reportbuilder: preserve column type during aggregation.
When applying callbacks during the group concatenation aggregation
types, ensure the column type is preserved for it's default value.
2022-05-19 16:04:37 +01:00
Paul Holden
1e2dd85346 MDL-74600 reportbuilder: re-factor menu helper methods into exporters.
Encapsulate generation of column/audience menu card data, used in the
editor, from helper class methods to specific exporter classes.
2022-05-19 15:56:37 +01:00
Paul Holden
bc206fdec3 MDL-74165 reportbuilder: helpers to create multiple params/aliases. 2022-05-04 13:08:55 +01:00
Sara Arjona
d51c17a2ca Merge branch 'MDL-74076' of https://github.com/paulholden/moodle 2022-03-17 16:58:00 +01:00
Jun Pataleta
6e528ca463 MDL-74173 reportbuilder: Convert action links to action menu links 2022-03-11 18:35:16 +08:00
Paul Holden
2916f89d12 MDL-74106 reportbuilder: handle non-recurring schedules properly.
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).
2022-03-07 15:47:33 +00:00
Paul Holden
ad7583cd33 MDL-74076 reportbuilder: deterministic ordering of schedule users.
Now that we have consistent ordering we can also revert 898f3d0a.
2022-03-04 15:25:22 +00:00
Eloy Lafuente (stronk7)
fba1593893 Merge branch 'MDL-73941' of https://github.com/paulholden/moodle 2022-03-01 16:10:37 +01:00
Paul Holden
0ead4cefd2 MDL-73983 reportbuilder: fix pre-defined action title attribute.
Since switching to report actions being displayed via action menus
in 48a6e927, pre-defined action titles weren't displayed.
2022-02-28 13:37:43 +01:00
Paul Holden
b95a655a33 MDL-73941 reportbuilder: return localised floats when aggregating.
As the 'average' and 'percentage' aggregation types both return
float values, we should ensure they are output with localised
formatting (e.g. decimal separator).
2022-02-20 07:43:32 +00:00
Paul Holden
a73d989a65 MDL-73682 reportbuilder: allow columns to define how they're sorted. 2022-02-02 10:17:56 +00:00
Ilya Tregubov
c94d463afa Merge branch 'MDL-73706' of git://github.com/paulholden/moodle 2022-01-31 16:59:15 +02:00
Paul Holden
eb2e261df4 MDL-73706 reportbuilder: fix count for columns with multiple fields.
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.
2022-01-28 15:38:40 +00:00
Jun Pataleta
fbc3e7568e Merge branch 'MDL-73493' of git://github.com/paulholden/moodle 2022-01-24 17:32:32 +08:00
Paul Holden
628541b5e1 MDL-73493 reportbuilder: correct handling of empty string in filters.
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>
2022-01-21 15:43:01 +00:00
Paul Holden
a844d885b2 MDL-73180 reportbuilder: improve relative date filter definitions.
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.
2022-01-19 08:22:03 +00:00
Paul Holden
ee566b88a8 MDL-72757 reportbuilder: improve model event tests.
Remove some boilerplate/duplication in the current test methods
using @depends annotation to pass persistents between them.
2022-01-10 17:21:23 +01:00
David Matamoros
39b90208e1 MDL-72757 reportbuilder: Events for CRUD operations on report models 2022-01-05 09:55:36 +01:00
Paul Holden
335f608abb MDL-72598 reportbuilder: tasks and API for report schedule delivery. 2021-12-21 09:44:43 +00:00
Paul Holden
a05683d027 MDL-72598 reportbuilder: interface elements for creating schedules.
Add new tab to the report editor, with system report, external API
and Javascript modules for managing report schedules.
2021-12-21 08:57:17 +00:00
Víctor Déniz
3eafc7a1bc Merge branch 'MDL-73280' of git://github.com/paulholden/moodle 2021-12-13 18:44:10 +00:00
Paul Holden
8bed417833 MDL-73280 reportbuilder: format checkbox profile fields correctly. 2021-12-09 14:09:44 +00:00
Eloy Lafuente (stronk7)
deb0e76eee MDL-73278 phpunit: Rename already namespaced classes to match file name
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.
2021-12-07 23:54:29 +01:00
Paul Holden
881dccaa7d MDL-73069 reportbuilder: filter/condition for selecting user.
This allows a report creator to create personalised reports
according to the user who is viewing the report.
2021-11-22 09:17:52 +00:00
David Matamoros
aaa041a9bd MDL-73001 reportbuilder: Allow to set custom title to fullname columns 2021-11-08 13:54:41 +01:00
Ilya Tregubov
6b0b757124 Merge branch 'MDL-72961' of https://github.com/paulholden/moodle 2021-11-04 14:40:26 +02:00
Paul Holden
cac0068d88 MDL-72961 reportbuilder: move category elements to correct entity. 2021-11-01 15:44:14 +00:00
Jun Pataleta
6f7defeeb6 Merge branch 'MDL-72588' of git://github.com/dravek/moodle 2021-11-01 11:22:48 +08:00
David Matamoros
70085ef7ac MDL-72588 reportbuilder: implement audience helpers and classes.
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>
2021-10-29 12:28:24 +02:00
Paul Holden
5ec86bf501 MDL-72663 reportbuilder: improvements to column aggregation methods.
The group concatenation types now consistently sort the returned values
and support aggregating columns containing multiple fields and those
with defined callbacks.
2021-10-22 16:17:31 +01:00
Paul Holden
16a65f73e7 MDL-72663 reportbuilder: column API changes to improve aggregation.
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
2021-10-22 16:17:17 +01:00