Merge branch 'MDL-79705-402' of https://github.com/paulholden/moodle into MOODLE_402_...
[moodle.git] / reportbuilder / upgrade.txt
blob6cd884281f6cf861587475af265e8dae880f5309
1 This file describes API changes in /reportbuilder/*
2 Information provided here is intended especially for developers.
4 === 4.2 ===
6 * New method `set_checkbox_toggleall` in system report class to allow reports to easily create checkbox toggle columns
7 * Column callbacks are now passed a fourth argument to indicate the aggregation type currently being applied, which allows
8   for columns to define how the aggregated data is displayed
9 * New methods `[add|get]_attributes` added to report base class, for including custom attributes in report container HTML
10 * New database helper method `sql_replace_parameter_names` to help ensure uniqueness of parameters within an expression (where
11   that expression can be used multiple times as part of a larger query)
12 * The local report filter class has a new `get_field_sql_and_params` method which should be used by filter types that re-use
13   the filter field SQL within their generated expression, to ensure SQL containing parameters works correctly
14 * The following attributes can be added to custom reports in order to control card view display (via the `add_attributes` method):
15   - `data-force-card` to force cards view
16   - `data-force-table` to force table view
17 * New optional parameter `pagesize` in external method `core_reportbuilder_reports_get` to set the displayed rows per page.
18 * Javascript reports repository module method `getReport` updated to accept new pagesize parameter.
19 * The schedule helper `create_schedule` method accepts a `$timenow` parameter to use for comparisons against current date
20   during tests
21 * The `datasource_stress_test_columns` test helper now enables sorting on those columns that support it
22 * The `create_[column|filter|condition]` test generator methods now allow for setting all persistent properties
23 * The `get_category` method of the base audience class has been deprecated, callers should instead use `get_component_displayname`
25 === 4.1 ===
27 * New method `add_action_divider()` in base system report class, to allow adding a divider to the action menu.
28 * New external method `core_reportbuilder_set_filters` for setting report filter values (plus `setFilters` AJAX repository
29   export for calling from Javascript modules)
30 * New method `set_filter_form_default` in base system report class, to override whether the default filters form
31   should be shown for a report
32 * The external `core_reportbuilder_filters_reset` method now accepts an optional `parameters` argument, required by
33   some system reports
34 * New external methods for retrieving custom report data:
35   - `core_reportbuilder_list_reports`
36   - `core_reportbuilder_retrieve_report`
37   - `core_reportbuilder_view_report`
38 * For consistency, the following entity classes have moved namespace (usage of previous namespace will generate debugging):
39   - `core_admin\{ => reportbuilder}\local\entities\task_log`
40   - `core_cohort\{ => reportbuilder}\local\entities\cohort`
41   - `core_cohort\{ => reportbuilder}\local\entities\cohort_member`
42   - `core_course\{ => reportbuilder}\local\entities\course_category`
43   - `report_configlog\{ => reportbuilder}\local\entities\config_change`
44 * 'set_default_per_page' and 'get_default_per_page' methods have been added to \local\report\base class
45   to manage the default displayed rows per page.
46 * Added two new methods in the datasource class:
47   - add_all_from_entity() to add all columns/filters/conditions from the given entity to the report at once
48   - add_all_from_entities() to add all columns/filters/conditions from all the entities added to the report at once
49 * New database helper methods for generating multiple unique values: `generate_aliases` and `generate_param_names`
50 * The base aggregation `format_value` method has a `$columntype` argument in order to preserve type during aggregation. When
51   defining column callbacks, strict typing will now be preserved in your callback methods when the column is being aggregated
52 * The method `get_joins()` in the base entity class is now public, allowing for easier joins within reports
53 * New method `set_table_aliases` in base entity class, for overriding multiple table aliases in a single call
54 * The following local helper methods have been deprecated, their implementation moved to exporters:
55   - `audience::get_all_audiences_menu_types` -> `custom_report_audience_cards_exporter`
56   - `report::get_available_columns` -> `custom_report_column_cards_exporter`
57 * The `custom_report_exporter` class now defines its editor element properties as optional, rather than each of those exporters
58   defining their own properties as optional. In turn, this means the structure of the following external methods will always be
59   present and consistent:
60   - `core_reportbuilder_columns_*`
61   - `core_reportbuilder_conditions_*`
62   - `core_reportbuilder_filters_*`
63 * The `custom_report_*` exporters now accept only classes that extend datasource as part of their related data properties
64 * The following permission methods now accept an optional `$context` parameter (default system context):
65   - `[require_]can_view_reports_list`
66   - `[require_]can_create_report`
67 * New method `get_default_condition_values()` in base datasource class, to be overridden by sources that wish to
68   define default values for conditions upon report creation.
69 * New methods `get_identity_[column|filter]` in user entity, for retrieving user identity field report elements
70 * New method `user_reports_list_access_sql` in audience helper for retrieving list of all reports for given user
71 * New report filter types:
72   - `category` for reports containing course categories
73   - `tags` for reports containing entities with support for core_tag API
74   - `autocomplete` for reports that contain pre-defined values for selection.
75 * New method `get_sample_values()` added to base filter class, to be overridden in all filter types to support stress testing
76 * New test helpers for automated stress testing of report sources:
77   - `datasource_stress_test_columns`
78   - `datasource_stress_test_columns_aggregation`
79   - `datasource_stress_test_conditions`
80 * The test helper method `get_custom_report_content()` now accepts a list of filter values and applies them to the report
81 * New method `get_default_column_sorting` in base datasource class, to be overridden by sources that wish to
82   define default columns sort order upon report creation.