run notifications and tracking after response send to client

This commit is contained in:
Ralf Becker 2020-07-16 18:33:12 +02:00
parent 406cc7ec8b
commit b02aa04c8c

View File

@ -1496,15 +1496,18 @@ class calendar_boupdate extends calendar_bo
// Update history
$tracking = new calendar_tracking($this);
Api\Egw::on_shutdown(function() use ($tracking, $event, $cal_id, $timestamps, $save_event, $old_event)
{
if (empty($event['id']) && !empty($cal_id)) $event['id'] = $cal_id;
// we run all dates through date2ts, to adjust to server-time and the possible date-formats
// This is done here to avoid damaging the actual event when saving, but the old event is in server-time
foreach ($timestamps as $ts)
{
// we convert here from user-time to timestamps in server-time!
if (isset($save_event[$ts])) $save_event[$ts] = $save_event[$ts] ? $this->date2ts($save_event[$ts],true) : 0;
if (isset($save_event[$ts])) $save_event[$ts] = $save_event[$ts] ? calendar_bo::date2ts($save_event[$ts], true) : 0;
}
$tracking->track($save_event, $old_event);
});
return $cal_id;
}