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: { user: {
id: 'user id', id: 'user id',
firstname: 'user first name', name: 'user name'
lastname: 'user last name'
}, },
recent: [ recent: [
{ {

View file

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

View file

@ -605,6 +605,7 @@ Common.Utils.applyCustomization = function(config, elmap) {
Common.Utils.fillUserInfo = function(info, lang, defname) { 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()));
if (_.isEmpty(_user.name)) {
_.isEmpty(_user.firstname) && _.isEmpty(_user.lastname) && (_user.firstname = defname); _.isEmpty(_user.firstname) && _.isEmpty(_user.lastname) && (_user.firstname = defname);
if (_.isEmpty(_user.firstname)) if (_.isEmpty(_user.firstname))
_user.fullname = _user.lastname; _user.fullname = _user.lastname;
@ -612,7 +613,8 @@ Common.Utils.fillUserInfo = function(info, lang, defname) {
_user.fullname = _user.firstname; _user.fullname = _user.firstname;
else else
_user.fullname = /^ru/.test(lang) ? _user.lastname + ' ' + _user.firstname : _user.firstname + ' ' + _user.lastname; _user.fullname = /^ru/.test(lang) ? _user.lastname + ' ' + _user.firstname : _user.firstname + ' ' + _user.lastname;
} else
_user.fullname = _user.name;
return _user; return _user;
}; };

View file

@ -274,8 +274,6 @@ define([
var _user = new Asc.asc_CUserInfo(); var _user = new Asc.asc_CUserInfo();
_user.put_Id(this.appOptions.user.id); _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); _user.put_FullName(this.appOptions.user.fullname);
docInfo = new Asc.asc_CDocInfo(); docInfo = new Asc.asc_CDocInfo();

View file

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

View file

@ -262,8 +262,6 @@ define([
var _user = new Asc.asc_CUserInfo(); var _user = new Asc.asc_CUserInfo();
_user.put_Id(this.appOptions.user.id); _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); _user.put_FullName(this.appOptions.user.fullname);
docInfo = new Asc.asc_CDocInfo(); docInfo = new Asc.asc_CDocInfo();

View file

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

View file

@ -296,8 +296,6 @@ define([
var _user = new Asc.asc_CUserInfo(); var _user = new Asc.asc_CUserInfo();
_user.put_Id(this.appOptions.user.id); _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); _user.put_FullName(this.appOptions.user.fullname);
docInfo = new Asc.asc_CDocInfo(); docInfo = new Asc.asc_CDocInfo();

View file

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