Add onRequestFillingStatus event

This commit is contained in:
Julia Radzhabova
2025-02-19 22:29:13 +03:00
parent e47101cf5c
commit 7b2234b21d
7 changed files with 28 additions and 3 deletions

View File

@ -312,6 +312,7 @@
'onSubmit': <filled form is submitted> // send when filled form is submitted successfully 'onSubmit': <filled form is submitted> // send when filled form is submitted successfully
'onRequestRefreshFile': <request new file version> // send when file version is updated. use instead of onOutdatedVersion 'onRequestRefreshFile': <request new file version> // send when file version is updated. use instead of onOutdatedVersion
'onUserActionRequired': <user action callback> // send if the user needs to enter a password or select encoding/delimiters when opening a file 'onUserActionRequired': <user action callback> // send if the user needs to enter a password or select encoding/delimiters when opening a file
'onRequestFillingStatus': <request filling status for current role> // used in pdf-form fill forms mode
} }
} }
@ -383,6 +384,7 @@
_config.editorConfig.canSaveDocumentToBinary = _config.events && !!_config.events.onSaveDocument; _config.editorConfig.canSaveDocumentToBinary = _config.events && !!_config.events.onSaveDocument;
_config.editorConfig.canStartFilling = _config.events && !!_config.events.onRequestStartFilling; _config.editorConfig.canStartFilling = _config.events && !!_config.events.onRequestStartFilling;
_config.editorConfig.canRequestRefreshFile = _config.events && !!_config.events.onRequestRefreshFile; _config.editorConfig.canRequestRefreshFile = _config.events && !!_config.events.onRequestRefreshFile;
_config.editorConfig.canRequestFillingStatus = _config.events && !!_config.events.onRequestFillingStatus;
_config.frameEditorId = placeholderId; _config.frameEditorId = placeholderId;
_config.parentOrigin = window.location.origin; _config.parentOrigin = window.location.origin;

View File

@ -409,6 +409,13 @@ if (window.Common === undefined) {
}); });
}, },
requestFillingStatus: function (role) {
_postMessage({
event:'onRequestFillingStatus',
data: role
});
},
pluginsReady: function() { pluginsReady: function() {
_postMessage({ event: 'onPluginsReady' }); _postMessage({ event: 'onPluginsReady' });
}, },

View File

@ -472,6 +472,7 @@ define([
this.appOptions.isDesktopApp = this.editorConfig.targetApp == 'desktop' || Common.Controllers.Desktop.isActive(); this.appOptions.isDesktopApp = this.editorConfig.targetApp == 'desktop' || Common.Controllers.Desktop.isActive();
this.appOptions.lang = this.editorConfig.lang; this.appOptions.lang = this.editorConfig.lang;
this.appOptions.canPlugins = false; this.appOptions.canPlugins = false;
this.appOptions.canRequestFillingStatus = this.editorConfig.canRequestFillingStatus;
Common.Controllers.Desktop.init(this.appOptions); Common.Controllers.Desktop.init(this.appOptions);
@ -664,6 +665,7 @@ define([
me.view.btnDownload.updateHint(''); me.view.btnDownload.updateHint('');
} }
me.showFillingForms(false); // hide filling forms me.showFillingForms(false); // hide filling forms
me.view.btnFillStatus.setVisible(this.appOptions.canFillForms && this.appOptions.canRequestFillingStatus);
if (this.appOptions.canFillForms) { if (this.appOptions.canFillForms) {
me.view.btnPrev.on('click', function(){ me.view.btnPrev.on('click', function(){
me.api.asc_MoveToFillingForm(false); me.api.asc_MoveToFillingForm(false);
@ -723,6 +725,9 @@ define([
me.view.btnRedo.on('click', function(){ me.view.btnRedo.on('click', function(){
me.api.Redo(false); 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_setRestriction(Asc.c_oAscRestrictionType.OnlyForms);
this.api.asc_SetFastCollaborative(true); this.api.asc_SetFastCollaborative(true);

View File

@ -107,7 +107,6 @@ define([
this.btnOptions.menu.items[2].cmpEl.addClass('small-resolution'); this.btnOptions.menu.items[2].cmpEl.addClass('small-resolution');
this.btnOptions.menu.items[4].cmpEl.addClass('small-resolution'); this.btnOptions.menu.items[4].cmpEl.addClass('small-resolution');
this.btnClear = new Common.UI.Button({ this.btnClear = new Common.UI.Button({
cls: 'btn-toolbar', cls: 'btn-toolbar',
iconCls: 'svg-icon clear-style', iconCls: 'svg-icon clear-style',
@ -179,6 +178,14 @@ define([
}); });
this.btnClose.render($('#id-btn-close-editor')); 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; return this;
}, },
@ -225,7 +232,8 @@ define([
tipRedo: 'Redo', tipRedo: 'Redo',
textClearField: 'Clear field', textClearField: 'Clear field',
textClose: 'Close file', textClose: 'Close file',
tipSubmit: 'Submit form' tipSubmit: 'Submit form',
tipFillStatus: 'Filling status'
}, DE.Views.ApplicationView || {})); }, DE.Views.ApplicationView || {}));
}); });

View File

@ -250,6 +250,7 @@
</div> </div>
<div id="id-submit-group" style="display: inline-block;"></div> <div id="id-submit-group" style="display: inline-block;"></div>
<div id="id-download-group" style="display: inline-block;"></div> <div id="id-download-group" style="display: inline-block;"></div>
<div id="id-btn-status" style="display: inline-block;"></div>
<span id="box-tools"></span> <span id="box-tools"></span>
<div id="id-btn-close-editor" style="display: inline-block;"></div> <div id="id-btn-close-editor" style="display: inline-block;"></div>
</div> </div>

View File

@ -228,6 +228,7 @@
</div> </div>
<div id="id-submit-group" style="display: inline-block;"></div> <div id="id-submit-group" style="display: inline-block;"></div>
<div id="id-download-group" style="display: inline-block;"></div> <div id="id-download-group" style="display: inline-block;"></div>
<div id="id-btn-status" style="display: inline-block;"></div>
<span id="box-tools"></span> <span id="box-tools"></span>
<div id="id-btn-close-editor" style="display: inline-block;"></div> <div id="id-btn-close-editor" style="display: inline-block;"></div>
</div> </div>

View File

@ -194,5 +194,6 @@
"DE.Views.ApplicationView.txtPrint": "Print", "DE.Views.ApplicationView.txtPrint": "Print",
"DE.Views.ApplicationView.txtSearch": "Find", "DE.Views.ApplicationView.txtSearch": "Find",
"DE.Views.ApplicationView.txtShare": "Share", "DE.Views.ApplicationView.txtShare": "Share",
"DE.Views.ApplicationView.txtTheme": "Interface theme" "DE.Views.ApplicationView.txtTheme": "Interface theme",
"DE.Views.ApplicationView.tipFillStatus": "Filling status"
} }