diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js index aee333978b..6aa421db1d 100644 --- a/apps/api/documents/api.js +++ b/apps/api/documents/api.js @@ -312,6 +312,7 @@ 'onSubmit': // send when filled form is submitted successfully 'onRequestRefreshFile': // send when file version is updated. use instead of onOutdatedVersion 'onUserActionRequired': // send if the user needs to enter a password or select encoding/delimiters when opening a file + 'onRequestFillingStatus': // used in pdf-form fill forms mode } } @@ -383,6 +384,7 @@ _config.editorConfig.canSaveDocumentToBinary = _config.events && !!_config.events.onSaveDocument; _config.editorConfig.canStartFilling = _config.events && !!_config.events.onRequestStartFilling; _config.editorConfig.canRequestRefreshFile = _config.events && !!_config.events.onRequestRefreshFile; + _config.editorConfig.canRequestFillingStatus = _config.events && !!_config.events.onRequestFillingStatus; _config.frameEditorId = placeholderId; _config.parentOrigin = window.location.origin; diff --git a/apps/common/Gateway.js b/apps/common/Gateway.js index 5ff5b6b862..a27b34e717 100644 --- a/apps/common/Gateway.js +++ b/apps/common/Gateway.js @@ -409,6 +409,13 @@ if (window.Common === undefined) { }); }, + requestFillingStatus: function (role) { + _postMessage({ + event:'onRequestFillingStatus', + data: role + }); + }, + pluginsReady: function() { _postMessage({ event: 'onPluginsReady' }); }, diff --git a/apps/documenteditor/forms/app/controller/ApplicationController.js b/apps/documenteditor/forms/app/controller/ApplicationController.js index 44142e6011..ea78544bc5 100644 --- a/apps/documenteditor/forms/app/controller/ApplicationController.js +++ b/apps/documenteditor/forms/app/controller/ApplicationController.js @@ -472,6 +472,7 @@ define([ this.appOptions.isDesktopApp = this.editorConfig.targetApp == 'desktop' || Common.Controllers.Desktop.isActive(); this.appOptions.lang = this.editorConfig.lang; this.appOptions.canPlugins = false; + this.appOptions.canRequestFillingStatus = this.editorConfig.canRequestFillingStatus; Common.Controllers.Desktop.init(this.appOptions); @@ -664,6 +665,7 @@ define([ me.view.btnDownload.updateHint(''); } me.showFillingForms(false); // hide filling forms + me.view.btnFillStatus.setVisible(this.appOptions.canFillForms && this.appOptions.canRequestFillingStatus); if (this.appOptions.canFillForms) { me.view.btnPrev.on('click', function(){ me.api.asc_MoveToFillingForm(false); @@ -723,6 +725,9 @@ define([ me.view.btnRedo.on('click', function(){ me.api.Redo(false); }); + me.view.btnFillStatus.on('click', function(){ + Common.Gateway.requestFillingStatus(me.appOptions.user.roles && me.appOptions.user.roles.length>0 ? me.appOptions.user.roles[0] : undefined); + }); this.api.asc_setRestriction(Asc.c_oAscRestrictionType.OnlyForms); this.api.asc_SetFastCollaborative(true); diff --git a/apps/documenteditor/forms/app/view/ApplicationView.js b/apps/documenteditor/forms/app/view/ApplicationView.js index a1edcc2d06..835666cc56 100644 --- a/apps/documenteditor/forms/app/view/ApplicationView.js +++ b/apps/documenteditor/forms/app/view/ApplicationView.js @@ -107,7 +107,6 @@ define([ this.btnOptions.menu.items[2].cmpEl.addClass('small-resolution'); this.btnOptions.menu.items[4].cmpEl.addClass('small-resolution'); - this.btnClear = new Common.UI.Button({ cls: 'btn-toolbar', iconCls: 'svg-icon clear-style', @@ -179,6 +178,14 @@ define([ }); this.btnClose.render($('#id-btn-close-editor')); + this.btnFillStatus = new Common.UI.Button({ + cls: 'btn-toolbar margin-right-small', + iconCls: 'svg-icon status', + hint: this.tipFillStatus, + scaling: false + }); + this.btnFillStatus.render($('#id-btn-status')); + return this; }, @@ -225,7 +232,8 @@ define([ tipRedo: 'Redo', textClearField: 'Clear field', textClose: 'Close file', - tipSubmit: 'Submit form' + tipSubmit: 'Submit form', + tipFillStatus: 'Filling status' }, DE.Views.ApplicationView || {})); }); \ No newline at end of file diff --git a/apps/documenteditor/forms/index.html b/apps/documenteditor/forms/index.html index 9e2b9969f7..7bfb95804a 100644 --- a/apps/documenteditor/forms/index.html +++ b/apps/documenteditor/forms/index.html @@ -250,6 +250,7 @@
+
diff --git a/apps/documenteditor/forms/index.html.deploy b/apps/documenteditor/forms/index.html.deploy index ffa3d9c361..840eb80a3f 100644 --- a/apps/documenteditor/forms/index.html.deploy +++ b/apps/documenteditor/forms/index.html.deploy @@ -228,6 +228,7 @@
+
diff --git a/apps/documenteditor/forms/locale/en.json b/apps/documenteditor/forms/locale/en.json index cf993c674e..725a52237d 100644 --- a/apps/documenteditor/forms/locale/en.json +++ b/apps/documenteditor/forms/locale/en.json @@ -194,5 +194,6 @@ "DE.Views.ApplicationView.txtPrint": "Print", "DE.Views.ApplicationView.txtSearch": "Find", "DE.Views.ApplicationView.txtShare": "Share", - "DE.Views.ApplicationView.txtTheme": "Interface theme" + "DE.Views.ApplicationView.txtTheme": "Interface theme", + "DE.Views.ApplicationView.tipFillStatus": "Filling status" } \ No newline at end of file