-
Notifications
You must be signed in to change notification settings - Fork 343
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7895 from chlulei/8_import_ical_exclusions
implements import of iCal exclusions
- Loading branch information
1 parent
1184260
commit 6d9e25f
Showing
1 changed file
with
12 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
@@ -18,6 +16,7 @@ | |
* | ||
*********************************************************************/ | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* @author Stefan Meyer <[email protected]> | ||
|
@@ -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()); | ||
|
||
|