mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-13 17:38:19 +01:00
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:
parent
6236c7e1ca
commit
d67cbb39e7
@ -1154,6 +1154,15 @@ app.classes.calendar = AppJS.extend(
|
|||||||
var filter = view ? view.getWidgetById('nm').getWidgetById('filter') : null;
|
var filter = view ? view.getWidgetById('nm').getWidgetById('filter') : null;
|
||||||
var dates = view ? view.getWidgetById('calendar.list.dates') : 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)
|
if (filter && dates)
|
||||||
{
|
{
|
||||||
dates.set_disabled(filter.value !== "custom");
|
dates.set_disabled(filter.value !== "custom");
|
||||||
@ -2857,7 +2866,8 @@ app.classes.calendar = AppJS.extend(
|
|||||||
else if (view == 'listview')
|
else if (view == 'listview')
|
||||||
{
|
{
|
||||||
app.calendar.update_state({
|
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'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -47,7 +47,7 @@ Egroupware
|
|||||||
</hbox>
|
</hbox>
|
||||||
<date id="date" class="et2_fullWidth" inline="true" onchange="var view_change = app.calendar.sidebox_changes_views.indexOf(app.calendar.state.view);
|
<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()};
|
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="first"/>
|
||||||
<textbox type="hidden" id="last"/>
|
<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"/>
|
<select-cat id="cat_id" empty_label="All categories" width="86%" onchange="app.calendar.update_state({cat_id: widget.getValue()});" expand_multiple_rows="4"/>
|
||||||
|
Loading…
Reference in New Issue
Block a user