Moodle
  1. Moodle
  2. MDL-1304

Add bulk import/export of events capability to calendar

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6
    • Fix Version/s: 1.8
    • Component/s: Calendar
    • Labels:
      None
    • Environment:
      All
    • Rank:
      34274

      Description

      It would definitely be nice if you could massively set events for the calendar. Eloy has provided some very nice links we should check out before doing any work on this.

      1. icalendar_export_2.patch
        14 kB
        Andrew Walbran
      2. icalendar_export.patch
        14 kB
        Andrew Walbran

        Issue Links

          Activity

          Hide
          Martin Dougiamas added a comment -

          From Andreas Calvo (andreas.calvo01 at campus.upf.es) Wednesday, 29 June 2005, 02:11 AM:

          Currently working on a simple export to iCalendar protocol, we expect to have a beta version later today.

          From Dan Stowell (d.stowell at ucl.ac.uk) Thursday, 12 January 2006, 04:17 PM:

          I've published a test version of export-to-iCalendar here: http://moodle.org/mod/forum/discuss.php?d=37393

          It produces data files which can load into some software (iCal, phpicalendar) but not into others (Outlook, Oracle Calendar). I'd be grateful if other developers could try and help with this.

          Show
          Martin Dougiamas added a comment - From Andreas Calvo (andreas.calvo01 at campus.upf.es) Wednesday, 29 June 2005, 02:11 AM: Currently working on a simple export to iCalendar protocol, we expect to have a beta version later today. From Dan Stowell (d.stowell at ucl.ac.uk) Thursday, 12 January 2006, 04:17 PM: I've published a test version of export-to-iCalendar here: http://moodle.org/mod/forum/discuss.php?d=37393 It produces data files which can load into some software (iCal, phpicalendar) but not into others (Outlook, Oracle Calendar). I'd be grateful if other developers could try and help with this.
          Hide
          Andrew Walbran added a comment -

          I've fixed bugs, finished missing parts, added more features, cleaned up
          parts of the code, improved compatibility with different calendar software,
          etc. in Jon Papaioannou's code for iCalendar export.

          I have tested this in Korganiser/Kontact, Evolution, Outlook, Google Calendar
          and Mozilla Calendar and it seems to work in all 5, though Mozilla Calendar
          doesn't handle the timezone quite right (it doesn't seem to account for daylight saving time).

          The attached patch is against cvshead, though I suspect it will also apply against 1.7 without too much work.

          If someone could commit this to CVS, that would be great.

          If you want to see the full log of changes, look at our gitweb: http://git.catalyst.net.nz/gitweb?p=moodle-r2.git;a=shortlog;h=mdl-icalendar

          Show
          Andrew Walbran added a comment - I've fixed bugs, finished missing parts, added more features, cleaned up parts of the code, improved compatibility with different calendar software, etc. in Jon Papaioannou's code for iCalendar export. I have tested this in Korganiser/Kontact, Evolution, Outlook, Google Calendar and Mozilla Calendar and it seems to work in all 5, though Mozilla Calendar doesn't handle the timezone quite right (it doesn't seem to account for daylight saving time). The attached patch is against cvshead, though I suspect it will also apply against 1.7 without too much work. If someone could commit this to CVS, that would be great. If you want to see the full log of changes, look at our gitweb: http://git.catalyst.net.nz/gitweb?p=moodle-r2.git;a=shortlog;h=mdl-icalendar
          Hide
          Martín Langhoff added a comment -

          Hi MartinD - Andrew is working with us at Catalyst - he has posted the "icalendar_export.patch" patch which I will be reviewing soon looking into merging it into HEAD. From a functionality/architecture point of view, is there anything in particular that you'd like to see in the iCal support?

          Show
          Martín Langhoff added a comment - Hi MartinD - Andrew is working with us at Catalyst - he has posted the "icalendar_export.patch" patch which I will be reviewing soon looking into merging it into HEAD. From a functionality/architecture point of view, is there anything in particular that you'd like to see in the iCal support?
          Hide
          Andrew Walbran added a comment -

          Here is an updated version on my patch, which fixes a few bugs. Everything is still available from git.

          Show
          Andrew Walbran added a comment - Here is an updated version on my patch, which fixes a few bugs. Everything is still available from git.
          Hide
          Andrew Walbran added a comment -

          Here's a summary I wrote:

          Moodle iCalendar export summary

          There are many cases where it would be useful for a user to be able to export events from their calendar in Moodle into a separate calendar program such as Evolution or Kontact. Many such programs also support subscribing to a remote calendar feed, in which case the program automatically downloads the latest version of the calendar at regular intervals.

          The standard format for calender information is iCalendar, as defined by RFC 2445 (http://www.faqs.org/rfcs/rfc2445.html). This format is supported in varying degrees by Korganiser/Kontact, Evolution, Mozilla Calendar, Apple iCal, Google Calendar and Microsoft Outlook.

          I have implemented support for Moodle to export calendars to iCalendar format, in such a way that subscription is possible as well as download. This support is based on a partial implementation by Jon Papaioannou, using his Bennu (http://bennu.sourceforge.net/) library.

          This can be accessed by two links at the bottom of the calendar page (calendar/view.php). 'Quick download / subscribe to calendar' links straight to download all events (global events, user events for the logged-in user and course events for relevant courses) from the last 5 or next 60 days. The URL includes the username and does not require logging in in the usual manner, so that it can be subscribed to with calendar applications, which are of course unable to handle the usual login process. Instead, a reasonable measure of security is provided by the 'authtoken' parameter in the URL, which is a SHA-1 hash of the username concatenated with the password hash. The use of a hash means that should someone else get hold of the URL they cannot discover the user's password. The use of both username and password in generating the hash avoids the problem of discovering users with the same password. This basic approach was suggested by Martin Dougiamas in the forum thread at http://moodle.org/mod/forum/discuss.php?d=37393.

          The 'Export calendar' link on the calendar page leads to a page where more options can be configured. The user can then either click 'Export' to download the calendar, or 'Get calendar URL' to be given the appropriate URL (generated by JavaScript) to copy to their calendar program to subscribe.

          This form is handled by calendar/export.php and calendar/export_basic.php. The actual export process is handled by calendar/export_execute.php, with the help of Bennu.

          I have tested the exported file in Korganiser/Kontact, Evolution, Outlook, Google Calendar and Mozilla Calendar and it seems to work in all 5, though Mozilla Calendar doesn't handle the timezone quite right.

          Show
          Andrew Walbran added a comment - Here's a summary I wrote: Moodle iCalendar export summary There are many cases where it would be useful for a user to be able to export events from their calendar in Moodle into a separate calendar program such as Evolution or Kontact. Many such programs also support subscribing to a remote calendar feed, in which case the program automatically downloads the latest version of the calendar at regular intervals. The standard format for calender information is iCalendar, as defined by RFC 2445 ( http://www.faqs.org/rfcs/rfc2445.html ). This format is supported in varying degrees by Korganiser/Kontact, Evolution, Mozilla Calendar, Apple iCal, Google Calendar and Microsoft Outlook. I have implemented support for Moodle to export calendars to iCalendar format, in such a way that subscription is possible as well as download. This support is based on a partial implementation by Jon Papaioannou, using his Bennu ( http://bennu.sourceforge.net/ ) library. This can be accessed by two links at the bottom of the calendar page (calendar/view.php). 'Quick download / subscribe to calendar' links straight to download all events (global events, user events for the logged-in user and course events for relevant courses) from the last 5 or next 60 days. The URL includes the username and does not require logging in in the usual manner, so that it can be subscribed to with calendar applications, which are of course unable to handle the usual login process. Instead, a reasonable measure of security is provided by the 'authtoken' parameter in the URL, which is a SHA-1 hash of the username concatenated with the password hash. The use of a hash means that should someone else get hold of the URL they cannot discover the user's password. The use of both username and password in generating the hash avoids the problem of discovering users with the same password. This basic approach was suggested by Martin Dougiamas in the forum thread at http://moodle.org/mod/forum/discuss.php?d=37393 . The 'Export calendar' link on the calendar page leads to a page where more options can be configured. The user can then either click 'Export' to download the calendar, or 'Get calendar URL' to be given the appropriate URL (generated by JavaScript) to copy to their calendar program to subscribe. This form is handled by calendar/export.php and calendar/export_basic.php. The actual export process is handled by calendar/export_execute.php, with the help of Bennu. I have tested the exported file in Korganiser/Kontact, Evolution, Outlook, Google Calendar and Mozilla Calendar and it seems to work in all 5, though Mozilla Calendar doesn't handle the timezone quite right.
          Hide
          Martín Langhoff added a comment -

          Merged Andrew's patch. Ready QA

          Show
          Martín Langhoff added a comment - Merged Andrew's patch. Ready QA

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: