diff --git a/apps/documenteditor/embed/js/ApplicationController.js b/apps/documenteditor/embed/js/ApplicationController.js
index da168bb749..f022efe102 100644
--- a/apps/documenteditor/embed/js/ApplicationController.js
+++ b/apps/documenteditor/embed/js/ApplicationController.js
@@ -424,8 +424,12 @@ DE.ApplicationController = new(function(){
if ( !appOptions.canFillForms || permissions.download === false) {
$('#idt-download-docx').hide();
+ itemsCount --;
+ }
+
+ if ( !appOptions.canFillForms && !appOptions.isOForm || permissions.download === false) {
$('#idt-download-pdf').hide();
- itemsCount -= 2;
+ itemsCount --;
}
if ( !embedConfig.shareUrl || appOptions.canFillForms) {
@@ -627,6 +631,17 @@ DE.ApplicationController = new(function(){
}, 2000);
}
});
+
+ if (appOptions.isOForm && permissions.download!==false) {
+ $('#id-critical-error-title').text(me.notcriticalErrorTitle);
+ $('#id-critical-error-message').html(me.textConvertFormDownload);
+ $('#id-critical-error-close').text(me.textDownloadPdf).off().on('click', function(){
+ downloadAs(Asc.c_oAscFileType.PDF);
+ $('#id-critical-error-dialog').modal('hide');
+ });
+ $('#id-critical-error-dialog').modal('show');
+ }
+
Common.Gateway.documentReady();
Common.Analytics.trackEvent('Load', 'Complete');
}
@@ -638,6 +653,7 @@ DE.ApplicationController = new(function(){
$('#id-critical-error-title').text(Asc.c_oLicenseResult.NotBefore === licType ? me.titleLicenseNotActive : me.titleLicenseExp);
$('#id-critical-error-message').html(Asc.c_oLicenseResult.NotBefore === licType ? me.warnLicenseBefore : me.warnLicenseExp);
$('#id-critical-error-close').parent().remove();
+ $('#id-critical-error-dialog button.close').remove();
$('#id-critical-error-dialog').css('z-index', 20002).modal({backdrop: 'static', keyboard: false, show: true});
return;
}
@@ -648,6 +664,9 @@ DE.ApplicationController = new(function(){
appOptions.canBranding = params.asc_getCustomization();
appOptions.canBranding && setBranding(config.customization);
+ var type = /^(?:(docxf|oform))$/.exec(docConfig.fileType);
+ appOptions.isOForm = !!(type && typeof type[1] === 'string'); // oform and docxf
+
api.asc_setViewMode(!appOptions.canFillForms);
btnSubmit = $('#id-btn-submit');
@@ -736,6 +755,7 @@ DE.ApplicationController = new(function(){
$('#id-critical-error-close').text(me.txtClose).off().on('click', function(){
window.location.reload();
});
+ $('#id-critical-error-dialog button.close').remove();
$('#id-critical-error-dialog').css('z-index', 20002).modal('show');
return;
}
@@ -841,6 +861,7 @@ DE.ApplicationController = new(function(){
$('#id-critical-error-close').text(me.txtClose).off().on('click', function(){
window.location.reload();
});
+ $('#id-critical-error-dialog button.close').remove();
}
else {
Common.Gateway.reportWarning(id, message);
@@ -1060,6 +1081,8 @@ DE.ApplicationController = new(function(){
titleLicenseExp: 'License expired',
titleLicenseNotActive: 'License not active',
warnLicenseBefore: 'License not active. Please contact your administrator.',
- warnLicenseExp: 'Your license has expired. Please update your license and refresh the page.'
+ warnLicenseExp: 'Your license has expired. Please update your license and refresh the page.',
+ textConvertFormDownload: 'Download file as a fillable PDF form to be able to fill it out.',
+ textDownloadPdf: 'Download pdf'
}
})();
\ No newline at end of file
diff --git a/apps/documenteditor/embed/locale/en.json b/apps/documenteditor/embed/locale/en.json
index d5c031dc58..ec6deef7a7 100644
--- a/apps/documenteditor/embed/locale/en.json
+++ b/apps/documenteditor/embed/locale/en.json
@@ -53,6 +53,8 @@
"DE.ApplicationController.waitText": "Please, wait...",
"DE.ApplicationController.warnLicenseBefore": "License not active. Please contact your administrator.",
"DE.ApplicationController.warnLicenseExp": "Your license has expired. Please update your license and refresh the page.",
+ "DE.ApplicationController.textConvertFormDownload": "Download file as a fillable PDF form to be able to fill it out.",
+ "DE.ApplicationController.textDownloadPdf": "Download PDF",
"DE.ApplicationView.txtDownload": "Download",
"DE.ApplicationView.txtDownloadDocx": "Download as DOCX",
"DE.ApplicationView.txtDownloadPdf": "Download as PDF",
diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js
index 17071e25e4..a6ec4ab372 100644
--- a/apps/documenteditor/main/app/controller/Main.js
+++ b/apps/documenteditor/main/app/controller/Main.js
@@ -573,9 +573,7 @@ define([
var type = data.doc ? /^(?:(docxf|oform)|(pdf))$/.exec(data.doc.fileType) : false;
this.appOptions.isFormCreator = !!(type && (typeof type[1] === 'string' || typeof type[2] === 'string' && this.appOptions.isPDFForm)) && this.appOptions.canFeatureForms; // show forms only for docxf or oform
-
- type = data.doc ? /^(?:(oform))$/.exec(data.doc.fileType) : false;
- this.appOptions.isOForm = !!(type && typeof type[1] === 'string');
+ this.appOptions.isOForm = !!(type && typeof type[1] === 'string'); // oform and docxf
this.api.asc_registerCallback('asc_onGetEditorPermissions', _.bind(this.onEditorPermissions, this));
this.api.asc_registerCallback('asc_onLicenseChanged', _.bind(this.onLicenseChanged, this));
diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js
index 13c23d53f7..585b89710d 100644
--- a/apps/documenteditor/main/app/controller/Toolbar.js
+++ b/apps/documenteditor/main/app/controller/Toolbar.js
@@ -3654,7 +3654,7 @@ define([
}
}
- config.isOForm && config.canDownloadForms && Common.UI.warning({
+ config.isOForm && config.canDownload && Common.UI.warning({
msg : config.canRequestSaveAs || !!config.saveAsUrl || config.isOffline ? me.textConvertFormSave : me.textConvertFormDownload,
buttons: [{value: 'ok', caption: config.canRequestSaveAs || !!config.saveAsUrl || config.isOffline ? me.textSavePdf : me.textDownloadPdf}, 'cancel'],
callback: function(btn){