diff options
author | Simon Rettberg | 2020-05-05 16:13:24 +0200 |
---|---|---|
committer | Simon Rettberg | 2020-05-05 16:13:24 +0200 |
commit | 608571df6d8696ce3fce792448d4a213f6b4d3cc (patch) | |
tree | c6d1ba41c55886cacc6daf2dcaf43e1791a63493 | |
parent | [statistics] Fix handling POST for sub-pages (diff) | |
download | slx-admin-608571df6d8696ce3fce792448d4a213f6b4d3cc.tar.gz slx-admin-608571df6d8696ce3fce792448d4a213f6b4d3cc.tar.xz slx-admin-608571df6d8696ce3fce792448d4a213f6b4d3cc.zip |
[statistics] Re-introduce "with sublocations" for location filter
-rw-r--r-- | modules-available/statistics/inc/statisticsfilter.inc.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/modules-available/statistics/inc/statisticsfilter.inc.php b/modules-available/statistics/inc/statisticsfilter.inc.php index 83983ee1..a038f076 100644 --- a/modules-available/statistics/inc/statisticsfilter.inc.php +++ b/modules-available/statistics/inc/statisticsfilter.inc.php @@ -23,6 +23,7 @@ abstract class StatisticsFilter const OP_ORDINAL = ['=', '!=', '<', '>', '<=', '>=']; const OP_STRCMP = ['~', '!~', '=', '!=']; const OP_NOMINAL = ['=', '!=']; + const OP_LOCATIONS = ['=', '!=', '~']; const OP_FUZZY_ORDINAL = ['=', '!=', '~', '!~', '<', '>', '<=', '>=']; /** @@ -281,9 +282,9 @@ class EnumStatisticsFilter extends SimpleStatisticsFilter public $values; - public function __construct(string $column, array $values) + public function __construct(string $column, array $values, array $ops = self::OP_NOMINAL) { - parent::__construct($column, self::OP_NOMINAL, ''); + parent::__construct($column, $ops, ''); if (isset($values[0])) { if (!is_array($values[0])) { $values = array_map(function($e) { return [ @@ -489,7 +490,7 @@ class LocationStatisticsFilter extends EnumStatisticsFilter 'value' => $loc['locationpad'] . ' ' . $loc['locationname'], ]; } - parent::__construct('locationid', $locs); + parent::__construct('locationid', $locs, self::OP_LOCATIONS); } |