Exemplo n.º 1
0
$returnurl = new moodle_url('/local/help_desk/accounts.php', array('sort' => $sort, 'dir' => $dir, 'perpage' => $perpage, 'page' => $page));
$systemcontext = context_system::instance();
require_login();
if (!has_capability('local/help_desk:manage', $systemcontext)) {
    print_error('You dont have permissions');
}
$PAGE->set_pagelayout('admin');
$PAGE->set_context($systemcontext);
$url = new moodle_url('/local/help_desk/accounts.php');
$PAGE->set_url($url);
$PAGE->set_title(get_string('pluginname', 'local_help_desk'));
$PAGE->navbar->add(get_string('pluginname', 'local_help_desk'));
$PAGE->navbar->add(get_string('accounts', 'local_help_desk'));
$PAGE->set_heading($SITE->fullname);
$renderer = $PAGE->get_renderer('local_help_desk');
$lib_help_desk = new help_desk();
$hierarchy = new hierarchy();
$ufiltering = new user_filtering_accounts();
//Tab tree (current tab)
$tab = 'accounts';
$serialkey_form = new accounts_serialkey_form(NULL, array('skid' => $skid));
echo $OUTPUT->header();
$lib_help_desk->createtabview($tab);
//Tab tree
$extracolumns = get_extra_user_fields($systemcontext);
$ufiltering = new user_filtering_accounts();
$allusernamefields = get_all_user_name_fields(false, null, null, null, true);
$columns = array_merge($allusernamefields, $extracolumns, array('city', 'country', 'lastaccess'));
foreach ($columns as $column) {
    $string[$column] = get_user_field_name($column);
    if ($sort != $column) {
Exemplo n.º 2
0
$PAGE->set_context($systemcontext);
if ($CFG->forcelogin) {
    require_login();
} else {
    user_accesstime_log();
}
if (!has_capability('local/help_desk:manage', $systemcontext)) {
    print_error('You dont have permissions');
}
$string = get_string('pluginname', 'local_help_desk');
$PAGE->set_url('/local/help_desk/index.php');
$PAGE->set_title($string);
$PAGE->navbar->add(get_string('pluginname', 'local_help_desk'));
$output = $PAGE->get_renderer('local_help_desk');
$hierarchy = new hierarchy();
$help_desk = new help_desk();
//Header and the navigation bar
$PAGE->set_heading($SITE->fullname);
$tab = 'report';
echo $OUTPUT->header();
$help_desk->createtabview($tab);
$schools_list = $hierarchy->get_schools();
$sem_list = $school > 0 ? $help_desk->school_semesters($school) : array('0' => 'Select');
$school_url = new moodle_url('/local/help_desk/report.php');
$select_school = new single_select($school_url, 'school', $schools_list, $school);
$select_school->set_label(get_string('school', 'local_help_desk'), array('class' => 'form-item form-label'));
$term_url = new moodle_url('/local/help_desk/report.php', array('school' => $school));
$select_term = new single_select($term_url, 'term', $sem_list, $term);
$select_term->set_label(get_string('term', 'local_help_desk'), array('class' => 'form-item form-label'));
echo "<div class='form-item clearfix' >" . $OUTPUT->render($select_school) . "</div>";
echo "<div class='form-item clearfix' >" . $OUTPUT->render($select_term) . "</div>";