* Calendar/CalDAV: fixed synced events still contained deleted exceptions

This commit is contained in:
Ralf Becker 2015-01-29 13:32:57 +00:00
parent eea3190f4c
commit c6505acdc6

View File

@ -823,15 +823,24 @@ class calendar_so
// set data, if recurrence is requested // set data, if recurrence is requested
if (isset($events[$id])) $events[$id]['participants'][$uid] = $status; if (isset($events[$id])) $events[$id]['participants'][$uid] = $status;
} }
// query recurrance exceptions, if needed // query recurrance exceptions, if needed: enum_recuring && !daywise is used in calendar_groupdav::get_series($uid,...)
if (!$params['enum_recuring']) if (!$params['enum_recuring'] || !$params['daywise'])
{ {
foreach($this->db->select($this->dates_table, 'cal_id,cal_start', array( foreach($this->db->select($this->dates_table, 'cal_id,cal_start', array(
'cal_id' => $ids, 'cal_id' => $ids,
'recur_exception' => true, 'recur_exception' => true,
), __LINE__, __FILE__, false, 'ORDER BY cal_id,cal_start', 'calendar') as $row) ), __LINE__, __FILE__, false, 'ORDER BY cal_id,cal_start', 'calendar') as $row)
{ {
$events[$row['cal_id']]['recur_exception'][] = $row['cal_start']; // for enum_recurring events are not indexed by cal_id, but $cal_id.'-'.$cal_start
// find master, which is first recurrence
if (!isset($events[$id=$row['cal_id']]))
{
foreach($events as $id => $event)
{
if ($event['id'] == $row['cal_id']) break;
}
}
$events[$id]['recur_exception'][] = $row['cal_start'];
} }
} }
//custom fields are not shown in the regular views, so we only query them, if explicitly required //custom fields are not shown in the regular views, so we only query them, if explicitly required