369 Commits

Author SHA1 Message Date
Paul Holden
534b2b1c69
MDL-84000 reportbuilder: move testcase helper to autoloaded namespace.
Clean up some class imports while we're at it.
2024-12-13 12:49:00 +00:00
Andrew Nicols
5be481d1d0
MDL-81520 core: Fix test finality 2024-12-11 12:30:21 +08:00
Andrew Nicols
3d51aed3e2
MDL-81521 core: Update all possibly data providers to be static
Note: Some data providers could not be automatically be converted to
being static. These will be handled in a separate issue.
2024-11-19 09:30:51 +08:00
Paul Holden
bb6a65da42
MDL-83180 reportbuilder: correct access check for viewing schedules. 2024-10-02 16:50:08 +08:00
Paul Holden
90d7307872
MDL-83181 reportbuilder: ensure audience correctness before delete. 2024-09-30 15:34:03 +07:00
Marina Glancy
9639feb9a3 MDL-82567 core: Add has_capability method
Co-authored-by: David Woloszyn <david.woloszyn@moodle.com>
Co-authored-by: Jun Pataleta <jun@moodle.com>
2024-08-24 06:30:25 +00:00
Paul Holden
7666131199
MDL-82006 reportbuilder: move filter Behat scenarios inside component. 2024-08-15 13:54:13 +01:00
Marina Glancy
9747b5b26b MDL-80907 various: fixes to incorrect column selectors in behat 2024-05-07 19:33:47 +01:00
Paul Holden
053aa290b2
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:47 +00:00
Paul Holden
38909cd64e
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:34 +01:00
Paul Holden
73939586b6
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:43:29 +01:00
Paul Holden
e8526347a3
MDL-78350 reportbuilder: parse javascript before rendering template. 2023-06-21 17:33:33 +01:00
Andrew Nicols
b66d82ccb4
Merge branch 'MDL-77569-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-06-15 12:00:55 +08:00
Paul Holden
eea061bc42
MDL-77569 reportbuilder: cache custom report element persistents.
During request lifecycle ensure that column, filter and condition
persistents are only loaded a single time to prevent additional
database reads.

Provide invalidation method, used by the report helpers, to ensure
that the persistents are re-loaded appropriately.

This is a backport of MDL-76901.

Co-authored-by: Marina Glancy <marina@moodle.com>
2023-06-08 10:00:19 +01:00
Paul Holden
6843ba0aad
MDL-78364 reportbuilder: earlier calculation of schedule recipients. 2023-06-05 16:22:33 +01:00
Shamim Rezaie
ddaf4b7a58 Merge branch 'MDL-77555-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-04-05 20:15:39 +10:00
Paul Holden
be58d68f20
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:40:31 +01:00
Sara Arjona
0d6eaef200 Merge branch 'MDL-77659_401' of https://github.com/AnupamaSarjoshi/moodle into MOODLE_401_STABLE 2023-03-27 16:50:31 +02:00
Paul Holden
f2cbacbd24
MDL-77555 reportbuilder: method to ensure unique parameters in SQL. 2023-03-27 10:29:31 +01:00
Sara Arjona
d2d49e150b Merge branch 'MDL-77705-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-03-23 18:30:27 +01:00
Paul Holden
ee3924702f
MDL-77705 reportbuilder: avoid re-using field alias between entities.
Ensure that when the user entity is added multiple times to a report,
when there are custom profile fields, each of those gets a unique table
alias per-entity.
2023-03-21 17:29:09 +00:00
Paul Holden
fac1828222
MDL-77692 reportbuilder: format custom field condition/filter names. 2023-03-20 16:32:08 +00:00
Anupama Sarjoshi
3fee9d949f MDL-77659 core_reportbuilder: fix user profile fields phpunit tests 2023-03-20 13:53:46 +00:00
Andrew Nicols
cd48ae56c7 MDL-77559 js: Rebuild all JS with Node 16 2023-03-09 09:53:19 +08:00
Jun Pataleta
a377bf30c4 Merge branch 'MDL-75012-401-5' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2023-03-02 12:31:09 +08:00
Andrew Nicols
288620b0b4 MDL-75012 js: Full build of all grunt things 2023-03-02 12:15:25 +08:00
Paul Holden
53c2d0ad15 MDL-77321 reportbuilder: cache list of loaded reports per user.
Since 0188af39 we've cached loaded reports, however there was an
edge case in those report sources that relied on the current user
as part of their own initialization (e.g. checking capabilities).

Co-authored-by: Marina Glancy <marina@moodle.com>
2023-02-27 21:16:23 +00:00
Andrew Nicols
352db923e1 Merge branch 'MDL-77352-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-02-23 11:20:16 +08:00
Paul Holden
c3504d5e4c MDL-77352 javascript: declare debouncer outside the event handler.
It needs to be declared as such, otherwise each time the event is
triggered a new debouncer is created.
2023-02-21 22:47:50 +00:00
Paul Holden
9829e77a6d MDL-76873 reportbuilder: correct checks for profile field visibility. 2023-02-20 09:22:07 +00:00
Mikel Martín
8d9a898bb5 MDL-77223 reportbuilder: Fix first report column as integer 2023-02-13 16:17:39 +01:00
Andrew Nicols
b21e31b016 Merge branch 'MDL-77091-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-02-06 12:59:33 +08:00
Paul Holden
c125d5f3f2 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:28 +00:00
Paul Holden
4b9e614eaf 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:36 +00:00
Jun Pataleta
28ccae3b7a Merge branch 'MDL-76739-401' of https://github.com/junpataleta/moodle into MOODLE_401_STABLE 2023-01-12 10:17:37 +08:00
David Mudrák
acd82d3a86 MDL-76739 lang: Use the fixed strings in the tests, too 2023-01-10 21:15:06 +01:00
Paul Holden
ee507d22ec MDL-76812 reportbuilder: ensure audience key is incremented correctly. 2023-01-06 09:58:05 +00:00
Sara Arjona
1cf0f78b9a Merge branch 'MDL-76221-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-01-04 13:09:18 +01:00
Paul Holden
4ecd652189 MDL-76221 reportbuilder: improve report test generator methods.
Test generators for creating report columns, filters and conditions
now allow for setting all persistent properties.
2023-01-04 10:56:23 +00:00
Paul Holden
0dbc7187ff MDL-76181 reportbuilder: sort columns during stress testing. 2022-12-29 13:57:37 +00:00
Andrew Nicols
be5cf43aa4 Merge branch 'MDL-76398-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2022-12-11 20:20:19 +08:00
Paul Holden
76fde950c1 MDL-76398 reportbuilder: use improved action menu steps in Behat.
Improved steps for using actions menus were added in 232ebac3, so
make use of them here for consistency/reliability.
2022-12-02 09:55:55 +00:00
Ilya Tregubov
9d801ab8a0 Merge branch 'MDL-76494-401' of https://github.com/marinaglancy/moodle into MOODLE_401_STABLE 2022-12-02 08:41:34 +03:00
Marina Glancy
a5f92c041e MDL-74853 various: add second parameter to htmlentities functions
Default value of the $flag argument changed in PHP 8.1 from ENT_COMPAT to ENT_QUOTES | ENT_SUBSTITUTE
To ensure consistent behavior across different PHP version the second parameter is now required for the functions:
htmlspecialchars(), htmlentities(), htmlspecialchars_decode(), html_entity_decode() and get_html_translation_table()
2022-11-28 16:12:32 +01:00
Marina Glancy
02430ee562 MDL-76494 core_reportbuilder: behat test for downloading report 2022-11-28 15:56:54 +01:00
Marina Glancy
064eccd4fc MDL-75525 reportbuilder: specify initial sorting for datasources 2022-11-07 15:43:45 +01:00
Sara Arjona
7d53813db7 Merge branch 'MDL-75349' of https://github.com/paulholden/moodle 2022-11-04 12:06:36 +03:00
Sara Arjona
b8ae747056 Merge branch 'MDL-75535' of https://github.com/paulholden/moodle 2022-11-04 11:01:41 +08:00
Jun Pataleta
9bdfcc46d3 Merge branch 'MDL-75358-master' of https://github.com/marinaglancy/moodle 2022-10-31 10:10:16 +08:00
Sara Arjona
9000fd3037 Merge branch 'MDL-75449' of https://github.com/paulholden/moodle 2022-10-27 17:24:11 +02:00