From 094bf69fab3fda4d684cc1817ca7c93bb7313490 Mon Sep 17 00:00:00 2001 From: yuri Date: Thu, 10 Aug 2017 12:31:13 +0300 Subject: [PATCH] contacts panel filters --- .../Espo/Modules/Crm/Resources/i18n/en_US/Contact.json | 3 ++- .../Crm/Resources/metadata/clientDefs/Account.json | 1 + application/Espo/Modules/Crm/SelectManagers/Contact.php | 8 ++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) 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 c997fb799a..c85c3df114 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/en_US/Contact.json +++ b/application/Espo/Modules/Crm/Resources/i18n/en_US/Contact.json @@ -48,6 +48,7 @@ }, "presetFilters": { "portalUsers": "Portal Users", - "notPortalUsers": "Not Portal Users" + "notPortalUsers": "Not Portal Users", + "accountActive": "Active" } } diff --git a/application/Espo/Modules/Crm/Resources/metadata/clientDefs/Account.json b/application/Espo/Modules/Crm/Resources/metadata/clientDefs/Account.json index b8913e0f47..a72b852b69 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/clientDefs/Account.json +++ b/application/Espo/Modules/Crm/Resources/metadata/clientDefs/Account.json @@ -48,6 +48,7 @@ }, "relationshipPanels": { "contacts": { + "filterList": ["all", "accountActive"], "layout":"listForAccount" }, "opportunities":{ diff --git a/application/Espo/Modules/Crm/SelectManagers/Contact.php b/application/Espo/Modules/Crm/SelectManagers/Contact.php index 542d7fdf6e..0093156c00 100644 --- a/application/Espo/Modules/Crm/SelectManagers/Contact.php +++ b/application/Espo/Modules/Crm/SelectManagers/Contact.php @@ -61,5 +61,13 @@ class Contact extends \Espo\Core\SelectManagers\Base } } + protected function filterAccountActive(&$result) + { + if (!array_key_exists('additionalColumnsConditions', $result)) { + $result['additionalColumnsConditions'] = array(); + } + $result['additionalColumnsConditions']['isInactive'] = false; + } + }