diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js index c84bf703a6..842ac755be 100644 --- a/apps/api/documents/api.js +++ b/apps/api/documents/api.js @@ -1076,15 +1076,18 @@ if (config.frameEditorId) params += "&frameEditorId=" + config.frameEditorId; - var type = config.document ? /^(?:(pdf))$/.exec(config.document.fileType) : null; - if (!(type && typeof type[1] === 'string') && (config.editorConfig && config.editorConfig.mode == 'view' || + var type = config.document ? /^(?:(pdf)|(oform|docxf))$/.exec(config.document.fileType) : null, + isPdf = type && typeof type[1] === 'string', + oldForm = type && typeof type[2] === 'string'; + + if (!(isPdf || oldForm) && (config.editorConfig && config.editorConfig.mode == 'view' || config.document && config.document.permissions && (config.document.permissions.edit === false && !config.document.permissions.review ))) params += "&mode=view"; - if (type && typeof type[1] === 'string' && (config.document && config.document.permissions && config.document.permissions.edit === false || config.editorConfig && config.editorConfig.mode == 'view')) + if ((isPdf || oldForm) && (config.document && config.document.permissions && config.document.permissions.edit === false || config.editorConfig && config.editorConfig.mode == 'view')) params += "&mode=fillforms"; if (config.document) { - config.document.isForm = (type && typeof type[1] === 'string') ? config.document.isForm : false; + config.document.isForm = isPdf ? config.document.isForm : oldForm; (config.document.isForm===true || config.document.isForm===false) && (params += "&isForm=" + config.document.isForm); } diff --git a/apps/documenteditor/embed/index.html b/apps/documenteditor/embed/index.html index 8325c4c732..edaeadc6cd 100644 --- a/apps/documenteditor/embed/index.html +++ b/apps/documenteditor/embed/index.html @@ -251,6 +251,9 @@