Exemple #1
0
    $filters = (array) $data;
    if (!empty($filters['datetill'])) {
        $filters['datetill'] += DAYSECS - 1;
        // Set to end of the chosen day.
    }
} else {
    $filters = array('id' => $courseid, 'userids' => optional_param('userids', '', PARAM_SEQUENCE), 'itemid' => optional_param('itemid', 0, PARAM_INT), 'grader' => optional_param('grader', 0, PARAM_INT), 'datefrom' => optional_param('datefrom', 0, PARAM_INT), 'datetill' => optional_param('datetill', 0, PARAM_INT), 'revisedonly' => optional_param('revisedonly', 0, PARAM_INT));
}
$table = new \gradereport_history\output\tablelog('gradereport_history', $context, $url, $filters, $download, $page);
$names = array();
foreach ($table->get_selected_users() as $key => $user) {
    $names[$key] = fullname($user);
}
$filters['userfullnames'] = implode(',', $names);
// Set up js.
\gradereport_history\helper::init_js($course->id, $names);
// Now that we have the names, reinitialise the button so its able to control them.
$button = new \gradereport_history\output\user_button($PAGE->url, get_string('selectusers', 'gradereport_history'), 'get');
$userbutton = $output->render($button);
$params = array('course' => $course, 'itemids' => $itemids, 'graders' => $graders, 'userbutton' => $userbutton);
$mform = new \gradereport_history\filter_form(null, $params);
$mform->set_data($filters);
if ($table->is_downloading()) {
    // Download file and exit.
    \core\session\manager::write_close();
    echo $output->render($table);
    die;
}
// Print header.
print_grade_page_head($COURSE->id, 'report', 'history', get_string('pluginname', 'gradereport_history'), false, '');
$mform->display();