19 declare(strict_types=1);
39 if (count($affected_talks) === 0) {
43 $superior = new \ilObjUser($affected_talks[0]->getOwner());
44 $employee = new \ilObjUser($affected_talks[0]->getData()->getEmployee());
47 case NotificationType::INVITATION:
48 $subject_key =
'notification_talks_subject';
49 $message_key =
'notification_talks_created';
54 $subject_key =
'notification_talks_subject_update';
55 $message_key =
'notification_talks_removed';
59 case NotificationType::UPDATE:
61 $subject_key =
'notification_talks_subject_update';
62 $message_key =
'notification_talks_updated';
67 $add_time = $affected_talks[0]->
getData()->isAllDay() ? 0 : 1;
69 $timezone = $employee->getTimeZone();
74 $affected_talks[0]->getRefId(),
76 $affected_talks[0]->getDescription(),
77 $affected_talks[0]->getData()->getLocation(),
80 $this->vcalendar_generator->fromTalkSeries($affected_talks[0]->
getParent(), $employee, $superior),
84 $notification->
send();
96 foreach ($talks as $talk) {
97 $dates[] = $talk->getData()->getStartDate();
106 return $a < $b ? -1 : 1;
109 $formatted_dates = [];
110 foreach ($dates as $date) {
113 return $formatted_dates;
VCalendarGeneratorInterface $vcalendar_generator
extractFormattedDates(string $format, string $timezone, \ilObjEmployeeTalk ... $talks)
__construct(VCalendarGeneratorInterface $vcalendar_generator)
static getUserDateFormat(int $a_add_time=0, bool $a_for_parsing=false)
Parse current user setting into date/time format.
send(NotificationType $type, \ilObjEmployeeTalk ... $affected_talks)
All affected talks must come from the same series.
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples