mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 09:26:35 +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
|
@ -126,7 +126,7 @@ function chat_add_instance($chat) {
|
|||
$event->timestart = $chat->chattime;
|
||||
$event->timeduration = 0;
|
||||
|
||||
calendar_event::create($event);
|
||||
\core_calendar\event::create($event);
|
||||
}
|
||||
return $returnid;
|
||||
}
|
||||
|
@ -157,11 +157,11 @@ function chat_update_instance($chat) {
|
|||
$event->description = format_module_intro('chat', $chat, $chat->coursemodule);
|
||||
$event->timestart = $chat->chattime;
|
||||
|
||||
$calendarevent = calendar_event::load($event->id);
|
||||
$calendarevent = \core_calendar\event::load($event->id);
|
||||
$calendarevent->update($event);
|
||||
} else {
|
||||
// Do not publish this event, so delete it.
|
||||
$calendarevent = calendar_event::load($event->id);
|
||||
$calendarevent = \core_calendar\event::load($event->id);
|
||||
$calendarevent->delete();
|
||||
}
|
||||
} else {
|
||||
|
@ -179,7 +179,7 @@ function chat_update_instance($chat) {
|
|||
$event->timestart = $chat->chattime;
|
||||
$event->timeduration = 0;
|
||||
|
||||
calendar_event::create($event);
|
||||
\core_calendar\event::create($event);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -446,7 +446,7 @@ function chat_refresh_events($courseid = 0) {
|
|||
$event->timestart = $chat->chattime;
|
||||
|
||||
if ($event->id = $DB->get_field('event', 'id', array('modulename' => 'chat', 'instance' => $chat->id))) {
|
||||
$calendarevent = calendar_event::load($event->id);
|
||||
$calendarevent = \core_calendar\event::load($event->id);
|
||||
$calendarevent->update($event);
|
||||
} else if ($chat->schedule > 0) {
|
||||
// The chat is scheduled and the event should be published.
|
||||
|
@ -459,7 +459,7 @@ function chat_refresh_events($courseid = 0) {
|
|||
$event->timeduration = 0;
|
||||
$event->visible = $DB->get_field('course_modules', 'visible', array('module' => $moduleid, 'instance' => $chat->id));
|
||||
|
||||
calendar_event::create($event);
|
||||
\core_calendar\event::create($event);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
@ -665,7 +665,7 @@ function chat_update_chat_times($chatid=0) {
|
|||
|
||||
if ($event->id = $DB->get_field_select('event', 'id', $cond, $params)) {
|
||||
$event->timestart = $chat->chattime;
|
||||
$calendarevent = calendar_event::load($event->id);
|
||||
$calendarevent = \core_calendar\event::load($event->id);
|
||||
$calendarevent->update($event, false);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue