Skip to content

Commit

Permalink
Merge pull request #2982 from ONLYOFFICE/fix/bugfix
Browse files Browse the repository at this point in the history
[DE] Fix open editor for oform/docxf files
  • Loading branch information
JuliaRadzhabova authored May 8, 2024
2 parents 155a769 + 4a7879b commit 444af66
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions apps/documenteditor/main/app/controller/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1659,6 +1659,8 @@ define([
this.appOptions.showSaveButton = this.appOptions.isEdit || !this.appOptions.isRestrictedEdit && this.appOptions.isPDFForm; // save to file or save to file copy (for pdf-form viewer)

if (this.appOptions.isPDFForm && !this.appOptions.isEdit) {
if (!this.appOptions.isRestrictedEdit && !this.appOptions.canEdit)
this.appOptions.canRequestEditRights = false; // if open form in viewer - check permissions.edit option
this.appOptions.canFillForms = this.appOptions.isRestrictedEdit = true; // can fill forms in viewer!
}

Expand Down
6 changes: 4 additions & 2 deletions apps/documenteditor/main/app/view/FileMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,13 +403,15 @@ define([
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']();
this.miEdit[!this.mode.isEdit && this.mode.canEdit && this.mode.canRequestEditRights ?'show':'hide']();

var canEdit = this.mode.canRequestEditRights && (!this.mode.isEdit && this.mode.canEdit || this.mode.isPDFForm && this.mode.canFillForms && this.mode.isRestrictedEdit);
this.miEdit[canEdit?'show':'hide']();
this.miPrint[this.mode.canPrint && !this.mode.canPreviewPrint ?'show':'hide']();
this.miPrintWithPreview[this.mode.canPreviewPrint?'show':'hide']();
this.miRename[(this.mode.canRename && !this.mode.isDesktopApp) ?'show':'hide']();
this.miProtect[(this.mode.isSignatureSupport || this.mode.isPasswordSupport) ?'show':'hide']();
separatorVisible = (this.mode.canDownload || this.mode.canDownloadOrigin || this.mode.isEdit && Common.UI.LayoutManager.isElementVisible('toolbar-file-save') || this.mode.canPrint || (this.mode.isSignatureSupport || this.mode.isPasswordSupport) ||
!this.mode.isEdit && this.mode.canEdit && this.mode.canRequestEditRights || this.mode.canRename && !this.mode.isDesktopApp) && !this.mode.isDisconnected;
canEdit || this.mode.canRename && !this.mode.isDesktopApp) && !this.mode.isDisconnected;
this.miProtect.$el.find('+.devider')[separatorVisible?'show':'hide']();
separatorVisible && (lastSeparator = this.miProtect.$el.find('+.devider'));

Expand Down

0 comments on commit 444af66

Please sign in to comment.