Use sdk class

This commit is contained in:
Julia Radzhabova 2021-03-26 14:29:16 +03:00
parent 64b34da425
commit 3b901f91e4
32 changed files with 102 additions and 102 deletions

View file

@ -216,7 +216,7 @@ define([
comment.asc_putTime(this.utcDateToString(new Date())); comment.asc_putTime(this.utcDateToString(new Date()));
comment.asc_putOnlyOfficeTime(this.ooDateToString(new Date())); comment.asc_putOnlyOfficeTime(this.ooDateToString(new Date()));
comment.asc_putUserId(this.currentUserId); comment.asc_putUserId(this.currentUserId);
comment.asc_putUserName(Common.Utils.UserInfoParser.getCurrentName()); comment.asc_putUserName(AscCommon.UserInfoParser.getCurrentName());
comment.asc_putSolved(false); comment.asc_putSolved(false);
if (!_.isUndefined(comment.asc_putDocumentFlag)) { if (!_.isUndefined(comment.asc_putDocumentFlag)) {
@ -354,7 +354,7 @@ define([
ascComment.asc_putTime(t.utcDateToString(new Date(comment.get('time')))); ascComment.asc_putTime(t.utcDateToString(new Date(comment.get('time'))));
ascComment.asc_putOnlyOfficeTime(t.ooDateToString(new Date(comment.get('time')))); ascComment.asc_putOnlyOfficeTime(t.ooDateToString(new Date(comment.get('time'))));
ascComment.asc_putUserId(t.currentUserId); ascComment.asc_putUserId(t.currentUserId);
ascComment.asc_putUserName(Common.Utils.UserInfoParser.getCurrentName()); ascComment.asc_putUserName(AscCommon.UserInfoParser.getCurrentName());
ascComment.asc_putSolved(comment.get('resolved')); ascComment.asc_putSolved(comment.get('resolved'));
ascComment.asc_putGuid(comment.get('guid')); ascComment.asc_putGuid(comment.get('guid'));
ascComment.asc_putUserData(comment.get('userdata')); ascComment.asc_putUserData(comment.get('userdata'));
@ -431,7 +431,7 @@ define([
if (reply.get('id') === replyId && !_.isUndefined(replyVal)) { if (reply.get('id') === replyId && !_.isUndefined(replyVal)) {
addReply.asc_putText(replyVal); addReply.asc_putText(replyVal);
addReply.asc_putUserId(me.currentUserId); addReply.asc_putUserId(me.currentUserId);
addReply.asc_putUserName(Common.Utils.UserInfoParser.getCurrentName()); addReply.asc_putUserName(AscCommon.UserInfoParser.getCurrentName());
} else { } else {
addReply.asc_putText(reply.get('reply')); addReply.asc_putText(reply.get('reply'));
addReply.asc_putUserId(reply.get('userid')); addReply.asc_putUserId(reply.get('userid'));
@ -511,7 +511,7 @@ define([
addReply.asc_putTime(me.utcDateToString(new Date())); addReply.asc_putTime(me.utcDateToString(new Date()));
addReply.asc_putOnlyOfficeTime(me.ooDateToString(new Date())); addReply.asc_putOnlyOfficeTime(me.ooDateToString(new Date()));
addReply.asc_putUserId(me.currentUserId); addReply.asc_putUserId(me.currentUserId);
addReply.asc_putUserName(Common.Utils.UserInfoParser.getCurrentName()); addReply.asc_putUserName(AscCommon.UserInfoParser.getCurrentName());
ascComment.asc_addReply(addReply); ascComment.asc_addReply(addReply);
@ -776,9 +776,9 @@ define([
comment.set('userdata', data.asc_getUserData()); comment.set('userdata', data.asc_getUserData());
comment.set('time', date.getTime()); comment.set('time', date.getTime());
comment.set('date', t.dateToLocaleTimeString(date)); comment.set('date', t.dateToLocaleTimeString(date));
comment.set('editable', (t.mode.canEditComments || (data.asc_getUserId() == t.currentUserId)) && Common.Utils.UserInfoParser.canEditComment(data.asc_getUserName())); comment.set('editable', (t.mode.canEditComments || (data.asc_getUserId() == t.currentUserId)) && AscCommon.UserInfoParser.canEditComment(data.asc_getUserName()));
comment.set('removable', (t.mode.canDeleteComments || (data.asc_getUserId() == t.currentUserId)) && Common.Utils.UserInfoParser.canDeleteComment(data.asc_getUserName())); comment.set('removable', (t.mode.canDeleteComments || (data.asc_getUserId() == t.currentUserId)) && AscCommon.UserInfoParser.canDeleteComment(data.asc_getUserName()));
comment.set('hide', !Common.Utils.UserInfoParser.canViewComment(data.asc_getUserName())); comment.set('hide', !AscCommon.UserInfoParser.canViewComment(data.asc_getUserName()));
replies = _.clone(comment.get('replys')); replies = _.clone(comment.get('replys'));
@ -804,9 +804,9 @@ define([
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)) && Common.Utils.UserInfoParser.canEditComment(data.asc_getReply(i).asc_getUserName()), editable : (t.mode.canEditComments || (data.asc_getReply(i).asc_getUserId() == t.currentUserId)) && AscCommon.UserInfoParser.canEditComment(data.asc_getReply(i).asc_getUserName()),
removable : (t.mode.canDeleteComments || (data.asc_getReply(i).asc_getUserId() == t.currentUserId)) && Common.Utils.UserInfoParser.canDeleteComment(data.asc_getReply(i).asc_getUserName()), removable : (t.mode.canDeleteComments || (data.asc_getReply(i).asc_getUserId() == t.currentUserId)) && AscCommon.UserInfoParser.canDeleteComment(data.asc_getReply(i).asc_getUserName()),
hide : !Common.Utils.UserInfoParser.canViewComment(data.asc_getReply(i).asc_getUserName()) hide : !AscCommon.UserInfoParser.canViewComment(data.asc_getReply(i).asc_getUserName())
})); }));
} }
@ -1255,9 +1255,9 @@ define([
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)) && Common.Utils.UserInfoParser.canEditComment(data.asc_getUserName()), editable : (this.mode.canEditComments || (data.asc_getUserId() == this.currentUserId)) && AscCommon.UserInfoParser.canEditComment(data.asc_getUserName()),
removable : (this.mode.canDeleteComments || (data.asc_getUserId() == this.currentUserId)) && Common.Utils.UserInfoParser.canDeleteComment(data.asc_getUserName()), removable : (this.mode.canDeleteComments || (data.asc_getUserId() == this.currentUserId)) && AscCommon.UserInfoParser.canDeleteComment(data.asc_getUserName()),
hide : !Common.Utils.UserInfoParser.canViewComment(data.asc_getUserName()), hide : !AscCommon.UserInfoParser.canViewComment(data.asc_getUserName()),
hint : !this.mode.canComments, hint : !this.mode.canComments,
groupName : (groupname && groupname.length>1) ? groupname[1] : null groupName : (groupname && groupname.length>1) ? groupname[1] : null
}); });
@ -1294,9 +1294,9 @@ define([
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)) && Common.Utils.UserInfoParser.canEditComment(data.asc_getReply(i).asc_getUserName()), editable : (this.mode.canEditComments || (data.asc_getReply(i).asc_getUserId() == this.currentUserId)) && AscCommon.UserInfoParser.canEditComment(data.asc_getReply(i).asc_getUserName()),
removable : (this.mode.canDeleteComments || (data.asc_getReply(i).asc_getUserId() == this.currentUserId)) && Common.Utils.UserInfoParser.canDeleteComment(data.asc_getReply(i).asc_getUserName()), removable : (this.mode.canDeleteComments || (data.asc_getReply(i).asc_getUserId() == this.currentUserId)) && AscCommon.UserInfoParser.canDeleteComment(data.asc_getReply(i).asc_getUserName()),
hide : !Common.Utils.UserInfoParser.canViewComment(data.asc_getReply(i).asc_getUserName()) hide : !AscCommon.UserInfoParser.canViewComment(data.asc_getReply(i).asc_getUserName())
})); }));
} }
} }
@ -1326,7 +1326,7 @@ define([
time: date.getTime(), time: date.getTime(),
date: this.dateToLocaleTimeString(date), date: this.dateToLocaleTimeString(date),
userid: this.currentUserId, userid: this.currentUserId,
username: Common.Utils.UserInfoParser.getCurrentName(), username: AscCommon.UserInfoParser.getCurrentName(),
usercolor: (user) ? user.get('color') : null, usercolor: (user) ? user.get('color') : null,
editTextInPopover: true, editTextInPopover: true,
showReplyInPopover: false, showReplyInPopover: false,
@ -1390,7 +1390,7 @@ define([
comment.asc_putTime(this.utcDateToString(new Date())); comment.asc_putTime(this.utcDateToString(new Date()));
comment.asc_putOnlyOfficeTime(this.ooDateToString(new Date())); comment.asc_putOnlyOfficeTime(this.ooDateToString(new Date()));
comment.asc_putUserId(this.currentUserId); comment.asc_putUserId(this.currentUserId);
comment.asc_putUserName(Common.Utils.UserInfoParser.getCurrentName()); comment.asc_putUserName(AscCommon.UserInfoParser.getCurrentName());
comment.asc_putSolved(false); comment.asc_putSolved(false);
if (!_.isUndefined(comment.asc_putDocumentFlag)) if (!_.isUndefined(comment.asc_putDocumentFlag))
@ -1457,7 +1457,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', t.mode.canEditComments && Common.Utils.UserInfoParser.canEditComment(comment.username));// dont't edit comment when customization->commentAuthorOnly is true or when permissions.editCommentAuthorOnly is true comment.set('editTextInPopover', t.mode.canEditComments && AscCommon.UserInfoParser.canEditComment(comment.username));// dont't edit comment when customization->commentAuthorOnly is true or when permissions.editCommentAuthorOnly is true
comment.set('hint', false); comment.set('hint', false);
this.popoverComments.push(comment); this.popoverComments.push(comment);
} }

View file

@ -464,7 +464,7 @@ define([
scope : me.view, scope : me.view,
hint : !me.appConfig.canReview, hint : !me.appConfig.canReview,
goto : (item.get_MoveType() == Asc.c_oAscRevisionsMove.MoveTo || item.get_MoveType() == Asc.c_oAscRevisionsMove.MoveFrom), goto : (item.get_MoveType() == Asc.c_oAscRevisionsMove.MoveTo || item.get_MoveType() == Asc.c_oAscRevisionsMove.MoveFrom),
editable : me.appConfig.isReviewOnly && (item.get_UserId() == me.currentUserId) || !me.appConfig.isReviewOnly && (!me.appConfig.canUseReviewPermissions || Common.Utils.UserInfoParser.canEditReview(item.get_UserName())) editable : me.appConfig.isReviewOnly && (item.get_UserId() == me.currentUserId) || !me.appConfig.isReviewOnly && (!me.appConfig.canUseReviewPermissions || AscCommon.UserInfoParser.canEditReview(item.get_UserName()))
}); });
arr.push(change); arr.push(change);
@ -475,7 +475,7 @@ define([
getUserName: function(id){ getUserName: function(id){
if (this.userCollection && id!==null){ if (this.userCollection && id!==null){
var rec = this.userCollection.findUser(id); var rec = this.userCollection.findUser(id);
if (rec) return Common.Utils.UserInfoParser.getParsedName(rec.get('username')); if (rec) return AscCommon.UserInfoParser.getParsedName(rec.get('username'));
} }
return ''; return '';
}, },
@ -576,7 +576,7 @@ define([
this.view.turnChanges(state, global); this.view.turnChanges(state, global);
if (userId && this.userCollection) { if (userId && this.userCollection) {
var rec = this.userCollection.findOriginalUser(userId); var rec = this.userCollection.findOriginalUser(userId);
rec && this.showTips(Common.Utils.String.format(globalFlag ? this.textOnGlobal : this.textOffGlobal, Common.Utils.UserInfoParser.getParsedName(rec.get('username')))); rec && this.showTips(Common.Utils.String.format(globalFlag ? this.textOnGlobal : this.textOffGlobal, AscCommon.UserInfoParser.getParsedName(rec.get('username'))));
} }
} }
}, },

View file

@ -724,7 +724,7 @@ Common.Utils.fillUserInfo = function(info, lang, defname) {
var _user = info || {}; var _user = info || {};
!_user.id && (_user.id = ('uid-' + Date.now())); !_user.id && (_user.id = ('uid-' + Date.now()));
_user.fullname = _.isEmpty(_user.name) ? defname : _user.name; _user.fullname = _.isEmpty(_user.name) ? defname : _user.name;
_user.group && (_user.fullname = (_user.group).toString() + Common.Utils.UserInfoParser.getSeparator() + _user.fullname); _user.group && (_user.fullname = (_user.group).toString() + AscCommon.UserInfoParser.getSeparator() + _user.fullname);
_user.guest = _.isEmpty(_user.name); _user.guest = _.isEmpty(_user.name);
return _user; return _user;
}; };

View file

@ -267,7 +267,7 @@ define([
}, },
getUserName: function (username) { getUserName: function (username) {
return Common.Utils.String.htmlEncode(Common.Utils.UserInfoParser.getParsedName(username)); return Common.Utils.String.htmlEncode(AscCommon.UserInfoParser.getParsedName(username));
}, },
hide: function () { hide: function () {

View file

@ -664,7 +664,7 @@ define([
return Common.Utils.String.ellipsis(Common.Utils.String.htmlEncode(quote), 120, true); return Common.Utils.String.ellipsis(Common.Utils.String.htmlEncode(quote), 120, true);
}, },
getUserName: function (username) { getUserName: function (username) {
return Common.Utils.String.htmlEncode(Common.Utils.UserInfoParser.getParsedName(username)); return Common.Utils.String.htmlEncode(AscCommon.UserInfoParser.getParsedName(username));
}, },
pickLink: function (message) { pickLink: function (message) {

View file

@ -136,7 +136,7 @@ define([
users: collection.chain().filter(function(item){return item.get('online') && !item.get('view')}).groupBy(function(item) {return item.get('idOriginal');}).value(), users: collection.chain().filter(function(item){return item.get('online') && !item.get('view')}).groupBy(function(item) {return item.get('idOriginal');}).value(),
usertpl: _.template(templateUserItem), usertpl: _.template(templateUserItem),
fnEncode: function(username) { fnEncode: function(username) {
return Common.Utils.String.htmlEncode(Common.Utils.UserInfoParser.getParsedName(username)); return Common.Utils.String.htmlEncode(AscCommon.UserInfoParser.getParsedName(username));
} }
})); }));

View file

@ -90,7 +90,7 @@ define([
'<% } %>', '<% } %>',
'<div class="user-name">', '<div class="user-name">',
'<div class="color" style="display: inline-block; background-color:' + '<%=usercolor%>;' + '" >', '<div class="color" style="display: inline-block; background-color:' + '<%=usercolor%>;' + '" >',
'</div><%= Common.Utils.String.htmlEncode(Common.Utils.UserInfoParser.getParsedName(username)) %>', '</div><%= Common.Utils.String.htmlEncode(AscCommon.UserInfoParser.getParsedName(username)) %>',
'</div>', '</div>',
'<% if (canRestore && selected) { %>', '<% if (canRestore && selected) { %>',
'<label class="revision-restore" role="presentation" tabindex="-1">' + this.textRestore + '</label>', '<label class="revision-restore" role="presentation" tabindex="-1">' + this.textRestore + '</label>',

View file

@ -670,7 +670,7 @@ define([
}, },
getUserName: function (username) { getUserName: function (username) {
return Common.Utils.String.htmlEncode(Common.Utils.UserInfoParser.getParsedName(username)); return Common.Utils.String.htmlEncode(AscCommon.UserInfoParser.getParsedName(username));
}, },
turnChanges: function(state, global) { turnChanges: function(state, global) {

View file

@ -255,7 +255,7 @@ define([
var me = this; var me = this;
var usersArray = []; var usersArray = [];
_.each(editUsers, function(item){ _.each(editUsers, function(item){
var name = Common.Utils.UserInfoParser.getParsedName(item.asc_getUserName()); var name = AscCommon.UserInfoParser.getParsedName(item.asc_getUserName());
var initials = me.getInitials(name); var initials = me.getInitials(name);
if((item.asc_getState()!==false) && !item.asc_getView()) { if((item.asc_getState()!==false) && !item.asc_getView()) {
var userAttr = { var userAttr = {
@ -699,7 +699,7 @@ define([
userColor = item.get_UserColor(), userColor = item.get_UserColor(),
goto = (item.get_MoveType() == Asc.c_oAscRevisionsMove.MoveTo || item.get_MoveType() == Asc.c_oAscRevisionsMove.MoveFrom); goto = (item.get_MoveType() == Asc.c_oAscRevisionsMove.MoveTo || item.get_MoveType() == Asc.c_oAscRevisionsMove.MoveFrom);
date = me.dateToLocaleTimeString(date); date = me.dateToLocaleTimeString(date);
var editable = me.appConfig.isReviewOnly && (item.get_UserId() == _userId) || !me.appConfig.isReviewOnly && (!me.appConfig.canUseReviewPermissions || Common.Utils.UserInfoParser.canEditReview(item.get_UserName())); var editable = me.appConfig.isReviewOnly && (item.get_UserId() == _userId) || !me.appConfig.isReviewOnly && (!me.appConfig.canUseReviewPermissions || AscCommon.UserInfoParser.canEditReview(item.get_UserName()));
arr.push({date: date, user: user, usercolor: userColor, changetext: changetext, goto: goto, editable: editable}); arr.push({date: date, user: user, usercolor: userColor, changetext: changetext, goto: goto, editable: editable});
}); });
arrChangeReview = arr; arrChangeReview = arr;
@ -770,7 +770,7 @@ define([
}, },
getInitials: function(name) { getInitials: function(name) {
var fio = Common.Utils.UserInfoParser.getParsedName(name).split(' '); var fio = AscCommon.UserInfoParser.getParsedName(name).split(' ');
var initials = fio[0].substring(0, 1).toUpperCase(); var initials = fio[0].substring(0, 1).toUpperCase();
for (var i=fio.length-1; i>0; i--) { for (var i=fio.length-1; i>0; i--) {
if (fio[i][0]!=='(' && fio[i][0]!==')') { if (fio[i][0]!=='(' && fio[i][0]!==')') {
@ -1558,9 +1558,9 @@ define([
reply : data.asc_getReply(i).asc_getText(), reply : data.asc_getReply(i).asc_getText(),
time : date.getTime(), time : date.getTime(),
userInitials : this.getInitials(username), userInitials : this.getInitials(username),
editable : (this.appConfig.canEditComments || (data.asc_getReply(i).asc_getUserId() == _userId)) && Common.Utils.UserInfoParser.canEditComment(username), editable : (this.appConfig.canEditComments || (data.asc_getReply(i).asc_getUserId() == _userId)) && AscCommon.UserInfoParser.canEditComment(username),
removable : (this.appConfig.canDeleteComments || (data.asc_getReply(i).asc_getUserId() == _userId)) && Common.Utils.UserInfoParser.canDeleteComment(username), removable : (this.appConfig.canDeleteComments || (data.asc_getReply(i).asc_getUserId() == _userId)) && AscCommon.UserInfoParser.canDeleteComment(username),
hide : !Common.Utils.UserInfoParser.canViewComment(data.asc_getReply(i).asc_getUserName()) hide : !AscCommon.UserInfoParser.canViewComment(data.asc_getReply(i).asc_getUserName())
}); });
} }
} }
@ -1589,9 +1589,9 @@ define([
replys : [], replys : [],
groupName : (groupname && groupname.length>1) ? groupname[1] : null, groupName : (groupname && groupname.length>1) ? groupname[1] : null,
userInitials : this.getInitials(username), userInitials : this.getInitials(username),
editable : (this.appConfig.canEditComments || (data.asc_getUserId() == _userId)) && Common.Utils.UserInfoParser.canEditComment(username), editable : (this.appConfig.canEditComments || (data.asc_getUserId() == _userId)) && AscCommon.UserInfoParser.canEditComment(username),
removable : (this.appConfig.canDeleteComments || (data.asc_getUserId() == _userId)) && Common.Utils.UserInfoParser.canDeleteComment(username), removable : (this.appConfig.canDeleteComments || (data.asc_getUserId() == _userId)) && AscCommon.UserInfoParser.canDeleteComment(username),
hide : !Common.Utils.UserInfoParser.canViewComment(username) hide : !AscCommon.UserInfoParser.canViewComment(username)
}; };
if (comment) { if (comment) {
var replies = this.readSDKReplies(data); var replies = this.readSDKReplies(data);
@ -1627,9 +1627,9 @@ define([
comment.quote = data.asc_getQuoteText(); comment.quote = data.asc_getQuoteText();
comment.time = date.getTime(); comment.time = date.getTime();
comment.date = me.dateToLocaleTimeString(date); comment.date = me.dateToLocaleTimeString(date);
comment.editable = (me.appConfig.canEditComments || (data.asc_getUserId() == _userId)) && Common.Utils.UserInfoParser.canEditComment(data.asc_getUserName()); comment.editable = (me.appConfig.canEditComments || (data.asc_getUserId() == _userId)) && AscCommon.UserInfoParser.canEditComment(data.asc_getUserName());
comment.removable = (me.appConfig.canDeleteComments || (data.asc_getUserId() == _userId)) && Common.Utils.UserInfoParser.canDeleteComment(data.asc_getUserName()); comment.removable = (me.appConfig.canDeleteComments || (data.asc_getUserId() == _userId)) && AscCommon.UserInfoParser.canDeleteComment(data.asc_getUserName());
comment.hide = !Common.Utils.UserInfoParser.canViewComment(data.asc_getUserName()); comment.hide = !AscCommon.UserInfoParser.canViewComment(data.asc_getUserName());
replies = _.clone(comment.replys); replies = _.clone(comment.replys);
@ -1654,9 +1654,9 @@ define([
reply : data.asc_getReply(i).asc_getText(), reply : data.asc_getReply(i).asc_getText(),
time : dateReply.getTime(), time : dateReply.getTime(),
userInitials : me.getInitials(username), userInitials : me.getInitials(username),
editable : (me.appConfig.canEditComments || (data.asc_getReply(i).asc_getUserId() == _userId)) && Common.Utils.UserInfoParser.canEditComment(username), editable : (me.appConfig.canEditComments || (data.asc_getReply(i).asc_getUserId() == _userId)) && AscCommon.UserInfoParser.canEditComment(username),
removable : (me.appConfig.canDeleteComments || (data.asc_getReply(i).asc_getUserId() == _userId)) && Common.Utils.UserInfoParser.canDeleteComment(username), removable : (me.appConfig.canDeleteComments || (data.asc_getReply(i).asc_getUserId() == _userId)) && AscCommon.UserInfoParser.canDeleteComment(username),
hide : !Common.Utils.UserInfoParser.canViewComment(username) hide : !AscCommon.UserInfoParser.canViewComment(username)
}); });
} }
comment.replys = replies; comment.replys = replies;

View file

@ -462,7 +462,7 @@ define([
}, },
getUserName: function (username) { getUserName: function (username) {
return Common.Utils.String.htmlEncode(Common.Utils.UserInfoParser.getParsedName(username)); return Common.Utils.String.htmlEncode(AscCommon.UserInfoParser.getParsedName(username));
}, },
textCollaboration: 'Collaboration', textCollaboration: 'Collaboration',

View file

@ -1334,11 +1334,11 @@ define([
this.appOptions.canUseReviewPermissions = this.appOptions.canLicense && (!!this.permissions.reviewGroups || this.appOptions.canUseReviewPermissions = this.appOptions.canLicense && (!!this.permissions.reviewGroups ||
this.editorConfig.customization && this.editorConfig.customization.reviewPermissions && (typeof (this.editorConfig.customization.reviewPermissions) == 'object')); this.editorConfig.customization && this.editorConfig.customization.reviewPermissions && (typeof (this.editorConfig.customization.reviewPermissions) == 'object'));
this.appOptions.canUseCommentPermissions = this.appOptions.canLicense && !!this.permissions.commentGroups; this.appOptions.canUseCommentPermissions = this.appOptions.canLicense && !!this.permissions.commentGroups;
Common.Utils.UserInfoParser.setParser(this.appOptions.canUseReviewPermissions || this.appOptions.canUseCommentPermissions); AscCommon.UserInfoParser.setParser(this.appOptions.canUseReviewPermissions || this.appOptions.canUseCommentPermissions);
Common.Utils.UserInfoParser.setCurrentName(this.appOptions.user.fullname); AscCommon.UserInfoParser.setCurrentName(this.appOptions.user.fullname);
this.appOptions.canUseReviewPermissions && Common.Utils.UserInfoParser.setReviewPermissions(this.permissions.reviewGroups, this.editorConfig.customization.reviewPermissions); this.appOptions.canUseReviewPermissions && AscCommon.UserInfoParser.setReviewPermissions(this.permissions.reviewGroups, this.editorConfig.customization.reviewPermissions);
this.appOptions.canUseCommentPermissions && Common.Utils.UserInfoParser.setCommentPermissions(this.permissions.commentGroups); this.appOptions.canUseCommentPermissions && AscCommon.UserInfoParser.setCommentPermissions(this.permissions.commentGroups);
appHeader.setUserName(Common.Utils.UserInfoParser.getParsedName(Common.Utils.UserInfoParser.getCurrentName())); appHeader.setUserName(AscCommon.UserInfoParser.getParsedName(AscCommon.UserInfoParser.getCurrentName()));
this.appOptions.canRename && appHeader.setCanRename(true); this.appOptions.canRename && appHeader.setCanRename(true);
this.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object' || this.editorConfig.plugins); this.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object' || this.editorConfig.plugins);
@ -2234,10 +2234,10 @@ define([
onUserConnection: function(change){ onUserConnection: function(change){
if (change && this.appOptions.user.guest && this.appOptions.canRenameAnonymous && (change.asc_getIdOriginal() == this.appOptions.user.id)) { // change name of the current user if (change && this.appOptions.user.guest && this.appOptions.canRenameAnonymous && (change.asc_getIdOriginal() == this.appOptions.user.id)) { // change name of the current user
var name = change.asc_getUserName(); var name = change.asc_getUserName();
if (name && name !== Common.Utils.UserInfoParser.getCurrentName() ) { if (name && name !== AscCommon.UserInfoParser.getCurrentName() ) {
this._renameDialog && this._renameDialog.close(); this._renameDialog && this._renameDialog.close();
Common.Utils.UserInfoParser.setCurrentName(name); AscCommon.UserInfoParser.setCurrentName(name);
appHeader.setUserName(Common.Utils.UserInfoParser.getParsedName(name)); appHeader.setUserName(AscCommon.UserInfoParser.getParsedName(name));
var idx1 = name.lastIndexOf('('), var idx1 = name.lastIndexOf('('),
idx2 = name.lastIndexOf(')'), idx2 = name.lastIndexOf(')'),

View file

@ -359,7 +359,7 @@ define([
if (usersStore){ if (usersStore){
var rec = usersStore.findUser(id); var rec = usersStore.findUser(id);
if (rec) if (rec)
return Common.Utils.UserInfoParser.getParsedName(rec.get('username')); return AscCommon.UserInfoParser.getParsedName(rec.get('username'));
} }
return me.guestText; return me.guestText;
}; };

View file

@ -1206,7 +1206,7 @@ define([
visible = this._ShowHideInfoItem(this.lblModifyDate, !!value) || visible; visible = this._ShowHideInfoItem(this.lblModifyDate, !!value) || visible;
value = props.asc_getLastModifiedBy(); value = props.asc_getLastModifiedBy();
if (value) if (value)
this.lblModifyBy.text(Common.Utils.UserInfoParser.getParsedName(value)); this.lblModifyBy.text(AscCommon.UserInfoParser.getParsedName(value));
visible = this._ShowHideInfoItem(this.lblModifyBy, !!value) || visible; visible = this._ShowHideInfoItem(this.lblModifyBy, !!value) || visible;
$('tr.divider.modify', this.el)[visible?'show':'hide'](); $('tr.divider.modify', this.el)[visible?'show':'hide']();

View file

@ -355,7 +355,7 @@ define([
if (usersStore){ if (usersStore){
var rec = usersStore.findUser(id); var rec = usersStore.findUser(id);
if (rec) if (rec)
return Common.Utils.UserInfoParser.getParsedName(rec.get('username')); return AscCommon.UserInfoParser.getParsedName(rec.get('username'));
} }
return me.textGuest; return me.textGuest;
}; };

View file

@ -840,10 +840,10 @@ define([
me.appOptions.canUseReviewPermissions = me.appOptions.canLicense && (!!me.permissions.reviewGroups || me.appOptions.canUseReviewPermissions = me.appOptions.canLicense && (!!me.permissions.reviewGroups ||
me.editorConfig.customization && me.editorConfig.customization.reviewPermissions && (typeof (me.editorConfig.customization.reviewPermissions) == 'object')); me.editorConfig.customization && me.editorConfig.customization.reviewPermissions && (typeof (me.editorConfig.customization.reviewPermissions) == 'object'));
me.appOptions.canUseCommentPermissions = me.appOptions.canLicense && !!me.permissions.commentGroups; me.appOptions.canUseCommentPermissions = me.appOptions.canLicense && !!me.permissions.commentGroups;
Common.Utils.UserInfoParser.setParser(me.appOptions.canUseReviewPermissions || me.appOptions.canUseCommentPermissions); AscCommon.UserInfoParser.setParser(me.appOptions.canUseReviewPermissions || me.appOptions.canUseCommentPermissions);
Common.Utils.UserInfoParser.setCurrentName(me.appOptions.user.fullname); AscCommon.UserInfoParser.setCurrentName(me.appOptions.user.fullname);
me.appOptions.canUseReviewPermissions && Common.Utils.UserInfoParser.setReviewPermissions(me.permissions.reviewGroups, me.editorConfig.customization.reviewPermissions); me.appOptions.canUseReviewPermissions && AscCommon.UserInfoParser.setReviewPermissions(me.permissions.reviewGroups, me.editorConfig.customization.reviewPermissions);
me.appOptions.canUseCommentPermissions && Common.Utils.UserInfoParser.setCommentPermissions(me.permissions.commentGroups); me.appOptions.canUseCommentPermissions && AscCommon.UserInfoParser.setCommentPermissions(me.permissions.commentGroups);
me.applyModeCommonElements(); me.applyModeCommonElements();
me.applyModeEditorElements(); me.applyModeEditorElements();
@ -1388,8 +1388,8 @@ define([
onUserConnection: function(change){ onUserConnection: function(change){
if (change && this.appOptions.user.guest && this.appOptions.canRenameAnonymous && (change.asc_getIdOriginal() == this.appOptions.user.id)) { // change name of the current user if (change && this.appOptions.user.guest && this.appOptions.canRenameAnonymous && (change.asc_getIdOriginal() == this.appOptions.user.id)) { // change name of the current user
var name = change.asc_getUserName(); var name = change.asc_getUserName();
if (name && name !== Common.Utils.UserInfoParser.getCurrentName() ) { if (name && name !== AscCommon.UserInfoParser.getCurrentName() ) {
Common.Utils.UserInfoParser.setCurrentName(name); AscCommon.UserInfoParser.setCurrentName(name);
} }
} }
}, },

View file

@ -458,7 +458,7 @@ define([
value = props.asc_getModified(); value = props.asc_getModified();
value ? $('#settings-doc-last-mod').html(value.toLocaleString(_lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleTimeString(_lang, {timeStyle: 'short'})) : $('.display-last-mode').remove(); value ? $('#settings-doc-last-mod').html(value.toLocaleString(_lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleTimeString(_lang, {timeStyle: 'short'})) : $('.display-last-mode').remove();
value = props.asc_getLastModifiedBy(); value = props.asc_getLastModifiedBy();
value ? $('#settings-doc-mod-by').html(Common.Utils.UserInfoParser.getParsedName(value)) : $('.display-mode-by').remove(); value ? $('#settings-doc-mod-by').html(AscCommon.UserInfoParser.getParsedName(value)) : $('.display-mode-by').remove();
value = props.asc_getCreated(); value = props.asc_getCreated();
value ? $('#settings-doc-date').html(value.toLocaleString(_lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleTimeString(_lang, {timeStyle: 'short'})) : $('.display-created-date').remove(); value ? $('#settings-doc-date').html(value.toLocaleString(_lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleTimeString(_lang, {timeStyle: 'short'})) : $('.display-created-date').remove();
value = props.asc_getCreator(); value = props.asc_getCreator();

View file

@ -209,7 +209,7 @@ define([
}, },
getUserName: function (username) { getUserName: function (username) {
return Common.Utils.String.htmlEncode(Common.Utils.UserInfoParser.getParsedName(username)); return Common.Utils.String.htmlEncode(AscCommon.UserInfoParser.getParsedName(username));
}, },
renderNumFormat: function (dataFormat, selectFormat) { renderNumFormat: function (dataFormat, selectFormat) {

View file

@ -1035,11 +1035,11 @@ define([
this.appOptions.canUseReviewPermissions = this.appOptions.canLicense && (!!this.permissions.reviewGroups || this.appOptions.canUseReviewPermissions = this.appOptions.canLicense && (!!this.permissions.reviewGroups ||
this.appOptions.canLicense && this.editorConfig.customization && this.editorConfig.customization.reviewPermissions && (typeof (this.editorConfig.customization.reviewPermissions) == 'object')); this.appOptions.canLicense && this.editorConfig.customization && this.editorConfig.customization.reviewPermissions && (typeof (this.editorConfig.customization.reviewPermissions) == 'object'));
this.appOptions.canUseCommentPermissions = this.appOptions.canLicense && !!this.permissions.commentGroups; this.appOptions.canUseCommentPermissions = this.appOptions.canLicense && !!this.permissions.commentGroups;
Common.Utils.UserInfoParser.setParser(this.appOptions.canUseReviewPermissions || this.appOptions.canUseCommentPermissions); AscCommon.UserInfoParser.setParser(this.appOptions.canUseReviewPermissions || this.appOptions.canUseCommentPermissions);
Common.Utils.UserInfoParser.setCurrentName(this.appOptions.user.fullname); AscCommon.UserInfoParser.setCurrentName(this.appOptions.user.fullname);
this.appOptions.canUseReviewPermissions && Common.Utils.UserInfoParser.setReviewPermissions(this.permissions.reviewGroups, this.editorConfig.customization.reviewPermissions); this.appOptions.canUseReviewPermissions && AscCommon.UserInfoParser.setReviewPermissions(this.permissions.reviewGroups, this.editorConfig.customization.reviewPermissions);
this.appOptions.canUseCommentPermissions && Common.Utils.UserInfoParser.setCommentPermissions(this.permissions.commentGroups); this.appOptions.canUseCommentPermissions && AscCommon.UserInfoParser.setCommentPermissions(this.permissions.commentGroups);
appHeader.setUserName(Common.Utils.UserInfoParser.getParsedName(Common.Utils.UserInfoParser.getCurrentName())); appHeader.setUserName(AscCommon.UserInfoParser.getParsedName(AscCommon.UserInfoParser.getCurrentName()));
this.appOptions.canRename && appHeader.setCanRename(true); this.appOptions.canRename && appHeader.setCanRename(true);
this.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object' || this.editorConfig.plugins); this.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object' || this.editorConfig.plugins);
@ -1880,10 +1880,10 @@ define([
onUserConnection: function(change){ onUserConnection: function(change){
if (change && this.appOptions.user.guest && this.appOptions.canRenameAnonymous && (change.asc_getIdOriginal() == this.appOptions.user.id)) { // change name of the current user if (change && this.appOptions.user.guest && this.appOptions.canRenameAnonymous && (change.asc_getIdOriginal() == this.appOptions.user.id)) { // change name of the current user
var name = change.asc_getUserName(); var name = change.asc_getUserName();
if (name && name !== Common.Utils.UserInfoParser.getCurrentName() ) { if (name && name !== AscCommon.UserInfoParser.getCurrentName() ) {
this._renameDialog && this._renameDialog.close(); this._renameDialog && this._renameDialog.close();
Common.Utils.UserInfoParser.setCurrentName(name); AscCommon.UserInfoParser.setCurrentName(name);
appHeader.setUserName(Common.Utils.UserInfoParser.getParsedName(name)); appHeader.setUserName(AscCommon.UserInfoParser.getParsedName(name));
var idx1 = name.lastIndexOf('('), var idx1 = name.lastIndexOf('('),
idx2 = name.lastIndexOf(')'), idx2 = name.lastIndexOf(')'),

View file

@ -363,7 +363,7 @@ define([
if (usersStore){ if (usersStore){
var rec = usersStore.findUser(id); var rec = usersStore.findUser(id);
if (rec) if (rec)
return Common.Utils.UserInfoParser.getParsedName(rec.get('username')); return AscCommon.UserInfoParser.getParsedName(rec.get('username'));
} }
return me.guestText; return me.guestText;
}; };

View file

@ -1074,7 +1074,7 @@ define([
visible = this._ShowHideInfoItem(this.lblModifyDate, !!value) || visible; visible = this._ShowHideInfoItem(this.lblModifyDate, !!value) || visible;
value = props.asc_getLastModifiedBy(); value = props.asc_getLastModifiedBy();
if (value) if (value)
this.lblModifyBy.text(Common.Utils.UserInfoParser.getParsedName(value)); this.lblModifyBy.text(AscCommon.UserInfoParser.getParsedName(value));
visible = this._ShowHideInfoItem(this.lblModifyBy, !!value) || visible; visible = this._ShowHideInfoItem(this.lblModifyBy, !!value) || visible;
$('tr.divider.modify', this.el)[visible?'show':'hide'](); $('tr.divider.modify', this.el)[visible?'show':'hide']();

View file

@ -763,10 +763,10 @@ define([
me.appOptions.canUseReviewPermissions = me.appOptions.canLicense && (!!me.permissions.reviewGroups || me.appOptions.canUseReviewPermissions = me.appOptions.canLicense && (!!me.permissions.reviewGroups ||
me.editorConfig.customization && me.editorConfig.customization.reviewPermissions && (typeof (me.editorConfig.customization.reviewPermissions) == 'object')); me.editorConfig.customization && me.editorConfig.customization.reviewPermissions && (typeof (me.editorConfig.customization.reviewPermissions) == 'object'));
me.appOptions.canUseCommentPermissions = me.appOptions.canLicense && !!me.permissions.commentGroups; me.appOptions.canUseCommentPermissions = me.appOptions.canLicense && !!me.permissions.commentGroups;
Common.Utils.UserInfoParser.setParser(me.appOptions.canUseReviewPermissions || me.appOptions.canUseCommentPermissions); AscCommon.UserInfoParser.setParser(me.appOptions.canUseReviewPermissions || me.appOptions.canUseCommentPermissions);
Common.Utils.UserInfoParser.setCurrentName(me.appOptions.user.fullname); AscCommon.UserInfoParser.setCurrentName(me.appOptions.user.fullname);
me.appOptions.canUseReviewPermissions && Common.Utils.UserInfoParser.setReviewPermissions(me.permissions.reviewGroups, me.editorConfig.customization.reviewPermissions); me.appOptions.canUseReviewPermissions && AscCommon.UserInfoParser.setReviewPermissions(me.permissions.reviewGroups, me.editorConfig.customization.reviewPermissions);
me.appOptions.canUseCommentPermissions && Common.Utils.UserInfoParser.setCommentPermissions(me.permissions.commentGroups); me.appOptions.canUseCommentPermissions && AscCommon.UserInfoParser.setCommentPermissions(me.permissions.commentGroups);
me.applyModeCommonElements(); me.applyModeCommonElements();
me.applyModeEditorElements(); me.applyModeEditorElements();
@ -1278,8 +1278,8 @@ define([
onUserConnection: function(change){ onUserConnection: function(change){
if (change && this.appOptions.user.guest && this.appOptions.canRenameAnonymous && (change.asc_getIdOriginal() == this.appOptions.user.id)) { // change name of the current user if (change && this.appOptions.user.guest && this.appOptions.canRenameAnonymous && (change.asc_getIdOriginal() == this.appOptions.user.id)) { // change name of the current user
var name = change.asc_getUserName(); var name = change.asc_getUserName();
if (name && name !== Common.Utils.UserInfoParser.getCurrentName() ) { if (name && name !== AscCommon.UserInfoParser.getCurrentName() ) {
Common.Utils.UserInfoParser.setCurrentName(name); AscCommon.UserInfoParser.setCurrentName(name);
} }
} }
}, },

View file

@ -239,7 +239,7 @@ define([
value = props.asc_getModified(); value = props.asc_getModified();
value ? $('#settings-pe-last-mod').html(value.toLocaleString(_lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleTimeString(_lang, {timeStyle: 'short'})) : $('.display-last-mode').remove(); value ? $('#settings-pe-last-mod').html(value.toLocaleString(_lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleTimeString(_lang, {timeStyle: 'short'})) : $('.display-last-mode').remove();
value = props.asc_getLastModifiedBy(); value = props.asc_getLastModifiedBy();
value ? $('#settings-pe-mod-by').html(Common.Utils.UserInfoParser.getParsedName(value)) : $('.display-mode-by').remove(); value ? $('#settings-pe-mod-by').html(AscCommon.UserInfoParser.getParsedName(value)) : $('.display-mode-by').remove();
value = props.asc_getCreated(); value = props.asc_getCreated();
value ? $('#settings-pe-date').html(value.toLocaleString(_lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleTimeString(_lang, {timeStyle: 'short'})) : $('.display-created-date').remove(); value ? $('#settings-pe-date').html(value.toLocaleString(_lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleTimeString(_lang, {timeStyle: 'short'})) : $('.display-created-date').remove();
value = props.asc_getCreator(); value = props.asc_getCreator();

View file

@ -175,7 +175,7 @@ define([
}, },
getUserName: function (username) { getUserName: function (username) {
return Common.Utils.String.htmlEncode(Common.Utils.UserInfoParser.getParsedName(username)); return Common.Utils.String.htmlEncode(AscCommon.UserInfoParser.getParsedName(username));
}, },
showPageTable: function() { showPageTable: function() {

View file

@ -1088,7 +1088,7 @@ define([
if (usersStore){ if (usersStore){
var rec = usersStore.findUser(id); var rec = usersStore.findUser(id);
if (rec) if (rec)
return Common.Utils.UserInfoParser.getParsedName(rec.get('username')); return AscCommon.UserInfoParser.getParsedName(rec.get('username'));
} }
return me.guestText; return me.guestText;
}; };

View file

@ -1082,11 +1082,11 @@ define([
this.appOptions.canUseReviewPermissions = this.appOptions.canLicense && (!!this.permissions.reviewGroups || this.appOptions.canUseReviewPermissions = this.appOptions.canLicense && (!!this.permissions.reviewGroups ||
this.appOptions.canLicense && this.editorConfig.customization && this.editorConfig.customization.reviewPermissions && (typeof (this.editorConfig.customization.reviewPermissions) == 'object')); this.appOptions.canLicense && this.editorConfig.customization && this.editorConfig.customization.reviewPermissions && (typeof (this.editorConfig.customization.reviewPermissions) == 'object'));
this.appOptions.canUseCommentPermissions = this.appOptions.canLicense && !!this.permissions.commentGroups; this.appOptions.canUseCommentPermissions = this.appOptions.canLicense && !!this.permissions.commentGroups;
Common.Utils.UserInfoParser.setParser(this.appOptions.canUseReviewPermissions || this.appOptions.canUseCommentPermissions); AscCommon.UserInfoParser.setParser(this.appOptions.canUseReviewPermissions || this.appOptions.canUseCommentPermissions);
Common.Utils.UserInfoParser.setCurrentName(this.appOptions.user.fullname); AscCommon.UserInfoParser.setCurrentName(this.appOptions.user.fullname);
this.appOptions.canUseReviewPermissions && Common.Utils.UserInfoParser.setReviewPermissions(this.permissions.reviewGroups, this.editorConfig.customization.reviewPermissions); this.appOptions.canUseReviewPermissions && AscCommon.UserInfoParser.setReviewPermissions(this.permissions.reviewGroups, this.editorConfig.customization.reviewPermissions);
this.appOptions.canUseCommentPermissions && Common.Utils.UserInfoParser.setCommentPermissions(this.permissions.commentGroups); this.appOptions.canUseCommentPermissions && AscCommon.UserInfoParser.setCommentPermissions(this.permissions.commentGroups);
this.headerView.setUserName(Common.Utils.UserInfoParser.getParsedName(Common.Utils.UserInfoParser.getCurrentName())); this.headerView.setUserName(AscCommon.UserInfoParser.getParsedName(AscCommon.UserInfoParser.getCurrentName()));
} else } else
this.appOptions.canModifyFilter = true; this.appOptions.canModifyFilter = true;
@ -2267,10 +2267,10 @@ define([
onUserConnection: function(change){ onUserConnection: function(change){
if (change && this.appOptions.user.guest && this.appOptions.canRenameAnonymous && (change.asc_getIdOriginal() == this.appOptions.user.id)) { // change name of the current user if (change && this.appOptions.user.guest && this.appOptions.canRenameAnonymous && (change.asc_getIdOriginal() == this.appOptions.user.id)) { // change name of the current user
var name = change.asc_getUserName(); var name = change.asc_getUserName();
if (name && name !== Common.Utils.UserInfoParser.getCurrentName() ) { if (name && name !== AscCommon.UserInfoParser.getCurrentName() ) {
this._renameDialog && this._renameDialog.close(); this._renameDialog && this._renameDialog.close();
Common.Utils.UserInfoParser.setCurrentName(name); AscCommon.UserInfoParser.setCurrentName(name);
this.headerView.setUserName(Common.Utils.UserInfoParser.getParsedName(name)); this.headerView.setUserName(AscCommon.UserInfoParser.getParsedName(name));
var idx1 = name.lastIndexOf('('), var idx1 = name.lastIndexOf('('),
idx2 = name.lastIndexOf(')'), idx2 = name.lastIndexOf(')'),

View file

@ -1932,7 +1932,7 @@ define([
visible = this._ShowHideInfoItem(this.lblModifyDate, !!value) || visible; visible = this._ShowHideInfoItem(this.lblModifyDate, !!value) || visible;
value = props.asc_getLastModifiedBy(); value = props.asc_getLastModifiedBy();
if (value) if (value)
this.lblModifyBy.text(Common.Utils.UserInfoParser.getParsedName(value)); this.lblModifyBy.text(AscCommon.UserInfoParser.getParsedName(value));
visible = this._ShowHideInfoItem(this.lblModifyBy, !!value) || visible; visible = this._ShowHideInfoItem(this.lblModifyBy, !!value) || visible;
$('tr.divider.modify', this.el)[visible?'show':'hide'](); $('tr.divider.modify', this.el)[visible?'show':'hide']();

View file

@ -822,7 +822,7 @@ define([ 'text!spreadsheeteditor/main/app/template/FormatRulesManagerDlg.templa
if (usersStore){ if (usersStore){
var rec = usersStore.findUser(id); var rec = usersStore.findUser(id);
if (rec) if (rec)
return Common.Utils.UserInfoParser.getParsedName(rec.get('username')); return AscCommon.UserInfoParser.getParsedName(rec.get('username'));
} }
return this.guestText; return this.guestText;
}, },

View file

@ -381,7 +381,7 @@ define([ 'text!spreadsheeteditor/main/app/template/NameManagerDlg.template',
if (usersStore){ if (usersStore){
var rec = usersStore.findUser(id); var rec = usersStore.findUser(id);
if (rec) if (rec)
return Common.Utils.UserInfoParser.getParsedName(rec.get('username')); return AscCommon.UserInfoParser.getParsedName(rec.get('username'));
} }
return this.guestText; return this.guestText;
}, },

View file

@ -300,7 +300,7 @@ define([
if (usersStore){ if (usersStore){
var rec = usersStore.findUser(id); var rec = usersStore.findUser(id);
if (rec) if (rec)
return Common.Utils.UserInfoParser.getParsedName(rec.get('username')); return AscCommon.UserInfoParser.getParsedName(rec.get('username'));
} }
return this.guestText; return this.guestText;
}, },

View file

@ -775,10 +775,10 @@ define([
me.appOptions.canUseReviewPermissions = me.appOptions.canLicense && (!!me.permissions.reviewGroups || me.appOptions.canUseReviewPermissions = me.appOptions.canLicense && (!!me.permissions.reviewGroups ||
me.editorConfig.customization && me.editorConfig.customization.reviewPermissions && (typeof (me.editorConfig.customization.reviewPermissions) == 'object')); me.editorConfig.customization && me.editorConfig.customization.reviewPermissions && (typeof (me.editorConfig.customization.reviewPermissions) == 'object'));
me.appOptions.canUseCommentPermissions = me.appOptions.canLicense && !!me.permissions.commentGroups; me.appOptions.canUseCommentPermissions = me.appOptions.canLicense && !!me.permissions.commentGroups;
Common.Utils.UserInfoParser.setParser(me.appOptions.canUseReviewPermissions || me.appOptions.canUseCommentPermissions); AscCommon.UserInfoParser.setParser(me.appOptions.canUseReviewPermissions || me.appOptions.canUseCommentPermissions);
Common.Utils.UserInfoParser.setCurrentName(me.appOptions.user.fullname); AscCommon.UserInfoParser.setCurrentName(me.appOptions.user.fullname);
me.appOptions.canUseReviewPermissions && Common.Utils.UserInfoParser.setReviewPermissions(me.permissions.reviewGroups, me.editorConfig.customization.reviewPermissions); me.appOptions.canUseReviewPermissions && AscCommon.UserInfoParser.setReviewPermissions(me.permissions.reviewGroups, me.editorConfig.customization.reviewPermissions);
me.appOptions.canUseCommentPermissions && Common.Utils.UserInfoParser.setCommentPermissions(me.permissions.commentGroups); me.appOptions.canUseCommentPermissions && AscCommon.UserInfoParser.setCommentPermissions(me.permissions.commentGroups);
} }
me.appOptions.canRequestEditRights = me.editorConfig.canRequestEditRights; me.appOptions.canRequestEditRights = me.editorConfig.canRequestEditRights;
@ -1483,8 +1483,8 @@ define([
onUserConnection: function(change){ onUserConnection: function(change){
if (change && this.appOptions.user.guest && this.appOptions.canRenameAnonymous && (change.asc_getIdOriginal() == this.appOptions.user.id)) { // change name of the current user if (change && this.appOptions.user.guest && this.appOptions.canRenameAnonymous && (change.asc_getIdOriginal() == this.appOptions.user.id)) { // change name of the current user
var name = change.asc_getUserName(); var name = change.asc_getUserName();
if (name && name !== Common.Utils.UserInfoParser.getCurrentName() ) { if (name && name !== AscCommon.UserInfoParser.getCurrentName() ) {
Common.Utils.UserInfoParser.setCurrentName(name); AscCommon.UserInfoParser.setCurrentName(name);
} }
} }
}, },

View file

@ -306,7 +306,7 @@ define([
value = props.asc_getModified(); value = props.asc_getModified();
value ? $('#settings-sse-last-mod').html(value.toLocaleString(_lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleTimeString(_lang, {timeStyle: 'short'})) : $('.display-last-mode').remove(); value ? $('#settings-sse-last-mod').html(value.toLocaleString(_lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleTimeString(_lang, {timeStyle: 'short'})) : $('.display-last-mode').remove();
value = props.asc_getLastModifiedBy(); value = props.asc_getLastModifiedBy();
value ? $('#settings-sse-mod-by').html(Common.Utils.UserInfoParser.getParsedName(value)) : $('.display-mode-by').remove(); value ? $('#settings-sse-mod-by').html(AscCommon.UserInfoParser.getParsedName(value)) : $('.display-mode-by').remove();
value = props.asc_getCreated(); value = props.asc_getCreated();
value ? $('#settings-sse-date').html(value.toLocaleString(_lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleTimeString(_lang, {timeStyle: 'short'})) : $('.display-created-date').remove(); value ? $('#settings-sse-date').html(value.toLocaleString(_lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleTimeString(_lang, {timeStyle: 'short'})) : $('.display-created-date').remove();
value = props.asc_getCreator(); value = props.asc_getCreator();

View file

@ -249,7 +249,7 @@ define([
}, },
getUserName: function (username) { getUserName: function (username) {
return Common.Utils.String.htmlEncode(Common.Utils.UserInfoParser.getParsedName(username)); return Common.Utils.String.htmlEncode(AscCommon.UserInfoParser.getParsedName(username));
}, },
showInsertImage: function () { showInsertImage: function () {