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:30:02 +08:00
parent 2713f92d62
commit 2ed251d007
+2 -10
View File
@@ -130,16 +130,8 @@ if ($editform->is_cancelled()) {
}
rebuild_course_cache($course->id);
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)));
}