511 Commits

Author SHA1 Message Date
Paul Holden
f442e8d5ad
MDL-82809 reportbuilder: always apply conditions to custom report.
Including those that are otherwise unavailable to the current user,
ensuring that they are always applied when viewing report output.
2024-10-16 10:51:52 +01:00
Paul Holden
07bc841860
MDL-82809 reportbuilder: load custom/profile fields consistently.
Ensure that provided columns and filters for each use appropriate
checks to determine their availability (based on user permissions,
etc), rather than conditionally adding them to the entity.
2024-10-16 09:11:20 +01:00
Paul Holden
6e77a2070d
MDL-83180 reportbuilder: correct access check for viewing schedules. 2024-10-02 16:49:26 +08:00
Paul Holden
4a68972a4a MDL-83181 reportbuilder: ensure audience correctness before delete. 2024-10-01 12:41:17 +00:00
Ilya Tregubov
4eed515242 Merge branch 'MDL-82488-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-09-20 09:25:13 +08:00
Ilya Tregubov
084dbef995 Merge branch 'MDL-82494-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-09-19 14:05:19 +08:00
Paul Holden
230831bc70
MDL-82494 user: correct profile field name formatting method.
Add optional `$escape` parameter to allow for unescaped return.
2024-08-30 09:48:08 +01:00
Paul Holden
60e11dc998
MDL-82488 customfield: allow for unescaped field formatted names.
Resolves double encoding of the same in Report builder editor.
2024-08-30 09:44:41 +01:00
Paul Holden
cd69894e95
MDL-82804 badges: define no results notice inside report instances.
When doing so from calling code, the property is not persisted when
filtering/paging (or any AJAX interaction); instead, it should be
set from within the report instance itself.
2024-08-29 16:37:58 +01:00
Marina Glancy
aca6d79b91 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-26 04:01:20 +00:00
Paul Holden
ef70a58aed
MDL-82006 reportbuilder: move filter Behat scenarios inside component. 2024-08-15 13:15:26 +01:00
Paul Holden
904222b6f2
MDL-82481 reportbuilder: re-use existing method for field options. 2024-07-18 14:03:18 +01:00
Huong Nguyen
a0a2015027
Merge branch 'MDL-80907-404' of https://github.com/marinaglancy/moodle into MOODLE_404_STABLE 2024-07-04 11:13:38 +07:00
Huong Nguyen
32bf836fec
Merge branch 'MDL-81434-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-05-14 08:52:47 +07:00
Marina Glancy
ad9d4bb4af MDL-80907 various: fixes to incorrect column selectors in behat 2024-05-07 19:28:46 +01:00
Paul Holden
1c2f5dc1df
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-07 15:03:16 +01:00
David Carrillo
7741ae3094
MDL-81776 reportbuilder: Check tagarea enabled when check availability
- When checking availability for a column/filter we need to assert
tagarea is enabled because it can return also null value.
2024-05-03 12:22:46 +02:00
Paul Holden
410b333e47
MDL-81603 reportbuilder: don't rely on real entity in datasource test. 2024-04-22 11:24:10 +01:00
Paul Holden
17fd4fe8f5
Merge branch 'MDL-81489' of https://github.com/lostrogit/moodle into main 2024-04-10 14:03:10 +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
David Carrillo
45d366d463
MDL-81488 reportbuilder: Fix incorrect string in report number filter 2024-04-10 09:23:10 +02:00
Shamim Rezaie
278ccdb7c4 Merge branch 'MDL-81126' of https://github.com/paulholden/moodle 2024-03-27 16:59:56 +11:00
Daniel Ziegenberg
08027e408c
MDL-81281 phpunit: assertObjectHasAttribute is deprecated
To be integrated as part of MDL-81266

When running PHPUnit 9.6 we get the following deprecation warnings:
"assertObjectHasAttribute() is deprecated and will be removed in PHPUnit
10. Refactor your test to use assertObjectHasProperty() instead."

So we replace all instances of assertObjectHasAttribute with
assertObjectHasProperty.

PHPUnit justifies the change with:
> PHPUnit currently refers to "fields" (see above) as "attributes". This
> is (or will become) confusing considering the introduction of
> attributes in PHP 8 and their support in PHPUnit.  PHPUnit will be
> changed to use the term "property" instead of "attribute" where "field"
> is meant.

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2024-03-25 16:21:45 +01:00
Daniel Ziegenberg
87267da39d
MDL-81281 phpunit: assertObjectNotHasAttribute is deprecated
To be integrated as part of MDL-81266

When running PHPUnit 9.6 we get the following deprecation warnings:
"assertObjectNotHasAttribute() is deprecated and will be removed in PHPUnit
10. Refactor your test to use assertObjectNotHasProperty() instead."

So we replace all instances of assertObjectNotHasAttribute with
assertObjectNotHasProperty.

PHPUnit justifies the change with:
> PHPUnit currently refers to "fields" (see above) as "attributes". This
> is (or will become) confusing considering the introduction of
> attributes in PHP 8 and their support in PHPUnit.  PHPUnit will be
> changed to use the term "property" instead of "attribute" where "field"
> is meant.

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2024-03-25 16:21:07 +01:00
Jun Pataleta
e366db6c55
Merge branch 'MDL-80843' of https://github.com/paulholden/moodle 2024-03-22 11:34:23 +08:00
Sara Arjona
484e52f6ae
Merge branch 'MDL-80245' of https://github.com/paulholden/moodle 2024-03-21 15:01:18 +01:00
Paul Holden
fbfcb6733d
MDL-80245 reportbuilder: implement interface elements for report tags.
Allow them to be edited during report creation/updating, display in
report listings table with filtering, and implement tag callback to
allow them to be discoverable across the site.
2024-03-21 13:11:22 +00:00
Sara Arjona
05dd0cd384
Merge branch 'MDL-80204-master' of https://github.com/izendegi/moodle 2024-03-13 12:24:41 +01:00
Iñigo Zendegi
a840d06652 MDL-80204 lang: Polysemic lang strings to & from
AMOS BEGIN
 CPY [to,moodle],[todate,moodle]
 MOV [to,moodle],[torecipient,moodle]
 CPY [from,moodle],[fromdate,moodle]
 MOV [from,moodle],[fromsender,moodle]
AMOS END
2024-03-12 11:51:03 +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
d3557d9483
MDL-80843 reportbuilder: consistent user auth report entity data.
Tidy up unit tests for user report, removing some redundancy and
duplication.
2024-02-23 09:28:44 +00:00
Paul Holden
7f342377bb
MDL-80342 cohort: new report filter class for selecting cohorts. 2024-02-21 16:34:35 +00:00
Sara Arjona
4a9be9001d
Merge branch 'MDL-80912' of https://github.com/paulholden/moodle 2024-02-20 15:39:18 +01:00
Huong Nguyen
f406ea8b76
Merge branch 'MDL-80936' of https://github.com/paulholden/moodle 2024-02-20 10:28:10 +07:00
Paul Holden
1acca870d9
MDL-80912 reportbuilder: output table caption when rendering reports.
Move the `get_name` method to the base report class, so that it can be
implemented by all report types. Provide a default implementation for
system reports based on the name of the class.

Use the name of the report as the caption. Target via Behat selectors.
2024-02-19 11:57:51 +00:00
Paul Holden
ebcc967d2e
MDL-80258 reportbuilder: ensure consistent reporting of entity themes.
Courses, categories, users & cohorts each have a configurable `theme`
attribute - ensure reporting on said value is consistent across all the
corresponding entities.
2024-02-14 12:12:37 +00: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
Sara Arjona
ce7f3eef04
Merge branch 'MDL-79552' of https://github.com/paulholden/moodle 2024-02-14 09:30:09 +01:00
Sara Arjona
1d23446a1b
Merge branch 'MDL-80807' of https://github.com/paulholden/moodle 2024-02-13 16:16:01 +01:00
Sara Arjona
0f2f0b2fd7
Merge branch 'MDL-80722' of https://github.com/paulholden/moodle 2024-02-13 16:13:17 +01:00
Paul Holden
306d16c9e9
Merge branch 'MDL-80735' of https://github.com/marinaglancy/moodle into main 2024-02-06 15:26:45 +00:00
Paul Holden
b8a87bd354
MDL-80807 reportbuilder: additional tests for aggregated column sort. 2024-02-06 09:47:57 +00:00