Merge pull request #1260 from ONLYOFFICE/fix/forms

Fix/forms
This commit is contained in:
Julia Radzhabova 2021-10-20 19:00:45 +03:00 committed by GitHub
commit 031d71c7d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 62 additions and 6 deletions

View file

@ -884,10 +884,11 @@
? "mobile" : config.document.permissions && (config.document.permissions.fillForms === true) && (config.editorConfig.mode !== 'view')
? "forms" : "embed";
} else {
if (app==='documenteditor' && config.document && config.document.permissions && (config.document.permissions.edit === false) && (config.document.permissions.review !== true)) {
config.document.permissions.fillForms = false;
}
path_type = (config.type === "mobile" || isSafari_mobile)
? "mobile" : ((app==='documenteditor') && config.document && config.document.permissions && (config.document.permissions.fillForms===true) &&
(config.document.permissions.edit === false) && (config.document.permissions.review !== true) && (config.editorConfig.mode !== 'view'))
? "forms" : (config.type === "embedded")
? "mobile" : (config.type === "embedded")
? "embed" : "main";
}

View file

@ -0,0 +1,16 @@
<svg width="100" height="127" viewBox="0 0 100 127" fill="none" xmlns="http://www.w3.org/2000/svg">
<symbol id="svg-format-docxf">
<g>
<path id="Vector" d="M95 23V119C95 119.796 94.6839 120.559 94.1213 121.121C93.5587 121.684 92.7956 122 92 122H8C7.20435 122 6.44129 121.684 5.87868 121.121C5.31607 120.559 5 119.796 5 119V8C5 7.20435 5.31607 6.44129 5.87868 5.87868C6.44129 5.31607 7.20435 5 8 5H77L95 23Z" fill="#5D86C4"/>
<path id="Vector_2" opacity="0.2" d="M95 23H80C79.2044 23 78.4413 22.6839 77.8787 22.1213C77.3161 21.5587 77 20.7956 77 20V5L95 23Z" fill="black"/>
<g>
<path d="M38.3477 109.635C38.3477 111.045 37.9453 112.125 37.1406 112.875C36.3398 113.625 35.1816 114 33.666 114H31.2402V105.434H33.9297C35.3281 105.434 36.4141 105.803 37.1875 106.541C37.9609 107.279 38.3477 108.311 38.3477 109.635ZM36.4609 109.682C36.4609 107.842 35.6484 106.922 34.0234 106.922H33.0566V112.5H33.8359C35.5859 112.5 36.4609 111.561 36.4609 109.682Z" fill="white"/>
<path d="M47.8984 109.705C47.8984 111.123 47.5469 112.213 46.8438 112.975C46.1406 113.736 45.1328 114.117 43.8203 114.117C42.5078 114.117 41.5 113.736 40.7969 112.975C40.0938 112.213 39.7422 111.119 39.7422 109.693C39.7422 108.268 40.0938 107.18 40.7969 106.43C41.5039 105.676 42.5156 105.299 43.832 105.299C45.1484 105.299 46.1543 105.678 46.8496 106.436C47.5488 107.193 47.8984 108.283 47.8984 109.705ZM41.6465 109.705C41.6465 110.662 41.8281 111.383 42.1914 111.867C42.5547 112.352 43.0977 112.594 43.8203 112.594C45.2695 112.594 45.9941 111.631 45.9941 109.705C45.9941 107.775 45.2734 106.811 43.832 106.811C43.1094 106.811 42.5645 107.055 42.1973 107.543C41.8301 108.027 41.6465 108.748 41.6465 109.705Z" fill="white"/>
<path d="M53.3125 106.822C52.6289 106.822 52.0996 107.08 51.7246 107.596C51.3496 108.107 51.1621 108.822 51.1621 109.74C51.1621 111.65 51.8789 112.605 53.3125 112.605C53.9141 112.605 54.6426 112.455 55.498 112.154V113.678C54.7949 113.971 54.0098 114.117 53.1426 114.117C51.8965 114.117 50.9434 113.74 50.2832 112.986C49.623 112.229 49.293 111.143 49.293 109.729C49.293 108.838 49.4551 108.059 49.7793 107.391C50.1035 106.719 50.5684 106.205 51.1738 105.85C51.7832 105.49 52.4961 105.311 53.3125 105.311C54.1445 105.311 54.9805 105.512 55.8203 105.914L55.2344 107.391C54.9141 107.238 54.5918 107.105 54.2676 106.992C53.9434 106.879 53.625 106.822 53.3125 106.822Z" fill="white"/>
<path d="M64.252 114H62.1777L60.1855 110.76L58.1934 114H56.248L59.0898 109.582L56.4297 105.434H58.4336L60.2793 108.516L62.0898 105.434H64.0469L61.3574 109.682L64.252 114Z" fill="white"/>
<path d="M67.1172 114H65.3301V105.434H70.2402V106.922H67.1172V109.131H70.0234V110.613H67.1172V114Z" fill="white"/>
</g>
<path id="Vector_3" d="M67.8 48L61.5 75L54.5 48H51.5H48.5L41.5 75L35.2 48H29.4L37.9 82H44.3L51.5 54.1L58.7 82H65.1L73.6 48H67.8Z" fill="white"/>
</g>
</symbol>
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

View file

@ -0,0 +1,18 @@
<svg width="100" height="127" viewBox="0 0 100 127" fill="none" xmlns="http://www.w3.org/2000/svg">
<symbol id="svg-format-oform">
<path d="M95 23V119C95 119.796 94.6839 120.559 94.1213 121.121C93.5587 121.684 92.7956 122 92 122H8C7.20435 122 6.44129 121.684 5.87868 121.121C5.31607 120.559 5 119.796 5 119V8C5 7.20435 5.31607 6.44129 5.87868 5.87868C6.44129 5.31607 7.20435 5 8 5H77L95 23Z" fill="#2CA498"/>
<path opacity="0.2" d="M95 23H80C79.2044 23 78.4413 22.6839 77.8787 22.1213C77.3161 21.5587 77 20.7956 77 20V5L95 23Z" fill="black"/>
<path d="M36.8535 109.705C36.8535 111.123 36.502 112.213 35.7988 112.975C35.0957 113.736 34.0879 114.117 32.7754 114.117C31.4629 114.117 30.4551 113.736 29.752 112.975C29.0488 112.213 28.6973 111.119 28.6973 109.693C28.6973 108.268 29.0488 107.18 29.752 106.43C30.459 105.676 31.4707 105.299 32.7871 105.299C34.1035 105.299 35.1094 105.678 35.8047 106.436C36.5039 107.193 36.8535 108.283 36.8535 109.705ZM30.6016 109.705C30.6016 110.662 30.7832 111.383 31.1465 111.867C31.5098 112.352 32.0527 112.594 32.7754 112.594C34.2246 112.594 34.9492 111.631 34.9492 109.705C34.9492 107.775 34.2285 106.811 32.7871 106.811C32.0645 106.811 31.5195 107.055 31.1523 107.543C30.7852 108.027 30.6016 108.748 30.6016 109.705Z" fill="white"/>
<path d="M40.416 114H38.6289V105.434H43.5391V106.922H40.416V109.131H43.3223V110.613H40.416V114Z" fill="white"/>
<path d="M52.9902 109.705C52.9902 111.123 52.6387 112.213 51.9355 112.975C51.2324 113.736 50.2246 114.117 48.9121 114.117C47.5996 114.117 46.5918 113.736 45.8887 112.975C45.1855 112.213 44.834 111.119 44.834 109.693C44.834 108.268 45.1855 107.18 45.8887 106.43C46.5957 105.676 47.6074 105.299 48.9238 105.299C50.2402 105.299 51.2461 105.678 51.9414 106.436C52.6406 107.193 52.9902 108.283 52.9902 109.705ZM46.7383 109.705C46.7383 110.662 46.9199 111.383 47.2832 111.867C47.6465 112.352 48.1895 112.594 48.9121 112.594C50.3613 112.594 51.0859 111.631 51.0859 109.705C51.0859 107.775 50.3652 106.811 48.9238 106.811C48.2012 106.811 47.6562 107.055 47.2891 107.543C46.9219 108.027 46.7383 108.748 46.7383 109.705Z" fill="white"/>
<path d="M56.582 109.236H57.168C57.7422 109.236 58.166 109.141 58.4395 108.949C58.7129 108.758 58.8496 108.457 58.8496 108.047C58.8496 107.641 58.709 107.352 58.4277 107.18C58.1504 107.008 57.7188 106.922 57.1328 106.922H56.582V109.236ZM56.582 110.713V114H54.7656V105.434H57.2617C58.4258 105.434 59.2871 105.646 59.8457 106.072C60.4043 106.494 60.6836 107.137 60.6836 108C60.6836 108.504 60.5449 108.953 60.2676 109.348C59.9902 109.738 59.5977 110.045 59.0898 110.268C60.3789 112.193 61.2188 113.438 61.6094 114H59.5938L57.5488 110.713H56.582Z" fill="white"/>
<path d="M66.3145 114L64.252 107.279H64.1992C64.2734 108.646 64.3105 109.559 64.3105 110.016V114H62.6875V105.434H65.1602L67.1875 111.984H67.2227L69.373 105.434H71.8457V114H70.1523V109.945C70.1523 109.754 70.1543 109.533 70.1582 109.283C70.166 109.033 70.1934 108.369 70.2402 107.291H70.1875L67.9785 114H66.3145Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M19 85H81V41H19V85ZM17 39V87H83V39H17Z" fill="white"/>
<rect x="19" y="41" width="62" height="44" fill="#41ADA2"/>
<rect x="29" y="50" width="5" height="2" fill="white"/>
<rect x="36" y="50" width="5" height="2" fill="white"/>
<rect x="29" y="74" width="5" height="2" fill="white"/>
<rect x="36" y="74" width="5" height="2" fill="white"/>
<rect width="22" height="2" transform="matrix(-4.37114e-08 1 1 4.37114e-08 34 52)" fill="white"/>
</symbol>
</svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

View file

@ -402,7 +402,7 @@ define([
this.appOptions.compatibleFeatures = (typeof (this.appOptions.customization) == 'object') && !!this.appOptions.customization.compatibleFeatures;
this.appOptions.canFeatureComparison = !!this.api.asc_isSupportFeature("comparison");
this.appOptions.canFeatureContentControl = !!this.api.asc_isSupportFeature("content-controls");
this.appOptions.canFeatureForms = true;
this.appOptions.mentionShare = !((typeof (this.appOptions.customization) == 'object') && (this.appOptions.customization.mentionShare==false));
this.appOptions.user.guest && this.appOptions.canRenameAnonymous && Common.NotificationCenter.on('user:rename', _.bind(this.showRenameUserDialog, this));
@ -479,6 +479,9 @@ define([
$('#editor-container').find('.doc-placeholder').css('margin-top', 19);
}
var type = data.doc ? /^(?:(docxf))$/.exec(data.doc.fileType) : false;
this.appOptions.canFeatureForms = !!(type && typeof type[1] === 'string');
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_onRunAutostartMacroses', _.bind(this.onRunAutostartMacroses, this));
@ -545,7 +548,9 @@ define([
Asc.c_oAscFileType.OTT,
Asc.c_oAscFileType.FB2,
Asc.c_oAscFileType.EPUB,
Asc.c_oAscFileType.DOCM
Asc.c_oAscFileType.DOCM,
Asc.c_oAscFileType.DOCXF,
Asc.c_oAscFileType.OFORM
];
if ( !_format || _supported.indexOf(_format) < 0 )

View file

@ -159,7 +159,9 @@ define([
Asc.c_oAscFileType.OTT,
Asc.c_oAscFileType.FB2,
Asc.c_oAscFileType.EPUB,
Asc.c_oAscFileType.DOCM
Asc.c_oAscFileType.DOCM,
Asc.c_oAscFileType.DOCXF,
Asc.c_oAscFileType.OFORM
];
if ( !_format || _supported.indexOf(_format) < 0 )

View file

@ -64,6 +64,9 @@ define([
{name: 'RTF', imgCls: 'rtf', type: Asc.c_oAscFileType.RTF}
],[
{name: 'DOCM', imgCls: 'docm', type: Asc.c_oAscFileType.DOCM},
{name: 'DOCXF', imgCls: 'docxf', type: Asc.c_oAscFileType.DOCXF},
{name: 'OFORM', imgCls: 'oform', type: Asc.c_oAscFileType.OFORM}
],[
{name: 'HTML (Zipped)', imgCls: 'html', type: Asc.c_oAscFileType.HTML},
{name: 'FB2', imgCls: 'fb2', type: Asc.c_oAscFileType.FB2},
{name: 'EPUB', imgCls: 'epub', type: Asc.c_oAscFileType.EPUB}
@ -137,6 +140,9 @@ define([
{name: 'RTF', imgCls: 'rtf', type: Asc.c_oAscFileType.RTF, ext: '.rtf'}
],[
{name: 'DOCM', imgCls: 'docm', type: Asc.c_oAscFileType.DOCM, ext: '.docm'},
{name: 'DOCXF', imgCls: 'docxf', type: Asc.c_oAscFileType.DOCXF, ext: '.docxf'},
{name: 'OFORM', imgCls: 'oform', type: Asc.c_oAscFileType.OFORM, ext: '.oform'}
],[
{name: 'HTML (Zipped)', imgCls: 'html', type: Asc.c_oAscFileType.HTML, ext: '.html'},
{name: 'FB2', imgCls: 'fb2', type: Asc.c_oAscFileType.FB2, ext: '.fb2'},
{name: 'EPUB', imgCls: 'epub', type: Asc.c_oAscFileType.EPUB, ext: '.epub'}

View file

@ -316,6 +316,8 @@
<img class="inline-svg" src="../../common/main/resources/img/doc-formats/fb2.svg">
<img class="inline-svg" src="../../common/main/resources/img/doc-formats/epub.svg">
<img class="inline-svg" src="../../common/main/resources/img/doc-formats/docm.svg">
<img class="inline-svg" src="../../common/main/resources/img/doc-formats/oform.svg">
<img class="inline-svg" src="../../common/main/resources/img/doc-formats/docxf.svg">
<img class="inline-svg" src="resources/img/blank.svg">
<img class="inline-svg" src="resources/img/recent-file.svg">
<img class="inline-svg" src="resources/img/file-template.svg">

View file

@ -310,6 +310,8 @@
<inline src="resources/img/doc-formats/fb2.svg" />
<inline src="resources/img/doc-formats/epub.svg" />
<inline src="resources/img/doc-formats/docm.svg" />
<inline src="resources/img/doc-formats/oform.svg" />
<inline src="resources/img/doc-formats/docxf.svg" />
<inline src="resources/img/toolbar/shapetypes.svg" />
<inline src="resources/img/toolbar/charttypes.svg" />
<inline src="resources/img/recent-file.svg" />

View file

@ -283,6 +283,8 @@
<img class="inline-svg" src="../../common/main/resources/img/doc-formats/fb2.svg">
<img class="inline-svg" src="../../common/main/resources/img/doc-formats/epub.svg">
<img class="inline-svg" src="../../common/main/resources/img/doc-formats/docm.svg">
<img class="inline-svg" src="../../common/main/resources/img/doc-formats/oform.svg">
<img class="inline-svg" src="../../common/main/resources/img/doc-formats/docxf.svg">
<img class="inline-svg" src="resources/img/blank.svg">
<img class="inline-svg" src="resources/img/recent-file.svg">
<img class="inline-svg" src="resources/img/file-template.svg">

View file

@ -328,6 +328,8 @@
<inline src="resources/img/doc-formats/fb2.svg" />
<inline src="resources/img/doc-formats/epub.svg" />
<inline src="resources/img/doc-formats/docm.svg" />
<inline src="resources/img/doc-formats/oform.svg" />
<inline src="resources/img/doc-formats/docxf.svg" />
<inline src="resources/img/toolbar/shapetypes.svg" />
<inline src="resources/img/toolbar/charttypes.svg" />
<inline src="resources/img/recent-file.svg" />