* Calendar: fixed recuring event lost start-date, if single recurrence got deleted, also installed save-guard in case other code triggers that too

caused by storing an event with unset start- or end-date, to not write it
This commit is contained in:
Ralf Becker 2012-10-02 16:43:49 +00:00
parent 7410c738c8
commit 49f1d43ad1
2 changed files with 7 additions and 7 deletions

View File

@ -1481,8 +1481,6 @@ class calendar_boupdate extends calendar_bo
$recur_date = $this->date2ts($event['start']);
$event = $this->read($cal_id);
$event['recur_exception'][] = $recur_date;
unset($event['start']);
unset($event['end']);
$this->save($event); // updates the content-history
}
if ($event['reference'])

View File

@ -995,11 +995,13 @@ ORDER BY cal_user_type, cal_usre_id
unset($event[$col]);
}
}
// set range_start/_end
$event['range_start'] = $event['cal_start'];
$event['range_end'] = $event['recur_type'] == MCAL_RECUR_NONE ? $event['cal_end'] :
($event['recur_enddate'] ? $event['recur_enddate'] : null);
// set range_start/_end, but only if we have cal_start/_end, as otherwise we destroy present values!
if (isset($event['cal_start'])) $event['range_start'] = $event['cal_start'];
if (isset($event['cal_end']))
{
$event['range_end'] = $event['recur_type'] == MCAL_RECUR_NONE ? $event['cal_end'] :
($event['recur_enddate'] ? $event['recur_enddate'] : null);
}
// ensure that we find mathing entries later on
if (!is_array($event['cal_category']))
{