From 7018d081d211ff10029f416238e0998bca4a9eb3 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 25 Feb 2014 17:59:22 +0000 Subject: [PATCH] Fix missing state information --- calendar/inc/class.calendar_ui.inc.php | 34 ++++++++++++-------------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/calendar/inc/class.calendar_ui.inc.php b/calendar/inc/class.calendar_ui.inc.php index 86f3a3ef6c..69536c2f2e 100644 --- a/calendar/inc/class.calendar_ui.inc.php +++ b/calendar/inc/class.calendar_ui.inc.php @@ -419,26 +419,24 @@ class calendar_ui $GLOBALS['egw']->preferences->add('calendar','saved_states',$saved_states); $GLOBALS['egw']->preferences->save_repository(false,'user',true); } - // only run for calendar views - if (in_array(gettype($this), array('calendar_uilist', 'calendar_uiviews'))) + + // store state in request for clientside favorites to use + // remove date and other states never stored in a favorite + $states = array_diff_key($states,array('date'=>false,'year'=>false,'month'=>false,'day'=>false,'save_owner'=>false)); + if (strpos($_GET['menuaction'], 'ajax_sidebox') !== false) { - // store state in request for clientside favorites to use - // remove date and other states never stored in a favorite - $states = array_diff_key($states,array('date'=>false,'year'=>false,'month'=>false,'day'=>false,'save_owner'=>false)); - if (strpos($_GET['menuaction'], 'ajax_sidebox') !== false) - { - // sidebox request is from top frame, which has app.calendar NOT loaded by time response arrives - } - elseif (egw_json_request::isJSONRequest())// && strpos($_GET['menuaction'], 'calendar_uiforms') === false) - { - $response = egw_json_response::get(); - $response->apply('app.calendar.set_state', array($states, $_GET['menuaction'])); - } - else - { - egw_framework::set_extra('calendar', 'state', $states); - } + // sidebox request is from top frame, which has app.calendar NOT loaded by time response arrives } + elseif (egw_json_request::isJSONRequest())// && strpos($_GET['menuaction'], 'calendar_uiforms') === false) + { + $response = egw_json_response::get(); + $response->apply('app.calendar.set_state', array($states, $_GET['menuaction'])); + } + else + { + egw_framework::set_extra('calendar', 'state', $states); + } + } } }