[DE] Support fillForms parameter for not-oform files
This commit is contained in:
parent
2b31602fa2
commit
a8ca0bb10a
|
@ -483,8 +483,8 @@ define([
|
||||||
this.appOptions.canFeatureForms = !!(type && typeof type[1] === 'string');
|
this.appOptions.canFeatureForms = !!(type && typeof type[1] === 'string');
|
||||||
|
|
||||||
type = data.doc ? /^(?:(oform))$/.exec(data.doc.fileType) : false;
|
type = data.doc ? /^(?:(oform))$/.exec(data.doc.fileType) : false;
|
||||||
if (type && typeof type[1] === 'string')
|
if (type && typeof type[1] === 'string') // open oform files in forms editor or in viewer
|
||||||
this.permissions.edit = this.permissions.review = this.permissions.comment = false;
|
this.permissions.edit = this.permissions.review = this.permissions.comment = this.permissions.fillForms = false;
|
||||||
|
|
||||||
this.api.asc_registerCallback('asc_onGetEditorPermissions', _.bind(this.onEditorPermissions, this));
|
this.api.asc_registerCallback('asc_onGetEditorPermissions', _.bind(this.onEditorPermissions, this));
|
||||||
this.api.asc_registerCallback('asc_onLicenseChanged', _.bind(this.onLicenseChanged, this));
|
this.api.asc_registerCallback('asc_onLicenseChanged', _.bind(this.onLicenseChanged, this));
|
||||||
|
@ -1425,8 +1425,7 @@ define([
|
||||||
this.appOptions.canEditContentControl = (this.permissions.modifyContentControl!==false);
|
this.appOptions.canEditContentControl = (this.permissions.modifyContentControl!==false);
|
||||||
this.appOptions.canHelp = !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.help===false);
|
this.appOptions.canHelp = !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.help===false);
|
||||||
this.appOptions.canSubmitForms = false; // this.appOptions.canLicense && (typeof (this.editorConfig.customization) == 'object') && !!this.editorConfig.customization.submitForm;
|
this.appOptions.canSubmitForms = false; // this.appOptions.canLicense && (typeof (this.editorConfig.customization) == 'object') && !!this.editorConfig.customization.submitForm;
|
||||||
// use forms editor for filling forms mode
|
this.appOptions.canFillForms = this.appOptions.canLicense && ((this.permissions.fillForms===undefined) ? this.appOptions.isEdit : this.permissions.fillForms) && (this.editorConfig.mode !== 'view');
|
||||||
this.appOptions.canFillForms = false;// this.appOptions.canLicense && ((this.permissions.fillForms===undefined) ? this.appOptions.isEdit : this.permissions.fillForms) && (this.editorConfig.mode !== 'view');
|
|
||||||
this.appOptions.isRestrictedEdit = !this.appOptions.isEdit && (this.appOptions.canComments || this.appOptions.canFillForms);
|
this.appOptions.isRestrictedEdit = !this.appOptions.isEdit && (this.appOptions.canComments || this.appOptions.canFillForms);
|
||||||
if (this.appOptions.isRestrictedEdit && this.appOptions.canComments && this.appOptions.canFillForms) // must be one restricted mode, priority for filling forms
|
if (this.appOptions.isRestrictedEdit && this.appOptions.canComments && this.appOptions.canFillForms) // must be one restricted mode, priority for filling forms
|
||||||
this.appOptions.canComments = false;
|
this.appOptions.canComments = false;
|
||||||
|
|
|
@ -118,14 +118,13 @@ export class storeAppOptions {
|
||||||
this.canEditStyles = this.canLicense && this.canEdit;
|
this.canEditStyles = this.canLicense && this.canEdit;
|
||||||
this.canPrint = (permissions.print !== false);
|
this.canPrint = (permissions.print !== false);
|
||||||
this.fileKey = document.key;
|
this.fileKey = document.key;
|
||||||
let type = /^(?:(oform))$/.exec(document.fileType); // can fill forms only in oform format
|
this.canFillForms = this.canLicense && ((permissions.fillForms===undefined) ? this.isEdit : permissions.fillForms) && (this.config.mode !== 'view');
|
||||||
this.canFillForms = this.canLicense && (!!type && typeof type[1] === 'string') && ((permissions.fillForms===undefined) ? this.isEdit : permissions.fillForms) && (this.config.mode !== 'view');
|
|
||||||
this.isRestrictedEdit = !this.isEdit && (this.canComments || this.canFillForms);
|
this.isRestrictedEdit = !this.isEdit && (this.canComments || this.canFillForms);
|
||||||
if (this.isRestrictedEdit && this.canComments && this.canFillForms) // must be one restricted mode, priority for filling forms
|
if (this.isRestrictedEdit && this.canComments && this.canFillForms) // must be one restricted mode, priority for filling forms
|
||||||
this.canComments = false;
|
this.canComments = false;
|
||||||
this.trialMode = params.asc_getLicenseMode();
|
this.trialMode = params.asc_getLicenseMode();
|
||||||
|
|
||||||
type = /^(?:(pdf|djvu|xps|oxps))$/.exec(document.fileType);
|
const type = /^(?:(pdf|djvu|xps|oxps))$/.exec(document.fileType);
|
||||||
this.canDownloadOrigin = permissions.download !== false && (type && typeof type[1] === 'string');
|
this.canDownloadOrigin = permissions.download !== false && (type && typeof type[1] === 'string');
|
||||||
this.canDownload = permissions.download !== false && (!type || typeof type[1] !== 'string');
|
this.canDownload = permissions.download !== false && (!type || typeof type[1] !== 'string');
|
||||||
this.canReader = (!type || typeof type[1] !== 'string');
|
this.canReader = (!type || typeof type[1] !== 'string');
|
||||||
|
|
Loading…
Reference in a new issue