From a8ddd4b29ca662a7af7dae1d9cb376215b85a3ca Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Thu, 22 Jun 2017 11:17:16 +1200 Subject: [PATCH] Add category selector to coursesummary admin report. --- coursesummary.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/coursesummary.php b/coursesummary.php index a956831..55e4566 100644 --- a/coursesummary.php +++ b/coursesummary.php @@ -34,7 +34,9 @@ $download = optional_param('download', '', PARAM_ALPHA); $sort = optional_param('tsort', '', PARAM_ALPHA); $fromcourse = optional_param('fromcourse', 0, PARAM_INT); +$admin = false; if (empty($fromcourse)) { + $admin = true; admin_externalpage_setup('managemodules'); } else { require_login($fromcourse); @@ -67,11 +69,18 @@ if (!$table->is_downloading($download, $exportfilename)) { $heading .= " (".$coursecat->name.")"; } echo $OUTPUT->heading($heading); - if (empty($category)) { + if ($admin) { // Only show tabs if displaying via the admin page. $tabmenu = attendance_print_settings_tabs('coursesummary'); echo $tabmenu; } + $url = new moodle_url('/mod/attendance/coursesummary.php', array('category' => $category, 'fromcourse' => $fromcourse)); + + if ($admin) { + $options = coursecat::make_categories_list('mod/attendance:viewsummaryreports'); + echo $OUTPUT->single_select($url, 'category', $options, $category); + } + } $table->define_columns(array('course', 'percentage')); -- 2.11.0