Skip to content

Commit

Permalink
Merge branch 'MDL-72968' of https://github.com/paulholden/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Nov 4, 2021
2 parents 3b64e3e + d7e10c3 commit 37fa747
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions lang/en/reportbuilder.php
Expand Up @@ -186,3 +186,4 @@
$string['userfullnamewithpicturelink'] = 'Full name with picture and link';
$string['usermodified'] = 'Modified by';
$string['userpicture'] = 'User picture';
$string['viewreport'] = 'View report';
2 changes: 1 addition & 1 deletion reportbuilder/classes/local/systemreports/reports_list.php
Expand Up @@ -258,7 +258,7 @@ protected function add_actions(): void {
// Preview action.
$this->add_action((new action(
new moodle_url('/reportbuilder/view.php', ['id' => ':id']),
new pix_icon('i/search', get_string('view', 'moodle')),
new pix_icon('i/search', get_string('viewreport', 'core_reportbuilder')),
[]
))
->add_callback(function(stdClass $row): bool {
Expand Down
3 changes: 2 additions & 1 deletion reportbuilder/edit.php
Expand Up @@ -37,14 +37,15 @@
$reportid = required_param('id', PARAM_INT);

admin_externalpage_setup('customreports', null, ['id' => $reportid], new moodle_url('/reportbuilder/edit.php'));
navigation_node::override_active_url(new moodle_url('/reportbuilder/index.php'));

$report = manager::get_report_from_id($reportid);
permission::require_can_edit_report($report->get_report_persistent());

$PAGE->set_context($report->get_context());
$PAGE->navbar->add(get_string('editreportcontent', 'core_reportbuilder'), $PAGE->url);

$reportname = $report->get_report_persistent()->get_formatted_name();
$PAGE->navbar->add($reportname);
$PAGE->set_title($reportname);
$PAGE->set_heading($reportname);

Expand Down
3 changes: 2 additions & 1 deletion reportbuilder/view.php
Expand Up @@ -34,17 +34,18 @@
$reportid = required_param('id', PARAM_INT);

admin_externalpage_setup('customreports', null, ['id' => $reportid], new moodle_url('/reportbuilder/view.php'));
navigation_node::override_active_url(new moodle_url('/reportbuilder/index.php'));

$report = manager::get_report_from_id($reportid);
permission::require_can_view_report($report->get_report_persistent());

$PAGE->set_context($report->get_context());
$PAGE->navbar->add(get_string('viewreport', 'core_reportbuilder'), $PAGE->url);

/** @var \core_reportbuilder\output\renderer $renderer */
$renderer = $PAGE->get_renderer('core_reportbuilder');

$reportname = $report->get_report_persistent()->get_formatted_name();
$PAGE->navbar->add($reportname);
$PAGE->set_title($reportname);
$PAGE->set_heading($reportname);

Expand Down

0 comments on commit 37fa747

Please sign in to comment.