MDL-73916 reportbuilder: Allow to set default condition values

- Changes on datasource class to allow to set default condition values
- Added default condition 'suspended' set to 'no' on users datasource
This commit is contained in:
David Matamoros
2022-06-03 08:43:46 +02:00
parent 5500d143f4
commit c6777c9cbf
4 changed files with 47 additions and 2 deletions
+15
View File
@@ -239,6 +239,9 @@ abstract class datasource extends base {
foreach ($conditionidentifiers as $uniqueidentifier) {
report::add_report_condition($reportid, $uniqueidentifier);
}
// Set the default condition values if they have been set in the datasource.
$this->set_condition_values($this->get_default_condition_values());
}
/**
@@ -248,6 +251,18 @@ abstract class datasource extends base {
*/
abstract public function get_default_conditions(): array;
/**
* Return the default condition values that will be added to the report once is created
*
* For any of the default conditions returned by the method {@see get_default_conditions} is
* possible to set the initial values.
*
* @return array
*/
public function get_default_condition_values(): array {
return [];
}
/**
* Return all configured report conditions
*