Send holiday cache data for current year on initial load, so it's available for sidebox menu.

This commit is contained in:
nathangray 2016-05-16 11:21:03 -06:00
parent 62b7beec71
commit ffccce1c8a
2 changed files with 10 additions and 0 deletions

View File

@ -557,6 +557,9 @@ class calendar_ui
$cont['view'] = $this->view ? $this->view : 'week';
$cont['date'] = $this->date ? $this->date : Api\DateTime();
$cont['year'] = (int)Api\DateTime::to($cont['date'],'Y');
$cont['holidays'] = $this->bo->read_holidays($cont['year']);
$readonlys = array();
$sel_options['status_filter'] = array(
array('value' => 'default', 'label' => lang('Not rejected'), 'title' => lang('Show all status, but rejected')),

View File

@ -181,7 +181,14 @@ app.classes.calendar = (function(){ "use strict"; return AppJS.extend(
this.sidebox_et2 = _et2.widgetContainer;
this.sidebox_hooked_templates.push(this.sidebox_et2);
$j(_et2.DOMContainer).hide();
// Set client side holiday cache for this year
egw.window.et2_calendar_view.holiday_cache[content.data.year] = content.data.holidays;
delete content.data.holidays;
delete content.data.year;
this._setup_sidebox_filters();
this.state = content.data;
break;