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 = $('