Moodle
  1. Moodle
  2. MDL-16660

Calendar: IMPORT or Subscribe to iCal feed into Moodle calendar

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.9.2, 2.1.8, 2.2, 2.2.5, 2.3.2
    • Fix Version/s: 2.4
    • Component/s: Calendar
    • Environment:
      Moodle 1.9.2
    • Testing Instructions:
      Hide

      NOTE TO TESTER: This feature really needs full QA testing, in the absence of detailed QA tests, please do exploitory testing on this feature. Particularly paying attention to editing, updating, deleting. Invalid files etc.

      Import form in calendar view

      The import subscription form should only appear for those users who already have the capability to add calendar events to that course calendar.

      Subscriptions list

      The import calendar form should show you a list of existing subscriptions, if any. This list allows you to

      • Update the poll interval. This can be never, hourly, daily, weekly, monthly, or annually. Choose one from the list and click the Update button for that subscription.
      • Remove the subscription. This will also remove any events added by the subscription from the calendar. Click the Remove button.

      Import Calendar form

      This form will let you add a subscription from a calendar URL, or import events from an uploaded calendar file.

      • Calendar name: this should be mandatory and should not accept blank values.
      • Import from: choose either a URL or a file
      • Calendar URL: a URL to an external ics calendar file
        • this field should be disabled if Import from is set to import from a file
      • Calendar file: lets you choose or upload a calendar file using the standard Moodle file browser
        • this field should be disabled if Import from is set to import from a URL
      • Poll interval. This can be never, hourly, daily, weekly, monthly, or annually.
        • this field has no effect when adding events from a calendar file.
      • Type of event. This allows you to select which calendar the events should be added to - the same as when adding a single event normally.
        • The list should display only those calendars you have permission to add events to - at either a user, group, course or site level.
      • Group: this lets you select which group to add events to.
        • this field should only be visible if you can add events to one or more groups.
        • this field should only show groups that you have permission to add events to.
      • Click Add to import the events from the calendar file, or add the calendar subscription.

      Poll interval

      The cron task should update calendar subscriptions as recorded in the mdl_event_subscriptions table, and as controlled by the poll interval. In the database, pollinterval is stored as a number of seconds, and calculated in cron using the current timestamp and the lastupdated field. In this way, monthly is actually anually divided by 12, rather than a strict calendar month.

      Show
      NOTE TO TESTER: This feature really needs full QA testing, in the absence of detailed QA tests, please do exploitory testing on this feature. Particularly paying attention to editing, updating, deleting. Invalid files etc. Import form in calendar view The import subscription form should only appear for those users who already have the capability to add calendar events to that course calendar. Subscriptions list The import calendar form should show you a list of existing subscriptions, if any. This list allows you to Update the poll interval. This can be never, hourly, daily, weekly, monthly, or annually. Choose one from the list and click the Update button for that subscription. Remove the subscription. This will also remove any events added by the subscription from the calendar. Click the Remove button. Import Calendar form This form will let you add a subscription from a calendar URL, or import events from an uploaded calendar file. Calendar name: this should be mandatory and should not accept blank values. Import from: choose either a URL or a file Calendar URL: a URL to an external ics calendar file this field should be disabled if Import from is set to import from a file Calendar file: lets you choose or upload a calendar file using the standard Moodle file browser this field should be disabled if Import from is set to import from a URL Poll interval. This can be never, hourly, daily, weekly, monthly, or annually. this field has no effect when adding events from a calendar file. Type of event. This allows you to select which calendar the events should be added to - the same as when adding a single event normally. The list should display only those calendars you have permission to add events to - at either a user, group, course or site level. Group: this lets you select which group to add events to. this field should only be visible if you can add events to one or more groups. this field should only show groups that you have permission to add events to. Click Add to import the events from the calendar file, or add the calendar subscription. Poll interval The cron task should update calendar subscriptions as recorded in the mdl_event_subscriptions table, and as controlled by the poll interval. In the database, pollinterval is stored as a number of seconds, and calculated in cron using the current timestamp and the lastupdated field. In this way, monthly is actually anually divided by 12, rather than a strict calendar month.
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      wip-MDL-16660-m24
    • Rank:
      1254

      Description

      Would be great if one could, either at the site, course or user level in the Moodle calendar:

      1) SUBSCRIBE to an external iCal calendar feed (such as to a Google Calendar ical feed) to auto-update the site events INTO MOODLE (not export out of Moodle, which already exists.) This way, if a school has a calendar already published with an ical feed (such as a Google calendar), an admin in Moodle could subscribe to that external ical feed and have all the school's events posted automatically in the Moodle calendar. By the same token, perhaps an instructor could subscribe to an ical feed for his or her course to feed in course level entries, or an individual with ical feeds could subscribe to them to sync them into their Moodle calendar.

      2) IMPORT an iCal calendar flatfile into Moodle's calendar

      1. bennu.tar.gz
        31 kB
        Mark Johnson
      2. calendar_test.patch
        62 kB
        Mark Johnson
      3. calendar_test2.patch
        8 kB
        Mark Johnson
      4. calendar_test3_fixed.patch
        23 kB
        Barry Oosthuizen
      5. calendar_test3.patch
        23 kB
        Mark Johnson
      6. calendar_test3.patch
        23 kB
        Mark Johnson
      7. ical2moodle.bmml
        5 kB
        Kirill Gordeenko
      8. ical2moodle.bmml
        5 kB
        Kirill Gordeenko
      9. ical2moodle.bmml
        5 kB
        Kirill Gordeenko
      10. ical2moodle.bmml
        5 kB
        Kirill Gordeenko
      11. ical2moodle.bmml
        5 kB
        Kirill Gordeenko
      12. ical2moodle.bmml
        5 kB
        Kirill Gordeenko
      13. ical2moodle.bmml
        5 kB
        Kirill Gordeenko
      14. ical2moodle.bmml
        5 kB
        Kirill Gordeenko
      15. ical2moodle.bmml
        5 kB
        Kirill Gordeenko
      16. ical2moodle.bmml
        5 kB
        Kirill Gordeenko
      17. ical2moodle.bmml
        5 kB
        Kirill Gordeenko
      18. ical2moodle.bmml
        5 kB
        Kirill Gordeenko
      19. ical2moodle.bmml
        5 kB
        Kirill Gordeenko
      20. ical2moodle.bmml
        4 kB
        Kirill Gordeenko
      21. ical2moodle.bmml
        4 kB
        Kirill Gordeenko
      22. ical2moodle.bmml
        4 kB
        Kirill Gordeenko
      23. ical2moodle.bmml
        4 kB
        Kirill Gordeenko
      24. ical2moodle.bmml
        4 kB
        Kirill Gordeenko
      25. MDL-16660_proof_of_concept.patch
        7 kB
        Mark Johnson
      26. Ringmer_Community_College_Term_Dates_2010-2011_Calendar.ics
        33 kB
        Frosty
      27. t.ics
        0.6 kB
        Jim Crumley
      1. ical2moodle.png
        68 kB
      2. Missing Repeat Events.jpg
        361 kB
      3. screenshot-1.jpg
        186 kB

        Issue Links

          Activity

          Hide
          Tim Hunt added a comment -

          This is already implemented! See, for example, the ical button at the bottom of http://moodle.org/calendar/view.php?view=upcoming&course=1. Documentation at http://docs.moodle.org/en/Calendar_export.

          Show
          Tim Hunt added a comment - This is already implemented! See, for example, the ical button at the bottom of http://moodle.org/calendar/view.php?view=upcoming&course=1 . Documentation at http://docs.moodle.org/en/Calendar_export .
          Hide
          Clark Shah-Nelson added a comment -

          Please reopen this case - the ability to IMPORT ical does not exist in Moodle, only the ability to EXPORT ical.

          Show
          Clark Shah-Nelson added a comment - Please reopen this case - the ability to IMPORT ical does not exist in Moodle, only the ability to EXPORT ical.
          Hide
          Tim Hunt added a comment -

          Doh! sorry. I can't read. Reopening.

          Show
          Tim Hunt added a comment - Doh! sorry. I can't read. Reopening.
          Hide
          Tim Hunt added a comment -

          and MDL-1304 is not a duplicate. Despite what it's summary says, that issue only led to export being implemented, not import.

          Show
          Tim Hunt added a comment - and MDL-1304 is not a duplicate. Despite what it's summary says, that issue only led to export being implemented, not import.
          Hide
          Bill Pickett added a comment -

          This is a very critical component for our school, exactly as it is decribed. We have been wanted this ability for a couple of years. We would like to sync/import the "site" calendar with our all school calendar, the division calendars (Primary (prek-1), Lower (2-5), Middle (6-8) and Upper (9-12) with the division courses, and allow the students to set up individual icals syncs for the sports they are participating in. I can see why many other schools would not want this.

          Show
          Bill Pickett added a comment - This is a very critical component for our school, exactly as it is decribed. We have been wanted this ability for a couple of years. We would like to sync/import the "site" calendar with our all school calendar, the division calendars (Primary (prek-1), Lower (2-5), Middle (6-8) and Upper (9-12) with the division courses, and allow the students to set up individual icals syncs for the sports they are participating in. I can see why many other schools would not want this.
          Hide
          Martin Dougiamas added a comment -

          A brief thought as I pass through ... we'll need to add a "source" calendar field to the events table (and an events_sources table describing the feeds), so that we can safely delete everything associated with the external calendar before/during every update from the iCal feed (to make sure we don't have events in Moodle that were deleted on the external calendar.

          Show
          Martin Dougiamas added a comment - A brief thought as I pass through ... we'll need to add a "source" calendar field to the events table (and an events_sources table describing the feeds), so that we can safely delete everything associated with the external calendar before/during every update from the iCal feed (to make sure we don't have events in Moodle that were deleted on the external calendar.
          Hide
          Edward Beckmann added a comment -

          I use an open source utility called gcaldaemon for syncing - I'm not a programmer, but its principles / code may help with this one? http://gcaldaemon.sourceforge.net/
          Ed

          Show
          Edward Beckmann added a comment - I use an open source utility called gcaldaemon for syncing - I'm not a programmer, but its principles / code may help with this one? http://gcaldaemon.sourceforge.net/ Ed
          Hide
          Lisa Sieverts added a comment -

          We desperately need this, too. We use webmail/kronolith to manage our school calendar, so need to be able to SUBSCRIBE to multiple kronolith calendars in Moodle.

          Show
          Lisa Sieverts added a comment - We desperately need this, too. We use webmail/kronolith to manage our school calendar, so need to be able to SUBSCRIBE to multiple kronolith calendars in Moodle.
          Hide
          Pascal Raven added a comment -

          As we are implementing Zimbra Email Collaboration Suite, we would also appreciate the ability to sync our Moodle calendar from a calendar in Zimbra. Zimbra uses ical as well and has the ability to share/sync information. This would significantly reduce work loads on our secretaries plus improve the overall usefulness of Moodle as there are many other uses we can think of such as what Bill Pickett talked about. Thanks for the opportunity to share our thoughts...

          Show
          Pascal Raven added a comment - As we are implementing Zimbra Email Collaboration Suite, we would also appreciate the ability to sync our Moodle calendar from a calendar in Zimbra. Zimbra uses ical as well and has the ability to share/sync information. This would significantly reduce work loads on our secretaries plus improve the overall usefulness of Moodle as there are many other uses we can think of such as what Bill Pickett talked about. Thanks for the opportunity to share our thoughts...
          Hide
          Kenneth Newquist added a comment -

          +1 for the ability to subscribe to an external calendar. We're also using Zimbra (as well as other external calendars) and this would be a great boon to Moodle on our campus.

          Show
          Kenneth Newquist added a comment - +1 for the ability to subscribe to an external calendar. We're also using Zimbra (as well as other external calendars) and this would be a great boon to Moodle on our campus.
          Hide
          Jon Witts added a comment -

          We are more interested in being able to IMPORT an ical file into the Moodle calendar than to sync it. We have our school calendar in webcalendar at the moment and would like to move it into the Moodle site calendar.

          Show
          Jon Witts added a comment - We are more interested in being able to IMPORT an ical file into the Moodle calendar than to sync it. We have our school calendar in webcalendar at the moment and would like to move it into the Moodle site calendar.
          Hide
          Crafton Williams added a comment -

          This would be great to have on a course-level in addition to sitewide.

          Show
          Crafton Williams added a comment - This would be great to have on a course-level in addition to sitewide.
          Hide
          Kathreja Mills added a comment -

          This is something that my organization (JSEA) would need. We would save so much staff time being able to just import our staff calendar rather then updating multiple calendars.

          Show
          Kathreja Mills added a comment - This is something that my organization (JSEA) would need. We would save so much staff time being able to just import our staff calendar rather then updating multiple calendars.
          Hide
          Eugene Istomin added a comment -

          Ability to sync with others calendar sources will be real progress to Moodle-on-desktop.

          Many peoples have troubles in creation study calendars directly in Moodle. Universities have a problem with calendar modification difficulties.
          Sync is the best way.

          Have you any ideas/code examples for sync? I can help you with implementing icalsync and testing.

          Show
          Eugene Istomin added a comment - Ability to sync with others calendar sources will be real progress to Moodle-on-desktop. Many peoples have troubles in creation study calendars directly in Moodle. Universities have a problem with calendar modification difficulties. Sync is the best way. Have you any ideas/code examples for sync? I can help you with implementing icalsync and testing.
          Hide
          John Cork added a comment -

          Our school has just adopted moodle and this is the first thing that I needed to do. It would save a tremendous amount of effort if there was some way to IMPORT calendars into moodle even if it was just copying from one course to another.

          Show
          John Cork added a comment - Our school has just adopted moodle and this is the first thing that I needed to do. It would save a tremendous amount of effort if there was some way to IMPORT calendars into moodle even if it was just copying from one course to another.
          Hide
          Mário Gonçalves added a comment -

          The lack of this feature is basicallly the only reason why our group still needs a website, really.

          We use Google Calendars integrated with out website to alert current and potential students of upcoming courses.

          With it implemented, we'd be able to have Moodle as both our courses' internal workplace and external showcase. Not to mention sync'ing would save a lot of time from all our staff.

          Show
          Mário Gonçalves added a comment - The lack of this feature is basicallly the only reason why our group still needs a website, really. We use Google Calendars integrated with out website to alert current and potential students of upcoming courses. With it implemented, we'd be able to have Moodle as both our courses' internal workplace and external showcase. Not to mention sync'ing would save a lot of time from all our staff.
          Hide
          Boyd Duffee added a comment -

          Sync is what most people really want, whether they know it or not. They want a calendar to keep up-to-date with an external source, possibly with multiple calendars like Thunderbird.

          You might check out the SyncML extension code that Jörg Lehrke has written against eGroupware. His homepage is http://k.noc.de/ The code implements SyncML 1.2 and is written in php. The patch may be better to use because it highlights the changes needed to add syncml to the larger project. I haven't looked at the code, but I have used the patch.

          My users are starting to ask for this functionality which I haven't seen elsewhere. I hope this feature sees some progress.

          Show
          Boyd Duffee added a comment - Sync is what most people really want, whether they know it or not. They want a calendar to keep up-to-date with an external source, possibly with multiple calendars like Thunderbird. You might check out the SyncML extension code that Jörg Lehrke has written against eGroupware. His homepage is http://k.noc.de/ The code implements SyncML 1.2 and is written in php. The patch may be better to use because it highlights the changes needed to add syncml to the larger project. I haven't looked at the code, but I have used the patch. My users are starting to ask for this functionality which I haven't seen elsewhere. I hope this feature sees some progress.
          Hide
          Charles Flynn added a comment -

          Sync would be good, but it would be more cumbersome for me.

          Importing an iCal formatted file would be better for me since I am handed an updated .doc file, which I have to parse and import fresh every month into a Joomla JEvents calendar.

          Part of that process includes making the file into a CSV, loading it into Google Calendars, exporting that and importing the iCal file. (I used to just import it into and from an OSX ical file, but that involved even another program and getting a linkable URL has been a problem for it.

          Anything would help, but I would like to bring in a CSV file, or failing that, an iCal .ics file.

          Show
          Charles Flynn added a comment - Sync would be good, but it would be more cumbersome for me. Importing an iCal formatted file would be better for me since I am handed an updated .doc file, which I have to parse and import fresh every month into a Joomla JEvents calendar. Part of that process includes making the file into a CSV, loading it into Google Calendars, exporting that and importing the iCal file. (I used to just import it into and from an OSX ical file, but that involved even another program and getting a linkable URL has been a problem for it. Anything would help, but I would like to bring in a CSV file, or failing that, an iCal .ics file.
          Hide
          Mark Johnson added a comment -

          I've made a start at looking how this feature could be implemented.
          The attached patch displays an "Import Calendar" button alongside the "Export" one, which takes you to the import page. Selecting an ical file will upload and parse it into a format that Moodle can use (objects for insertion into the events table), and display a sample of the appointments in the file.

          This isn't usable yet, as it's currently quite specific to files generated with Novell Groupwise. If someone would like to send me (or post on this discussion: http://moodle.org/mod/forum/post.php?reply=559776) examples of .ics files from other applications, it would certainly help me along the way.

          Show
          Mark Johnson added a comment - I've made a start at looking how this feature could be implemented. The attached patch displays an "Import Calendar" button alongside the "Export" one, which takes you to the import page. Selecting an ical file will upload and parse it into a format that Moodle can use (objects for insertion into the events table), and display a sample of the appointments in the file. This isn't usable yet, as it's currently quite specific to files generated with Novell Groupwise. If someone would like to send me (or post on this discussion: http://moodle.org/mod/forum/post.php?reply=559776 ) examples of .ics files from other applications, it would certainly help me along the way.
          Hide
          Frosty added a comment -

          He's an iCal generated by Outlook 2007 for our School term dates. Hope it helps?

          Frosty

          Show
          Frosty added a comment - He's an iCal generated by Outlook 2007 for our School term dates. Hope it helps? Frosty
          Hide
          Clark Shah-Nelson added a comment -

          Google Calendar ical export - not much in it, but I put a couple things in for December 25th week.

          Show
          Clark Shah-Nelson added a comment - Google Calendar ical export - not much in it, but I put a couple things in for December 25th week.
          Hide
          Jim Crumley added a comment -

          Here's another ics file, from another one.

          I haven't looked at the patch yet, but are ytou using a library to read the ics? There are
          lots of good libraries out there - I would avoid reinventing the wheel on this, if possible.

          Thanks for working on this.

          Show
          Jim Crumley added a comment - Here's another ics file, from another one. I haven't looked at the patch yet, but are ytou using a library to read the ics? There are lots of good libraries out there - I would avoid reinventing the wheel on this, if possible. Thanks for working on this.
          Hide
          Mark Johnson added a comment -

          Thank you Frosty, Clark and Jim, it's certainly interesting to see the differences between the files output by different programs.

          Jim,
          I looked at a couple of libraries, but the ones I tried couldn't parse the export from Groupwise I had (although this is probably Groupwise's fault looking at the other ics files - for some reason it doesn't "nest" the VEVENTS correnctly and puts all the END: EVENT lines at the end of the file). I'd much rather use (or at least modify) an existing library than write one myself, the patch I used was purely to see if you can get data into a format that Moodle can use, which you can quite easily.
          If someone can recommend a library to use for this, I'll look into it.

          Show
          Mark Johnson added a comment - Thank you Frosty, Clark and Jim, it's certainly interesting to see the differences between the files output by different programs. Jim, I looked at a couple of libraries, but the ones I tried couldn't parse the export from Groupwise I had (although this is probably Groupwise's fault looking at the other ics files - for some reason it doesn't "nest" the VEVENTS correnctly and puts all the END: EVENT lines at the end of the file). I'd much rather use (or at least modify) an existing library than write one myself, the patch I used was purely to see if you can get data into a format that Moodle can use, which you can quite easily. If someone can recommend a library to use for this, I'll look into it.
          Hide
          Martin Dougiamas added a comment -

          Moodle includes the bennu library already http://bennu.sourceforge.net/ which should be able to do this, right?

          Note, bennu was created by Jon Papaioannou, a former Moodle developer.

          Show
          Martin Dougiamas added a comment - Moodle includes the bennu library already http://bennu.sourceforge.net/ which should be able to do this, right? Note, bennu was created by Jon Papaioannou, a former Moodle developer.
          Hide
          Mark Johnson added a comment -

          I did see bennu late yesterday, looks like it should be up to the job, and all the better if it's already included.
          I noticed moodle.org in the example code, that explains why!
          I'll look at using the bennu library to do the job. Thanks guys.

          Show
          Mark Johnson added a comment - I did see bennu late yesterday, looks like it should be up to the job, and all the better if it's already included. I noticed moodle.org in the example code, that explains why! I'll look at using the bennu library to do the job. Thanks guys.
          Hide
          Mark Johnson added a comment -

          Ok, I've taken a look at bennu. It seems that Jon Papaioannou managed to get enough of the iCalendar standard implemented to enable exports from Moodle (calendar and event creation, but not much more) before becoming unable to work on it.

          However, there was some code posted on the project's forum with a view to implementing an import feature. It looks promising, although still requires a little bit of work. The rest of the iCalendar components listed in http://www.ietf.org/rfc/rfc2445.txt (P. 50-72) also need implementing before it will work reliably, but the groundwork's already there so it's not too arduous a task.
          I'll keep you posted.

          Show
          Mark Johnson added a comment - Ok, I've taken a look at bennu. It seems that Jon Papaioannou managed to get enough of the iCalendar standard implemented to enable exports from Moodle (calendar and event creation, but not much more) before becoming unable to work on it. However, there was some code posted on the project's forum with a view to implementing an import feature. It looks promising, although still requires a little bit of work. The rest of the iCalendar components listed in http://www.ietf.org/rfc/rfc2445.txt (P. 50-72) also need implementing before it will work reliably, but the groundwork's already there so it's not too arduous a task. I'll keep you posted.
          Hide
          Mark Johnson added a comment -

          I've made quite a bit of progress with implementing the import feature to bennu. I used the unserialize() method from the project's sourceforge forum as a base (are the licensing concerns in this regard? I emailed the poster but am yet to receive a response), and identified the unimplemented areas of the RFC which I've implemented to the best of my ability.

          The error handling could use some improvement. Currently erroneous lines are dropped and logged to that errors can be repeated later, but this isn't perfect due to recursive calls to the function.

          The outlook and google calendars posted both parse happily and the resulting data (after invalid bits are dropped) can be converted into a format that Moodle is happy with. The only problem I came across was my Groupwise calendar due to the aforementioned problem with nesting events, but doing a find-and-replace to fix the nesting allowed the file to parse.

          Show
          Mark Johnson added a comment - I've made quite a bit of progress with implementing the import feature to bennu. I used the unserialize() method from the project's sourceforge forum as a base (are the licensing concerns in this regard? I emailed the poster but am yet to receive a response), and identified the unimplemented areas of the RFC which I've implemented to the best of my ability. The error handling could use some improvement. Currently erroneous lines are dropped and logged to that errors can be repeated later, but this isn't perfect due to recursive calls to the function. The outlook and google calendars posted both parse happily and the resulting data (after invalid bits are dropped) can be converted into a format that Moodle is happy with. The only problem I came across was my Groupwise calendar due to the aforementioned problem with nesting events, but doing a find-and-replace to fix the nesting allowed the file to parse.
          Hide
          Volker Krasemann added a comment -

          Hello,

          I am new at this, but I have been playing around trying to embed iCal into Moodle. This is my first post here or anywhere. I am working on a website wehre you could go and download the whole zipped file. I will describe what I did and then attach a screenshot. I am not a programmer, so bear with me.

          I redesigned Moodle and added features of a calendar like iCal. Essentially I embedded a web published version of iCal (phpicalandar) into Moodle. PHP iCalendar is a php-based iCal file parser. It displays iCal files in a nice logical, clean manner with day, week, month, and year navigation. You can add and edit these events online.

          When a teacher or student first logs into the Course Management Calendar a window opens up that shows all the classes the student is enrolled in or that the teacher teaches. Teachers are able to edit classes and add homework assignments. Both students and teachers are able to add one type of event into the calendar. Students can view which classes are being taught, what is taught and what the homework is that is assigned and when it is due.

          The calendar is shown on the opening page. Moodle works in the background and if open has all its usual functionality.

          Show
          Volker Krasemann added a comment - Hello, I am new at this, but I have been playing around trying to embed iCal into Moodle. This is my first post here or anywhere. I am working on a website wehre you could go and download the whole zipped file. I will describe what I did and then attach a screenshot. I am not a programmer, so bear with me. I redesigned Moodle and added features of a calendar like iCal. Essentially I embedded a web published version of iCal (phpicalandar) into Moodle. PHP iCalendar is a php-based iCal file parser. It displays iCal files in a nice logical, clean manner with day, week, month, and year navigation. You can add and edit these events online. When a teacher or student first logs into the Course Management Calendar a window opens up that shows all the classes the student is enrolled in or that the teacher teaches. Teachers are able to edit classes and add homework assignments. Both students and teachers are able to add one type of event into the calendar. Students can view which classes are being taught, what is taught and what the homework is that is assigned and when it is due. The calendar is shown on the opening page. Moodle works in the background and if open has all its usual functionality.
          Hide
          Volker Krasemann added a comment -

          This is a screenshot of what the opening moodle page looks like. The frame in the center shows the embedded phpicalendar.

          Show
          Volker Krasemann added a comment - This is a screenshot of what the opening moodle page looks like. The frame in the center shows the embedded phpicalendar.
          Hide
          Bill Pickett added a comment -

          I am trying to follow the discussion but the technical is quite technical for me. What I would like is for the calendar to access an outlook calendar automatically and pull the updates.

          Show
          Bill Pickett added a comment - I am trying to follow the discussion but the technical is quite technical for me. What I would like is for the calendar to access an outlook calendar automatically and pull the updates.
          Hide
          Mark Johnson added a comment -

          Volker,
          That's pretty impressive for a self-confessed non programmer!
          I've avoided including an entire separate ical-based system since Moodle already has calendar functionality built in. However, your solution would probably suit some people - you might want to create a discussion about how to do it on the Calendar forum.

          Bill,
          That would certainly be the ideal situation to have. However there's quite a bit of groundwork to do first so that Moodle can understand the file format required. Once that's done the possibility of "syncing" with other calendar apps like Outlook can be explored.

          As a general update to this bug, I've been in contact with Jon Papaioannou about the bennu library. I'm still waiting to hear from him a second time but it's possible that I'll commit my changes (when they've been brought up to standard) to the library upstream (less code to maintain in Moodle) and we can then use it for our needs.

          Show
          Mark Johnson added a comment - Volker, That's pretty impressive for a self-confessed non programmer! I've avoided including an entire separate ical-based system since Moodle already has calendar functionality built in. However, your solution would probably suit some people - you might want to create a discussion about how to do it on the Calendar forum. Bill, That would certainly be the ideal situation to have. However there's quite a bit of groundwork to do first so that Moodle can understand the file format required. Once that's done the possibility of "syncing" with other calendar apps like Outlook can be explored. As a general update to this bug, I've been in contact with Jon Papaioannou about the bennu library. I'm still waiting to hear from him a second time but it's possible that I'll commit my changes (when they've been brought up to standard) to the library upstream (less code to maintain in Moodle) and we can then use it for our needs.
          Hide
          Mark Hilliard added a comment -

          Mark,
          I just had a very large meeting with my Moodle users and the Calendar Import links is something they would REALLY like to use. We currently link 3-4 different calendars and waste huge amount of time.

          Is there any update on the good work you have done with iCal imports? We have a several moodle test servers and would be glad to test out code if I can find out where it lives and the best way to put it into a test environment.

          We currently use Moodle 1.9.5 or newer, but could install any flavor of Moodle you need for testing. Can we get an update on what versions of Moodle are compatible? And let me know if testing it would help you at some time OK? and a huge thanks for tackling this challenge!!

          Mark H.
          Mpls, MN USA

          Show
          Mark Hilliard added a comment - Mark, I just had a very large meeting with my Moodle users and the Calendar Import links is something they would REALLY like to use. We currently link 3-4 different calendars and waste huge amount of time. Is there any update on the good work you have done with iCal imports? We have a several moodle test servers and would be glad to test out code if I can find out where it lives and the best way to put it into a test environment. We currently use Moodle 1.9.5 or newer, but could install any flavor of Moodle you need for testing. Can we get an update on what versions of Moodle are compatible? And let me know if testing it would help you at some time OK? and a huge thanks for tackling this challenge!! Mark H. Mpls, MN USA
          Hide
          Stephen Glanville added a comment -

          Hi Folks

          Thanks for your efforts in getting this much needed and gobsmackingly absent function added to Moodle...I'm just here to add my support...I don't think I could add anything much by way of comment to what has already been said...except for my own preferences/requirements, just to bolster those of others here...

          Specifically I want to be able to connect with iCal and/or .Mac (effectively same thing), and or Google Calendar.

          Either way, being able to import a Calendar, connect and synchronize with other online Calendars has to be a standard feature for anything in the age of Web2.0/e-Learning...doesn't it? :-P

          Cheers

          Stephen Glanville

          Show
          Stephen Glanville added a comment - Hi Folks Thanks for your efforts in getting this much needed and gobsmackingly absent function added to Moodle...I'm just here to add my support...I don't think I could add anything much by way of comment to what has already been said...except for my own preferences/requirements, just to bolster those of others here... Specifically I want to be able to connect with iCal and/or .Mac (effectively same thing), and or Google Calendar. Either way, being able to import a Calendar, connect and synchronize with other online Calendars has to be a standard feature for anything in the age of Web2.0/e-Learning...doesn't it? :-P Cheers Stephen Glanville
          Hide
          Stephen Glanville added a comment -

          PS: I would hardly consider this to be 'Minor' priority! Major at the very least.

          Cheers

          Stephen G again :-P

          Show
          Stephen Glanville added a comment - PS: I would hardly consider this to be 'Minor' priority! Major at the very least. Cheers Stephen G again :-P
          Hide
          Martin Dougiamas added a comment -

          Good going, Mark!!

          I'm happy to try and squeeze it into Moodle 2.0 if we can get a bunch of people to review and test your work. And getting it standard in Bennu would make it even easier.

          Show
          Martin Dougiamas added a comment - Good going, Mark!! I'm happy to try and squeeze it into Moodle 2.0 if we can get a bunch of people to review and test your work. And getting it standard in Bennu would make it even easier.
          Hide
          Ken Tuley added a comment -

          I don't feel comfortable reviewing code, but I'll test the heck out of this calendar solution!

          Thanks for the work on this....

          Show
          Ken Tuley added a comment - I don't feel comfortable reviewing code, but I'll test the heck out of this calendar solution! Thanks for the work on this....
          Hide
          Mark Hilliard added a comment -

          Mark Johnson, Martin D,

          I have been watching this issue very closely and would love to help test. while I am not a PHP expert I have people at my work who are excellent.
          I also can create virtual Moodle servers very quickly and test things for you.

          I just downloaded all the files at the top of this tracker issue, but I am fairly new to Moodle tracker.

          I have shell access to all my servers and can upload via Filezilla to any place with proper security, Just need to know WHERE things go.

          We also have several Google accounts with larger calendars to use for testing.

          Can anyone give me the basics info for placing/installing the PHP and/or patch files to get started with testing?

          Mark Hilliard
          MPLS, MN

          Show
          Mark Hilliard added a comment - Mark Johnson, Martin D, I have been watching this issue very closely and would love to help test. while I am not a PHP expert I have people at my work who are excellent. I also can create virtual Moodle servers very quickly and test things for you. I just downloaded all the files at the top of this tracker issue, but I am fairly new to Moodle tracker. I have shell access to all my servers and can upload via Filezilla to any place with proper security, Just need to know WHERE things go. We also have several Google accounts with larger calendars to use for testing. Can anyone give me the basics info for placing/installing the PHP and/or patch files to get started with testing? Mark Hilliard MPLS, MN
          Hide
          Mark Johnson added a comment -

          Woah!
          Sorry I haven't replied to this in a while everyone, I've been busy with other projects and haven't had a chance to revisit issue.
          I'm currently at a bit of a roadblock as my institution is (very slowly) reviewing it's policy for releasing my code, so I've been asked not to release anything until the policy is clarified. I'm going to try my hardest to get this actioned within the next week or so.

          Martin, that's awesome! I'll try my hardest to get it released before the beta is out.

          I still haven't heard back from Jon Papaioannou regarding getting access to the Bennu upstream project. Does anyone have a current email address for him? He doesn't seem to check his moodle.org one anymore.

          Show
          Mark Johnson added a comment - Woah! Sorry I haven't replied to this in a while everyone, I've been busy with other projects and haven't had a chance to revisit issue. I'm currently at a bit of a roadblock as my institution is (very slowly) reviewing it's policy for releasing my code, so I've been asked not to release anything until the policy is clarified. I'm going to try my hardest to get this actioned within the next week or so. Martin, that's awesome! I'll try my hardest to get it released before the beta is out. I still haven't heard back from Jon Papaioannou regarding getting access to the Bennu upstream project. Does anyone have a current email address for him? He doesn't seem to check his moodle.org one anymore.
          Hide
          Mark Johnson added a comment -

          Sorry, I didn't mention, the code I currently have needs some substantial testing, but is a great improvement over the patch I've already submitted here. I've acted on some of the feedback Jon gave me to improve the code quality, and from the testing I've done it works pretty well (and even copes with some of the more serious departures from the standard produced by some programs). It definitely needs more testing, so I'll get it up here as soon as I can.

          Show
          Mark Johnson added a comment - Sorry, I didn't mention, the code I currently have needs some substantial testing, but is a great improvement over the patch I've already submitted here. I've acted on some of the feedback Jon gave me to improve the code quality, and from the testing I've done it works pretty well (and even copes with some of the more serious departures from the standard produced by some programs). It definitely needs more testing, so I'll get it up here as soon as I can.
          Hide
          Mark Johnson added a comment -

          I've now gotten hold of Jon who has agreed to add me to the Bennu project. Once my code's in the library, I'll post a patch with my latest code and instructions on how to test it out.

          Show
          Mark Johnson added a comment - I've now gotten hold of Jon who has agreed to add me to the Bennu project. Once my code's in the library, I'll post a patch with my latest code and instructions on how to test it out.
          Hide
          Mark Johnson added a comment -

          Good news! I've now had by modifications to bennu added to the upstream project's SVN.
          The attached patch is not my final proposed fix for the issue, but will allow people to test the functionality. It applies the latest version of bennu from SVN, and adds in interface to import iCalendar files. After applying, use the following steps to test it out:

          Navigate to calendar/view.php (accessible from the Calendar and Upcoming Events blocks)
          Click [[importcalendar]]
          Select your .ics file and upload
          You may see a lot of debugging messages about invalid properties. These are not fatal, and can for the most part be ignored. If there are any invalid component messages, there may be an issue.
          At the bottom of the page there will be a table with a preview of 20 events that are to be imported, as well as a count of any that are not displayed. Check that those displayed match what you're expecting.
          Select the type of events you want to create (Site/Course/User), and click Import Events. You should see a summary of any that are imported or updated.
          You can now return to the calendar and check that the events have imported.

          If you can post a comment saying which system your .ics file was generated from and your results, that would be a great help.

          Show
          Mark Johnson added a comment - Good news! I've now had by modifications to bennu added to the upstream project's SVN. The attached patch is not my final proposed fix for the issue, but will allow people to test the functionality. It applies the latest version of bennu from SVN, and adds in interface to import iCalendar files. After applying, use the following steps to test it out: Navigate to calendar/view.php (accessible from the Calendar and Upcoming Events blocks) Click [ [importcalendar] ] Select your .ics file and upload You may see a lot of debugging messages about invalid properties. These are not fatal, and can for the most part be ignored. If there are any invalid component messages, there may be an issue. At the bottom of the page there will be a table with a preview of 20 events that are to be imported, as well as a count of any that are not displayed. Check that those displayed match what you're expecting. Select the type of events you want to create (Site/Course/User), and click Import Events. You should see a summary of any that are imported or updated. You can now return to the calendar and check that the events have imported. If you can post a comment saying which system your .ics file was generated from and your results, that would be a great help.
          Hide
          Alex Brady added a comment -

          Hello, I am quite new at moodle and am having troubles with getting this to work. I have all of the files, but am not sure what I do or where I need to put the code in order for this to work. I am trying to have our Google Calendar Ical be on on our Moodle Calendar as well. If there is any step by step instructions on how to do this or any more detailed instructions, that would be great.

          Thanks!

          Show
          Alex Brady added a comment - Hello, I am quite new at moodle and am having troubles with getting this to work. I have all of the files, but am not sure what I do or where I need to put the code in order for this to work. I am trying to have our Google Calendar Ical be on on our Moodle Calendar as well. If there is any step by step instructions on how to do this or any more detailed instructions, that would be great. Thanks!
          Hide
          Mark Johnson added a comment -

          Hi Alex,
          Please note that this isn't yet ready for use on a production system. If you're looking for a reliable implementation of iCal imports, please wait until it's included in the Moodle package.
          However, if you've got a test server and would like to try it out, you'll need to download calendar_test.patch and apply it to the code in your test environment (see instructions on applying patches here: http://docs.moodle.org/en/Development:How_to_apply_a_patch). Once that's done, follow the steps in my previous comment to try it out.
          Thanks

          Show
          Mark Johnson added a comment - Hi Alex, Please note that this isn't yet ready for use on a production system. If you're looking for a reliable implementation of iCal imports, please wait until it's included in the Moodle package. However, if you've got a test server and would like to try it out, you'll need to download calendar_test.patch and apply it to the code in your test environment (see instructions on applying patches here: http://docs.moodle.org/en/Development:How_to_apply_a_patch ). Once that's done, follow the steps in my previous comment to try it out. Thanks
          Hide
          Chris Collman added a comment -

          Backing up calendar is also a little unclear. Been editing MoodleDocs and tried to backup demo course to restore my calendar entries when it refreshed on the hour. MoodleDocs said an ics could be used as a backup. I assumed I could create the file via Calendar export, then import it. I guess this just meant that you could print up a copy using another calendar program. Not a backup.

          Importing an ics file would be nice. And feature should also be on permission list. I would not trust some students or teachers to populate a calendar with their imported events.

          Show
          Chris Collman added a comment - Backing up calendar is also a little unclear. Been editing MoodleDocs and tried to backup demo course to restore my calendar entries when it refreshed on the hour. MoodleDocs said an ics could be used as a backup. I assumed I could create the file via Calendar export, then import it. I guess this just meant that you could print up a copy using another calendar program. Not a backup. Importing an ics file would be nice. And feature should also be on permission list. I would not trust some students or teachers to populate a calendar with their imported events.
          Hide
          Alex Brady added a comment -

          Thanks for the response Mark!

          I tried following the steps here http://docs.moodle.org/en/Development:How_to_apply_a_patch

          I downloaded the patch.exe and placed it in C:/bin/patch.exe
          I then took the calendar_test.patch and placed inside my moodle root folder at C:\xampp\htdocs\moodle\

          I opened up calendar_test.patch and saved it as thispatch.patch in the same directory
          I then went into the directory in command prompt of the patch file, C:\xampp\htdocs\moodle\
          Then I typed in c:\bin\patch.exe --dry-run -p1 < thispatch.patch

          When I did this, I got messages saying that the different hunks had failed. I don't know if you or anyone can help me with my specific case, but it would be very nice to be able to import the ical. I am testing this on a live, but somewhat of a test Moodle server. We are begining to implement it at our school, but it has not fully been developed yet.

          Thanks

          Show
          Alex Brady added a comment - Thanks for the response Mark! I tried following the steps here http://docs.moodle.org/en/Development:How_to_apply_a_patch I downloaded the patch.exe and placed it in C:/bin/patch.exe I then took the calendar_test.patch and placed inside my moodle root folder at C:\xampp\htdocs\moodle\ I opened up calendar_test.patch and saved it as thispatch.patch in the same directory I then went into the directory in command prompt of the patch file, C:\xampp\htdocs\moodle\ Then I typed in c:\bin\patch.exe --dry-run -p1 < thispatch.patch When I did this, I got messages saying that the different hunks had failed. I don't know if you or anyone can help me with my specific case, but it would be very nice to be able to import the ical. I am testing this on a live, but somewhat of a test Moodle server. We are begining to implement it at our school, but it has not fully been developed yet. Thanks
          Hide
          Mark Johnson added a comment -

          Hi Guys, thanks for helping out!
          Sorry, I should have said something about backing up.
          The best way to back up before you start is to do a mysqldump (or Export in phpMyAdmin) of the {$prefix}event table, as that's the only one that's modified. Once you've tested an import you can just restore it to the previous state.

          Permissions are currently handled by the moodle/calendar:manage{$foo}entries permissions. E.g. Users can only import events to a calendar where they can already create them. Do we need any additional control than this?

          Alex,
          Do you have any way of creating a duplicate of your installation to test against? I'd hate for you to mess up your institution's only install.
          Which version are you trying to patch against? I created the patch against 1.9.8+ which I checked out on Monday. If you're using an earlier version that might be why there's problems. Can you post up the output of the patch command with --dry-run?

          Show
          Mark Johnson added a comment - Hi Guys, thanks for helping out! Sorry, I should have said something about backing up. The best way to back up before you start is to do a mysqldump (or Export in phpMyAdmin) of the {$prefix}event table, as that's the only one that's modified. Once you've tested an import you can just restore it to the previous state. Permissions are currently handled by the moodle/calendar:manage{$foo}entries permissions. E.g. Users can only import events to a calendar where they can already create them. Do we need any additional control than this? Alex, Do you have any way of creating a duplicate of your installation to test against? I'd hate for you to mess up your institution's only install. Which version are you trying to patch against? I created the patch against 1.9.8+ which I checked out on Monday. If you're using an earlier version that might be why there's problems. Can you post up the output of the patch command with --dry-run?
          Hide
          Mark Johnson added a comment -

          If you're still having problems, this might simplify things a bit:
          I've uploaded an updated version of the bennu library to MDL-22308. The files in the zip file there are a drop-in replacement for the files in /lib/bennu.
          calendar_test2.patch from this issue only patches the calendar component of Moodle to provide the import interface. This should be easier as there's less to go wrong.

          Thanks
          Mark

          Show
          Mark Johnson added a comment - If you're still having problems, this might simplify things a bit: I've uploaded an updated version of the bennu library to MDL-22308 . The files in the zip file there are a drop-in replacement for the files in /lib/bennu. calendar_test2.patch from this issue only patches the calendar component of Moodle to provide the import interface. This should be easier as there's less to go wrong. Thanks Mark
          Hide
          Paul Nicholls added a comment -

          Hi Mark,
          Thanks for all your hard work on this incredibly useful feature! Has there been any progress on making it stable enough for production use (and inclusion in Moodle core)? We'd really like to be able to use this, but from the comments here, it doesn't sound like it's quite ready for production use. How far away do you think it is?

          Cheers,
          Paul

          Show
          Paul Nicholls added a comment - Hi Mark, Thanks for all your hard work on this incredibly useful feature! Has there been any progress on making it stable enough for production use (and inclusion in Moodle core)? We'd really like to be able to use this, but from the comments here, it doesn't sound like it's quite ready for production use. How far away do you think it is? Cheers, Paul
          Hide
          Martin Dougiamas added a comment -

          If this is going to get into 2.0 I would really like to have a bunch of people vouching for the patch. is it ready?

          Show
          Martin Dougiamas added a comment - If this is going to get into 2.0 I would really like to have a bunch of people vouching for the patch. is it ready?
          Hide
          Charles Flynn added a comment -

          I just loaded the patch...so, can verify that on Moodle 1.9.9 on a shared Linux server, the patch responded without errors using Terminal on Mac OSX 10.6.4

          I'll now start testing an import or three.

          Show
          Charles Flynn added a comment - I just loaded the patch...so, can verify that on Moodle 1.9.9 on a shared Linux server, the patch responded without errors using Terminal on Mac OSX 10.6.4 I'll now start testing an import or three.
          Hide
          Charles Flynn added a comment -

          I'm sorry to report that I have exported several ics calendar files from Google Calendar, from my Mac iCal, and from the calendar at dcinematools.com - I can look at all the internals from these calendars and see that they seem to be valid files.

          But they do not seem to import into the Moodle Calendar. It goes through the process correctly, I hit Preview, and it doesn't 'see' the event.

          These are all events that I can successfully import with a double click into the Mac iCal program.

          I have created a new event in Moodle calendar, exported it, then modified it with new dates. That will add successfully to Mac iCal.

          In only this case, when I use the import event in Moodle, the event will Preview...that is, I can see the event at the top of the screen.

          It asks if I want it for the user or for global, and after hitting "Import Events", it comes back with "0 events imported successfully. 0 events updated."

          So, either I have loaded the patch wrong, or I have Moodle Calendar set up to not accept events this way, or there is something wrong with the script.

          To test the first, I have used both the patch (which seemed to work - at least, it doesn't work the same way I have just described), and I also did the long route of uploading the files into the event folder...with the same effect.

          As far as permissions, I am using the admin account which is set up to make calendar events.

          Ideas?

          Show
          Charles Flynn added a comment - I'm sorry to report that I have exported several ics calendar files from Google Calendar, from my Mac iCal, and from the calendar at dcinematools.com - I can look at all the internals from these calendars and see that they seem to be valid files. But they do not seem to import into the Moodle Calendar. It goes through the process correctly, I hit Preview, and it doesn't 'see' the event. These are all events that I can successfully import with a double click into the Mac iCal program. I have created a new event in Moodle calendar, exported it, then modified it with new dates. That will add successfully to Mac iCal. In only this case, when I use the import event in Moodle, the event will Preview...that is, I can see the event at the top of the screen. It asks if I want it for the user or for global, and after hitting "Import Events", it comes back with "0 events imported successfully. 0 events updated." So, either I have loaded the patch wrong, or I have Moodle Calendar set up to not accept events this way, or there is something wrong with the script. To test the first, I have used both the patch (which seemed to work - at least, it doesn't work the same way I have just described), and I also did the long route of uploading the files into the event folder...with the same effect. As far as permissions, I am using the admin account which is set up to make calendar events. Ideas?
          Hide
          Mark Johnson added a comment -

          Sorry for my recent silence, it appears that I wasn't watching the issue so didn't recieve notifications of the recent updates.
          Charles, thank you very much for testing the system. Can I ask what debugging level your Moodle is set to, and if it produced any errors? Also, would you be able to post the iCal files you were using up here, to see if I can identify the problem?

          Martin, I don't honestly think this solution is going to be ready for 2.0 (it's currently written for 1.9 APIs anyway) unless someone else finds time to iron out the creases for me, so it might be best to pencil it in for 2.1?

          Show
          Mark Johnson added a comment - Sorry for my recent silence, it appears that I wasn't watching the issue so didn't recieve notifications of the recent updates. Charles, thank you very much for testing the system. Can I ask what debugging level your Moodle is set to, and if it produced any errors? Also, would you be able to post the iCal files you were using up here, to see if I can identify the problem? Martin, I don't honestly think this solution is going to be ready for 2.0 (it's currently written for 1.9 APIs anyway) unless someone else finds time to iron out the creases for me, so it might be best to pencil it in for 2.1?
          Hide
          Charles Flynn added a comment -

          Mark, I will write you a private email, to suggest an idea offline, and send some of my personal files.

          I haven't set Moodle for any debugging level. I suppose that is easy to do, but one more thing to learn that I haven't had to do.

          Charles

          Show
          Charles Flynn added a comment - Mark, I will write you a private email, to suggest an idea offline, and send some of my personal files. I haven't set Moodle for any debugging level. I suppose that is easy to do, but one more thing to learn that I haven't had to do. Charles
          Hide
          Mark Johnson added a comment -

          Just a note to testers as I don't think my instructions were clear enough before, and led to the problems Charles was having:

          To test my patch, you will need to replace the contents of /lib/bennu with the contents of the bennu.zip from MDL-22308, NOT the bennu.tar.gz from this page.
          You'll then need to apply calendar_test2.patch from this issue. Sorry if this has caused any confusion.

          If the bennu.tar.gz file on this page could be deleted, that would probably help ease confusion.

          Show
          Mark Johnson added a comment - Just a note to testers as I don't think my instructions were clear enough before, and led to the problems Charles was having: To test my patch, you will need to replace the contents of /lib/bennu with the contents of the bennu.zip from MDL-22308 , NOT the bennu.tar.gz from this page. You'll then need to apply calendar_test2.patch from this issue. Sorry if this has caused any confusion. If the bennu.tar.gz file on this page could be deleted, that would probably help ease confusion.
          Hide
          Charles Flynn added a comment -

          After Mark made changes to my configuration;

          I have successfully imported an .ics file that I generated by exporting it from Mac iCal. It has dozens of events.

          I had failures importing the Ringmer and t.ics files that are included at the top of this project. They both threw a number of errors, and did not import at all. (These have been sent to Mark.)

          So, partial great success.

          It would be good to know from the people who deposited those files how they were generated.

          Show
          Charles Flynn added a comment - After Mark made changes to my configuration; I have successfully imported an .ics file that I generated by exporting it from Mac iCal. It has dozens of events. I had failures importing the Ringmer and t.ics files that are included at the top of this project. They both threw a number of errors, and did not import at all. (These have been sent to Mark.) So, partial great success. It would be good to know from the people who deposited those files how they were generated.
          Hide
          Jim Crumley added a comment -

          Charles,

          I made t.isc with a perl script that I wrote. The script uses use fairly standard perl libraries - Data::ICal and Date::ICal - for creating the events, though I did copy some of the timezone portions of the header
          from elsewhere.

          I have used these ics files most often with Google calendar, though I have also tested them with a few other programs including Mozilla Sunbird, Evolution, and Outlook. I haven't had any problems with other programs parsing them, though it wouldn't surprise me much if there were issues with the header.

          Show
          Jim Crumley added a comment - Charles, I made t.isc with a perl script that I wrote. The script uses use fairly standard perl libraries - Data::ICal and Date::ICal - for creating the events, though I did copy some of the timezone portions of the header from elsewhere. I have used these ics files most often with Google calendar, though I have also tested them with a few other programs including Mozilla Sunbird, Evolution, and Outlook. I haven't had any problems with other programs parsing them, though it wouldn't surprise me much if there were issues with the header.
          Hide
          Mark Johnson added a comment -

          It seems that the problems Charles has been experiencing were down to permissions - There was nothing preventing an unprivileged user from attempting to import, which caused problems. calendar_test3.patch checks that the user is allowed to create events before giving them access to the import page, so any user who is able to access the page shouldn't experience the problems Charles was having.

          Again, you'll need to install the updated bennu library from MDL-22308 to test this patch.

          Show
          Mark Johnson added a comment - It seems that the problems Charles has been experiencing were down to permissions - There was nothing preventing an unprivileged user from attempting to import, which caused problems. calendar_test3.patch checks that the user is allowed to create events before giving them access to the import page, so any user who is able to access the page shouldn't experience the problems Charles was having. Again, you'll need to install the updated bennu library from MDL-22308 to test this patch.
          Hide
          Lei Zhang added a comment -

          Mark,

          Your last patch calendar_test3.path was truncated in line 151, you might want to upload another one.

          When I upload the test calendar from Ringmer Community college in this ticket, it returns some errors although I've no trouble of view them after importing.

          Failed to add property on line 46
          Failed to add property on line 61
          Failed to add component on line 70
          Invalid line: 71, ignoring

          Importing a calendar straight from MS Outlook, event start time will reset back to 1970.

          Show
          Lei Zhang added a comment - Mark, Your last patch calendar_test3.path was truncated in line 151, you might want to upload another one. When I upload the test calendar from Ringmer Community college in this ticket, it returns some errors although I've no trouble of view them after importing. Failed to add property on line 46 Failed to add property on line 61 Failed to add component on line 70 Invalid line: 71, ignoring Importing a calendar straight from MS Outlook, event start time will reset back to 1970.
          Hide
          Daniel Wahl added a comment -

          Mark,

          just pulled to the latest CVS update (20100804), then updated the bennu libs from the other ticket, then applied the patch. I added the string to lang/en_utf8/calendar.php - and everything appears as it should so I have a "Import Calendar" button depending on if the user has permissions in Moodle - but clicking "import calendar" always results in a white page.

          Permissions in /calendar are all 644, and the bennu libs all have the same permissions as the files that weren't overwritten (can't remember off-hand)

          I turned on debugging and set it to developer, but I don't get anything on the page.

          Show
          Daniel Wahl added a comment - Mark, just pulled to the latest CVS update (20100804), then updated the bennu libs from the other ticket, then applied the patch. I added the string to lang/en_utf8/calendar.php - and everything appears as it should so I have a "Import Calendar" button depending on if the user has permissions in Moodle - but clicking "import calendar" always results in a white page. Permissions in /calendar are all 644, and the bennu libs all have the same permissions as the files that weren't overwritten (can't remember off-hand) I turned on debugging and set it to developer, but I don't get anything on the page.
          Hide
          Mark Johnson added a comment -

          Lei and Daniel, thank you for helping test this solution.

          Lei, I just downloaded calendar_test3.patch and it's got everything it needs, it may have been that your download got interrupted.
          Those error messages you get are just debugging from the parser, dropping properties that aren't supported and so on, so nothing to worry about. Once I know it's working, I'll make sure it only displays them when the appropriate debugging level is set.

          Daniel,
          Can you confirm that calendar/import.php and calendar/calendar_import_form.php were created when you applied the patch?

          Thanks!

          Show
          Mark Johnson added a comment - Lei and Daniel, thank you for helping test this solution. Lei, I just downloaded calendar_test3.patch and it's got everything it needs, it may have been that your download got interrupted. Those error messages you get are just debugging from the parser, dropping properties that aren't supported and so on, so nothing to worry about. Once I know it's working, I'll make sure it only displays them when the appropriate debugging level is set. Daniel, Can you confirm that calendar/import.php and calendar/calendar_import_form.php were created when you applied the patch? Thanks!
          Hide
          Daniel Wahl added a comment -

          Mark they were both created:

          import.php (20.6KB)
          157 lines (including whitespace)
          starts with php open tags and require ../config.php
          ends with print_footer(); and php close tags

          calendar_import_form.php (1.6KB)
          50 lines (including whitespace)
          starts with php open tags and require ../config.php
          ends with closing bracket for calendar_import_confirm_form class extender and php close tags

          all files in /calendar/ are 644 and calendar/ is 755 (like all other directories at the root level)


          the above info came from gphpedit - different editors may display differently I suppose.

          Show
          Daniel Wahl added a comment - Mark they were both created: import.php (20.6KB) 157 lines (including whitespace) starts with php open tags and require ../config.php ends with print_footer(); and php close tags calendar_import_form.php (1.6KB) 50 lines (including whitespace) starts with php open tags and require ../config.php ends with closing bracket for calendar_import_confirm_form class extender and php close tags all files in /calendar/ are 644 and calendar/ is 755 (like all other directories at the root level) — the above info came from gphpedit - different editors may display differently I suppose.
          Hide
          Barry Oosthuizen added a comment -

          Hi Mark,

          Thanks for your work on this, it's really needed.

          I have the same problem as Lei, with patch 3. Here is what I get when I open the patch (line 151):

          + echo '<p><a href="'.calendar_get_link_href(CALENDAR_URL.'view.php?view=upcoming&course='.$courseid.'&', $now['mday'], $now['mo

          I think it should be:

          + echo '<p><a href="'.calendar_get_link_href(CALENDAR_URL.'view.php?view=upcoming&course='.$courseid.'&', $now['mday'], $now['mon'], $now['year']).'">Back to Calendar.</a></p>';

          Whenever I try and import a file I get:

          0 events imported successfully.

          0 events updated

          but do find them afterwards in the calendar when importing from Google Calendar.

          When trying to import from a Yahoo Calendar there were loads of errors and everything went to 1/1/1970

          Here are some of the errors:

          Notice: Undefined index: SUMMARY in C:\wamp\www\moodle\calendar\import.php on line 116

          Notice: Trying to get property of non-object in C:\wamp\www\moodle\calendar\import.php on line 116

          Notice: Undefined index: DESCRIPTION in C:\wamp\www\moodle\calendar\import.php on line 117

          Notice: Trying to get property of non-object in C:\wamp\www\moodle\calendar\import.php on line 117

          Notice: Undefined index: DTSTART in C:\wamp\www\moodle\calendar\import.php on line 118

          Notice: Trying to get property of non-object in C:\wamp\www\moodle\calendar\import.php on line 118

          Notice: Undefined index: DTEND in C:\wamp\www\moodle\calendar\import.php on line 119

          I think these errors cause a few hundred blank entries to be added so on 1/1/1970 in the calendar I have a really long list of blank entries + a few non blank ones (the actual entries in my Calendar that got sent to 01/01/1970). I see in the database loads of blank entries where timestart is 0 (01/01/1970) as below

          id name description format courseid groupid userid repeatid modulename instance eventtype timestart Ascending timeduration visible uuid sequence timemodified

          214 0 0 0 2 0 0 0 0 1 eTjZPzRWiMLCzi8T6vw0982lkj34kSTGXp364pyaFp 1 1281294009

          Cheers,

          Barry

          Show
          Barry Oosthuizen added a comment - Hi Mark, Thanks for your work on this, it's really needed. I have the same problem as Lei, with patch 3. Here is what I get when I open the patch (line 151): + echo '<p><a href="'.calendar_get_link_href(CALENDAR_URL.'view.php?view=upcoming&course='.$courseid.'&', $now ['mday'] , $now['mo I think it should be: + echo '<p><a href="'.calendar_get_link_href(CALENDAR_URL.'view.php?view=upcoming&course='.$courseid.'&', $now ['mday'] , $now ['mon'] , $now ['year'] ).'">Back to Calendar.</a></p>'; Whenever I try and import a file I get: 0 events imported successfully. 0 events updated but do find them afterwards in the calendar when importing from Google Calendar. When trying to import from a Yahoo Calendar there were loads of errors and everything went to 1/1/1970 Here are some of the errors: Notice: Undefined index: SUMMARY in C:\wamp\www\moodle\calendar\import.php on line 116 Notice: Trying to get property of non-object in C:\wamp\www\moodle\calendar\import.php on line 116 Notice: Undefined index: DESCRIPTION in C:\wamp\www\moodle\calendar\import.php on line 117 Notice: Trying to get property of non-object in C:\wamp\www\moodle\calendar\import.php on line 117 Notice: Undefined index: DTSTART in C:\wamp\www\moodle\calendar\import.php on line 118 Notice: Trying to get property of non-object in C:\wamp\www\moodle\calendar\import.php on line 118 Notice: Undefined index: DTEND in C:\wamp\www\moodle\calendar\import.php on line 119 I think these errors cause a few hundred blank entries to be added so on 1/1/1970 in the calendar I have a really long list of blank entries + a few non blank ones (the actual entries in my Calendar that got sent to 01/01/1970). I see in the database loads of blank entries where timestart is 0 (01/01/1970) as below id name description format courseid groupid userid repeatid modulename instance eventtype timestart Ascending timeduration visible uuid sequence timemodified 214 0 0 0 2 0 0 0 0 1 eTjZPzRWiMLCzi8T6vw0982lkj34kSTGXp364pyaFp 1 1281294009 Cheers, Barry
          Hide
          Mark Johnson added a comment -

          I've just re-uploaded the patch, Barry and Lei, please try to download it again.

          Daniel, when you increased the Debug Messages level to DEVELOPER did you also check "Display Debug Messages" so that they print to the page, rather than the error log?

          Show
          Mark Johnson added a comment - I've just re-uploaded the patch, Barry and Lei, please try to download it again. Daniel, when you increased the Debug Messages level to DEVELOPER did you also check "Display Debug Messages" so that they print to the page, rather than the error log?
          Hide
          Barry Oosthuizen added a comment -

          Hi Mark,

          The new patch3 still looks the same to me.

          I've attached another one here.

          By the way, the 0 events imported successfully, 0 events updated issue I had has been resolved (my mistake).

          Cheers,

          Barry

          Show
          Barry Oosthuizen added a comment - Hi Mark, The new patch3 still looks the same to me. I've attached another one here. By the way, the 0 events imported successfully, 0 events updated issue I had has been resolved (my mistake). Cheers, Barry
          Hide
          Mark Johnson added a comment -

          Thanks Barry,
          Both patches look the same to me, but if the "fixed" one works better for everyone, please use that.

          Can I confirm, Barry, that you've managed to apply the patch and successfully import ical files?

          Show
          Mark Johnson added a comment - Thanks Barry, Both patches look the same to me, but if the "fixed" one works better for everyone, please use that. Can I confirm, Barry, that you've managed to apply the patch and successfully import ical files?
          Hide
          Barry Oosthuizen added a comment -

          Hi Mark, Yes, I've applied the patch successfullly and have imported ical files successfully from Google Calendar. Yahoo Calendar gave me problems/errors as I posted above.

          Show
          Barry Oosthuizen added a comment - Hi Mark, Yes, I've applied the patch successfullly and have imported ical files successfully from Google Calendar. Yahoo Calendar gave me problems/errors as I posted above.
          Hide
          Daniel Wahl added a comment -

          Mark,

          I had turned on print debugging. I just rolled back, and applied the patch again, with the calendar_test3_fixed - and it worked. So I'm guessing it's a line feed error (was the patch made on Windows?) or something goofy like that.

          So from looking briefly this patch is an import patch - not a 'subscribe' patch right? subscription is what I'm hoping will eventually be implemented, so that our teachers can 'push' updates to Moodle from iCal.

          Hope I don't sound too greedy, I really am thankful for your work!

          Show
          Daniel Wahl added a comment - Mark, I had turned on print debugging. I just rolled back, and applied the patch again, with the calendar_test3_fixed - and it worked. So I'm guessing it's a line feed error (was the patch made on Windows?) or something goofy like that. So from looking briefly this patch is an import patch - not a 'subscribe' patch right? subscription is what I'm hoping will eventually be implemented, so that our teachers can 'push' updates to Moodle from iCal. Hope I don't sound too greedy, I really am thankful for your work!
          Hide
          Mark Johnson added a comment -

          Barry,
          Could you post the Yahoo calendar that's giving you problems, or email it to me if you don't want to post it publicly?

          Daniel,
          That's correct, I'm only focusing on import at the moment. Once that's done, what I've got in mind is some sort of cron job which can call a list of URLs at regular intervals to sync with icals somewhere on the web. I don't know enough about other implementations of sync/subscribe to know how it might work if the ical file isn't accessible on the web, but anyone who does is most welcome to contribute your knowledge!

          Show
          Mark Johnson added a comment - Barry, Could you post the Yahoo calendar that's giving you problems, or email it to me if you don't want to post it publicly? Daniel, That's correct, I'm only focusing on import at the moment. Once that's done, what I've got in mind is some sort of cron job which can call a list of URLs at regular intervals to sync with icals somewhere on the web. I don't know enough about other implementations of sync/subscribe to know how it might work if the ical file isn't accessible on the web, but anyone who does is most welcome to contribute your knowledge!
          Hide
          Mark Johnson added a comment -

          I've just taken a look into Brian's problem and it seems that Yahoo Calendar exports a slightly non-standard ics file. I have contacted Yahoo to let them know (the functionality's currently in beta anyway), and will wait to see what they say. I may modify the parser to allow for their error.

          Show
          Mark Johnson added a comment - I've just taken a look into Brian's problem and it seems that Yahoo Calendar exports a slightly non-standard ics file. I have contacted Yahoo to let them know (the functionality's currently in beta anyway), and will wait to see what they say. I may modify the parser to allow for their error.
          Hide
          Mark Johnson added a comment -

          That's Barry, not Brian. My apologies.

          Show
          Mark Johnson added a comment - That's Barry, not Brian. My apologies.
          Hide
          chester folming added a comment -

          How is this issue coming along?

          This is our only serious problem with moodle - that we cannot let it be part of our calendar information chain.

          Calendars are born in our study administrative system and supposed to be spread to the students mail accounts (after some manipulation) as individual user calendars - as well as class calendars that need to be available in moodle.

          Could you please give the status of this issue as of October 2010..?

          Show
          chester folming added a comment - How is this issue coming along? This is our only serious problem with moodle - that we cannot let it be part of our calendar information chain. Calendars are born in our study administrative system and supposed to be spread to the students mail accounts (after some manipulation) as individual user calendars - as well as class calendars that need to be available in moodle. Could you please give the status of this issue as of October 2010..?
          Hide
          Mark Johnson added a comment -

          Hi Chester,
          From the feedback I've had so far the patch seems to "work", the problems that people have had seem to be down to not applying the patch correctly, or incompatible files (Yahoo calendar still appears to produce non-standard files). I've not had any more feedback, so I suppose it's up to the core dev team what happens next. If the decision's made that it needs to support Yahoo calendar, I'll need to modify the bennu library to allow it. I'll then produce a clean patch against 1.9 and add it to the modules and plugins database. Since the target for this bug is 2.1, I'll need to update the code to version 2 APIs, which I'll do sometime before next summer, unless someone wants to do it for me.

          Show
          Mark Johnson added a comment - Hi Chester, From the feedback I've had so far the patch seems to "work", the problems that people have had seem to be down to not applying the patch correctly, or incompatible files (Yahoo calendar still appears to produce non-standard files). I've not had any more feedback, so I suppose it's up to the core dev team what happens next. If the decision's made that it needs to support Yahoo calendar, I'll need to modify the bennu library to allow it. I'll then produce a clean patch against 1.9 and add it to the modules and plugins database. Since the target for this bug is 2.1, I'll need to update the code to version 2 APIs, which I'll do sometime before next summer, unless someone wants to do it for me.
          Hide
          Helen Foster added a comment -

          Thanks everyone for your comments, votes and patches. Any comment Martin?

          Show
          Helen Foster added a comment - Thanks everyone for your comments, votes and patches. Any comment Martin?
          Hide
          LIP added a comment -

          Hi all,

          I just want to know what is the status of this feature? Is ok to use in production structures? The feature is in "Unresolved" status.

          I would like to install it. I have version Moodle 1.9.8+ (Build: 20100428).

          With the best regards,

          Show
          LIP added a comment - Hi all, I just want to know what is the status of this feature? Is ok to use in production structures? The feature is in "Unresolved" status. I would like to install it. I have version Moodle 1.9.8+ (Build: 20100428). With the best regards,
          Hide
          Mark Johnson added a comment -

          The feature is not yet in Moodle core. I wouldn't recommend the patch for production sites, but if you have a test site you can install it on and it works for your use case, it should be OK for production sites as far as I know (you probably haven't read through all the comments, but I've not been able to confirm any issues with the patch itself. Yahoo produces a slightly non-standard ical file that the import script doesn't like, but other than that all reported issues have been due to the patch being incorrectly applied). However, until Moodle HQ can provide some feedback, I'm at a bit of a dead end with regards to developing this any further.

          Show
          Mark Johnson added a comment - The feature is not yet in Moodle core. I wouldn't recommend the patch for production sites, but if you have a test site you can install it on and it works for your use case, it should be OK for production sites as far as I know (you probably haven't read through all the comments, but I've not been able to confirm any issues with the patch itself. Yahoo produces a slightly non-standard ical file that the import script doesn't like, but other than that all reported issues have been due to the patch being incorrectly applied). However, until Moodle HQ can provide some feedback, I'm at a bit of a dead end with regards to developing this any further.
          Hide
          Charles Fulton added a comment -

          I've just applied this cleanly against 1.9.10. Importing works fine, but the preview function comes up blank for the test data. I'm using the 2011 Detroit Tigers schedule which is available as an iCal download: http://mlb.mlb.com/schedule/downloadable.jsp?c_id=det. I've tested other ics files and the preview function does work. I've compared the output of the preview data and the data eventually imported and they appear to be the same, so I'm a little stumped as to why it can't unserialize it for previewing. As I said it does import into the calendar without trouble.

          Show
          Charles Fulton added a comment - I've just applied this cleanly against 1.9.10. Importing works fine, but the preview function comes up blank for the test data. I'm using the 2011 Detroit Tigers schedule which is available as an iCal download: http://mlb.mlb.com/schedule/downloadable.jsp?c_id=det . I've tested other ics files and the preview function does work. I've compared the output of the preview data and the data eventually imported and they appear to be the same, so I'm a little stumped as to why it can't unserialize it for previewing. As I said it does import into the calendar without trouble.
          Hide
          Jonathan Harker added a comment -

          Hi there,
          Just FYI I'm porting this import patch to 2.0 for a client, and hopefully we can get this and MDL-22308 pulled into 2.0 master and possibly MOODLE_19_STABLE too.

          Show
          Jonathan Harker added a comment - Hi there, Just FYI I'm porting this import patch to 2.0 for a client, and hopefully we can get this and MDL-22308 pulled into 2.0 master and possibly MOODLE_19_STABLE too.
          Hide
          Jonathan Harker added a comment -

          In the meantime for Moodle 1.9 the three commits on top of http://git.catalyst.net.nz/gw?p=moodle-r2.git;a=shortlog;h=refs/heads/MDL-16660_19 are calendar_test3_fixed.patch from this ticket (author Mark Johnson) plus two commits to update lib/bennu (see MDL-22308).

          Cheers, J

          Show
          Jonathan Harker added a comment - In the meantime for Moodle 1.9 the three commits on top of http://git.catalyst.net.nz/gw?p=moodle-r2.git;a=shortlog;h=refs/heads/MDL-16660_19 are calendar_test3_fixed.patch from this ticket (author Mark Johnson) plus two commits to update lib/bennu (see MDL-22308 ). Cheers, J
          Hide
          Mark Johnson added a comment -

          Thanks very much for your input here Jonathon, I've not had a lot of time to work on this myself recently, so your help in getting this sorted is very much appreciated.

          Show
          Mark Johnson added a comment - Thanks very much for your input here Jonathon, I've not had a lot of time to work on this myself recently, so your help in getting this sorted is very much appreciated.
          Hide
          Jonathan Harker added a comment -
          Show
          Jonathan Harker added a comment - Just to update - pushed another commit on these branches which suppresses a PHP warning: http://git.catalyst.net.nz/gw?p=moodle-r2.git;a=shortlog;h=refs/heads/MDL-16660_19 http://git.catalyst.net.nz/gw?p=moodle-r2.git;a=shortlog;h=refs/heads/MDL-16660_20
          Hide
          Jonathan Harker added a comment -

          Work for a client has expanded this into importing from a URL and having it synced from a cron - WIP at http://git.catalyst.net.nz/gw?p=moodle-r2.git;a=shortlog;h=refs/heads/feature-20-importcalendar

          Show
          Jonathan Harker added a comment - Work for a client has expanded this into importing from a URL and having it synced from a cron - WIP at http://git.catalyst.net.nz/gw?p=moodle-r2.git;a=shortlog;h=refs/heads/feature-20-importcalendar
          Hide
          Derek Chirnside added a comment -

          The Moodle in Schools distribution has this work from Catalyst built in as standard. http://www.moodleinschools.org.nz/forum/topics/5067. Seems to be working well.

          I'm assuming someone has asked for this to be included in Moodle core? Anyone abl to comment?
          -Derek

          Show
          Derek Chirnside added a comment - The Moodle in Schools distribution has this work from Catalyst built in as standard. http://www.moodleinschools.org.nz/forum/topics/5067 . Seems to be working well. I'm assuming someone has asked for this to be included in Moodle core? Anyone abl to comment? -Derek
          Hide
          Mark Hilliard added a comment -

          Would very much like to see this in core, as tech staff who need to upgrade many sites will take a lot of work to install all separately. This really would help Moodle be an integrated part of school's educational website systems too!! Huge vote for putting in CORE.

          Mark H.

          Show
          Mark Hilliard added a comment - Would very much like to see this in core, as tech staff who need to upgrade many sites will take a lot of work to install all separately. This really would help Moodle be an integrated part of school's educational website systems too!! Huge vote for putting in CORE. Mark H.
          Hide
          Ulrike Montgomery added a comment -

          It would be great for our schools in Germany to have this in core

          Show
          Ulrike Montgomery added a comment - It would be great for our schools in Germany to have this in core
          Hide
          Edmund Best added a comment -

          I echo these comments, PLEASE put this in the core distro! Great work by people over a long time, I think that this would massively benefit schools in their distribution of calendar information.

          Show
          Edmund Best added a comment - I echo these comments, PLEASE put this in the core distro! Great work by people over a long time, I think that this would massively benefit schools in their distribution of calendar information.
          Hide
          Jonathan Harker added a comment -

          I'd like to review the feature-20-importcalendar branch and see if needs a bit of a tidy up for core (stuff in local/importcalendar should be moved into core somewhere, for instance). Will add this to the heap

          Show
          Jonathan Harker added a comment - I'd like to review the feature-20-importcalendar branch and see if needs a bit of a tidy up for core (stuff in local/importcalendar should be moved into core somewhere, for instance). Will add this to the heap
          Hide
          Martin Dougiamas added a comment -

          Would be very keen to see this in 2.x ... finished, polished and fun code has the best chance!

          Show
          Martin Dougiamas added a comment - Would be very keen to see this in 2.x ... finished, polished and fun code has the best chance!
          Hide
          Michael de Raadt added a comment -

          Elevating this so that it is likely to get some post-2.1 attention.

          Show
          Michael de Raadt added a comment - Elevating this so that it is likely to get some post-2.1 attention.
          Hide
          Ken Tuley added a comment -

          Thanks for bumping this. I really would like to see this happen and soon. we're about to begin a new school year, and I've got a lot of dates on other calendars. So being able to subscribe to them would be a lot easier than re-entering them in Moodle.

          Show
          Ken Tuley added a comment - Thanks for bumping this. I really would like to see this happen and soon. we're about to begin a new school year, and I've got a lot of dates on other calendars. So being able to subscribe to them would be a lot easier than re-entering them in Moodle.
          Hide
          Mark Hilliard added a comment -

          This would be a very powerful district-wide integration option for schools.

          In business they call this stuff "enterprise" level tools and that's what it really is.

          I estimate 70-80% of schools I worked with had a calender application for the district that really should be integrated with on-line learning tool like Moodle so students/parents would see a "common" calendar. Google Calendar support would easily be most powerful for schools in Midwest US.

          Show
          Mark Hilliard added a comment - This would be a very powerful district-wide integration option for schools. In business they call this stuff "enterprise" level tools and that's what it really is. I estimate 70-80% of schools I worked with had a calender application for the district that really should be integrated with on-line learning tool like Moodle so students/parents would see a "common" calendar. Google Calendar support would easily be most powerful for schools in Midwest US.
          Hide
          Robert Puffer added a comment -

          Sorry to be so contrary and at so late a date but I believe this is the wrong direction. Seems like we're protecting the walled garden and not considering how we can make Moodle resources (events) available in state-of-the-art tools used by others. In the Midwest US (where I'm from) I'm seeing many schools, K-12 and higher ed going to Google Apps for Education. The calendar functionality in Google works tremendously and sharing infrastructure is already in-place. Moodle's calendar has major flaws (try recurring events for a bit) and hasn't seen much work in the past several years (IMO). The API available to Google Apps for Education institutions provides ample functionality in order to publish Moodle course events to a Google "course" calendar which can easily be automatically shared with all course participants (and their parents, if not in Higher Ed).

          Show
          Robert Puffer added a comment - Sorry to be so contrary and at so late a date but I believe this is the wrong direction. Seems like we're protecting the walled garden and not considering how we can make Moodle resources (events) available in state-of-the-art tools used by others. In the Midwest US (where I'm from) I'm seeing many schools, K-12 and higher ed going to Google Apps for Education. The calendar functionality in Google works tremendously and sharing infrastructure is already in-place. Moodle's calendar has major flaws (try recurring events for a bit) and hasn't seen much work in the past several years (IMO). The API available to Google Apps for Education institutions provides ample functionality in order to publish Moodle course events to a Google "course" calendar which can easily be automatically shared with all course participants (and their parents, if not in Higher Ed).
          Hide
          Robert Puffer added a comment -

          Did I forget to mention that Google's feed is quite wonky – never know how frequently the updates will be available?

          Show
          Robert Puffer added a comment - Did I forget to mention that Google's feed is quite wonky – never know how frequently the updates will be available?
          Hide
          Clark Shah-Nelson added a comment -

          Hi Bob,
          Just want to be sure the original intent of this ticket is not lost. The current Moodle calendar can already both be subscribed to and imported into Google calendar, Outlook, or anywhere that accepts ICS/ical feeds (out-going). The purpose here is to establish the reverse direction as well - so that the Moodle calendar can either import or subscribe to a Google calendar (or other ICS/ical file/feed from any other app). Having uni-directional functionality is limiting and is seemingly against standards (ics/ical in/out as Outlook/Google and other calendar programs have). I (and I believe the others who have voted for and commented in favor of this ticket) would simply like to be able to subscribe in Moodle to a campus calendar that is already in existence in another app (regardless of update frequency) so that we don't have to duplicate effort to get these events into Moodle. I respectfully suggest that proposed improvements to other Moodle calendar functionality (such as recurring events) be added in a separate ticket.

          Show
          Clark Shah-Nelson added a comment - Hi Bob, Just want to be sure the original intent of this ticket is not lost. The current Moodle calendar can already both be subscribed to and imported into Google calendar, Outlook, or anywhere that accepts ICS/ical feeds (out-going). The purpose here is to establish the reverse direction as well - so that the Moodle calendar can either import or subscribe to a Google calendar (or other ICS/ical file/feed from any other app). Having uni-directional functionality is limiting and is seemingly against standards (ics/ical in/out as Outlook/Google and other calendar programs have). I (and I believe the others who have voted for and commented in favor of this ticket) would simply like to be able to subscribe in Moodle to a campus calendar that is already in existence in another app (regardless of update frequency) so that we don't have to duplicate effort to get these events into Moodle. I respectfully suggest that proposed improvements to other Moodle calendar functionality (such as recurring events) be added in a separate ticket.
          Hide
          Robert Puffer added a comment -

          Again, I apologize Clark for any lapses in my understanding of Moodle's calendar functionality. As I understand it, Moodle does not export calendars by course to separate URLs which would not provide the functionality I described. A quick check on the Tracker indicates how important (NOT!!) the calendar is in Moodle's overall scheme. It appears that mostly the few things that got fixes out of the enormous number of issues filed had to do with lost functionality in some other portion of Moodle. I might mention again that on the reverse side, when you'd like to have Google export a calendar to iCal, you are even worse off in wondering exactly when its going to happen (maybe anything that starts with a small 'i' isn't on their priority list). I agree with you that the original issue (filed two years ago) was to be able to easily import a campus academic calendar (or some such) into Moodle courses or as Global events and that intent is still a good one – its just far afield from where I believe this issue has headed in the mean time and seems to put a bandaid where a tourniquet might be a better resolution.

          Show
          Robert Puffer added a comment - Again, I apologize Clark for any lapses in my understanding of Moodle's calendar functionality. As I understand it, Moodle does not export calendars by course to separate URLs which would not provide the functionality I described. A quick check on the Tracker indicates how important (NOT!!) the calendar is in Moodle's overall scheme. It appears that mostly the few things that got fixes out of the enormous number of issues filed had to do with lost functionality in some other portion of Moodle. I might mention again that on the reverse side, when you'd like to have Google export a calendar to iCal, you are even worse off in wondering exactly when its going to happen (maybe anything that starts with a small 'i' isn't on their priority list). I agree with you that the original issue (filed two years ago) was to be able to easily import a campus academic calendar (or some such) into Moodle courses or as Global events and that intent is still a good one – its just far afield from where I believe this issue has headed in the mean time and seems to put a bandaid where a tourniquet might be a better resolution.
          Hide
          Robert Puffer added a comment -

          Respectfully, I guess if I had 156 votes and hadn't seen something go into core in over 2-1/2 years, I'd look in another direction for a solution.

          Show
          Robert Puffer added a comment - Respectfully, I guess if I had 156 votes and hadn't seen something go into core in over 2-1/2 years, I'd look in another direction for a solution.
          Hide
          Clark Shah-Nelson added a comment -

          Yes, given that this issue has 156 and the next highest voted item in the entire tracker has 97, and that it has been 2.5 years or so, it does make me question the relative importance and value of the tracker in the larger scheme of new features and improvements to Moodle.
          (Then again, I've only contributed the idea, not the code... so I have plenty of time and patience. Looks like it might make it in by the time I convince the administration to switch from text to Google Calendar.

          At any rate, I still haven't seen any specifics noted that either a) would cause me to not seek the functionality mentioned b) would cause me to unvote for this, c) would cause me to seek another direction or solution, or d) would make me not want to send the NZ Westlake Boys' High School and the Ministry of Education a cake! http://www.moodleinschools.org.nz/forum/topics/5067

          I think we are getting close on this one.

          (BTW, Bob, you are correct, that when exporting from Moodle to Google Calendar - the URL generated is specific to a user, and not a course. Students or instructors can generate a URL to subscribe to in Google calendar that displays their entire Moodle calendar among their google calendars (though only by week, month, or 60 days of upcoming events).

          Show
          Clark Shah-Nelson added a comment - Yes, given that this issue has 156 and the next highest voted item in the entire tracker has 97, and that it has been 2.5 years or so, it does make me question the relative importance and value of the tracker in the larger scheme of new features and improvements to Moodle. (Then again, I've only contributed the idea, not the code... so I have plenty of time and patience. Looks like it might make it in by the time I convince the administration to switch from text to Google Calendar. At any rate, I still haven't seen any specifics noted that either a) would cause me to not seek the functionality mentioned b) would cause me to unvote for this, c) would cause me to seek another direction or solution, or d) would make me not want to send the NZ Westlake Boys' High School and the Ministry of Education a cake! http://www.moodleinschools.org.nz/forum/topics/5067 I think we are getting close on this one. (BTW, Bob, you are correct, that when exporting from Moodle to Google Calendar - the URL generated is specific to a user, and not a course. Students or instructors can generate a URL to subscribe to in Google calendar that displays their entire Moodle calendar among their google calendars (though only by week, month, or 60 days of upcoming events).
          Hide
          Daniel Wahl added a comment -

          Clark please see MDL-22211 for a fix for viewing events further out than 60 day. Unfortunately this is only tested for 1.9, not 2.0 as I wrote it a year and a half ago.

          Show
          Daniel Wahl added a comment - Clark please see MDL-22211 for a fix for viewing events further out than 60 day. Unfortunately this is only tested for 1.9, not 2.0 as I wrote it a year and a half ago.
          Hide
          Petr Škoda added a comment -

          +1 to throw away all the current date/time related + calendar code and start from scratch. This would also require some migration tool that fixes existing sites that use local server time. I personally do not think we could build any reliable solution on top of the current code.

          Show
          Petr Škoda added a comment - +1 to throw away all the current date/time related + calendar code and start from scratch. This would also require some migration tool that fixes existing sites that use local server time. I personally do not think we could build any reliable solution on top of the current code.
          Hide
          Robert Puffer added a comment -

          Petr, the world is constantly changing and I've found something about which we finally agree.

          Show
          Robert Puffer added a comment - Petr, the world is constantly changing and I've found something about which we finally agree.
          Hide
          Jonathan Harker added a comment -

          Why stop at just the calendar code, Petr? If you want to rewrite it, go ahead, but that's surely on a different ticket.

          Show
          Jonathan Harker added a comment - Why stop at just the calendar code, Petr? If you want to rewrite it, go ahead, but that's surely on a different ticket.
          Hide
          Petr Škoda added a comment -

          I said that because there are problems with DST in our custom made date/time library, also we do not store the timezone information properly which creates major problems with repeated events. If you ignore timezones/DST and just use server time it works fine (at least for me), if you configure the DST/timezones then suddenly events are moved, cron events skipped, etc. If we are going to sync our calendar with something that does the things right I am afraid we are going to hit major problems because our & their is not going to match. Then we need to recalculate the server time to real UTC time for all existing data, we can not do it using incorrect routines. This should be done only once and properly, but it of course requires fully tested and working lib date/time support. Why replace the calendar UI code? It should use Ajax.

          Nobody worked on calendar for many years (except some minor cleanup by Sam last year), since the migration to PHP 5.2.x I keep repeating we should do something with the date/time/calendar internals first. I do not see a point in implementing any kind of import/export of calendar events unless we fist make it do the maths properly.

          Show
          Petr Škoda added a comment - I said that because there are problems with DST in our custom made date/time library, also we do not store the timezone information properly which creates major problems with repeated events. If you ignore timezones/DST and just use server time it works fine (at least for me), if you configure the DST/timezones then suddenly events are moved, cron events skipped, etc. If we are going to sync our calendar with something that does the things right I am afraid we are going to hit major problems because our & their is not going to match. Then we need to recalculate the server time to real UTC time for all existing data, we can not do it using incorrect routines. This should be done only once and properly, but it of course requires fully tested and working lib date/time support. Why replace the calendar UI code? It should use Ajax. Nobody worked on calendar for many years (except some minor cleanup by Sam last year), since the migration to PHP 5.2.x I keep repeating we should do something with the date/time/calendar internals first. I do not see a point in implementing any kind of import/export of calendar events unless we fist make it do the maths properly.
          Hide
          Jonathan Harker added a comment -

          It's probably not as big an issue to fix the timezone maths as you seem to think. RFC-4791 is pretty straightforward, and we should be able to force mdl_event table to store UTC in timestart, add a timezone field, and adjust calendar/lib.php code as and where necessary.

          Show
          Jonathan Harker added a comment - It's probably not as big an issue to fix the timezone maths as you seem to think. RFC-4791 is pretty straightforward, and we should be able to force mdl_event table to store UTC in timestart, add a timezone field, and adjust calendar/lib.php code as and where necessary.
          Hide
          Petr Škoda added a comment -

          Yes, fixing the code is possible, but nobody was willing to do that. You need to also upgrade all existing events, module deadlines and any other dates have in code + modify formslib + deal with backup/restore and I am not sure what else comes up.

          This can not be done in stable branch because it will require database and API changes. If somebody does not start coding now it will not be part of Moodle 2.2

          I would really love to see all this fix and import/export working fine, thanks everybody for your participation!

          Show
          Petr Škoda added a comment - Yes, fixing the code is possible, but nobody was willing to do that. You need to also upgrade all existing events, module deadlines and any other dates have in code + modify formslib + deal with backup/restore and I am not sure what else comes up. This can not be done in stable branch because it will require database and API changes. If somebody does not start coding now it will not be part of Moodle 2.2 I would really love to see all this fix and import/export working fine, thanks everybody for your participation!
          Hide
          Jonathan Harker added a comment -

          The intent of this ticket is a simple UI addition to import calendars in Moodle, alongside the existing export. Belly-aching about the quality of the calendar code, while justified, is irrelevant. Petr, if you're seriously recommending throwing out all the calendar code and starting again, then that's a separate ticket for moodle 2 dev. If this is going to happen, then close this ticket and put us all out of our misery. Otherwise, I have a straightforward patch to 2.0 that works that should be easily compressed and rebased.
          http://git.catalyst.net.nz/gw?p=moodle-r2.git;a=shortlog;h=refs/heads/feature-20-importcalendar

          Show
          Jonathan Harker added a comment - The intent of this ticket is a simple UI addition to import calendars in Moodle, alongside the existing export. Belly-aching about the quality of the calendar code, while justified, is irrelevant. Petr, if you're seriously recommending throwing out all the calendar code and starting again, then that's a separate ticket for moodle 2 dev. If this is going to happen, then close this ticket and put us all out of our misery. Otherwise, I have a straightforward patch to 2.0 that works that should be easily compressed and rebased. http://git.catalyst.net.nz/gw?p=moodle-r2.git;a=shortlog;h=refs/heads/feature-20-importcalendar
          Hide
          Jonathan Harker added a comment -

          (requires a squash and rebase)

          Show
          Jonathan Harker added a comment - (requires a squash and rebase)
          Hide
          Dan Marsden added a comment -

          Adding Michael to this (HQ Dev manager) - Michael can you please provide some feedback here? - when is HQ planning to rewrite calendar? - if it's longer than 12months away can we at least get something like this feature in?

          also - attaching link to squashed rebased commit against master (Jonathan any chance you could check this to see if it looks ok?) - I've excluded the lib/bennu changes as it's been upgraded in 2.2 already.

          Show
          Dan Marsden added a comment - Adding Michael to this (HQ Dev manager) - Michael can you please provide some feedback here? - when is HQ planning to rewrite calendar? - if it's longer than 12months away can we at least get something like this feature in? also - attaching link to squashed rebased commit against master (Jonathan any chance you could check this to see if it looks ok?) - I've excluded the lib/bennu changes as it's been upgraded in 2.2 already.
          Hide
          chester folming added a comment -

          This feature (import) and a much improved interface for adding events - is my teachers problem #1 with Moodle.
          We are running three installations for around 3000 teachers and students.
          (We are updating to 2.2+ from 2.0.4 this week, so a 1.9 version is not going to make it)

          Could anybody confirm that ical-import comes with 2.3?

          Show
          chester folming added a comment - This feature (import) and a much improved interface for adding events - is my teachers problem #1 with Moodle. We are running three installations for around 3000 teachers and students. (We are updating to 2.2+ from 2.0.4 this week, so a 1.9 version is not going to make it) Could anybody confirm that ical-import comes with 2.3?
          Hide
          Dan Marsden added a comment -

          Hi Chester, "improved interface for adding events" is probably a different bug in the tracker - there have been discussions around replacing/rewriting the calendar functionality in Moodle but this hasn't been added to any development plan yet (that I've seen)

          This code doesn't come with 2.3 at this stage - but I'm hoping HQ will look at this and make a decision either way - close as won't fix in the current calendar feature and do this when calendar is rewritten/replaced or agree for a patch to go into the existing calendar feature.

          Show
          Dan Marsden added a comment - Hi Chester, "improved interface for adding events" is probably a different bug in the tracker - there have been discussions around replacing/rewriting the calendar functionality in Moodle but this hasn't been added to any development plan yet (that I've seen) This code doesn't come with 2.3 at this stage - but I'm hoping HQ will look at this and make a decision either way - close as won't fix in the current calendar feature and do this when calendar is rewritten/replaced or agree for a patch to go into the existing calendar feature.
          Hide
          Dan Marsden added a comment -

          important to note that the patch provided here works as-is but isn't quite ready for Moodle core inclusion - we don't plan to spend time on this cleaning it up unless we get some form of commitment from HQ that it's possible this can go into core.

          it needs a few small tidy ups related to coding guidelines - it includes a couple of patches for calendar core files that have bugs that cause the import to fail - it's possible these core changes could be handled differently (I don't think we maintain core changes to yui code)

          Show
          Dan Marsden added a comment - important to note that the patch provided here works as-is but isn't quite ready for Moodle core inclusion - we don't plan to spend time on this cleaning it up unless we get some form of commitment from HQ that it's possible this can go into core. it needs a few small tidy ups related to coding guidelines - it includes a couple of patches for calendar core files that have bugs that cause the import to fail - it's possible these core changes could be handled differently (I don't think we maintain core changes to yui code)
          Hide
          Jonathan Harker added a comment -

          This branch has a squashed commit similar to Dan's - but with the constants and language strings moved (and renamed) to the local/importcalendar code, the two other bugs removed (for now) as they should probably be dealt with separately.

          Show
          Jonathan Harker added a comment - This branch has a squashed commit similar to Dan's - but with the constants and language strings moved (and renamed) to the local/importcalendar code, the two other bugs removed (for now) as they should probably be dealt with separately.
          Hide
          chester folming added a comment -

          Hi Dan and Jonathan

          Importing an ics file to the personal calendar works with the patch I downloaded - is there a way of importing the ics file into a course?

          Right now if I am a teacher, I can only import into my own personal calendar, and if I am an admin, I can only import into the global or the personal calendar.

          However the most useful function would be to import into the course calendar..
          (I've made sure that the permission for the teacher role has all calendar permissions allowed).

          Best Regards and thanx for your work on this issue
          Chester Folming

          Show
          chester folming added a comment - Hi Dan and Jonathan Importing an ics file to the personal calendar works with the patch I downloaded - is there a way of importing the ics file into a course? Right now if I am a teacher, I can only import into my own personal calendar, and if I am an admin, I can only import into the global or the personal calendar. However the most useful function would be to import into the course calendar.. (I've made sure that the permission for the teacher role has all calendar permissions allowed). Best Regards and thanx for your work on this issue Chester Folming
          Hide
          chester folming added a comment -

          Could it be achieved (within the frame of this patch) to import into the course calendar?

          Show
          chester folming added a comment - Could it be achieved (within the frame of this patch) to import into the course calendar?
          Hide
          chester folming added a comment -

          I think many do not understand why calendar import is such an important issue.
          Teachers and students all have smart phones, and they are expecting to be able to view their calendar on these devices. However calendars are often partly made elsewhere in other systems, and this information will never get to Moodle unless import to the course is possible.

          With the new mobile interface (and hopefully also soon integrated in the great My Moodle app) calendar upgrades are the single most missing thing. Import could bring the information into Moodle, which is step one in this process (IMO).

          It would be nice to have some comments from the people who decides what goes into core, this issue (MDL-16660) is well voted for, and has been around for a while..

          Anyhow thank you for all the good work - I am not loosing sight of all the great new improvements

          Show
          chester folming added a comment - I think many do not understand why calendar import is such an important issue. Teachers and students all have smart phones, and they are expecting to be able to view their calendar on these devices. However calendars are often partly made elsewhere in other systems, and this information will never get to Moodle unless import to the course is possible. With the new mobile interface (and hopefully also soon integrated in the great My Moodle app) calendar upgrades are the single most missing thing. Import could bring the information into Moodle, which is step one in this process (IMO). It would be nice to have some comments from the people who decides what goes into core, this issue ( MDL-16660 ) is well voted for, and has been around for a while.. Anyhow thank you for all the good work - I am not loosing sight of all the great new improvements
          Hide
          Mark Johnson added a comment -

          While I still agree that calendar importing is an important feature, I think it's dangerous to assume that "Teachers and students all have smart phones" - ours certainly don't. However they still want to be able to import calendars as they want to have access to all institutional data through one system, and since so much of it's already in Moodle it makes sense for that to be the system.

          Show
          Mark Johnson added a comment - While I still agree that calendar importing is an important feature, I think it's dangerous to assume that "Teachers and students all have smart phones" - ours certainly don't. However they still want to be able to import calendars as they want to have access to all institutional data through one system, and since so much of it's already in Moodle it makes sense for that to be the system.
          Hide
          chester folming added a comment -

          Thank you for the reply on calendar import, and why this is important in relation to access from smart phones.

          We give the teachers iphones (95%) and androids (5%). So they all have smart phones.
          Our log indicate that 40% of students daily uses a smart phone to check their mail. So the percentage is probably somewhat higher, since you have to download an app for this.

          I wrote earlier, that the teachers have to be able to import calender files to a course calendar, and not just to his or hers private calendar. As it is today students and teacher shares calendars at google - which means they have to go to two systems. Which also means that they are driven away from Moodle, where everything should be accessible.

          Show
          chester folming added a comment - Thank you for the reply on calendar import, and why this is important in relation to access from smart phones. We give the teachers iphones (95%) and androids (5%). So they all have smart phones. Our log indicate that 40% of students daily uses a smart phone to check their mail. So the percentage is probably somewhat higher, since you have to download an app for this. I wrote earlier, that the teachers have to be able to import calender files to a course calendar, and not just to his or hers private calendar. As it is today students and teacher shares calendars at google - which means they have to go to two systems. Which also means that they are driven away from Moodle, where everything should be accessible.
          Hide
          Jonathan Harker added a comment -

          Hi chester,

          Last time I tested this, you could add subscriptions to the course calendar or any groups you were in (as long as you had the permissions to edit the course or group calendar in question). If you don't see those options in the event type drop-down, can you let me know what version of Moodle you are testing it in? It may be that the code to set that up (importcalendar_get_eventtype_choices function in local/importcalendar/lib.php) has changed since we were testing it in 2.0

          Show
          Jonathan Harker added a comment - Hi chester, Last time I tested this, you could add subscriptions to the course calendar or any groups you were in (as long as you had the permissions to edit the course or group calendar in question). If you don't see those options in the event type drop-down, can you let me know what version of Moodle you are testing it in? It may be that the code to set that up (importcalendar_get_eventtype_choices function in local/importcalendar/lib.php) has changed since we were testing it in 2.0
          Hide
          chester folming added a comment -

          Hi Jonathan

          Thank you for taking the time to reply.
          Our installation works in relation to importing into the personal calendar and if you are an admin - to the global calendar..

          We have installed from:
          http://git.catalyst.net.nz/gw?p=moodle-r2.git;a=commitdiff;h=5cb9820e1da0c8c31ba9d1d2e15132f073616be6
          (I installed the patch by replacing the view.php file in the calendar dir and created the file structure for the other six php-files and placed files accordingly)

          Our Moodle version is: Moodle 2.2.1+ (Build: 20120202)

          It does not seem to be a matter of permissions, since a teacher can create new events in the course calendar, but not import to it via the patch.

          Show
          chester folming added a comment - Hi Jonathan Thank you for taking the time to reply. Our installation works in relation to importing into the personal calendar and if you are an admin - to the global calendar.. We have installed from: http://git.catalyst.net.nz/gw?p=moodle-r2.git;a=commitdiff;h=5cb9820e1da0c8c31ba9d1d2e15132f073616be6 (I installed the patch by replacing the view.php file in the calendar dir and created the file structure for the other six php-files and placed files accordingly) Our Moodle version is: Moodle 2.2.1+ (Build: 20120202) It does not seem to be a matter of permissions, since a teacher can create new events in the course calendar, but not import to it via the patch.
          Hide
          chester folming added a comment -

          Hi Jonathan

          On the matter of not being able to import calendar to course on a new installation Moodle (2.2.1+):

          I tried to see if I could find the problem you implied above, but I had no success.
          Is there any hope that you can find time to look into the problem..?

          Show
          chester folming added a comment - Hi Jonathan On the matter of not being able to import calendar to course on a new installation Moodle (2.2.1+): I tried to see if I could find the problem you implied above, but I had no success. Is there any hope that you can find time to look into the problem..?
          Hide
          Christine Wilson added a comment -

          Has there been any resolution to this? I am looking at Moodle 2.2 and don't see where importing a calendar is an option? As the administrator, I would like to be able to import a calendar rather than having to reinput all of the information again. I would be even better if I could just like it to the google calendar and have it update automatically. Any solution to any of this?

          Show
          Christine Wilson added a comment - Has there been any resolution to this? I am looking at Moodle 2.2 and don't see where importing a calendar is an option? As the administrator, I would like to be able to import a calendar rather than having to reinput all of the information again. I would be even better if I could just like it to the google calendar and have it update automatically. Any solution to any of this?
          Hide
          Dan Marsden added a comment -

          Hi Christine - this feature request is still open, but you're welcome to install the patch linked above to include this functionality on your site.

          Show
          Dan Marsden added a comment - Hi Christine - this feature request is still open, but you're welcome to install the patch linked above to include this functionality on your site.
          Hide
          chester folming added a comment - - edited

          The Calendar import patch is working in principle and is very easy to install.
          However the import to course and group calendar seems not to be working on a new (Build: 20120202) installation, see above.
          This is a serious problem if true, since it is the main functionality..

          You should notice (Christine) I am the only one to report this problem, which according to Jonathan might be related to us running a rather new install of Moodle.
          (Or me being stupid in a not yet disclosed way )
          If others can/cannot reproduce the problem on a new installation - I would like to know - I tried twice on different new servers, with the same result.

          Show
          chester folming added a comment - - edited The Calendar import patch is working in principle and is very easy to install. However the import to course and group calendar seems not to be working on a new (Build: 20120202) installation, see above. This is a serious problem if true, since it is the main functionality.. You should notice (Christine) I am the only one to report this problem, which according to Jonathan might be related to us running a rather new install of Moodle. (Or me being stupid in a not yet disclosed way ) If others can/cannot reproduce the problem on a new installation - I would like to know - I tried twice on different new servers, with the same result.
          Hide
          Jonathan Harker added a comment -

          Hi-

          I've amended this MDL-16660 code to account for a change in the Moodle calendar API in 2.1 onwards, which improves the calendar's course interaction by requiring a course ID parameter rather than fishing it out of the PHP session. I have re-done the all-in-one commit for the master (2.3 dev) candidate branch which includes the fix, as well as added branches for 2.1 and 2.2 folks for convenience. Since the fix is *not required for Moodle 2.0, I have also added a 2.0 branch, which does not include it.

          Note that the 2.0, 2.1 and 2.2 branches are provided for the convenience of users of stable versions, and contain two extra optional commits that fix minor calendar bugs. These are not included in the proposed patch for 2.3 dev above.

          Show
          Jonathan Harker added a comment - Hi- I've amended this MDL-16660 code to account for a change in the Moodle calendar API in 2.1 onwards, which improves the calendar's course interaction by requiring a course ID parameter rather than fishing it out of the PHP session. I have re-done the all-in-one commit for the master (2.3 dev) candidate branch which includes the fix, as well as added branches for 2.1 and 2.2 folks for convenience. Since the fix is *not required for Moodle 2.0, I have also added a 2.0 branch, which does not include it. Note that the 2.0, 2.1 and 2.2 branches are provided for the convenience of users of stable versions, and contain two extra optional commits that fix minor calendar bugs. These are not included in the proposed patch for 2.3 dev above.
          Hide
          Jonathan Harker added a comment -

          Hi Chester - if you apply these changes (diff) to your Moodle 2.2 install, it should make the course and group options reappear in the list.

          Show
          Jonathan Harker added a comment - Hi Chester - if you apply these changes (diff) to your Moodle 2.2 install, it should make the course and group options reappear in the list.
          Hide
          chester folming added a comment -

          The import calendar patch works on Moodle 2.2.1 with the changes you made, thank you very much Jonathan Harker.
          This integrates the calendar on Moodle with our smart phone users - again thank you very much!

          I cannot stress how important it is for us to have this functionality in Moodle.
          I hope that this functionality soon will be part of core (yes I voted for it).

          Show
          chester folming added a comment - The import calendar patch works on Moodle 2.2.1 with the changes you made, thank you very much Jonathan Harker. This integrates the calendar on Moodle with our smart phone users - again thank you very much! I cannot stress how important it is for us to have this functionality in Moodle. I hope that this functionality soon will be part of core (yes I voted for it).
          Hide
          Jonathan Harker added a comment -

          Testing instructions added.

          Show
          Jonathan Harker added a comment - Testing instructions added.
          Hide
          Martin Dougiamas added a comment -

          Dan, can you peer review this? Development seems to have settled down.

          Show
          Martin Dougiamas added a comment - Dan, can you peer review this? Development seems to have settled down.
          Hide
          Martin Dougiamas added a comment -

          Argh, this is a local plugin at the moment and so can't go in core.

          Anyone want to rewrite it as part of the calendar?

          Show
          Martin Dougiamas added a comment - Argh, this is a local plugin at the moment and so can't go in core. Anyone want to rewrite it as part of the calendar?
          Hide
          Dan Poltawski added a comment -

          As mention this is a local plugin at the moment

          Show
          Dan Poltawski added a comment - As mention this is a local plugin at the moment
          Hide
          Dan Marsden added a comment -

          yeah - I was talking with Jonathan about this earlier - we weren't sure "where" that code should end up but it was left there for easy install until planned inclusion in core - where do you think it should go? - I wondered if admin/tools would be a good place but it's not really restricted to admin users.

          Show
          Dan Marsden added a comment - yeah - I was talking with Jonathan about this earlier - we weren't sure "where" that code should end up but it was left there for easy install until planned inclusion in core - where do you think it should go? - I wondered if admin/tools would be a good place but it's not really restricted to admin users.
          Hide
          Dan Poltawski added a comment -

          Can it not be 'part of' calendar?

          Show
          Dan Poltawski added a comment - Can it not be 'part of' calendar?
          Hide
          Jonathan Harker added a comment -

          I'll move it into calendar/lib - I assume the db update can be condensed into one upgrade in lib/db?

          Show
          Jonathan Harker added a comment - I'll move it into calendar/lib - I assume the db update can be condensed into one upgrade in lib/db?
          Hide
          Erica Bithell added a comment -

          I've successfully installed these patches on a Moodle 2.2 installation and mostly this looks excellent with our Google calendar events. However I have a permissions issue (the calendar permissions are set at their defaults). Our Moodle is login-only i.e. no guests. I have added a calendar at site level, and my 'test user' with ordinary privileges sees the calendar and what I would expect in the import dropdown menu i.e. user events only if they enter the calendar from the front page (whereas I, as admin, see the option to import to both user and global events). This user is also (correctly) unable to edit any individual events, whereas I as admin am able to do so. However the authorised user IS able to see and use both the update and the remove buttons in the list of calendars. When they click 'remove', the globally-added calendar disappears site-wide, for all users. This does not seem to be the expected behaviour, and it is certainly not desirable! I'm not really a coder - I might be able to fix this for my own site but doubt that I could deal with it in a way robust enough to create a more widely usable patch. Could someone more competent that me look into this? Thanks!

          Show
          Erica Bithell added a comment - I've successfully installed these patches on a Moodle 2.2 installation and mostly this looks excellent with our Google calendar events. However I have a permissions issue (the calendar permissions are set at their defaults). Our Moodle is login-only i.e. no guests. I have added a calendar at site level, and my 'test user' with ordinary privileges sees the calendar and what I would expect in the import dropdown menu i.e. user events only if they enter the calendar from the front page (whereas I, as admin, see the option to import to both user and global events). This user is also (correctly) unable to edit any individual events, whereas I as admin am able to do so. However the authorised user IS able to see and use both the update and the remove buttons in the list of calendars. When they click 'remove', the globally-added calendar disappears site-wide, for all users. This does not seem to be the expected behaviour, and it is certainly not desirable! I'm not really a coder - I might be able to fix this for my own site but doubt that I could deal with it in a way robust enough to create a more widely usable patch. Could someone more competent that me look into this? Thanks!
          Hide
          Derek Chirnside added a comment -

          @Dan and @Martin.
          technically speaking, what is wrong if this is a 'local' plugin? What is the difference between a local and a non-local plugin?

          -Derek

          Show
          Derek Chirnside added a comment - @Dan and @Martin. technically speaking, what is wrong if this is a 'local' plugin? What is the difference between a local and a non-local plugin? -Derek
          Hide
          Martin Dougiamas added a comment - - edited

          The local plugins area is, by definition, reserved for generic plugins created locally on a site. It's not a place for core functionality. Admins need a safe place for such custom stuff and that is it.

          It's not even intended for plugins that are to be shared (there are 25 other places for those) but even so, some do:

          http://moodle.org/plugins/browse.php?list=category&id=18

          Show
          Martin Dougiamas added a comment - - edited The local plugins area is, by definition, reserved for generic plugins created locally on a site. It's not a place for core functionality. Admins need a safe place for such custom stuff and that is it. It's not even intended for plugins that are to be shared (there are 25 other places for those) but even so, some do: http://moodle.org/plugins/browse.php?list=category&id=18
          Hide
          Anthony Borrow added a comment -

          Martin - I'm not sure that I understand what you mean that local plugins are "not even intended for plugins that are to be shared". Would you mind giving an example or highlighting one that seems to make an appropriate use of the local plugins area and perhaps one that is less than ideal? Peace - Anthony

          Show
          Anthony Borrow added a comment - Martin - I'm not sure that I understand what you mean that local plugins are "not even intended for plugins that are to be shared". Would you mind giving an example or highlighting one that seems to make an appropriate use of the local plugins area and perhaps one that is less than ideal? Peace - Anthony
          Hide
          Jonathan Harker added a comment -

          Just about done here - two questions, where do I put a calendar cron job, and shall I just update lib/db upgrade and install directly using the code from the XMLDB schema thingy?

          Show
          Jonathan Harker added a comment - Just about done here - two questions, where do I put a calendar cron job, and shall I just update lib/db upgrade and install directly using the code from the XMLDB schema thingy?
          Hide
          Martin Dougiamas added a comment -

          Calendar is so central I think it could just go straight into cron.php

          And yes, the db changes would be in /lib/db.

          Show
          Martin Dougiamas added a comment - Calendar is so central I think it could just go straight into cron.php And yes, the db changes would be in /lib/db.
          Hide
          Jonathan Harker added a comment -

          Updated master candidate branch. Moved pretty much everything to core calendar/lib.php, added calendar cron call to lib/cronlib.php, updated lib/db as appropriate, new savepoint at 2012053000.00

          Show
          Jonathan Harker added a comment - Updated master candidate branch. Moved pretty much everything to core calendar/lib.php, added calendar cron call to lib/cronlib.php, updated lib/db as appropriate, new savepoint at 2012053000.00
          Hide
          Jonathan Harker added a comment -

          Hi - not sure how to make a PULL request; it might want a quick round of peer review anyway?

          Show
          Jonathan Harker added a comment - Hi - not sure how to make a PULL request; it might want a quick round of peer review anyway?
          Hide
          Dan Poltawski added a comment -

          You made it into a request for integration review, which is a pull request.

          I'm converting it into a peer review request.

          Show
          Dan Poltawski added a comment - You made it into a request for integration review, which is a pull request. I'm converting it into a peer review request.
          Hide
          chester folming added a comment - - edited

          Hi - Thank you for working hard on this!

          I have an issue where imported events, from an ics import, will not remain in the calendar. After an hour or so they will disappear again. I would like to resolve the issue, and were thinking that the best solution would be to do a new install from your latest submission.

          However we are on 2.2.1 (Build: 20120202) so I suppose I cannot use the newest MDL-16660_23_2 version?
          We will not be able to update to 2.3 before the summer break..

          Assuming MDL-16660_23_2 can only be installed on a 2.3 server, can you from my description above - tell what needs to be corrected on our server..?

          Show
          chester folming added a comment - - edited Hi - Thank you for working hard on this! I have an issue where imported events, from an ics import, will not remain in the calendar. After an hour or so they will disappear again. I would like to resolve the issue, and were thinking that the best solution would be to do a new install from your latest submission. However we are on 2.2.1 (Build: 20120202) so I suppose I cannot use the newest MDL-16660 _23_2 version? We will not be able to update to 2.3 before the summer break.. Assuming MDL-16660 _23_2 can only be installed on a 2.3 server, can you from my description above - tell what needs to be corrected on our server..?
          Hide
          Jonathan Harker added a comment -

          I'm not sure how much peer review it really needs since all I've done is

          • relocate the code from /local/importcalendar to /calendar/lib.php,
          • move the language strings into lang/en/calendar.php,
          • tweak the cron code in lib/cronlib.php to run the cron function now in calendar/lib.php,
          • move the db schema stuff to lib/db, and
          • test both a new install and an upgrade to make sure it works correctly, which it does.
          Show
          Jonathan Harker added a comment - I'm not sure how much peer review it really needs since all I've done is relocate the code from /local/importcalendar to /calendar/lib.php, move the language strings into lang/en/calendar.php, tweak the cron code in lib/cronlib.php to run the cron function now in calendar/lib.php, move the db schema stuff to lib/db, and test both a new install and an upgrade to make sure it works correctly, which it does.
          Hide
          Jonathan Harker added a comment -

          Ping?

          Show
          Jonathan Harker added a comment - Ping?
          Hide
          Dan Poltawski added a comment -

          Hi Jonathan,

          Won't get a chance to look at this till after 2.3 is out of the door.

          cheers,
          dan

          Show
          Dan Poltawski added a comment - Hi Jonathan, Won't get a chance to look at this till after 2.3 is out of the door. cheers, dan
          Hide
          Martin Dougiamas added a comment -

          And here we are! We should try and land this in 2.4 as soon as 2.3.1 is released.

          Show
          Martin Dougiamas added a comment - And here we are! We should try and land this in 2.4 as soon as 2.3.1 is released.
          Hide
          Jonathan Harker added a comment -

          New m4 rebase on master.

          Show
          Jonathan Harker added a comment - New m4 rebase on master.
          Hide
          Jonathan Harker added a comment -
          Show
          Jonathan Harker added a comment - A start at the user documentation here: http://docs.moodle.org/dev/User:Jonathan_Harker/Import_Calendar
          Hide
          Dan Poltawski added a comment -

          Really sorry I have been slack with getting this reviewed. I haven't [completely] forgotten about it, hope to look at it when I come back from hol.

          Show
          Dan Poltawski added a comment - Really sorry I have been slack with getting this reviewed. I haven't [completely] forgotten about it, hope to look at it when I come back from hol.
          Hide
          Dan Poltawski added a comment -

          Hi Jonathan,

          Once again, sorry for my slow feedback on this.

          I've had an initial look at this, mostly focusing on the code as it is there and not how it all works together and interacts. Note that i'm not that familiar with calendar other than I know its not a very pretty sight.. So some of these comments may be related to existing calendar things.

          It seems like there are still a good few basic things (e.g. hardcoded english strings) which need to be looked at in order to get this ready to be core integrated.

          One thing which was not immediately obvious to me is how this dealt with existing events, collisions, date changes and things? How does it deal with changes to event times etc?

          Here are my notes about the code as it is (like I say, really focusing on the code as it is in my editor, rather than the wider picture):

          1. calendar/lib.php:
            1. This is against moodle coding style Not Moodle style require_once "{$CFG->libdir}/bennu/bennu.inc.php";
            2. Note to self: I have a funny feeling that calendar/lib.php is included by the world and dog, is this additional bennu include gonna have a perf impact. Worth Checking the include stack?
          2. calendar_get_eventtype_choices:
            1. Missing proper phpdoc
            2. $choices[1] is depdning on a SITEID of 1, that is not the case for all sites.
          3. calendar_addsubscription_form{}
            1. There are hardcoded english strings throughout this. Need to be converted to proper strings and get_string calls..
            2. Use of optional param is highly unusual in a form like that. Should this be definition_after_data or a form item itself.
            3. file_get_contents() won't use moodle settings for proxy etc. Needs to use a filelib function.
            4. Inline javascript needs to be converted to a more modern style, rather than use this javascript popup, why not keep it simple and move this form to its own page? Then wed have a proper place to go after the import too.
          4. calendar_add_icalendar_event{}
            1. Uses PARAM_CLEAN where more specific cleaning can be done. From the definition of PARAM CLEAN is 'obsoleted, please use a more specific type of parameter.'
          5. calendar_show_subscriptions
            1. In general this function seems fairly unweildy
            2. Again optional_param inline in functions is generally discouraged I don't know if this is necessary here.
            3. Variables with underscores is against Moodle coding style (See http://docs.moodle.org/dev/Coding_style#Variables)
            4. There are hardcoded english strings throughout this. Need to be converted to proper strings and get_string calls..
            5. I think you need to convert date -> userdate to get propre localised date
          6. calendar_import_icalendar_events:
            1. ini_set('max_execution_time', 300); -> set_time_limit()
            2. Inline english algnugage strings
            3. Needs a space after the foreach foreach($ical->components['VEVENT'] as $event) {
          7. calendar_update_subscription_events
            1. Inline english language strings
          8. calendar_cron
            1. It'd be clearer if you took out the DB statement from inside the foreach (and be more moodle coding style compliant)

          Also, when I was playing in DEBUG_DEVELOPER mode with this, I encountered a number of E_STRICT problems

          Show
          Dan Poltawski added a comment - Hi Jonathan, Once again, sorry for my slow feedback on this. I've had an initial look at this, mostly focusing on the code as it is there and not how it all works together and interacts. Note that i'm not that familiar with calendar other than I know its not a very pretty sight.. So some of these comments may be related to existing calendar things. It seems like there are still a good few basic things (e.g. hardcoded english strings) which need to be looked at in order to get this ready to be core integrated. One thing which was not immediately obvious to me is how this dealt with existing events, collisions, date changes and things? How does it deal with changes to event times etc? Here are my notes about the code as it is (like I say, really focusing on the code as it is in my editor, rather than the wider picture): calendar/lib.php: This is against moodle coding style Not Moodle style require_once "{$CFG->libdir}/bennu/bennu.inc.php"; Note to self: I have a funny feeling that calendar/lib.php is included by the world and dog, is this additional bennu include gonna have a perf impact. Worth Checking the include stack? calendar_get_eventtype_choices: Missing proper phpdoc $choices [1] is depdning on a SITEID of 1, that is not the case for all sites. calendar_addsubscription_form{} There are hardcoded english strings throughout this. Need to be converted to proper strings and get_string calls.. Use of optional param is highly unusual in a form like that. Should this be definition_after_data or a form item itself. file_get_contents() won't use moodle settings for proxy etc. Needs to use a filelib function. Inline javascript needs to be converted to a more modern style, rather than use this javascript popup, why not keep it simple and move this form to its own page? Then wed have a proper place to go after the import too. calendar_add_icalendar_event{} Uses PARAM_CLEAN where more specific cleaning can be done. From the definition of PARAM CLEAN is 'obsoleted, please use a more specific type of parameter.' calendar_show_subscriptions In general this function seems fairly unweildy Again optional_param inline in functions is generally discouraged I don't know if this is necessary here. Variables with underscores is against Moodle coding style (See http://docs.moodle.org/dev/Coding_style#Variables ) There are hardcoded english strings throughout this. Need to be converted to proper strings and get_string calls.. I think you need to convert date -> userdate to get propre localised date calendar_import_icalendar_events: ini_set('max_execution_time', 300); -> set_time_limit() Inline english algnugage strings Needs a space after the foreach foreach($ical->components ['VEVENT'] as $event) { calendar_update_subscription_events Inline english language strings calendar_cron It'd be clearer if you took out the DB statement from inside the foreach (and be more moodle coding style compliant) Also, when I was playing in DEBUG_DEVELOPER mode with this, I encountered a number of E_STRICT problems
          Hide
          Dan Poltawski added a comment -

          Ps. I rebased your branch on latest master here: git://github.com/danpoltawski/moodle/ MDL-16660_m4-rebased

          Show
          Dan Poltawski added a comment - Ps. I rebased your branch on latest master here: git://github.com/danpoltawski/moodle/ MDL-16660 _m4-rebased
          Hide
          Dan Poltawski added a comment -

          Fatal error: Class 'moodleform' not found in /Users/danp/git/moodle/calendar/lib.php on line 2684

          Show
          Dan Poltawski added a comment - Fatal error: Class 'moodleform' not found in /Users/danp/git/moodle/calendar/lib.php on line 2684
          Show
          Dan Poltawski added a comment - ( http://dan.moodle.local/moodle/login/logout.php?sesskey=ZE9aqvOzad )
          Hide
          Marcin Stanowski added a comment -

          After I applied the patch I can no longer add any modules, blocks, after hitting admin/index.php fatal error mentioned by Dan appears.

          Show
          Marcin Stanowski added a comment - After I applied the patch I can no longer add any modules, blocks, after hitting admin/index.php fatal error mentioned by Dan appears.
          Hide
          chester folming added a comment -

          This feature seems to have lost attention when moved from Moodle 2.3.2 to 2.3.3..?

          Please put priority on this, not just because of the votes - probably a lot of administrators (like me) have said again and again to staff that this feature is coming. It has been a hope since 2008 - and it seems possible from what I read above.

          It is so important and it has been increasingly important since the smart phone became popular..
          Please don't forget this - I have lost a lot of credit from sharing the hope that this would be possible in Moodle 2.3.2.

          My persistence on this subject might be annoying, but then please look at the votes for this feature.

          Show
          chester folming added a comment - This feature seems to have lost attention when moved from Moodle 2.3.2 to 2.3.3..? Please put priority on this, not just because of the votes - probably a lot of administrators (like me) have said again and again to staff that this feature is coming. It has been a hope since 2008 - and it seems possible from what I read above. It is so important and it has been increasingly important since the smart phone became popular.. Please don't forget this - I have lost a lot of credit from sharing the hope that this would be possible in Moodle 2.3.2. My persistence on this subject might be annoying, but then please look at the votes for this feature.
          Hide
          Martin Dougiamas added a comment -

          I have been telling everyone this is going to be in 2.4. FOr this to happen it needs to

          a) have Dan's identified problems fixed. Jonathan are you able to do this?

          b) be submitted for integration by next week so it gets in before code freeze.

          Show
          Martin Dougiamas added a comment - I have been telling everyone this is going to be in 2.4. FOr this to happen it needs to a) have Dan's identified problems fixed. Jonathan are you able to do this? b) be submitted for integration by next week so it gets in before code freeze.
          Hide
          Jonathan Harker added a comment -

          I don't have time to finish this by next week, as I'm working on a DSpace repository plug-in for the next two weeks. However I have rebased the commit onto latest master and started to address some of the issues on a WIP commit on top - see the wip-jh-MDL-16660 branch.

          I agree that the add/view/manage calendar subscriptions form(s) should be on their own page. I have to leave that for hopefully another dev (maybe at the Octoberhackfest?)

          Things addressed:

          • lang strings extracted out
          • fixed E_STRICT error about uninitialised objects in calendar_show_subscriptions()
          • The rest of the E_STRICT errors I found are coming from lib/bennu, which is independent of this task, but should nevertheless be addressed; I'll create a separate task. How much of a showstopper is it?
            Example

            Non-static method Bennu::generate_guid() should not be called statically,
            assuming $this from incompatible context in
            /home/johnno/Projects/moodle/lib/bennu/iCalendar_properties.php on line 974

          • variable names fixed in calendar_show_subscriptions()
          • wayward foreach() now correctly spaced
          • userdate() now used in the subscription list
          • A few threadbare doc-strings updated
          • I didn't realise "doing {$this}" was frowned upon, changed
          • The Moodle download_file_contents() function now used to fetch external .ics URLs, respecting proxies etc.
          • use PARAM_NOTAGS instead of PARAM_CLEAN to sanitise the event strings
          • require_once, include, et al. are not functions, use of () unnecessary, but changed anyway
          • SITEID now used for global events
          • cron function tidied up
          • Bug: eventmanager.js - YUI was unnecessarily raising a fatal exception, killing all subsequent page Javascript execution. The error is handled further up the chain in initializer() anyway (line 19).
          Show
          Jonathan Harker added a comment - I don't have time to finish this by next week, as I'm working on a DSpace repository plug-in for the next two weeks. However I have rebased the commit onto latest master and started to address some of the issues on a WIP commit on top - see the wip-jh-MDL-16660 branch. I agree that the add/view/manage calendar subscriptions form(s) should be on their own page. I have to leave that for hopefully another dev (maybe at the Octoberhackfest?) Things addressed: lang strings extracted out fixed E_STRICT error about uninitialised objects in calendar_show_subscriptions() The rest of the E_STRICT errors I found are coming from lib/bennu, which is independent of this task, but should nevertheless be addressed; I'll create a separate task. How much of a showstopper is it? Example Non-static method Bennu::generate_guid() should not be called statically, assuming $this from incompatible context in /home/johnno/Projects/moodle/lib/bennu/iCalendar_properties.php on line 974 variable names fixed in calendar_show_subscriptions() wayward foreach() now correctly spaced userdate() now used in the subscription list A few threadbare doc-strings updated I didn't realise "doing {$this}" was frowned upon, changed The Moodle download_file_contents() function now used to fetch external .ics URLs, respecting proxies etc. use PARAM_NOTAGS instead of PARAM_CLEAN to sanitise the event strings require_once, include, et al. are not functions, use of () unnecessary, but changed anyway SITEID now used for global events cron function tidied up Bug: eventmanager.js - YUI was unnecessarily raising a fatal exception, killing all subsequent page Javascript execution. The error is handled further up the chain in initializer() anyway (line 19).
          Hide
          Jonathan Harker added a comment -

          Created MDL-36015 for E_STRICT errors in lib/bennu - can someone please review its severity status etc.

          Show
          Jonathan Harker added a comment - Created MDL-36015 for E_STRICT errors in lib/bennu - can someone please review its severity status etc.
          Hide
          Sam Hemelryk added a comment -

          Hi Jonathan,

          Just letting you know Martin asked me to check this out if I found a bit of time. I've started looking at it now and will produce a commit tidying up and fixing a couple of things based upon the branch you mentioned above wip-jh-MDL-16660.
          I'll try have something up in the next couple of days so that we can get Dan to look again when he is back.
          I'll ping you if I have any Q's about things.

          Many thanks
          Sam

          Show
          Sam Hemelryk added a comment - Hi Jonathan, Just letting you know Martin asked me to check this out if I found a bit of time. I've started looking at it now and will produce a commit tidying up and fixing a couple of things based upon the branch you mentioned above wip-jh- MDL-16660 . I'll try have something up in the next couple of days so that we can get Dan to look again when he is back. I'll ping you if I have any Q's about things. Many thanks Sam
          Hide
          Sam Hemelryk added a comment -

          Ok I think this is probably ready for a peer-review again:

          Repo: git://github.com/samhemelryk/moodle.git
          Branch: wip-MDL-16660-m24
          Diff: https://github.com/samhemelryk/moodle/compare/wip-MDL-16660-m24
          

          The following is copied from the commit message (notes what I've changed here):

          • Added a bit of AMOS to copy existing strings and save a little translation effort
          • Cleaned up fixed strings in several places
          • Cleaned up some existing strings as required.
          • Fixed install and upgrade code. Split upgrade into two parts (one for each table).
          • Fixed fatal error caused by missing forms lib inclusion
          • Added param types to forms.
          • Converted file_get_content to use curl for URL's.
          • Cleaned things up per coding style.
          • Separated subscription management and form into separate files.
          • Tidied up bennu inclusion to just where required.
          • Lots of other small fixes as well.

          Cheers
          Sam

          Show
          Sam Hemelryk added a comment - Ok I think this is probably ready for a peer-review again: Repo: git://github.com/samhemelryk/moodle.git Branch: wip-MDL-16660-m24 Diff: https://github.com/samhemelryk/moodle/compare/wip-MDL-16660-m24 The following is copied from the commit message (notes what I've changed here): Added a bit of AMOS to copy existing strings and save a little translation effort Cleaned up fixed strings in several places Cleaned up some existing strings as required. Fixed install and upgrade code. Split upgrade into two parts (one for each table). Fixed fatal error caused by missing forms lib inclusion Added param types to forms. Converted file_get_content to use curl for URL's. Cleaned things up per coding style. Separated subscription management and form into separate files. Tidied up bennu inclusion to just where required. Lots of other small fixes as well. Cheers Sam
          Hide
          Sam Hemelryk added a comment -

          Assigned to myself so that I could move this into the peer-review queue.

          Show
          Sam Hemelryk added a comment - Assigned to myself so that I could move this into the peer-review queue.
          Hide
          Jonathan Harker added a comment -

          Only a minor thing, but filelib has download_file_content($url) which does all the curl bit for you, respecting the Moodle proxy settings and whatnot, which saves you having to instantiate new curl() objects.

          Show
          Jonathan Harker added a comment - Only a minor thing, but filelib has download_file_content($url) which does all the curl bit for you, respecting the Moodle proxy settings and whatnot, which saves you having to instantiate new curl() objects.
          Hide
          Dan Poltawski added a comment -

          Sending all 'waiting for peer review' issues to integration before freeze, as agreed in Integrators Meeting 19/10/12. We are doing this to ensure any 'integratable issues' will not got missed before freeze..

          Show
          Dan Poltawski added a comment - Sending all 'waiting for peer review' issues to integration before freeze, as agreed in Integrators Meeting 19/10/12. We are doing this to ensure any 'integratable issues' will not got missed before freeze..
          Hide
          Dan Poltawski added a comment -

          Sam: seems like your branch has disappeared here.

          Show
          Dan Poltawski added a comment - Sam: seems like your branch has disappeared here.
          Hide
          Sam Hemelryk added a comment -

          Hi Dan, branch is back up there now. Not sure what went wrong there but I couldn't find it on my local machine either.
          Luckily I was saved by git reflog. God bless git.

          Show
          Sam Hemelryk added a comment - Hi Dan, branch is back up there now. Not sure what went wrong there but I couldn't find it on my local machine either. Luckily I was saved by git reflog. God bless git.
          Hide
          Martin Dougiamas added a comment -

          Thank Git for that.

          Show
          Martin Dougiamas added a comment - Thank Git for that.
          Hide
          Dan Poltawski added a comment - - edited

          Thanks everyone for your work, input and votes on this issue, its integrated now!

          There is still work left to be done though:

          1/ We desperately need more testing instrucitons covering more paths for this feature (especially for QA tests). Help with the docs for this feature and heavy testing to iron out the kinks.

          2/ As far as I can tell there is no indication of the source of the calendar events when imported. This means that event imported can be edited by the teacher, then updated again and then the teachers changes will be updated without warnings. We have the susbscriptionid in the DB, so I suppose this is an easy fix. As MD said "a little "ical" tag on all the events and no editing allowed". MDL-36276.

          On the code:

          • I got rid of get_ical_data() as the code path for using download_file_content was never been called and would be different to the curl download path. It seemed simpler to remove and simplify the code.
          • $eventrecord->groupid = 0; // TODO: ???
          • I removed the translation of cronjob strings, since this is not required.
          Show
          Dan Poltawski added a comment - - edited Thanks everyone for your work, input and votes on this issue, its integrated now! There is still work left to be done though: 1/ We desperately need more testing instrucitons covering more paths for this feature (especially for QA tests). Help with the docs for this feature and heavy testing to iron out the kinks. 2/ As far as I can tell there is no indication of the source of the calendar events when imported. This means that event imported can be edited by the teacher, then updated again and then the teachers changes will be updated without warnings. We have the susbscriptionid in the DB, so I suppose this is an easy fix. As MD said "a little "ical" tag on all the events and no editing allowed". MDL-36276 . On the code: I got rid of get_ical_data() as the code path for using download_file_content was never been called and would be different to the curl download path. It seemed simpler to remove and simplify the code. $eventrecord->groupid = 0; // TODO: ??? I removed the translation of cronjob strings, since this is not required.
          Hide
          Rajesh Taneja added a comment -

          Works Great Sam,

          Few things which you might want to fix:

          1. Poll interval can't be updated. Clicking update sets poll interval to never (0)
            • Add ical subscription with "Poll interval" to hourly
            • Change poll to weekly, and click update. Poll is set to never.
          2. Poll interval is not disabled for Calender File. As there is no poll interval for file import, I think "Poll interval" should be disabled with "Calendar URL" field.
          3. Unrelated issue (Just for reference): Event link on calender block have html (&) url, which never let user jump to correct event.

          Passing this as the above problems are trivial and can be solved in another bug.

          Show
          Rajesh Taneja added a comment - Works Great Sam, Few things which you might want to fix: Poll interval can't be updated. Clicking update sets poll interval to never (0) Add ical subscription with "Poll interval" to hourly Change poll to weekly, and click update. Poll is set to never. Poll interval is not disabled for Calender File . As there is no poll interval for file import, I think "Poll interval" should be disabled with "Calendar URL" field. Unrelated issue (Just for reference): Event link on calender block have html (&) url, which never let user jump to correct event. Passing this as the above problems are trivial and can be solved in another bug.
          Hide
          Dan Poltawski added a comment -

          Hurray!

          You did it, congratulations! You have on Mojito credit to redeem after the release of Moodle 2.4

          Show
          Dan Poltawski added a comment - Hurray! You did it, congratulations! You have on Mojito credit to redeem after the release of Moodle 2.4
          Hide
          Helen Foster added a comment -

          I've just been checking out this new feature in order to write some QA tests for it. Great work everybody!

          Raj, I noticed the same things as you with regard to the poll interval and so created MDL-36351 and MDL-36352 for them.

          Show
          Helen Foster added a comment - I've just been checking out this new feature in order to write some QA tests for it. Great work everybody! Raj, I noticed the same things as you with regard to the poll interval and so created MDL-36351 and MDL-36352 for them.
          Hide
          chester folming added a comment -

          Thank you so much guys, next week we will start our testing, maybe contributing to the new (spin off) issues.
          This is a huge new improvement, thank you..!

          Show
          chester folming added a comment - Thank you so much guys, next week we will start our testing, maybe contributing to the new (spin off) issues. This is a huge new improvement, thank you..!
          Hide
          Rajesh Taneja added a comment -

          Thanks Helen.

          Show
          Rajesh Taneja added a comment - Thanks Helen.
          Hide
          Helen Foster added a comment -

          I also discovered that invalid file formats are accepted and reported the problem as MDL-36400.

          Show
          Helen Foster added a comment - I also discovered that invalid file formats are accepted and reported the problem as MDL-36400 .
          Hide
          Helen Foster added a comment -

          Just noting a couple of language string improvements added to en_fix, as agreed with Sam:

          'Poll' and 'Poll interval' changed to 'Update' and 'Update interval' respectively to make them more easily understood.

          Show
          Helen Foster added a comment - Just noting a couple of language string improvements added to en_fix, as agreed with Sam: 'Poll' and 'Poll interval' changed to 'Update' and 'Update interval' respectively to make them more easily understood.
          Hide
          Helen Foster added a comment -

          I'm removing the qa_test_required label as this issue now has some QA tests: MDLQA-4580, MDLQA-4581, MDLQA-4593, MDLQA-4594 (Note that these are QA test master copies which will be cloned for upcoming QA cycles.)

          The poll/update interval setting is not covered in a QA test, as I couldn't think of an easy way to test it.

          If anyone thinks more QA tests are needed for this new feature, please comment and re-add the qa_test_required label.

          Show
          Helen Foster added a comment - I'm removing the qa_test_required label as this issue now has some QA tests: MDLQA-4580 , MDLQA-4581 , MDLQA-4593 , MDLQA-4594 (Note that these are QA test master copies which will be cloned for upcoming QA cycles.) The poll/update interval setting is not covered in a QA test, as I couldn't think of an easy way to test it. If anyone thinks more QA tests are needed for this new feature, please comment and re-add the qa_test_required label.
          Hide
          Gehrt Delius added a comment -

          Importing the following iCal-URL doesn't work on 2.4beta from today:

          http://www.schulferien.org/iCal/Ferien/icals/Ferien_Nordrhein_Westfalen_2013.ics

          Show
          Gehrt Delius added a comment - Importing the following iCal-URL doesn't work on 2.4beta from today: http://www.schulferien.org/iCal/Ferien/icals/Ferien_Nordrhein_Westfalen_2013.ics
          Hide
          Ankit Agarwal added a comment -

          Hi Gehrt,
          It looks like MDL-36592 is responsible for that. I will have a deeper look once I start working on that issue.
          Thanks

          Show
          Ankit Agarwal added a comment - Hi Gehrt, It looks like MDL-36592 is responsible for that. I will have a deeper look once I start working on that issue. Thanks
          Hide
          Helen Foster added a comment -

          I'm removing the docs_required label as this feature is now documented: http://docs.moodle.org/en/Calendar_import

          Show
          Helen Foster added a comment - I'm removing the docs_required label as this feature is now documented: http://docs.moodle.org/en/Calendar_import
          Hide
          chester folming added a comment - - edited

          Location is not imported to Moodle calendar, maybe there is a double import of calendar title..?

          I added MDL-37624 which explains the problem, and double tested this with iCal (mac) and Gmail calendar.
          Both iCal and Gmail calendar will show locaion from the same file.

          A developer checked if he could make a local fix for us, but said the location information was not imported at all.

          Show
          chester folming added a comment - - edited Location is not imported to Moodle calendar, maybe there is a double import of calendar title..? I added MDL-37624 which explains the problem, and double tested this with iCal (mac) and Gmail calendar. Both iCal and Gmail calendar will show locaion from the same file. A developer checked if he could make a local fix for us, but said the location information was not imported at all.
          Hide
          chester folming added a comment - - edited

          This thread seems to have a large group of administrators and core developers interested in the calendar functions.
          I would like to ask your opinion on MDL-37624, and maybe be part of progressing this into development.
          (I am myself the administrator of an installation of 4500 users and some 100+ teachers).

          The problem:
          Today location is missing in Moodle, both when creating a new event and when importing events (calendars) into Moodle. I think this needs to be solved since Moodle with import now can be part of a calendar flow.

          Our staff creates calendars in their mail application, and some guest lecturers create them in gmail.
          Some actually also create calendars in Moodle, but in all cases, communication to the full standard is not possible at this point. This is what would be important to get solved..

          Show
          chester folming added a comment - - edited This thread seems to have a large group of administrators and core developers interested in the calendar functions. I would like to ask your opinion on MDL-37624 , and maybe be part of progressing this into development. (I am myself the administrator of an installation of 4500 users and some 100+ teachers). The problem: Today location is missing in Moodle, both when creating a new event and when importing events (calendars) into Moodle. I think this needs to be solved since Moodle with import now can be part of a calendar flow. Our staff creates calendars in their mail application, and some guest lecturers create them in gmail. Some actually also create calendars in Moodle, but in all cases, communication to the full standard is not possible at this point. This is what would be important to get solved..