6.0.0-alpha12
▾
Tasks
New Task
Search
▾
Others
Photos
Wiki
Development
Tickets
New Ticket
Search
Toggle Alerts Log
Help
7/10/25
H
istory
A
ttachments
C
omment
W
atch
Download
Comment on [#7470] Sunbird/Lightning alarm dismissal and snooze incompletely implemented
*
Your Email Address
*
Spam protection
Enter the letters below:
. .. .. .. ..___ |\ ||\/||\/||_/ [__ | \|| || || \[___
Comment
> 20090121 \ > > - after applying these patches, it works - partly. (using horde > v3.3.2 and kronolith v2.3 - sunbird & lightning v0.9) > > - tryied to edit REMINDER(alarm) in existing event, saved and it was > remembered. fine > > - !!! have tryied to snooze (e.g. 5min) it after the event showed up > first time, but after snoozing never showed up again. > > > > p.s. > > - when patching the Driver.php in /kronolith/lib was "squeaking" this: > > { > > Reversed (or previously applied) patch detected! Assume -R? [n] > > Apply anyway? [n] y > > } > > - creating the file 'Driver.php.rej' after, which is 4002 bits long, > containing this: > > { > > *************** > > *** 739,744 **** > > $vAlarm = &Horde_iCalendar::newComponent('valarm', > $vEvent); > > $vAlarm->setAttribute('ACTION', 'DISPLAY'); > > $vAlarm->setAttribute('TRIGGER;VALUE=DURATION', > '-PT' . $this->alarm . 'M'); > > $vEvent->addComponent($vAlarm); > > } > > } > > --- 739,760 ---- > > $vAlarm = &Horde_iCalendar::newComponent('valarm', > $vEvent); > > $vAlarm->setAttribute('ACTION', 'DISPLAY'); > > $vAlarm->setAttribute('TRIGGER;VALUE=DURATION', > '-PT' . $this->alarm . 'M'); > > + > > + // > Send Sunbird/Lightning X-MOZ-LASTACK if the alarm has been dismissed > > + // > Send X-MOZ-SNOOZE-TIME if it's been snoozed > > + > require_once 'Horde/Alarm.php'; > > + $currentAlarm = > Horde_Alarm::factory(); > > + > if($currentAlarm->exists($this->_uid, $this->creatorID)) { > > + > if($currentAlarm->isSnoozed($this->_uid, $this->creatorID)) { > > + > $vEvent->setAttribute('X-MOZ-LASTACK', $modified); > > + > $alarmHash = $currentAlarm->get($this->_uid, > $this->creatorID); > > + > if(isset($alarmHash->snooze)) { > > + > $vEvent->setAttribute('X-MOZ-SNOOZE-TIME', > $alarmHash['snooze']->timestamp()); > > + > } > > + } > > + } else { > > + > $vEvent->setAttribute('X-MOZ-LASTACK', $modified); > > + } > > $vEvent->addComponent($vAlarm); > > } > > } > > *************** > > *** 896,902 **** > > } else { > > $duration = $vEvent->getAttribute('DURATION'); > > if (!is_array($duration) && !is_a($duration, 'PEAR_Error')) { > > - $this->end = new > Horde_Date($this->start->timestamp() + $duration); > > } else { > > // End date equal to start date as per RFC 2445. > > $this->end = Util::cloneObject($this->start); > > --- 912,918 ---- > > } else { > > $duration = $vEvent->getAttribute('DURATION'); > > if (!is_array($duration) && !is_a($duration, 'PEAR_Error')) { > > + $this->end = new > Horde_Date($this->start->timestamp() + $duration); > > } else { > > // End date equal to start date as per RFC 2445. > > $this->end = Util::cloneObject($this->start); > > *************** > > *** 916,922 **** > > $this->alarm = intval(($this->start->timestamp() - > $alarm) / 60); > > } > > > > - // @TODO: vCalendar 2.0 alarms > > > > // Attendance. > > // Importing attendance may result in confusion: editing an > imported > > --- 932,964 ---- > > $this->alarm = intval(($this->start->timestamp() - > $alarm) / 60); > > } > > > > + // Dismissed or Snoozed > > + // Sunbird/Lightning sends an > X-MOZ-LASTACK if an alarm is snoozed or dismissed > > + // It sends an additional > X-MOZ-SNOOZE-TIME if snoozed with a date stamp > > + // containing the time the alarm > should refire > > + $dismissed = > $vEvent->getAttribute('X-MOZ-LASTACK'); > > + $snoozed = > $vEvent->getAttribute('X-MOZ-SNOOZE-TIME'); > > + if(!is_a($dismissed, 'PEAR_ERROR')) { > > + require_once 'Horde/Alarm.php'; > > + $currentAlarm = Horde_Alarm::factory(); > > + if(!is_a($snoozed, 'PEAR_ERROR')) { > > + $snoozeTime = new > Horde_Date(strtotime($snoozed)); > > + $snoozeLength = > intval(($snoozeTime->timestamp() - time()) / 60); > > + > $currentAlarm->snooze($this->getUID(), $this->getCreatorId(), > $snoozeLength); > > + } else { > > + > $currentAlarm->snooze($this->getUID(), $this->getCreatorId(), -1); > > + } > > + } > > + > > + $components = $vEvent->getComponents(); > > + foreach($components as $c) { > > + if($c->getType() == 'vAlarm') { > > + $myalarm = > $c->getAttribute('TRIGGER;VALUE=DURATION'); > > + $this->alarm = > intval(Horde_iCalendar::_parseDuration($myalarm) / -60); > > + $this->save(); > > + break; > > + } > > + } > > > > // Attendance. > > // Importing attendance may result in confusion: editing an > imported > > } > > > > Daniel
Attachment
Watch this ticket
N
ew Ticket
M
y Tickets
S
earch
Q
uery Builder
R
eports
Saved Queries
Open Bugs
Bugs waiting for Feedback
Open Bugs in Releases
Open Enhancements
Enhancements waiting for Feedback
Bugs with Patches
Enhancements with Patches
Release Showstoppers
Stalled Tickets
New Tickets
Horde 5 Showstoppers