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:
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user