mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 04:29:28 +01:00
Cleanup all-day handling
This commit is contained in:
parent
a707c183f3
commit
2a2a9f5f11
@ -1657,7 +1657,7 @@ class calendar_boupdate extends calendar_bo
|
|||||||
|
|
||||||
if ($filter != 'master' && ($filter != 'exact' || empty($event['uid'])))
|
if ($filter != 'master' && ($filter != 'exact' || empty($event['uid'])))
|
||||||
{
|
{
|
||||||
if (isset($event['whole_day']) && $event['whole_day'])
|
if (!empty($event['whole_day']))
|
||||||
{
|
{
|
||||||
if ($filter == 'relax')
|
if ($filter == 'relax')
|
||||||
{
|
{
|
||||||
@ -1781,19 +1781,7 @@ class calendar_boupdate extends calendar_bo
|
|||||||
// check times
|
// check times
|
||||||
if ($filter != 'relax')
|
if ($filter != 'relax')
|
||||||
{
|
{
|
||||||
if (isset($event['whole_day'])&& $event['whole_day'])
|
if (empty($event['whole_day']))
|
||||||
{
|
|
||||||
if (!$this->so->isWholeDay($egwEvent))
|
|
||||||
{
|
|
||||||
if ($this->log)
|
|
||||||
{
|
|
||||||
error_log(__FILE__.'['.__LINE__.'] '.__METHOD__.
|
|
||||||
"() egwEvent is not a whole-day event!\n",3,$this->logfile);
|
|
||||||
}
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
if (abs($event['end'] - $egwEvent['end']) >= 120)
|
if (abs($event['end'] - $egwEvent['end']) >= 120)
|
||||||
{
|
{
|
||||||
@ -1805,6 +1793,18 @@ class calendar_boupdate extends calendar_bo
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!$this->so->isWholeDay($egwEvent))
|
||||||
|
{
|
||||||
|
if ($this->log)
|
||||||
|
{
|
||||||
|
error_log(__FILE__.'['.__LINE__.'] '.__METHOD__.
|
||||||
|
"() egwEvent is not a whole-day event!\n",3,$this->logfile);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for real match
|
// check for real match
|
||||||
|
@ -490,7 +490,7 @@ class calendar_sif extends calendar_boupdate
|
|||||||
// not merge
|
// not merge
|
||||||
// SIF clients do not support participants => add them back
|
// SIF clients do not support participants => add them back
|
||||||
unset($event['participants']);
|
unset($event['participants']);
|
||||||
if ($event['whole_day'] && $event['tzid'] != $event_info['stored_event']['tzid'])
|
if (!empty($event['whole_day']) && $event['tzid'] != $event_info['stored_event']['tzid'])
|
||||||
{
|
{
|
||||||
if (!isset(self::$tz_cache[$event_info['stored_event']['tzid']]))
|
if (!isset(self::$tz_cache[$event_info['stored_event']['tzid']]))
|
||||||
{
|
{
|
||||||
@ -524,9 +524,7 @@ class calendar_sif extends calendar_boupdate
|
|||||||
else // common adjustments for new events
|
else // common adjustments for new events
|
||||||
{
|
{
|
||||||
// set non blocking all day depending on the user setting
|
// set non blocking all day depending on the user setting
|
||||||
if (isset($event['whole_day'])
|
if (!empty($event['whole_day']) && $this->nonBlockingAllday)
|
||||||
&& $event['whole_day']
|
|
||||||
&& $this->nonBlockingAllday)
|
|
||||||
{
|
{
|
||||||
$event['non_blocking'] = 1;
|
$event['non_blocking'] = 1;
|
||||||
}
|
}
|
||||||
@ -906,7 +904,7 @@ class calendar_sif extends calendar_boupdate
|
|||||||
}
|
}
|
||||||
elseif (!$recur_date &&
|
elseif (!$recur_date &&
|
||||||
$event['recur_type'] != MCAL_RECUR_NONE &&
|
$event['recur_type'] != MCAL_RECUR_NONE &&
|
||||||
!isset($event['whole_day'])) // whole-day events are not shifted
|
empty($event['whole_day'])) // whole-day events are not shifted
|
||||||
{
|
{
|
||||||
// Add the timezone transition related pseudo exceptions
|
// Add the timezone transition related pseudo exceptions
|
||||||
$exceptions = $this->so->get_recurrence_exceptions($event, $tzid, 0, 0, 'tz_rrule');
|
$exceptions = $this->so->get_recurrence_exceptions($event, $tzid, 0, 0, 'tz_rrule');
|
||||||
@ -1059,16 +1057,7 @@ class calendar_sif extends calendar_boupdate
|
|||||||
$sifEvent .= '<Exceptions>';
|
$sifEvent .= '<Exceptions>';
|
||||||
foreach ($event['recur_exception'] as $day)
|
foreach ($event['recur_exception'] as $day)
|
||||||
{
|
{
|
||||||
if (isset($event['whole_day']))
|
if (empty($event['whole_day']))
|
||||||
{
|
|
||||||
if (!is_a($day,'DateTime'))
|
|
||||||
{
|
|
||||||
$day = new egw_time($day,egw_time::$server_timezone);
|
|
||||||
$day->setTimezone(self::$tz_cache[$event['tzid']]);
|
|
||||||
}
|
|
||||||
$sifEvent .= '<ExcludeDate>' . $day->format('Y-m-d') . '</ExcludeDate>';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
if ($this->log && is_a($day,'DateTime'))
|
if ($this->log && is_a($day,'DateTime'))
|
||||||
{
|
{
|
||||||
@ -1078,6 +1067,15 @@ class calendar_sif extends calendar_boupdate
|
|||||||
}
|
}
|
||||||
$sifEvent .= '<ExcludeDate>' . self::getDateTime($day,$tzid) . '</ExcludeDate>';
|
$sifEvent .= '<ExcludeDate>' . self::getDateTime($day,$tzid) . '</ExcludeDate>';
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!is_a($day,'DateTime'))
|
||||||
|
{
|
||||||
|
$day = new egw_time($day,egw_time::$server_timezone);
|
||||||
|
$day->setTimezone(self::$tz_cache[$event['tzid']]);
|
||||||
|
}
|
||||||
|
$sifEvent .= '<ExcludeDate>' . $day->format('Y-m-d') . '</ExcludeDate>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$sifEvent .= '</Exceptions>';
|
$sifEvent .= '</Exceptions>';
|
||||||
}
|
}
|
||||||
@ -1099,7 +1097,13 @@ class calendar_sif extends calendar_boupdate
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'Start':
|
case 'Start':
|
||||||
if (isset($event['whole_day']))
|
if (empty($event['whole_day']))
|
||||||
|
{
|
||||||
|
$sifEvent .= '<Start>' . self::getDateTime($event['start'],$tzid) . '</Start>';
|
||||||
|
$sifEvent .= '<End>' . self::getDateTime($event['end'],$tzid) . '</End>';
|
||||||
|
$sifEvent .= "<AllDayEvent>0</AllDayEvent>";
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// for whole-day events we use the date in event timezone
|
// for whole-day events we use the date in event timezone
|
||||||
$time = new egw_time($event['start'],egw_time::$server_timezone);
|
$time = new egw_time($event['start'],egw_time::$server_timezone);
|
||||||
@ -1110,12 +1114,6 @@ class calendar_sif extends calendar_boupdate
|
|||||||
$sifEvent .= '<End>' . $time->format('Y-m-d') . '</End>';
|
$sifEvent .= '<End>' . $time->format('Y-m-d') . '</End>';
|
||||||
$sifEvent .= "<AllDayEvent>1</AllDayEvent>";
|
$sifEvent .= "<AllDayEvent>1</AllDayEvent>";
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
$sifEvent .= '<Start>' . self::getDateTime($event['start'],$tzid) . '</Start>';
|
|
||||||
$sifEvent .= '<End>' . self::getDateTime($event['end'],$tzid) . '</End>';
|
|
||||||
$sifEvent .= "<AllDayEvent>0</AllDayEvent>";
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'ReminderMinutesBeforeStart':
|
case 'ReminderMinutesBeforeStart':
|
||||||
|
Loading…
Reference in New Issue
Block a user