From e6530ff812e176d5c62a8f353c95aca82ffe4dc3 Mon Sep 17 00:00:00 2001 From: Alexey Koshelev Date: Sat, 14 Feb 2026 13:39:46 +0300 Subject: [PATCH 1/5] [DE Form] Show protection tab in toolbar --- .../main/app/controller/DocProtection.js | 10 +++--- .../main/app/controller/Toolbar.js | 14 +++++--- .../main/app/view/DocProtection.js | 33 ++++++++++--------- 3 files changed, 33 insertions(+), 24 deletions(-) diff --git a/apps/documenteditor/main/app/controller/DocProtection.js b/apps/documenteditor/main/app/controller/DocProtection.js index e200661461..3cf0bed3a9 100644 --- a/apps/documenteditor/main/app/controller/DocProtection.js +++ b/apps/documenteditor/main/app/controller/DocProtection.js @@ -119,7 +119,7 @@ define([ }, onProtectDocClick: function(state) { - this.view.btnProtectDoc.toggle(!state, true); + this.view && this.view.btnProtectDoc && this.view.btnProtectDoc.toggle(!state, true); if (state) { var me = this; me._docProtectDlg = new DE.Views.ProtectDialog({ @@ -183,7 +183,7 @@ define([ type = props ? props.asc_getEditType() : Asc.c_oAscEDocProtect.None, isProtected = (type === Asc.c_oAscEDocProtect.ReadOnly || type === Asc.c_oAscEDocProtect.Comments || type === Asc.c_oAscEDocProtect.TrackedChanges || type === Asc.c_oAscEDocProtect.Forms); - me.view && me.view.btnProtectDoc.toggle(!!isProtected, true); + me.view && me.view.btnProtectDoc && me.view.btnProtectDoc.toggle(!!isProtected, true); if (isProtected) { var str; @@ -226,7 +226,7 @@ define([ var props = this.getDocProps(true), isProtected = props && (props.isReadOnly || props.isCommentsOnly || props.isFormsOnly || props.isReviewOnly); - this.view && this.view.btnProtectDoc.toggle(isProtected, true); + this.view && this.view.btnProtectDoc && this.view.btnProtectDoc.toggle(isProtected, true); // off preview forms var forms = this.getApplication().getController('FormsTab'); @@ -305,7 +305,9 @@ define([ onLockDocumentProtection: function(state) { this._state.lockDocProtect = state; - this.view && Common.Utils.lockControls(Common.enumLock.protectLock, state, {array: [this.view.btnProtectDoc]}); + if(this.view && this.view.btnProtectDoc) { + Common.Utils.lockControls(Common.enumLock.protectLock, state, {array: [this.view.btnProtectDoc]}); + } if (this._docProtectDlg && this._docProtectDlg.isVisible()) this._docProtectDlg.SetDisabled(state || this._state.docProtection && (this._state.docProtection.isReadOnly || this._state.docProtection.isFormsOnly || this._state.docProtection.isCommentsOnly || this._state.docProtection.isReviewOnly)); diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index 9b8f0f7b50..22a65aba71 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -3929,16 +3929,20 @@ define([ } Array.prototype.push.apply(me.toolbar.lockControls, headerfootertab.getView('HeaderFooterTab').getButtons()); - if ( config.canProtect && !config.isPDFForm) { + if ( config.canProtect) { tab = {action: 'protect', caption: me.toolbar.textTabProtect, layoutname: 'toolbar-protect', dataHintTitle: 'T'}; $panel = application.getController('Common.Controllers.Protection').createToolbarPanel(); if ($panel) { - (config.isSignatureSupport || config.isPasswordSupport) && $panel.append($('
')); - var doctab = application.getController('DocProtection'); - $panel.append(doctab.createToolbarPanel()); + const doctabController = application.getController('DocProtection'); + const doctabView = doctabController.getView('DocProtection'); + const doctabButtons = doctabView.getButtons(); + if(doctabButtons.length > 0 && (config.isSignatureSupport || config.isPasswordSupport)) { + $panel.append($('
')); + } + $panel.append(doctabController.createToolbarPanel()); me.toolbar.addTab(tab, $panel, 7); me.toolbar.setVisible('protect', Common.UI.LayoutManager.isElementVisible('toolbar-protect')); - Array.prototype.push.apply(me.toolbar.lockControls, doctab.getView('DocProtection').getButtons()); + Array.prototype.push.apply(me.toolbar.lockControls, doctabButtons); } } diff --git a/apps/documenteditor/main/app/view/DocProtection.js b/apps/documenteditor/main/app/view/DocProtection.js index 2a54ca8d98..75ea37086c 100644 --- a/apps/documenteditor/main/app/view/DocProtection.js +++ b/apps/documenteditor/main/app/view/DocProtection.js @@ -54,7 +54,7 @@ define([ function setEvents() { var me = this; - this.btnProtectDoc.on('click', function (btn, e) { + this.btnProtectDoc && this.btnProtectDoc.on('click', function (btn, e) { me.fireEvent('protect:document', [btn.pressed]); }); me._isSetEvents = true; @@ -73,17 +73,20 @@ define([ this.lockedControls = []; this._state = {disabled: false, currentProtectHint: this.hintProtectDoc }; - this.btnProtectDoc = new Common.UI.Button({ - cls: 'btn-toolbar x-huge icon-top', - iconCls: 'toolbar__icon btn-restrict-editing', - enableToggle: true, - caption: this.txtProtectDoc, - lock : [_set.lostConnect, _set.coAuth, _set.previewReviewMode, _set.viewFormMode, _set.protectLock, _set.viewMode], - dataHint : '1', - dataHintDirection: 'bottom', - dataHintOffset: 'small' - }); - this.lockedControls.push(this.btnProtectDoc); + if(!this.appConfig.isPDFForm) { + this.btnProtectDoc = new Common.UI.Button({ + cls: 'btn-toolbar x-huge icon-top', + iconCls: 'toolbar__icon btn-restrict-editing', + enableToggle: true, + caption: this.txtProtectDoc, + lock : [_set.lostConnect, _set.coAuth, _set.previewReviewMode, _set.viewFormMode, _set.protectLock, _set.viewMode], + dataHint : '1', + dataHintDirection: 'bottom', + dataHintOffset: 'small' + }); + this.lockedControls.push(this.btnProtectDoc); + } + Common.UI.LayoutManager.addControls(this.lockedControls); Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this)); }, @@ -97,7 +100,7 @@ define([ (new Promise(function (accept, reject) { accept(); })).then(function(){ - me.btnProtectDoc.updateHint(me._state.currentProtectHint, true); + me.btnProtectDoc && me.btnProtectDoc.updateHint(me._state.currentProtectHint, true); setEvents.call(me); }); }, @@ -105,7 +108,7 @@ define([ getPanel: function () { this.$el = $(_.template(template)( {} )); - this.btnProtectDoc.render(this.$el.find('#slot-btn-protect-doc')); + this.btnProtectDoc && this.btnProtectDoc.render(this.$el.find('#slot-btn-protect-doc')); return this.$el; }, @@ -131,7 +134,7 @@ define([ } else if (type === Asc.c_oAscEDocProtect.TrackedChanges){ // none or tracked changes str = this.txtDocProtectedTrack; } - this.btnProtectDoc.updateHint(str, true); + this.btnProtectDoc && this.btnProtectDoc.updateHint(str, true); this._state.currentProtectHint = str; }, txtProtectDoc: 'Protect Document', From 193ec793110e1e948b8f5007ddac024abd8cc82b Mon Sep 17 00:00:00 2001 From: Alexey Koshelev Date: Sat, 14 Feb 2026 22:58:07 +0300 Subject: [PATCH 2/5] [DE Form] Add mark as final button --- apps/common/main/lib/controller/Protection.js | 8 +++++++- apps/common/main/lib/view/Protection.js | 18 ++++++++++++++++++ apps/documenteditor/main/locale/en.json | 1 + apps/pdfeditor/main/locale/en.json | 1 + apps/presentationeditor/main/locale/en.json | 1 + apps/spreadsheeteditor/main/locale/en.json | 1 + 6 files changed, 29 insertions(+), 1 deletion(-) diff --git a/apps/common/main/lib/controller/Protection.js b/apps/common/main/lib/controller/Protection.js index 8e155a19b4..919b7f6e1c 100644 --- a/apps/common/main/lib/controller/Protection.js +++ b/apps/common/main/lib/controller/Protection.js @@ -61,7 +61,8 @@ define([ this.addListeners({ 'Common.Views.Protection': { 'protect:password': _.bind(this.onPasswordClick, this), - 'protect:signature': _.bind(this.onSignatureClick, this) + 'protect:signature': _.bind(this.onSignatureClick, this), + 'protect:markAsFinal': _.bind(this.onMarkAsFinal, this), } }); }, @@ -132,6 +133,10 @@ define([ } }, + onMarkAsFinal: function(state) { + this.api && this.api.markAsFinal(state); + }, + createToolbarPanel: function() { return this.view.getPanel(); }, @@ -147,6 +152,7 @@ define([ accept(); })).then(function(){ me.onChangeProtectDocument(); + me.view && me.view.btnMarkAsFinal && me.view.btnMarkAsFinal.toggle(me.api.isFinal(), true); Common.NotificationCenter.on('protect:doclock', _.bind(me.onChangeProtectDocument, me)); }); }, diff --git a/apps/common/main/lib/view/Protection.js b/apps/common/main/lib/view/Protection.js index 7a520c9b96..6c9838a25e 100644 --- a/apps/common/main/lib/view/Protection.js +++ b/apps/common/main/lib/view/Protection.js @@ -57,6 +57,7 @@ define([ '' + '' + '' + + '' + '' + ''; @@ -122,6 +123,7 @@ define([ this._state = {disabled: false, hasPassword: false, disabledPassword: false, invisibleSignDisabled: false}; + const me = this; var filter = Common.localStorage.getKeysFilter(); this.appPrefix = (filter && filter.length) ? filter.split(',')[0] : ''; @@ -163,6 +165,20 @@ define([ this.btnsInvisibleSignature.push(this.btnSignature); } + if(this.appConfig.isPDFForm) { + this.btnMarkAsFinal = new Common.UI.Button({ + cls: 'btn-toolbar x-huge icon-top', + iconCls: 'toolbar__icon btn-ic-protect', + caption: this.txtMarkAsFinal, + enableToggle: true, + dataHint : '1', + dataHintDirection: 'bottom', + dataHintOffset: 'small' + }); + this.btnMarkAsFinal.on('toggle', function (btn, state) { + me.fireEvent('protect:markAsFinal', [state]); + }); + } Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this)); }, @@ -231,6 +247,7 @@ define([ this.btnAddPwd && this.btnAddPwd.render(this.$el.find('#slot-btn-add-password')); this.btnPwd && this.btnPwd.render(this.$el.find('#slot-btn-change-password')); this.btnSignature && this.btnSignature.render(this.$el.find('#slot-btn-signature')); + this.btnMarkAsFinal && this.btnMarkAsFinal.render(this.$el.find('#slot-btn-mark-as-final')); } return this.$el; }, @@ -353,6 +370,7 @@ define([ }, txtEncrypt: 'Encrypt', + txtMarkAsFinal: 'Mark as final', txtSignature: 'Signature', hintAddPwd: 'Encrypt with password', hintPwd: 'Change or delete password', diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index eb51fdcbae..90ebd80184 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -1051,6 +1051,7 @@ "Common.Views.Protection.txtChangePwd": "Change password", "Common.Views.Protection.txtDeletePwd": "Delete password", "Common.Views.Protection.txtEncrypt": "Encrypt", + "Common.Views.Protection.txtMarkAsFinal": "Mark as final", "Common.Views.Protection.txtInvisibleSignature": "Add digital signature", "Common.Views.Protection.txtSignature": "Signature", "Common.Views.Protection.txtSignatureLine": "Add signature line", diff --git a/apps/pdfeditor/main/locale/en.json b/apps/pdfeditor/main/locale/en.json index 67f9340e04..8ca1e7dc04 100644 --- a/apps/pdfeditor/main/locale/en.json +++ b/apps/pdfeditor/main/locale/en.json @@ -823,6 +823,7 @@ "Common.Views.Protection.txtChangePwd": "Change password", "Common.Views.Protection.txtDeletePwd": "Delete password", "Common.Views.Protection.txtEncrypt": "Encrypt", + "Common.Views.Protection.txtMarkAsFinal": "Mark as final", "Common.Views.Protection.txtInvisibleSignature": "Add digital signature", "Common.Views.Protection.txtSignature": "Signature", "Common.Views.Protection.txtSignatureLine": "Add signature line", diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index 08c2a53bfe..96dfa7e415 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -1134,6 +1134,7 @@ "Common.Views.Protection.txtChangePwd": "Change password", "Common.Views.Protection.txtDeletePwd": "Delete password", "Common.Views.Protection.txtEncrypt": "Encrypt", + "Common.Views.Protection.txtMarkAsFinal": "Mark as final", "Common.Views.Protection.txtInvisibleSignature": "Add digital signature", "Common.Views.Protection.txtSignature": "Signature", "Common.Views.Protection.txtSignatureLine": "Add signature line", diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index dd9214cadb..72aab5945b 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -1072,6 +1072,7 @@ "Common.Views.Protection.txtChangePwd": "Change password", "Common.Views.Protection.txtDeletePwd": "Delete password", "Common.Views.Protection.txtEncrypt": "Encrypt", + "Common.Views.Protection.txtMarkAsFinal": "Mark as final", "Common.Views.Protection.txtInvisibleSignature": "Add digital signature", "Common.Views.Protection.txtSignature": "Signature", "Common.Views.Protection.txtSignatureLine": "Add signature line", From 4c3ce796b7511b13d17c099efb0704969b62303c Mon Sep 17 00:00:00 2001 From: Alexey Koshelev Date: Mon, 16 Feb 2026 12:19:36 +0300 Subject: [PATCH 3/5] Refactoring --- apps/common/main/lib/controller/Protection.js | 9 ++++++++- apps/common/main/lib/view/Protection.js | 2 +- apps/documenteditor/main/locale/en.json | 2 +- apps/pdfeditor/main/locale/en.json | 2 +- apps/presentationeditor/main/locale/en.json | 2 +- apps/spreadsheeteditor/main/locale/en.json | 2 +- 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/apps/common/main/lib/controller/Protection.js b/apps/common/main/lib/controller/Protection.js index 919b7f6e1c..8d307f25b7 100644 --- a/apps/common/main/lib/controller/Protection.js +++ b/apps/common/main/lib/controller/Protection.js @@ -92,6 +92,8 @@ define([ this.api.asc_registerCallback('asc_onUpdateSignatures', _.bind(this.onApiUpdateSignatures, this)); } this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onCoAuthoringDisconnect, this)); + + Common.NotificationCenter.on('doc:mode-changed', _.bind(this.onChangeDocMode, this)); } }, @@ -152,7 +154,6 @@ define([ accept(); })).then(function(){ me.onChangeProtectDocument(); - me.view && me.view.btnMarkAsFinal && me.view.btnMarkAsFinal.toggle(me.api.isFinal(), true); Common.NotificationCenter.on('protect:doclock', _.bind(me.onChangeProtectDocument, me)); }); }, @@ -262,6 +263,12 @@ define([ onCoAuthoringDisconnect: function() { this.SetDisabled(true); + }, + + onChangeDocMode: function () { + if(this.view && this.view.btnMarkAsFinal) { + this.view.btnMarkAsFinal.toggle(this.api.isFinal(), true); + } } }, Common.Controllers.Protection || {})); diff --git a/apps/common/main/lib/view/Protection.js b/apps/common/main/lib/view/Protection.js index 6c9838a25e..5f4032a49a 100644 --- a/apps/common/main/lib/view/Protection.js +++ b/apps/common/main/lib/view/Protection.js @@ -370,7 +370,7 @@ define([ }, txtEncrypt: 'Encrypt', - txtMarkAsFinal: 'Mark as final', + txtMarkAsFinal: 'Protect Document', txtSignature: 'Signature', hintAddPwd: 'Encrypt with password', hintPwd: 'Change or delete password', diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index 90ebd80184..d07939ebac 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -1051,7 +1051,7 @@ "Common.Views.Protection.txtChangePwd": "Change password", "Common.Views.Protection.txtDeletePwd": "Delete password", "Common.Views.Protection.txtEncrypt": "Encrypt", - "Common.Views.Protection.txtMarkAsFinal": "Mark as final", + "Common.Views.Protection.txtMarkAsFinal": "Protect Document", "Common.Views.Protection.txtInvisibleSignature": "Add digital signature", "Common.Views.Protection.txtSignature": "Signature", "Common.Views.Protection.txtSignatureLine": "Add signature line", diff --git a/apps/pdfeditor/main/locale/en.json b/apps/pdfeditor/main/locale/en.json index 8ca1e7dc04..572c55c7db 100644 --- a/apps/pdfeditor/main/locale/en.json +++ b/apps/pdfeditor/main/locale/en.json @@ -823,7 +823,7 @@ "Common.Views.Protection.txtChangePwd": "Change password", "Common.Views.Protection.txtDeletePwd": "Delete password", "Common.Views.Protection.txtEncrypt": "Encrypt", - "Common.Views.Protection.txtMarkAsFinal": "Mark as final", + "Common.Views.Protection.txtMarkAsFinal": "Protect Document", "Common.Views.Protection.txtInvisibleSignature": "Add digital signature", "Common.Views.Protection.txtSignature": "Signature", "Common.Views.Protection.txtSignatureLine": "Add signature line", diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index 96dfa7e415..7b5502766e 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -1134,7 +1134,7 @@ "Common.Views.Protection.txtChangePwd": "Change password", "Common.Views.Protection.txtDeletePwd": "Delete password", "Common.Views.Protection.txtEncrypt": "Encrypt", - "Common.Views.Protection.txtMarkAsFinal": "Mark as final", + "Common.Views.Protection.txtMarkAsFinal": "Protect Document", "Common.Views.Protection.txtInvisibleSignature": "Add digital signature", "Common.Views.Protection.txtSignature": "Signature", "Common.Views.Protection.txtSignatureLine": "Add signature line", diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index 72aab5945b..5d7a066732 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -1072,7 +1072,7 @@ "Common.Views.Protection.txtChangePwd": "Change password", "Common.Views.Protection.txtDeletePwd": "Delete password", "Common.Views.Protection.txtEncrypt": "Encrypt", - "Common.Views.Protection.txtMarkAsFinal": "Mark as final", + "Common.Views.Protection.txtMarkAsFinal": "Protect Document", "Common.Views.Protection.txtInvisibleSignature": "Add digital signature", "Common.Views.Protection.txtSignature": "Signature", "Common.Views.Protection.txtSignatureLine": "Add signature line", From 4579ae4ba1de6b0e11bdaa0a1cf2b050e6c2072a Mon Sep 17 00:00:00 2001 From: Alexey Koshelev Date: Mon, 16 Feb 2026 15:22:54 +0300 Subject: [PATCH 4/5] Change icon and text --- apps/common/main/lib/controller/Protection.js | 4 ++-- apps/common/main/lib/view/Protection.js | 18 +++++++++++------- apps/documenteditor/main/locale/en.json | 2 +- apps/pdfeditor/main/locale/en.json | 2 +- apps/presentationeditor/main/locale/en.json | 2 +- apps/spreadsheeteditor/main/locale/en.json | 2 +- 6 files changed, 17 insertions(+), 13 deletions(-) diff --git a/apps/common/main/lib/controller/Protection.js b/apps/common/main/lib/controller/Protection.js index 8d307f25b7..9d45992dcd 100644 --- a/apps/common/main/lib/controller/Protection.js +++ b/apps/common/main/lib/controller/Protection.js @@ -266,8 +266,8 @@ define([ }, onChangeDocMode: function () { - if(this.view && this.view.btnMarkAsFinal) { - this.view.btnMarkAsFinal.toggle(this.api.isFinal(), true); + if(this.view && this.view.btnProtectForm) { + this.view.btnProtectForm.toggle(this.api.isFinal(), true); } } diff --git a/apps/common/main/lib/view/Protection.js b/apps/common/main/lib/view/Protection.js index 5f4032a49a..40b508ea68 100644 --- a/apps/common/main/lib/view/Protection.js +++ b/apps/common/main/lib/view/Protection.js @@ -57,7 +57,10 @@ define([ '' + '' + '' + - '' + + '' + + '
' + + '
' + + '' + '
' + ''; @@ -166,16 +169,16 @@ define([ } if(this.appConfig.isPDFForm) { - this.btnMarkAsFinal = new Common.UI.Button({ + this.btnProtectForm = new Common.UI.Button({ cls: 'btn-toolbar x-huge icon-top', - iconCls: 'toolbar__icon btn-ic-protect', - caption: this.txtMarkAsFinal, + iconCls: 'toolbar__icon btn-restrict-editing', + caption: this.txtProtectForm, enableToggle: true, dataHint : '1', dataHintDirection: 'bottom', dataHintOffset: 'small' }); - this.btnMarkAsFinal.on('toggle', function (btn, state) { + this.btnProtectForm.on('toggle', function (btn, state) { me.fireEvent('protect:markAsFinal', [state]); }); } @@ -235,6 +238,7 @@ define([ } Common.NotificationCenter.trigger('tab:visible', 'protect', Common.UI.LayoutManager.isElementVisible('toolbar-protect')); } + !me.btnProtectForm && (me.$el || $(me.el)).find('.separator.protect-form').hide(); setEvents.call(me); }); @@ -247,7 +251,7 @@ define([ this.btnAddPwd && this.btnAddPwd.render(this.$el.find('#slot-btn-add-password')); this.btnPwd && this.btnPwd.render(this.$el.find('#slot-btn-change-password')); this.btnSignature && this.btnSignature.render(this.$el.find('#slot-btn-signature')); - this.btnMarkAsFinal && this.btnMarkAsFinal.render(this.$el.find('#slot-btn-mark-as-final')); + this.btnProtectForm && this.btnProtectForm.render(this.$el.find('#slot-btn-protect-form')); } return this.$el; }, @@ -370,7 +374,7 @@ define([ }, txtEncrypt: 'Encrypt', - txtMarkAsFinal: 'Protect Document', + txtProtectForm: 'Protect Form', txtSignature: 'Signature', hintAddPwd: 'Encrypt with password', hintPwd: 'Change or delete password', diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index d07939ebac..5781bba471 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -1051,7 +1051,7 @@ "Common.Views.Protection.txtChangePwd": "Change password", "Common.Views.Protection.txtDeletePwd": "Delete password", "Common.Views.Protection.txtEncrypt": "Encrypt", - "Common.Views.Protection.txtMarkAsFinal": "Protect Document", + "Common.Views.Protection.txtProtectForm": "Protect Form", "Common.Views.Protection.txtInvisibleSignature": "Add digital signature", "Common.Views.Protection.txtSignature": "Signature", "Common.Views.Protection.txtSignatureLine": "Add signature line", diff --git a/apps/pdfeditor/main/locale/en.json b/apps/pdfeditor/main/locale/en.json index 572c55c7db..7e9e5c947e 100644 --- a/apps/pdfeditor/main/locale/en.json +++ b/apps/pdfeditor/main/locale/en.json @@ -823,7 +823,7 @@ "Common.Views.Protection.txtChangePwd": "Change password", "Common.Views.Protection.txtDeletePwd": "Delete password", "Common.Views.Protection.txtEncrypt": "Encrypt", - "Common.Views.Protection.txtMarkAsFinal": "Protect Document", + "Common.Views.Protection.txtProtectForm": "Protect Form", "Common.Views.Protection.txtInvisibleSignature": "Add digital signature", "Common.Views.Protection.txtSignature": "Signature", "Common.Views.Protection.txtSignatureLine": "Add signature line", diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index 7b5502766e..942567a619 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -1134,7 +1134,7 @@ "Common.Views.Protection.txtChangePwd": "Change password", "Common.Views.Protection.txtDeletePwd": "Delete password", "Common.Views.Protection.txtEncrypt": "Encrypt", - "Common.Views.Protection.txtMarkAsFinal": "Protect Document", + "Common.Views.Protection.txtProtectForm": "Protect Form", "Common.Views.Protection.txtInvisibleSignature": "Add digital signature", "Common.Views.Protection.txtSignature": "Signature", "Common.Views.Protection.txtSignatureLine": "Add signature line", diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index 5d7a066732..298c034c0e 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -1072,7 +1072,7 @@ "Common.Views.Protection.txtChangePwd": "Change password", "Common.Views.Protection.txtDeletePwd": "Delete password", "Common.Views.Protection.txtEncrypt": "Encrypt", - "Common.Views.Protection.txtMarkAsFinal": "Protect Document", + "Common.Views.Protection.txtProtectForm": "Protect Form", "Common.Views.Protection.txtInvisibleSignature": "Add digital signature", "Common.Views.Protection.txtSignature": "Signature", "Common.Views.Protection.txtSignatureLine": "Add signature line", From 725a8aba2bc82b5a3c52711e499d44872c06f772 Mon Sep 17 00:00:00 2001 From: Alexey Koshelev Date: Mon, 16 Feb 2026 15:32:29 +0300 Subject: [PATCH 5/5] Refactoring --- apps/common/main/lib/controller/Protection.js | 8 ++++---- apps/common/main/lib/view/Protection.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/common/main/lib/controller/Protection.js b/apps/common/main/lib/controller/Protection.js index 9d45992dcd..92c6b08896 100644 --- a/apps/common/main/lib/controller/Protection.js +++ b/apps/common/main/lib/controller/Protection.js @@ -62,7 +62,7 @@ define([ 'Common.Views.Protection': { 'protect:password': _.bind(this.onPasswordClick, this), 'protect:signature': _.bind(this.onSignatureClick, this), - 'protect:markAsFinal': _.bind(this.onMarkAsFinal, this), + 'protect:protectForm': _.bind(this.onProtectForm, this), } }); }, @@ -135,8 +135,8 @@ define([ } }, - onMarkAsFinal: function(state) { - this.api && this.api.markAsFinal(state); + onProtectForm: function(state) { + this.api && this.api.asc_markAsFinal(state); }, createToolbarPanel: function() { @@ -267,7 +267,7 @@ define([ onChangeDocMode: function () { if(this.view && this.view.btnProtectForm) { - this.view.btnProtectForm.toggle(this.api.isFinal(), true); + this.view.btnProtectForm.toggle(this.api.asc_isFinal(), true); } } diff --git a/apps/common/main/lib/view/Protection.js b/apps/common/main/lib/view/Protection.js index 40b508ea68..101ac7ed76 100644 --- a/apps/common/main/lib/view/Protection.js +++ b/apps/common/main/lib/view/Protection.js @@ -179,7 +179,7 @@ define([ dataHintOffset: 'small' }); this.btnProtectForm.on('toggle', function (btn, state) { - me.fireEvent('protect:markAsFinal', [state]); + me.fireEvent('protect:protectForm', [state]); }); }