[dev] kronolith 2.1.4 and multiple all-day appointments

Chuck Hagenbuch chuck at horde.org
Mon Dec 11 08:02:30 PST 2006


Quoting Chris Stromsoe <cbs at cts.ucla.edu>:

> Multiple all-day appointments in the week and work-week views in  
> 2.1.4 are confusing.  If the appointments overlap, different  
> appointments end up appearing adjacent to each other on the same  
> line.  I'm re-doing the all-day implementation to use a single solid  
> bar, cover from start to finish (including the spacer block between  
> days).
>
> This block is from html() in kronolith/lib/WeekView.php.  What is  
> line #140 checking for?  I changed the &nbsp; in 141 to include some  
> text so I could see when it's being used, but haven't been able to  
> trigger that block.
>
> 132    $row = '';
> 133    for ($j = $this->startDay; $j <= $this->endDay; $j++) {
> 134        $row .= '<td class="hour" align="right">' .  
> ($more_timeslots ? _("All day") : '&nbsp;') . '</td>';
> 135        $row .= '<td colspan="' . $this->days[$j]->_totalspan .  
> '" valign="top"><table width="100%" cellspacing="0">';
> 136        if ($this->days[$j]->_all_day_maxrowspan > 0) {
> 137            for ($k = 0; $k <  
> $this->days[$j]->_all_day_maxrowspan; $k++) {
> 138                $row .= '<tr>';
> 139                foreach ($this->days[$j]->_currentCalendars as  
> $cid => $cal) {
> 140                    if  
> (count($this->days[$j]->_all_day_events[$cid]) === $k) {
> 141                        $row .= '<td rowspan="' .  
> ($this->days[$j]->_all_day_maxrowspan - $k) . '" width="'. round(99  
> / count($this->days[$j]->_currentCalendars)) . '%">&nbsp;</td>';
> 142                    } elseif  
> (count($this->days[$j]->_all_day_events[$cid]) > $k) {
> 143                        $event =  
> $this->days[$j]->_all_day_events[$cid][$k];
> 144                        $eventCategories[$event->getCategory()] = true;
> 145
> 146                        $row .= '<td class="week-eventbox  
> category' . md5($event->getCategory()) . '" ' .
> 147                            'width="' . round(99 /  
> count($this->days[$j]->_currentCalendars)) . '%" ' .
> 148                            'valign="top">' .
> 149                             
> $event->getLink($this->days[$j]->getStamp()) . '</td>';
> 150                    }
> 151                }
> 152                $row .= '</tr>';
> 153            }
> 154        } else {
> 155            $row .= '<tr><td colspan="' .  
> count($this->_currentCalendars) . '">&nbsp;</td></tr>';
> 156        }
> 157        $row .= '</table></td>';
> 158    }

Interesting - I'm not sure either. If you figure it out, please leave  
a comment. :) Did you try looking at the CVS history?

Looks like it came along with the side-by-side view patches. Still  
don't know what for.

-chuck

-- 
"we are plastered to the windshield of the bus that is time." - Chris


More information about the dev mailing list