From ddf25e02e33c7bb187df8e8ab325117ce0c2551d Mon Sep 17 00:00:00 2001 From: yuri Date: Mon, 14 Nov 2016 10:39:18 +0200 Subject: [PATCH 1/8] email: has attachment filter --- application/Espo/Resources/i18n/en_US/Email.json | 3 ++- application/Espo/Resources/layouts/Email/filters.json | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/application/Espo/Resources/i18n/en_US/Email.json b/application/Espo/Resources/i18n/en_US/Email.json index 8315849391..6b866a755d 100644 --- a/application/Espo/Resources/i18n/en_US/Email.json +++ b/application/Espo/Resources/i18n/en_US/Email.json @@ -33,7 +33,8 @@ "sentBy": "Sent by (User)", "folder": "Folder", "inboundEmails": "Group Accounts", - "emailAccounts": "Personal Accounts" + "emailAccounts": "Personal Accounts", + "hasAttachment": "Has Attachment" }, "links": { "replied": "Replied", diff --git a/application/Espo/Resources/layouts/Email/filters.json b/application/Espo/Resources/layouts/Email/filters.json index a735645985..cf99b9296b 100644 --- a/application/Espo/Resources/layouts/Email/filters.json +++ b/application/Espo/Resources/layouts/Email/filters.json @@ -12,6 +12,7 @@ "sentBy", "users", "createdAt", + "hasAttachment", "inboundEmails", "emailAccounts" ] From 6b0a280e2c9e08440569ebf387961031d9077136 Mon Sep 17 00:00:00 2001 From: yuri Date: Mon, 14 Nov 2016 12:44:36 +0200 Subject: [PATCH 2/8] fix layout swaping --- client/src/views/admin/layouts/grid.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/client/src/views/admin/layouts/grid.js b/client/src/views/admin/layouts/grid.js index 78347acd64..630d9a7415 100644 --- a/client/src/views/admin/layouts/grid.js +++ b/client/src/views/admin/layouts/grid.js @@ -225,9 +225,17 @@ Espo.define('views/admin/layouts/grid', 'views/admin/layouts/base', function (De } } - if ($(this).data('full-width')) { - $(ui.draggable).data('full-width', true).attr('data-full-width', true); - } + var fullWidth = $(this).data('fullWidth'); + + /*if () { + $(ui.draggable).data('fullWidth', true).attr('data-full-width', true); + }*/ + + $(this).data('fullWidth', $(ui.draggable).data('fullWidth')); + $(ui.draggable).data('fullWidth', fullWidth); + + $(this).attr('data-full-width', $(ui.draggable).attr('data-full-width')); + $(ui.draggable).attr('data-full-width', fullWidth); ui.draggable.css({ top: 0, From bc64effb144fc2a82489ce108ef38165ce3312c0 Mon Sep 17 00:00:00 2001 From: yuri Date: Mon, 14 Nov 2016 13:23:22 +0200 Subject: [PATCH 3/8] cleanup --- client/src/views/admin/layouts/grid.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/client/src/views/admin/layouts/grid.js b/client/src/views/admin/layouts/grid.js index 630d9a7415..ce09f474e2 100644 --- a/client/src/views/admin/layouts/grid.js +++ b/client/src/views/admin/layouts/grid.js @@ -227,10 +227,6 @@ Espo.define('views/admin/layouts/grid', 'views/admin/layouts/base', function (De var fullWidth = $(this).data('fullWidth'); - /*if () { - $(ui.draggable).data('fullWidth', true).attr('data-full-width', true); - }*/ - $(this).data('fullWidth', $(ui.draggable).data('fullWidth')); $(ui.draggable).data('fullWidth', fullWidth); From a683e6bdf803595e0d82d23ca63915c291ee8bb3 Mon Sep 17 00:00:00 2001 From: yuri Date: Tue, 15 Nov 2016 12:15:01 +0200 Subject: [PATCH 4/8] improve export --- client/src/views/record/list.js | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/client/src/views/record/list.js b/client/src/views/record/list.js index 67011529c6..c106ee29e0 100644 --- a/client/src/views/record/list.js +++ b/client/src/views/record/list.js @@ -299,25 +299,34 @@ Espo.define('views/record/list', 'view', function (Dep) { } }, - export: function () { - var data = {}; - if (this.allResultIsChecked) { - data.where = this.collection.getWhere(); - data.selectData = this.collection.data || {}; - data.byWhere = true; - } else { - data.ids = this.checkedList; + export: function (data, url, fieldList) { + if (!data) { + data = {}; + if (this.allResultIsChecked) { + data.where = this.collection.getWhere(); + data.selectData = this.collection.data || {}; + data.byWhere = true; + } else { + data.ids = this.checkedList; + } } - this.createView('dialogExport', 'views/export/modals/export', { + var url = url || this.scope + '/action/export'; + + var o = { scope: this.scope - }, function (view) { + }; + if (fieldList) { + o.fieldList = fieldList; + } + + this.createView('dialogExport', 'views/export/modals/export', o, function (view) { view.render(); this.listenToOnce(view, 'proceed', function (dialogData) { if (dialogData.useCustomFieldList) { data.attributeList = dialogData.attributeList; } - this.ajaxPostRequest(this.scope + '/action/export', data).then(function (data) { + this.ajaxPostRequest(url, data).then(function (data) { if ('id' in data) { window.location = this.getBasePath() + '?entryPoint=download&id=' + data.id; } From e0128bf54f581ff253bf79ab7e1b41d6914b539a Mon Sep 17 00:00:00 2001 From: yuri Date: Wed, 16 Nov 2016 11:17:46 +0200 Subject: [PATCH 5/8] contact-document relation --- .../Espo/Modules/Crm/Resources/i18n/en_US/Contact.json | 3 ++- .../Espo/Modules/Crm/Resources/i18n/en_US/Document.json | 3 ++- .../Modules/Crm/Resources/metadata/entityDefs/Contact.json | 6 ++++++ .../Modules/Crm/Resources/metadata/entityDefs/Document.json | 5 +++++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/application/Espo/Modules/Crm/Resources/i18n/en_US/Contact.json b/application/Espo/Modules/Crm/Resources/i18n/en_US/Contact.json index be519032a6..31f8f2f537 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/en_US/Contact.json +++ b/application/Espo/Modules/Crm/Resources/i18n/en_US/Contact.json @@ -28,7 +28,8 @@ "accounts": "Accounts", "casesPrimary": "Cases (Primary)", "portalUser": "Portal User", - "originalLead": "Original Lead" + "originalLead": "Original Lead", + "documents": "Documents" }, "labels": { "Create Contact": "Create Contact" diff --git a/application/Espo/Modules/Crm/Resources/i18n/en_US/Document.json b/application/Espo/Modules/Crm/Resources/i18n/en_US/Document.json index daa4bc6299..1456637bff 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/en_US/Document.json +++ b/application/Espo/Modules/Crm/Resources/i18n/en_US/Document.json @@ -19,7 +19,8 @@ "accounts": "Accounts", "opportunities": "Opportunities", "folder": "Folder", - "leads": "Leads" + "leads": "Leads", + "contacts": "Contacts" }, "options": { "status": { diff --git a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Contact.json b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Contact.json index 4681314760..d35bd6d647 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Contact.json +++ b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Contact.json @@ -297,6 +297,12 @@ "type": "hasOne", "entity": "Lead", "foreign": "createdContact" + }, + "documents": { + "type": "hasMany", + "entity": "Document", + "foreign": "contacts", + "audited": true } }, "collection": { diff --git a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Document.json b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Document.json index faab7c295d..86697c277c 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Document.json +++ b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Document.json @@ -96,6 +96,11 @@ "entity": "Lead", "foreign": "documents" }, + "contacts": { + "type": "hasMany", + "entity": "Contact", + "foreign": "documents" + }, "createdBy": { "type": "belongsTo", "entity": "User" From 4e2e3448920c1ea2f9598dbc98eb65218d1ea1f6 Mon Sep 17 00:00:00 2001 From: yuri Date: Wed, 16 Nov 2016 11:45:31 +0200 Subject: [PATCH 6/8] industry field additions --- .../Espo/Modules/Crm/Resources/i18n/en_US/Account.json | 5 ++++- .../Modules/Crm/Resources/metadata/entityDefs/Account.json | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/application/Espo/Modules/Crm/Resources/i18n/en_US/Account.json b/application/Espo/Modules/Crm/Resources/i18n/en_US/Account.json index 8f1198200b..eacd243432 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/en_US/Account.json +++ b/application/Espo/Modules/Crm/Resources/i18n/en_US/Account.json @@ -65,14 +65,17 @@ "Marketing": "Marketing", "Publishing": "Publishing", "Real Estate": "Real Estate", + "Retail": "Retail", "Service": "Service", + "Support": "Support", "Sports": "Sports", "Software": "Software", "Technology": "Technology", "Telecommunications": "Telecommunications", "Television": "Television", "Transportation": "Transportation", - "Venture Capital": "Venture Capital" + "Venture Capital": "Venture Capital", + "Wholesale": "Wholesale" } }, "labels": { diff --git a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Account.json b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Account.json index 941de0a03c..d85458340d 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Account.json +++ b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Account.json @@ -51,14 +51,17 @@ "Marketing", "Publishing", "Real Estate", + "Retail", "Service", "Sports", "Software", + "Support", "Technology", "Telecommunications", "Television", "Transportation", - "Venture Capital" + "Venture Capital", + "Wholesale" ], "default": "", "isSorted": true From c99a1261d5dc5b1c0b2d85096bd63b56d036551e Mon Sep 17 00:00:00 2001 From: yuri Date: Wed, 16 Nov 2016 11:54:17 +0200 Subject: [PATCH 7/8] lead industry field --- .../Crm/Resources/i18n/en_US/Lead.json | 3 +- .../Crm/Resources/layouts/Lead/detail.json | 1 + .../Crm/Resources/layouts/Lead/filters.json | 1 + .../Resources/metadata/entityDefs/Lead.json | 7 ++++ .../crm/src/views/lead/fields/industry.js | 42 +++++++++++++++++++ 5 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 client/modules/crm/src/views/lead/fields/industry.js diff --git a/application/Espo/Modules/Crm/Resources/i18n/en_US/Lead.json b/application/Espo/Modules/Crm/Resources/i18n/en_US/Lead.json index 685e69cdc3..67bf0404f1 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/en_US/Lead.json +++ b/application/Espo/Modules/Crm/Resources/i18n/en_US/Lead.json @@ -23,7 +23,8 @@ "createdOpportunity": "Opportunity", "campaign": "Campaign", "targetLists": "Target Lists", - "targetList": "Target List" + "targetList": "Target List", + "industry": "Industry" }, "links": { "targetLists": "Target Lists", diff --git a/application/Espo/Modules/Crm/Resources/layouts/Lead/detail.json b/application/Espo/Modules/Crm/Resources/layouts/Lead/detail.json index 6fde5d1bac..51a6c3a786 100644 --- a/application/Espo/Modules/Crm/Resources/layouts/Lead/detail.json +++ b/application/Espo/Modules/Crm/Resources/layouts/Lead/detail.json @@ -13,6 +13,7 @@ "rows": [ [{"name":"status"},{"name":"source"}], [{"name":"opportunityAmount"},{"name":"campaign"}], + [false, {"name":"industry"}], [{"name":"description", "fullWidth": true}] ] } diff --git a/application/Espo/Modules/Crm/Resources/layouts/Lead/filters.json b/application/Espo/Modules/Crm/Resources/layouts/Lead/filters.json index 061bcfaaf0..aba17ffe48 100644 --- a/application/Espo/Modules/Crm/Resources/layouts/Lead/filters.json +++ b/application/Espo/Modules/Crm/Resources/layouts/Lead/filters.json @@ -8,6 +8,7 @@ "status", "source", "opportunityAmountConverted", + "industry", "phoneNumber", "targetLists", "teams", diff --git a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Lead.json b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Lead.json index bbb443a329..f59cb8df2c 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Lead.json +++ b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Lead.json @@ -39,6 +39,13 @@ "options": ["", "Call", "Email", "Existing Customer", "Partner", "Public Relations", "Web Site", "Campaign", "Other"], "default": "" }, + "industry": { + "type": "enum", + "view": "crm:views/lead/fields/industry", + "customizationOptionsDisabled": true, + "default": "", + "isSorted": true + }, "opportunityAmount": { "type": "currency", "audited": true diff --git a/client/modules/crm/src/views/lead/fields/industry.js b/client/modules/crm/src/views/lead/fields/industry.js new file mode 100644 index 0000000000..feb478cea3 --- /dev/null +++ b/client/modules/crm/src/views/lead/fields/industry.js @@ -0,0 +1,42 @@ +/************************************************************************ + * This file is part of EspoCRM. + * + * EspoCRM - Open Source CRM application. + * Copyright (C) 2014-2015 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/. + * + * The interactive user interfaces in modified source and object code versions + * of this program must display Appropriate Legal Notices, as required under + * Section 5 of the GNU General Public License version 3. + * + * 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('crm:views/lead/fields/industry', 'views/fields/enum', function (Dep) { + + return Dep.extend({ + + setup: function () { + this.params.options = this.getMetadata().get('entityDefs.Account.fields.industry.options'); + this.params.translation = 'Account.options.industry'; + + Dep.prototype.setup.call(this); + } + + }); + +}); From 38f44b3e5f37ad160c0859a23d9a2a12358c1226 Mon Sep 17 00:00:00 2001 From: yuri Date: Wed, 16 Nov 2016 13:06:42 +0200 Subject: [PATCH 8/8] cases layout change --- .../Modules/Crm/Resources/layouts/Case/list.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/application/Espo/Modules/Crm/Resources/layouts/Case/list.json b/application/Espo/Modules/Crm/Resources/layouts/Case/list.json index 69afa467b1..b2b2f91736 100644 --- a/application/Espo/Modules/Crm/Resources/layouts/Case/list.json +++ b/application/Espo/Modules/Crm/Resources/layouts/Case/list.json @@ -1,8 +1,8 @@ [ - {"name":"name","width":30,"link":true}, - {"name":"number","width":12}, - {"name":"status", "width":11}, - {"name":"priority", "width":11}, - {"name":"account"}, - {"name":"assignedUser"} + {"name":"name", "link": true}, + {"name":"number", "widthPx": 100}, + {"name":"status", "width": 11}, + {"name":"priority", "width": 11}, + {"name":"account", "width": 18}, + {"name":"assignedUser", "width": 14} ] \ No newline at end of file