[kronolith] sql driver patch - multiday events

Jesse Wolff jesse_wolff@yahoo.com
Mon, 1 Oct 2001 17:53:43 -0700


Thanks Jan for applying the patch to cvs.

I still run into 2 problems with the summary view (lib/api.php). When the fix 
was made in cvs the checks for the driver type where not included and changed 
some of the logic a bit. 

Here are the issues and some proposed fixes. It's all based on the latest cvs. 
I've tested the fixes and with them, recurrences and multi-day events should 
both show up correctly in the summary view. 

1) The times for recurrence events don't show correctly when the recurrence 
start date is greater than the current time.

This problem is due to the second part of the if statement on line 33-34:

if (!$event->hasRecurType(KRONOLITH_RECUR_NONE) &&
                 $event->startTimestamp < $now) {

I can't find a reason why this check is necessary for the sql driver and it 
causes the above problem. If mcal doesn't need it as well we can take it out by 
changing the line to:

if (!$event->hasRecurType(KRONOLITH_RECUR_NONE)) {

If mcal needs it, we can change it to:

$driver = $GLOBALS['conf']['calendar']['driver'];
if (!$event->hasRecurType(KRONOLITH_RECUR_NONE) &&
    ($driver != 'mcal' ||
    ($driver == 'mcal' && $event->startTimestamp < $now))) {


2) The times for multi-day events don't show up correctly.

This is due to line 44:

$event->endTimestamp = $event->startTimestamp + $event->durMin * 60;

For the sql driver it shouldn't be included. If it's not needed by mcal it can 
be deleted. If it's needed by mcal it will need to be wrapped by a check for 
the driver.

if ($driver == 'mcal') {
    $event->endTimestamp = $event->startTimestamp + $event->durMin * 60;
}


Thanks again,
Jesse.

Quoting Jan Schneider <janmailing@gmx.de>

>Many thanks, great work!
>
>Zitat von Jesse Wolff <jesse_wolff@yahoo.com>:
>
>> Hey all,
>> 
>> Attached is a patch based on the latest cvs that allows you to correctly 
>> displays events that span multiple days when using the sql driver. It should
>> display correctly in all views - day, week, month and horde summary. There's
>> no time limit on how long an event can last.