Fix integrated apps were opening in calendar edit

This commit is contained in:
Nathan Gray 2015-10-07 16:24:21 +00:00
parent 061ac97f78
commit c2232f1b8f

View File

@ -1095,7 +1095,6 @@ app.classes.calendar = AppJS.extend(
var js_integration_data = _action.parent.data.nextmatch.options.settings.js_integration_data || this.et2.getArrayMgr('content').data.nm.js_integration_data;
var id = _senders[0].id;
var matches = id.match(/^(?:calendar::)?([0-9]+):([0-9]+)$/);
var backup = _action.data;
if (matches)
{
this.edit_series(matches[1],matches[2]);
@ -1103,6 +1102,15 @@ app.classes.calendar = AppJS.extend(
}
matches = id.match(/^([a-z_-]+)([0-9]+)/i);
if (matches)
{
var js_integration_data = _action.parent.data.nextmatch.options.settings.js_integration_data || this.et2.getArrayMgr('content').data.nm.js_integration_data;
if(typeof js_integration_data == 'string')
{
js_integration_data = JSON.parse(js_integration_data);
}
}
matches = id.match(/^calendar::([a-z_-]+)([0-9]+)/i);
if (matches && js_integration_data && js_integration_data[matches[1]])
{
var app = matches[1];
_action.data.url = window.egw_webserverUrl+'/index.php?';
@ -1113,20 +1121,23 @@ app.classes.calendar = AppJS.extend(
if (js_integration_data[app].edit_popup)
{
matches = js_integration_data[app].edit_popup.match(/^(.*)x(.*)$/);
if (matches)
{
_action.data.width = matches[1];
_action.data.height = matches[2];
}
else
{
_action.data.nm_action = 'location';
}
egw.open_link(_action.data.url,'_blank',js_integration_data[app].edit_popup,app);
_action.data = backup; // restore url, width, height, nm_action
return;
}
}
else
{
// Other app integration using link registry
var data = egw.dataGetUIDdata(_senders[0].id);
if(data && data.data)
{
return egw.open(data.data.app_id, data.data.app, 'edit');
}
}
// Regular, single event
egw.open(id.replace(/^calendar::/g,''),'calendar','edit');
_action.data = backup; // restore url, width, height, nm_action
},
/**