Skip to content

Conversation

@kesselb
Copy link
Contributor

@kesselb kesselb commented Apr 9, 2024

Summary

Make calendar subscriptions available via php api.

TODO

Test cases

  • Add subscription
  • Delete subscription
  • Show/Hide/Rename subscription
  • Export subscription
  • Export event

Checklist

@kesselb kesselb added enhancement 2. developing Work in progress labels Apr 9, 2024
@kesselb kesselb added this to the Nextcloud 30 milestone Apr 9, 2024
@kesselb kesselb self-assigned this Apr 9, 2024
@kesselb kesselb force-pushed the feat/noid/expose-subscription-calendars branch 3 times, most recently from b60f373 to 8acafd1 Compare April 16, 2024 20:33
@kesselb kesselb marked this pull request as ready for review April 16, 2024 21:23
@kesselb
Copy link
Contributor Author

kesselb commented Apr 16, 2024

Patch the calendar app for easier testing:

diff --git a/lib/Dashboard/CalendarWidget.php b/lib/Dashboard/CalendarWidget.php
index f1bbd231e..83d978d2d 100644
--- a/lib/Dashboard/CalendarWidget.php
+++ b/lib/Dashboard/CalendarWidget.php
@@ -144,7 +144,7 @@ class CalendarWidget implements IAPIWidget, IButtonWidget, IIconWidget, IOptionW
                        return [];
                }
                $dateTime = (new DateTimeImmutable())->setTimestamp($this->timeFactory->getTime());
-               $inTwoWeeks = $dateTime->add(new DateInterval('P14D'));
+               $inTwoWeeks = $dateTime->add(new DateInterval('P60D'));
                $options = [
                        'timerange' => [
                                'start' => $dateTime,
@@ -153,7 +153,7 @@ class CalendarWidget implements IAPIWidget, IButtonWidget, IIconWidget, IOptionW
                ];
                $widgetItems = [];
                foreach ($calendars as $calendar) {
-                       $searchResult = $calendar->search('', [], $options, $limit);
+                       $searchResult = $calendar->search('', [], $options);
                        foreach ($searchResult as $calendarEvent) {
                                // Find first recurrence in the future
                                $recurrence = null;

@kesselb
Copy link
Contributor Author

kesselb commented Apr 16, 2024

@GVodyanov GVodyanov self-requested a review April 18, 2024 15:24
@kesselb kesselb force-pushed the feat/noid/expose-subscription-calendars branch from 8acafd1 to 3ba89ea Compare April 22, 2024 14:55
@tcitworld
Copy link
Member

Can this expose the subscription source as well? Would be handy for nextcloud/calendar#5168 too

@kesselb kesselb force-pushed the feat/noid/expose-subscription-calendars branch from 3ba89ea to acc19d4 Compare April 23, 2024 15:18
@kesselb
Copy link
Contributor Author

kesselb commented Apr 23, 2024

Can this expose the subscription source as well?

Added getSource to CachedSubscriptionImpl

Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense

@kesselb kesselb force-pushed the feat/noid/expose-subscription-calendars branch from 17bcc92 to 230e707 Compare May 7, 2024 12:53
@kesselb kesselb force-pushed the feat/noid/expose-subscription-calendars branch from 230e707 to e210043 Compare May 7, 2024 14:03
@kesselb kesselb added 3. to review Waiting for reviews and removed 2. developing Work in progress labels May 7, 2024
@kesselb kesselb merged commit c60de5b into master May 7, 2024
@kesselb kesselb deleted the feat/noid/expose-subscription-calendars branch May 7, 2024 20:08
@kesselb kesselb added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels May 7, 2024
@kesselb
Copy link
Contributor Author

kesselb commented May 7, 2024

/backport to stable29

@kesselb
Copy link
Contributor Author

kesselb commented May 7, 2024

/backport to stable28

@kesselb
Copy link
Contributor Author

kesselb commented May 8, 2024

/backport to stable27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to release Ready to be released and/or waiting for tests to finish enhancement feature: caldav Related to CalDAV internals

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Events from subscribed calendar not showing up in Upcoming widget.

6 participants