if ($id) $PAGE->navbar->add(get_string('manageplan', 'local_curriculum'), new moodle_url('/local/curriculum/viewcurriculum.php', array('id' => $cid, 'assign' => 1))); $PAGE->navbar->add(get_string('assigncourses', 'local_curriculum')); echo $OUTPUT->header(); echo $OUTPUT->heading(get_string('managecurriculum', 'local_curriculum')); //try{ $schoollist = $hierarchy->get_assignedschools(); if (is_siteadmin()) { $schoollist = $hierarchy->get_school_items(); } $count = count($schoollist); //Count of schools to which registrar is assigned if ($count < 1) { throw new Exception(get_string('notassignedschool', 'local_collegestructure')); } //Tab view $curriculum = new curricula(); $curriculum->print_curriculumtabs($mode); if ($id) $plan = $DB->get_record('local_curriculum_plan', array('id' => $id)); $cur = $DB->get_record('local_curriculum', array('id' => $cid)); if ($id) $name = $cplan->name($plan); else $name = $cplan->name($cur); echo ($id) ? '<h4>' . $cur->shortname . ': ' . $plan->fullname . '</h4>' : '<h4>' . $cur->fullname . '</h4>'; echo $OUTPUT->box(get_string('viewassigncoursetoplanpage', 'local_curriculum')); //display the details of plan. $out = '<br/><table border="0" style="width:100%;"><tr><td style="width:50%;"><b>' . get_string('schoolid', 'local_collegestructure') . ' : </b>' . $name->school . '</td><td align="right" style="width:50%;"><b>' . get_string('program', 'local_programs') . ' : </b>' . $name->program . '</td></tr></table>';
$nav = $assign ? get_string('manageplan', 'local_curriculum') : get_string('viewcurriculum', 'local_curriculum'); $PAGE->navbar->add($nav); $PAGE->set_title(get_string('curriculum', 'local_curriculum') . ': ' . $nav); echo $OUTPUT->header(); if (!$curriculumlist = $DB->get_record('local_curriculum', array('id' => $id))) print_error(' invalid curriculum id'); $enableplan = $curriculumlist->enableplan; //Heading of the page $heading = $assign ? get_string('managecurriculum', 'local_curriculum') : $curriculumlist->fullname; echo $OUTPUT->heading($heading); $currenttab = "manageplan"; $curriculum = new curricula(); if ($assign) $curriculum->print_curriculumtabs($currenttab); //Get the records from the database $curriculum->view_curriculum($id); /** Show the curriculum with all the plans created along with courses * * */ $cplan = curriculumplan::getInstance(); $hierarchy = new hierarchy(); $sql = "SELECT cur.*, pro.fullname AS programname FROM {local_curriculum} AS cur JOIN {local_program} AS pro ON pro.id = cur.programid AND pro.schoolid = cur.schoolid WHERE cur.id = {$id}";
//get the admin layout $PAGE->set_pagelayout('admin'); //check the context level of the user and check weather the user is login to the system or not $PAGE->set_context($systemcontext); $PAGE->set_heading($SITE->fullname); $PAGE->navbar->add(get_string('managecurriculum', 'local_curriculum'), "/local/curriculum/index.php", get_string('viewcurriculum', 'local_curriculum')); $PAGE->navbar->add(get_string('assigncuplan', 'local_curriculum')); $PAGE->set_url(new moodle_url('/local/curriculum/assignmodules.php', array('id' => $id))); require_login(); $PAGE->set_pagelayout('admin'); echo $OUTPUT->header(); $currenttab = "assigncuplan"; $curriculum = new curricula(); $curriculum->print_curriculumtabs($currenttab); //$PAGE->set_category_by_id($id); $returnurl = new moodle_url('/local/curriculum/assignmodules.php', array('id' => $id)); // Process any Module assigning Process actions. // assign a specified module to a new semester if (!empty($moveto) and $data = data_submitted()) { if (!$destcategory = $DB->get_record('local_curriculum', array('id' => $data->moveto))) { print_error('cannotfindcurriculum', '', '', $data->moveto); } $modules = array(); foreach ($data as $key => $value) { if (preg_match('/^c\d+$/', $key)) {
$data->description = $data->description['text']; $conf->plan = $data->fullname; if ($data->id > 0) { // Update record $cplan->update_plan($data->id, $data); $message = get_string('updatesuccess', 'local_curriculum', $conf); } else { // Add new record $data->timecreated = time(); $cplan->insert_plan($data); $message = get_string('createsuccess', 'local_curriculum', $conf); } $options = array('style' => 'notifysuccess'); $hierarchy->set_confirmation($message, $returnurl, $options); } //display the page echo $OUTPUT->header(); echo $OUTPUT->heading(get_string('managecurriculum', 'local_curriculum')); // Tab view $curriculum = new curricula(); $currenttab = 'addnewplan'; $curriculum->print_curriculumtabs($currenttab); if (isset($CFG->allowframembedding) and ! $CFG->allowframembedding) { echo $OUTPUT->box(get_string('viewplancreationpage', 'local_curriculum')); } // Display the form $plan->display(); echo $OUTPUT->footer(); ?>
$PAGE->set_context($systemcontext); $PAGE->requires->css('/local/curriculum/css/styles.css'); //get the admin layout $PAGE->set_pagelayout('admin'); if ($CFG->forcelogin) { require_login(); } else { user_accesstime_log(); } $PAGE->set_heading($SITE->fullname); //this is the return url $strheading = get_string('managecurriculum', 'local_curriculum'); $returnurl = new moodle_url('/local/curriculum/activeplan.php', array('id' => $id)); $curriculum = new curricula(); if($id > 0) { if(!$tool = $DB->get_record('local_activeplan_batch', array('id'=>$id))){ print_error('Invalid ID'); } } else { $tool = new stdClass(); $tool->id = $id; } /* Start of delete the record */ if ($delete) { $PAGE->url->param('delete', 1); if ($confirm and confirm_sesskey()) { $DB->delete_records('local_activeplan_batch', array('id'=>$id));
$PAGE->set_context($systemcontext); //get the admin layout $PAGE->set_pagelayout('admin'); if ($CFG->forcelogin) { require_login(); } else { user_accesstime_log(); } $PAGE->set_heading($SITE->fullname); //this is the return url $strheading = get_string('managecurriculum', 'local_curriculum'); $returnurl = new moodle_url('/local/curriculum/index.php', array('id' => $id, 'page' => $page)); $curriculum = new curricula(); /* Start of delete the faculty */ if ($delete) { $PAGE->url->param('delete', 1); if ($confirm and confirm_sesskey()) { $curriculum->curriculum_delete_instance($id); redirect($returnurl); } $strheading = get_string('deletecurriculum', 'local_curriculum'); $PAGE->navbar->add(get_string('managecurriculum', 'local_curriculum'), new moodle_url('/local/curriculum/index.php', array('id' => $id))); $PAGE->navbar->add($strheading); $PAGE->set_title(get_string('curriculum', 'local_curriculum') . ': ' . $strheading); echo $OUTPUT->header();