[Tickets #1557] NEW: Posible typo or bug in workweek FB view

bugs at bugs.horde.org bugs at bugs.horde.org
Tue Mar 15 23:51:34 PST 2005


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

Ticket URL: http://bugs.horde.org/ticket/?id=1557
-----------------------------------------------------------------------
 Ticket             | 1557
 Created By         | scalero at datadec.es
 Summary            | Posible typo or bug in workweek FB view
 Queue              | Kronolith
 Version            | 2.0.2
 State              | Unconfirmed
 Priority           | 1. Low
 Type               | Bug
 Owners             | 
-----------------------------------------------------------------------


scalero at datadec.es (2005-03-15 23:51) wrote:

Sametimes do not appear correctly the blocks of FB in the workweek view, the
blocks that happen before to 9:00 and after to 18:00 not appear. This is due
to the function '_getBlocks' of file 'kronolith/lib/FBView/workweek.php',
compared with 'kronolith/lib/FBView/week.php' it seems the following
variables have been fixed:

$this->_startHour --> 9
$this->_endHour   --> 18

I think this function must be the same function as the week view but with
$dayWidth fixed to 20.

Is this correct? 


If I apply this patch all works OK:

RCS file: /horde/kronolith/lib/FBView/workweek.php
diff -r1.1 -r1.2
40,43c40,43
<                 if ($start_hour >= 9 && $start_hour < 18) {
<                     $left += ($start_hour - 9) * (20 / 9);
<                     $left += ($start_min / 60) * (20 / 9);
<                 } elseif ($start_hour >= 18) {
---
>                 if ($start_hour >= $this->_startHour && $start_hour <
$this->_endHour) {
>                     $left += ($start_hour - $this->_startHour) * (20 /
$this->_startHour);
>                     $left += ($start_min / 60) * (20 /
$this->_startHour);
>                 } elseif ($start_hour >= $this->_endHour) {
46c46
<                 $left = max(0, $left);
---
>                 $left = min(100, max(0, $left));
53,56c53,56
<                 if ($end_hour >= 9 && $end_hour < 18) {
<                     $right += ($end_hour - 9) * (20 / 9);
<                     $right += ($end_min / 60) * (20 / 9);
<                 } elseif ($end_hour >= 18) {
---
>                 if ($end_hour >= $this->_startHour && $end_hour <
$this->_endHour) {
>                     $right += ($end_hour - $this->_startHour) * (20 /
$this->_startHour);
>                     $right += ($end_min / 60) * (20 / $this->_startHour);
>                 } elseif ($end_hour >= $this->_endHour) {
61,64c61,65
<                 $template->set('left', $left);
<                 $template->set('width', $right - $left);
<                 $template->set('top', $count++ * 15);
<                 $template->set('label', $label);
---
>                 if (($right - $left) != 0) {
>                     $template->set('left', $left);
>                     $template->set('width', $right - $left);
>                     $template->set('top', $count++ * 15);
>                     $template->set('label', $label);
66c67,68
<                 $blocks .= $template->fetch(KRONOLITH_TEMPLATES .
'/fbview/' . $blockfile);
---
>                     $blocks .= $template->fetch(KRONOLITH_TEMPLATES .
'/fbview/' . $blockfile);
>                 }
82,85c84,87
<                 if ($start_hour >= 9 && $start_hour < 18) {
<                     $right += ($start_hour - 9) * (20 / 9);
<                     $right += ($start_min / 60) * (20 / 9);
<                 } elseif ($start_hour >= 18) {
---
>                 if ($start_hour >= $this->_startHour && $start_hour <
$this->_endHour) {
>                     $right += ($start_hour - $this->_startHour) * (20 /
$this->_startHour);
>                     $right += ($start_min / 60) * (20 /
$this->_startHour);
>                 } elseif ($start_hour >= $this->_endHour) {
105,108c107,110
<                 if ($end_hour >= 9 && $end_hour < 18) {
<                     $left += ($end_hour - 9) * (20 / 9);
<                     $left += ($end_min / 60) * (20 / 9);
<                 } elseif ($end_hour >= 18) {
---
>                 if ($end_hour >= $this->_startHour && $end_hour <
$this->_endHour) {
>                     $left += ($end_hour - $this->_startHour) * (20 /
$this->_startHour);
>                     $left += ($end_min / 60) * (20 / $this->_startHour);
>                 } elseif ($end_hour >= $this->_endHour) {




More information about the bugs mailing list