steffen: server/kolab-resource-handlers/kolab-resource-handlers/fbview/fbview/kronolith/lib/FBView month.php, 1.2, 1.3 week.php, 1.4, 1.5 workweek.php, 1.4, 1.5
cvs at intevation.de
cvs at intevation.de
Wed Dec 22 00:59:59 CET 2004
Author: steffen
Update of /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/fbview/fbview/kronolith/lib/FBView
In directory doto:/tmp/cvs-serv7384/kolab-resource-handlers/fbview/fbview/kronolith/lib/FBView
Modified Files:
month.php week.php workweek.php
Log Message:
Fix for Issue565 (too small/invisible busyblocks)
Index: month.php
===================================================================
RCS file: /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/fbview/fbview/kronolith/lib/FBView/month.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- month.php 15 Dec 2004 22:11:59 -0000 1.2
+++ month.php 21 Dec 2004 23:59:57 -0000 1.3
@@ -81,9 +81,9 @@
$t = mktime(0, 0, 0, date('n', $day), date('j', $day) + $i, date('Y', $day));
$day_label = strftime(" %d ", $t);
if ($i > 0) {
- $hours_html .= "<td colspan=\"3\" 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%\">$day_label</td>";
} else {
- $hours_html .= "<td colspan=\"3\" style=\"white-space:nowrap;overflow:hidden;width:$dayWidth%\">$day_label</td>";
+ $hours_html .= "<td colspan=\"4\" style=\"white-space:nowrap;overflow:hidden;width:$dayWidth%\">$day_label</td>";
}
}
@@ -201,6 +201,14 @@
}
$right = min(100, $right);
+ if( $left == $right ) {
+ // This is the minimum interval we can display
+ if( $left > 0 ) {
+ $left -= 1;
+ } else {
+ $right += 1;
+ }
+ }
if (($right - $left) != 0) {
$template->set('left', $left);
$template->set('width', $right - $left);
Index: week.php
===================================================================
RCS file: /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/fbview/fbview/kronolith/lib/FBView/week.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- week.php 11 Nov 2004 15:08:48 -0000 1.4
+++ week.php 21 Dec 2004 23:59:57 -0000 1.5
@@ -74,16 +74,16 @@
$t = mktime(0, 0, 0, date('n', $day), date('j', $day) + $i, date('Y', $day));
$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:$dayWidth%\">$day_label</td>";
+ $hours_html .= "<td colspan=\"4\" style=\"white-space:nowrap;overflow:hidden;border-left:1px solid black;width:$dayWidth%\">$day_label</td>";
} else {
- $hours_html .= "<td colspan=\"3\" style=\"white-space:nowrap;overflow:hidden;width:$dayWidth%\">$day_label</td>";
+ $hours_html .= "<td colspan=\"4\" style=\"white-space:nowrap;overflow:hidden;width:$dayWidth%\">$day_label</td>";
}
}
$hours_html .= "</tr><tr>";
for ($i = 0; $i < 7; $i++) {
- for ($h = 9; $h < 18; $h += 3) {
+ for ($h = 0; $h < 24; $h += 6) {
$t = mktime($h, 0, 0, date('n', $day), date('j', $day), date('Y', $day));
if( $prefs->getValue('twentyFour') ) {
@@ -91,7 +91,7 @@
} else {
$hour = intval(strftime("%I", $t)) . strftime(" %p", $t);
}
- if (($i + $h) > 9) {
+ if( $h==0 && $h+$i > 0 ) {
$hours_html .= "<td style=\"white-space:nowrap;overflow:hidden;border-left:1px solid black;width:4%\">$hour</td>";
} else {
$hours_html .= "<td style=\"white-space:nowrap;overflow:hidden;width:4%\">$hour</td>";
@@ -181,39 +181,49 @@
{
$template = &new Horde_Template();
- $count = 0;
+ $count = 0.;
$blocks = '';
- $dayWidth = 100 / 7;
+ $dayWidth = 100. / 7.;
foreach ($periods as $start => $end) {
if ($start < $this->_endStamp && $end > $this->_startStamp) {
- $start_day = floor(($start - $this->_startStamp) / (24 * 3600));
+ $start_day = floor(($start - $this->_startStamp) / (24. * 3600.));
$start_hour = intval(strftime('%H', $start));
$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 = min(100, max(0, $left));
+ }*/
+ $left = min(100., max(0., $left));
- $end_day = floor(($end - $this->_startStamp) / (24 * 3600));
+ $end_day = floor(($end - $this->_startStamp) / (24. * 3600.));
$end_hour = intval(strftime('%H', $end));
$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 = min(100, $right);
+ }*/
+ $right = min(100., $right);
- if (($right - $left) != 0) {
+ if( $left == $right ) {
+ // This is the minimum interval we can display
+ if( $left > 0 ) {
+ $left -= 1;
+ } else {
+ $right += 1;
+ }
+ }
+ if ( ($right - $left) != 0.) {
$template->set('left', $left);
$template->set('width', $right - $left);
$template->set('top', $count++ * 15);
@@ -250,12 +260,12 @@
$start_min = intval(strftime('%M', $start));
$right = $dayWidth * $start_day;
- if ($start_hour >= 9 && $start_hour < 18) {
+ /*if ($start_hour >= 9 && $start_hour < 18) {
$right += ($start_hour - 9) * ($dayWidth / 9);
$right += ($start_min / 60) * ($dayWidth / 9);
} elseif ($start_hour >= 18) {
$right += $dayWidth;
- }
+ }*/
}
$left = 0;
@@ -273,12 +283,12 @@
$end_min = intval(strftime('%M', $end));
$left = $dayWidth * $end_day;
- if ($end_hour >= 9 && $end_hour < 18) {
+ /*if ($end_hour >= 9 && $end_hour < 18) {
$left += ($end_hour - 9) * ($dayWidth / 9);
$left += ($end_min / 60) * ($dayWidth / 9);
} elseif ($end_hour >= 18) {
$left += $dayWidth;
- }
+ }*/
$left = min(100, $left);
}
$right = 100;
Index: workweek.php
===================================================================
RCS file: /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/fbview/fbview/kronolith/lib/FBView/workweek.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- workweek.php 11 Nov 2004 15:08:48 -0000 1.4
+++ workweek.php 21 Dec 2004 23:59:57 -0000 1.5
@@ -212,6 +212,14 @@
}
$right = min(100, $right);
+ if( $left == $right ) {
+ // This is the minimum interval we can display
+ if( $left > 0 ) {
+ $left -= 1;
+ } else {
+ $right += 1;
+ }
+ }
$template->set('left', $left);
$template->set('width', $right - $left);
$template->set('top', $count++ * 15);
More information about the commits
mailing list