Merge pull request #123 from ecm4u/master
allow "Ends With" and "Like (%)" on varchar field
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -460,7 +460,9 @@
|
||||
},
|
||||
"varcharSearchRanges": {
|
||||
"equals": "Equals",
|
||||
"like": "Is Like (%)",
|
||||
"startsWith": "Starts With",
|
||||
"endsWith": "Ends With",
|
||||
"contains": "Contains",
|
||||
"isEmpty": "Is Empty",
|
||||
"isNotEmpty": "Is Not Empty"
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user