[Tickets #4851] Re: Calendar export issues (alarms & timezone)

bugs at bugs.horde.org bugs at bugs.horde.org
Mon Jun 25 17:28:48 UTC 2007


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/?id=4851
-----------------------------------------------------------------------
 Ticket             | 4851
 Updated By         | munzli at olmero.ch
 Summary            | Calendar export issues (alarms & timezone)
 Queue              | Kronolith
 Version            | 2.1.2
 Type               | Bug
 State              | Accepted
 Priority           | 2. Medium
 Owners             | 
-----------------------------------------------------------------------


munzli at olmero.ch (2007-06-25 10:28) wrote:

since i need to show this tomorrow and didn't have any time i hacked 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);
        }



More information about the bugs mailing list