mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-16 22:42:16 +00:00
Added the operations equal and not equal for strings in the FilterComponent
This commit is contained in:
@@ -768,15 +768,31 @@ class FilterCmptLib
|
||||
{
|
||||
// comparison (==)
|
||||
case self::OP_EQUAL:
|
||||
if (is_numeric($filterDefinition->condition)) $condition = '= '.$filterDefinition->condition;
|
||||
// Numeric
|
||||
if (is_numeric($filterDefinition->condition))
|
||||
{
|
||||
$condition = '= '.$filterDefinition->condition;
|
||||
}
|
||||
else // string type
|
||||
{
|
||||
$condition = '= \''.$this->_ci->FiltersModel->escapeLike($filterDefinition->condition).'\'';
|
||||
}
|
||||
break;
|
||||
// not equal (!=)
|
||||
case self::OP_NOT_EQUAL:
|
||||
if (is_numeric($filterDefinition->condition)) $condition = '!= '.$filterDefinition->condition;
|
||||
// Numeric
|
||||
if (is_numeric($filterDefinition->condition))
|
||||
{
|
||||
$condition = '!= '.$filterDefinition->condition;
|
||||
}
|
||||
else // string type
|
||||
{
|
||||
$condition = '!= \''.$this->_ci->FiltersModel->escapeLike($filterDefinition->condition).'\'';
|
||||
}
|
||||
break;
|
||||
// greater than (>)
|
||||
case self::OP_GREATER_THAN:
|
||||
// It it's a date type
|
||||
// If it's a date type
|
||||
if (is_numeric($filterDefinition->condition)
|
||||
&& isset($filterDefinition->option)
|
||||
&& ($filterDefinition->option == self::OPT_HOURS
|
||||
@@ -793,7 +809,7 @@ class FilterCmptLib
|
||||
break;
|
||||
// less than (<)
|
||||
case self::OP_LESS_THAN:
|
||||
// It it's a date type
|
||||
// If it's a date type
|
||||
if (is_numeric($filterDefinition->condition)
|
||||
&& isset($filterDefinition->option)
|
||||
&& ($filterDefinition->option == self::OPT_HOURS
|
||||
|
||||
@@ -644,6 +644,8 @@ export const CoreFilterCmpt = {
|
||||
|| filterField.type.toLowerCase().indexOf('bpchar') >= 0">
|
||||
<div class="col-2">
|
||||
<select class="form-select" name="operation" v-model="filterField.operation">
|
||||
<option value="equal">Gleich</option>
|
||||
<option value="nequal">Nicht gleich</option>
|
||||
<option value="contains">Enthält</option>
|
||||
<option value="ncontains">Enthält nicht</option>
|
||||
</select>
|
||||
|
||||
Reference in New Issue
Block a user