Add new search attribute for swimlane

This commit is contained in:
Frederic Guillot
2015-07-18 11:33:51 -04:00
parent d75a0a9d45
commit dfd7972227
8 changed files with 138 additions and 25 deletions

View File

@@ -71,6 +71,9 @@ class TaskFilter extends Base
case 'T_REFERENCE':
$this->filterByReference($value);
break;
case 'T_SWIMLANE':
$this->filterBySwimlaneName($value);
break;
}
}
@@ -246,6 +249,30 @@ class TaskFilter extends Base
$this->query->closeOr();
}
/**
* 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
*