diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js index 3cc8595e4..0c5dca4a1 100644 --- a/apps/api/documents/api.js +++ b/apps/api/documents/api.js @@ -62,8 +62,7 @@ user: { id: 'user id', - firstname: 'user first name', - lastname: 'user last name' + name: 'user name' }, recent: [ { diff --git a/apps/common/main/lib/controller/ReviewChanges.js b/apps/common/main/lib/controller/ReviewChanges.js index d0a9b4c2c..c24bb4d33 100644 --- a/apps/common/main/lib/controller/ReviewChanges.js +++ b/apps/common/main/lib/controller/ReviewChanges.js @@ -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; } }, diff --git a/apps/common/main/lib/util/utils.js b/apps/common/main/lib/util/utils.js index 26b80a9df..87be71c2f 100644 --- a/apps/common/main/lib/util/utils.js +++ b/apps/common/main/lib/util/utils.js @@ -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; }; diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 4139d8d51..b23131073 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -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(); diff --git a/apps/documenteditor/mobile/app/controller/Main.js b/apps/documenteditor/mobile/app/controller/Main.js index d9f464be8..f3fdedd3e 100644 --- a/apps/documenteditor/mobile/app/controller/Main.js +++ b/apps/documenteditor/mobile/app/controller/Main.js @@ -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; }, diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index ac838e5da..6b530a4bf 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -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(); diff --git a/apps/presentationeditor/mobile/app/controller/Main.js b/apps/presentationeditor/mobile/app/controller/Main.js index 228d389f2..f14dfdf2d 100644 --- a/apps/presentationeditor/mobile/app/controller/Main.js +++ b/apps/presentationeditor/mobile/app/controller/Main.js @@ -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; }, diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 31691f872..d0c371a1f 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -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(); diff --git a/apps/spreadsheeteditor/mobile/app/controller/Main.js b/apps/spreadsheeteditor/mobile/app/controller/Main.js index 82293b9d9..99bfad4fa 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/Main.js +++ b/apps/spreadsheeteditor/mobile/app/controller/Main.js @@ -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; },