diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-08-19 21:25:19 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-08-19 21:25:19 -0400 |
commit | 5b888a23454e369ebf383c3003497038ae2fbf5d (patch) | |
tree | e3e1c5f722eb36e3c39d654e41ac4ee082f715b8 /app/Model/TaskFilter.php | |
parent | 1983fc5f7afa20b5ddba0ad1fb63fb92f563deb6 (diff) |
Add search in task title when using an integer only input
Diffstat (limited to 'app/Model/TaskFilter.php')
-rw-r--r-- | app/Model/TaskFilter.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/Model/TaskFilter.php b/app/Model/TaskFilter.php index e8926b52..cede59e3 100644 --- a/app/Model/TaskFilter.php +++ b/app/Model/TaskFilter.php @@ -242,11 +242,11 @@ class TaskFilter extends Base */ public function filterByTitle($title) { - if (strlen($title) > 1 && $title{0} === '#' && ctype_digit(substr($title, 1))) { - $this->query->eq(Task::TABLE.'.id', substr($title, 1)); - } - else if (ctype_digit($title)) { - $this->query->eq(Task::TABLE.'.id', $title); + if (ctype_digit($title) || (strlen($title) > 1 && $title{0} === '#' && ctype_digit(substr($title, 1)))) { + $this->query->beginOr(); + $this->query->eq(Task::TABLE.'.id', str_replace('#', '', $title)); + $this->query->ilike(Task::TABLE.'.title', '%'.$title.'%'); + $this->query->closeOr(); } else { $this->query->ilike(Task::TABLE.'.title', '%'.$title.'%'); |