MDL-33767 Course: The actions on default section redirect to the correct section
This commit is contained in:
committed by
Aparup Banerjee
parent
3240c7100e
commit
483d768bc0
@@ -33,9 +33,9 @@ require_once($CFG->libdir . '/conditionlib.php');
|
||||
require_once('editsection_form.php');
|
||||
|
||||
$id = required_param('id',PARAM_INT); // Week/topic ID
|
||||
$sectionreturn = optional_param('sectionreturn', 0, PARAM_BOOL);
|
||||
$sectionreturn = optional_param('sr', 0, PARAM_INT);
|
||||
|
||||
$PAGE->set_url('/course/editsection.php', array('id'=>$id, 'sectionreturn'=> $sectionreturn));
|
||||
$PAGE->set_url('/course/editsection.php', array('id'=>$id, 'sr'=> $sectionreturn));
|
||||
|
||||
$section = $DB->get_record('course_sections', array('id' => $id), '*', MUST_EXIST);
|
||||
$course = $DB->get_record('course', array('id' => $section->course), '*', MUST_EXIST);
|
||||
@@ -60,11 +60,7 @@ $mform = new editsection_form($PAGE->url, array('course' => $course, 'editoropti
|
||||
'cs' => $section, 'showavailability' => $section->showavailability));
|
||||
$mform->set_data($section); // set current value
|
||||
|
||||
if ($sectionreturn) {
|
||||
$returnurl = course_get_url($course, $section->section);
|
||||
} else {
|
||||
$returnurl = course_get_url($course);
|
||||
}
|
||||
$returnurl = course_get_url($course, $sectionreturn);
|
||||
|
||||
/// If data submitted, then process and store.
|
||||
if ($mform->is_cancelled()){
|
||||
|
||||
Reference in New Issue
Block a user