default:
            //Adding new sessiontitle
            $newsessiontitle = optional_param('newsessiontitle', '', PARAM_MULTILANG);
            if (!empty($newsessiontitle)) {
                unset($rec);
                $rec->courseid = $course->id;
                $rec->sessiontitle = $newsessiontitle;
                insert_record('attendance_sessiontitles', $rec);
                add_to_log($course->id, 'attforblock', 'sessiontitle added', 'addtitles.php?course=' . $course->id, $user->lastname . ' ' . $user->firstname);
            } else {
                print_error('cantaddsessiontitle', 'attforblock', "addtitles.php?id={$id}");
            }
            break;
    }
}
show_tabs($cm, $context, 'sessiontitles');
if ($submitsettings) {
    config_save();
    //////////////////////////////
    notice(get_string('sessiontitlesupdated', 'attforblock'), 'addtitles.php?id=' . $id);
}
$i = 1;
$table->width = '400px';
$table->head = array('#', get_string('sessiontitle', 'attforblock'), get_string('action'));
$table->align = array('center', 'center', 'center', 'center');
$sessiontitles = get_sessiontitles($course->id, true);
$deltitle = get_string('delete');
if (count_records_select('attendance_sessiontitles', 'deleted = 0')) {
    // check if session titles exist
    foreach ($sessiontitles as $st) {
        $table->data[$i][] = $i;
                                set_field('attendance_scan_logs', 'processed', 1, 'id', $lastscan->id);
                            }
                        }
                    }
                } else {
                    echo 'Failed to log in';
                }
                insert_record('attendance_scan_logs', $rec);
                add_to_log($course->id, 'attforblock', 'scan added', 'scan.php?course=' . $course->id, $user->lastname . ' ' . $user->firstname);
            } else {
                print_error('cantaddscan', 'attforblock', "scan.php?id={$id}");
            }
            break;
    }
}
show_tabs($cm, $context, 'scan');
$i = 1;
$table->width = '400px';
$table->head = array('#', get_string('scan', 'attforblock'));
$table->align = array('center', 'center', 'center');
$scans = get_scans($course->id);
if (count_records_select('attendance_scan_logs')) {
    // check if session titles exist
    foreach ($scans as $st) {
        $table->data[$i][] = $i;
        $table->data[$i][] = userdate($st->timescanned, get_string('strftimehm', 'attforblock'));
        $table->data[$i][] = ereg_replace("[^A-Za-z]", "", $st->scan);
        if ($st->scannedin == 0) {
            $table->data[$i][] = 'Out';
        } else {
            $table->data[$i][] = 'In';
         //add this $var => not delete this package on computer detail
         $_SESSION['OCS']["justAdded"] = true;
         echo "<script language='javascript'> window.opener.document." . $form_to_reload . ".submit();</script>";
     }
 }
 if ($protectedPost['sens_' . $table_name] == "") {
     $protectedPost['sens_' . $table_name] = 'DESC';
 }
 if ($protectedPost['onglet'] == "") {
     $protectedPost['onglet'] = 'MACH';
 }
 $def_onglets['MACH'] = $l->g(980);
 $def_onglets['SERV_GROUP'] = $l->g(981);
 //show tab
 if ($list_id) {
     show_tabs($def_onglets, $form_name, 'onglet', 7);
     echo '<div class="right-content mlt_bordure" >';
     //echo "<table ALIGN = 'Center' class='onglet'><tr><td align =center><tr><td align =center>";
     if ($protectedPost['onglet'] == 'SERV_GROUP') {
         $sql_rules = "select distinct rule,rule_name from download_affect_rules order by 1";
         $res_rules = mysqli_query($_SESSION['OCS']["readServer"], $sql_rules) or die(mysqli_error($_SESSION['OCS']["readServer"]));
         $nb_rule = 0;
         while ($val_rules = mysqli_fetch_array($res_rules)) {
             $first = $val_rules['rule'];
             $list_rules[$val_rules['rule']] = $val_rules['rule_name'];
             $nb_rule++;
         }
         if ($nb_rule > 1) {
             $select_choise = $l->g(668) . show_modif($list_rules, 'rule_choise', 2, $form_name);
             echo $select_choise;
         } elseif ($nb_rule == 1) {
if (isset($protectedPost['NO_VISIBLE']) and $protectedPost['NO_VISIBLE'] != '' and isset($_SESSION['OCS']['ADMIN_CONSOLE'])) {
    delete($protectedPost['NO_VISIBLE']);
}
if (isset($protectedPost['UPDATE_VALUE']) and $protectedPost['UPDATE_VALUE'] != '' and isset($_SESSION['OCS']['ADMIN_CONSOLE'])) {
    $arg = look_config_default_values($protectedPost['UPDATE_VALUE']);
    insert_update($protectedPost['UPDATE_VALUE'], $protectedPost[$protectedPost['UPDATE_VALUE']], $arg['ivalue'][$protectedPost['UPDATE_VALUE']], 'IVALUE');
}
require_once 'require/function_console.php';
$data_on = define_tab();
$data_tab = show_active_tab($data_on);
echo open_form($form_name);
if (isset($protectedPost["onglet"]) and !isset($data_tab['DATA'][$protectedPost["onglet"]])) {
    $protectedPost["onglet"] = $data_tab['DEFAULT'];
}
if ($data_tab['DATA'] != array()) {
    show_tabs($data_tab['DATA'], $form_name, "onglet", 8);
    echo '<div class="right-content"><div class="mlt_bordure" >';
    if ($_SESSION['OCS']['profile']->getConfigValue('CONSOLE') == 'YES') {
        echo "<table align='right' border='0'><tr><td colspan=10 align='right'><a href=# OnClick='pag(\"ADMIN\",\"ADMIN\",\"" . $form_name . "\");'>";
        if (isset($_SESSION['OCS']['ADMIN_CONSOLE']) and $_SESSION['OCS']['ADMIN_CONSOLE'] == 'ADMIN') {
            echo "<img src='image/success.png'>";
        } else {
            echo "<img src='image/modif_tab.png'>";
        }
        echo "</a></td></tr></table>";
    }
    if ($data_on['DATA'][$protectedPost['onglet']]) {
        $fields = list_field($protectedPost['onglet']);
        show_console_field($fields, $form_name);
    } else {
        $array_group = "";
        default:
            //Adding new subject
            $newsubject = optional_param('newsubject', '', PARAM_MULTILANG);
            if (!empty($newsubject)) {
                unset($rec);
                $rec->courseid = $course->id;
                $rec->subject = $newsubject;
                insert_record('attendance_subjects', $rec);
                add_to_log($course->id, 'attforblock', 'subject added', 'addsubjects.php?course=' . $course->id, $user->lastname . ' ' . $user->firstname);
            } else {
                print_error('cantaddsubject', 'attforblock', "addsubjects.php?id={$id}");
            }
            break;
    }
}
show_tabs($cm, $context, 'subjects');
if ($submitsettings) {
    config_save();
    //////////////////////////////
    notice(get_string('subjectsupdated', 'attforblock'), 'addsubjects.php?id=' . $id);
}
$i = 1;
$table->width = '400px';
$table->head = array('#', get_string('subject', 'attforblock'), get_string('action'));
$table->align = array('center', 'center', 'center', 'center');
$subjects = get_subjects($course->id, true);
$deltitle = get_string('delete');
if (count_records_select('attendance_subjects', 'deleted = 0')) {
    // check if session titles exist
    foreach ($subjects as $st) {
        $table->data[$i][] = $i;
require_login($course->id);
if (!($user = get_record('user', 'id', $USER->id))) {
    error("No such user in this course");
}
if (!($context = get_context_instance(CONTEXT_MODULE, $cm->id))) {
    print_error('badcontext');
}
require_capability('mod/attforblock:viewreports', $context);
//add info to log
add_to_log($course->id, 'attendance', 'report displayed', 'mod/attforblock/report.php?id=' . $id, $user->lastname . ' ' . $user->firstname);
/// Print headers
$navlinks[] = array('name' => $attforblock->name, 'link' => "view.php?id={$id}", 'type' => 'activity');
$navlinks[] = array('name' => get_string('report', 'attforblock'), 'link' => null, 'type' => 'activityinstance');
$navigation = build_navigation($navlinks);
print_header("{$course->shortname}: " . $attforblock->name . ' - ' . get_string('report', 'attforblock'), $course->fullname, $navigation, "", "", true, "&nbsp;", navmenu($course));
show_tabs($cm, $context, 'report');
$sort = $sort == 'firstname' ? 'firstname' : 'lastname';
if (!count_records('attendance_sessions', 'courseid', $course->id)) {
    // no session exists for this course
    redirect("sessions.php?id={$cm->id}&amp;action=add");
} else {
    // display attendance report
    /// find out current groups mode
    $groupmode = groups_get_activity_groupmode($cm);
    $currentgroup = groups_get_activity_group($cm, true);
    if ($groupmode == VISIBLEGROUPS || $groupmode && has_capability('moodle/site:accessallgroups', $context)) {
        groups_print_activity_menu($cm, "report.php?id={$id}&amp;sort={$sort}");
    }
    echo '<div>' . helpbutton('report', get_string('help'), 'attforblock', true, true, '', true) . '</div>';
    if ($currentgroup) {
        $students = get_users_by_capability($context, 'moodle/legacy:student', '', "u.{$sort} ASC", '', '', $currentgroup, '', false);
if (!($user = get_record('user', 'id', $USER->id))) {
    error("No such user in this course");
}
if (!($context = get_context_instance(CONTEXT_MODULE, $cm->id))) {
    print_error('badcontext');
}
require_capability('mod/attforblock:manageattendances', $context);
$navlinks[] = array('name' => $attforblock->name, 'link' => "view.php?id={$id}", 'type' => 'activity');
$navlinks[] = array('name' => get_string($action, 'attforblock'), 'link' => null, 'type' => 'activityinstance');
$navigation = build_navigation($navlinks);
print_header("{$course->shortname}: " . $attforblock->name . ' - ' . get_string($action, 'attforblock'), $course->fullname, $navigation, "", "", true, "&nbsp;", navmenu($course));
//////////////////////////////////////////////////////////
// Adding sessions
//////////////////////////////////////////////////////////
if ($action === 'add') {
    show_tabs($cm, $context, 'add');
    $mform_add = new mod_attforblock_add_form('sessions.php', array('course' => $course, 'cm' => $cm, 'modcontext' => $context));
    if ($fromform = $mform_add->get_data()) {
        $duration = $fromform->durtime['hours'] * HOURSECS + $fromform->durtime['minutes'] * MINSECS;
        $now = time();
        // check for new teacher in text box and insert the new teacher to the attendance_teachers table
        if ($fromform->hteacher > '') {
            $newteacher->teacher = $fromform->hteacher;
            $addteacher = insert_record('attendance_teachers', $newteacher);
        }
        // check for new subject in text box and insert the new subject to the attendance_subjects table
        if ($fromform->hsubject > '') {
            $newsubject->subject = $fromform->hsubject;
            $addsubject = insert_record('attendance_subjects', $newsubject);
        }
        // check for new session title in text box and insert the new title to the attendance_sessiontitles table
예제 #8
0
        echo "</div>\n";
    }
}
//
// Main body
//
// Clear list of modifications
$log = array();
if (isset($_POST['author_ui_modified'])) {
    apply_author_ui_change();
}
if (isset($_POST['author_advanced_settings_modified'])) {
    apply_author_advanced_settings_change();
}
// Referer may be set by the form, but also by lcm_cookie.php which
// is called before config_author.php via inc.php (ahem..)
// [ML] If this is removed, the user will not be correctly sent to the
// referer when the language setting is changed
if (isset($_REQUEST['referer'])) {
    $target = new Link($_REQUEST['referer']);
    header('Location: ' . $target->getUrlForHeader());
    exit;
}
lcm_page_start(_T('title_authorconf'));
// Show tabs
$groups = array('interface' => _T('authorconf_tab_interface'), 'advanced' => _T('authorconf_tab_advanced'));
$tab = isset($_REQUEST['tab']) ? $_REQUEST['tab'] : 'interface';
//show_tabs($groups,$tab,$_SERVER['REQUEST_URI']);
show_tabs($groups, $tab, $_SERVER['SCRIPT_NAME'] . "?ref=" . urlencode(isset($_GET['ref']) ? urldecode(clean_input($_GET['ref'])) : $_SERVER['HTTP_REFERER']));
show_author_form($tab);
lcm_page_end();
예제 #9
0
if (!($author_data = lcm_fetch_array($result))) {
    lcm_header("Location: listauthors.php");
    exit;
}
$fullname = get_person_name($author_data);
lcm_page_start(_T('title_author_view') . ' ' . $fullname, '', '', 'authors_intro');
// Show tabs
if ($author == $author_session['id_author'] || $author_session['status'] == 'admin') {
    $groups = array('general' => array('name' => _T('generic_tab_general'), 'tooltip' => _T('generic_subtitle_general', array('author' => $fullname))), 'cases' => array('name' => _T('generic_tab_cases'), 'tooltip' => _T('author_subtitle_cases', array('author' => $fullname))), 'followups' => array('name' => _T('generic_tab_followups'), 'tooltip' => _T('author_subtitle_followups', array('author' => $fullname))), 'appointments' => array('name' => _T('generic_tab_agenda'), 'tooltip' => _T('author_subtitle_appointments', array('author' => $fullname))), 'times' => array('name' => _T('generic_tab_reports'), 'tooltip' => _T('author_subtitle_reports', array('author' => $fullname))), 'attachments' => array('name' => _T('generic_tab_documents'), 'tooltip' => _T('author_subtitle_attachments', array('author' => $fullname))));
} else {
    $groups = array('general' => array('name' => _T('generic_tab_general'), 'tooltip' => _T('generic_subtitle_general', array('author' => $fullname))), 'cases' => array('name' => _T('generic_tab_cases'), 'tooltip' => _T('author_subtitle_cases', array('author' => $fullname))));
}
$tab = isset($_GET['tab']) ? $_GET['tab'] : 'general';
// [ML] $_SERVER['REQUEST_URI']);
// [ML] Forcing 'author_det.php' else some vars really get carried for nothing (see fu tab + dates)
show_tabs($groups, $tab, "author_det.php?author={$author}");
echo '<fieldset class="info_box">';
switch ($tab) {
    //
    // General tab
    //
    case 'general':
        //
        // Show client general information
        //
        show_page_subtitle(_T('generic_subtitle_general'), 'authors_intro');
        echo '<ul class="info">';
        echo '<li>' . _Ti('authoredit_input_id') . '<strong>' . $author_data['id_author'] . "</strong></li>\n";
        echo '<li>' . _Ti('person_input_name') . '<strong>' . get_person_name($author_data) . "</strong></li>\n";
        echo '<li>' . _Ti('authoredit_input_status') . '<strong>' . _T('authoredit_input_status_' . $author_data['status']) . "</strong></li>\n";
        echo '<li>' . _Ti('time_input_date_creation') . format_date($author_data['date_creation']) . "</li>\n";
예제 #10
0
/// Print headers
$navlinks[] = array('name' => $attforblock->name, 'link' => null, 'type' => 'activity');
print_header("{$course->shortname}: " . $attforblock->name, $course->fullname, $navlinks, "", "", true, $OUTPUT->update_module_button($cm->id, 'attforblock'), navmenu($course));
echo $OUTPUT->heading(get_string('attendanceforthecourse', 'attforblock') . ' :: ' . $course->fullname);
if (!$DB->count_records_select('attendance_sessions', "courseid = ? AND sessdate >= ?", array($course->id, $course->startdate))) {
    // no session exists for this course
    show_tabs($cm, $context);
    echo $OUTPUT->heading(get_string('nosessionexists', 'attforblock'));
    $hiddensess = $DB->count_records_select('attendance_sessions', "courseid = ? AND sessdate < ?", array($course->id, $course->startdate));
    echo '<div align="left">';
    echo $OUTPUT->help_icon('hiddensessions', 'attforblock', '');
    echo get_string('hiddensessions', 'attforblock') . ': ' . $hiddensess . '</div>';
} else {
    //sessions generated , display them
    add_to_log($course->id, 'attendance', 'manage attendances', 'mod/attforblock/manage.php?course=' . $course->id, $user->lastname . ' ' . $user->firstname);
    show_tabs($cm, $context);
    print_sessions_list($course);
}
//	require_once('lib.php');
//	$t = attforblock_get_user_grades($attforblock); ////////////////////////////////////////////
echo $OUTPUT->footer($course);
function print_sessions_list($course)
{
    global $CFG, $DB, $OUTPUT, $USER, $context, $cm;
    //$USER->timezone = $tz;
    $strhours = get_string('hours');
    $strmins = get_string('min');
    $qry = $DB->get_records_select('attendance_sessions', "courseid = ? AND sessdate >= ?", array($course->id, $course->startdate), 'sessdate asc');
    $i = 0;
    $table = new html_table();
    //$table->width = '100%';
            if (!empty($newacronym) && !empty($newdescription)) {
                unset($rec);
                $rec->courseid = $course->id;
                $rec->acronym = $newacronym;
                $rec->description = $newdescription;
                $rec->grade = $newgrade;
                $DB->insert_record('attendance_statuses', $rec);
                add_to_log($course->id, 'attendance', 'setting added', 'mod/attforblock/attsettings.php?course=' . $course->id, $user->lastname . ' ' . $user->firstname);
            } else {
                print_error('cantaddstatus', 'attforblock', "attsettings.php?id={$id}");
            }
            break;
    }
}
print_header("{$course->shortname}: " . $attforblock->name . ' - ' . get_string('settings', 'attforblock'), $course->fullname, $navlinks, "", "", true, "&nbsp;", navmenu($course));
show_tabs($cm, $context, 'settings');
if ($submitsettings) {
    config_save();
    //////////////////////////////
    notice(get_string('variablesupdated', 'attforblock'), 'attsettings.php?id=' . $id);
}
$i = 1;
$table = new html_table();
//$table->width = '100%';
//$table->tablealign = 'center';
$table->head = array('#', get_string('acronym', 'attforblock'), get_string('description'), get_string('grade'), get_string('action'));
$table->align = array('center', 'center', 'center', 'center', 'center', 'center');
$statuses = get_statuses($course->id, false);
$deltitle = get_string('delete');
foreach ($statuses as $st) {
    $table->data[$i][] = $i;
        default:
            //Adding new teacher
            $newteacher = optional_param('newteacher', '', PARAM_MULTILANG);
            if (!empty($newteacher)) {
                unset($rec);
                $rec->courseid = $course->id;
                $rec->teacher = $newteacher;
                insert_record('attendance_teachers', $rec);
                add_to_log($course->id, 'attforblock', 'teacher added', 'addteachers.php?course=' . $course->id, $user->lastname . ' ' . $user->firstname);
            } else {
                print_error('cantaddteacher', 'attforblock', "addteachers.php?id={$id}");
            }
            break;
    }
}
show_tabs($cm, $context, 'teachers');
if ($submitsettings) {
    config_save();
    //////////////////////////////
    notice(get_string('teachersupdated', 'attforblock'), 'addteachers.php?id=' . $id);
}
$i = 1;
$table->width = '400px';
$table->head = array('#', get_string('teacher', 'attforblock'), get_string('action'));
$table->align = array('center', 'center', 'center', 'center');
$teachers = get_teachers($course->id, true);
$deltitle = get_string('delete');
if (count_records_select('attendance_teachers', 'deleted = 0')) {
    // check if session titles exist
    foreach ($teachers as $st) {
        $table->data[$i][] = $i;
    error("No such user in this course");
}
if (!($context = get_context_instance(CONTEXT_MODULE, $cm->id))) {
    print_error('badcontext');
}
require_capability('mod/attforblock:viewreports', $context);
//add info to log
add_to_log($course->id, 'attendance', 'report displayed', 'mod/attforblock/adv_report.php?id=' . $id, $user->lastname . ' ' . $user->firstname);
/// Print headers
$navlinks[] = array('name' => $attforblock->name, 'link' => "view.php?id={$id}", 'type' => 'activity');
$navlinks[] = array('name' => get_string('report', 'attforblock'), 'link' => null, 'type' => 'activityinstance');
$navigation = build_navigation($navlinks);
require_js('updatestatus.js');
require_js('showclass.js');
print_header("{$course->shortname}: " . $attforblock->name . ' - ' . get_string('report', 'attforblock'), $course->fullname, $navigation, "", '<link type="text/css" href="attforblock.css" rel="stylesheet" />', true, "&nbsp;", navmenu($course));
show_tabs($cm, $context, 'advancedreport');
echo '<div>' . helpbutton('report', get_string('help'), 'attforblock', true, true, '', true) . '</div>';
$sort = $sort == 'firstname' ? 'firstname' : 'lastname';
if (!count_records('attendance_sessions', 'courseid', $course->id)) {
    // no session exists for this course
    redirect("sessions.php?id={$cm->id}&amp;action=add");
} else {
    // display attendance report
    //  require_once('scanlib.php'); // to be used somewhere when this works
    //  Print the filter form in a table
    echo '<table class="generaltable"><thead><tr>';
    echo '<th class ="alignleft" id="tshowfilter" name="tshowfilter">';
    $mform_report = new mod_attforblock_report_form('adv_report.php', array('course' => $course, 'cm' => $cm, 'modcontext' => $context));
    $mform_report->display();
    ?>
</th></tr></thead><tbody><tr><td></td></tr></tbody></table>
        require_once FOOTER_HTML;
        die;
    }
    $protectedPost['onglet'] = 'ADMIN_RSX';
    $protectedPost['MODIF'] = $protectedGet['value'];
    $left_menu_displayed = false;
} else {
    $data_on['ADMIN_RSX'] = $l->g(1140);
    $data_on['ADMIN_TYPE'] = $l->g(836);
    if ($_SESSION['OCS']['profile']->getConfigValue('MANAGE_SMTP_COMMUNITIES') == 'YES') {
        $data_on['ADMIN_SMTP'] = $l->g(1205);
    }
    if ($protectedPost['onglet'] != $protectedPost['old_onglet']) {
        unset($protectedPost['MODIF']);
    }
    show_tabs($data_on, $form_name, "onglet", 10);
    $left_menu_displayed = true;
}
$class = $left_menu_displayed ? "right-content" : "";
echo '<div class="' . $class . ' mlt_bordure" >';
if ($protectedPost['onglet'] == 'ADMIN_RSX') {
    $method = verif_base_methode('OCS');
    if (!$method) {
        if (isset($protectedPost['SUP_PROF']) and $protectedPost['SUP_PROF'] != '') {
            delete_subnet($protectedPost['SUP_PROF']);
            $tab_options['CACHE'] = 'RESET';
        }
        if (isset($protectedPost['Valid_modif'])) {
            $result = add_subnet($protectedPost['ADD_IP'], $protectedPost['RSX_NAME'], $protectedPost['ID_NAME'], $protectedPost['ADD_SX_RSX']);
            if ($result) {
                msg_error($result);
예제 #15
0
     lcm_page_start(_T('title_error'));
     echo _T('error_no_read_permission');
     lcm_page_end();
     exit;
 }
 $add = allowed($case, 'w');
 $edit = allowed($case, 'e');
 $admin = allowed($case, 'a');
 // Show case details
 lcm_page_start(_T('title_case_details') . " #" . $row['id_case'] . ' ' . $row['title'], '', '', 'cases_intro');
 // [ML] This will probably never be implemented
 // echo "<div id=\"breadcrumb\"><a href=\"". getenv("HTTP_REFERER") ."\">List of cases</a> &gt; ". $row['title'] ."</div>";
 // Show tabs
 $groups = array('general' => array('name' => _T('generic_tab_general'), 'tooltip' => _T('case_subtitle_general')), 'appointments' => array('name' => _T('generic_tab_agenda'), 'tooltip' => _T('case_subtitle_appointments')), 'exps' => array('name' => 'Requests', 'tooltip' => 'Internal requests'), 'times' => array('name' => _T('generic_tab_reports'), 'tooltip' => _T('case_subtitle_times')), 'attachments' => array('name' => _T('generic_tab_documents'), 'tooltip' => _T('case_subtitle_attachments')));
 $tab = isset($_GET['tab']) ? $_GET['tab'] : 'general';
 show_tabs($groups, $tab, $_SERVER['REQUEST_URI']);
 echo show_all_errors();
 switch ($tab) {
     //
     // General tab
     //
     case 'general':
         echo "<fieldset class='info_box'>";
         $obj_case_ui = new LcmCaseInfoUI($row['id_case']);
         $obj_case_ui->printGeneral();
         if ($edit && $modify) {
             echo '<p><a href="edit_case.php?case=' . $row['id_case'] . '" class="edit_lnk">' . _T('edit_case_information') . '</a></p>';
         }
         // [ML] This is not useful at the moment.. there is no import
         // and the XML spec of the export needs improvement.
         //			if ($GLOBALS['author_session']['status'] == 'admin')
$tab_options['form_name'] = $form_name;
echo open_form($form_name);
//view all groups
if ($_SESSION['OCS']['profile']->getConfigValue('GROUPS') == "YES") {
    $def_onglets['DYNA'] = $l->g(810);
    //Dynamic group
    $def_onglets['STAT'] = $l->g(809);
    //Static group centraux
    if ($_SESSION['OCS']["use_redistribution"] == 1) {
        $def_onglets['SERV'] = mb_strtoupper($l->g(651));
    }
    if ($protectedPost['onglet'] == "") {
        $protectedPost['onglet'] = "STAT";
    }
    //show onglet
    show_tabs($def_onglets, $form_name, "onglet", 0);
    echo '<div class="right-content mlt_bordure" >';
} else {
    $protectedPost['onglet'] = "STAT";
}
$list_fields = array('GROUP_NAME' => 'h.NAME', 'GROUP_ID' => 'h.ID', 'DESCRIPTION' => 'h.DESCRIPTION', 'CREATE' => 'h.LASTDATE', 'NBRE' => 'NBRE');
//only for admins
if ($_SESSION['OCS']['profile']->getConfigValue('GROUPS') == "YES") {
    if ($protectedPost['onglet'] == "STAT") {
        $list_fields['CHECK'] = 'ID';
    }
    $list_fields['SUP'] = 'ID';
    $tab_options['LBL_POPUP']['SUP'] = 'NAME';
    $tab_options['LBL']['SUP'] = $l->g(122);
}
//changement de nom à l'affichage des champs
예제 #17
0
        if ($fromform->format === 'text') {
            ExportToCSV($data, $filename);
        } else {
            ExportToTableEd($data, $filename, $fromform->format);
        }
        exit;
    } else {
        print_error('Students not found!', 'report.php?id=' . $id);
    }
} else {
    /// Print headers
    $navlinks[] = array('name' => $attforblock->name, 'link' => "view.php?id={$id}", 'type' => 'activity');
    $navlinks[] = array('name' => get_string('export', 'quiz'), 'link' => null, 'type' => 'activityinstance');
    $navigation = build_navigation($navlinks);
    print_header("{$course->shortname}: " . $attforblock->name . ' - ' . get_string('export', 'quiz'), $course->fullname, $navigation, "", "", true, "&nbsp;", navmenu($course));
    show_tabs($cm, $context, 'export');
    $mform_export->display();
}
echo $OUTPUT->footer($course);
/////////////////////////////////////////////////////////////////////////////////
function ExportToTableEd($data, $filename, $format)
{
    global $CFG;
    if ($format === 'excel') {
        require_once "{$CFG->libdir}/excellib.class.php";
        $filename .= ".xls";
        $workbook = new MoodleExcelWorkbook("-");
    } else {
        require_once "{$CFG->libdir}/odslib.class.php";
        $filename .= ".ods";
        $workbook = new MoodleODSWorkbook("-");
echo open_form($form_name);
if (isset($protectedPost['MODIF']) and $protectedPost['MODIF'] != '') {
    $protectedPost['tab'] = 'ADD';
    $sql = "select NAME,REGTREE,REGKEY,REGVALUE,ID from regconfig where id = '%s'";
    $arg = $protectedPost['MODIF'];
    //$sql="select NAME,ID,MASK from subnet where netid='".$netid."'";
    $res = mysql2_query_secure($sql, $_SESSION['OCS']["readServer"], $arg);
    $row = mysqli_fetch_object($res);
    $protectedPost['NAME'] = $row->NAME;
    $protectedPost['REGTREE'] = $row->REGTREE;
    $protectedPost['REGKEY'] = $row->REGKEY;
    $protectedPost['REGVALUE'] = $row->REGVALUE;
    $tab_hidden['id'] = $row->ID;
}
$tab_options = $protectedPost;
show_tabs($tab, $form_name, "tab", 4);
echo '<div class="right-content mlt_bordure" >';
if ($ajax) {
    if (isset($protectedPost['REGKEY'])) {
        $protectedPost['tab'] = "VIEW";
    }
}
if ($protectedPost['tab'] == 'VIEW') {
    // delete register key
    if (isset($protectedPost['SUP_PROF']) and $protectedPost['SUP_PROF'] != '') {
        // delete one row
        delkey($protectedPost['SUP_PROF']);
        $tab_options['CACHE'] = 'RESET';
    } else {
        if (isset($protectedPost['del_check']) and $protectedPost['del_check'] != '') {
            // delete multiple selected rows
예제 #19
0
        break;
    case '':
        // Do Nothing
        break;
    default:
        lcm_panic("No such action (" . _request('action') . ")");
}
lcm_page_start(_T('menu_admin_keywords'), '', '', 'keywords_intro');
lcm_bubble('keyword_list');
echo show_all_errors();
//
// Tabs
//
$groups = array('system' => _T('keywords_tab_system'), 'contact' => _T('keywords_tab_contact'), 'user' => _T('keywords_tab_user'), 'maint' => _T('keywords_tab_maintenance'));
$tab = _request('tab', 'system');
show_tabs($groups, $tab, $_SERVER['SCRIPT_NAME']);
switch ($tab) {
    case 'system':
    case 'user':
    case 'contact':
        show_all_keywords_type($tab);
        break;
    case 'maint':
        echo '<fieldset class="info_box">' . "\n";
        echo '<form method="post" action="' . $_SERVER['REQUEST_URI'] . '">' . "\n";
        echo '<p>' . _T('keywords_info_maintenance') . "</p>\n";
        echo '<input type="hidden" name="action" value="refresh" />' . "\n";
        echo '<button type="submit" name="submit_button" value="refresh" class="simple_form_btn">' . _T('button_validate') . "</button>\n";
        echo "</form>\n";
        echo "</fieldset>\n";
}