From 7dc9c3e6b67fa4aebfd4c99fa14decd7f14d5478 Mon Sep 17 00:00:00 2001 From: Heiko Robert Date: Fri, 11 Mar 2016 15:46:15 +0100 Subject: [PATCH] added search filter "Ends With", "Like" for varchar fields --- application/Espo/Core/SelectManagers/Base.php | 3 +++ application/Espo/Resources/i18n/de_DE/Global.json | 2 ++ client/src/views/fields/varchar.js | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/application/Espo/Core/SelectManagers/Base.php b/application/Espo/Core/SelectManagers/Base.php index 545c7ccc3b..a3468580b8 100644 --- a/application/Espo/Core/SelectManagers/Base.php +++ b/application/Espo/Core/SelectManagers/Base.php @@ -875,6 +875,9 @@ class Base case 'startsWith': $part[$item['field'] . '*'] = $item['value'] . '%'; break; + case 'endsWith': + $part[$item['field'] . '*'] = $item['value'] . '%'; + break; case 'contains': $part[$item['field'] . '*'] = '%' . $item['value'] . '%'; break; diff --git a/application/Espo/Resources/i18n/de_DE/Global.json b/application/Espo/Resources/i18n/de_DE/Global.json index 76c0fad64b..6a93d525d8 100644 --- a/application/Espo/Resources/i18n/de_DE/Global.json +++ b/application/Espo/Resources/i18n/de_DE/Global.json @@ -436,7 +436,9 @@ }, "varcharSearchRanges": { "equals": "Gleich", + "like": "Wie (%)", "startsWith": "Beginnt mit", + "endsWith": "Endet mit", "contains": "Enthält", "isEmpty": "Ist leer", "isNotEmpty": "Ist nicht leer" diff --git a/client/src/views/fields/varchar.js b/client/src/views/fields/varchar.js index c3c7ee1d49..6ef017de9f 100644 --- a/client/src/views/fields/varchar.js +++ b/client/src/views/fields/varchar.js @@ -35,7 +35,7 @@ Espo.define('views/fields/varchar', 'views/fields/base', function (Dep) { searchTemplate: 'fields/varchar/search', setupSearch: function () { - this.searchParams.typeOptions = ['startsWith', 'contains', 'equals', 'isEmpty', 'isNotEmpty']; + this.searchParams.typeOptions = ['startsWith', 'endsWith', 'contains', 'equals', 'like', 'isEmpty', 'isNotEmpty']; this.events = _.extend({ 'change select.search-type': function (e) { var type = $(e.currentTarget).val();