Merge pull request #1376 from ONLYOFFICE/feature/Bug_54137
[DE] Fix Bug 54137
This commit is contained in:
commit
eff237ea21
|
@ -15,6 +15,7 @@ import EditorUIController from '../lib/patch';
|
|||
canViewComments: stores.storeAppOptions.canViewComments,
|
||||
canCoAuthoring: stores.storeAppOptions.canCoAuthoring,
|
||||
canReview: stores.storeAppOptions.canReview,
|
||||
canFillForms: stores.storeAppOptions.canFillForms,
|
||||
users: stores.users,
|
||||
isDisconnected: stores.users.isDisconnected,
|
||||
displayMode: stores.storeReview.displayMode
|
||||
|
@ -212,7 +213,7 @@ class ContextMenu extends ContextMenuController {
|
|||
|
||||
initMenuItems() {
|
||||
if ( !Common.EditorApi ) return [];
|
||||
const { isEdit } = this.props;
|
||||
const { isEdit, canFillForms } = this.props;
|
||||
|
||||
if (isEdit && EditorUIController.ContextMenu) {
|
||||
return EditorUIController.ContextMenu.mapMenuItems(this);
|
||||
|
@ -258,6 +259,20 @@ class ContextMenu extends ContextMenuController {
|
|||
});
|
||||
}
|
||||
|
||||
if ( canFillForms && canCopy && !locked ) {
|
||||
itemsIcon.push({
|
||||
event: 'cut',
|
||||
icon: 'icon-cut'
|
||||
});
|
||||
}
|
||||
|
||||
if ( canFillForms && !locked ) {
|
||||
itemsIcon.push({
|
||||
event: 'paste',
|
||||
icon: 'icon-paste'
|
||||
});
|
||||
}
|
||||
|
||||
if ( canViewComments && this.isComments ) {
|
||||
itemsText.push({
|
||||
caption: _t.menuViewComment,
|
||||
|
|
|
@ -118,7 +118,8 @@ export class storeAppOptions {
|
|||
this.canEditStyles = this.canLicense && this.canEdit;
|
||||
this.canPrint = (permissions.print !== false);
|
||||
this.fileKey = document.key;
|
||||
this.canFillForms = this.canLicense && ((permissions.fillForms===undefined) ? this.isEdit : permissions.fillForms) && (this.config.mode !== 'view');
|
||||
const typeForm = /^(?:(oform))$/.exec(document.fileType); // can fill forms only in oform format
|
||||
this.canFillForms = this.canLicense && !!(typeForm && typeof typeForm[1] === 'string') && ((permissions.fillForms===undefined) ? this.isEdit : permissions.fillForms) && (this.config.mode !== 'view');
|
||||
this.isRestrictedEdit = !this.isEdit && (this.canComments || this.canFillForms);
|
||||
if (this.isRestrictedEdit && this.canComments && this.canFillForms) // must be one restricted mode, priority for filling forms
|
||||
this.canComments = false;
|
||||
|
|
Loading…
Reference in a new issue