diff --git a/calendar/inc/class.calendar_ui.inc.php b/calendar/inc/class.calendar_ui.inc.php index 30e746a46b..0a6058ded2 100644 --- a/calendar/inc/class.calendar_ui.inc.php +++ b/calendar/inc/class.calendar_ui.inc.php @@ -272,7 +272,16 @@ class calendar_ui // only look at _REQUEST, if we are in the calendar (prefs and admin show our sidebox menu too!) if (is_null($set_states)) { - $set_states = substr($_GET['menuaction'],0,9) == 'calendar.' ? $_REQUEST : array(); + // ajax-exec call has get-parameter in some json + if (isset($_REQUEST['json_data']) && ($json_data = json_decode($_REQUEST['json_data'], true)) && + !empty($json_data['request']['parameters'][0])) + { + parse_str(substr($json_data['request']['parameters'][0], 10), $set_states); // cut off "/index.php?" + } + else + { + $set_states = substr($_GET['menuaction'],0,9) == 'calendar.' ? $_REQUEST : array(); + } } if (!$states['date'] && $states['year'] && $states['month'] && $states['day']) { @@ -561,7 +570,7 @@ class calendar_ui 'icon' => false ) )); - + $n = 0; // index for file-array $planner_days_for_view = false; diff --git a/calendar/js/app.js b/calendar/js/app.js index ba1f162d12..ec8fd8a966 100644 --- a/calendar/js/app.js +++ b/calendar/js/app.js @@ -34,7 +34,7 @@ app.classes.calendar = AppJS.extend( { // call parent this._super.apply(this, arguments); - + // make calendar object available, even if not running in top window, as sidebox does if (window.top !== window && typeof window.top.app.calendar == 'undefined') { @@ -547,20 +547,21 @@ app.classes.calendar = AppJS.extend( if (typeof state.state != 'undefined' && state.state.view == 'undefined' || state.state.view == 'listview') { menuaction = 'calendar.calendar_uilist.listview'; + state.state.ajax = 'true'; if (state.name) { - state.state = {favorite: state.name.replace(/[^A-Za-z0-9-_]/g, '_')}; + state.state.favorite = state.name.replace(/[^A-Za-z0-9-_]/g, '_'); } } var query = jQuery.extend({menuaction: menuaction},state.state||{}); - + // prepend an owner 0, to reset all owners and not just set given resource type if(typeof query.owner != 'undefined') { query.owner = '0,'+ query.owner; } - this.egw.open_link(this.egw.link('/',query), 'calendar'); + this.egw.open_link(this.egw.link('/index.php',query), 'calendar'); // Stop the normal bubbling if this is called on click return false;