[kronolith] new patch concerning listAlarms

W. Tasin tasin at fhm.edu
Sat Apr 3 04:49:15 PST 2004


Hi,

here is the patch which fixes a typo and the compare function.

Now with all my patches (including the "identity"-one) I will be alerted 
by mail, but I will be flooded with mails, because the "seen"-stuff 
inside reminder.php was intended to work on a daemon.

So my question now is how should this be handled?
Make reminder.php again a daemon? Saving this information inside the 
database (and what about the mcal-backend)?

For the sql backend I could have a look at it trying to make it work (if 
desired).

Ciao

Walter
-------------- next part --------------
--- /home/tasin/horde/CVS-HORDE/horde/kronolith/lib/Kronolith.php	Sat Apr  3 06:40:27 2004
+++ kronolith/lib/Kronolith.php	Sat Apr  3 08:03:11 2004
@@ -792,9 +792,9 @@
         $second = Kronolith::dateObject($second);
 
         $diff = Kronolith::compareDates($first, $second);
-        if (!$diff) {
-            return 0;
-        } elseif ($first->house != $second->hour) {
+        if ($diff) {
+            return $diff;
+        } elseif ($first->hour != $second->hour) {
             return $first->hour - $second->hour;
         } elseif ($first->min != $second->min) {
             return $first->min - $second->min;

-------------- next part --------------
--- kronolith/lib/Driver/sql.php	Fri Apr  2 18:07:33 2004
+++ kronolith/lib/Driver/sql.php	Fri Apr  2 21:55:54 2004
@@ -54,8 +54,8 @@
                 $start = &Kronolith::dateObject($event->start);
                 $start->min -= $event->getAlarm();
                 $start->correct();
-                if (Kronolith::compareDateTimes($start, $date) == -1 &&
-                    Kronolith::compareDateTimes($date, $event->end) == -1) {
+                if (Kronolith::compareDateTimes($start, $date) <= 0 &&
+                    Kronolith::compareDateTimes($date, $event->end) <= -1) {
                     $events[] = $eventId;
                 }
             } else {
@@ -63,13 +63,13 @@
                     $start = &Kronolith::dateObject($next);
                     $start->min -= $event->getAlarm();
                     $start->correct();
-                    if (Kronolith::compareDateTimes($start, $date) == -1 &&
+                    if (Kronolith::compareDateTimes($start, $date) <= 0 &&
                         Kronolith::compareDateTimes($date, Kronolith::dateObject(array('year' => $next->year,
                                                                                        'month' => $next->month,
                                                                                        'mday' => $next->mday,
                                                                                        'hour' => $event->end->hour,
                                                                                        'min' => $event->end->min,
-                                                                                       'sec' => $event->end->sec)) == -1)) {
+                                                                                       'sec' => $event->end->sec)) <= -1)) {
                         $events[] = $eventId;
                     }
                 }



More information about the kronolith mailing list