[Tickets #5026] Re: Correctly space calendar table and show number of appointments/events in period

bugs@bugs.horde.org bugs at bugs.horde.org
Tue Feb 27 01:46:31 PST 2007


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

Ticket URL: http://bugs.horde.org/ticket/?id=5026
-----------------------------------------------------------------------
 Ticket             | 5026
 Updated By         | jon at spriggs.org.uk
 Summary            | Correctly space calendar table and show number of appointments/events in
                    | period
 Queue              | Kronolith
 Version            | HEAD
 Type               | Enhancement
 State              | Feedback
 Priority           | 1. Low
 Owners             | 
-----------------------------------------------------------------------


jon at spriggs.org.uk (2007-02-27 01:46) wrote:

Apologies - this change is to show the number of events on a date. This
change also ensures column widths on the Kronolith Portal Block "Month
View" do not change dramatically when additional data is provided for that
date.

The unified diff follows - sorry about that - selected the wrong option in
the cvs diff command.

Index: month.php
===================================================================
RCS file: /repository/kronolith/lib/Block/month.php,v
retrieving revision 1.34
diff -u -r1.34 month.php
--- month.php   2 Feb 2007 05:56:28 -0000       1.34
+++ month.php   27 Feb 2007 09:42:13 -0000
@@ -111,7 +111,7 @@
             $weekdays[] = _("Su");
         }
         foreach ($weekdays as $weekday) {
-            $html .= '<th class="item">' . $weekday . '</th>';
+            $html .= '<th class="item" width="14.2%">' . $weekday .
'</th>';
         }

         if (isset($this->_params['calendar']) &&
$this->_params['calendar'] != '__all') {
@@ -156,23 +156,25 @@
                 /* There are events; create a cell with tooltip to
                  * list them. */
                 $day_events = '';
+                $event_count = 0;
                 foreach ($all_events[$dayStamp] as $event) {
                     $day_events .= date($prefs->getValue('twentyFour') ?
'G:i' : 'g:ia', $event->start->timestamp()) . ' - ' .
date($prefs->getValue('twentyFour') ? 'G:i' : 'g:ia',
$event->end->timestamp());
                     $day_events .= ($event->getLocation()) ? ' (' .
$event->getLocation() . ')' : '';
                     $day_events .= ' ' . $event->getTitle() . "\n";
+                    $event_count++;
                 }
-                $cell = Horde::linkTooltip($url, _("View Day"), '', '',
'', $day_events) . date('j', $dayStamp) . '</a>';
+                $cell = Horde::linkTooltip($url, _("View Day"), '', '',
'', $day_events) . date('j', $dayStamp);
             } else {
                 /* No events, plain link to the day. */
-                $cell = Horde::linkTooltip($url, _("View Day")) .
date('j', $dayStamp) . '</a>';
+                $cell = Horde::linkTooltip($url, _("View Day")) .
date('j', $dayStamp);
             }

             /* Bold the cell if there are events. */
             if (!empty($all_events[$dayStamp])) {
-                $cell = '<strong>' . $cell . '</strong>';
+                $cell = '<strong>' . $cell . '</strong> (' . $event_count
. ')';
             }

-            $html .= $cell . '</td>';
+            $html .= $cell . '</a></td>';
             ++$weekday;
         }






More information about the bugs mailing list