Fix recurring event issue

This commit is contained in:
Jörg Lehrke 2010-02-10 19:47:39 +00:00
parent e763d692c9
commit ad79f404e9

View File

@ -1873,22 +1873,10 @@ class calendar_boupdate extends calendar_bo
$recurrence_event = false;
$wasPseudo = false;
if ($event['recur_type'] != MCAL_RECUR_NONE)
{
$type = 'SERIES-MASTER';
}
else
{
// SINGLE, SERIES-EXCEPTION OR SERIES-EXCEPTON-STATUS
if (($foundEvents = $this->find_event($event, 'exact')))
{
// We found the exact match
$eventID = array_shift($foundEvents);
if ($this->log)
{
error_log(__FILE__.'['.__LINE__.'] '.__METHOD__.
"()[EVENT]: $eventID");
}
if (strstr($eventID, ':'))
{
$type = 'SERIES-PSEUDO-EXCEPTION';
@ -1903,17 +1891,24 @@ class calendar_boupdate extends calendar_bo
{
$stored_event = $this->read($eventID, 0, false, 'server');
}
if (empty($event['uid']))
if (!empty($stored_event['uid']) && empty($event['uid']))
{
$event['uid'] = $stored_event['uid']; // restore the UID if it was not delivered
}
}
if ($event['recur_type'] != MCAL_RECUR_NONE)
{
$type = 'SERIES-MASTER';
}
if ($type == 'SINGLE' &&
($foundEvents = $this->find_event($event, 'master')))
{
// Let's try to find a related series
// SINGLE, SERIES-EXCEPTION OR SERIES-EXCEPTON-STATUS
foreach ($foundEvents as $eventID)
{
// Let's try to find a related series
if ($this->log)
{
error_log(__FILE__.'['.__LINE__.'] '.__METHOD__.
@ -2008,7 +2003,6 @@ class calendar_boupdate extends calendar_bo
// unset it to prevent confusion of stored event and master event
unset($event['id']);
}
}
// check ACL
if (is_array($master_event))