Summary | Calendar export issues (alarms & timezone) |
Queue | Kronolith |
Queue Version | HEAD |
Type | Bug |
State | Resolved |
Priority | 2. Medium |
Owners | chuck (at) horde (dot) org |
Requester | junkmail (at) dominaweb (dot) net |
Created | 01/08/2007 (6763 days ago) |
Due | |
Updated | 07/09/2007 (6581 days ago) |
Assigned | 01/11/2007 (6760 days ago) |
Resolved | 07/09/2007 (6581 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | Kronolith 2.2 |
Patch | No |
Assigned to Chuck Hagenbuch
State ⇒ Resolved
the code really quickly... i would n't use this it's very ugly
/* vCalendar 2.0 alarms. */
// NOTE: only works with minutes
foreach ($vEvent->getComponents() as $o)
{
// asume it's an alarm, big hack, could add if ($o->getType
== 'valarm')
$theAttributes = $o->getAllAttributes();
foreach ($theAttributes as $theAttribute)
{
if($theAttribute['name'] == 'TRIGGER')
{
// lightning writes minus minutes, so sqrt the thing, ugly
$this->alarm =
sqrt($theAttribute['value']*$theAttribute['value'])/60;
}
}
}
which replaces (in Driver.php)
$alarm = $vEvent->getAttribute('AALARM');
if (!is_array($alarm) && !is_a($alarm, 'PEAR_Error') && intval($alarm)) {
$this->alarm = intval(($this->start->timestamp() - $alarm) / 60);
Horde::logMessage(intval(($this->start->timestamp() - $alarm)
/ 60), __FILE__, __LINE__, PEAR_LOG_NOTICE);
}
// vAlarm components for RFC 2445
if (!empty($this->alarm))
{
$vAlarm = &Horde_iCalendar::newComponent('valarm', $vEvent);
$vAlarm->setAttribute('ACTION','DISPLAY');
$vAlarm->setAttribute('TRIGGER;VALUE=DURATION', '-PT'.$this->alarm.'M');
$vEvent->addComponent($vAlarm);
}
but i'm stuck at getting the webdav import to work... anything done here yet?
First off all: Sorry for my bad english!
I use kronolith and nag and export the ics-files for my Desktopo (Rainlendar).
To get alarm and reminder working I've edited the Driver.php in both,
kronolith and nag.
I dont know if it is a god job or not, but it works fine for me.
May be its buggy or not, so use it as an suggestion, if you want.
Comments are wellcome!
Greetings from Germany,
Sven
In kronolith/lib/Driver.php I've replaced Line 482-486:
[code]
//vCalendar 1.0 alarms. Has to be replaced with vAlarm components for
RFC 2445, if anyone ever requests.
if (!empty($this->alarm)) {
$vEvent->setAttribute('AALARM', $this->start->timestamp()
- $this->alarm * 60);
}
[/code]
with this:
[code]
// vCalendar 2.0 vAlarms. Test by Sven Soehnel
// RFC 2445, if anyone ever requests.
if (!empty($this->alarm)) {
$vEvent->setAttribute('BEGIN','VALARM');
$vEvent->setAttribute('ACTION','AUDIO');
$vEvent->setAttribute('TRIGGER;VALUE=DURATION',
'-PT'.$this->alarm.'M');
$vEvent->setAttribute('END','VALARM');
}
[/code]
In nag/lib/Driver.php I've replaced lines 117-122:
[code]
if (!empty($task['due']) && empty($task['completed'])) {
$vTodo->setAttribute('DUE', $task['due']);
if (!empty($task['alarm'])) {
$vTodo->setAttribute('AALARM', $task['due'] -
$task['alarm'] * 60);
}
}
[/code]
with:
[code]
// vCalendar 2.0 vAlarms. Test by Sven Soehnel
// RFC 2445, if anyone ever requests.
if (!empty($task['due']) && empty($task['completed'])) {
$vTodo->setAttribute('DUE', $task['due']);
if (!empty($task['alarm'])) {
$vTodo->setAttribute('BEGIN','VALARM');
$vTodo->setAttribute('ACTION','AUDIO');
$vTodo->setAttribute('TRIGGER;VALUE=DURATION',
'-PT'.$task['alarm'].'M');
$vTodo->setAttribute('END','VALARM');
}
}
[/code]
However, once there is an official release that contains the fixes,
I'm completely confident that my hosting service will install that
version for me. I have a good relationship with them. They won't
test "development" code, however, since it would affect all domains on
the shared server, not just me.
If you, or any developer for that matter, wants to send me a .ics file
from a development version of Kronolith, containing an export of a
couple calendar events that have alarms set, for me to try importing,
I'd be more than happy to do that....just include the date/time of the
event(s) as well as how far before the events the alarm should be, so
I can verify it imports correct.
Given the simplicity of the changes to the ics file, however, I would
expect the fix to be pretty simple to visually test by looking at the
.ics file itself.
If there is any other way you think I can be of help, let me know.
State ⇒
since you have no access to change your Horde install, there isn't
much we can do for your particular situation - you won't be able to
test changes, etc.
How confident are you that this, including the reminder (valarm tags), is
working in the latest version? I didn't see anything in any of the known or
fixed bug lists that would lead me to believe this was already fixed.
I hate to ask my hosting service to upgrade Horde and then have it not
help...plus, I think the version is somewhat tied to their CPanel
installation. If you're confident, I'll ask them if they can upgrade, but
otherwise I'd appreciate verification first. It's really simple to test by
just setting up one event with a reminder and exporting it, then looking at
the .ics file to see if the vtimezone *and* valarm tags are present (and
correct), as indicated in the example I included with my bug submission.
Kindest Regards,
Frank Domina
State ⇒ Feedback
added in Horde 3.1.4.
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ Calendar export issues (alarms & timezone)
Queue ⇒ Kronolith
State ⇒ Unconfirmed
The result, when pulling into Outllook, for example, is that all of
the times are off by the difference between UTC and the user's timezone.
It's also not properly setting the reminder alarm (for Outlook, cell
phone calendar, whatever). It is using an "AALARM" tag, which I don't
even see in the RFC for the ics format.
Below are changes I manually made to the file before importing into
Outlook, and it corrected the issues. It would be great if these
fixes could be incorporated into Kronolith itself!
ISSUE 1) Regarding the timezone (obviously needs to change to match
the exporting user's timezone).....also, note that I set the DST
switch to the NEW (as of 2007) dates. I made the file START as
follows (asterisks on inserted lines for readibility in this email,
but the asterisks are NOT in the file):
* BEGIN:VTIMEZONE
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//The Horde Project//Horde_iCalendar Library//EN
METHOD:PUBLISH
* TZID:US-Eastern
* LAST-MODIFIED:20070101T000000Z
* TZURL:http://zones.stds_r_us.net/tz/US-Eastern
* BEGIN:STANDARD
* DTSTART:19671029T020000
* RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=11
* TZOFFSETFROM:-0400
* TZOFFSETTO:-0500
* TZNAME:EST
* END:STANDARD
* BEGIN:DAYLIGHT
* DTSTART:19870405T020000
* RRULE:FREQ=YEARLY;BYDAY=2SU;BYMONTH=3
* TZOFFSETFROM:-0500
* TZOFFSETTO:-0400
* TZNAME:EDT
* END:DAYLIGHT
--- Then, EVENTS (starting with the first BEGIN:VEVENT) GO HERE---
And then, finally, it ends with:
END:VCALENDAR
* END:VTIMEZONE
Related, I needed to modify each event to specify the timezone for the
start/end times. For example:
DTSTART;VALUE=DATE:20070120
DTEND;VALUE=DATE:20070121
needed to become:
DTSTART;TZID=US-Eastern:20070120
DTEND;TZID=US-Eastern:20070121
(Note, there is no time, just a date, because the event was an
all-day event, but the same resolution applies to shorter events.)
ISSUE
#2) Regarding the reminder alarms, I left the "AALARM" tagsas-is (they didn't seem to hurt anything -- probably ignored), but for
each event I added the proper alarm tags (I inserted these immediately
below the AALARM tag:
BEGIN:VALARM
TRIGGER:-PT12H
ACTION:AUDIO
END:VALARM
The TRIGGER above specifies 12 hours before the event starts. If you
wanted 15 minutes, it would be TRIGGER:-PT-15M, and so on.
The ACTION:AUDIO appears to work fine to tell Outlook to pop-up its
reminder dialog, and in within my phone, signal the reminder with a
beep.