Add a method to apply filters for tasks

This commit is contained in:
Frédéric Guillot
2014-04-21 22:44:25 -04:00
parent 9bfd824ab7
commit 919e5d51a4
5 changed files with 76 additions and 58 deletions

View File

@@ -42,12 +42,18 @@ class Project extends Base
$this->checkProjectPermissions($project['id']);
$tasks = $this->task->getAllByProjectId($project_id, array(0));
$filters = array(
array('column' => 'project_id', 'operator' => 'eq', 'value' => $project_id),
array('column' => 'is_active', 'operator' => 'eq', 'value' => \Model\Task::STATUS_CLOSED),
);
$tasks = $this->task->find($filters);
$nb_tasks = count($tasks);
$this->response->html($this->template->layout('project_tasks', array(
'menu' => 'projects',
'project' => $project,
'columns' => $this->board->getColumnsList($project_id),
'tasks' => $tasks,
'nb_tasks' => $nb_tasks,
'title' => $project['name'].' ('.$nb_tasks.')'