From e301514ec6b072ec79d0cabd355474feb65818fa Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Tue, 11 Nov 2014 10:57:40 +0200 Subject: [PATCH] cases changes --- .../Crm/Resources/layouts/Case/list.json | 9 ++++- .../Resources/metadata/entityDefs/Case.json | 3 +- .../crm/src/views/case/fields/contact.js | 40 +++++++++++++++++++ 3 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 frontend/client/modules/crm/src/views/case/fields/contact.js diff --git a/application/Espo/Modules/Crm/Resources/layouts/Case/list.json b/application/Espo/Modules/Crm/Resources/layouts/Case/list.json index 156a723ccd..fcc0c7d09f 100644 --- a/application/Espo/Modules/Crm/Resources/layouts/Case/list.json +++ b/application/Espo/Modules/Crm/Resources/layouts/Case/list.json @@ -1 +1,8 @@ -[{"name":"number","width":15},{"name":"name","width":30,"link":true},{"name":"status","width":15},{"name":"priority","width":15},{"name":"assignedUser","width":15}] \ No newline at end of file +[ + {"name":"number","width":12}, + {"name":"name","width":30,"link":true}, + {"name":"status"}, + {"name":"priority"}, + {"name":"account"}, + {"name":"assignedUser"} +] \ No newline at end of file diff --git a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Case.json b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Case.json index a38338d7d7..70a6298ff7 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Case.json +++ b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Case.json @@ -36,7 +36,8 @@ "type": "link" }, "contact": { - "type": "link" + "type": "link", + "view": "Crm:Case.Fields.Contact" }, "createdAt": { "type": "datetime", diff --git a/frontend/client/modules/crm/src/views/case/fields/contact.js b/frontend/client/modules/crm/src/views/case/fields/contact.js new file mode 100644 index 0000000000..87e125d1ff --- /dev/null +++ b/frontend/client/modules/crm/src/views/case/fields/contact.js @@ -0,0 +1,40 @@ +/************************************************************************ + * This file is part of EspoCRM. + * + * EspoCRM - Open Source CRM application. + * Copyright (C) 2014 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko + * Website: http://www.espocrm.com + * + * EspoCRM is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * EspoCRM is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with EspoCRM. If not, see http://www.gnu.org/licenses/. + ************************************************************************/ + +Espo.define('Crm:Views.Case.Fields.Contact', 'Views.Fields.Link', function (Dep) { + + return Dep.extend({ + + getSelectFilters: function () { + if (this.model.get('accountId')) { + return { + 'account': { + type: 'equals', + field: 'accountId', + value: this.model.get('accountId'), + valueName: this.model.get('accountName'), + } + }; + } + }, + }); + +});