diff options
Diffstat (limited to 'app/Model/TaskFilter.php')
-rw-r--r-- | app/Model/TaskFilter.php | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/app/Model/TaskFilter.php b/app/Model/TaskFilter.php index 377ec3c6..822397ec 100644 --- a/app/Model/TaskFilter.php +++ b/app/Model/TaskFilter.php @@ -71,6 +71,9 @@ class TaskFilter extends Base case 'T_REFERENCE': $this->filterByReference($value); break; + case 'T_SWIMLANE': + $this->filterBySwimlaneName($value); + break; } } @@ -247,6 +250,30 @@ class TaskFilter extends Base } /** + * Filter by swimlane name + * + * @access public + * @param array $values List of swimlane name + * @return TaskFilter + */ + public function filterBySwimlaneName(array $values) + { + $this->query->beginOr(); + + foreach ($values as $swimlane) { + if ($swimlane === 'default') { + $this->query->eq(Task::TABLE.'.swimlane_id', 0); + } + else { + $this->query->ilike(Swimlane::TABLE.'.name', $swimlane); + $this->query->addCondition(Task::TABLE.'.swimlane_id=0 AND '.Project::TABLE.'.default_swimlane '.$this->db->getDriver()->getOperator('ILIKE')." '$swimlane'"); + } + } + + $this->query->closeOr(); + } + + /** * Filter by category id * * @access public |