From 822b3591855a4ffbe164674786313ef659b94ce4 Mon Sep 17 00:00:00 2001 From: JodliDev Date: Fri, 20 Aug 2021 19:36:47 +0200 Subject: [PATCH] first commit of new changes to CalDAV support --- calendar.php | 12 + calendar_ui.js | 60 ++++ composer.json | 11 +- config.inc.php.dist | 8 +- drivers/caldav/SQL/mysql.initial.sql | 23 +- drivers/caldav/caldav_client.php | 398 ++++++++++++++++++++++++++ drivers/caldav/caldav_driver.php | 397 +++++++++++++++++-------- drivers/caldav/caldav_sync.php | 6 +- drivers/caldav/encryption.php | 73 +++++ drivers/calendar_driver.php | 4 +- localization/de.inc | 2 + localization/de_CH.inc | 2 + localization/de_DE.inc | 2 + localization/en_US.inc | 4 + skins/elastic/templates/calendar.html | 4 + skins/larry/templates/calendar.html | 4 + 16 files changed, 870 insertions(+), 140 deletions(-) create mode 100644 drivers/caldav/caldav_client.php create mode 100644 drivers/caldav/encryption.php diff --git a/calendar.php b/calendar.php index 65cc153..691dca7 100644 --- a/calendar.php +++ b/calendar.php @@ -928,6 +928,18 @@ $("#rcmfd_new_category").keypress(function(event) { } switch ($action) { + case "new-source": //we "misuse" create_calendar() to stay compatible with other drivers + $cal['new-source'] = true; + $success = $this->driver->create_calendar($cal); + $reload = true; + break; + case "delete-source": //we "misuse" delete_calendar() to stay compatible with other drivers + $cal['delete-source'] = true; + $success = $this->driver->delete_calendar($cal); + $reload = true; + break; + case "form-source-new": //we "misuse" calendar_editform() to stay compatible with other drivers + case "form-source-delete": //we "misuse" calendar_editform() to stay compatible with other drivers case "form-new": case "form-edit": echo $this->ui->calendar_editform($action, $cal); diff --git a/calendar_ui.js b/calendar_ui.js index 571c153..50c1126 100644 --- a/calendar_ui.js +++ b/calendar_ui.js @@ -2884,6 +2884,64 @@ function rcube_calendar_ui(settings) return update_event_confirm('remove', event, { id:event.id, calendar:event.calendar, attendees:event.attendees }); }; + //opens a dialog to add caldav sources + this.calendar_new_source = function() { + var title = rcmail.gettext('addsources', 'calendar'), + params = {action: 'form-source-new', _framed: 1}, + $dialog = $('