patch

Jan Schneider janmailing@gmx.de
Sat, 23 Jun 2001 12:50:12 +0200


---------------------- multipart/mixed attachment
Hi,

this is a patch for the summary to only show events that aren't yet finished 
and to show events in bold that are in progress.
It also fixes a missing </td>

Jan.

::::::::::::::::::::::::::::::::::::::::
AMMMa AG - discover your knowledge
:::::::::::::::::::::::::::
Detmolder Str. 25-33 :: D-33604 Bielefeld
fon +49.521.96878-0 :: fax  +49.521.96878-20
http://www.ammma.de
::::::::::::::::::::::::::::::::::::::::::::::
---------------------- multipart/mixed attachment
Index: api.php
===================================================================
RCS file: /cvs/horde/kronolith/lib/api.php,v
retrieving revision 1.6
diff -u -r1.6 api.php
--- api.php     2001/06/15 16:28:33     1.6
+++ api.php     2001/06/23 10:40:02
@@ -16,14 +16,15 @@
 function kronolithSummary()
 {
     global $prefs;
     
     $html = '<table border="0" cellpadding="2" cellspacing="0"><tr><td class="header">' . _("Calendar") . '</td></tr><tr><td class="text"><table border="0" cellpadding="0" cellspacing="0">';
     
     include_once KRONOLITH_BASE . '/lib/Day.php';
     $day = new Kronolith_Day();
+    $now = time() + $timeshift * 3600;
     for ($i = 0; $i < 7; $i++) {
         $events = Kronolith::getEvents($day->getStamp());
         
         if (count($events) > 0) {
             $html .= '<tr><td colspan="3" class="text"><b>';
             if ($day->isToday()) {
@@ -35,8 +38,10 @@
         }
 
         foreach ($events as $event) {
+            if ($event->end_time < $now) continue;
             $html .= '<tr><td class="text">';
-            if ($event->start->hour != 0 || $event->start->min != 0 
+            if ($event->start_time < $now && $event->end_time > $now) $html .= '<b>';
+            if ($event->start->hour != 0 || $event->start->min != 0
                 || ($event->end_time - $event->start_time) != (24 * 60 * 60)) {
                 if ($prefs->getValue('24hr')) {
                     $time  = date('G:i', $event->start_time) . '-';
@@ -53,17 +58,20 @@
             if (!empty($event->attrlist['location'])) {
                 $text .= ' (' . $event->attrlist['location'] . ')';
             }
             $html .= Horde::link(Horde::applicationUrl('editevent.php?eventID=' . 
                                                      $event->id), $event->title) . $time . '</a>';
+            if ($event->start_time < $now && $event->end_time > $now) $html .= '</b>';
             $html .= '</td><td class="text">&nbsp;&nbsp;&nbsp;</td><td class="text">';
+            if ($event->start_time < $now && $event->end_time > $now) $html .= '<b>';
             $html .= Horde::link(Horde::applicationUrl('editevent.php?eventID=' .
                                                      $event->id), $event->title) . $text . '</a>';
-            $html .= '</tr>';
+            if ($event->start_time < $now && $event->end_time > $now) $html .= '</b>';
+            $html .= '</td></tr>';
         }
         $day = new Kronolith_Day(null, null, null, $day->getTomorrow());
     }
     $html .= '</table></td></tr></table>';
     
     return $html;
 }
 

---------------------- multipart/mixed attachment--