6.0.0-beta1
9/24/25

[#1557] Possible typo or bug in workweek FB view
Summary Possible typo or bug in workweek FB view
Queue Kronolith
Queue Version 2.0.2
Type Bug
State Resolved
Priority 1. Low
Owners Horde Developers (at)
Requester scalero (at) datadec (dot) es
Created 03/16/2005 (7497 days ago)
Due
Updated 04/27/2005 (7455 days ago)
Assigned 04/25/2005 (7457 days ago)
Resolved 04/27/2005 (7455 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
04/27/2005 08:20:27 AM Jan Schneider Comment #7
State ⇒ Resolved
Reply to this comment
Should be resolved with patch of bug 1868.
04/25/2005 03:58:46 PM tasin (at) fhm (dot) edu Comment #6
New Attachment: week2.diff Download
Reply to this comment
I suggest to delete the method inside workweek.php, due to the fact, 
that _getBlocks() of the parent class does now the same job.



Anyway there are still two problems:

1) the grid of the dates works only if the difference between 
_endHours and _startHours are dividable by 3 (w/o modulus)

(e.g. startHours==8:00 and endHours=0:00)

2) the painting (resp. the size) of the occupied blocks in 
workweek.php and week still aren't correct.



The first problem should be solved by the patch.

If I find a solution for prob. 2 I will let you know.

Ciao



Walter


04/25/2005 10:10:24 AM Jan Schneider Comment #5
Assigned to Horde DevelopersHorde Developers
State ⇒ Assigned
Reply to this comment
Looks good.
04/25/2005 08:48:58 AM scalero (at) datadec (dot) es Comment #4
New Attachment: workweek.patch.txt Download
Reply to this comment
Sorry but I do not following the code for:



if (($right - $left) != 0) {



I upload the patch, is correct??






04/22/2005 10:11:39 AM Jan Schneider Comment #3
Summary ⇒ Possible typo or bug in workweek FB view
Reply to this comment
Hello?
03/16/2005 12:35:40 PM Jan Schneider Comment #2
State ⇒ Feedback
Reply to this comment
The patch looks good, but can you explain what the

if (($right - $left) != 0) {

is for?



And please upload the patch as a unified diff and as an attachment to 
this ticket.
03/16/2005 07:51:33 AM scalero (at) datadec (dot) es Comment #1
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ Posible typo or bug in workweek FB view
Queue ⇒ Kronolith
State ⇒ Unconfirmed
Reply to this comment
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) {

Saved Queries