From 068c7175973351ab747b509f1852e1e6b225b9a9 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 26 Dec 2023 17:25:40 +0300 Subject: [PATCH 1/2] Fix Bug 65702 --- apps/documenteditor/main/app/controller/Main.js | 1 + apps/pdfeditor/main/app/controller/Main.js | 1 + apps/presentationeditor/main/app/controller/Main.js | 1 + apps/spreadsheeteditor/main/app/controller/Main.js | 1 + 4 files changed, 4 insertions(+) diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 96e496e32f..2f9c3f774f 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -1392,6 +1392,7 @@ define([ }, 50); } else { documentHolderController.getView().createDelayedElementsViewer(); + Common.Utils.injectSvgIcons(); Common.NotificationCenter.trigger('document:ready', 'main'); me.applyLicense(); } diff --git a/apps/pdfeditor/main/app/controller/Main.js b/apps/pdfeditor/main/app/controller/Main.js index af18cbc0d5..6b42c7e167 100644 --- a/apps/pdfeditor/main/app/controller/Main.js +++ b/apps/pdfeditor/main/app/controller/Main.js @@ -1031,6 +1031,7 @@ define([ }, 500); } else { Common.NotificationCenter.trigger('document:ready', 'main'); + Common.Utils.injectSvgIcons(); me.applyLicense(); } diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 29f6c8853c..9cdf327d23 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -1002,6 +1002,7 @@ define([ }, 50); } else { documentHolderController.getView().createDelayedElementsViewer(); + Common.Utils.injectSvgIcons(); Common.NotificationCenter.trigger('document:ready', 'main'); me.applyLicense(); } diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index d0812d590b..abd71bdc3b 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -1087,6 +1087,7 @@ define([ var formulasDlgController = application.getController('FormulaDialog'); formulasDlgController && formulasDlgController.setMode(me.appOptions).setApi(me.api); documentHolderView.createDelayedElementsViewer(); + Common.Utils.injectSvgIcons(); Common.NotificationCenter.trigger('document:ready', 'main'); me.applyLicense(); } From 857fd4b23635e99bbfc4c6e2dc93b96c3bfdd2f7 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 26 Dec 2023 18:23:20 +0300 Subject: [PATCH 2/2] [DE] Change warning when open oform file --- .../main/app/controller/Toolbar.js | 56 +++++++++++++++++-- apps/documenteditor/main/locale/en.json | 7 ++- 2 files changed, 56 insertions(+), 7 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index 80e42a4aed..c6774f1c6b 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -459,6 +459,7 @@ define([ this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onApiCoAuthoringDisconnect, this)); Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiCoAuthoringDisconnect, this)); } + this.api.asc_registerCallback('asc_onDownloadUrl', _.bind(this.onDownloadUrl, this)); Common.NotificationCenter.on('protect:doclock', _.bind(this.onChangeProtectDocument, this)); }, @@ -3539,17 +3540,56 @@ define([ .setApi(me.api) .onAppReady(config); } - config.isOForm && config.canDownloadForms && !Common.localStorage.getBool("de-convert-oform") && Common.UI.warning({ - msg : me.textConvertForm, - dontshow: true, - callback: function(btn, dontshow){ - dontshow && Common.localStorage.setItem("de-convert-oform", 1); + + config.isOForm && config.canDownloadForms && 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){ + if (btn==='ok') { + me.isFromFormSaveAs = config.canRequestSaveAs || !!config.saveAsUrl; + me.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.PDF, me.isFromFormSaveAs)); + } Common.NotificationCenter.trigger('edit:complete'); } }); }); }, + onDownloadUrl: function(url, fileType) { + if (this.isFromFormSaveAs) { + var me = this, + defFileName = this.getApplication().getController('Viewport').getView('Common.Views.Header').getDocumentCaption(); + !defFileName && (defFileName = me.txtUntitled); + + var idx = defFileName.lastIndexOf('.'); + if (idx>0) + defFileName = defFileName.substring(0, idx) + '.pdf'; + + if (me.mode.canRequestSaveAs) { + Common.Gateway.requestSaveAs(url, defFileName, fileType); + } else { + me._saveCopyDlg = new Common.Views.SaveAsDlg({ + saveFolderUrl: me.mode.saveAsUrl, + saveFileUrl: url, + defFileName: defFileName + }); + me._saveCopyDlg.on('saveaserror', function(obj, err){ + Common.UI.warning({ + closable: false, + msg: err, + callback: function(btn){ + Common.NotificationCenter.trigger('edit:complete', me); + } + }); + }).on('close', function(obj){ + me._saveCopyDlg = undefined; + }); + me._saveCopyDlg.show(); + } + } + this.isFromFormSaveAs = false; + }, + getView: function (name) { return !name ? this.toolbar : Backbone.Controller.prototype.getView.apply(this, arguments); }, @@ -4016,7 +4056,11 @@ define([ textEmptyMMergeUrl: 'You need to specify URL.', textRecentlyUsed: 'Recently Used', dataUrl: 'Paste a data URL', - textConvertForm: 'Download file as pdf to save the form in the format ready for filling.' + textConvertFormSave: 'Save file as a fillable PDF form to be able to fill it out.', + textConvertFormDownload: 'Download file as a fillable PDF form to be able to fill it out.', + txtUntitled: 'Untitled', + textSavePdf: 'Save as pdf', + textDownloadPdf: 'Download pdf' }, DE.Controllers.Toolbar || {})); }); diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index d9738ca0b5..d1289f38cc 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -1214,7 +1214,12 @@ "DE.Controllers.Toolbar.notcriticalErrorTitle": "Warning", "DE.Controllers.Toolbar.textAccent": "Accents", "DE.Controllers.Toolbar.textBracket": "Brackets", - "DE.Controllers.Toolbar.textConvertForm": "Download file as pdf to save the form in the format ready for filling.", + "del_DE.Controllers.Toolbar.textConvertForm": "Download file as pdf to save the form in the format ready for filling.", + "DE.Controllers.Toolbar.textConvertFormDownload": "Download file as a fillable PDF form to be able to fill it out.", + "DE.Controllers.Toolbar.textConvertFormSave": "Save file as a fillable PDF form to be able to fill it out.", + "DE.Controllers.Toolbar.txtUntitled": "Untitled", + "DE.Controllers.Toolbar.textSavePdf": "Save as pdf", + "DE.Controllers.Toolbar.textDownloadPdf": "Download pdf", "DE.Controllers.Toolbar.textEmptyImgUrl": "You need to specify image URL.", "DE.Controllers.Toolbar.textEmptyMMergeUrl": "You need to specify URL.", "DE.Controllers.Toolbar.textFontSizeErr": "The entered value is incorrect.
Please enter a numeric value between 1 and 300",