Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions import_cr.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,8 @@
$indexurl = new moodle_url('/report/sql/index.php');
$pageurl = new moodle_url('/report/sql/import_cr.php');

echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('crimport:title', 'report_sql'));

if (!cr_import::available()) {
echo $OUTPUT->notification(
get_string('crimport:unavailable', 'report_sql'),
\core\output\notification::NOTIFY_WARNING
);
echo html_writer::link($indexurl, get_string('back'));
echo $OUTPUT->footer();
exit;
}

// Handle the submitted selection.
if (optional_param('import', 0, PARAM_BOOL) && confirm_sesskey()) {
// Handle the submitted selection before any output, so redirect() can send headers.
if (cr_import::available() && optional_param('import', 0, PARAM_BOOL) && confirm_sesskey()) {
$ids = optional_param_array('report', [], PARAM_INT);
if (empty($ids)) {
redirect(
Expand All @@ -79,6 +66,19 @@
redirect($indexurl, implode(' ', $messages), null, \core\output\notification::NOTIFY_SUCCESS);
}

echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('crimport:title', 'report_sql'));

if (!cr_import::available()) {
echo $OUTPUT->notification(
get_string('crimport:unavailable', 'report_sql'),
\core\output\notification::NOTIFY_WARNING
);
echo html_writer::link($indexurl, get_string('back'));
echo $OUTPUT->footer();
exit;
}

$classified = cr_import::discover();

$importable = array_filter($classified, static fn(array $i): bool => $i['verdict'] === 'import');
Expand Down
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
defined('MOODLE_INTERNAL') || die();

$plugin->component = 'report_sql';
$plugin->release = 2026112000;
$plugin->version = 2026112000;
$plugin->release = 2026112001;
$plugin->version = 2026112001;
$plugin->requires = 2024100700; // Moodle 4.5 LTS — the Reportbuilder API this plugin uses is stable from 4.5.
$plugin->maturity = MATURITY_STABLE;
$plugin->supported = [405, 503];
Loading