Tie sidebox calendar to listview, so if you click month, or click a week or day, it changes the listview filter too

This commit is contained in:
Nathan Gray 2015-12-16 20:41:54 +00:00
parent 6236c7e1ca
commit d67cbb39e7
2 changed files with 12 additions and 2 deletions

View File

@ -1154,6 +1154,15 @@ app.classes.calendar = AppJS.extend(
var filter = view ? view.getWidgetById('nm').getWidgetById('filter') : null;
var dates = view ? view.getWidgetById('calendar.list.dates') : null;
// Update state when user changes it
if(filter)
{
app.calendar.state.filter = filter.getValue();
}
else
{
delete app.calendar.state.filter;
}
if (filter && dates)
{
dates.set_disabled(filter.value !== "custom");
@ -2857,7 +2866,8 @@ app.classes.calendar = AppJS.extend(
else if (view == 'listview')
{
app.calendar.update_state({
end_date: app.calendar.date.toString(app.classes.calendar.views.week.end_date({date:date_widget.getValue()}))
end_date: app.calendar.date.toString(app.classes.calendar.views.week.end_date({date:date_widget.getValue()})),
filter: 'week'
});
}
});

View File

@ -47,7 +47,7 @@ Egroupware
</hbox>
<date id="date" class="et2_fullWidth" inline="true" onchange="var view_change = app.calendar.sidebox_changes_views.indexOf(app.calendar.state.view);
var update = {date:widget.getValue()};
if(view_change >= 0) {update.view = app.calendar.sidebox_changes_views[view_change ? view_change - 1 : view_change]}; app.calendar.update_state(update);"/>
if(view_change >= 0) {update.view = app.calendar.sidebox_changes_views[view_change ? view_change - 1 : view_change];} else if (app.calendar.state.view == 'listview') {update.filter = 'after';} app.calendar.update_state(update);"/>
<textbox type="hidden" id="first"/>
<textbox type="hidden" id="last"/>
<select-cat id="cat_id" empty_label="All categories" width="86%" onchange="app.calendar.update_state({cat_id: widget.getValue()});" expand_multiple_rows="4"/>