From 051c36f597fddb791ac156aa27f995248f0d2c0a Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Wed, 17 Jul 2019 14:45:09 -0700 Subject: Add support for reference:none --- app/Filter/TaskReferenceFilter.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'app') diff --git a/app/Filter/TaskReferenceFilter.php b/app/Filter/TaskReferenceFilter.php index 2fe6f8a6..612be812 100644 --- a/app/Filter/TaskReferenceFilter.php +++ b/app/Filter/TaskReferenceFilter.php @@ -32,6 +32,14 @@ class TaskReferenceFilter extends BaseFilter implements FilterInterface */ public function apply() { + if ($this->value === 'none') { + $this->query->beginOr(); + $this->query->eq(TaskModel::TABLE.'.reference', ''); + $this->query->isNull(TaskModel::TABLE.'.reference'); + $this->query->closeOr(); + return $this; + } + if (strpos($this->value, '*') >= 0) { $this->query->ilike(TaskModel::TABLE.'.reference', str_replace('*', '%', $this->value)); return $this; -- cgit v1.2.3