Skip to content

Commit

Permalink
Merge pull request #3154 from ONLYOFFICE/fix/fix-wopi
Browse files Browse the repository at this point in the history
Fix/fix wopi
Bug 62643
  • Loading branch information
JuliaRadzhabova authored Aug 28, 2024
2 parents d45e71d + 5bd8eff commit ba3609b
Show file tree
Hide file tree
Showing 177 changed files with 475 additions and 310 deletions.
1 change: 1 addition & 0 deletions apps/api/wopi/editor-wopi.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ div {
var onRequestSaveAs = function (event) {
//SaveAs work via PutRelativeFile server-server request
docEditor.serviceCommand('wopi:saveAsComplete');
};
var onRequestSharingSettings = function (event) {
Expand Down
10 changes: 3 additions & 7 deletions apps/documenteditor/main/app/controller/LeftMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -446,20 +446,16 @@ define([

saveAsInWopi: function(menu, format, ext) {
var me = this,
defFileName = this.getApplication().getController('Viewport').getView('Common.Views.Header').getDocumentCaption(),
fileInfo = this.getApplication().getController('Main').document.info,
folder = fileInfo ? fileInfo.folder || '' : '';
defFileName = this.getApplication().getController('Viewport').getView('Common.Views.Header').getDocumentCaption();
!defFileName && (defFileName = me.txtUntitled);
folder && (folder.charAt(folder.length-1) !== '/') && (folder = folder + '/');

if (typeof ext === 'string') {
var idx = defFileName.lastIndexOf('.');
if (idx>0)
defFileName = defFileName.substring(0, idx) + ext;
}
(new Common.Views.TextInputDialog({
label: me.textSelectPath,
value: folder + (defFileName || ''),
value: defFileName || '',
handler: function(result, value) {
if (result == 'ok') {
me.clickSaveAsFormat(menu, format, ext, value);
Expand Down Expand Up @@ -1029,7 +1025,7 @@ define([
txtCompatible: 'The document will be saved to the new format. It will allow to use all the editor features, but might affect the document layout.<br>Use the \'Compatibility\' option of the advanced settings if you want to make the files compatible with older MS Word versions.',
warnDownloadAsPdf: 'Your {0} will be converted to an editable format. This may take a while. The resulting document will be optimized to allow you to edit the text, so it might not look exactly like the original {0}, especially if the original file contained lots of graphics.',
warnReplaceString: '{0} is not a valid special character for the Replace With box.',
textSelectPath: 'Enter a path for saving file copy'
textSelectPath: 'Enter a new name for saving the file copy'

}, DE.Controllers.LeftMenu || {}));
});
5 changes: 5 additions & 0 deletions apps/documenteditor/main/app/controller/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1492,6 +1492,11 @@ define([
Common.Gateway.on('downloadas', _.bind(me.onDownloadAs, me));
Common.Gateway.on('setfavorite', _.bind(me.onSetFavorite, me));
Common.Gateway.on('requestclose', _.bind(me.onRequestClose, me));
this.appOptions.canRequestSaveAs && Common.Gateway.on('internalcommand', function(data) {
if (data.command == 'wopi:saveAsComplete') {
me.onExternalMessage({msg: me.txtSaveCopyAsComplete});
}
});

Common.Gateway.sendInfo({mode:me.appOptions.isEdit?'edit':'view'});

Expand Down
4 changes: 2 additions & 2 deletions apps/documenteditor/main/app/view/FileMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ define([

this.miDownload[((this.mode.canDownload || this.mode.canDownloadOrigin) && (!this.mode.isDesktopApp || !this.mode.isOffline))?'show':'hide']();
var isBCSupport = Common.Controllers.Desktop.isActive() ? Common.Controllers.Desktop.call("isBlockchainSupport") : false;
this.miSaveCopyAs[((this.mode.canDownload || this.mode.canDownloadOrigin) && (!this.mode.isDesktopApp || !this.mode.isOffline)) && (this.mode.canRequestSaveAs || this.mode.saveAsUrl || this.mode.wopi) && !isBCSupport ?'show':'hide']();
this.miSaveCopyAs[((this.mode.canDownload || this.mode.canDownloadOrigin) && (!this.mode.isDesktopApp || !this.mode.isOffline)) && (this.mode.canRequestSaveAs || this.mode.saveAsUrl) && !isBCSupport ?'show':'hide']();
this.miSaveAs[((this.mode.canDownload || this.mode.canDownloadOrigin) && this.mode.isDesktopApp && this.mode.isOffline)?'show':'hide']();
this.miSave[this.mode.showSaveButton && Common.UI.LayoutManager.isElementVisible('toolbar-file-save') ?'show':'hide']();

Expand Down Expand Up @@ -495,7 +495,7 @@ define([
} else if (this.mode.canDownloadOrigin)
$('a',this.miDownload.$el).text(this.textDownload);

if (this.mode.canDownload && (this.mode.canRequestSaveAs || this.mode.saveAsUrl || this.mode.wopi)) {
if (this.mode.canDownload && (this.mode.canRequestSaveAs || this.mode.saveAsUrl)) {
!this.panels['save-copy'] && (this.panels['save-copy'] = ((new DE.Views.FileMenuPanels.ViewSaveCopy({menu: this, fileType: this.document ? this.document.fileType : undefined, mode: this.mode})).render()));
}

Expand Down
3 changes: 2 additions & 1 deletion apps/documenteditor/main/locale/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@
"DE.Controllers.LeftMenu.textNoTextFound": "لا يمكن العثور على البيانات التي كنت تبحث عنها. الرجاء ضبط خيارات البحث الخاصة بك.",
"DE.Controllers.LeftMenu.textReplaceSkipped": "تم إجراء الاستبدال. تم تخطي {0} حدث.",
"DE.Controllers.LeftMenu.textReplaceSuccess": "انتهى البحث. الحالات المستبدلة: {0}",
"DE.Controllers.LeftMenu.textSelectPath": "Enter a path for saving file copy",
"DE.Controllers.LeftMenu.textSelectPath": "Enter a new name for saving the file copy",
"DE.Controllers.LeftMenu.txtCompatible": "سيتم حفظ المستند بالتنسيق الجديد. سيسمح باستخدام جميع ميزات المحرر، ولكنه قد يؤثر على تخطيط المستند.<br>استخدم خيار \"التوافق\" في الإعدادات المتقدمة إذا كنت تريد جعل الملفات متوافقة مع إصدارات MS Word الأقدم.",
"DE.Controllers.LeftMenu.txtUntitled": "بدون عنوان",
"DE.Controllers.LeftMenu.warnDownloadAs": "اذا تابعت الحفظ بهذا التنسيق ستفقد كل الميزات عدا النص.<br> هل حقا تريد المتابعة؟ ",
Expand Down Expand Up @@ -3617,6 +3617,7 @@
"DE.Views.WatermarkSettingsDialog.textUnderline": "تحته خط",
"DE.Views.WatermarkSettingsDialog.tipFontName": "اسم الخط",
"DE.Views.WatermarkSettingsDialog.tipFontSize": "حجم الخط",
"DE.Controllers.Main.txtSaveCopyAsComplete": "The file copy was successfully saved",
"DE.Controllers.Toolbar.fileUrl": "Paste a file URL",
"DE.Views.Toolbar.capBtnInsTextFromFile": "Text from File",
"DE.Views.Toolbar.mniTextFromLocalFile": "Text from the local file",
Expand Down
3 changes: 2 additions & 1 deletion apps/documenteditor/main/locale/az.json
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@
"DE.Controllers.LeftMenu.textNoTextFound": "Axtardığınız verilən tapılmadı. Axtarış seçimlərinizi tənzimləyin.",
"DE.Controllers.LeftMenu.textReplaceSkipped": "Əvəz edilir. {0} hal nəzərə alınmadı.",
"DE.Controllers.LeftMenu.textReplaceSuccess": "Araşdırma aparılır. Hadisələr dəyişdirildi: {0}",
"DE.Controllers.LeftMenu.textSelectPath": "Enter a path for saving file copy",
"DE.Controllers.LeftMenu.textSelectPath": "Enter a new name for saving the file copy",
"DE.Controllers.LeftMenu.txtCompatible": "Fayl yeni formatda saxlanacaq. Redaktorların bütün xüsusiyyətləri sizin üçün əlçatan olacaq, lakin bu, sənədin tərtibatına təsir edə bilər.<br> Faylınızı MS Word-ün köhnə versiyaları ilə uyğunlaşdırmaq üçün təkmil parametrlərdə \"Uyğunluq\" seçimini aktivləşdirin.",
"DE.Controllers.LeftMenu.txtUntitled": "Başlıqsız",
"DE.Controllers.LeftMenu.warnDownloadAs": "Bu formatda yadda saxlamağa davam etsəniz, mətndən başqa bütün funksiyalar itiriləcək.<br>Davam etmək istədiyinizə əminsiniz?",
Expand Down Expand Up @@ -3617,6 +3617,7 @@
"DE.Views.WatermarkSettingsDialog.textUnderline": "Altından xətt çəkilmiş",
"DE.Views.WatermarkSettingsDialog.tipFontName": "Şrift Adı",
"DE.Views.WatermarkSettingsDialog.tipFontSize": "Şrift Ölçüsü",
"DE.Controllers.Main.txtSaveCopyAsComplete": "The file copy was successfully saved",
"DE.Controllers.Toolbar.fileUrl": "Paste a file URL",
"DE.Views.Toolbar.capBtnInsTextFromFile": "Text from File",
"DE.Views.Toolbar.mniTextFromLocalFile": "Text from the local file",
Expand Down
3 changes: 2 additions & 1 deletion apps/documenteditor/main/locale/be.json
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@
"DE.Controllers.LeftMenu.textNoTextFound": "Даныя не знойдзеныя. Калі ласка, змяніце параметры пошуку.",
"DE.Controllers.LeftMenu.textReplaceSkipped": "Заменена. Прапушчана ўваходжанняў: {0}.",
"DE.Controllers.LeftMenu.textReplaceSuccess": "Пошук завершаны. Заменена ўваходжанняў: {0}",
"DE.Controllers.LeftMenu.textSelectPath": "Enter a path for saving file copy",
"DE.Controllers.LeftMenu.textSelectPath": "Enter a new name for saving the file copy",
"DE.Controllers.LeftMenu.txtCompatible": "Дакумент будзе захаваны ў новым фармаце. Гэта дасць магчымасць выкарыстоўваць усе функцыі рэдактара, але можа паўплываць на структуру дакумента.<br>Выкарыстоўвайце параметр \"Сумяшчальнасць\", калі хочаце зрабіць файлы сумяшчальнымі са старэйшымі версіямі MS Word.",
"DE.Controllers.LeftMenu.txtUntitled": "Без назвы",
"DE.Controllers.LeftMenu.warnDownloadAs": "Калі вы працягнеце захаванне ў гэты фармат, усе функцыі, апроч тэксту страцяцца.<br>Сапраўды хочаце працягнуць?",
Expand Down Expand Up @@ -3617,6 +3617,7 @@
"DE.Views.WatermarkSettingsDialog.textUnderline": "Падкрэслены",
"DE.Views.WatermarkSettingsDialog.tipFontName": "Назва шрыфту",
"DE.Views.WatermarkSettingsDialog.tipFontSize": "Памер шрыфту",
"DE.Controllers.Main.txtSaveCopyAsComplete": "The file copy was successfully saved",
"DE.Controllers.Toolbar.fileUrl": "Paste a file URL",
"DE.Views.Toolbar.capBtnInsTextFromFile": "Text from File",
"DE.Views.Toolbar.mniTextFromLocalFile": "Text from the local file",
Expand Down
3 changes: 2 additions & 1 deletion apps/documenteditor/main/locale/bg.json
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@
"DE.Controllers.LeftMenu.textNoTextFound": "Данните, които търсите, не можаха да бъдат намерени. Моля, коригирайте опциите си за търсене.",
"DE.Controllers.LeftMenu.textReplaceSkipped": "Замяната е направена. {0} събития бяха пропуснати.",
"DE.Controllers.LeftMenu.textReplaceSuccess": "Търсенето е направено. Заместени случаи: {0}",
"DE.Controllers.LeftMenu.textSelectPath": "Enter a path for saving file copy",
"DE.Controllers.LeftMenu.textSelectPath": "Enter a new name for saving the file copy",
"DE.Controllers.LeftMenu.txtCompatible": "The document will be saved to the new format. It will allow to use all the editor features, but might affect the document layout.<br>Use the 'Compatibility' option of the advanced settings if you want to make the files compatible with older MS Word versions.",
"DE.Controllers.LeftMenu.txtUntitled": "Неозаглавен",
"DE.Controllers.LeftMenu.warnDownloadAs": "Ако продължите да записвате в този формат, всички функции, с изключение на текста, ще бъдат загубени. <br> Сигурни ли сте, че искате да продължите?",
Expand Down Expand Up @@ -3617,6 +3617,7 @@
"DE.Views.WatermarkSettingsDialog.textUnderline": "Underline",
"DE.Views.WatermarkSettingsDialog.tipFontName": "Font name",
"DE.Views.WatermarkSettingsDialog.tipFontSize": "Font size",
"DE.Controllers.Main.txtSaveCopyAsComplete": "The file copy was successfully saved",
"DE.Controllers.Toolbar.fileUrl": "Paste a file URL",
"DE.Views.Toolbar.capBtnInsTextFromFile": "Text from File",
"DE.Views.Toolbar.mniTextFromLocalFile": "Text from the local file",
Expand Down
3 changes: 2 additions & 1 deletion apps/documenteditor/main/locale/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@
"DE.Controllers.LeftMenu.textNoTextFound": "No s'han trobat les dades que heu cercat. Ajusteu les opcions de cerca.",
"DE.Controllers.LeftMenu.textReplaceSkipped": "S'ha realitzat la substitució. S'han omès {0} ocurrències.",
"DE.Controllers.LeftMenu.textReplaceSuccess": "S'ha fet la cerca. S'han substituït les coincidències: {0}",
"DE.Controllers.LeftMenu.textSelectPath": "Enter a path for saving file copy",
"DE.Controllers.LeftMenu.textSelectPath": "Enter a new name for saving the file copy",
"DE.Controllers.LeftMenu.txtCompatible": "El document es desarà amb el format nou. Podreu utilitzar totes les funcions de l'editor, però podria afectar la disposició del document. <br>Useu l'opció 'Compatibilitat' de la configuració avançada si voleu que els fitxers siguin compatibles amb versions anteriors de MS Word.",
"DE.Controllers.LeftMenu.txtUntitled": "Sense títol",
"DE.Controllers.LeftMenu.warnDownloadAs": "Si continueu i deseu en aquest format, es perdran totes les característiques, excepte el text.<br>Voleu continuar?",
Expand Down Expand Up @@ -3617,6 +3617,7 @@
"DE.Views.WatermarkSettingsDialog.textUnderline": "Subratllar",
"DE.Views.WatermarkSettingsDialog.tipFontName": "Nom de la lletra",
"DE.Views.WatermarkSettingsDialog.tipFontSize": "Mida de la lletra",
"DE.Controllers.Main.txtSaveCopyAsComplete": "The file copy was successfully saved",
"DE.Controllers.Toolbar.fileUrl": "Paste a file URL",
"DE.Views.Toolbar.capBtnInsTextFromFile": "Text from File",
"DE.Views.Toolbar.mniTextFromLocalFile": "Text from the local file",
Expand Down
3 changes: 2 additions & 1 deletion apps/documenteditor/main/locale/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@
"DE.Controllers.LeftMenu.textNoTextFound": "Data, která jste hledali, nebyla nalezena. Upravte parametry vyhledávání.",
"DE.Controllers.LeftMenu.textReplaceSkipped": "Nahrazení bylo provedeno. {0} výskytů bylo přeskočeno.",
"DE.Controllers.LeftMenu.textReplaceSuccess": "Hledání bylo dokončeno. Nahrazeno výskytů: {0}",
"DE.Controllers.LeftMenu.textSelectPath": "Enter a path for saving file copy",
"DE.Controllers.LeftMenu.textSelectPath": "Enter a new name for saving the file copy",
"DE.Controllers.LeftMenu.txtCompatible": "Dokument bude uložen v novém formátu. Umožní vám využít všechny funkce editoru, ale může ovlivnit rozvržení dokumentu.<br>Pokud chcete, aby soubory byly kompatibilní se staršími verzemi MS Word, použijte volbu „Kompatibilita“ v pokročilých nastaveních.",
"DE.Controllers.LeftMenu.txtUntitled": "Bez názvu",
"DE.Controllers.LeftMenu.warnDownloadAs": "Pokud budete pokračovat v ukládání v tomto formátu, vše kromě textu bude ztraceno.<br>Opravdu chcete pokračovat?",
Expand Down Expand Up @@ -3617,6 +3617,7 @@
"DE.Views.WatermarkSettingsDialog.textUnderline": "Podtržené",
"DE.Views.WatermarkSettingsDialog.tipFontName": "Název písma",
"DE.Views.WatermarkSettingsDialog.tipFontSize": "Velikost písma",
"DE.Controllers.Main.txtSaveCopyAsComplete": "The file copy was successfully saved",
"DE.Controllers.Toolbar.fileUrl": "Paste a file URL",
"DE.Views.Toolbar.capBtnInsTextFromFile": "Text from File",
"DE.Views.Toolbar.mniTextFromLocalFile": "Text from the local file",
Expand Down
3 changes: 2 additions & 1 deletion apps/documenteditor/main/locale/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@
"DE.Controllers.LeftMenu.textNoTextFound": "Dataen du har søgt, kunne ikke findes. Venligst ændre dine søgerkriterier.",
"DE.Controllers.LeftMenu.textReplaceSkipped": "Erstatningen er blevet oprettet. {0} gentagelser blev sprunget over.",
"DE.Controllers.LeftMenu.textReplaceSuccess": "Søgningen er blevet gennemført. Forekomster erstattet: {0}",
"DE.Controllers.LeftMenu.textSelectPath": "Enter a path for saving file copy",
"DE.Controllers.LeftMenu.textSelectPath": "Enter a new name for saving the file copy",
"DE.Controllers.LeftMenu.txtCompatible": "Dokumentet bliver gemt i nyt format. Det vil tillade dig at bruge alle redigeringsfunktioner, men det kan påvirke dokumentlayoutet.<br>Brug \"kompatibilitet\" indstillingen fra avancerede indstillinger hvis du ønsker at gøre filer kompatible med ældre MS Word versioner.",
"DE.Controllers.LeftMenu.txtUntitled": "Unavngivet",
"DE.Controllers.LeftMenu.warnDownloadAs": "Hvis du fortsætter med at gemme i dette format, vil alle funktioner på nær teksten blive tabt.<br> Er du sikker på at du vil fortsætte?",
Expand Down Expand Up @@ -3617,6 +3617,7 @@
"DE.Views.WatermarkSettingsDialog.textUnderline": "Understreg",
"DE.Views.WatermarkSettingsDialog.tipFontName": "Skrifttypenavn",
"DE.Views.WatermarkSettingsDialog.tipFontSize": "Skriftstørrelse",
"DE.Controllers.Main.txtSaveCopyAsComplete": "The file copy was successfully saved",
"DE.Controllers.Toolbar.fileUrl": "Paste a file URL",
"DE.Views.Toolbar.capBtnInsTextFromFile": "Text from File",
"DE.Views.Toolbar.mniTextFromLocalFile": "Text from the local file",
Expand Down
1 change: 1 addition & 0 deletions apps/documenteditor/main/locale/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -3617,6 +3617,7 @@
"DE.Views.WatermarkSettingsDialog.textUnderline": "Unterstrichen",
"DE.Views.WatermarkSettingsDialog.tipFontName": "Schriftartname",
"DE.Views.WatermarkSettingsDialog.tipFontSize": "Schriftgrad",
"DE.Controllers.Main.txtSaveCopyAsComplete": "The file copy was successfully saved",
"DE.Controllers.Toolbar.fileUrl": "Paste a file URL",
"DE.Views.Toolbar.capBtnInsTextFromFile": "Text from File",
"DE.Views.Toolbar.mniTextFromLocalFile": "Text from the local file",
Expand Down
3 changes: 2 additions & 1 deletion apps/documenteditor/main/locale/el.json
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@
"DE.Controllers.LeftMenu.textNoTextFound": "Τα δεδομένα που αναζητάτε δεν βρέθηκαν. Παρακαλούμε προσαρμόστε τις επιλογές αναζήτησης.",
"DE.Controllers.LeftMenu.textReplaceSkipped": "Η αντικατάσταση έγινε. {0} εμφανίσεις προσπεράστηκαν.",
"DE.Controllers.LeftMenu.textReplaceSuccess": "Η αναζήτηση ολοκληρώθηκε. Εμφανίσεις που αντικαταστάθηκαν: {0}",
"DE.Controllers.LeftMenu.textSelectPath": "Enter a path for saving file copy",
"DE.Controllers.LeftMenu.textSelectPath": "Enter a new name for saving the file copy",
"DE.Controllers.LeftMenu.txtCompatible": "Το έγγραφο θα αποθηκευτεί στη νέα μορφή. Θα επιτρέπεται η χρήση όλων των χαρακτηριστικών του συντάκτη, αλλά μπορεί να επηρεαστεί η διάταξη του εγγράφου.<br>Χρησιμοποιήστε την επιλογή 'Συμβατότητα' των προηγμένων ρυθμίσεων αν θέλετε να κάνετε τα αρχεία συμβατά με παλαιότερες εκδόσεις MS Word.",
"DE.Controllers.LeftMenu.txtUntitled": "Άτιτλο",
"DE.Controllers.LeftMenu.warnDownloadAs": "Αν προχωρήσετε με την αποθήκευση σε αυτή τη μορφή, όλα τα χαρακτηριστικά πλην του κειμένου θα χαθούν.<br>Θέλετε σίγουρα να συνεχίσετε;",
Expand Down Expand Up @@ -3617,6 +3617,7 @@
"DE.Views.WatermarkSettingsDialog.textUnderline": "Υπογράμμιση",
"DE.Views.WatermarkSettingsDialog.tipFontName": "Όνομα γραμματοσειράς",
"DE.Views.WatermarkSettingsDialog.tipFontSize": "Μέγεθος γραμματοσειράς",
"DE.Controllers.Main.txtSaveCopyAsComplete": "The file copy was successfully saved",
"DE.Controllers.Toolbar.fileUrl": "Paste a file URL",
"DE.Views.Toolbar.capBtnInsTextFromFile": "Text from File",
"DE.Views.Toolbar.mniTextFromLocalFile": "Text from the local file",
Expand Down
Loading

0 comments on commit ba3609b

Please sign in to comment.