|
@ -36,10 +36,12 @@ require_login(); |
|
|
if (empty($category)) { |
|
|
if (empty($category)) { |
|
|
$context = context_system::instance(); |
|
|
$context = context_system::instance(); |
|
|
$courses = array(); // Show all courses. |
|
|
$courses = array(); // Show all courses. |
|
|
|
|
|
$PAGE->set_context(context_system::instance()); |
|
|
} else { |
|
|
} else { |
|
|
$context = context_coursecat::instance($category); |
|
|
$context = context_coursecat::instance($category); |
|
|
$coursecat = coursecat::get($category); |
|
|
$coursecat = coursecat::get($category); |
|
|
$courses = $coursecat->get_courses(array('recursive' => true, 'idonly' => true)); |
|
|
$courses = $coursecat->get_courses(array('recursive' => true, 'idonly' => true)); |
|
|
|
|
|
$PAGE->set_category_by_id($category); |
|
|
} |
|
|
} |
|
|
// Check permissions. |
|
|
// Check permissions. |
|
|
require_capability('mod/attendance:viewsummaryreports', $context); |
|
|
require_capability('mod/attendance:viewsummaryreports', $context); |
|
@ -47,7 +49,7 @@ require_capability('mod/attendance:viewsummaryreports', $context); |
|
|
$exportfilename = 'attendancecoursesummary.csv'; |
|
|
$exportfilename = 'attendancecoursesummary.csv'; |
|
|
|
|
|
|
|
|
$PAGE->set_url('/mod/attendance/coursesummary.php', array('category' => $category)); |
|
|
$PAGE->set_url('/mod/attendance/coursesummary.php', array('category' => $category)); |
|
|
$PAGE->set_context(context_system::instance()); |
|
|
|
|
|
$PAGE->set_heading($SITE->fullname); |
|
|
$PAGE->set_heading($SITE->fullname); |
|
|
|
|
|
|
|
|
$table = new flexible_table('attendancecoursesummary'); |
|
|
$table = new flexible_table('attendancecoursesummary'); |
|
|