Fix calendar refreshing (#2516)
This commit is contained in:
parent
0bd01c80f5
commit
65f4a8ce3d
2 changed files with 19 additions and 18 deletions
|
@ -942,14 +942,12 @@ class calendar extends rcube_plugin
|
|||
public function refresh($attr)
|
||||
{
|
||||
// refresh the entire calendar every 10th time to also sync deleted events
|
||||
$refetch = rand(0,10) == 10;
|
||||
if (rand(0,10) == 10) {
|
||||
$this->rc->output->command('plugin.refresh_calendar', array('refetch' => true));
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($this->driver->list_calendars(true) as $cal) {
|
||||
if ($refetch) {
|
||||
$this->rc->output->command('plugin.refresh_calendar',
|
||||
array('source' => $cal['id'], 'refetch' => true));
|
||||
}
|
||||
else {
|
||||
$events = $this->driver->load_events(
|
||||
get_input_value('start', RCUBE_INPUT_GET),
|
||||
get_input_value('end', RCUBE_INPUT_GET),
|
||||
|
@ -965,7 +963,6 @@ class calendar extends rcube_plugin
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handler for pending_alarms plugin hook triggered by the calendar module on keep-alive requests.
|
||||
|
|
|
@ -2164,6 +2164,10 @@ function rcube_calendar_ui(settings)
|
|||
if (me.fisheye_date)
|
||||
me.fisheye_view(me.fisheye_date);
|
||||
}
|
||||
// refetch all calendars
|
||||
else if (p.refetch) {
|
||||
fc.fullCalendar('refetchEvents');
|
||||
}
|
||||
|
||||
// remove temp events
|
||||
fc.fullCalendar('removeEvents', function(e){ return e.temp; });
|
||||
|
|
Loading…
Add table
Reference in a new issue