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