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