Author Topic: Added tasks to iCalendar export  (Read 11981 times)

spingary

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Added tasks to iCalendar export
« on: March 20, 2010, 05:21:01 pm »
I love the iCalendar export feature.  I use it to add my Feng calendar to my Google Calendar, then all my Google calendars gets synced to my Palm Pre. It works great.

The problem is that the Feng iCalendar export does not export tasks.  So I hacked it to do so.  Hopefully this might find its way to the core.

Two files are updated and attached:
application/controllers/FeedController.class.php
environment/classes/event/CalFormatUtilities.php

Since tasks have no start/end times, they export as date events with no time. In Google Calendar they show up on the top of each day.  This is nice in that it shows me what I am supposed to be working on from day to day without crowding my calendar time slots.

To use it, simply get the iCalendar URL like you normally do, and add the parameter "&p=1" to tell it you want project tasks exported as well.

For example, the URL might be:

http://projects.xyz.com/index.php?c=feed&a=ical_export&n=Gary%20W&cal=0&t=abcabcabc5420657bbe7b70191a9e4d582f634881c&isw=0

You just have to change it to:

http://projects.xyz.com/index.php?c=feed&a=ical_export&n=Gary%20W&cal=0&t=abcabcabc5420657bbe7b70191a9e4d582f634881c&isw=0&p=1

Oh, and you can change the display name of the calendar by simply changing the "n" parameter. So instead of "&n=Gary%20W" I changed it to "&n=Projects%20Calendar" and it shows up on my Palm Pre as "Projects Calendar"

Hope someone finds this useful.

PS This is not fully tested so use as your own risk.  I hope all pulled the project tasks correctly!

damendieta

  • Jr. Member
  • **
  • Posts: 76
    • View Profile
Re: Added tasks to iCalendar export
« Reply #1 on: March 31, 2010, 09:10:44 pm »
Really grate, I hope it will be added to Feng 1.7 final.

Thanks a lot.

cabeza

  • Administrator
  • Hero Member
  • *****
  • Posts: 1004
    • View Profile
    • Feng Office
Re: Added tasks to iCalendar export
« Reply #2 on: April 02, 2010, 12:23:32 pm »
Thank you spingary.

I didn't make it to 1.7, but we'll take a look for 1.8.

Edit: If you have feedback (i.e. testing) or documentation about this enhancement, please let us know.
« Last Edit: April 02, 2010, 12:25:15 pm by cabeza »

Mnemic

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Added tasks to iCalendar export
« Reply #3 on: April 29, 2010, 05:41:12 pm »
This doesn't appear to work for 1.7RC

Just an FYI...

Also how do you get to the Raw Calendar URLs?
« Last Edit: April 29, 2010, 05:44:57 pm by Mnemic »

Mnemic

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Added tasks to iCalendar export
« Reply #4 on: May 03, 2010, 12:16:15 pm »
Mkay,

We'll I've been digging into this, and the code attached to the original post seems to be... incomplete. The CalFormatUtilities.php file is missing the last few lines of the code, and just generates errors.

The function modified also is missing the $tasks assignment so I see no way for it to work. Even fixing and creating what lines I think are missing, it still does not function, and I'm at a loss on why.

I'm just a novice OO programmer, and In my test app I've made, I can't get the Tasks to give me a date at all.

This feature would be really nice if we can get it to work.

spingary

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: Added tasks to iCalendar export
« Reply #5 on: May 03, 2010, 12:27:47 pm »
I downloaded and checked the files - they seem to be complete and are the same as what I have in my install which works without any errors.

But I neglected to mention that this was for 1.6.2!  I wonder if that's what's causing the errors for you guys running RC1.7x? 

I am sure it's not perfect and might be buggy.  Will be happy to help troubleshoot.

Gary

chuelibrueder

  • Newbie
  • *
  • Posts: 10
    • View Profile
    • Email
Update for version 1.7
« Reply #6 on: August 10, 2010, 05:23:56 pm »
Hi Everyone,

I've been working on updating this for version 1.7. I've got a working version and I've also inplemented some changes.

I've made the following changes:

1. I've changed the feed, so the export isn't VEVENT anymore, but VTODO.

This means that the feed will show up as task in sunbird/lightning/rainlendar, or whatever ical-client you're using. It doesn't work with google calendar because they haven't implemented VTODO-feeds, but feeding to google is really crappy anyway.

It is definitly working in lightning and rainlendar and ist rfc2445 compatible.

2. I've added the projekt and all it's parent projekts as categories, so you will be able to sort the tasks according to the projects.

3. I've changed the way the feeds are called Assuming you have the following link in the calendar:
 
http://projects.xyz.com/index.php?c=feed&a=ical_export&n=Gary%20W&cal=0&t=abcabcabc5420657bbe7b70191a9e4d582f634881c&isw=0

To get all the open task you need to add "&tsk=1":

http://projects.xyz.com/index.php?c=feed&a=ical_export&n=Gary%20W&cal=0&t=abcabcabc5420657bbe7b70191a9e4d582f634881c&isw=0&tsk

To only get the task assignet to the respective user you also need to add "&usrs=1":

http://projects.xyz.com/index.php?c=feed&a=ical_export&n=Gary%20W&cal=0&t=abcabcabc5420657bbe7b70191a9e4d582f634881c&isw=0&tsk=1&usrs=1

What hasn't changed ist the file that need to be addapted in your fengoffice installation. That's still CalFormatUtilities.php and FeedController.class.php.

Attached you find the the too adapted files. And feel free to ask questions if you have any trouble. But as always us at your own risk.

Greetings Chuelibrueder

Murz

  • Full Member
  • ***
  • Posts: 147
    • View Profile
Re: Added tasks to iCalendar export
« Reply #7 on: August 11, 2010, 04:53:56 am »
Thank's! Works very good on KDE 4.5 & Kontact! I use only tasks in og, because events didn't remember that user forgot to complete it, and now I can see it! Beautiful! =)

But because exported info is read-only, will be good to add http link to each task and event to fengoffice page, for example in end of description.

And will be good to add the option to add username in title of each task (or in other field) for control task of other users.

Murz

  • Full Member
  • ***
  • Posts: 147
    • View Profile
Re: Added tasks to iCalendar export
« Reply #8 on: August 11, 2010, 05:15:32 am »
For adding assigner and assigned user you can use fields, described in http://en.wikipedia.org/wiki/ICalendar#To-do_.28VTODO.29
ORGANIZER:MAILTO:unclesam@us.gov
ATTENDEE;PARTSTAT=ACCEPTED:MAILTO:jqpublic@example.com

chuelibrueder

  • Newbie
  • *
  • Posts: 10
    • View Profile
    • Email
Re: Added tasks to iCalendar export
« Reply #9 on: August 11, 2010, 10:03:13 am »
Here you go,

included ORGANIZER-Tag and Link to the task in the description.

Greetings
chuelibrueder

Murz

  • Full Member
  • ***
  • Posts: 147
    • View Profile
Re: Added tasks to iCalendar export
« Reply #10 on: August 11, 2010, 11:17:41 am »
Thank's! But I can't found where I can see the ORGANIZER tag content from VTODO in Mozilla Lighting & KDE Calendar.
What software do you use? Can you post the screenshot with ORGANIZER field visible in calendar?

And calendar in KDE supports html content in tasks, so we can show url as hyperlink in task (for one-click access), but Mozilla Lighting didn't support it.
I have attached an example of VTODO, created with KDE Calendar. Will be good for me to see the option for adding link to task as html hyperlink in task body.

chuelibrueder

  • Newbie
  • *
  • Posts: 10
    • View Profile
    • Email
Re: Added tasks to iCalendar export
« Reply #11 on: August 12, 2010, 03:55:30 pm »
I don't have a clue where the ORGANIZER tag appears in KDE. It does appear in lightning, when you click on a task and look at the Task details at the bottom (Andrea Jberg in the printscreen). You can also add the column by clicking the light blue button at the top right corner of the printscreen. Sorry that's not true.

Concerning the HTML-Problem: This "X-KDE-TEXTFORMAT=HTML..." is a special property (x-param) for KDE, but since this only works in KDE, there's really no point in adding this to the file for everyone. You can easily add it yourself in the ClassFormatUtilities.php file by changing the line starting with $description.

« Last Edit: August 12, 2010, 03:58:02 pm by chuelibrueder »

Murz

  • Full Member
  • ***
  • Posts: 147
    • View Profile
Re: Added tasks to iCalendar export
« Reply #12 on: August 13, 2010, 05:52:59 am »
Thank's for info, I try to patch the code for my KDE.

And will be good to add option for export not all tasks, but only for which user are subscribed or assigned.

For example of filtering only subscribed by user objects from db you can look how I filter them in patch from topic http://forums.fengoffice.com/index.php?topic=4216.msg17079#msg17079 with option "scope=created_subscribed"

shmuelios

  • Freshman
  • *
  • Posts: 19
    • View Profile
Re: Added tasks to iCalendar export
« Reply #13 on: March 31, 2011, 08:34:48 am »
Thanks for this great little mod!  :)

Do you think it would be possible to have an option that converts tasks to compatible events? Just either use the end date of a task or both if possible.

I know Google calendar isn't the best for feeds its the only way currently ( I know ) of keeping sync on an android phone unless other people know of a better method currently available?

Could this make it into Feng office and with tasks converted to events?

I think it this would make a very handy feature for people tracking off mobile devices.