diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js
index 4f17b2977..00c4688e4 100644
--- a/apps/api/documents/api.js
+++ b/apps/api/documents/api.js
@@ -199,6 +199,7 @@
_config.editorConfig.canRename = _config.events && !!_config.events.onRequestRename;
_config.editorConfig.canMakeActionLink = _config.events && !!_config.events.onMakeActionLink;
_config.editorConfig.canRequestUsers = _config.events && !!_config.events.onRequestUsers;
+ _config.editorConfig.canRequestSendNotify = _config.events && !!_config.events.onRequestSendNotify;
_config.editorConfig.mergeFolderUrl = _config.editorConfig.mergeFolderUrl || _config.editorConfig.saveAsUrl;
_config.frameEditorId = placeholderId;
diff --git a/apps/common/main/lib/controller/Comments.js b/apps/common/main/lib/controller/Comments.js
index 67cf2f8f8..ec150afc0 100644
--- a/apps/common/main/lib/controller/Comments.js
+++ b/apps/common/main/lib/controller/Comments.js
@@ -494,6 +494,7 @@ define([
ascComment.asc_addReply(addReply);
me.api.asc_changeComment(id, ascComment);
+ me.mode && me.mode.canRequestUsers && me.view.pickEMail(id, replyVal);
return true;
}
@@ -1125,7 +1126,8 @@ define([
this.popover = Common.Views.ReviewPopover.prototype.getPopover({
commentsStore : this.popoverComments,
renderTo : this.sdkViewName,
- canRequestUsers: (this.mode) ? this.mode.canRequestUsers : undefined
+ canRequestUsers: (this.mode) ? this.mode.canRequestUsers : undefined,
+ canRequestSendNotify: (this.mode) ? this.mode.canRequestSendNotify : undefined
});
this.popover.setCommentsStore(this.popoverComments);
}
diff --git a/apps/common/main/lib/template/CommentsPopover.template b/apps/common/main/lib/template/CommentsPopover.template
index 45b112b7d..78f0d4a5a 100644
--- a/apps/common/main/lib/template/CommentsPopover.template
+++ b/apps/common/main/lib/template/CommentsPopover.template
@@ -10,7 +10,7 @@
<%=scope.pickLink(comment)%>
<% } else { %>
-
+
<% if (hideAddReply) { %>
<% } else { %>
diff --git a/apps/common/main/lib/view/Comments.js b/apps/common/main/lib/view/Comments.js
index 28b9a4496..ca7aaaf1d 100644
--- a/apps/common/main/lib/view/Comments.js
+++ b/apps/common/main/lib/view/Comments.js
@@ -723,7 +723,6 @@ define([
pickEMail: function (commentId, message) {
var arr = Common.Utils.String.htmlEncode(message).match(/\B[@+][A-Z0-9._%+-]+@[A-Z0-9._]+\.[A-Z]+\b/gi);
- console.log(arr); // send e-mails
arr = _.map(arr, function(str){
return str.slice(1, str.length);
});
diff --git a/apps/common/main/lib/view/DocumentAccessDialog.js b/apps/common/main/lib/view/DocumentAccessDialog.js
index ecdfa56c1..2d6c0fcfd 100644
--- a/apps/common/main/lib/view/DocumentAccessDialog.js
+++ b/apps/common/main/lib/view/DocumentAccessDialog.js
@@ -120,8 +120,10 @@ define([
_onMessage: function(msg) {
if (msg && msg.Referer == "onlyoffice") {
- if (msg.needUpdate)
+ if (msg.needUpdate) {
this.trigger('accessrights', this, msg.sharingSettings);
+ Common.NotificationCenter.trigger('mentions:clearusers', this);
+ }
Common.NotificationCenter.trigger('window:close', this);
}
},
diff --git a/apps/common/main/lib/view/ReviewPopover.js b/apps/common/main/lib/view/ReviewPopover.js
index 958928b39..1bd511f5b 100644
--- a/apps/common/main/lib/view/ReviewPopover.js
+++ b/apps/common/main/lib/view/ReviewPopover.js
@@ -101,6 +101,7 @@ define([
this.commentsStore = options.commentsStore;
this.reviewStore = options.reviewStore;
this.canRequestUsers = options.canRequestUsers;
+ this.canRequestSendNotify = options.canRequestSendNotify;
this.externalUsers = [];
this._state = {commentsVisible: false, reviewVisible: false};
@@ -111,7 +112,10 @@ define([
Common.UI.Window.prototype.initialize.call(this, _options);
- this.canRequestUsers && Common.Gateway.on('setusers', _.bind(this.setUsers, this));
+ if (this.canRequestUsers) {
+ Common.Gateway.on('setusers', _.bind(this.setUsers, this));
+ Common.NotificationCenter.on('mentions:clearusers', _.bind(this.clearUsers, this));
+ }
return this;
},
@@ -126,7 +130,7 @@ define([
minHeight: '',
overflow: 'hidden',
position: 'absolute',
- zIndex: '990'
+ zIndex: '1001'
});
var body = window.find('.body');
@@ -239,7 +243,8 @@ define([
textEdit: me.textEdit,
textReply: me.textReply,
textClose: me.textClose,
- maxCommLength: Asc.c_oAscMaxCellOrCommentLength
+ maxCommLength: Asc.c_oAscMaxCellOrCommentLength,
+ textMention: me.canRequestSendNotify ? me.textMention : ''
})
)
});
@@ -970,6 +975,10 @@ define([
this._state.emailSearch = null;
},
+ clearUsers: function() {
+ this.externalUsers = [];
+ },
+
getPopover: function(options) {
if (!this.popover)
this.popover = new Common.Views.ReviewPopover(options);
@@ -1103,7 +1112,8 @@ define([
textClose : 'Close',
textResolve : 'Resolve',
textOpenAgain : "Open Again",
- textLoading : 'Loading'
+ textLoading : 'Loading',
+ textMention : '+mention will provide access to the document and send an email'
}, Common.Views.ReviewPopover || {}))
});
\ No newline at end of file
diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js
index 879957f51..a073c4846 100644
--- a/apps/documenteditor/main/app/controller/Main.js
+++ b/apps/documenteditor/main/app/controller/Main.js
@@ -341,6 +341,7 @@ define([
this.plugins = this.editorConfig.plugins;
this.appOptions.canMakeActionLink = this.editorConfig.canMakeActionLink;
this.appOptions.canRequestUsers = this.editorConfig.canRequestUsers;
+ this.appOptions.canRequestSendNotify = this.editorConfig.canRequestSendNotify;
appHeader = this.getApplication().getController('Viewport').getView('Common.Views.Header');
appHeader.setCanBack(this.appOptions.canBackToFolder === true, (this.appOptions.canBackToFolder) ? this.editorConfig.customization.goback.text : '')
diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json
index 31d60f3d7..32e3c1ad8 100644
--- a/apps/documenteditor/main/locale/en.json
+++ b/apps/documenteditor/main/locale/en.json
@@ -276,6 +276,7 @@
"Common.Views.ReviewPopover.textCancel": "Cancel",
"Common.Views.ReviewPopover.textClose": "Close",
"Common.Views.ReviewPopover.textEdit": "OK",
+ "Common.Views.ReviewPopover.textMention": "+mention will provide access to the document and send an email",
"Common.Views.ReviewPopover.textOpenAgain": "Open Again",
"Common.Views.ReviewPopover.textReply": "Reply",
"Common.Views.ReviewPopover.textResolve": "Resolve",
diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js
index 00eb66d09..2a7cc6a7c 100644
--- a/apps/presentationeditor/main/app/controller/Main.js
+++ b/apps/presentationeditor/main/app/controller/Main.js
@@ -320,6 +320,7 @@ define([
this.appOptions.canPlugins = false;
this.plugins = this.editorConfig.plugins;
this.appOptions.canRequestUsers = this.editorConfig.canRequestUsers;
+ this.appOptions.canRequestSendNotify = this.editorConfig.canRequestSendNotify;
appHeader = this.getApplication().getController('Viewport').getView('Common.Views.Header');
appHeader.setCanBack(this.appOptions.canBackToFolder === true, (this.appOptions.canBackToFolder) ? this.editorConfig.customization.goback.text : '')
diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json
index 80a815c10..2b7671e92 100644
--- a/apps/presentationeditor/main/locale/en.json
+++ b/apps/presentationeditor/main/locale/en.json
@@ -198,6 +198,7 @@
"Common.Views.ReviewPopover.textCancel": "Cancel",
"Common.Views.ReviewPopover.textClose": "Close",
"Common.Views.ReviewPopover.textEdit": "OK",
+ "Common.Views.ReviewPopover.textMention": "+mention will provide access to the document and send an email",
"Common.Views.ReviewPopover.textOpenAgain": "Open Again",
"Common.Views.ReviewPopover.textReply": "Reply",
"Common.Views.ReviewPopover.textResolve": "Resolve",
diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js
index c85db0204..8cfe7427f 100644
--- a/apps/spreadsheeteditor/main/app/controller/Main.js
+++ b/apps/spreadsheeteditor/main/app/controller/Main.js
@@ -326,6 +326,7 @@ define([
this.appOptions.canPlugins = false;
this.plugins = this.editorConfig.plugins;
this.appOptions.canRequestUsers = this.editorConfig.canRequestUsers;
+ this.appOptions.canRequestSendNotify = this.editorConfig.canRequestSendNotify;
this.headerView = this.getApplication().getController('Viewport').getView('Common.Views.Header');
this.headerView.setCanBack(this.appOptions.canBackToFolder === true, (this.appOptions.canBackToFolder) ? this.editorConfig.customization.goback.text : '')
diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json
index 7fe61ada6..5ae57d279 100644
--- a/apps/spreadsheeteditor/main/locale/en.json
+++ b/apps/spreadsheeteditor/main/locale/en.json
@@ -188,6 +188,7 @@
"Common.Views.ReviewPopover.textCancel": "Cancel",
"Common.Views.ReviewPopover.textClose": "Close",
"Common.Views.ReviewPopover.textEdit": "OK",
+ "Common.Views.ReviewPopover.textMention": "+mention will provide access to the document and send an email",
"Common.Views.ReviewPopover.textOpenAgain": "Open Again",
"Common.Views.ReviewPopover.textReply": "Reply",
"Common.Views.ReviewPopover.textResolve": "Resolve",