Change format for editorConfig->user (use "name" instead of "lastname" and "firstname").

This commit is contained in:
Julia Radzhabova 2016-11-18 14:48:24 +03:00
parent e6af089bda
commit 7392d30a9d
9 changed files with 41 additions and 39 deletions

View file

@ -62,8 +62,7 @@
user: {
id: 'user id',
firstname: 'user first name',
lastname: 'user last name'
name: 'user name'
},
recent: [
{

View file

@ -99,8 +99,6 @@ define([
this.setApi(api);
if (data) {
this.currentUserId = data.config.user.id;
this.currentUserName = data.config.user.name;
this.sdkViewName = data['sdkviewname'] || this.sdkViewName;
}
},

View file

@ -605,14 +605,16 @@ Common.Utils.applyCustomization = function(config, elmap) {
Common.Utils.fillUserInfo = function(info, lang, defname) {
var _user = info || {};
!_user.id && (_user.id = ('uid-' + Date.now()));
_.isEmpty(_user.firstname) && _.isEmpty(_user.lastname) && (_user.firstname = defname);
if (_.isEmpty(_user.firstname))
_user.fullname = _user.lastname;
else if (_.isEmpty(_user.lastname))
_user.fullname = _user.firstname;
else
_user.fullname = /^ru/.test(lang) ? _user.lastname + ' ' + _user.firstname : _user.firstname + ' ' + _user.lastname;
if (_.isEmpty(_user.name)) {
_.isEmpty(_user.firstname) && _.isEmpty(_user.lastname) && (_user.firstname = defname);
if (_.isEmpty(_user.firstname))
_user.fullname = _user.lastname;
else if (_.isEmpty(_user.lastname))
_user.fullname = _user.firstname;
else
_user.fullname = /^ru/.test(lang) ? _user.lastname + ' ' + _user.firstname : _user.firstname + ' ' + _user.lastname;
} else
_user.fullname = _user.name;
return _user;
};

View file

@ -274,8 +274,6 @@ define([
var _user = new Asc.asc_CUserInfo();
_user.put_Id(this.appOptions.user.id);
_user.put_FirstName(this.appOptions.user.firstname);
_user.put_LastName(this.appOptions.user.lastname);
_user.put_FullName(this.appOptions.user.fullname);
docInfo = new Asc.asc_CDocInfo();

View file

@ -111,8 +111,6 @@ Ext.define('DE.controller.Main', {
var _user = new Asc.asc_CUserInfo();
_user.put_Id(this.editorConfig.user.id);
_user.put_FirstName(this.editorConfig.user.firstname);
_user.put_LastName(this.editorConfig.user.lastname);
_user.put_FullName(this.editorConfig.user.fullname);
var docInfo = new Asc.asc_CDocInfo();
@ -375,11 +373,16 @@ Ext.define('DE.controller.Main', {
_fillUserInfo: function(info, lang, defname) {
var _user = info || {};
!_user.id && (_user.id = ('uid-' + Date.now()));
_.isEmpty(_user.firstname) && _.isEmpty(_user.lastname)
&& (_user.firstname = defname);
_user.fullname = /^ru/.test(lang) ?
_user.lastname + ' ' + _user.firstname : _user.firstname + ' ' + _user.lastname;
if (_.isEmpty(_user.name)) {
_.isEmpty(_user.firstname) && _.isEmpty(_user.lastname) && (_user.firstname = defname);
if (_.isEmpty(_user.firstname))
_user.fullname = _user.lastname;
else if (_.isEmpty(_user.lastname))
_user.fullname = _user.firstname;
else
_user.fullname = /^ru/.test(lang) ? _user.lastname + ' ' + _user.firstname : _user.firstname + ' ' + _user.lastname;
} else
_user.fullname = _user.name;
return _user;
},

View file

@ -262,8 +262,6 @@ define([
var _user = new Asc.asc_CUserInfo();
_user.put_Id(this.appOptions.user.id);
_user.put_FirstName(this.appOptions.user.firstname);
_user.put_LastName(this.appOptions.user.lastname);
_user.put_FullName(this.appOptions.user.fullname);
docInfo = new Asc.asc_CDocInfo();

View file

@ -110,8 +110,6 @@ Ext.define('PE.controller.Main', {
var _user = new Asc.asc_CUserInfo();
_user.put_Id(this.editorConfig.user.id);
_user.put_FirstName(this.editorConfig.user.firstname);
_user.put_LastName(this.editorConfig.user.lastname);
_user.put_FullName(this.editorConfig.user.fullname);
var docInfo = new Asc.asc_CDocInfo();
@ -327,11 +325,16 @@ Ext.define('PE.controller.Main', {
_fillUserInfo: function(info, lang, defname) {
var _user = info || {};
!_user.id && (_user.id = ('uid-' + Date.now()));
_.isEmpty(_user.firstname) && _.isEmpty(_user.lastname)
&& (_user.firstname = defname);
_user.fullname = /^ru/.test(lang) ?
_user.lastname + ' ' + _user.firstname : _user.firstname + ' ' + _user.lastname;
if (_.isEmpty(_user.name)) {
_.isEmpty(_user.firstname) && _.isEmpty(_user.lastname) && (_user.firstname = defname);
if (_.isEmpty(_user.firstname))
_user.fullname = _user.lastname;
else if (_.isEmpty(_user.lastname))
_user.fullname = _user.firstname;
else
_user.fullname = /^ru/.test(lang) ? _user.lastname + ' ' + _user.firstname : _user.firstname + ' ' + _user.lastname;
} else
_user.fullname = _user.name;
return _user;
},

View file

@ -296,8 +296,6 @@ define([
var _user = new Asc.asc_CUserInfo();
_user.put_Id(this.appOptions.user.id);
_user.put_FirstName(this.appOptions.user.firstname);
_user.put_LastName(this.appOptions.user.lastname);
_user.put_FullName(this.appOptions.user.fullname);
docInfo = new Asc.asc_CDocInfo();

View file

@ -112,8 +112,6 @@ Ext.define('SSE.controller.Main', {
var _user = new Asc.asc_CUserInfo();
_user.put_Id(this.editorConfig.user.id);
_user.put_FirstName(this.editorConfig.user.firstname);
_user.put_LastName(this.editorConfig.user.lastname);
_user.put_FullName(this.editorConfig.user.fullname);
docInfo = new Asc.asc_CDocInfo();
@ -348,11 +346,16 @@ Ext.define('SSE.controller.Main', {
_fillUserInfo: function(info, lang, defname) {
var _user = info || {};
!_user.id && (_user.id = ('uid-' + Date.now()));
_.isEmpty(_user.firstname) && _.isEmpty(_user.lastname)
&& (_user.firstname = defname);
_user.fullname = /^ru/.test(lang) ?
_user.lastname + ' ' + _user.firstname : _user.firstname + ' ' + _user.lastname;
if (_.isEmpty(_user.name)) {
_.isEmpty(_user.firstname) && _.isEmpty(_user.lastname) && (_user.firstname = defname);
if (_.isEmpty(_user.firstname))
_user.fullname = _user.lastname;
else if (_.isEmpty(_user.lastname))
_user.fullname = _user.firstname;
else
_user.fullname = /^ru/.test(lang) ? _user.lastname + ' ' + _user.firstname : _user.firstname + ' ' + _user.lastname;
} else
_user.fullname = _user.name;
return _user;
},