Recent Changes - Search:

Cookbook

PmWiki

pmwiki.org

HandleICal

Summary: Add-on for wikicalendars to export/import events to/from ical-files
Version: 2009-10-04
Prerequisites: PmWiki 2.2 beta
Status: Beta
Last-tested-with: 2.2.5 and PmCalendar
Maintainer:
Categories: Calendar, PIM

Questions answered by this recipe

How can I export events of an specific date from an existing wikicalendar?
How can I export all events of my whole wikicalender?
How can I import ical-files to my wiki?

Description

Import/Export ical-files from/to a wikicalendar.

The script adds two action ("?action=fromics" and "?action=toics") to the wiki, which permit to import events from a given ical-file to a wikicalender or export events from a wikicalendar to a ics-file.

Installation:

This script assumes that you have installed a calendarsolution for PmWiki (like PmCalendar, WikiCalendar or Logbook) using a separate WikiGroup und pagenames like "group/yyyymmdd"

  1. download handleical.phpΔ and copy it to your cookbook folder
  2. include it into your config.php using: "include_once("$FarmD/cookbook/handleical.php");"
  3. set the following parameter before including the Recipe in your config.php:
    1. $ICalCalendarGroup - the name of your wikilog group - default:"Calendar"
    2. $ICalTimeZone - the time zone the events belong to - default:"Europe/Berlin"
    3. $ICalFileName - the name of calendarfile - default:"PmWiki_Cal"

Usage:

The recipe expects each calendar entry to be seperated by a horizontal rule and to use keywords ("Von:", "Bis:", "Wo:", "Beschreibung") for the single parts of the event.

    !!!title of the first event
    Von: hh:mm 
Bis: hh:mm
Wo:
Beschreibung: ---- !!!title of the next event ...

To export events from your calender the scripts adds the action "?action=toics" to your wiki, which will create a file and store it in the Uploaddirectory of the calendargroup.

  • to export the events of the shown page use "?action=toics" without any further parameter
  • to export the events of a specific date use "?action=toics&date=yyyymmdd"
  • to export all events of all pages in your wikicalender use "?action=toics&date=all"

To import events from an ical-file (.ics, RFC2445) use the action "?action=fromics", which will add all events from a previously uploaded file (with the name "events.ics") to your wikicalendar-pages. To import a specific file, use the "?action=fromics&file=filename" (without extension) to get all events from a ical-file named "filename.ics".

Notes

The whole recipe is mainly in German and the keywords are hardcoded at the moment, what will change in a following version.

Release Notes

  • 2008-01-24 initial release
  • 2009-10-03 minimal bug fixes (Von: / Bis: where exchanged)
  • 2009-10-04 minimal bug fixes (limit the listpages()-function to the needed pages for events of the Calendar group only)

See Also

ICalExport

Contributors

Comments

Problem: The Dates and Times for Von: and Bis: where exchanged, so that the start date became the end date and vice versa.

Solution:I changed this in handleical.phpΔ and uploaded it again. The problem is fixed in v2009-10-03

Problem: If you want to export all events from the calendar Group, the script scans the whole wiki by using the function ListPages() without parameters. After exporting, it does not return to the calendar group but to the last page of the last group in the whole wiki.

Solution: I changed the corresponding lines 151 and 152 in handleical.phpΔ to the following code:

  151: # alle Seiten der Kalendergruppe des wikis in ein array schreiben
  152: $pagelist = ListPages("/".$ICalCalendarGroup."/");

In effect, only the pages of the calendar Group are scanned for events. This is necessary, since only these events are exported by the script anyway.

User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.

Edit - History - Print - Recent Changes - Search
Page last modified on September 10, 2011, at 11:42 AM