iCal export feature for calendar (strictly for TEST PURPOSES ONLY!)
Take the attached file and drop it into /moodle/calendar/ and then see how it works for you just by accessing http://......./moodle/calendar/ical.php - you should be able to download the upcoming 60 days' events (max of 1000 events) in iCal format.
DISCLAIMER: This is not guaranteed in any sense! In particular, although the data loads perfectly well into "PHPicalendar", I can't get it to load into Oracle Calendar (which claims to be able to load iCal data). I don't have a phone/PDA to test it on. I believe that the output is perfectly valid iCal 2.0 data, though.
If anyone feels like reporting back on how well this works on phones/PDAs/Apple iCal, please do.
Re: iCal export feature for calendar (strictly for TEST PURPOSES ONLY!)
I just tried installing this, but get a file download window starting and an error:
Internet explorer cannot download ical.php from ...
Any thoughts?
Re: iCal export feature for calendar (strictly for TEST PURPOSES ONLY!)
I just tried downloading from a completely different computer and it worked fine.
In fact, the computer was a Mac so I tested how Apple's iCal software handled it... and it works nicely!
If anyone can diagnose the reason that the data can't be imported into Oracle Calendar / Microsoft Outlook, I'd be grateful for the input.
Re: iCal export feature for calendar (strictly for TEST PURPOSES ONLY!)
Sorry, I had no trouble downloading it, just it did not work on my moodle 1.5.3 installation.
I'll try again later and see if there is any change. I just put it in the \calendar folder of my moodle folder. Anything else needed to register it or activate it?
Re: iCal export feature for calendar (strictly for TEST PURPOSES ONLY!)
You might need to make sure it has the same file permissions as other Moodle files (typically, it needs to be "world-readable" as well as readable by you)...
Re: iCal export feature for calendar (strictly for TEST PURPOSES ONLY!)
I tried again and discovered that it was an Internet explorer problem. When I used firefox, I got a page of text that could be saved as an ical file.
However, I have not been able to find a program I can import it into... I use a program called Time and Chaos. I will tinker with the file to see what i can do.
I tried importing it as a .ics file into outlook with no success - claims that it is not valid... will continue to experiment
Thanks - at least the export format is working for me.
Re: iCal export feature for calendar (strictly for TEST PURPOSES ONLY!)
I was able to import the text file output into brown bear software's ical 3.1 for windows, so the file export worked for me if I use firefox for the download/processing of ical.php and I can import it into some vcal compatible applications. Outlook did not like it and neither did time and chaos.
I would love to be able to import and export calendar entries... or interate a calendar into moodle that I can do that with.
Re: iCal export feature for calendar (strictly for TEST PURPOSES ONLY!)
But I wish it was possible to find out why Outlook/T&C don't like the file... Can *anyone* help?
Re: iCal export feature for calendar (strictly for TEST PURPOSES ONLY!)
I was working on this feature lately (need to get it off the ground before I get that nice letter from the army recruitment office), and your effort has woken me up suddenly...
I 'm going to commit stuff in /calendar/ and /lib/bennu/ to facilitate the import/export procedure. Stay tuned!
Re: iCal export feature for calendar (strictly for TEST PURPOSES ONLY!)
You're right, though! Adding that fixes the problem. Thanks - I'll publish an updated version of the script.
Re: iCal export feature for calendar (strictly for TEST PURPOSES ONLY!)
Re: iCal export feature for calendar (strictly for TEST PURPOSES ONLY!)
Is there an easy way to allow the ical export function to include events that occurred before the current day? Example-- If I want to include events from last month....etc??
Re: iCal export feature for calendar (strictly for TEST PURPOSES ONLY!)
Re: iCal export feature for calendar (strictly for TEST PURPOSES ONLY!)
Ideas for anyone who might pick this up for further development -
- Discrimination between Global, Course, & Individual events
- Date ranges
- (& of course, iCal data Import as well as Export !)
Re: iCal export feature for calendar (strictly for TEST PURPOSES ONLY!)
Import is a separate issue, really. Of course it would be great to be able to do, but none of the functionality in my script would help anyone with the import task...
But I'm still irked by the fact that the data files don't work in all calendar software - that's the biggest issue we need to address!
Re: iCal export feature for calendar (strictly for TEST PURPOSES ONLY!)
We have a bunch of stuff in an Oracle calendar we'd like to Moodlize.
I'm encouraged by how long ago people were talking about doing it but discouraged by my inability to find anything about it anywhere.
Again sorry about my noobish question
VERSION 0.2 - iCal export feature for calendar (strictly for TEST PURPOSES ONLY!)
The next really massive problem to solve is... Why does Internet Explorer refuse to download the file? (Is it unable to handle the MIME type "text/calendar", perhaps? Not sure.)
Re: VERSION 0.2 - iCal export feature for calendar (strictly for TEST PURPOSES ONLY!)
Re: VERSION 0.2 - iCal export feature for calendar (strictly for TEST PURPOSES ONLY!)
I have a question about ical and the Moodle calendar. I can download the Moodle calendar and open the ics file in iCal, but the time of each event is off by 4 hours. (they appear in iCal 4 hours earlier) I checked the Moodle and the time is correct in both the variables and calendar settings. It is also correct on the computer the file is downloaded to. (including the time zone) Any idea how to fix this so the times are the same (automatically)?
Thanks.
Re: VERSION 0.2 - iCal export feature for calendar (strictly for TEST PURPOSES ONLY!)
My time is out by 10 hours as well. It seems as though the file does not take into account the server time (I'm in Melbourne Australia where it's +10 GMT).
It would be great if someone could come up with a fix for this
JM
Re: VERSION 0.2 - iCal export feature for calendar (strictly for TEST PURPOSES ONLY!)
I did add this to moodle/calender folder everuthing goes well , except , outlook doesn't seem to find appointments...
any suggestions?
iCal export feature for calendar in 1.6dev (strictly for TEST PURPOSES ONLY!)
I 've just added a bunch of scripts that can be used to export calendar events to iCal format. You can access the scripts by manually typing this URL:
http://yoursite.com/calendar/export.php
It's still quite raw, but does work. I would appreciate people giving feedback on anything, from obvious bugs to the user interface to the actual code.
Specifically for Dan, and other people who are interested in contributing to the code:
- The general idea is to break down the files as follows:
- export.php is the "driver" script. Everything that has a UI goes through this. It's this script's responsibility to include or redirect to other files as necessary.
- export_execute.php is the "worker" script. It takes parameters from the URL in a well-defined format and does the export. Afterwards it redirects back to export.php (the UI).
- export_basic.html is the UI for the screen you see when first visiting export.php.
- export_advanced.html does not exist yet, but if you take a look at the UI it's obvious what it will be for.
- /lib/bennu/ contains the library that will do the actual translation to iCal format. In other words, the worker script is responsible for translating the data from Moodle's database format to the format that Bennu recognizes. Bennu is then responsible for translating the data from its own format to iCal. This nicely encapsulates all iCal-specific stuff in /lib/bennu/, freeing up developers from actually needing to know anything about iCal.
- The code that does the actual work is very simple; the UI-related code is much more complicated. The reason for this is that I was thinking of pushing a little on the quality of the UI that Moodle offers. For example: you want to export your calendar. Here's a list of common tasks you might want to do, populated intelligently (for example, if today it's Sunday it makes more sense to give you a "next week" option rather than a "this week" option). If that's not good enough, then you can define your own export parameters (date range etc.). Then, next time you come back these options will have been "saved" and presented ready for use without your lifting a finger. Much room for novelty here, and the feedback could be very interesting.
- I 'd very much appreciate it if anyone wants to give a hand in coding /lib/bennu. The current version should be quite sufficient to do what we want to do right now, but obviously there are lots of things more to be done (e.g. to import stuff from iCal). Coding Bennu is the hard part; the actual Moodle UI doesn't involve going through RFC 2445 with a magnifying glass late at night.
Cheers!
Jon
Re: iCal export feature for calendar in 1.6dev (strictly for TEST PURPOSES ONLY!)
By the way, the WebCT import tool includes a function icalFileToEvents($file, $courseid) which does very simple parsing/importing of iCal data.
http://cvs.sourceforge.net/viewcvs.py/moodle/contrib/webctimport/lib.php?view=markup
You might or might not be able to salvage some useful code from that. It would be nice, in future, if the WebCT-importer can use Bennu for this part of the processing!
Re: iCal export feature for calendar in 1.6dev (strictly for TEST PURPOSES ONLY!)
http://cvs.sourceforge.net/viewcvs.py/phpicalendar/phpicalendar/functions/ical_parser.php?view=markup
It's GPL licensed. Could easily be used in Moodle?
Re: iCal export feature for calendar in 1.6dev (strictly for TEST PURPOSES ONLY!)
Some points to take into account when evaluating solutions for this problem:
- Exactly how can I reuse this piece of code? Take a moment to look at the (few and incomplete) examples included in Bennu. Then take a look at ical_parser.php. By the time you have grasped how things work in Bennu, you 'll be still scratching your head over ical_parser.
- What does the solution, as a tool, offer me? Bennu offers a clean OO interface to the world. ical_parser seems to generate $master_array, and good luck reverse engineering the rules regarding its contents. In the worst case, you 'd end up writing a separate conversion layer just to hide these (irrelevant and dangerous, from the point of client code) implementation details from "your" export code.
- Simply take a look at that code and ask yourself if you 'd want to maintain it. Hint: at some point it reaches 19 levels of tabs.
I 'm not trying to say that this thing is good and that thing is bad. In software engineering there are lots of things you have to take into account, like available resources, timetables, the often disastrous effects of deciding to rewrite a working system from scratch, etc etc. I have no doubt that ical_parser works for the PHP iCalendar people and does the job just fine, even if the maintainers sometimes wish it wasn't written this way (I can say the same for Moodle code, and it's no shame!).
My point is that when you put everything up on the table, it can make sense to develop something from scratch. Especially if you don't have screaming deadlines, you 'll get a modern and clean system designed for the job instead of an adaptation of something designed for another task, and there's something to be given back to the community in the process.
Cheers!
Jon
Re: iCal export feature for calendar in 1.6dev (strictly for TEST PURPOSES ONLY!)
Re: iCal export feature for calendar in 1.6dev (strictly for TEST PURPOSES ONLY!)
I had no idea this "hidden" code was already in CVS for 1.6
Unfortunately, it's not usable right now. To really get it working I think we need to expose a URL with GET parameters including a secret private code, so that tools like Google Calendar and iCal can subscribe to the calendar feed without too much risk of casual URL guessing, eg:
http://moodle.org/calendar/ical.php?course=5&code=68GJ68GHC5VJBB6767VHVGH
Any takers? See also the project on the student projects page:
http://docs.moodle.org/en/Student_projects
Re: iCal export feature for calendar in 1.6dev (strictly for TEST PURPOSES ONLY!)
Re: iCal export feature for calendar in 1.6dev (strictly for TEST PURPOSES ONLY!)
Re: iCal export feature for calendar in 1.6dev (strictly for TEST PURPOSES ONLY!)
Re: iCal export feature for calendar in 1.6dev (strictly for TEST PURPOSES ONLY!)
See also the log on our gitweb:
http://git.catalyst.net.nz/gitweb?p=moodle-r2.git;a=shortlog;h=mdl-icalendar
Comments are welcome.
Hopefully this can be added to CVS.
Re: iCal export feature for calendar (strictly for TEST PURPOSES ONLY!)
Is it possible to incoprate with outlook exprees?
Re: iCal export feature for calendar (strictly for TEST PURPOSES ONLY!)
Re: iCal export feature for calendar (strictly for TEST PURPOSES ONLY!)
WHAT IS THE Further Research can be done in ICAL?
Re: iCal export feature for calendar (strictly for TEST PURPOSES ONLY!)
Re: iCal export feature for calendar (strictly for TEST PURPOSES ONLY!)
What version of Outlook? (I'm assuming 2007??)
Have you looked under Tools > Account setting > Internet calendar > new.
I believe (I've set it up) all you need to do is copy the info from moodle into outlook (Export - choose your info & Get calendar URL).
Jeff
Re: iCal export feature for calendar (strictly for TEST PURPOSES ONLY!)
Thanks Jeff.
Re: iCal export feature for calendar (strictly for TEST PURPOSES ONLY!)
Did it work for you?
After setting up mine at home, I am now getting an "error on page" when I try ot 'Get calendar URL'
Line: 140
Char: 5
Error: Object doesn't support this property or method
Code: 0
URL: http:mysite.com/calendar/export.php?
Anyone have an idea?
Jeff
Re: iCal export feature for calendar (strictly for TEST PURPOSES ONLY!)
This forum post has been removed
Matt,
did you get any further with this idea of placing a student's ical feed in the Mentee's block?
All the events have a time associated, thus, Kontact displays these events in the time schedule. So far so good, but with events that take several days (the summer break for instance) those are also listed in the the time schedule while it would be a lot more comfortable to have them listed as day events like this:
[...]
DTSTART;VALUE=DATE:20070719
DTEND;VALUE=DATE:20070830
TRANSP:TRANSPARENT
[...]
Is there a way to incorporate this functionality into Moodle? Or it is already implemented and I didn't notice?
Re: iCal export feature for calendar (strictly for TEST PURPOSES ONLY!)
Since true .ics subscription doesn't seem to be available yet, my little work around is to have this file automatically written every so often (through the power of cron) to the PHP iCalendar directory on the same server. Is this crazy talk?
This forum post has been removed
This forum post has been removed
Re: iCal subscription URL for course events rather than user events
Could you post this fix for all to see? I know I will need this in the next few weeks.
-- Sherry
This forum post has been removed
This forum post has been removed
This forum post has been removed
Re: iCal export feature for calendar (strictly for TEST PURPOSES ONLY!)
Also, can anyone explain why there is a seemingly arbitrary limit such as this? I'm sure there's a good reason -- I'd just like to understand it.
Re: iCal export feature for calendar (strictly for TEST PURPOSES ONLY!)
Re: iCal export feature for calendar (strictly for TEST PURPOSES ONLY!)
I am sure I wrote a post that explained how to do this in detail some time in the past. Hopefully that is findable with a bit of searching.
Re: iCal export feature for calendar (strictly for TEST PURPOSES ONLY!)
Yes- Tim did give the code here: http://moodle.org/mod/forum/discuss.php?d=119125#p605145
This page has other helpful calendar info