diff --git a/apps/common/main/lib/component/ComboBox.js b/apps/common/main/lib/component/ComboBox.js index 1eb060eb2..3164abd68 100644 --- a/apps/common/main/lib/component/ComboBox.js +++ b/apps/common/main/lib/component/ComboBox.js @@ -710,8 +710,8 @@ define([ this.options.updateFormControl.call(this, this._selectedItem); }, - setValue: function(value) { - Common.UI.ComboBox.prototype.setValue.call(this, value); + setValue: function(value, defValue) { + Common.UI.ComboBox.prototype.setValue.call(this, value, defValue); if (this.options.updateFormControl) this.options.updateFormControl.call(this, this._selectedItem); }, diff --git a/apps/documenteditor/main/app/controller/DocProtection.js b/apps/documenteditor/main/app/controller/DocProtection.js index d277d95cb..ab8488fc0 100644 --- a/apps/documenteditor/main/app/controller/DocProtection.js +++ b/apps/documenteditor/main/app/controller/DocProtection.js @@ -86,6 +86,7 @@ define([ this.setApi(api); }, setApi: function (api) { + this.userCollection = this.getApplication().getCollection('Common.Collections.Users'); if (api) { this.api = api; this.api.asc_registerCallback('asc_onChangeDocumentProtection',_.bind(this.onChangeProtectDocument, this)); @@ -95,6 +96,7 @@ define([ setMode: function(mode) { this.appConfig = mode; + this.currentUserId = mode.user.id; this.appConfig.isEdit && (this.view = this.createView('DocProtection', { mode: mode @@ -183,7 +185,7 @@ define([ }); }, - onChangeProtectDocument: function() { + onChangeProtectDocument: function(userId) { var props = this.getDocProps(true), isProtected = props && (props.isReadOnly || props.isCommentsOnly || props.isFormsOnly || props.isReviewOnly); this.view && this.view.btnProtectDoc.toggle(isProtected, true); @@ -204,6 +206,27 @@ define([ if (this._docProtectDlg && this._docProtectDlg.isVisible()) this._docProtectDlg.SetDisabled(!!this._state.lockDocProtect || isProtected); Common.NotificationCenter.trigger('protect:doclock', props); + if (userId && this.userCollection) { + var recUser = this.userCollection.findOriginalUser(userId); + if (recUser && (recUser.get('idOriginal') !== this.currentUserId)) { + var str = this.view.txtWasUnprotected; + switch (this._state.docProtection.type) { + case Asc.c_oAscEDocProtect.ReadOnly: + str = this.view.txtWasProtectedView; + break; + case Asc.c_oAscEDocProtect.Comments: + str = this.view.txtWasProtectedComment; + break; + case Asc.c_oAscEDocProtect.Forms: + str = this.view.txtWasProtectedForms; + break; + case Asc.c_oAscEDocProtect.TrackedChanges: + str = this.view.txtWasProtectedTrack; + break; + } + str && Common.NotificationCenter.trigger('showmessage', {msg: str}, {timeout: 5000, hideCloseTip: true}); + } + } }, getDocProps: function(update) { diff --git a/apps/documenteditor/main/app/view/DocProtection.js b/apps/documenteditor/main/app/view/DocProtection.js index 81bf01e1f..24151040c 100644 --- a/apps/documenteditor/main/app/view/DocProtection.js +++ b/apps/documenteditor/main/app/view/DocProtection.js @@ -142,7 +142,12 @@ define([ txtDocProtectedForms: 'Document is protected.
You may only fill in forms in this document.', hintProtectDoc: 'Protect document', txtDocUnlockDescription: 'Enter a password to unprotect document', - txtUnlockTitle: 'Unprotect Document' + txtUnlockTitle: 'Unprotect Document', + txtWasProtectedView: 'Document has been protected by another user.\nYou may only view this document.', + txtWasProtectedTrack: 'Document has been protected by another user.\nYou may edit this document, but all changes will be tracked.', + txtWasProtectedComment: 'Document has been protected by another user.\nYou may only insert comments to this document.', + txtWasProtectedForms: 'Document has been protected by another user.\nYou may only fill in forms in this document.', + txtWasUnprotected: 'Document has been unprotected.' } }()), DE.Views.DocProtection || {})); }); \ No newline at end of file diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index 9411c70e9..3c8991111 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -1634,6 +1634,11 @@ "DE.Views.DocProtection.txtDocUnlockDescription": "Enter a password to unprotect document", "DE.Views.DocProtection.txtUnlockTitle": "Unprotect Document", "DE.Views.DocProtection.txtProtectDoc": "Protect Document", + "DE.Views.DocProtection.txtWasProtectedView": "Document has been protected by another user.\nYou may only view this document.", + "DE.Views.DocProtection.txtWasProtectedTrack": "Document has been protected by another user.\nYou may edit this document, but all changes will be tracked.", + "DE.Views.DocProtection.txtWasProtectedComment": "Document has been protected by another user.\nYou may only insert comments to this document.", + "DE.Views.DocProtection.txtWasProtectedForms": "Document has been protected by another user.\nYou may only fill in forms in this document.", + "DE.Views.DocProtection.txtWasUnprotected": "Document has been unprotected.", "DE.Views.DocumentHolder.aboveText": "Above", "DE.Views.DocumentHolder.addCommentText": "Add comment", "DE.Views.DocumentHolder.advancedDropCapText": "Drop Cap Settings", diff --git a/apps/presentationeditor/main/app/view/Animation.js b/apps/presentationeditor/main/app/view/Animation.js index 4358439fb..6d1f4d87d 100644 --- a/apps/presentationeditor/main/app/view/Animation.js +++ b/apps/presentationeditor/main/app/view/Animation.js @@ -187,6 +187,7 @@ define([ this.toolbar = options.toolbar; this.appConfig = options.mode; this.$el = this.toolbar.toolbar.$el.find('#animation-panel'); + var me = this; var _set = Common.enumLock; this.lockedControls = []; this._arrEffectName = [{group:'none', value: AscFormat.ANIM_PRESET_NONE, iconCls: 'animation-none', displayValue: this.textNone}].concat(Common.define.effectData.getEffectData()); @@ -293,7 +294,7 @@ define([ this.lockedControls.push(this.btnAddAnimation); - this.cmbDuration = new Common.UI.ComboBox({ + this.cmbDuration = new Common.UI.ComboBoxCustom({ el: this.$el.find('#animation-spin-duration'), cls: 'input-group-nr', menuStyle: 'min-width: 100%;', @@ -309,7 +310,10 @@ define([ lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation, _set.noAnimationDuration, _set.timingLock], dataHint: '1', dataHintDirection: 'top', - dataHintOffset: 'small' + dataHintOffset: 'small', + updateFormControl: function(record) { + record && this.setRawValue(record.get('value') + ' ' + me.txtSec); + } }); this.lockedControls.push(this.cmbDuration);