From ddaff608dc56f33afc2517ad98a4fb13af549ae6 Mon Sep 17 00:00:00 2001 From: Sam Hemelryk Date: Fri, 20 Nov 2009 06:36:11 +0000 Subject: [PATCH] calendar MDL-19793 Fixed minor regressions caused by recent updates --- calendar/lib.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/calendar/lib.php b/calendar/lib.php index ec291bdf17..cb81ec65de 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -1658,6 +1658,9 @@ function calendar_add_event_allowed($event) { return has_capability('moodle/calendar:manageentries', get_context_instance(CONTEXT_COURSE, SITEID)); default: + if (isset($event->courseid) && $event->courseid > 0) { + return has_capability('moodle/calendar:manageentries', get_context_instance(CONTEXT_COURSE, $event->courseid)); + } return false; } } @@ -2051,6 +2054,8 @@ class calendar_event { add_to_log($this->properties->courseid, 'calendar', 'edit all', 'event.php?action=edit&id='.$this->properties->id, $this->properties->name); } else { $DB->update_record('event', $this->properties); + $event = calendar_event::load($this->properties->id); + $this->properties = $event->properties(); add_to_log($this->properties->courseid, 'calendar', 'edit', 'event.php?action=edit&id='.$this->properties->id, $this->properties->name); } -- 2.39.5