Merge branch hotfix/v7.0.1 into master

This commit is contained in:
papacarlo 2022-02-22 08:17:30 +00:00
commit 39060b92f5
21 changed files with 177 additions and 53 deletions

View file

@ -471,7 +471,9 @@ Common.UI.HintManager = new(function() {
match = false; match = false;
var keyCode = e.keyCode; var keyCode = e.keyCode;
if (keyCode !== 16 && keyCode !== 17 && keyCode !== 18 && keyCode !== 91) { if (keyCode !== 16 && keyCode !== 17 && keyCode !== 18 && keyCode !== 91) {
curLetter = _lang === 'en' ? ((keyCode > 47 && keyCode < 58 || keyCode > 64 && keyCode < 91) ? String.fromCharCode(e.keyCode) : null) : e.key; curLetter = _lang === 'en' ?
((keyCode > 47 && keyCode < 58 || keyCode > 64 && keyCode < 91) ? String.fromCharCode(e.keyCode) : null) :
(/[.*+?^${}()|[\]\\]/g.test(e.key) ? null : e.key);
} }
if (curLetter) { if (curLetter) {
var curr; var curr;

View file

@ -235,10 +235,10 @@ define([
this.lblCompanyLic.parents('tr').addClass('hidden'); this.lblCompanyLic.parents('tr').addClass('hidden');
value = Common.UI.Themes.isDarkTheme() ? (customer.logoDark || customer.logo) : (customer.logo || customer.logoDark); value = Common.UI.Themes.isDarkTheme() ? (customer.logoDark || customer.logo) : (customer.logo || customer.logoDark);
value.length ? value && value.length ?
this.divCompanyLogo.html('<img src="'+value+'" style="max-width:216px; max-height: 35px;" />') : this.divCompanyLogo.html('<img src="'+value+'" style="max-width:216px; max-height: 35px;" />') :
this.divCompanyLogo.parents('tr').addClass('hidden'); this.divCompanyLogo.parents('tr').addClass('hidden');
value.length && Common.NotificationCenter.on('uitheme:changed', this.changeLogo.bind(this)); value && value.length && Common.NotificationCenter.on('uitheme:changed', this.changeLogo.bind(this));
} else { } else {
this.cntLicenseeInfo.addClass('hidden'); this.cntLicenseeInfo.addClass('hidden');
this.cntLicensorInfo.addClass('margin-bottom'); this.cntLicensorInfo.addClass('margin-bottom');

View file

@ -79,7 +79,7 @@ li {
&.lv, &.lv-LV {background-position: -32px -72px;} &.lv, &.lv-LV {background-position: -32px -72px;}
&.lt, &.lt-LT {background-position: 0 -84px;} &.lt, &.lt-LT {background-position: 0 -84px;}
&.vi, &.vi-VN {background-position: -16px -84px;} &.vi, &.vi-VN {background-position: -16px -84px;}
&.de-CH {background-position: -32px -84px;} &.de-CH, &.fr-CH {background-position: -32px -84px;}
&.pt-PT {background-position: -16px -96px;} &.pt-PT {background-position: -16px -96px;}
&.de-AT {background-position: -32px -96px;} &.de-AT {background-position: -32px -96px;}
&.es, &.es-ES {background-position: 0 -108px;} &.es, &.es-ES {background-position: 0 -108px;}

View file

@ -121,7 +121,7 @@ const PluginsController = inject('storeAppOptions')(observer(props => {
}; };
const pluginClose = plugin => { const pluginClose = plugin => {
if (plugin) { if (plugin && modal) {
modal.close(); modal.close();
} }
}; };

View file

@ -103,6 +103,8 @@ define([
this.api.asc_registerCallback('asc_onCountPages', this.onCountPages.bind(this)); this.api.asc_registerCallback('asc_onCountPages', this.onCountPages.bind(this));
this.api.asc_registerCallback('asc_onCurrentPage', this.onCurrentPage.bind(this)); this.api.asc_registerCallback('asc_onCurrentPage', this.onCurrentPage.bind(this));
this.api.asc_registerCallback('asc_onDocumentModifiedChanged', _.bind(this.onDocumentModifiedChanged, this)); this.api.asc_registerCallback('asc_onDocumentModifiedChanged', _.bind(this.onDocumentModifiedChanged, this));
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onApiServerDisconnect, this));
Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiServerDisconnect, this));
// Initialize api gateway // Initialize api gateway
Common.Gateway.on('init', this.loadConfig.bind(this)); Common.Gateway.on('init', this.loadConfig.bind(this));
@ -505,6 +507,7 @@ define([
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_onRunAutostartMacroses', _.bind(this.onRunAutostartMacroses, this)); this.api.asc_registerCallback('asc_onRunAutostartMacroses', _.bind(this.onRunAutostartMacroses, this));
this.api.asc_registerCallback('asc_onLicenseChanged', _.bind(this.onLicenseChanged, this));
this.api.asc_setDocInfo(docInfo); this.api.asc_setDocInfo(docInfo);
this.api.asc_getEditorPermissions(this.editorConfig.licenseUrl, this.editorConfig.customerId); this.api.asc_getEditorPermissions(this.editorConfig.licenseUrl, this.editorConfig.customerId);
this.api.asc_enableKeyEvents(true); this.api.asc_enableKeyEvents(true);
@ -642,6 +645,17 @@ define([
}); });
}, },
onLicenseChanged: function(params) {
var licType = params.asc_getLicenseType();
if (licType !== undefined && this.appOptions.canFillForms &&
(licType===Asc.c_oLicenseResult.Connections || licType===Asc.c_oLicenseResult.UsersCount || licType===Asc.c_oLicenseResult.ConnectionsOS || licType===Asc.c_oLicenseResult.UsersCountOS
|| licType===Asc.c_oLicenseResult.SuccessLimit && (this.appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0))
this._state.licenseType = licType;
if (this._isDocReady)
this.applyLicense();
},
applyLicense: function() { applyLicense: function() {
if (this._state.licenseType) { if (this._state.licenseType) {
var license = this._state.licenseType, var license = this._state.licenseType,
@ -658,6 +672,10 @@ define([
primary = 'buynow'; primary = 'buynow';
} }
if (this._state.licenseType!==Asc.c_oLicenseResult.SuccessLimit && this.appOptions.canFillForms) {
Common.NotificationCenter.trigger('api:disconnect');
}
var value = Common.localStorage.getItem("de-license-warning"); var value = Common.localStorage.getItem("de-license-warning");
value = (value!==null) ? parseInt(value) : 0; value = (value!==null) ? parseInt(value) : 0;
var now = (new Date).getTime(); var now = (new Date).getTime();
@ -986,6 +1004,8 @@ define([
}, },
onShowContentControlsActions: function(obj, x, y) { onShowContentControlsActions: function(obj, x, y) {
if (this._isDisabled) return;
var me = this; var me = this;
switch (obj.type) { switch (obj.type) {
case Asc.c_oAscContentControlSpecificType.DateTime: case Asc.c_oAscContentControlSpecificType.DateTime:
@ -1718,12 +1738,12 @@ define([
if (this.textMenu && !noobject) { if (this.textMenu && !noobject) {
var cancopy = this.api.can_CopyCut(), var cancopy = this.api.can_CopyCut(),
disabled = menu_props.paraProps && menu_props.paraProps.locked || menu_props.headerProps && menu_props.headerProps.locked || disabled = menu_props.paraProps && menu_props.paraProps.locked || menu_props.headerProps && menu_props.headerProps.locked ||
menu_props.imgProps && (menu_props.imgProps.locked || menu_props.imgProps.content_locked); menu_props.imgProps && (menu_props.imgProps.locked || menu_props.imgProps.content_locked) || this._isDisabled;
this.textMenu.items[0].setDisabled(disabled || !this.api.asc_getCanUndo()); // undo this.textMenu.items[0].setDisabled(disabled || !this.api.asc_getCanUndo()); // undo
this.textMenu.items[1].setDisabled(disabled || !this.api.asc_getCanRedo()); // redo this.textMenu.items[1].setDisabled(disabled || !this.api.asc_getCanRedo()); // redo
this.textMenu.items[3].setDisabled(!cancopy); // copy this.textMenu.items[3].setDisabled(disabled || !cancopy); // cut
this.textMenu.items[4].setDisabled(disabled || !cancopy); // cut this.textMenu.items[4].setDisabled(!cancopy); // copy
this.textMenu.items[5].setDisabled(disabled) // paste; this.textMenu.items[5].setDisabled(disabled) // paste;
this.showPopupMenu(this.textMenu, {}, event); this.showPopupMenu(this.textMenu, {}, event);
@ -1757,6 +1777,23 @@ define([
} }
}, },
onApiServerDisconnect: function(enableDownload) {
this._state.isDisconnected = true;
this._isDisabled = true;
this.view && this.view.btnClear && this.view.btnClear.setDisabled(true);
if (!enableDownload) {
this.appOptions.canPrint = this.appOptions.canDownload = false;
this.view && this.view.btnDownload.setDisabled(true);
this.view && this.view.btnSubmit.setDisabled(true);
if (this.view && this.view.btnOptions && this.view.btnOptions.menu) {
this.view.btnOptions.menu.items[0].setDisabled(true); // print
this.view.btnOptions.menu.items[2].setDisabled(true); // download
this.view.btnOptions.menu.items[3].setDisabled(true); // download docx
this.view.btnOptions.menu.items[4].setDisabled(true); // download pdf
}
}
},
errorDefaultMessage : 'Error code: %1', errorDefaultMessage : 'Error code: %1',
unknownErrorText : 'Unknown error.', unknownErrorText : 'Unknown error.',
convertationTimeoutText : 'Conversion timeout exceeded.', convertationTimeoutText : 'Conversion timeout exceeded.',

View file

@ -1274,7 +1274,7 @@ define([
onLicenseChanged: function(params) { onLicenseChanged: function(params) {
var licType = params.asc_getLicenseType(); var licType = params.asc_getLicenseType();
if (licType !== undefined && this.appOptions.canEdit && this.editorConfig.mode !== 'view' && if (licType !== undefined && (this.appOptions.canEdit || this.appOptions.isRestrictedEdit) && this.editorConfig.mode !== 'view' &&
(licType===Asc.c_oLicenseResult.Connections || licType===Asc.c_oLicenseResult.UsersCount || licType===Asc.c_oLicenseResult.ConnectionsOS || licType===Asc.c_oLicenseResult.UsersCountOS (licType===Asc.c_oLicenseResult.Connections || licType===Asc.c_oLicenseResult.UsersCount || licType===Asc.c_oLicenseResult.ConnectionsOS || licType===Asc.c_oLicenseResult.UsersCountOS
|| licType===Asc.c_oLicenseResult.SuccessLimit && (this.appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0)) || licType===Asc.c_oLicenseResult.SuccessLimit && (this.appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0))
this._state.licenseType = licType; this._state.licenseType = licType;
@ -1300,7 +1300,7 @@ define([
primary = 'buynow'; primary = 'buynow';
} }
if (this._state.licenseType!==Asc.c_oLicenseResult.SuccessLimit && this.appOptions.isEdit) { if (this._state.licenseType!==Asc.c_oLicenseResult.SuccessLimit && (this.appOptions.isEdit || this.appOptions.isRestrictedEdit)) {
this.disableEditing(true); this.disableEditing(true);
Common.NotificationCenter.trigger('api:disconnect'); Common.NotificationCenter.trigger('api:disconnect');
} }

View file

@ -131,6 +131,10 @@ define([
this.rightmenu.fireEvent('editcomplete', this.rightmenu); this.rightmenu.fireEvent('editcomplete', this.rightmenu);
}, },
onApiFocusObject: function(SelectedObjects) {
this.onFocusObject(SelectedObjects);
},
onFocusObject: function(SelectedObjects, forceSignature) { onFocusObject: function(SelectedObjects, forceSignature) {
if (!this.editMode && !forceSignature) if (!this.editMode && !forceSignature)
return; return;
@ -339,7 +343,7 @@ define([
createDelayedElements: function() { createDelayedElements: function() {
var me = this; var me = this;
if (this.api) { if (this.api) {
this.api.asc_registerCallback('asc_onFocusObject', _.bind(this.onFocusObject, this)); this.api.asc_registerCallback('asc_onFocusObject', _.bind(this.onApiFocusObject, this));
this.api.asc_registerCallback('asc_doubleClickOnObject', _.bind(this.onDoubleClickOnObject, this)); this.api.asc_registerCallback('asc_doubleClickOnObject', _.bind(this.onDoubleClickOnObject, this));
if (this.rightmenu.mergeSettings) { if (this.rightmenu.mergeSettings) {
this.rightmenu.mergeSettings.setDocumentName(this.getApplication().getController('Viewport').getView('Common.Views.Header').getDocumentCaption()); this.rightmenu.mergeSettings.setDocumentName(this.getApplication().getController('Viewport').getView('Common.Views.Header').getDocumentCaption());

View file

@ -405,7 +405,7 @@ class MainController extends Component {
onLicenseChanged (params) { onLicenseChanged (params) {
const appOptions = this.props.storeAppOptions; const appOptions = this.props.storeAppOptions;
const licType = params.asc_getLicenseType(); const licType = params.asc_getLicenseType();
if (licType !== undefined && appOptions.canEdit && appOptions.config.mode !== 'view' && if (licType !== undefined && (appOptions.canEdit || appOptions.isRestrictedEdit) && appOptions.config.mode !== 'view' &&
(licType === Asc.c_oLicenseResult.Connections || licType === Asc.c_oLicenseResult.UsersCount || licType === Asc.c_oLicenseResult.ConnectionsOS || licType === Asc.c_oLicenseResult.UsersCountOS (licType === Asc.c_oLicenseResult.Connections || licType === Asc.c_oLicenseResult.UsersCount || licType === Asc.c_oLicenseResult.ConnectionsOS || licType === Asc.c_oLicenseResult.UsersCountOS
|| licType === Asc.c_oLicenseResult.SuccessLimit && (appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0)) || licType === Asc.c_oLicenseResult.SuccessLimit && (appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0))
this._state.licenseType = licType; this._state.licenseType = licType;

View file

@ -916,7 +916,7 @@ define([
onLicenseChanged: function(params) { onLicenseChanged: function(params) {
var licType = params.asc_getLicenseType(); var licType = params.asc_getLicenseType();
if (licType !== undefined && this.appOptions.canEdit && this.editorConfig.mode !== 'view' && if (licType !== undefined && (this.appOptions.canEdit || this.appOptions.isRestrictedEdit) && this.editorConfig.mode !== 'view' &&
(licType===Asc.c_oLicenseResult.Connections || licType===Asc.c_oLicenseResult.UsersCount || licType===Asc.c_oLicenseResult.ConnectionsOS || licType===Asc.c_oLicenseResult.UsersCountOS (licType===Asc.c_oLicenseResult.Connections || licType===Asc.c_oLicenseResult.UsersCount || licType===Asc.c_oLicenseResult.ConnectionsOS || licType===Asc.c_oLicenseResult.UsersCountOS
|| licType===Asc.c_oLicenseResult.SuccessLimit && (this.appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0)) || licType===Asc.c_oLicenseResult.SuccessLimit && (this.appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0))
this._state.licenseType = licType; this._state.licenseType = licType;
@ -942,7 +942,7 @@ define([
primary = 'buynow'; primary = 'buynow';
} }
if (this._state.licenseType!==Asc.c_oLicenseResult.SuccessLimit && this.appOptions.isEdit) { if (this._state.licenseType!==Asc.c_oLicenseResult.SuccessLimit && (this.appOptions.isEdit || this.appOptions.isRestrictedEdit)) {
this.disableEditing(true); this.disableEditing(true);
Common.NotificationCenter.trigger('api:disconnect'); Common.NotificationCenter.trigger('api:disconnect');
} }

View file

@ -484,7 +484,7 @@ class MainController extends Component {
onLicenseChanged (params) { onLicenseChanged (params) {
const appOptions = this.props.storeAppOptions; const appOptions = this.props.storeAppOptions;
const licType = params.asc_getLicenseType(); const licType = params.asc_getLicenseType();
if (licType !== undefined && appOptions.canEdit && appOptions.config.mode !== 'view' && if (licType !== undefined && (appOptions.canEdit || appOptions.isRestrictedEdit) && appOptions.config.mode !== 'view' &&
(licType === Asc.c_oLicenseResult.Connections || licType === Asc.c_oLicenseResult.UsersCount || licType === Asc.c_oLicenseResult.ConnectionsOS || licType === Asc.c_oLicenseResult.UsersCountOS (licType === Asc.c_oLicenseResult.Connections || licType === Asc.c_oLicenseResult.UsersCount || licType === Asc.c_oLicenseResult.ConnectionsOS || licType === Asc.c_oLicenseResult.UsersCountOS
|| licType === Asc.c_oLicenseResult.SuccessLimit && (appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0)) || licType === Asc.c_oLicenseResult.SuccessLimit && (appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0))
this._state.licenseType = licType; this._state.licenseType = licType;

View file

@ -112,11 +112,36 @@ const SettingsList = inject("storeAppOptions", "storeToolbarSettings")(observer(
}; };
const appOptions = props.storeAppOptions; const appOptions = props.storeAppOptions;
let _isEdit = false; let _isEdit = false,
_canDownload = false,
_canDownloadOrigin = false,
_canAbout = true,
_canHelp = true,
_canPrint = false;
if (!appOptions.isDisconnected) { if (appOptions.isDisconnected) {
_isEdit = false;
if (!appOptions.enableDownload)
_canPrint = _canDownload = _canDownloadOrigin = false;
} else {
_isEdit = appOptions.isEdit; _isEdit = appOptions.isEdit;
_canDownload = appOptions.canDownload;
_canDownloadOrigin = appOptions.canDownloadOrigin;
_canPrint = appOptions.canPrint;
if (appOptions.customization && appOptions.canBrandingExt) {
_canAbout = (appOptions.customization.about!==false);
} }
if (appOptions.customization) {
_canHelp = (appOptions.customization.help!==false);
}
}
const onDownloadOrigin = () => {
closeModal();
setTimeout(() => {
Common.EditorApi.get().asc_DownloadOrigin();
}, 0);
};
return ( return (
<View style={props.style} stackPages={true} routes={routes}> <View style={props.style} stackPages={true} routes={routes}>
@ -141,12 +166,21 @@ const SettingsList = inject("storeAppOptions", "storeToolbarSettings")(observer(
<ListItem title={_t.textApplicationSettings} link="#" onClick={onoptionclick.bind(this, '/application-settings/')}> <ListItem title={_t.textApplicationSettings} link="#" onClick={onoptionclick.bind(this, '/application-settings/')}>
<Icon slot="media" icon="icon-app-settings"></Icon> <Icon slot="media" icon="icon-app-settings"></Icon>
</ListItem> </ListItem>
{_canDownload &&
<ListItem title={_t.textDownload} link="#" onClick={onoptionclick.bind(this, '/download/')}> <ListItem title={_t.textDownload} link="#" onClick={onoptionclick.bind(this, '/download/')}>
<Icon slot="media" icon="icon-download"></Icon> <Icon slot="media" icon="icon-download"></Icon>
</ListItem> </ListItem>
}
{_canDownloadOrigin &&
<ListItem title={_t.textDownload} link="#" onClick={onDownloadOrigin} className='no-indicator'>
<Icon slot="media" icon="icon-download"></Icon>
</ListItem>
}
{_canPrint &&
<ListItem className={disabledPreview && 'disabled'} title={_t.textPrint} onClick={onPrint}> <ListItem className={disabledPreview && 'disabled'} title={_t.textPrint} onClick={onPrint}>
<Icon slot="media" icon="icon-print"></Icon> <Icon slot="media" icon="icon-print"></Icon>
</ListItem> </ListItem>
}
<ListItem title={_t.textPresentationInfo} link="#" onClick={onoptionclick.bind(this, "/presentation-info/")}> <ListItem title={_t.textPresentationInfo} link="#" onClick={onoptionclick.bind(this, "/presentation-info/")}>
<Icon slot="media" icon="icon-info"></Icon> <Icon slot="media" icon="icon-info"></Icon>
</ListItem> </ListItem>

View file

@ -1017,7 +1017,7 @@ define([
if (this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge) return; if (this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge) return;
var licType = params.asc_getLicenseType(); var licType = params.asc_getLicenseType();
if (licType !== undefined && this.appOptions.canEdit && this.editorConfig.mode !== 'view' && if (licType !== undefined && (this.appOptions.canEdit || this.appOptions.isRestrictedEdit) && this.editorConfig.mode !== 'view' &&
(licType===Asc.c_oLicenseResult.Connections || licType===Asc.c_oLicenseResult.UsersCount || licType===Asc.c_oLicenseResult.ConnectionsOS || licType===Asc.c_oLicenseResult.UsersCountOS (licType===Asc.c_oLicenseResult.Connections || licType===Asc.c_oLicenseResult.UsersCount || licType===Asc.c_oLicenseResult.ConnectionsOS || licType===Asc.c_oLicenseResult.UsersCountOS
|| licType===Asc.c_oLicenseResult.SuccessLimit && (this.appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0)) || licType===Asc.c_oLicenseResult.SuccessLimit && (this.appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0))
this._state.licenseType = licType; this._state.licenseType = licType;
@ -1043,7 +1043,7 @@ define([
primary = 'buynow'; primary = 'buynow';
} }
if (this._state.licenseType!==Asc.c_oLicenseResult.SuccessLimit && this.appOptions.isEdit) { if (this._state.licenseType!==Asc.c_oLicenseResult.SuccessLimit && (this.appOptions.isEdit || this.appOptions.isRestrictedEdit)) {
this.disableEditing(true); this.disableEditing(true);
Common.NotificationCenter.trigger('api:disconnect'); Common.NotificationCenter.trigger('api:disconnect');
} }

View file

@ -962,7 +962,7 @@ define([
_.extend(_options, { _.extend(_options, {
width : width || 450, width : width || 450,
height : height || 265, height : height || 277,
contentWidth : (width - 50) || 400, contentWidth : (width - 50) || 400,
header : false, header : false,
cls : 'filter-dlg', cls : 'filter-dlg',
@ -973,7 +973,7 @@ define([
items : [], items : [],
resizable : true, resizable : true,
minwidth : 450, minwidth : 450,
minheight : 265 minheight : 277
}, options); }, options);
this.template = options.template || [ this.template = options.template || [

View file

@ -985,7 +985,7 @@ define([
}); });
var regdata = [{ value: 0x042C }, { value: 0x0402 }, { value: 0x0405 }, { value: 0x0C07 }, { value: 0x0407 }, {value: 0x0807}, { value: 0x0408 }, { value: 0x0C09 }, { value: 0x0809 }, { value: 0x0409 }, { value: 0x0C0A }, { value: 0x080A }, var regdata = [{ value: 0x042C }, { value: 0x0402 }, { value: 0x0405 }, { value: 0x0C07 }, { value: 0x0407 }, {value: 0x0807}, { value: 0x0408 }, { value: 0x0C09 }, { value: 0x0809 }, { value: 0x0409 }, { value: 0x0C0A }, { value: 0x080A },
{ value: 0x040B }, { value: 0x040C }, { value: 0x0410 }, { value: 0x0411 }, { value: 0x0412 }, { value: 0x0426 }, { value: 0x040E }, { value: 0x0413 }, { value: 0x0415 }, { value: 0x0416 }, { value: 0x040B }, { value: 0x040C }, { value: 0x100C }, { value: 0x0410 }, { value: 0x0411 }, { value: 0x0412 }, { value: 0x0426 }, { value: 0x040E }, { value: 0x0413 }, { value: 0x0415 }, { value: 0x0416 },
{ value: 0x0816 }, { value: 0x0419 }, { value: 0x041B }, { value: 0x0424 }, { value: 0x081D }, { value: 0x041D }, { value: 0x041F }, { value: 0x0422 }, { value: 0x042A }, { value: 0x0804 }]; { value: 0x0816 }, { value: 0x0419 }, { value: 0x041B }, { value: 0x0424 }, { value: 0x081D }, { value: 0x041D }, { value: 0x041F }, { value: 0x0422 }, { value: 0x042A }, { value: 0x0804 }];
regdata.forEach(function(item) { regdata.forEach(function(item) {
var langinfo = Common.util.LanguageInfo.getLocalLanguageName(item.value); var langinfo = Common.util.LanguageInfo.getLocalLanguageName(item.value);

View file

@ -565,7 +565,7 @@ class MainController extends Component {
if (appOptions.isEditDiagram || appOptions.isEditMailMerge) return; if (appOptions.isEditDiagram || appOptions.isEditMailMerge) return;
const licType = params.asc_getLicenseType(); const licType = params.asc_getLicenseType();
if (licType !== undefined && appOptions.canEdit && appOptions.config.mode !== 'view' && if (licType !== undefined && (appOptions.canEdit || appOptions.isRestrictedEdit) && appOptions.config.mode !== 'view' &&
(licType === Asc.c_oLicenseResult.Connections || licType === Asc.c_oLicenseResult.UsersCount || licType === Asc.c_oLicenseResult.ConnectionsOS || licType === Asc.c_oLicenseResult.UsersCountOS (licType === Asc.c_oLicenseResult.Connections || licType === Asc.c_oLicenseResult.UsersCount || licType === Asc.c_oLicenseResult.ConnectionsOS || licType === Asc.c_oLicenseResult.UsersCountOS
|| licType === Asc.c_oLicenseResult.SuccessLimit && (appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0)) || licType === Asc.c_oLicenseResult.SuccessLimit && (appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0))
this._state.licenseType = licType; this._state.licenseType = licType;

View file

@ -100,8 +100,10 @@ export class storeAppOptions {
this.canPrint = (permissions.print !== false); this.canPrint = (permissions.print !== false);
this.isRestrictedEdit = !this.isEdit && this.canComments; this.isRestrictedEdit = !this.isEdit && this.canComments;
this.trialMode = params.asc_getLicenseMode(); this.trialMode = params.asc_getLicenseMode();
this.canDownloadOrigin = permissions.download !== false;
this.canDownload = permissions.download !== false; const type = /^(?:(pdf|djvu|xps|oxps))$/.exec(document.fileType);
this.canDownloadOrigin = permissions.download !== false && (type && typeof type[1] === 'string');
this.canDownload = permissions.download !== false && (!type || typeof type[1] !== 'string');
this.canUseReviewPermissions = this.canLicense && (!!permissions.reviewGroups || this.customization this.canUseReviewPermissions = this.canLicense && (!!permissions.reviewGroups || this.customization
&& this.customization.reviewPermissions && (typeof (this.customization.reviewPermissions) == 'object')); && this.customization.reviewPermissions && (typeof (this.customization.reviewPermissions) == 'object'));
this.canUseCommentPermissions = this.canLicense && !!permissions.commentGroups; this.canUseCommentPermissions = this.canLicense && !!permissions.commentGroups;

View file

@ -53,7 +53,7 @@ export class storeApplicationSettings {
getRegDataCodes() { getRegDataCodes() {
const regDataCode = [ const regDataCode = [
{ value: 0x042C }, { value: 0x0402 }, { value: 0x0405 }, { value: 0x0407 }, {value: 0x0807}, { value: 0x0408 }, { value: 0x0C09 }, { value: 0x0809 }, { value: 0x0409 }, { value: 0x0C0A }, { value: 0x080A }, { value: 0x042C }, { value: 0x0402 }, { value: 0x0405 }, { value: 0x0407 }, {value: 0x0807}, { value: 0x0408 }, { value: 0x0C09 }, { value: 0x0809 }, { value: 0x0409 }, { value: 0x0C0A }, { value: 0x080A },
{ value: 0x040B }, { value: 0x040C }, { value: 0x0410 }, { value: 0x0411 }, { value: 0x0412 }, { value: 0x0426 }, { value: 0x0413 }, { value: 0x0415 }, { value: 0x0416 }, { value: 0x040B }, { value: 0x040C }, { value: 0x100C }, { value: 0x0410 }, { value: 0x0411 }, { value: 0x0412 }, { value: 0x0426 }, { value: 0x0413 }, { value: 0x0415 }, { value: 0x0416 },
{ value: 0x0816 }, { value: 0x0419 }, { value: 0x041B }, { value: 0x0424 }, { value: 0x081D }, { value: 0x041D }, { value: 0x041F }, { value: 0x0422 }, { value: 0x042A }, { value: 0x0804 } { value: 0x0816 }, { value: 0x0419 }, { value: 0x041B }, { value: 0x0424 }, { value: 0x081D }, { value: 0x041D }, { value: 0x041F }, { value: 0x0422 }, { value: 0x042A }, { value: 0x0804 }
]; ];

View file

@ -117,11 +117,36 @@ const SettingsList = inject("storeAppOptions")(observer(props => {
}; };
const appOptions = props.storeAppOptions; const appOptions = props.storeAppOptions;
let _isEdit = false; let _isEdit = false,
_canDownload = false,
_canDownloadOrigin = false,
_canAbout = true,
_canHelp = true,
_canPrint = false;
if (!appOptions.isDisconnected) { if (appOptions.isDisconnected) {
_isEdit = false;
if (!appOptions.enableDownload)
_canPrint = _canDownload = _canDownloadOrigin = false;
} else {
_isEdit = appOptions.isEdit; _isEdit = appOptions.isEdit;
_canDownload = appOptions.canDownload;
_canDownloadOrigin = appOptions.canDownloadOrigin;
_canPrint = appOptions.canPrint;
if (appOptions.customization && appOptions.canBrandingExt) {
_canAbout = (appOptions.customization.about!==false);
} }
if (appOptions.customization) {
_canHelp = (appOptions.customization.help!==false);
}
}
const onDownloadOrigin = () => {
closeModal();
setTimeout(() => {
Common.EditorApi.get().asc_DownloadOrigin();
}, 0);
};
return ( return (
<View style={props.style} stackPages={true} routes={routes}> <View style={props.style} stackPages={true} routes={routes}>
@ -146,12 +171,21 @@ const SettingsList = inject("storeAppOptions")(observer(props => {
<ListItem title={_t.textApplicationSettings} link="#" onClick={onoptionclick.bind(this, '/application-settings/')}> <ListItem title={_t.textApplicationSettings} link="#" onClick={onoptionclick.bind(this, '/application-settings/')}>
<Icon slot="media" icon="icon-app-settings"></Icon> <Icon slot="media" icon="icon-app-settings"></Icon>
</ListItem> </ListItem>
{_canDownload &&
<ListItem title={_t.textDownload} link="#" onClick={onoptionclick.bind(this, '/download/')}> <ListItem title={_t.textDownload} link="#" onClick={onoptionclick.bind(this, '/download/')}>
<Icon slot="media" icon="icon-download"></Icon> <Icon slot="media" icon="icon-download"></Icon>
</ListItem> </ListItem>
}
{_canDownloadOrigin &&
<ListItem title={_t.textDownload} link="#" onClick={onDownloadOrigin} className='no-indicator'>
<Icon slot="media" icon="icon-download"></Icon>
</ListItem>
}
{_canPrint &&
<ListItem title={_t.textPrint} onClick={onPrint}> <ListItem title={_t.textPrint} onClick={onPrint}>
<Icon slot="media" icon="icon-print"></Icon> <Icon slot="media" icon="icon-print"></Icon>
</ListItem> </ListItem>
}
<ListItem title={_t.textSpreadsheetInfo} link="#" onClick={onoptionclick.bind(this, "/spreadsheet-info/")}> <ListItem title={_t.textSpreadsheetInfo} link="#" onClick={onoptionclick.bind(this, "/spreadsheet-info/")}>
<Icon slot="media" icon="icon-info"></Icon> <Icon slot="media" icon="icon-info"></Icon>
</ListItem> </ListItem>

View file

@ -33,7 +33,7 @@ module.exports = function(grunt) {
return !!string && !!iconv_lite ? iconv_lite.encode(string,encoding) : string; return !!string && !!iconv_lite ? iconv_lite.encode(string,encoding) : string;
}; };
var jsreplacements = [ global.jsreplacements = [
{ {
from: /\{\{SUPPORT_EMAIL\}\}/g, from: /\{\{SUPPORT_EMAIL\}\}/g,
to: _encode(process.env.SUPPORT_EMAIL) || 'support@onlyoffice.com' to: _encode(process.env.SUPPORT_EMAIL) || 'support@onlyoffice.com'
@ -355,12 +355,12 @@ module.exports = function(grunt) {
replacements: [{ replacements: [{
from: /\{\{PRODUCT_VERSION\}\}/g, from: /\{\{PRODUCT_VERSION\}\}/g,
to: packageFile.version to: packageFile.version
}] }, ...global.jsreplacements]
}, },
prepareHelp: { prepareHelp: {
src: ['<%= pkg.main.copy.help[0].dest %>/ru/**/*.htm*'], src: ['<%= pkg.main.copy.help[0].dest %>/ru/**/*.htm*'],
overwrite: true, overwrite: true,
replacements: [] replacements: [...helpreplacements]
} }
}, },
@ -427,10 +427,10 @@ module.exports = function(grunt) {
} }
}); });
var replace = grunt.config.get('replace'); // var replace = grunt.config.get('replace');
replace.writeVersion.replacements.push(...jsreplacements); // replace.writeVersion.replacements.push(...global.jsreplacements);
replace.prepareHelp.replacements.push(...helpreplacements); // replace.prepareHelp.replacements.push(...helpreplacements);
grunt.config.set('replace', replace); // grunt.config.set('replace', replace);
}); });
grunt.registerTask('deploy-reporter', function(){ grunt.registerTask('deploy-reporter', function(){

View file

@ -65,6 +65,17 @@ module.exports = (grunt) => {
} }
}, },
replace: {
varsEnviroment: {
src: ['<%= pkg.forms.js.requirejs.options.out %>'],
overwrite: true,
replacements: [{
from: /\{\{PRODUCT_VERSION\}\}/g,
to: packageFile.version
}, ...global.jsreplacements]
},
},
inline: { inline: {
dist: { dist: {
src: packageFile.forms.inline.src src: packageFile.forms.inline.src
@ -76,5 +87,5 @@ module.exports = (grunt) => {
grunt.registerTask('deploy-app-forms', ['forms-app-init', 'clean:prebuild', /*'imagemin',*/ 'less', grunt.registerTask('deploy-app-forms', ['forms-app-init', 'clean:prebuild', /*'imagemin',*/ 'less',
'requirejs', 'concat', 'copy', 'inline', /*'json-minify',*/ 'requirejs', 'concat', 'copy', 'inline', /*'json-minify',*/
/*'replace:writeVersion',*/ /*'replace:prepareHelp',*/ 'clean:postbuild']); 'replace:varsEnviroment', /*'replace:prepareHelp',*/ 'clean:postbuild']);
} }