plugins/calendar
Thomas Brüderli
bruederli at kolabsys.com
Tue Nov 12 09:03:05 CET 2013
plugins/calendar/calendar.php | 33 +++++++++++++++------------------
plugins/calendar/calendar_ui.js | 4 ++++
2 files changed, 19 insertions(+), 18 deletions(-)
New commits:
commit 65f4a8ce3d3080c5c23f5e3ae248af1ff0639497
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date: Tue Nov 12 09:02:41 2013 +0100
Fix calendar refreshing (#2516)
diff --git a/plugins/calendar/calendar.php b/plugins/calendar/calendar.php
index 1b76d2c..d0b6c02 100644
--- a/plugins/calendar/calendar.php
+++ b/plugins/calendar/calendar.php
@@ -942,27 +942,24 @@ 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),
- get_input_value('q', RCUBE_INPUT_GET),
- $cal['id'],
- 1,
- $attr['last']
- );
+ $events = $this->driver->load_events(
+ get_input_value('start', RCUBE_INPUT_GET),
+ get_input_value('end', RCUBE_INPUT_GET),
+ get_input_value('q', RCUBE_INPUT_GET),
+ $cal['id'],
+ 1,
+ $attr['last']
+ );
- foreach ($events as $event) {
- $this->rc->output->command('plugin.refresh_calendar',
- array('source' => $cal['id'], 'update' => $this->_client_event($event)));
- }
+ foreach ($events as $event) {
+ $this->rc->output->command('plugin.refresh_calendar',
+ array('source' => $cal['id'], 'update' => $this->_client_event($event)));
}
}
}
diff --git a/plugins/calendar/calendar_ui.js b/plugins/calendar/calendar_ui.js
index c76939f..64d67c2 100644
--- a/plugins/calendar/calendar_ui.js
+++ b/plugins/calendar/calendar_ui.js
@@ -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; });
More information about the commits
mailing list