diff options
author | Simon Rettberg | 2022-07-07 15:01:13 +0200 |
---|---|---|
committer | Simon Rettberg | 2022-07-07 15:01:13 +0200 |
commit | 62e5347557b96eb57ddf8321b08b8bf21831d7cc (patch) | |
tree | 5a43d1f6a183fa0afc7a9359bd71ab196e82bd4e /modules-available/statistics/inc | |
parent | [passthrough] Adapt to query builder changes (diff) | |
download | slx-admin-62e5347557b96eb57ddf8321b08b8bf21831d7cc.tar.gz slx-admin-62e5347557b96eb57ddf8321b08b8bf21831d7cc.tar.xz slx-admin-62e5347557b96eb57ddf8321b08b8bf21831d7cc.zip |
[statistics] Allow '*' in "any" search filter
Diffstat (limited to 'modules-available/statistics/inc')
-rw-r--r-- | modules-available/statistics/inc/statisticsfilter.inc.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules-available/statistics/inc/statisticsfilter.inc.php b/modules-available/statistics/inc/statisticsfilter.inc.php index 809a636d..c83d9542 100644 --- a/modules-available/statistics/inc/statisticsfilter.inc.php +++ b/modules-available/statistics/inc/statisticsfilter.inc.php @@ -714,7 +714,7 @@ class AnyHardwarePropStatisticsFilter extends StatisticsFilter public function __construct() { - parent::__construct(null, ['=']); + parent::__construct(null, ['~']); } public function whereClause(string $operator, $argument, array &$args, array &$joins): string @@ -725,7 +725,7 @@ class AnyHardwarePropStatisticsFilter extends StatisticsFilter $joins[] = "LEFT JOIN statistic_hw_prop $key1 ON (`$key1`.`value` LIKE :$val AND `$key1`.hwid = `$shw`.hwid)"; $key2 = self::getNewKey('hw'); $joins[] = "LEFT JOIN machine_x_hw_prop $key2 ON (`$key2`.`value` LIKE :$val AND `$key2`.machinehwid = mxhw.machinehwid)"; - $args[$val] = '%' . str_replace('%', '_', $argument) . '%'; + $args[$val] = '%' . str_replace(['%', '*'], ['_', '%'], $argument) . '%'; return "((`$key1`.`value` IS NOT NULL) OR (`$key2`.`value` IS NOT NULL))"; } |