Skip to content

Commit

Permalink
report selector
Browse files Browse the repository at this point in the history
  • Loading branch information
rdebleu committed Nov 27, 2023
1 parent 271205b commit 7b77315
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 9 additions & 5 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

require_once(dirname(__FILE__) . '/../../config.php');
require_once("{$CFG->libdir}/adminlib.php");

use core\report_helper;
use report_payments\reportbuilder\local\systemreports\{payments_course, payments_global, payments_user};
use core_reportbuilder\system_report_factory;
use core_reportbuilder\external\system_report_exporter;

require_once(dirname(__FILE__) . '/../../config.php');
require_once("{$CFG->libdir}/adminlib.php");


$courseid = optional_param('courseid', 1, PARAM_INT);
$userid = optional_param('userid', 0, PARAM_INT);
$categoryid = optional_param('categoryid', 0, PARAM_INT);
Expand Down Expand Up @@ -58,8 +60,8 @@
require_login();

$PAGE->set_url(new \moodle_url('/report/payments/index.php', $params));
$PAGE->set_pagelayout('report');
$PAGE->set_context($context);
$PAGE->set_pagelayout('admin');
$strheading = get_string('payments');

$PAGE->set_title($strheading);
Expand All @@ -70,17 +72,19 @@
case CONTEXT_COURSE:
$course = get_course($courseid);
$PAGE->set_heading($course->fullname);
$PAGE->set_course($course);
break;
default:
$PAGE->set_heading($strheading);
}
\report_payments\event\report_viewed::create(['context' => $context])->trigger();
$report = system_report_factory::create($classname, $context);

if (!empty($filter)) {
$report->set_filter_values(['payment:name_values' => $filter]);
}
echo $OUTPUT->header();
$pluginname = get_string('pluginname', 'report_payments');
\core\report_helper::print_report_selector($pluginname);
report_helper::print_report_selector($pluginname);
echo $report->output();
echo $OUTPUT->footer();
2 changes: 1 addition & 1 deletion lang/en/report_payments.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
$string['payments:userview'] = 'View payments user report';
$string['payments:view'] = 'View payments course report';
$string['plugin'] = 'Plugin';
$string['pluginname'] = 'Payments report';
$string['pluginname'] = 'Payments';
$string['privacy:metadata'] = 'The payments report plugin does not store any personal data.';
$string['page-report-payments-course'] = 'Payments course report';
$string['page-report-payments-index'] = 'Payments global report';
Expand Down

0 comments on commit 7b77315

Please sign in to comment.