Ejemplo n.º 1
0
        redirect($return);
    } else {
        redirect('etudiant.php?d=' . $referentiel->id);
    }
}
/// selection d'utilisateurs
if (isset($action) && $action == 'selectuser' && isset($form->userid) && $form->userid > 0 && confirm_sesskey()) {
    $userid_filtre = $form->userid;
    // DEBUG
    // echo "<br />DEBUG :: etudiant.php :: Ligen 172 :: ACTION : $action  User: $userid_filtre\n";
    unset($form);
    unset($action);
    // exit;
}
/// Delete any requested records
if (!empty($deleteid) && confirm_sesskey() && (has_capability('mod/referentiel:managecertif', $context) or referentiel_etudiant_isowner($deleteid))) {
    if ($confirm = optional_param('confirm', 0, PARAM_INT)) {
        if (referentiel_delete_etudiant_user($deleteid)) {
            if ($CFG->version > 2014051200) {
                // Moodle 2.7+
                $params = array('contextid' => $context->id, 'objectid' => $deleteid);
                $event = \mod_referentiel\event\etudiant_deleted::create($params);
                $event->trigger();
            } else {
                // Before Moodle 2.7
                add_to_log($course->id, 'referentiel', 'delete', "etudiant.php?id={$cm->id}", $deleteid, $cm->id);
            }
            // notify(get_string('recorddeleted','referentiel'), 'notifysuccess');
        }
        redirect("{$CFG->wwwroot}/mod/referentiel/etudiant.php?id={$cm->id}&amp;sesskey=" . sesskey());
        exit;
Ejemplo n.º 2
0
$returnlink_ref = new moodle_url('/mod/referentiel/view.php', array('id' => $cm->id, 'non_redirection' => '1'));
$returnlink_course = new moodle_url('/course/view.php', array('id' => $course->id));
$returnlink_add = new moodle_url('/mod/referentiel/add.php', array('d' => $referentiel->id, 'sesskey' => sesskey()));
require_login($course->id, false, $cm);
if (!isloggedin() || isguestuser()) {
    redirect($returnlink_course);
}
$context = context_module::instance($cm->id);
require_capability('mod/referentiel:export', $context);
require_capability('mod/referentiel:export', $context);
// ensure the files area exists for this course
// Moodle 1.9
// make_upload_directory( "$course->id/$CFG->moddata/referentiel" );
if ($etudiant_id) {
    // So do you have access?
    if (!(has_capability('mod/referentiel:writereferentiel', $context) or referentiel_etudiant_isowner($etudiant_id)) or !confirm_sesskey()) {
        print_error(get_string('noaccess', 'referentiel'));
    }
}
// RECUPERER LES FORMULAIRES
if (isset($SESSION->modform)) {
    // Variables are stored in the session
    $form = $SESSION->modform;
    unset($SESSION->modform);
} else {
    $form = (object) $_POST;
}
if ($cancel) {
    if (!empty($SESSION->returnpage)) {
        $return = $SESSION->returnpage;
        unset($SESSION->returnpage);