Stop calendar from activating itself on every infolog save.

This commit is contained in:
Nathan Gray 2016-02-22 15:43:03 +00:00
parent d0a9e84fb6
commit 9627e5dd8d

View File

@ -255,7 +255,7 @@ app.classes.calendar = AppJS.extend(
if (do_refresh)
{
// Discard cache, reload
return this.observer('','calendar',_id ? 'infolog'+_id : false, _type);
this._clear_cache();
}
break;
case 'calendar':
@ -297,18 +297,8 @@ app.classes.calendar = AppJS.extend(
}
else
{
// Full refresh, clear the caches
var events = egw.dataKnownUIDs(_app);
for(var i = 0; i < events.length; i++)
{
egw.dataDeleteUID(_app + '::' + events[i]);
}
var daywise = egw.dataKnownUIDs(app.classes.calendar.DAYWISE_CACHE_ID);
for(var i = 0; i < daywise.length; i++)
{
// Empty to clear existing widgets
egw.dataStoreUID(app.classes.calendar.DAYWISE_CACHE_ID + '::' + daywise[i], null);
}
this._clear_cache();
// Force redraw to current state
this.setState({state: this.state});
}
@ -2584,6 +2574,25 @@ app.classes.calendar = AppJS.extend(
}
},
/**
* Clear all calendar data from egw.data cache
*/
_clear_cache: function() {
// Full refresh, clear the caches
var events = egw.dataKnownUIDs('calendar');
for(var i = 0; i < events.length; i++)
{
egw.dataDeleteUID('calendar::' + events[i]);
}
var daywise = egw.dataKnownUIDs(app.classes.calendar.DAYWISE_CACHE_ID);
for(var i = 0; i < daywise.length; i++)
{
// Empty to clear existing widgets
egw.dataStoreUID(app.classes.calendar.DAYWISE_CACHE_ID + '::' + daywise[i], null);
}
},
/**
* Take the date range(s) in the value and decide if we need to fetch data
* for the date ranges, or if they're already cached fill them in.