[DE] Added option "customization->commentAuthorOnly". If "true" - user can edit only comments that he created, otherwise he can edit all comments.
This commit is contained in:
parent
c39e55d631
commit
882a78c0c6
|
@ -114,7 +114,8 @@
|
||||||
toolbar: true,
|
toolbar: true,
|
||||||
header: true,
|
header: true,
|
||||||
autosave: true,
|
autosave: true,
|
||||||
forcesave: false
|
forcesave: false,
|
||||||
|
commentAuthorOnly: false
|
||||||
},
|
},
|
||||||
plugins: {
|
plugins: {
|
||||||
autoStartGuid: 'asc.{FFE1F462-1EA2-4391-990D-4CC84940B754}',
|
autoStartGuid: 'asc.{FFE1F462-1EA2-4391-990D-4CC84940B754}',
|
||||||
|
|
|
@ -698,7 +698,8 @@ define([
|
||||||
editText : false,
|
editText : false,
|
||||||
editTextInPopover : false,
|
editTextInPopover : false,
|
||||||
showReplyInPopover : false,
|
showReplyInPopover : false,
|
||||||
scope : t.view
|
scope : t.view,
|
||||||
|
editable : t.mode.canEditComments || (data.asc_getReply(i).asc_getUserId() == t.currentUserId)
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1047,7 +1048,8 @@ define([
|
||||||
editTextInPopover : (this.editPopover ? true : false),
|
editTextInPopover : (this.editPopover ? true : false),
|
||||||
showReplyInPopover : false,
|
showReplyInPopover : false,
|
||||||
hideAddReply : !_.isUndefined(this.hidereply) ? this.hidereply : (this.showPopover ? true : false),
|
hideAddReply : !_.isUndefined(this.hidereply) ? this.hidereply : (this.showPopover ? true : false),
|
||||||
scope : this.view
|
scope : this.view,
|
||||||
|
editable : this.mode.canEditComments || (data.asc_getUserId() == this.currentUserId)
|
||||||
});
|
});
|
||||||
if (comment) {
|
if (comment) {
|
||||||
var replies = this.readSDKReplies(data);
|
var replies = this.readSDKReplies(data);
|
||||||
|
@ -1078,7 +1080,8 @@ define([
|
||||||
editText : false,
|
editText : false,
|
||||||
editTextInPopover : false,
|
editTextInPopover : false,
|
||||||
showReplyInPopover : false,
|
showReplyInPopover : false,
|
||||||
scope : this.view
|
scope : this.view,
|
||||||
|
editable : this.mode.canEditComments || (data.asc_getReply(i).asc_getUserId() == this.currentUserId)
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1229,7 +1232,7 @@ define([
|
||||||
for (i = 0; i < comments.length; ++i) {
|
for (i = 0; i < comments.length; ++i) {
|
||||||
comment = this.findComment(comments[i].asc_getId());
|
comment = this.findComment(comments[i].asc_getId());
|
||||||
if (comment) {
|
if (comment) {
|
||||||
comment.set('editTextInPopover', true);
|
comment.set('editTextInPopover', t.mode.canEditComments);// dont't edit comment when customization->commentAuthorOnly is true
|
||||||
comment.set('hint', false);
|
comment.set('hint', false);
|
||||||
this.popoverComments.push(comment);
|
this.popoverComments.push(comment);
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,7 +75,8 @@ define([
|
||||||
scope : null,
|
scope : null,
|
||||||
hide : false,
|
hide : false,
|
||||||
hint : false,
|
hint : false,
|
||||||
dummy : undefined
|
dummy : undefined,
|
||||||
|
editable : true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Common.Models.Reply = Backbone.Model.extend({
|
Common.Models.Reply = Backbone.Model.extend({
|
||||||
|
@ -89,7 +90,8 @@ define([
|
||||||
id : Common.UI.getId(), // internal
|
id : Common.UI.getId(), // internal
|
||||||
editText : false,
|
editText : false,
|
||||||
editTextInPopover : false,
|
editTextInPopover : false,
|
||||||
scope : null
|
scope : null,
|
||||||
|
editable : true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -29,7 +29,9 @@
|
||||||
<% if (!item.get("editText")) { %>
|
<% if (!item.get("editText")) { %>
|
||||||
<div class="user-message" data-can-copy="true"><%=scope.pickLink(item.get("reply"))%></div>
|
<div class="user-message" data-can-copy="true"><%=scope.pickLink(item.get("reply"))%></div>
|
||||||
<div class="btns-reply-ct">
|
<div class="btns-reply-ct">
|
||||||
|
<% if (item.get("editable")) { %>
|
||||||
<div class="btn-edit img-commonctrl" data-value="<%=item.get("id")%>"></div>
|
<div class="btn-edit img-commonctrl" data-value="<%=item.get("id")%>"></div>
|
||||||
|
<% } %>
|
||||||
<div class="btn-delete img-commonctrl" data-value="<%=item.get("id")%>"></div>
|
<div class="btn-delete img-commonctrl" data-value="<%=item.get("id")%>"></div>
|
||||||
</div>
|
</div>
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
|
@ -57,7 +59,9 @@
|
||||||
|
|
||||||
<% if (!editText && !lock) { %>
|
<% if (!editText && !lock) { %>
|
||||||
<div class="edit-ct">
|
<div class="edit-ct">
|
||||||
|
<% if (editable) { %>
|
||||||
<div class="btn-edit img-commonctrl"></div>
|
<div class="btn-edit img-commonctrl"></div>
|
||||||
|
<% } %>
|
||||||
<div class="btn-delete img-commonctrl"></div>
|
<div class="btn-delete img-commonctrl"></div>
|
||||||
<% if (resolved) { %>
|
<% if (resolved) { %>
|
||||||
<div class="btn-resolve-check img-commonctrl" data-toggle="tooltip"></div>
|
<div class="btn-resolve-check img-commonctrl" data-toggle="tooltip"></div>
|
||||||
|
|
|
@ -30,7 +30,9 @@
|
||||||
<div class="user-message"><%=scope.pickLink(item.get("reply"))%></div>
|
<div class="user-message"><%=scope.pickLink(item.get("reply"))%></div>
|
||||||
<% if (!hint) { %>
|
<% if (!hint) { %>
|
||||||
<div class="btns-reply-ct">
|
<div class="btns-reply-ct">
|
||||||
|
<% if (item.get("editable")) { %>
|
||||||
<div class="btn-edit img-commonctrl" data-value="<%=item.get("id")%>"></div>
|
<div class="btn-edit img-commonctrl" data-value="<%=item.get("id")%>"></div>
|
||||||
|
<%}%>
|
||||||
<div class="btn-delete img-commonctrl" data-value="<%=item.get("id")%>"></div>
|
<div class="btn-delete img-commonctrl" data-value="<%=item.get("id")%>"></div>
|
||||||
</div>
|
</div>
|
||||||
<%}%>
|
<%}%>
|
||||||
|
@ -60,7 +62,9 @@
|
||||||
|
|
||||||
<% if (!editTextInPopover && !lock && !hint) { %>
|
<% if (!editTextInPopover && !lock && !hint) { %>
|
||||||
<div class="edit-ct">
|
<div class="edit-ct">
|
||||||
|
<% if (editable) { %>
|
||||||
<div class="btn-edit img-commonctrl"></div>
|
<div class="btn-edit img-commonctrl"></div>
|
||||||
|
<% } %>
|
||||||
<div class="btn-delete img-commonctrl"></div>
|
<div class="btn-delete img-commonctrl"></div>
|
||||||
<% if (resolved) { %>
|
<% if (resolved) { %>
|
||||||
<div class="btn-resolve-check img-commonctrl" data-toggle="tooltip"></div>
|
<div class="btn-resolve-check img-commonctrl" data-toggle="tooltip"></div>
|
||||||
|
|
|
@ -1024,6 +1024,7 @@ define([
|
||||||
this.appOptions.buildVersion = params.asc_getBuildVersion();
|
this.appOptions.buildVersion = params.asc_getBuildVersion();
|
||||||
this.appOptions.canForcesave = this.appOptions.isEdit && !this.appOptions.isOffline && (typeof (this.editorConfig.customization) == 'object' && !!this.editorConfig.customization.forcesave);
|
this.appOptions.canForcesave = this.appOptions.isEdit && !this.appOptions.isOffline && (typeof (this.editorConfig.customization) == 'object' && !!this.editorConfig.customization.forcesave);
|
||||||
this.appOptions.forcesave = this.appOptions.canForcesave;
|
this.appOptions.forcesave = this.appOptions.canForcesave;
|
||||||
|
this.appOptions.canEditComments= this.appOptions.isOffline || !(typeof (this.editorConfig.customization) == 'object' && this.editorConfig.customization.commentAuthorOnly);
|
||||||
|
|
||||||
if ( this.appOptions.isLightVersion ) {
|
if ( this.appOptions.isLightVersion ) {
|
||||||
this.appOptions.canUseHistory =
|
this.appOptions.canUseHistory =
|
||||||
|
|
Loading…
Reference in a new issue