From: defacer Date: Mon, 24 May 2004 12:23:08 +0000 (+0000) Subject: Fixed a bug just introduced before in the event type selection screen. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=0d5d9de2ba09d54ba4f6a29c13f85962d1dfcb71;p=moodle.git Fixed a bug just introduced before in the event type selection screen. --- diff --git a/calendar/event.php b/calendar/event.php index 397a98ae5e..6167f29b62 100644 --- a/calendar/event.php +++ b/calendar/event.php @@ -188,15 +188,11 @@ if(empty($focus)) $focus = ''; // Let's see if we are supposed to provide a referring course link - // but NOT for the front page - - if (!empty($SESSION->cal_course_referer)) { - if ($course = get_record('course', 'id', $SESSION->cal_course_referer)) { - $shortname = $course->shortname; - $nav = ''.$shortname.' -> '.$nav; - } - } else { - $nav = ''; + // but NOT for the "main page" course + if($SESSION->cal_course_referer > 1 && + ($shortname = get_field('course', 'shortname', 'id', $SESSION->cal_course_referer)) !== false) { + // If we know about the referring course, show a return link + $nav = ''.$shortname.' -> '.$nav; } print_header(get_string('calendar', 'calendar').': '.$title, $site->fullname, $nav.' -> '.$title, @@ -294,16 +290,10 @@ $form->timestart = time(); } - if(!isset($_REQUEST['type'])) { - // We don't know what kind of event we want - calendar_get_allowed_types($allowed); - if(!$allowed->groups && !$allowed->courses && !$allowed->site) { - // Take the shortcut - $_REQUEST['type'] = 'user'; - } - else { - $_REQUEST['type'] = 'select'; - } + calendar_get_allowed_types($allowed); + if(!$allowed->groups && !$allowed->courses && !$allowed->site) { + // Take the shortcut + $_REQUEST['type'] = 'user'; } $header = '';