mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-12 17:08:34 +01:00
Try to not always refresh calendar via observer for every infolog entry, but only the ones that are integrated in calendar
This commit is contained in:
parent
2244d6fc63
commit
dcad41f542
@ -141,26 +141,40 @@ app.classes.calendar = AppJS.extend(
|
||||
*/
|
||||
observer: function(_msg, _app, _id, _type, _msg_type, _links)
|
||||
{
|
||||
if (typeof _links != 'undefined')
|
||||
var do_refresh = false;
|
||||
switch(_app)
|
||||
{
|
||||
if (typeof _links.calendar != 'undefined')
|
||||
case 'infolog':
|
||||
{
|
||||
switch(_app)
|
||||
jQuery('.calendar_calDayTodos')
|
||||
.find('a')
|
||||
.each(function(i,a){
|
||||
var match = a.href.split(/&info_id=/);
|
||||
if (match && typeof match[1] !="undefined")
|
||||
{
|
||||
if (match[1]== _id) do_refresh = true;
|
||||
}
|
||||
});
|
||||
if (jQuery('div [id^="infolog'+_id+'"]').length > 0) do_refresh = true;
|
||||
switch (_type)
|
||||
{
|
||||
case 'infolog':
|
||||
case 'add':
|
||||
do_refresh = true;
|
||||
break;
|
||||
}
|
||||
if (do_refresh)
|
||||
{
|
||||
if (typeof this.et2 != 'undefined' && this.et2 !=null)
|
||||
{
|
||||
if (typeof this.et2 != 'undefined' && this.et2 !=null)
|
||||
{
|
||||
this.egw.refresh(_msg, 'calendar');
|
||||
}
|
||||
else
|
||||
{
|
||||
window.location.reload();
|
||||
}
|
||||
this.egw.refresh(_msg, 'calendar');
|
||||
}
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
window.location.reload();
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -96,7 +96,23 @@ app.classes.infolog = AppJS.extend(
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//Refresh handler for infologs integrated in calendar
|
||||
if (_app == 'infolog' && _id && _type !='delete')
|
||||
{
|
||||
var info_type = egw.dataGetUIDdata(_app+"::"+_id)?egw.dataGetUIDdata(_app+"::"+_id).data.info_type:false;
|
||||
var cal_show = egw.preference('cal_show','infolog')||false;
|
||||
|
||||
if (info_type && cal_show)
|
||||
{
|
||||
var rex = RegExp(info_type,'gi');
|
||||
if (cal_show.match(rex))
|
||||
{
|
||||
//Trigger refresh the whole calendar if the changed infolog entry is integrated one
|
||||
if (typeof app['calendar'] != 'undefined') app.calendar.egw.window.location.reload();
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user