$approver_name = 'Not Registered'; } } else { $approver_email = ''; $approver_name = ''; } $home = new moodle_url('/'); $dir = $home . 'local/obu_application/'; $program = $dir . 'mdl_redirect.php?id=' . $application_id; $heading = get_string('redirect_application', 'local_obu_application'); $PAGE->set_context($context); $PAGE->set_pagelayout('standard'); $PAGE->set_url($program); $PAGE->set_heading($SITE->fullname); $PAGE->set_title($heading); $application = read_application($application_id); $application_title = $application->course_code . ' ' . $application->course_name . ' (Application Ref HLS/' . $application->id . ')'; get_application_status($USER->id, $application, $text, $button); // get the approval trail and the next action (from the user's perspective) $application_status = '<h4>' . $application_title . '</h4>' . $text; $parameters = ['application_id' => $application_id, 'application_status' => $application_status, 'approver_email' => $approver_email, 'approver_name' => $approver_name]; // Check that it is possible to redirect the form if ($application->approval_state > 0) { // Already finally approved or rejected? $message = get_string('application_unavailable', 'local_obu_application'); } else { $message = ''; } $mform = new mdl_redirect_form(null, $parameters); if ($mform->is_cancelled()) { redirect($home);
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * */ require_once '../../config.php'; require_once './locallib.php'; require_once './process_form.php'; require_once $CFG->libdir . '/moodlelib.php'; require_login(); $context = context_system::instance(); $manager = has_capability('local/obu_application:manage', $context); $home = new moodle_url('/'); // We only handle an existing application (id given) if (!isset($_REQUEST['id'])) { redirect($home); } $application = read_application($_REQUEST['id']); if ($application === false) { redirect($home); } $process = $home . 'local/obu_application/mdl_process.php?id=' . $application->id; $PAGE->set_context($context); $PAGE->set_pagelayout('standard'); $PAGE->set_title(get_string('plugintitle', 'local_obu_application') . ': ' . get_string('process', 'local_obu_application')); $PAGE->set_url($process); $PAGE->navbar->add(get_string('application', 'local_obu_application', $application->id)); $message = ''; // If not awaiting approval by someone, display the current status (prominently) if ($application->approval_state == 0 && $application->approval_level == 0) { // Application not yet submitted if ($USER->id != $application->userid) { // no-one else can look at your unsubmitted applications
// So that we can exclude them later $approver_email = ''; $url = new moodle_url('/local/obu_application/mdl_approvals.php'); $heading = get_string('approvals', 'local_obu_application'); } $PAGE->set_url($url); $PAGE->set_pagelayout('standard'); $PAGE->set_context($context); $PAGE->set_title($heading); $PAGE->set_heading($heading); // The page contents echo $OUTPUT->header(); echo $OUTPUT->heading($heading); $process = new moodle_url('/local/obu_application/mdl_process.php'); $redirect = new moodle_url('/local/obu_application/mdl_redirect.php'); $approvals = get_approvals($approver_email); // get outstanding approval requests foreach ($approvals as $approval) { if ($approver_email != '' || $approval->approver != $approver->email) { $application = read_application($approval->application_id); get_application_status($USER->id, $application, $text, $button); // get the approval trail and the next action (from the user's perspective) echo '<h4><a href="' . $process . '?id=' . $application->id . '">' . $application->course_code . ' ' . $application->course_name . ' (' . $application->lastname . ' - HLS/' . $application->id . ')</a></h4>'; echo $text; if ($application->approval_level < 3) { // Can't redirect away from final HLS approval/processing echo '<p><a href="' . $redirect . '?id=' . $application->id . '">' . get_string('redirect_application', 'local_obu_application') . '</a></p>'; } } } echo $OUTPUT->footer();
} if (empty($xfers)) { $message = get_string('no_xfer', 'local_obu_application'); } else { if ($mform_data->xfer_type < 3) { $delimiter = ','; $extension = 'csv'; } else { $delimiter = '|'; $extension = 'txt'; } header('Content-Type: text/csv'); header('Content-Disposition: attachment;filename=HLS_' . $param->name . sprintf('_%05d.', $xfer_id) . $extension); $fp = fopen('php://output', 'w'); foreach ($xfers as $index => $xfer) { $application = read_application($xfer); $fields = array(); if ($mform_data->xfer_type == 3) { $fields['Form_Released_Date'] = date('d/m/Y'); $fields['Institution_Label'] = 'Ox Brookes'; $fields['Course_Type'] = 'HLS'; } $fields['Applicant_Id'] = 'H' . sprintf('%07d', $application->userid); $fields['Form_Id'] = 'HLS/' . $application->id; $fields['Title'] = $application->title; $fields['Surname'] = $application->lastname; $fields['First_Name'] = $application->firstname; if ($mform_data->xfer_type == 1 || $mform_data->xfer_type == 3) { // Admissions if ($mform_data->xfer_type == 3) { $fields['Middle_Name'] = '';