Commit graph

124 commits

Author SHA1 Message Date
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
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
Paul Holden
6312467346
MDL-77614 reportbuilder: throw exception if entity name already exists. 2023-04-25 12:55:09 +01:00
Shamim Rezaie
b54fbcf532
Merge branch 'MDL-77555' of https://github.com/paulholden/moodle 2023-04-05 11:25:16 +01:00
Paul Holden
5d0f34bde2
MDL-77555 reportbuilder: improve SQL generation within filters.
Use native ANSI SQL syntax for numeric comparisons where possible,
define filter API for the case where filters must re-use the given
field SQL while ensuring uniqueness of any field parameters.

Currently only necessary in the category filter type.
2023-04-05 09:37:37 +01:00
Paul Holden
4146329063
MDL-77555 reportbuilder: method to ensure unique parameters in SQL. 2023-03-27 10:29:25 +01:00
Anupama Sarjoshi
79370e225e MDL-77659 core_reportbuilder: fix user profile fields phpunit tests 2023-03-20 12:19:57 +00:00
Paul Holden
198db552b0
MDL-77056 reportbuilder: relative date filter for before given period. 2023-03-07 22:46:50 +00:00
Paul Holden
650b6caf83 MDL-77201 reportbuilder: pass current aggregation to column callbacks. 2023-02-14 11:03:03 +00:00
Andrew Nicols
92d04b9e7b Merge branch 'MDL-77091' of https://github.com/paulholden/moodle 2023-02-06 12:58:56 +08:00
Paul Holden
147c31800b MDL-75345 reportbuilder: improve course/user custom report tests.
Ensure column and filters provided by each source have sufficient
coverage. Re-factor individual entity/helper class tests to test
their own specific implementation only.

Remove now-defunct test fixtures.
2023-02-01 15:41:32 +00:00
Paul Holden
5b644bfd30 MDL-77091 reportbuilder: set base time in schedule test generator.
The base time allows for the setting of the "current time" for the
purposes of the schedule test against recurrence configuration.

We should ensure the generator method allows this property so that
it can be used when calculating the initial "next send time" of the
schedule upon creation (and avoiding excessive recursion when the
actual current time is used for the calculation).
2023-02-01 14:39:21 +00:00