MDL-32526 Course: After creating course user should be redirected to newly created course

After creating a new course if user has capability to enrol users then
enrol user page should be visible else user should see newly created course
This commit is contained in:
Rajesh Taneja
2013-01-16 16:29:11 +08:00
parent 3e90b10ad8
commit 3fc3fcd333
+2 -10
View File
@@ -135,16 +135,8 @@ if ($editform->is_cancelled()) {
update_course($data, $editoroptions);
}
switch ($returnto) {
case 'category':
case 'topcat': //redirecting to where the new course was created by default.
$url = new moodle_url($CFG->wwwroot.'/course/category.php', array('id'=>$categoryid));
break;
default:
$url = new moodle_url($CFG->wwwroot.'/course/view.php', array('id'=>$course->id));
break;
}
redirect($url);
// Redirect user to newly created/updated course.
redirect(new moodle_url('/course/view.php', array('id' => $course->id)));
}