From e3c468361de34f061314ed364b736a1f57b4a3fb Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 12 Oct 2009 09:34:56 +0000 Subject: [PATCH] "stop calendar to update prefs on each request (do it only on change)" --- calendar/inc/class.calendar_ui.inc.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/calendar/inc/class.calendar_ui.inc.php b/calendar/inc/class.calendar_ui.inc.php index 1b8d4b151c..f146332d76 100644 --- a/calendar/inc/class.calendar_ui.inc.php +++ b/calendar/inc/class.calendar_ui.inc.php @@ -381,9 +381,12 @@ class calendar_ui // save defined states into the user-prefs if(!empty($states) && is_array($states)) { - $saved_states = array_intersect_key($states,array_flip($this->states_to_save)); - $GLOBALS['egw']->preferences->add('calendar','saved_states',serialize($saved_states)); - $GLOBALS['egw']->preferences->save_repository(false,'user',false); + $saved_states = serialize(array_intersect_key($states,array_flip($this->states_to_save))); + if ($saved_states != $this->cal_prefs['saved_states']) + { + $GLOBALS['egw']->preferences->add('calendar','saved_states',$saved_states); + $GLOBALS['egw']->preferences->save_repository(false,'user',false); + } } }