fasterit / roundcube_calendar

A functional version of Kolab's roundcube plugin with CalDAV forked from https://gitlab.awesome-it.de/kolab/roundcube-plugins/tree/feature_caldav
GNU Affero General Public License v3.0
19 stars 21 forks source link

Using default calender configuration not working #14

Open daincredibleholg opened 7 years ago

daincredibleholg commented 7 years ago

It looks like the Roundcube API changed.

This is tested with Roundcube 1.2.4 (using the complete package, if it has any importance) and todays HEAD of master (aka creating a fresh clone from the repository).

Once I add this to the plugins config.inc.php, it blows:

$config['calendar_preinstalled_calendars'] = array(
    'Caldav' => array(
                    'driver'      => 'caldav',
                    'caldav_user' => '%u',
                    'caldav_pass' => '%p',
                    'caldav_url'  => 'https:/cloud.mydomain.example/',
                    'color'       => 'cccc00',
                    'showAlarms'  => 1),
);

The error from Roundcubes error log is:

[31-Mar-2017 09:20:12 +0200]: PHP Error: Failed to load plugin file /var/www/htdocs/plugins/carddav/carddav.php in /var/www//htdocs/program/lib/Roundcube/rcube_plugin_api.php on line 173 (GET /?_task=calendar)
[31-Mar-2017 09:20:12 +0200]: PHP Error: Failed to load plugin file /var/www/htdocs/plugins/contextmenu/contextmenu.php in /var/www/htdocs/program/lib/Roundcube/rcube_plugin_api.php on line 173 (GET /?_task=calendar)
[31-Mar-2017 09:20:12 Europe/Berlin] PHP Fatal error:  Call to undefined method caldav_driver::insert_default_calendar() in /var/www/htdocs/plugins/calendar/calendar.php on line 182

And, more or less the short version, from the apache error log:

[Fri Mar 31 09:16:59.888865 2017] [:error] [pid 4478] [client 213.205.198.198:45818] PHP Fatal error:  Call to undefined method caldav_driver::insert_default_calendar() in /var/www/htdocs/plugins/calendar/calendar.php on line 182

Searching through the code base shows that there is no caldav_driver::insert_default_calendar() function indeed.

shpokas commented 7 years ago

No, insert_default_calendar() along with a few other functions are omitted from file calendar/drivers/caldav/caldav_driver.php Why? Keine Ahnung.

andrewhotlab commented 5 years ago

I'm not a developer, but I just managed to make it work again, by comparing the file calendar/drivers/caldav/caldav_driver.php with the one from feature_caldav branch of the Kolab repository.

I made a patch which works for me, but I do not know how to create a pull request, so I attached the file here. I'll be grateful if a developer can check it out and commit it. It will also be a good plus if the result could be published in the Roundcube Plugins web page.

archont00 commented 5 years ago

Nice work. I was able to get https://github.com/texxasrulez/Caldav_Calendar/ working, unfortunately the bug with timezones was a show stopper https://github.com/texxasrulez/Caldav_Calendar/issues/19 I wonder, if "fasterit" caldav code base suffers the same bug or not.

andrewhotlab commented 5 years ago

Sorry, I posted it here, but actually the patch was created for the dotplex/roundcube_calendar fork (in the meanwhile, I managed to create my first pull request). I used that fork because they fixed the issue #15, which was preventing me to have the plugin work.

archont00 commented 5 years ago

I see. And do the timezones work for you?

andrewhotlab commented 5 years ago

Yes, the .ics file I can download from Roundcube contains all timezone details. Actually my Roundcube instance is using Cyrus IMAP's CalDAV module as back end, not Nextcloud's app, but it shouldn't make any difference for the bug you mention in texxasrulez/Caldav_Calendar#19, does it?

archont00 commented 5 years ago

It works even with roundcube 1.4 (elastic - but only with larry or classic themes). I use docker (official) and had to additionally install mcrypt extension which became disabled in php 7.1 (and removed in php 7.2): https://askubuntu.com/questions/1031921/php-mcrypt-package-missing-in-ubuntu-server-18-04-lts

The only trouble is the default time zone - caldav plugin converts the time to UTC timezone and does not save any info about the timezone.

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Roundcube libcalendaring 1.4-git//Sabre//Sabre VObject 2.1.7//EN
CALSCALE:GREGORIAN
BEGIN:VEVENT
UID:DCDF83EFF8FF2891CDA8D4085AFB3AE5-44A014B8E8E6E4A8
DTSTAMP;VALUE=DATE-TIME:20181211T210757Z
CREATED;VALUE=DATE-TIME:20181211T210749Z
LAST-MODIFIED;VALUE=DATE-TIME:20181211T210749Z
DTSTART;VALUE=DATE-TIME:20181212T083000Z
DTEND;VALUE=DATE-TIME:20181212T090000Z
SUMMARY:Test3
SEQUENCE:0
TRANSP:OPAQUE
CLASS:PUBLIC
END:VEVENT
END:VCALENDAR

E.g. new event 09:30-10:30 is shown as such in roundcube/calendar, and also in nextcloud calendar I can see 09:30-10:30 in the calendar view. However, when I try to edit, nexctloud shows UTC timezone and time 08:30-09:00 (Obviously, this is the same time - but very unfriendly to edit time in a different timezone.)

Is there a way how to deal with that? (This might rather be nexctloud calendar app issue, though.)

EDIT: It is a valid behaviour to save DATE-TIME in UTC (which is indicated by "Z"). Clients seem to deal with that differently: