From ecffd5fb736caff68021e9e5de1b7759ce023c54 Mon Sep 17 00:00:00 2001 From: nathan Date: Tue, 18 Apr 2023 11:48:25 -0600 Subject: [PATCH] Api: Fix Et2Link did not open PDFs in Collabora, but always downloaded them --- api/js/jsapi/egw_links.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/api/js/jsapi/egw_links.js b/api/js/jsapi/egw_links.js index 88aa62903f..b9d6863231 100644 --- a/api/js/jsapi/egw_links.js +++ b/api/js/jsapi/egw_links.js @@ -169,7 +169,7 @@ egw.extend('links', egw.MODULE_GLOBAL, function() let data = {}; if (mime_info) { - if (this.isEditable(_type)) + if (this.isCollaborable(_type)) { data = { 'menuaction': 'collabora.EGroupware\\collabora\\Ui.editor', @@ -557,6 +557,11 @@ egw.extend('links', egw.MODULE_GLOBAL, function() */ isCollaborable: function (mime) { + if (typeof this.user('apps')['collabora'] == "undefined") + { + return false; + } + // Additional check to see if Collabora can open the file at all, not just edit it let fe = this.file_editor_prefered_mimes(mime); if (fe && fe.mime && fe.mime[mime] && fe.mime[mime].name || this.isEditable(mime))