fix naming

This commit is contained in:
yuri
2015-12-02 12:40:27 +02:00
parent 6a9abab7ea
commit c079b256f0
8 changed files with 41 additions and 50 deletions
+8 -7
View File
@@ -25,6 +25,7 @@
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('controllers/admin', ['controller', 'search-manager'], function (Dep, SearchManager) {
return Dep.extend({
@@ -85,7 +86,7 @@ Espo.define('controllers/admin', ['controller', 'search-manager'], function (Dep
this.main('views/settings/edit', {
model: model,
headerTemplate: 'admin/settings/headers/settings',
recordViewName: 'views/admin/settings'
recordView: 'views/admin/settings'
});
}, this);
model.fetch();
@@ -99,7 +100,7 @@ Espo.define('controllers/admin', ['controller', 'search-manager'], function (Dep
this.main('views/settings/edit', {
model: model,
headerTemplate: 'admin/settings/headers/notifications',
recordViewName: 'views/admin/notifications'
recordView: 'views/admin/notifications'
});
}, this);
model.fetch();
@@ -113,7 +114,7 @@ Espo.define('controllers/admin', ['controller', 'search-manager'], function (Dep
this.main('views/settings/edit', {
model: model,
headerTemplate: 'admin/settings/headers/outbound-emails',
recordViewName: 'views/admin/outbound-emails'
recordView: 'views/admin/outbound-emails'
});
}, this);
model.fetch();
@@ -127,7 +128,7 @@ Espo.define('controllers/admin', ['controller', 'search-manager'], function (Dep
this.main('views/settings/edit', {
model: model,
headerTemplate: 'admin/settings/headers/inbound-emails',
recordViewName: 'views/admin/inbound-emails'
recordView: 'views/admin/inbound-emails'
});
}, this);
model.fetch();
@@ -141,7 +142,7 @@ Espo.define('controllers/admin', ['controller', 'search-manager'], function (Dep
this.main('views/settings/edit', {
model: model,
headerTemplate: 'admin/settings/headers/currency',
recordViewName: 'views/admin/currency'
recordView: 'views/admin/currency'
});
}, this);
model.fetch();
@@ -185,7 +186,7 @@ Espo.define('controllers/admin', ['controller', 'search-manager'], function (Dep
this.main('views/settings/edit', {
model: model,
headerTemplate: 'admin/settings/headers/user-interface',
recordViewName: 'views/admin/user-interface'
recordView: 'views/admin/user-interface'
});
}, this);
model.fetch();
@@ -199,7 +200,7 @@ Espo.define('controllers/admin', ['controller', 'search-manager'], function (Dep
this.main('views/settings/edit', {
model: model,
headerTemplate: 'admin/settings/headers/authentication',
recordViewName: 'views/admin/authentication'
recordView: 'views/admin/authentication'
});
}, this);
model.fetch();
+1 -12
View File
@@ -25,6 +25,7 @@
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('controllers/record', 'controller', function (Dep) {
return Dep.extend({
@@ -52,18 +53,6 @@ Espo.define('controllers/record', 'controller', function (Dep) {
return this.viewMap[type] || this.getMetadata().get('clientDefs.' + this.name + '.views.' + type) || Espo.Utils.upperCaseFirst(type);
},
getViews: function (type) {
var views = {};
var recordView = this.getMetadata().get('clientDefs.' + this.name + '.recordViews.' + type);
if (recordView) {
if (!views.body) {
views.body = {};
}
views.body.view = recordView;
}
return views;
},
beforeList: function () {
this.handleCheckAccess('read');
},
+8 -8
View File
@@ -40,9 +40,9 @@ Espo.define('views/detail', 'views/main', function (Dep) {
optionsToPass: ['attributes', 'returnUrl', 'returnDispatchParams'],
headerViewName: 'views/header',
headerView: 'views/header',
recordViewName: 'views/record/detail',
recordView: 'views/record/detail',
addUnfollowButtonToMenu: function () {
this.removeMenuItem('follow', true);
@@ -71,8 +71,8 @@ Espo.define('views/detail', 'views/main', function (Dep) {
setup: function () {
Dep.prototype.setup.call(this);
this.headerViewName = this.options.headerViewName || this.headerViewName;
this.recordViewName = this.options.recordViewName || this.recordViewName;
this.headerView = this.options.headerView || this.headerView;
this.recordView = this.options.recordView || this.recordView;
this.setupHeader();
this.setupRecord();
@@ -89,7 +89,7 @@ Espo.define('views/detail', 'views/main', function (Dep) {
},
setupHeader: function () {
this.createView('header', this.headerViewName, {
this.createView('header', this.headerView, {
model: this.model,
el: '#main > .header'
});
@@ -107,7 +107,7 @@ Espo.define('views/detail', 'views/main', function (Dep) {
},
getRecordViewName: function () {
return this.getMetadata().get('clientDefs.' + this.scope + '.recordViews.detail') || this.recordViewName;
return this.getMetadata().get('clientDefs.' + this.scope + '.recordViews.detail') || this.recordView;
},
handleFollowButton: function () {
@@ -201,7 +201,7 @@ Espo.define('views/detail', 'views/main', function (Dep) {
this.notify('Loading...');
var viewName = this.getMetadata().get('clientDefs.' + scope + '.modalViews.edit') || 'Modals.Edit';
var viewName = this.getMetadata().get('clientDefs.' + scope + '.modalViews.edit') || 'views/modals/edit';
this.createView('quickCreate', viewName, {
scope: scope,
relate: {
@@ -260,7 +260,7 @@ Espo.define('views/detail', 'views/main', function (Dep) {
boolFilterList = boolFilterList.call(this);
}
var viewName = this.getMetadata().get('clientDefs.' + scope + '.modalViews.select') || 'Modals.SelectRecords';
var viewName = this.getMetadata().get('clientDefs.' + scope + '.modalViews.select') || 'views/modals/select-records';
this.notify('Loading...');
this.createView('dialog', viewName, {
+6 -6
View File
@@ -42,20 +42,20 @@ Espo.define('views/edit', 'views/main', function (Dep) {
optionsToPass: ['returnUrl', 'returnDispatchParams', 'attributes'],
headerViewName: 'views/header',
headerView: 'views/header',
recordViewName: 'views/record/edit',
recordView: 'views/record/edit',
setup: function () {
this.headerViewName = this.options.headerViewName || this.headerViewName;
this.recordViewName = this.options.recordViewName || this.recordViewName;
this.headerView = this.options.headerView || this.headerView;
this.recordView = this.options.recordView || this.recordView;
this.setupHeader();
this.setupRecord();
},
setupHeader: function () {
this.createView('header', this.headerViewName, {
this.createView('header', this.headerView, {
model: this.model,
el: '#main > .header'
});
@@ -73,7 +73,7 @@ Espo.define('views/edit', 'views/main', function (Dep) {
},
getRecordViewName: function () {
return this.getMetadata().get('clientDefs.' + this.scope + '.recordViews.edit') || this.recordViewName;
return this.getMetadata().get('clientDefs.' + this.scope + '.recordViews.edit') || this.recordView;
},
getHeader: function () {
+12 -12
View File
@@ -38,11 +38,11 @@ Espo.define('views/list', ['views/main', 'search-manager'], function (Dep, Searc
name: 'List',
headerViewName: 'views/header',
headerView: 'views/header',
searchViewName: 'views/record/search',
searchView: 'views/record/search',
recordViewName: 'views/record/list',
recordView: 'views/record/list',
searchPanel: true,
@@ -61,9 +61,9 @@ Espo.define('views/list', ['views/main', 'search-manager'], function (Dep, Searc
this.searchPanel = false;
}
this.headerViewName = this.options.headerViewName || this.headerViewName;
this.recordViewName = this.options.recordViewName || this.recordViewName;
this.searchViewName = this.options.searchViewName || this.searchViewName;
this.headerView = this.options.headerView || this.headerView;
this.recordView = this.options.recordView || this.recordView;
this.searchView = this.options.searchView || this.searchView;
this.setupHeader();
@@ -84,7 +84,7 @@ Espo.define('views/list', ['views/main', 'search-manager'], function (Dep, Searc
},
setupHeader: function () {
this.createView('header', this.headerViewName, {
this.createView('header', this.headerView, {
collection: this.collection,
el: '#main > .page-header'
});
@@ -110,7 +110,7 @@ Espo.define('views/list', ['views/main', 'search-manager'], function (Dep, Searc
},
setupSearchPanel: function () {
this.createView('search', this.searchViewName, {
this.createView('search', this.searchView, {
collection: this.collection,
el: '#main > .search-container',
searchManager: this.searchManager,
@@ -156,7 +156,7 @@ Espo.define('views/list', ['views/main', 'search-manager'], function (Dep, Searc
},
getRecordViewName: function () {
return this.getMetadata().get('clientDefs.' + this.scope + '.recordViews.list') || this.recordViewName;
return this.getMetadata().get('clientDefs.' + this.scope + '.recordViews.list') || this.recordView;
},
afterRender: function () {
@@ -218,10 +218,10 @@ Espo.define('views/list', ['views/main', 'search-manager'], function (Dep, Searc
var attributes = this.getCreateAttributes() || {};
this.notify('Loading...');
var viewName = this.getMetadata().get('clientDefs.' + this.scope + '.modalViews.edit') || 'Modals.Edit';
this.createView('quickCreate', 'Modals.Edit', {
var viewName = this.getMetadata().get('clientDefs.' + this.scope + '.modalViews.edit') || 'views/modals/edit';
this.createView('quickCreate', 'views/modals/edit', {
scope: this.scope,
attributes: attributes,
attributes: attributes
}, function (view) {
view.render();
view.notify(false);
+4 -4
View File
@@ -38,9 +38,9 @@ Espo.define('views/merge', 'views/main', function (Dep) {
name: 'Merge',
headerViewName: 'views/header',
headerView: 'views/header',
recordViewName: 'views/record/merge',
recordView: 'views/record/merge',
setup: function () {
this.models = this.options.models;
@@ -50,14 +50,14 @@ Espo.define('views/merge', 'views/main', function (Dep) {
},
setupHeader: function () {
this.createView('header', this.headerViewName, {
this.createView('header', this.headerView, {
model: this.model,
el: '#main > .page-header'
});
},
setupRecord: function () {
this.createView('body', this.recordViewName, {
this.createView('body', this.recordView, {
el: '#main > .body',
models: this.models
});
+1
View File
@@ -27,6 +27,7 @@
************************************************************************/
Espo.define('views/record/list', 'view', function (Dep) {
return Dep.extend({
template: 'record/list',
+1 -1
View File
@@ -31,7 +31,7 @@ Espo.define('views/settings/edit', 'views/edit', function (Dep) {
return Dep.extend({
setupHeader: function () {
this.createView('header', this.headerViewName, {
this.createView('header', this.headerView, {
model: this.model,
el: '#main > .header',
template: this.options.headerTemplate