mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-57497 core_calendar: added new calendar event class
Moved calendar_event class to new location using replaceclasses.php Part of MDL-55611 epic.
This commit is contained in:
parent
e9dfeec94e
commit
e057f279e4
25 changed files with 901 additions and 877 deletions
|
@ -206,8 +206,8 @@ function lesson_update_events($lesson, $override = null) {
|
|||
unset($event->id);
|
||||
}
|
||||
$event->name = $eventname.' ('.get_string('lessonopens', 'lesson').')';
|
||||
// The method calendar_event::create will reuse a db record if the id field is set.
|
||||
calendar_event::create($event);
|
||||
// The method \core_calendar\event::create will reuse a db record if the id field is set.
|
||||
\core_calendar\event::create($event);
|
||||
}
|
||||
if ($deadline && $addclose) {
|
||||
if ($oldevent = array_shift($oldevents)) {
|
||||
|
@ -224,14 +224,14 @@ function lesson_update_events($lesson, $override = null) {
|
|||
$event->priority = $closepriorities[$deadline];
|
||||
}
|
||||
}
|
||||
calendar_event::create($event);
|
||||
\core_calendar\event::create($event);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Delete any leftover events.
|
||||
foreach ($oldevents as $badevent) {
|
||||
$badevent = calendar_event::load($badevent);
|
||||
$badevent = \core_calendar\event::load($badevent);
|
||||
$badevent->delete();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue