diff --git a/js/planning.js b/js/planning.js index 31d3c0a1f48..1eebfda58cb 100644 --- a/js/planning.js +++ b/js/planning.js @@ -91,7 +91,6 @@ var GLPIPlanning = { timeZone: 'UTC', theme: true, weekNumbers: options.full_view ? true : false, - defaultView: options.default_view, timeFormat: 'H:mm', eventLimit: true, // show 'more' button when too mmany events minTime: CFG_GLPI.planning_begin, @@ -615,6 +614,12 @@ var GLPIPlanning = { } }); + // Load the last known view only if it is valid (else load default view) + const view = this.calendar.isValidViewType(options.default_view) ? + options.default_view : + default_options.default_view; + this.calendar.changeView(view); + $('.planning_on_central a') .mousedown(function() { disable_qtip = true;