Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions IcalParser/IcalRangedParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ public function parseRecurrences($event): array
} elseif (class_exists('FreePBX')) {
//fast is not implemented here for obvious reasons

\FreePBX::Notifications()->add_warning('calendar', 'RRULECOUNT', _('Calendar using COUNT'), _('A calendar you have added has an event that has a reoccuring rule of COUNT. When COUNT is used this slows down Calendar drastically. Please change your rule to another format'), "", true, true);
if( \FreePBX::Notifications()->exists('calendar', 'RRULECOUNT') === 0){
\FreePBX::Notifications()->('calendar', 'RRULECOUNT', _('Calendar using COUNT'), _('A calendar you have added has an event that has a reoccuring rule of COUNT. When COUNT is used this slows down Calendar drastically. Please change your rule to another format'), "", true, true);
}

/*
$period = CarbonPeriod::between($event['DTSTART'],$this->ranges['end']);
Expand Down Expand Up @@ -285,7 +287,9 @@ public function getEvents(): EventsList
}
*/

\FreePBX::Notifications()->add_warning('calendar', 'RECURRENCEID', _('Calendar using RECURRENCE-ID'), str_replace('%event', $event['SUMMARY'], _('A calendar you have added has an event called "%event" that has a RECURRENCE-ID rule. Because there is no full support yet they are ignored, please consider changing this to Exceptions/Additions.')), "", true, true);
if( \FreePBX::Notifications()->exists('calendar', 'RECURRENCEID') === 0){
\FreePBX::Notifications()->add_warning('calendar', 'RECURRENCEID', _('Calendar using RECURRENCE-ID'), str_replace('%event', $event['SUMMARY'], _('A calendar you have added has an event called "%event" that has a RECURRENCE-ID rule. Because there is no full support yet they are ignored, please consider changing this to Exceptions/Additions.')), "", true, true);
}
$event = null; //this is an event that modifies another one. In every case (even if we weren't able to overwrite the original one for whatever reason) it should not end up in the output
} else {
//neither start nor end is within range so skip it
Expand Down Expand Up @@ -359,7 +363,9 @@ public function getEventsNow($now = 0)

if (empty($event['RECURRENCES'])) {
if (!empty($event['RECURRENCE-ID']) && !empty($event['UID']) && isset($event['SEQUENCE'])) {
\FreePBX::Notifications()->add_warning('calendar', 'RECURRENCEID', _('Calendar using RECURRENCE-ID'), str_replace('%event', $event['SUMMARY'], _('A calendar you have added has an event called "%event" that has a RECURRENCE-ID rule. Because there is no full support yet they are ignored, please consider changing this to Exceptions/Additions.')), "", true, true);
if( \FreePBX::Notifications()->exists('calendar', 'RECURRENCEID') === 0){
\FreePBX::Notifications()->add_warning('calendar', 'RECURRENCEID', _('Calendar using RECURRENCE-ID'), str_replace('%event', $event['SUMMARY'], _('A calendar you have added has an event called "%event" that has a RECURRENCE-ID rule. Because there is no full support yet they are ignored, please consider changing this to Exceptions/Additions.')), "", true, true);
}
} else {
if ($event['DTSTART']->getTimestamp() < $now && $now < $event['DTEND']->getTimestamp())
array_push($events, $event); //event is now, keep it
Expand Down