* Calendar: fix not working "no filter" favorite

This commit is contained in:
Ralf Becker 2015-08-27 12:03:29 +00:00
parent b55fcedaca
commit 263a5f5f2c

View File

@ -1316,18 +1316,18 @@ app.classes.calendar = AppJS.extend(
} }
} }
if (jQuery.isEmptyObject(state)) state.state = {};
// old calendar state handling on server-side (incl. switching to and from listview) // old calendar state handling on server-side (incl. switching to and from listview)
var menuaction = 'calendar.calendar_uiviews.index'; var menuaction = 'calendar.calendar_uiviews.index';
if (typeof state.state != 'undefined' && (typeof state.state.view == 'undefined' || state.state.view == 'listview')) if (typeof state.state != 'undefined' && (typeof state.state.view == 'undefined' || state.state.view == 'listview'))
{
if (state.name)
{ {
// 'blank' is the special name for no filters, send that instead of the nice translated name // 'blank' is the special name for no filters, send that instead of the nice translated name
state.state.favorite = jQuery.isEmptyObject(state) || jQuery.isEmptyObject(state.state||state.filter) ? 'blank' : state.name.replace(/[^A-Za-z0-9-_]/g, '_'); state.state.favorite = jQuery.isEmptyObject(state.state||state.filter) ? 'blank' : state.name.replace(/[^A-Za-z0-9-_]/g, '_');
// set date for "No Filter" (blank) favorite to todays date // set date for "No Filter" (blank) favorite to todays date
if (state.state.favorite == 'blank') if (state.state.favorite == 'blank')
state.state.date = jQuery.datepicker.formatDate('yymmdd', new Date); state.state.date = jQuery.datepicker.formatDate('yymmdd', new Date);
}
menuaction = 'calendar.calendar_uilist.listview'; menuaction = 'calendar.calendar_uilist.listview';
state.state.ajax = 'true'; state.state.ajax = 'true';
// check if we already use et2 / are in listview // check if we already use et2 / are in listview