Skip to content

Commit

Permalink
Merge pull request #7895 from chlulei/8_import_ical_exclusions
Browse files Browse the repository at this point in the history
implements import of iCal exclusions
  • Loading branch information
smeyer-ilias committed Aug 12, 2024
1 parent 1184260 commit 6d9e25f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions components/ILIAS/Calendar/classes/iCal/class.ilICalParser.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
Expand All @@ -18,6 +16,7 @@
*
*********************************************************************/

declare(strict_types=1);

/**
* @author Stefan Meyer <[email protected]>
Expand Down Expand Up @@ -393,6 +392,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());

Expand Down

0 comments on commit 6d9e25f

Please sign in to comment.