From: dwoolhead Date: Fri, 22 Jun 2007 13:30:22 +0000 (+0000) Subject: MDL-10084 propogate course id through calendar pages to ensure consistent display... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=54052a7ae124990ccbd87edec1e50369e3085397;p=moodle.git MDL-10084 propogate course id through calendar pages to ensure consistent display for site front page, my moodle and courses --- diff --git a/calendar/lib.php b/calendar/lib.php index 68202713f5..867b966d7a 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -518,9 +518,13 @@ function calendar_print_event($event) { echo format_text($event->description, FORMAT_HTML); if (calendar_edit_event_allowed($event)) { echo '
'; + $calendarcourseid = ''; + if (!empty($event->calendarcourseid)) { + $calendarcourseid = '&course='.$event->calendarcourseid; + } if (empty($event->cmid)) { - $editlink = CALENDAR_URL.'event.php?action=edit&id='.$event->id; - $deletelink = CALENDAR_URL.'event.php?action=delete&id='.$event->id; + $editlink = CALENDAR_URL.'event.php?action=edit&id='.$event->id.$calendarcourseid; + $deletelink = CALENDAR_URL.'event.php?action=delete&id='.$event->id.$calendarcourseid; } else { $editlink = $CFG->wwwroot.'/course/mod.php?update='.$event->cmid.'&return=true&sesskey='.$USER->sesskey; $deletelink = $CFG->wwwroot.'/course/mod.php?delete='.$event->cmid.'&sesskey='.$USER->sesskey;; @@ -670,7 +674,7 @@ function calendar_top_controls($type, $data) { $nextlink = calendar_get_link_next(get_string('monthnext', 'access'), 'index.php?', 0, $nextmonth, $nextyear, $accesshide=true); $prevlink = calendar_get_link_previous(get_string('monthprev', 'access'), 'index.php?', 0, $prevmonth, $prevyear, true); $content .= "\n".'
'. $prevlink; - $content .= ' | '.userdate($time, get_string('strftimemonthyear')).''; + $content .= ' | '.userdate($time, get_string('strftimemonthyear')).''; $content .= ' | '. $nextlink ."\n"; $content .= "
\n"; break; @@ -680,7 +684,7 @@ function calendar_top_controls($type, $data) { $nextlink = calendar_get_link_next(get_string('monthnext', 'access'), 'view.php?id='.$data['id'].'&', 0, $nextmonth, $nextyear, $accesshide=true); $prevlink = calendar_get_link_previous(get_string('monthprev', 'access'), 'view.php?id='.$data['id'].'&', 0, $prevmonth, $prevyear, true); $content .= "\n".'
'. $prevlink; - $content .= ' | '.userdate($time, get_string('strftimemonthyear')).''; + $content .= ' | '.userdate($time, get_string('strftimemonthyear')).''; $content .= ' | '. $nextlink ."\n"; $content .= "
\n"; break; diff --git a/calendar/view.php b/calendar/view.php index b12d827eea..7ecc0960f4 100644 --- a/calendar/view.php +++ b/calendar/view.php @@ -268,6 +268,7 @@ function calendar_show_day($d, $m, $y, $courses, $groups, $users, $courseid) { if($event->courseid != 0 && $event->courseid != SITEID && $event->groupid == 0) { $event->class = 'event_course'.array_search($event->courseid, $courses) % CALENDAR_MAXCOURSES; } + $event->calendarcourseid = $courseid; if ($event->timestart >= $starttime && $event->timestart <= $endtime) { // Print it now