Esempio n. 1
0
    $att->perm->require_view_capability();
    $own = true;
} else {
    $att->perm->require_view_reports_capability();
    $own = false;
}
$PAGE->set_url($att->url_individualreport());
$PAGE->set_pagelayout('report');
$PAGE->set_title($course->shortname . ": " . $att->name . ' - ' . get_string('individualreport', 'attcontrol'));
$PAGE->set_heading($course->fullname);
$PAGE->set_cacheable(true);
$PAGE->set_button($OUTPUT->update_module_button($cm->id, 'attcontrol'));
$PAGE->navbar->add(get_string('report', 'attcontrol'));
switch ($pageparams->action) {
    case att_individualreport_page_params::ACTION_CHANGE_PERPAGE:
        $att->set_attcontrol_perpage(optional_param('perpage', 10, PARAM_INT));
        break;
        //Removed the save action from this view, as it could be used by the students.
}
$output = $PAGE->get_renderer('mod_attcontrol');
//Changed the tabs showed depending on the privileges
if ($own) {
    $filtercontrols = new attcontrol_ownreport_filter_controls($att, $USER->id);
    $reportdata = new attcontrol_individual_report_data($att, false, $USER->id);
} else {
    $tabs = new attcontrol_tabs($att, attcontrol_tabs::TAB_INDIVIDUALREPORT);
    $filtercontrols = new attcontrol_individualreport_filter_controls($att);
    $reportdata = new attcontrol_individual_report_data($att);
}
add_to_log($course->id, 'attcontrol', 'individual report viewed', '/mod/attcontrol/individualreport.php?id=' . $id, '', $cm->id);
// Output starts here.