MDL-31556 Lesson Module: fixed missing 'lesson closes' event in calendar
authorJoseph Rezeau <moodle@rezeau.org>
Thu, 16 Feb 2012 08:08:15 +0000 (16:08 +0800)
committerRossiani Wijaya <rwijaya@moodle.com>
Thu, 16 Feb 2012 08:08:15 +0000 (16:08 +0800)
mod/lesson/lib.php

index 6ca0738..4781fbc 100644 (file)
@@ -659,7 +659,9 @@ function lesson_process_post_save(&$lesson) {
         if ($lesson->available) {
             $event->name = $lesson->name.' ('.get_string('lessonopens', 'lesson').')';
             calendar_event::create(clone($event));
-        } else if ($lesson->deadline) {
+        }
+
+        if ($lesson->deadline) {
             $event->name      = $lesson->name.' ('.get_string('lessoncloses', 'lesson').')';
             $event->timestart = $lesson->deadline;
             $event->eventtype = 'close';