steffen: server/kolab-resource-handlers/kolab-resource-handlers/fbview/fbview/kronolith/lib/FBView day.php, 1.6, 1.7 week.php, 1.6, 1.7 workweek.php, 1.6, 1.7

cvs at intevation.de cvs at intevation.de
Thu Sep 29 16:44:20 CEST 2005


Author: steffen

Update of /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/fbview/fbview/kronolith/lib/FBView
In directory doto:/tmp/cvs-serv6382/kolab-resource-handlers/fbview/fbview/kronolith/lib/FBView

Modified Files:
	day.php week.php workweek.php 
Log Message:
Fix for issue666. This fixed the problem described in the issue, but the overall layout of the week-view just sucks, and I failed to make it any better...

Index: day.php
===================================================================
RCS file: /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/fbview/fbview/kronolith/lib/FBView/day.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- day.php	12 Sep 2005 22:46:12 -0000	1.6
+++ day.php	29 Sep 2005 14:44:18 -0000	1.7
@@ -128,7 +128,8 @@
 
         $hours_html = '<table width="100%" cellpadding="0" cellspacing="0" style="text-align:center"><tr>';
         $step = 1;
-        $width = 100 / ($endHour - $startHour);
+        $width = 100.0 / ($endHour - $startHour);
+	$width_str = sprintf("%F",$width);
         for ($i = $startHour; $i < $endHour; $i+= $step) {
             $t = mktime($i);
 	    if( $prefs->getValue('twentyFour') ) {
@@ -137,9 +138,9 @@
 	      $hour = intval(strftime("%I", $t)) . strftime(" %p", $t);
 	    }
             if ($i > $startHour) {
-                $hours_html .= "<td style=\"border-left:1px solid black;width:$width%\">$hour</td>";
+                $hours_html .= "<td style=\"border-left:1px solid black;width:$width_str%\">$hour</td>";
             } else {
-                $hours_html .= "<td style=\"width:$width%\">$hour</td>";
+                $hours_html .= "<td style=\"width:$width_str%\">$hour</td>";
             }
         }
         $hours_html .= '</tr></table>';

Index: week.php
===================================================================
RCS file: /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/fbview/fbview/kronolith/lib/FBView/week.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- week.php	29 Aug 2005 23:52:34 -0000	1.6
+++ week.php	29 Sep 2005 14:44:18 -0000	1.7
@@ -70,13 +70,16 @@
 
         $hours_html = '<table width="100%" cellpadding="0" cellspacing="0" style="text-align:center"><tr>';
         $dayWidth = 100 / 7;
+	$dayWidth_str = sprintf("%F",$dayWidth);
         for ($i = 0; $i < 7; $i++) {
             $t = mktime(0, 0, 0, date('n', $day), date('j', $day) + $i, date('Y', $day));
-            $day_label = strftime("%A, %d %B", $t);
+            $day_label = strftime("%a, %d %b", $t);
             if ($i > 0) {
-                $hours_html .= "<td colspan=\"4\" style=\"white-space:nowrap;overflow:hidden;border-left:1px solid black;width:$dayWidth%\">$day_label</td>";
+	      #$hours_html .= "<td colspan=\"4\" style=\"white-space:nowrap;overflow:hidden;border-left:1px solid black;width:$dayWidth_str%\">$day_label</td>";
+	      $hours_html .= "<td colspan=\"4\" style=\"white-space:nowrap;overflow:hidden;border-left:1px solid black; width:$dayWidth_str%\">$day_label</td>";
             } else {
-                $hours_html .= "<td colspan=\"4\" style=\"white-space:nowrap;overflow:hidden;width:$dayWidth%\">$day_label</td>";
+	      #$hours_html .= "<td colspan=\"4\" style=\"white-space:nowrap;overflow:hidden;width:$dayWidth_str%\">$day_label</td>";
+	      $hours_html .= "<td colspan=\"4\" style=\"white-space:nowrap; overflow:hidden; width:$dayWidth_str%\">$day_label</td>";
             }
         }
 
@@ -92,9 +95,11 @@
 		  $hour = intval(strftime("%I", $t)) . strftime(" %p", $t);
 		}
                 if( $h==0 && $h+$i > 0 ) {
-                    $hours_html .= "<td style=\"white-space:nowrap;overflow:hidden;border-left:1px solid black;width:4%\">$hour</td>";
+		  $hours_html .= "<td style=\"white-space:nowrap;overflow:hidden;border-left:1px solid black;width:3.57%\">$hour</td>";
+		  #$hours_html .= "<td style=\"white-space:nowrap;overflow:hidden;border-left:1px solid black;width:1*\">$hour</td>";
                 } else {
-                    $hours_html .= "<td style=\"white-space:nowrap;overflow:hidden;width:4%\">$hour</td>";
+		  $hours_html .= "<td style=\"white-space:nowrap;overflow:hidden;width:3.57%\">$hour</td>";
+		  #$hours_html .= "<td style=\"white-space:nowrap;overflow:hidden;width:1*\">$hour</td>";
                 }
             }
         }
@@ -192,13 +197,12 @@
                 $start_min = intval(strftime('%M', $start));
 
                 $left = $dayWidth * $start_day;
-		/*
                 if ($start_hour >= 9 && $start_hour < 18) {
-                    $left += ($start_hour - 9) * ($dayWidth / 9);
-                    $left += ($start_min / 60) * ($dayWidth / 9);
-                } elseif ($start_hour >= 18) {
-                    $left += $dayWidth;
-                }*/
+		  $left += ($start_hour - 9) * ($dayWidth / 9);
+		  $left += ($start_min / 60) * ($dayWidth / 9);
+		} elseif ($start_hour >= 18) {
+		  $left += $dayWidth;
+                }
                 $left = min(100., max(0., $left));
 
                 $end_day = floor(($end - $this->_startStamp) / (24. * 3600.));
@@ -206,13 +210,12 @@
                 $end_min = intval(strftime('%M', $end));
 
                 $right = $dayWidth * $end_day;
-		/*
                 if ($end_hour >= 9 && $end_hour < 18) {
-                    $right += ($end_hour - 9) * ($dayWidth / 9);
-                    $right += ($end_min / 60) * ($dayWidth / 9);
-                } elseif ($end_hour >= 18) {
-                    $right += $dayWidth;
-                }*/
+		  $right += ($end_hour - 9) * ($dayWidth / 9);
+		  $right += ($end_min / 60) * ($dayWidth / 9);
+		} elseif ($end_hour >= 18) {
+		  $right += $dayWidth;
+                }
                 $right = min(100., $right);
 
 		if( $left == $right ) { 
@@ -224,8 +227,8 @@
 		  }
 		}
                 if ( ($right - $left) != 0.) {
-				    $template->set('left', sprintf("%F",$left));
-					$template->set('width', sprintf("%F",$right - $left));
+		    $template->set('left', sprintf("%F",$left));
+		    $template->set('width', sprintf("%F",$right - $left));
                     $template->set('top', $count++ * 15);
                     $template->set('label', $label);
                     $template->set('evclick', '');

Index: workweek.php
===================================================================
RCS file: /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/fbview/fbview/kronolith/lib/FBView/workweek.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- workweek.php	29 Aug 2005 23:52:34 -0000	1.6
+++ workweek.php	29 Sep 2005 14:44:18 -0000	1.7
@@ -71,7 +71,7 @@
         $hours_html = '<table width="100%" cellpadding="0" cellspacing="0" style="text-align:center"><tr>';
         for ($i = 0; $i < 5; $i++) {
             $t = mktime(0, 0, 0, date('n', $day), date('j', $day) + $i, date('Y', $day));
-            $day_label = strftime("%A, %d %B", $t);
+            $day_label = strftime("%a, %d %b", $t);
             if ($i > 0) {
                 $hours_html .= "<td colspan=\"3\" style=\"white-space:nowrap;overflow:hidden;border-left:1px solid black;width:20%\">$day_label</td>";
             } else {
@@ -220,7 +220,7 @@
 		    $right += 1;
 		  }
 		}
-		        $template->set('left', sprintf("%F",$left));
+		$template->set('left', sprintf("%F",$left));
                 $template->set('width', sprintf("%F",$right - $left));
                 $template->set('top', $count++ * 15);
                 $template->set('label', $label);





More information about the commits mailing list