mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 23:00:56 +01:00
Make sure listview start & end dates stay valid
This commit is contained in:
parent
e9e6d8f5ab
commit
c91b4af435
@ -1592,7 +1592,11 @@ app.classes.calendar = AppJS.extend(
|
||||
delete state.date;
|
||||
delete state.first;
|
||||
delete state.last;
|
||||
|
||||
delete state.startdate;
|
||||
delete state.enddate;
|
||||
delete state.start_date;
|
||||
delete state.end_date;
|
||||
|
||||
return state;
|
||||
},
|
||||
|
||||
@ -1895,11 +1899,19 @@ app.classes.calendar = AppJS.extend(
|
||||
if(state.state.view === 'listview')
|
||||
{
|
||||
state.state.startdate = state.state.date;
|
||||
if(state.state.startdate.toJSON)
|
||||
{
|
||||
state.state.startdate = state.state.startdate.toJSON();
|
||||
}
|
||||
|
||||
if(state.state.end_date)
|
||||
{
|
||||
state.state.enddate = state.state.end_date;
|
||||
}
|
||||
if(state.state.enddate && state.state.enddate.toJSON)
|
||||
{
|
||||
state.state.enddate = state.state.enddate.toJSON();
|
||||
}
|
||||
state.state.col_filter = {participant: state.state.owner};
|
||||
state.state.search = state.state.keywords;
|
||||
|
||||
@ -1908,6 +1920,16 @@ app.classes.calendar = AppJS.extend(
|
||||
delete state.state.filter;
|
||||
|
||||
var nm = view.etemplates[0].widgetContainer.getWidgetById('nm');
|
||||
|
||||
// 'Custom' filter needs an end date
|
||||
if(nm.activeFilters.filter === 'custom' && !state.state.end_date)
|
||||
{
|
||||
state.state.enddate = state.state.last;
|
||||
}
|
||||
if(state.state.enddate && state.state.startdate && state.state.startdate > state.state.enddate)
|
||||
{
|
||||
state.state.enddate = state.state.startdate;
|
||||
}
|
||||
nm.applyFilters(state.state);
|
||||
if(!state.state.end_date && nm.activeFilters.enddate)
|
||||
{
|
||||
|
@ -5,9 +5,9 @@
|
||||
<template id="calendar.list.dates" template="" lang="" group="0" version="1.3.001">
|
||||
<hbox>
|
||||
<description value="Start"/>
|
||||
<date id="startdate"/>
|
||||
<date id="startdate" onchange="app.calendar.update_state({date: widget.getValue()}); return false;"/>
|
||||
<description value="End"/>
|
||||
<date id="enddate"/>
|
||||
<date id="enddate" onchange="app.calendar.update_state({end_date: widget.getValue()}); return false;"/>
|
||||
</hbox>
|
||||
</template>
|
||||
<template id="calendar.list.rows" template="" lang="" group="0" version="1.9.004">
|
||||
|
Loading…
Reference in New Issue
Block a user