From 8464f7ae39d62b2ee368fa1f1d7c13af3cdfd314 Mon Sep 17 00:00:00 2001 From: nathangray Date: Thu, 1 Feb 2018 13:30:36 -0700 Subject: [PATCH] * Calendar - Fix Filemanager, Infolog & Timesheet context menu actions --- calendar/js/app.js | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/calendar/js/app.js b/calendar/js/app.js index 58536738da..39c25ed8c6 100644 --- a/calendar/js/app.js +++ b/calendar/js/app.js @@ -1408,18 +1408,39 @@ app.classes.calendar = (function(){ "use strict"; return AppJS.extend( /** * Application links from non-list events * + * The ID looks like calendar:: or calendar::: + * For processing the links: + * '$app' gets replaced with 'calendar' + * '$id' gets replaced with + * '$app_id gets replaced with : + * + * Use either $id or $app_id depending on if you want the series [beginning] + * or a particular date. + * * @param {egwAction} _action * @param {egwActionObject[]} _events */ action_open: function(_action, _events) { var id = _events[0].id.split('::'); + var app = id[0]; + var app_id = id[1]; + if(app_id.indexOf(':')) + { + var split = id[1].split(':'); + id = split[0]; + } + else + { + id = app_id; + } if(_action.data.open) { var open = JSON.parse(_action.data.open) || {}; var extra = open.extra || ''; - extra = extra.replace(/(\$|%24)app/,id[0]).replace(/(\$|%24)id/,id[1]); + extra = extra.replace(/(\$|%24)app/,app).replace(/(\$|%24)app_id/,app_id) + .replace(/(\$|%24)id/,id); // Get a little smarter with the context if(!extra) @@ -1465,7 +1486,8 @@ app.classes.calendar = (function(){ "use strict"; return AppJS.extend( else if (_action.data.url) { var url = _action.data.url; - url = url.replace(/(\$|%24)app/,id[0]).replace(/(\$|%24)id/,id[1]); + url = url.replace(/(\$|%24)app/,app).replace(/(\$|%24)app_id/,app_id) + .replace(/(\$|%24)id/,id); this.egw.open_link(url); } },