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['created'] = $this->now_su;
$event['creator'] = $GLOBALS['egw_info']['user']['account_id']; $event['creator'] = $GLOBALS['egw_info']['user']['account_id'];
$old_event = array();
} }
else else
{ {
@ -163,9 +164,13 @@ class calendar_boupdate extends calendar_bo
if ($event['category']) if ($event['category'])
{ {
if (!is_array($event['category'])) $event['category'] = explode(',',$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) foreach($event['category'] as $key => $cat_id)
{ {
@ -1547,8 +1552,8 @@ class calendar_boupdate extends calendar_bo
} }
} }
} elseif ($event['recur_type'] == $egwEvent['recur_type'] && } elseif ($event['recur_type'] == $egwEvent['recur_type'] &&
$filter != 'master' && $filter != 'master' && ($filter == 'exact' ||
strpos($egwEvent['title'], $event['title']) === 0) strpos($egwEvent['title'], $event['title']) === 0))
{ {
$matchingEvents[] = $egwEvent['id']; // we found the event $matchingEvents[] = $egwEvent['id']; // we found the event
} }