mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 08:44:07 -04:00
Merge pull request #48621 from nextcloud/feat/issue-3786-allow-shared-calendars
feat: Allow shared calendars as appointment conflict calendars
This commit is contained in:
commit
9d49c75bdb
1 changed files with 7 additions and 9 deletions
|
|
@ -24,16 +24,14 @@ class CalendarProvider implements ICalendarProvider {
|
|||
}
|
||||
|
||||
public function getCalendars(string $principalUri, array $calendarUris = []): array {
|
||||
$calendarInfos = [];
|
||||
if (empty($calendarUris)) {
|
||||
$calendarInfos = $this->calDavBackend->getCalendarsForUser($principalUri);
|
||||
} else {
|
||||
foreach ($calendarUris as $calendarUri) {
|
||||
$calendarInfos[] = $this->calDavBackend->getCalendarByUri($principalUri, $calendarUri);
|
||||
}
|
||||
}
|
||||
|
||||
$calendarInfos = array_filter($calendarInfos);
|
||||
$calendarInfos = $this->calDavBackend->getCalendarsForUser($principalUri) ?? [];
|
||||
|
||||
if (!empty($calendarUris)) {
|
||||
$calendarInfos = array_filter($calendarInfos, function ($calendar) use ($calendarUris) {
|
||||
return in_array($calendar['uri'], $calendarUris);
|
||||
});
|
||||
}
|
||||
|
||||
$iCalendars = [];
|
||||
foreach ($calendarInfos as $calendarInfo) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue