134 Commits

Author SHA1 Message Date
Huong Nguyen
2b724556ee
Merge branch 'MDL-80669' of https://github.com/paulholden/moodle 2024-07-25 11:01:56 +07:00
Paul Holden
892b68d58c
MDL-80669 reportbuilder: improved reporting of custom/profile fields.
Make the display of both custom and user profile fields consistent in
column callbacks. The defaults for each should be considered when both
rendering the column data and also when aggregating them (specifically
for numeric columns to ensure calculations are accurate).

When such fields are filtered, and they have user defined default
values then we should also take that into account to ensure that the
same values rendered in columns can always be filtered for.

During this change, I've updated some of the variables to improve
readability and future maintainability of these classes. Annoyingly
there are a non-zero number of changes just for Oracle support.
2024-07-19 10:48:12 +01:00
Paul Holden
8426610258
MDL-82466 reportbuilder: new format helper for formatting time. 2024-07-19 10:33:57 +01:00
Paul Holden
2d25cf1401
MDL-82331 reportbuilder: date filtering down to the nearest minute. 2024-06-28 10:36:48 +01:00
Huong Nguyen
053e0e8a87
Merge branch 'MDL-82068' of https://github.com/paulholden/moodle 2024-06-27 11:19:38 +07:00
Eloy Lafuente (stronk7)
674497a12c
MDL-81523 phpunit: Add all missing setUp/tearDown parent calls
All setUp(), tearDown(), setUpBeforeClass() and tearDownAfterClass()
must, always, call to parent, to ensure that everything is properly
set and cleaned.

While in a lot of situations this is not needed (parents may not
have anything to run), with PHPUnit >= 10 this can become more
important because we are going to move the reset code from current
placement @ runBare() to setUp()/tearDown().

Note that all the changes performed in this commit have been detected
and fixed by moodle-cs (ParentSetUpTearDownSniffTest).
2024-06-14 16:04:57 +02:00
Paul Holden
7c3b8c0a40
MDL-82068 reportbuilder: re-factor SQL JOIN collection to trait.
Replace identical implementation of the same in various classes with
usage of the new trait. Implement constructor property promotion in
modified classes at the same time, to help clean up/clarify class
properties.
2024-06-05 13:36:22 +01:00
Paul Holden
a33e54c08f
MDL-82041 reportbuilder: switch time-sensitive code to new Clock API.
Where current implementation, and more specifically tests, rely on the
current time then replace that with the PSR-20 Clock from 298c13ac3b.

Applicable updates to the date filter and report scheduling calculation.
2024-05-31 15:37:42 +01:00
Sara Arjona
a7097cd8d4
Merge branch 'MDL-81168' of https://github.com/paulholden/moodle 2024-05-14 17:36:52 +02:00
Paul Holden
9b827c09ce
MDL-81434 reportbuilder: ensure filter/condition parameter uniqueness.
This change fixes an edge case that could be triggered by creating a
custom report that contained a filter instance that was active as both
a filter and condition, where the filter instance provides parameters
to it's SQL fragment.

There is only one such filter present currently with which we can test
this, see 2f9001cbe9.
2024-05-10 09:48:52 +01:00
Paul Holden
d9f05b81d0
MDL-81168 reportbuilder: better float input support in filters.
Support localised float values in filter forms, so that locales that
use different decimal separators work as expected.

Note lack of current support in the date filter.
2024-05-10 09:47:21 +01:00
Carlos Castillo
92211f291f MDL-81489 reportbuilder: Optional tags when create/update reports
Make tags property optional when create/update report.
2024-04-10 10:17:22 +02:00
Shamim Rezaie
278ccdb7c4 Merge branch 'MDL-81126' of https://github.com/paulholden/moodle 2024-03-27 16:59:56 +11:00
Sara Arjona
484e52f6ae
Merge branch 'MDL-80245' of https://github.com/paulholden/moodle 2024-03-21 15:01:18 +01:00
Eloy Lafuente (stronk7)
361dfe8145
MDL-75952 general: Since php81, refection->setAccessible() is no-op
Refereces:
- https://wiki.php.net/rfc/make-reflection-setaccessible-no-op
- https://www.php.net/manual/en/reflectionproperty.setaccessible.php
- https://www.php.net/manual/en/reflectionmethod.setaccessible.php

As of PHP 8.1.0, calling this method has no effect; all methods are
invokable by default. So, let's remove all uses from core, they are
no-op.
2024-03-10 21:15:00 +01:00
Ilya Tregubov
82859f1848 Merge branch 'MDL-80943' of https://github.com/paulholden/moodle 2024-03-08 09:21:44 +08:00
Jun Pataleta
3278ce7aba
Merge branch 'MDL-65292' of https://github.com/stronk7/moodle 2024-03-08 08:00:41 +08:00
Ilya Tregubov
a6fd25485e Merge branch 'MDL-80342' of https://github.com/paulholden/moodle 2024-03-07 08:51:25 +08:00
Paul Holden
47790ea315
MDL-80245 tag: allow for tags filter to operate in component mode.
This allows the filter to be more easily re-used for component system
reports that want to filter by their own tags.
2024-03-06 20:31:07 +00:00
Paul Holden
a1f064339d
MDL-80245 reportbuilder: define custom report tags area. 2024-03-06 20:31:07 +00:00
Paul Holden
4bd8f3a0dc
MDL-80943 reportbuilder: select-type customfields should be text.
The column type determines the available aggregation options present
for the column. Custom fields of type "select" should be considered as
text fields for this purpose, because their stored value represents
the index to their available options, rather than having any distinct
meaning of it's own for display.
2024-03-06 10:34:45 +00:00
Paul Holden
6eb1688887
MDL-81126 reportbuilder: relative date filter for after given period.
This is the inverse of the "before" date filter added in 198db552.
2024-03-05 11:51:00 +00:00
Eloy Lafuente (stronk7)
ba1f804ffa
MDL-65292 style: Fix all function declarations white space
This has been generated running the following Sniffs, all
them part of the Moodle's CodeSniffer standard:
- PSR12.Functions.ReturnTypeDeclaration
- PSR12.Functions.NullableTypeDeclaration
- moodle.Methods.MethodDeclarationSpacing
- Squiz.Whitespace.ScopeKeywordSpacing

All them are, exclusively, about correct spacing, so the changes
are, all them, only white space changes.

Only exceptions to the above are 3 changes what were setting the
return type in a new line, and, when that happens, the closing
parenthesis (bracket) has to go to the same line than the colon.
2024-02-28 23:33:26 +01:00
Paul Holden
7f342377bb
MDL-80342 cohort: new report filter class for selecting cohorts. 2024-02-21 16:34:35 +00:00
Huong Nguyen
f406ea8b76
Merge branch 'MDL-80936' of https://github.com/paulholden/moodle 2024-02-20 10:28:10 +07:00
Paul Holden
c6ef18085f
MDL-80936 reportbuilder: fix when default customfield values are shown.
We should ensure we only show a value for the custom field (default or
otherwise) when it's actually joined to an entity it represents.
2024-02-14 11:29:27 +00:00
Paul Holden
b8a87bd354
MDL-80807 reportbuilder: additional tests for aggregated column sort. 2024-02-06 09:47:57 +00:00
Paul Holden
27cb7506db
MDL-80619 reportbuilder: add capability to allow viewing all reports. 2024-01-19 13:30:23 +00:00
Paul Holden
2097872510
Merge branch 'MDL-80564' of https://github.com/marinaglancy/moodle into main 2024-01-12 09:07:38 +00:00
Sara Arjona
53a9613bab
Merge branch 'MDL-80014' of https://github.com/paulholden/moodle 2024-01-10 16:10:08 +01:00
Marina Glancy
27c6c174d8 MDL-80564 reportbuilder: Consistent permission check for user full name 2024-01-09 17:50:56 +00:00
Paul Holden
e56e9cd6de
MDL-80329 reportbuilder: trim whitespace in text filter content. 2023-12-13 10:15:32 +00:00
Paul Holden
bf39fc43b4
MDL-80014 reportbuilder: entity method to retrieve all table aliases. 2023-12-13 10:06:19 +00:00
Paul Holden
fb53d081da
MDL-79397 reportbuilder: always auto-generate entity table aliases.
As the number of report entity classes has grown, each having their own
manually defined table aliases, it becomes harder to ensure each of the
aliases are always unique across report sources.

We can remove that burden by ensuring table aliases are automatically
generated upon request.
2023-12-07 17:19:01 +00:00
Sara Arjona
02b188d6c9
Merge branch 'MDL-79216' of https://github.com/paulholden/moodle 2023-12-05 16:46:10 +01:00
Paul Holden
176ed8e798
MDL-80254 reportbuilder: better handling of deleted users in schedules.
We should verify that schedule and audience users are active accounts,
and that we don't try to send report schedules either from/to them if
they aren't.
2023-12-04 09:48:39 +00:00
Paul Holden
0d9b79fb20
MDL-79216 files: new report filter type for filesize data. 2023-12-01 09:39:01 +00:00
Paul Holden
6a9eadceb6
MDL-79998 reportbuilder: user entity method to get identity fields. 2023-11-10 10:22:51 +00:00
Ilya Tregubov
8d7511b230
Merge branch 'MDL-79446' of https://github.com/paulholden/moodle 2023-11-06 09:13:47 +08:00
Paul Holden
da6ef4ac1d
MDL-79705 reportbuilder: remove checkbox field callback handling.
We no longer need special handling of this field type, because it
now returns language strings rather than HTML markup for a checkbox
element on display.
2023-10-17 16:51:26 +01:00
Paul Holden
e19c4e89d1
MDL-79446 reportbuilder: optional $suffix for generated alias/params.
Allows for, and documents, intended usage when the result of these
methods is used elsewhere (e.g. in `$DB->get_in_or_equal`).
2023-10-11 15:10:39 +01:00
Sara Arjona
999fbc3bdd
Merge branch 'MDL-75855' of https://github.com/paulholden/moodle 2023-08-24 16:49:34 +02:00
Ilya Tregubov
60693cd9b6
Merge branch 'MDL-77067' of https://github.com/paulholden/moodle 2023-08-24 09:59:58 +08:00
Paul Holden
b9a5a3626e
MDL-77067 reportbuilder: indicate when audiences are used in schedules.
Indicate in each audience card whether it's used as part of a report
schedule, and inform user again upon deletion of said audience.
2023-08-23 16:09:17 +01:00
Paul Holden
8fe1f83fe1
MDL-75855 reportbuilder: don't allow condition/filter duplication.
Custom reports shouldn't allow the same condition and/or filter
instance to exist more that once per report.
2023-08-22 18:47:33 +01:00
Paul Holden
3ca41c77e4
MDL-76902 reportbuilder: entity method for defining table join alias. 2023-08-22 15:16:31 +01:00
Sara Arjona
565d6a45a3
Merge branch 'MDL-78879' of https://github.com/paulholden/moodle 2023-08-08 13:04:30 +02:00
Paul Holden
e4e7e59d90
MDL-78807 reportbuilder: ensure report base conditions are non-empty. 2023-08-02 13:50:50 +01:00
Paul Holden
501a170cb6
MDL-78879 reportbuilder: allow for negation of category filter.
Add "Equal to" and "Not equal to" operators to the filter class.

AMOS BEGIN
 CPY [subcats,qtype_randomsamatch],[includesubcategories,moodle]
AMOS END
2023-08-02 12:26:54 +01:00
Paul Holden
2ffda63da8
MDL-75359 reportbuilder: fixes for custom/user profile field elements.
Ensures cross-DB compatibility for all types of both custom and user
profile fields, specifically when they're filtered and/or aggregated.

Implement stress testing of both via appropriate report sources.
2023-07-07 14:45:24 +01:00