mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-28 16:24:05 +02:00
Merge branch 'feature/datafields-search-case-insensitive-2359'
This commit is contained in:
commit
f7a295ccd5
@ -5,12 +5,13 @@ namespace Icinga\Module\Director\Web\Table;
|
||||
use gipfl\IcingaWeb2\Link;
|
||||
use gipfl\IcingaWeb2\Table\ZfQueryBasedTable;
|
||||
use Zend_Db_Adapter_Abstract as ZfDbAdapter;
|
||||
use Zend_Db_Expr as DbExpr;
|
||||
use Zend_Db_Select as ZfDbSelect;
|
||||
|
||||
class DatafieldTable extends ZfQueryBasedTable
|
||||
{
|
||||
protected $searchColumns = [
|
||||
'df.varname',
|
||||
'lc_varname',
|
||||
'df.caption',
|
||||
];
|
||||
|
||||
@ -19,6 +20,7 @@ class DatafieldTable extends ZfQueryBasedTable
|
||||
return [
|
||||
'id' => 'df.id',
|
||||
'varname' => 'df.varname',
|
||||
'lc_varname' => new DbExpr('LOWER(df.varname)'),
|
||||
'caption' => 'df.caption',
|
||||
'description' => 'df.description',
|
||||
'datatype' => 'df.datatype',
|
||||
@ -88,6 +90,15 @@ class DatafieldTable extends ZfQueryBasedTable
|
||||
)->group('df.id')->group('df.varname')->group('dfc.category_name')->order('caption ASC');
|
||||
}
|
||||
|
||||
public function search($search)
|
||||
{
|
||||
if ($search !== null) {
|
||||
$search = strtolower($search);
|
||||
}
|
||||
|
||||
return parent::search($search);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $type
|
||||
* @param ZfDbAdapter $db
|
||||
|
Loading…
x
Reference in New Issue
Block a user