DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:davcal

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:davcal [2017-02-21 19:06] 80.110.155.152plugin:davcal [2024-02-08 09:03] (current) – [davcal Plugin] LMS23
Line 3: Line 3:
 ---- plugin ---- ---- plugin ----
 description: Add a synchronisable Calendar to DokuWiki description: Add a synchronisable Calendar to DokuWiki
-author     : Andreas Böhler +author     : DokuFreaks (previous: Andreas Böhler) 
-email      : dev@aboehler.at +email      : dev@aboehler.at
 type       : Syntax Plugin type       : Syntax Plugin
-lastupdate : 2017-02-21 +lastupdate : 2022-08-04 
-compatible : Elenor Of Tsort, Detritus, Hrun, Frusterick Manners+compatible : Elenor Of Tsort, Detritus, Hrun, Frusterick Manners, Greebo, Hogfather, Igor, "Jack Jackrum", Kaos
 depends    : sqlite depends    : sqlite
 conflicts  conflicts 
 similar    : calendoku, icalevents, icalendar, google_cal, calendoku similar    : calendoku, icalevents, icalendar, google_cal, calendoku
-tags       : calendar, ical, caldav+tags       : calendar, ical, caldav, !discontinued
  
-downloadurl: http://www.aboehler.at/hg/davcal/archive/tip.tar.gz +downloadurl: https://github.com/dokufreaks/dokuwiki-plugin-davcal/archive/refs/heads/master.zip 
-bugtracker : https://code.rnb-consulting.at/tag/davcal_plugin+bugtracker : https://github.com/dokufreaks/dokuwiki-plugin-davcal/issues 
-sourcerepo : http://www.aboehler.at/hg/davcal/+sourcerepo : https://github.com/dokufreaks/dokuwiki-plugin-davcal
 donationurl:  donationurl: 
  
 screenshot_img :  screenshot_img : 
 ---- ----
 +
 +FIXME **Look for new maintainer - Would be nice if someone could take on this plugin and develop it further! \\ 
 +However, any help with a javascript update is welcome!** FIXME
 +
 +
 +===== New repository =====
 +The original authors repository https://gitlab.aboehler.at/dokuwiki/davcal/ is cloned to 
 +https://github.com/dokufreaks/dokuwiki-plugin-davcal
 +
 +Pull requests are welcome.
  
 ==== DAVCal provides ==== ==== DAVCal provides ====
Line 31: Line 41:
 ===== Requirements ===== ===== Requirements =====
  
-  * You need the sqlite PlugIn+  * You need the [[plugin:sqlite]] PlugIn
   * You need at least PHP 5.4 (required by the underlying DAV library), including the PHP XML module (php-xml((openSUSE users add the packages php5-dom, php5-xmlwriter, php5-xmlreader and php5-mbstring)))   * You need at least PHP 5.4 (required by the underlying DAV library), including the PHP XML module (php-xml((openSUSE users add the packages php5-dom, php5-xmlwriter, php5-xmlreader and php5-mbstring)))
   * CalDAV synchronisation requires   * CalDAV synchronisation requires
Line 41: Line 51:
 Make sure that the sqlite PlugIn is installed. PDO SQLite support is required for the CalDAV server to function properly. Make sure that the sqlite PlugIn is installed. PDO SQLite support is required for the CalDAV server to function properly.
  
-Install the plugin using the [[plugin:plugin|Plugin Manager]] and the download URL above, which points to latest version of the plugin. Refer to [[:Plugins]] on how to install plugins manually.+Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
  
 ===== Examples/Usage ===== ===== Examples/Usage =====
  
-This plugin enables you to embed a Calendar within a WikiPage. The calendar is rendered using fullcalendar.js and makes use of AJAX/jQuery requests. Thus, it is only realiably rendered within your web browser. You can, however, also display a (read-only) table with events in your calendar. This table doesn't need JavaScript.+This plugin enables you to embed a Calendar within a WikiPage. The calendar is rendered using fullcalendar.js and makes use of AJAX/jQuery requests. Thus, it is only reliably rendered within your web browser. You can, however, also display a (read-only) table with events in your calendar. This table doesn't need JavaScript.
  
 To add a simple calendar to a page, use the syntax ''%%{{davcal>}}%%''. To add a simple calendar to a page, use the syntax ''%%{{davcal>}}%%''.
Line 51: Line 61:
 Be aware that only **one** calendar per page is possible. However, you can aggregate multiple calendars into one. Be aware that only **one** calendar per page is possible. However, you can aggregate multiple calendars into one.
  
-{{https://www.rnb-consulting.at/doku/lib/exe/fetch.php/dokuwiki/screenshot136.png?200}} +{{https://www.rnb-consulting.at/doku/lib/exe/fetch.php/dokuwiki/screenshot136.png?200&recache}}  {{https://www.rnb-consulting.at/doku/lib/exe/fetch.php/dokuwiki/screenshot137.png?200&recache}}
-{{https://www.rnb-consulting.at/doku/lib/exe/fetch.php/dokuwiki/screenshot137.png?200}}+
  
 ===== Syntax ===== ===== Syntax =====
Line 74: Line 83:
 In order to display a table with events, the syntax is slightly different: In order to display a table with events, the syntax is slightly different:
  
-<code>{{davcaltable>id=calendars:mycalendar:start,id=calendars:othercalendar,startdate=2015-10-20,numdays=30,dateformat=Y-m-d,onlystart=true,sort=asc,timezone=Europe/Vienna}}</code>+<code>{{davcaltable>id=calendars:mycalendar:start,id=calendars:othercalendar,startdate=2015-10-20,numdays=30,dateformat=Y-m-d,calname=true,onlystart=true,sort=asc,timezone=Europe/Vienna,nolocation}} 
 +</code>
  
-This creates tabular output and starts from 2015/10/20 (''%%startdate=2015-10-20%%'', this date format is required!), displays up to 30 days (''%%numdays=30%%''), formats the events as Y-m-d (''%%dateformat=Y-m-d%%'') and displays only the column 'At' instead of 'From' and 'To' (''%%onlystart=true%%''). Events are sorted in ascending order (''%%sort=asc%%'') and their time is converted to the timezone 'Europe/Vienna' (''%%timezone=Europe/Vienna%%''). It is also possible to define the date relative to the current date: ''%%startdate=today-30%%'' means 30 days ago, ''%%startdate=today+1%%'' means tomorrow. If you omit the timezone, 'UTC' is assumed.+This creates tabular output and starts from 2015/10/20 (''%%startdate=2015-10-20%%'', this date format is required!), displays up to 30 days (''%%numdays=30%%''), formats the events as Y-m-d (''%%dateformat=Y-m-d%%'') and displays only the column 'At' instead of 'From' and 'To' (''%%onlystart=true%%''). Events are sorted in ascending order (''%%sort=asc%%'') and their time is converted to the timezone 'Europe/Vienna' (''%%timezone=Europe/Vienna%%''). It is also possible to define the date relative to the current date: ''%%startdate=today-30%%'' means 30 days ago, ''%%startdate=today+1%%'' means tomorrow. If you omit the timezone, 'UTC' is assumed. The field 'Location' is hidden (''%% nolocation%%''), but the calendar name is displayed (''%%calname=true%%'').
  
 If you want to get all events up to and including today, you can do the following:  If you want to get all events up to and including today, you can do the following: 
 <code> <code>
-{{davcaltable>id=calendars:mycalendar:start,startdate=today+1,numdays=0,startisend=true}}</code>+{{davcaltable>id=calendars:mycalendar:start,startdate=today+1,numdays=0,startisend=true}} 
 +</code>
  
 The following table lists all options for ''%%davcal>%%'': The following table lists all options for ''%%davcal>%%'':
Line 107: Line 118:
 | sort | ''%%asc%%'' or ''%%desc%%'' | Sort the events in ascending or descending order (by start date). Defaults to ''desc'' | | sort | ''%%asc%%'' or ''%%desc%%'' | Sort the events in ascending or descending order (by start date). Defaults to ''desc'' |
 | timezone | Any timezone supported by PHP | Specify the timezone the events should be displayed in. Defaults probably to UTC, depending on your server configuration. | | timezone | Any timezone supported by PHP | Specify the timezone the events should be displayed in. Defaults probably to UTC, depending on your server configuration. |
 +| nolocation | not specified | If specified, the field 'Location' is hidden. |
 +| calname | ''true'', ''on'' | Set this to ''true'' or ''on'' to add a column with the calendar name the event is saved in. The default is ''false''. |
  
 ===== Settings ===== ===== Settings =====
Line 112: Line 125:
 The admin can specify default settings for all calendars (timezone, week numbers, ...) in the settings panel. Users can override the settings on a per-user basis by clicking on the link 'Settings/Sync'. The admin can also disable this button in the admin settings. The admin can specify default settings for all calendars (timezone, week numbers, ...) in the settings panel. Users can override the settings on a per-user basis by clicking on the link 'Settings/Sync'. The admin can also disable this button in the admin settings.
  
-===== Synchronisation (Client Mode) =====+==== Nginx usage ==== 
 + 
 +Since //.ics// url are a bit weird, the following hack is required to make them work: 
 + 
 +<code> 
 +location ~ ^/lib/plugins/davcal/ics.php/(.*)$ { 
 +    include fastcgi_params; 
 +    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
 +    fastcgi_param REDIRECT_STATUS 200; 
 +    fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; 
 + 
 +    fastcgi_split_path_info ^(.+\.php)(.*)$; 
 +    fastcgi_param PATH_INFO $fastcgi_path_info; 
 +    fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; 
 +
 +</code> 
 + 
 +Also, CalDAV requires a similar code block for nginx. 
 +<code> 
 +location ~ ^/lib/plugins/davcal/calenderserver.php/(.*)$ { 
 +    include fastcgi_params; 
 +    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
 +    fastcgi_param REDIRECT_STATUS 200; 
 +    fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; 
 + 
 +    fastcgi_split_path_info ^(.+\.php)(.*)$; 
 +    fastcgi_param PATH_INFO $fastcgi_path_info; 
 +    fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; 
 +
 +</code> 
 + 
 +Also, the caret (^) might need to be removed from the location line to get either block to work in some nginx configurations.  Also, the path to the PHP FPM sock might need adjusted. 
 + 
 +===== Synchronization (Client Mode) =====
  
 The plugin [[plugin:webdavclient|webdavclient]] provides the client synchronisation component for davcal. Add webdavclient to your installation and configure a new connection in the Admin setup. Note the ID of the newly configured connection. The plugin [[plugin:webdavclient|webdavclient]] provides the client synchronisation component for davcal. Add webdavclient to your installation and configure a new connection in the Admin setup. Note the ID of the newly configured connection.
Line 122: Line 168:
 This also works with ''%%davcaltable%%'', the full davcal option set is supported. If the calendar is set read/write in the WebDAV connection setup, you can even modify and delete events. This also works with ''%%davcaltable%%'', the full davcal option set is supported. If the calendar is set read/write in the WebDAV connection setup, you can even modify and delete events.
  
-===== Synchronisation (Server Mode) =====+===== Synchronization (Server Mode) =====
  
-The synchronisation backend is provided by SabreDAV. If you click on Settings/Sync below a calendar, a CalDAV URL as well as a Private URL is displayed. Synchronisation can be disabled in the admin settings.+The synchronization backend is provided by SabreDAV. If you click on Settings/Sync below a calendar, a CalDAV URL as well as a Private URL is displayed. Synchronization can be disabled in the admin settings.
  
 ==== CalDAV ==== ==== CalDAV ====
  
-The CalDAV URL allows you to synchronise your calendar via CalDAV, but requires authentication. Use your DokuWiki login credentials. This only works on password-based authentication backends (obviously), but provides a convenient two-way sync. The URL is only displayed for logged-in users.+The CalDAV URL allows you to synchronize your calendar via CalDAV, but requires authentication. Use your DokuWiki login credentials. This only works on password-based authentication backends (obviously), but provides a convenient two-way sync. The URL is only displayed for logged-in users.
  
 For MacOS/iOS, use the iOS sync URL provided. For MacOS/iOS, use the iOS sync URL provided.
Line 142: Line 188:
 If you have access to the configuration of your webserver, you can use the auto-discovery feature. In this case, you need to redirect the file .well-known/caldav to your DAVCal installation. If you have access to the configuration of your webserver, you can use the auto-discovery feature. In this case, you need to redirect the file .well-known/caldav to your DAVCal installation.
  
-For the following example, let's assume you have Dokuwiki installed at http://www.example.com/dokuwiki. Thus, your CalDAV server is at http://www.example.com/dokuwiki/lib/plugins/davcal/calendarserver.php. For autodiscovery to work, you need to omit the remaining parts of the Sync URL, only the path to calendarserver.php is required. +For the following example, let's assume you have DokuWiki installed at %%http://www.example.com/dokuwiki%%. Thus, your CalDAV server is at %%http://www.example.com/dokuwiki/lib/plugins/davcal/calendarserver.php%%. For autodiscovery to work, you need to omit the remaining parts of the Sync URL, only the path to calendarserver.php is required. 
  
 If you have Apache, create the file /.htaccess in the root directory of the web server and add the following line: If you have Apache, create the file /.htaccess in the root directory of the web server and add the following line:
  
-<code>Redirect 301 /.well-known/caldav /dokuwiki/lib/plugins/davcal/calendarserver.php</code>+<code> 
 +Redirect 301 /.well-known/caldav /dokuwiki/lib/plugins/davcal/calendarserver.php 
 +</code>
  
-Then you can point your CalDAV sync client to http://www.example.com, provide login credentials and all your accessible calendars should be available.+Then you can point your CalDAV sync client to %%http://www.example.com%%, provide login credentials and all your accessible calendars should be available.
  
 === Auto Discovery (MacOS) === === Auto Discovery (MacOS) ===
Line 158: Line 206:
 ==== Sharing ==== ==== Sharing ====
  
-By default, the calendar is accessible for synchronisation to all users who have at least read rights on the page it is attached to. If the user has only read rights, the calendar is read-only, if the user has more powerful rights, the calendar is also accessible for writing.+By default, the calendar is accessible for synchronization to all users who have at least read rights on the page it is attached to. If the user has only read rights, the calendar is read-only, if the user has more powerful rights, the calendar is also accessible for writing.
  
 ==== Clients ==== ==== Clients ====
Line 171: Line 219:
 ===== Deleting/Moving of Calendar ===== ===== Deleting/Moving of Calendar =====
  
-It is currently not possible to entirely delete or move a calendar. However, when the reference to a calendar is deleted via the Syntax option, the calendar is disabled. Synchronisation is disabled for this calendar, but the calendar objects are retained. As soon as you restore an old version of the page, the calendar is enabled again and the objects are back.+It is currently not possible to entirely delete or move a calendar. However, when the reference to a calendar is deleted via the Syntax option, the calendar is disabled. Synchronization is disabled for this calendar, but the calendar objects are retained. As soon as you restore an old version of the page, the calendar is enabled again and the objects are back.
  
 An admin component for completely deleting calendars is currently WiP. An admin component for completely deleting calendars is currently WiP.
Line 179: Line 227:
 DavCAL currently supports the languages DavCAL currently supports the languages
  
-  * English +  * Dutch (nl) 
-  * German +  * English (en) 
-  * Dutch +  * French (fr) 
-  * French+  * German (de and de-informal) 
 +  * Russian (ru)
  
-If you would like to provide translations, don't hesitate to contact me or open a task at [[https://code.rnb-consulting.at/tag/davcal_plugin/|code.rnb-consulting.at/tag/davcal_plugin]].+If you would like to provide translations, don't hesitate to contact me or open a task at [[https://github.com/dokufreaks/dokuwiki-plugin-davcal]].
  
 ===== Limitations ===== ===== Limitations =====
Line 191: Line 240:
   * You cannot edit recurring events   * You cannot edit recurring events
   * You cannot move an event from one calendar to another if you display multiple calendars   * You cannot move an event from one calendar to another if you display multiple calendars
 +
 +===== Tips & Tricks =====
 +
 +DAVCal stores all its data in a SQLite database managed by the SQLite plugin. However, sometimes it is handy to understand the database format and to perform operations on the database.
 +
 +The raw database file can be found in the DokuWiki-folder at ''%%data/meta/davcal.sqlite3%%''. It can be edited using a command line tool or the SQLite interface in the DokuWiki admin area.
 +
 +==== Listing/deleting calendar objects older than... ====
 +
 +It is possible to get a list of all calendar entries older than, in this example 20th September, 2017 at 10AM, using the query: ''%%SELECT calendardata FROM calendarobjects WHERE datetime(lastoccurence, 'unixepoch') < '2017-09-20 10:00:00';%%''.
 +
 +In order to delete the entries, replace the query by ''%%DELETE FROM calendarobjects WHERE datetime(lastoccurence, 'unixepoch') < '2017-09-20 10:00:00';%%''. You could even automate this task by creating a cron job.
  
 ===== Development ===== ===== Development =====
Line 196: Line 257:
 === Change Log === === Change Log ===
  
-{{rss>http://feeds.feedburner.com/dokuwiki-plugin-davcal date}}+{{rss>https://github.com/dokufreaks/dokuwiki-plugin-davcal/commits/master.atom date}}
  
 === Known Bugs and Issues === === Known Bugs and Issues ===
  
-Please use the bug tracker ("Create Task...", click on the drop-down icon of the backlog) at [[https://code.rnb-consulting.at/tag/davcal_plugin/|code.rnb-consulting.at/tag/davcal_plugin]]. This page is unmonitored. +[[https://github.com/dokufreaks/dokuwiki-plugin-davcal/issues|Use GitHub]]
- +
-  * Timezone support is not fully tested +
-  * Recurring events should be displayed correctly, but there is no user-interface to add/edit them +
-  * Due to the underlying DAV library, you need at least PHP 5.4. Otherwise, you'll get PHP parse errors.+
  
 === ToDo/Wish List === === ToDo/Wish List ===
  
-Please use the bug tracker ("Create Task...", click on the drop-down icon of the backlog) at [[https://code.rnb-consulting.at/tag/davcal_plugin/|code.rnb-consulting.at/tag/davcal_plugin]]. This page is unmonitored. +[[https://github.com/dokufreaks/dokuwiki-plugin-davcal/issues|Use GitHub]]
- +
-  * Add editor support for recurring events. Please! nth.DayPerMonth, EveryNDaysByStart, nth.DatePerMonth (+3): https://code.rnb-consulting.at/T19 +
-  * Translations (please contact me via E-Mail if you would like to contribute translations)+
  
  
plugin/davcal.1487700364.txt.gz · Last modified: 2017-02-21 19:06 by 80.110.155.152

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki