Fix duplication by changed event title

This commit is contained in:
Jörg Lehrke 2010-03-16 09:26:01 +00:00
parent a39a8b8eb8
commit abfc3f522b

View File

@ -142,6 +142,7 @@ class calendar_boupdate extends calendar_bo
{
$event['created'] = $this->now_su;
$event['creator'] = $GLOBALS['egw_info']['user']['account_id'];
$old_event = array();
}
else
{
@ -163,9 +164,13 @@ class calendar_boupdate extends calendar_bo
if ($event['category'])
{
if (!is_array($event['category'])) $event['category'] = explode(',',$event['category']);
if ($old_event && $old_event['category'] && !is_array($old_event['category']))
if (!$old_event || !isset($old_event['category']))
{
$old_event['category'] = explode(',',$old_event['category']);
$old_event['category'] = array();
}
elseif (!is_array($old_event['category']))
{
$old_event['category'] = explode(',', $old_event['category']);
}
foreach($event['category'] as $key => $cat_id)
{
@ -1547,8 +1552,8 @@ class calendar_boupdate extends calendar_bo
}
}
} elseif ($event['recur_type'] == $egwEvent['recur_type'] &&
$filter != 'master' &&
strpos($egwEvent['title'], $event['title']) === 0)
$filter != 'master' && ($filter == 'exact' ||
strpos($egwEvent['title'], $event['title']) === 0))
{
$matchingEvents[] = $egwEvent['id']; // we found the event
}
@ -2067,7 +2072,7 @@ class calendar_boupdate extends calendar_bo
// check for changed data
foreach (array('start','end','uid','title','location','description',
'priority','public','special','non_blocking') as $key)
{
{
if (!empty($event[$key]) && $recurrence_event[$key] != $event[$key])
{
if ($wasPseudo)
@ -2087,7 +2092,7 @@ class calendar_boupdate extends calendar_bo
}
break;
}
}
}
// the event id here is always the id of the master event
// unset it to prevent confusion of stored event and master event
unset($event['id']);