diff --git a/application/Espo/Controllers/EntityManager.php b/application/Espo/Controllers/EntityManager.php index ccf14c8a0c..4faa98ba45 100644 --- a/application/Espo/Controllers/EntityManager.php +++ b/application/Espo/Controllers/EntityManager.php @@ -89,6 +89,9 @@ class EntityManager extends \Espo\Core\Controllers\Base if (!empty($data['iconClass'])) { $params['iconClass'] = $data['iconClass']; } + if (isset($data['fullTextSearch'])) { + $params['fullTestSearch'] = $data['fullTextSearch']; + } $params['kanbanViewMode'] = !empty($data['kanbanViewMode']); if (!empty($data['kanbanStatusIgnoreList'])) { diff --git a/application/Espo/Core/Utils/EntityManager.php b/application/Espo/Core/Utils/EntityManager.php index 854dc18796..2e0861ec09 100644 --- a/application/Espo/Core/Utils/EntityManager.php +++ b/application/Espo/Core/Utils/EntityManager.php @@ -403,6 +403,16 @@ class EntityManager $this->getMetadata()->set('entityDefs', $name, $entityDefsData); } + + if (isset($data['fullTextSearch'])) { + $entityDefsData = [ + 'collection' => [ + 'fullTextSearch' => !!$data['fullTextSearch'] + ] + ]; + $this->getMetadata()->set('entityDefs', $name, $entityDefsData); + } + if (array_key_exists('kanbanStatusIgnoreList', $data)) { $scopeData['kanbanStatusIgnoreList'] = $data['kanbanStatusIgnoreList']; $this->getMetadata()->set('scopes', $name, $scopeData); diff --git a/application/Espo/Resources/i18n/en_US/EntityManager.json b/application/Espo/Resources/i18n/en_US/EntityManager.json index 275872bfbe..adbaee8a6c 100644 --- a/application/Espo/Resources/i18n/en_US/EntityManager.json +++ b/application/Espo/Resources/i18n/en_US/EntityManager.json @@ -32,7 +32,8 @@ "color": "Color", "kanbanViewMode": "Kanban View", "kanbanStatusIgnoreList": "Ignored groups in Kanban view", - "iconClass": "Icon" + "iconClass": "Icon", + "fullTextSearch": "Full-Text Search" }, "options": { "type": { @@ -68,6 +69,7 @@ "disabled": "Check if you don't need this entity in your system.", "linkAudited": "Creating related record and linking with existing record will be logged in Stream.", "linkMultipleField": "Link Multiple field provides a handy way to edit relations. Don't use it if you can have a large number of related records.", - "entityType": "Base Plus - has Activities, History and Tasks panels.\n\nEvent - available in Calendar and Activities panel." + "entityType": "Base Plus - has Activities, History and Tasks panels.\n\nEvent - available in Calendar and Activities panel.", + "fullTextSearch": "Running rebuild required." } } diff --git a/client/res/templates/admin/entity-manager/modals/edit-entity.tpl b/client/res/templates/admin/entity-manager/modals/edit-entity.tpl index 45ed68121f..ea5e9445bf 100644 --- a/client/res/templates/admin/entity-manager/modals/edit-entity.tpl +++ b/client/res/templates/admin/entity-manager/modals/edit-entity.tpl @@ -77,6 +77,15 @@ +
+
+ +
+ {{{fullTextSearch}}} +
+
+
+
diff --git a/client/src/views/admin/entity-manager/modals/edit-entity.js b/client/src/views/admin/entity-manager/modals/edit-entity.js index c28b08e78c..bb9e0f0a42 100644 --- a/client/src/views/admin/entity-manager/modals/edit-entity.js +++ b/client/src/views/admin/entity-manager/modals/edit-entity.js @@ -64,7 +64,8 @@ Espo.define('views/admin/entity-manager/modals/edit-entity', ['views/modal', 'mo this.model.set('sortBy', this.getMetadata().get('entityDefs.' + scope + '.collection.sortBy')); this.model.set('sortDirection', this.getMetadata().get('entityDefs.' + scope + '.collection.asc') ? 'asc' : 'desc'); - this.model.set('textFilterFields', this.getMetadata().get('entityDefs.' + scope + '.collection.textFilterFields') || ['name']); + this.model.set('textFilterFields', this.getMetadata().get(['entityDefs', scope, 'collection', 'textFilterFields']) || ['name']); + this.model.set('fullTextSearch', this.getMetadata().get(['entityDefs', scope, 'collection', 'fullTextSearch']) || false); this.model.set('statusField', this.getMetadata().get('scopes.' + scope + '.statusField') || null); @@ -259,6 +260,16 @@ Espo.define('views/admin/entity-manager/modals/edit-entity', ['views/modal', 'mo } }); + this.createView('fullTextSearch', 'views/fields/bool', { + model: model, + mode: 'edit', + el: this.options.el + ' .field[data-name="fullTextSearch"]', + defs: { + name: 'fullTextSearch' + }, + tooltip: true + }); + this.createView('kanbanViewMode', 'views/fields/bool', { model: model, mode: 'edit', @@ -502,6 +513,7 @@ Espo.define('views/admin/entity-manager/modals/edit-entity', ['views/modal', 'mo stream: this.model.get('stream'), disabled: this.model.get('disabled'), textFilterFields: this.model.get('textFilterFields'), + fullTextSearch: this.model.get('fullTextSearch'), statusField: this.model.get('statusField'), iconClass: this.model.get('iconClass') };