From b5dc6b393bb70fabaa59fa5ab77d3fc00013f59d Mon Sep 17 00:00:00 2001 From: Christoph Ludolf Date: Tue, 6 Aug 2024 11:17:22 +0200 Subject: [PATCH 1/2] implements import of iCal exclusions --- Services/Calendar/classes/iCal/class.ilICalParser.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Services/Calendar/classes/iCal/class.ilICalParser.php b/Services/Calendar/classes/iCal/class.ilICalParser.php index 2c48b30047e8..ee12c8274dcc 100644 --- a/Services/Calendar/classes/iCal/class.ilICalParser.php +++ b/Services/Calendar/classes/iCal/class.ilICalParser.php @@ -393,6 +393,17 @@ protected function writeEvent(): void } $entry->save(); + // Search exclusions + // Only possible after entry is saved, otherwise the id is not available + foreach ($this->getContainer()->getItemsByName('EXDATE', false) as $item) { + if (is_a($item, 'ilICalProperty')) { + $rec_exclusion = new ilCalendarRecurrenceExclusion(); + $rec_exclusion->setEntryId($entry->getEntryId()); + $rec_exclusion->setDate(new ilDate($item->getValue(), IL_CAL_DATE)); + $rec_exclusion->save(); + } + } + $ass = new ilCalendarCategoryAssignments($entry->getEntryId()); $ass->addAssignment($this->category->getCategoryID()); From e389497353e1e2161842b705f715d3da27ffc8e9 Mon Sep 17 00:00:00 2001 From: Christoph Ludolf Date: Tue, 6 Aug 2024 11:20:35 +0200 Subject: [PATCH 2/2] copyright fix --- Services/Calendar/classes/iCal/class.ilICalParser.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Services/Calendar/classes/iCal/class.ilICalParser.php b/Services/Calendar/classes/iCal/class.ilICalParser.php index ee12c8274dcc..d8a7ed200c61 100644 --- a/Services/Calendar/classes/iCal/class.ilICalParser.php +++ b/Services/Calendar/classes/iCal/class.ilICalParser.php @@ -1,7 +1,5 @@