diff options
author | Frédéric Guillot <contact@fredericguillot.com> | 2014-02-22 13:37:06 -0500 |
---|---|---|
committer | Frédéric Guillot <contact@fredericguillot.com> | 2014-02-22 13:37:06 -0500 |
commit | a1923d3d7f9276e859d6fd6bee339f0ea00f6544 (patch) | |
tree | 84caca943de5d0e016455ea2f6896d0b697fdf05 /controllers/project.php | |
parent | fd28d50597d4f255ba9514e0fc03c8cb67c86f22 (diff) |
Add a page to display completed tasks and add the completion date column for tasks
Diffstat (limited to 'controllers/project.php')
-rw-r--r-- | controllers/project.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/controllers/project.php b/controllers/project.php index a384be67..c44dd38d 100644 --- a/controllers/project.php +++ b/controllers/project.php @@ -4,6 +4,29 @@ namespace Controller; class Project extends Base { + // List of completed tasks for a given project + public function tasks() + { + $project_id = $this->request->getIntegerParam('project_id'); + $project = $this->project->get($project_id); + + if (! $project) { + $this->session->flashError(t('Project not found.')); + $this->response->redirect('?controller=project'); + } + + $tasks = $this->task->getAllByProjectId($project_id, array(0)); + $nb_tasks = count($tasks); + + $this->response->html($this->template->layout('project_tasks', array( + 'menu' => 'projects', + 'project' => $project, + 'tasks' => $tasks, + 'nb_tasks' => $nb_tasks, + 'title' => $project['name'].' ('.$nb_tasks.')' + ))); + } + // List of projects public function index() { |