Esempio n. 1
0
    $l10n->addResource(__DIR__ . '/l10n/request-details.json');
    require_once FS_PHP . '/header-external.php';
    require_once 'views/request-details.php';
    require_once FS_PHP . '/footer-external.php';
} elseif ($_GET['page'] === "add") {
    //Assert that the NOE is not in a blocked date range
    $blackout = unserialize(PROFESSOR_NOE_SUBMISSION_BLACKOUT);
    if (!empty($blackout['start']) && !empty($blackout['end'])) {
        if (strtotime($_POST['exam_date']) >= strtotime($blackout['start']) && strtotime($_POST['exam_date']) <= strtotime($blackout['end'])) {
            $loggers['audit']->notice("Attempted to add NOE in range of blackout dates");
            echo "invalid-dates";
            exit;
        }
    }
    $email = explode("@", $SESSION->email);
    $noe_id = $noes->addNOE($_POST, $SESSION->first_name . " " . $SESSION->last_name, $email[0], $SESSION->id);
    if ($noe_id) {
        $loggers['audit']->info("NOE {$noe_id} added.");
        // Check for conflicts
        if ($noes->checkNOEConflict($_POST)) {
            $noes->sendConflictNotification($_POST);
            echo 'success-yes-conflict';
        } else {
            echo 'success-no-conflict';
        }
        //Need to borrow prof module functions to trigger reminder emails professor and students
        $professor = new \Ventus\Professor\RequestForm($dbo);
        $professor->reminderToAccessServiceStudents(null, $noe_id);
        $loggers['audit']->info("Reminder sent to Access Service students for NOE {$noe_id}");
        $professor->reminderToProfessors(array('source' => 'faculty', 'exam_request_id' => $noe_id));
        $loggers['audit']->info("Reminder sent to professors for NOE {$noe_id}");
Esempio n. 2
0
    if (!$endDate) {
        $endDate = new \DateTime($default_date_range['end']);
    }
    $startDate = $startDate->format('Y-m-d');
    $endDate = $endDate->format('Y-m-d');
    $notices = $noes->fetchNOEs($startDate, $endDate);
    if ($_GET['mode'] === "as_only") {
        //If the user has requested that only NOE's with AS confirmations, we need to filter out those that don't
        $notices = array_filter($notices, function ($n) use($noes) {
            return $noes->fetchCountStudentsConfirmedAtAS($n['exam_request_id'], $n['course_code'], $n['course_section'], $n['session']) > 0;
        });
    }
    $l10n->addResource(__DIR__ . '/l10n/notice-of-examination.json');
    $viewFile = 'views/notice-of-examination.php';
} elseif ($_GET['page'] === "add-notice-of-exam") {
    $noe_id = $noes->addNOE($_POST, $SESSION->first_name . " " . $SESSION->last_name, $SESSION->user_name, $SESSION->user_id);
    $loggers['audit']->info("NOE {$noe_id} added");
    echo $noe_id;
    //Need to borrow prof module functions to trigger reminder emails professor and students
    $professor = new \Ventus\Professor\RequestForm($dbo);
    $professor->reminderToAccessServiceStudents(null, $noe_id);
    $loggers['audit']->info("Exam confirmation reminders sent to students for NOE {$noe_id}");
    $professor->reminderToProfessors(array('source' => 'exams', 'exam_request_id' => $noe_id));
    $loggers['audit']->info("Exam reminder sent to professors for NOE {$noe_id}");
} elseif ($_GET['page'] === "delete-request") {
    $noes->deleteNOE($_POST['request_id']);
    $loggers['audit']->info("NOE {$_POST['request_id']} deleted");
} elseif ($_GET['page'] === "update-exam-date-and-duration") {
    $noes->updateExamStartAndDuration($_POST['request_id'], $_POST['exam_date'], $_POST['exam_duration'], $SESSION->user_id);
    $loggers['audit']->info("Exam date updated for NOE {$_POST['request_id']}");
} elseif ($_GET['page'] === "fetch-control-sheet") {