diff --git a/reportbuilder/classes/local/helpers/schedule.php b/reportbuilder/classes/local/helpers/schedule.php index 9dcfd65c853ca..c103f502ce151 100644 --- a/reportbuilder/classes/local/helpers/schedule.php +++ b/reportbuilder/classes/local/helpers/schedule.php @@ -339,10 +339,10 @@ public static function delete_schedule(int $reportid, int $scheduleid): bool { * @return string[] */ public static function get_format_options(): array { - $dataformats = core_plugin_manager::instance()->get_plugins_of_type('dataformat'); + $dataformats = dataformat::get_enabled_plugins(); - return array_map(static function(dataformat $dataformat): string { - return $dataformat->displayname; + return array_map(static function(string $pluginname): string { + return get_string('dataformat', 'dataformat_' . $pluginname); }, $dataformats); } diff --git a/reportbuilder/classes/local/systemreports/report_schedules.php b/reportbuilder/classes/local/systemreports/report_schedules.php index 071850c7f6291..c42dce210cf63 100644 --- a/reportbuilder/classes/local/systemreports/report_schedules.php +++ b/reportbuilder/classes/local/systemreports/report_schedules.php @@ -29,7 +29,6 @@ use core_reportbuilder\local\filters\date; use core_reportbuilder\local\filters\text; use core_reportbuilder\local\helpers\format; -use core_reportbuilder\local\helpers\schedule as helper; use core_reportbuilder\local\models\report; use core_reportbuilder\local\models\schedule; use core_reportbuilder\local\report\action; @@ -198,8 +197,11 @@ protected function add_columns(): void { ->add_fields("{$tablealias}.format") ->set_is_sortable(true) ->add_callback(static function(string $format): string { - $formats = helper::get_format_options(); - return $formats[$format] ?? ''; + if (get_string_manager()->string_exists('dataformat', 'dataformat_' . $format)) { + return get_string('dataformat', 'dataformat_' . $format); + } else { + return $format; + } }) );