From 401b0bdfb10ebfe75c9a392de52d37cc3c22c062 Mon Sep 17 00:00:00 2001
From: Frederic Guillot <fred@kanboard.net>
Date: Sun, 19 Jul 2015 18:14:20 -0400
Subject: Split task controller into smaller classes

---
 app/Controller/Comment.php                         |   2 +-
 app/Controller/Task.php                            | 371 +--------------------
 app/Controller/Taskcreation.php                    |  86 +++++
 app/Controller/Taskmodification.php                | 212 ++++++++++++
 app/Controller/Taskstatus.php                      |  79 +++++
 app/Model/Acl.php                                  |   3 +
 app/Template/board/table_container.php             |   2 +-
 app/Template/board/table_swimlane.php              |   2 +-
 app/Template/board/task_menu.php                   |   6 +-
 app/Template/task/close.php                        |  15 -
 app/Template/task/description.php                  |  33 ++
 app/Template/task/edit.php                         |  68 ----
 app/Template/task/edit_description.php             |  38 ---
 app/Template/task/edit_recurrence.php              |  47 ---
 app/Template/task/new.php                          |  84 -----
 app/Template/task/open.php                         |  15 -
 app/Template/task/public.php                       |   2 +-
 app/Template/task/show.php                         |   6 +-
 app/Template/task/show_description.php             |  33 --
 app/Template/task/sidebar.php                      |  12 +-
 app/Template/task/time.php                         |  20 --
 app/Template/task/time_tracking.php                |  27 --
 app/Template/task/time_tracking_details.php        |  27 ++
 app/Template/task/time_tracking_summary.php        |  13 +
 app/Template/task/timesheet.php                    |  13 -
 app/Template/task_creation/form.php                |  84 +++++
 .../task_modification/edit_description.php         |  38 +++
 app/Template/task_modification/edit_recurrence.php |  47 +++
 app/Template/task_modification/edit_task.php       |  66 ++++
 app/Template/task_modification/edit_time.php       |  20 ++
 app/Template/task_status/close.php                 |  15 +
 app/Template/task_status/open.php                  |  15 +
 app/common.php                                     |  21 +-
 33 files changed, 788 insertions(+), 734 deletions(-)
 create mode 100644 app/Controller/Taskcreation.php
 create mode 100644 app/Controller/Taskmodification.php
 create mode 100644 app/Controller/Taskstatus.php
 delete mode 100644 app/Template/task/close.php
 create mode 100644 app/Template/task/description.php
 delete mode 100644 app/Template/task/edit.php
 delete mode 100644 app/Template/task/edit_description.php
 delete mode 100644 app/Template/task/edit_recurrence.php
 delete mode 100644 app/Template/task/new.php
 delete mode 100644 app/Template/task/open.php
 delete mode 100644 app/Template/task/show_description.php
 delete mode 100644 app/Template/task/time.php
 delete mode 100644 app/Template/task/time_tracking.php
 create mode 100644 app/Template/task/time_tracking_details.php
 create mode 100644 app/Template/task/time_tracking_summary.php
 delete mode 100644 app/Template/task/timesheet.php
 create mode 100644 app/Template/task_creation/form.php
 create mode 100644 app/Template/task_modification/edit_description.php
 create mode 100644 app/Template/task_modification/edit_recurrence.php
 create mode 100644 app/Template/task_modification/edit_task.php
 create mode 100644 app/Template/task_modification/edit_time.php
 create mode 100644 app/Template/task_status/close.php
 create mode 100644 app/Template/task_status/open.php

(limited to 'app')

diff --git a/app/Controller/Comment.php b/app/Controller/Comment.php
index ca701a88..7b9d4aee 100644
--- a/app/Controller/Comment.php
+++ b/app/Controller/Comment.php
@@ -93,7 +93,7 @@ class Comment extends Base
                 $this->response->redirect($this->helper->url->to('board', 'show', array('project_id' => $task['project_id'])));
             }
 
-            $this->response->redirect($this->helper->url->to('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), 'comments');
+            $this->response->redirect($this->helper->url->to('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), 'comments'));
         }
 
         $this->create($values, $errors);
diff --git a/app/Controller/Task.php b/app/Controller/Task.php
index 1b9f9417..0770fcd1 100644
--- a/app/Controller/Task.php
+++ b/app/Controller/Task.php
@@ -2,8 +2,6 @@
 
 namespace Controller;
 
-use Model\Project as ProjectModel;
-
 /**
  * Task controller
  *
@@ -107,231 +105,40 @@ class Task extends Base
     }
 
     /**
-     * Display a form to create a new task
-     *
-     * @access public
-     */
-    public function create(array $values = array(), array $errors = array())
-    {
-        $project = $this->getProject();
-        $method = $this->request->isAjax() ? 'render' : 'layout';
-        $swimlanes_list = $this->swimlane->getList($project['id'], false, true);
-
-        if (empty($values)) {
-
-            $values = array(
-                'swimlane_id' => $this->request->getIntegerParam('swimlane_id', key($swimlanes_list)),
-                'column_id' => $this->request->getIntegerParam('column_id'),
-                'color_id' => $this->request->getStringParam('color_id', $this->color->getDefaultColor()),
-                'owner_id' => $this->request->getIntegerParam('owner_id'),
-                'another_task' => $this->request->getIntegerParam('another_task'),
-            );
-        }
-
-        $this->response->html($this->template->$method('task/new', array(
-            'ajax' => $this->request->isAjax(),
-            'errors' => $errors,
-            'values' => $values + array('project_id' => $project['id']),
-            'projects_list' => $this->project->getListByStatus(ProjectModel::ACTIVE),
-            'columns_list' => $this->board->getColumnsList($project['id']),
-            'users_list' => $this->projectPermission->getMemberList($project['id'], true, false, true),
-            'colors_list' => $this->color->getList(),
-            'categories_list' => $this->category->getList($project['id']),
-            'swimlanes_list' => $swimlanes_list,
-            'date_format' => $this->config->get('application_date_format'),
-            'date_formats' => $this->dateParser->getAvailableFormats(),
-            'title' => $project['name'].' &gt; '.t('New task')
-        )));
-    }
-
-    /**
-     * Validate and save a new task
-     *
-     * @access public
-     */
-    public function save()
-    {
-        $project = $this->getProject();
-        $values = $this->request->getValues();
-
-        list($valid, $errors) = $this->taskValidator->validateCreation($values);
-
-        if ($valid) {
-
-            if ($this->taskCreation->create($values)) {
-                $this->session->flash(t('Task created successfully.'));
-
-                if (isset($values['another_task']) && $values['another_task'] == 1) {
-                    unset($values['title']);
-                    unset($values['description']);
-                    $this->response->redirect($this->helper->url->to('task', 'create', $values));
-                }
-                else {
-                    $this->response->redirect($this->helper->url->to('board', 'show', array('project_id' => $project['id'])));
-                }
-            }
-            else {
-                $this->session->flashError(t('Unable to create your task.'));
-            }
-        }
-
-        $this->create($values, $errors);
-    }
-
-    /**
-     * Display a form to edit a task
-     *
-     * @access public
-     */
-    public function edit(array $values = array(), array $errors = array())
-    {
-        $task = $this->getTask();
-        $ajax = $this->request->isAjax();
-
-        if (empty($values)) {
-            $values = $task;
-        }
-
-        $this->dateParser->format($values, array('date_due'));
-
-        $params = array(
-            'values' => $values,
-            'errors' => $errors,
-            'task' => $task,
-            'users_list' => $this->projectPermission->getMemberList($task['project_id']),
-            'colors_list' => $this->color->getList(),
-            'categories_list' => $this->category->getList($task['project_id']),
-            'date_format' => $this->config->get('application_date_format'),
-            'date_formats' => $this->dateParser->getAvailableFormats(),
-            'ajax' => $ajax,
-        );
-
-        if ($ajax) {
-            $this->response->html($this->template->render('task/edit', $params));
-        }
-        else {
-            $this->response->html($this->taskLayout('task/edit', $params));
-        }
-    }
-
-    /**
-     * Validate and update a task
-     *
-     * @access public
-     */
-    public function update()
-    {
-        $task = $this->getTask();
-        $values = $this->request->getValues();
-
-        list($valid, $errors) = $this->taskValidator->validateModification($values);
-
-        if ($valid) {
-
-            if ($this->taskModification->update($values)) {
-                $this->session->flash(t('Task updated successfully.'));
-
-                if ($this->request->getIntegerParam('ajax')) {
-                    $this->response->redirect($this->helper->url->to('board', 'show', array('project_id' => $task['project_id'])));
-                }
-                else {
-                    $this->response->redirect($this->helper->url->to('task', 'show', array('project_id' => $task['project_id'], 'task_id' => $task['id'])));
-                }
-            }
-            else {
-                $this->session->flashError(t('Unable to update your task.'));
-            }
-        }
-
-        $this->edit($values, $errors);
-    }
-
-    /**
-     * Update time tracking information
-     *
-     * @access public
-     */
-    public function time()
-    {
-        $task = $this->getTask();
-        $values = $this->request->getValues();
-
-        list($valid,) = $this->taskValidator->validateTimeModification($values);
-
-        if ($valid && $this->taskModification->update($values)) {
-            $this->session->flash(t('Task updated successfully.'));
-        }
-        else {
-            $this->session->flashError(t('Unable to update your task.'));
-        }
-
-        $this->response->redirect($this->helper->url->to('task', 'show', array('project_id' => $task['project_id'], 'task_id' => $task['id'])));
-    }
-
-    /**
-     * Hide a task
+     * Display the time tracking details
      *
      * @access public
      */
-    public function close()
+    public function timetracking()
     {
         $task = $this->getTask();
-        $redirect = $this->request->getStringParam('redirect');
-
-        if ($this->request->getStringParam('confirmation') === 'yes') {
-
-            $this->checkCSRFParam();
-
-            if ($this->taskStatus->close($task['id'])) {
-                $this->session->flash(t('Task closed successfully.'));
-            } else {
-                $this->session->flashError(t('Unable to close this task.'));
-            }
-
-            if ($redirect === 'board') {
-                $this->response->redirect($this->helper->url->to('board', 'show', array('project_id' => $task['project_id'])));
-            }
 
-            $this->response->redirect($this->helper->url->to('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])));
-        }
-
-        if ($this->request->isAjax()) {
-            $this->response->html($this->template->render('task/close', array(
-                'task' => $task,
-                'redirect' => $redirect,
-            )));
-        }
+        $subtask_paginator = $this->paginator
+            ->setUrl('task', 'timesheet', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'pagination' => 'subtasks'))
+            ->setMax(15)
+            ->setOrder('start')
+            ->setDirection('DESC')
+            ->setQuery($this->subtaskTimeTracking->getTaskQuery($task['id']))
+            ->calculateOnlyIf($this->request->getStringParam('pagination') === 'subtasks');
 
-        $this->response->html($this->taskLayout('task/close', array(
+        $this->response->html($this->taskLayout('task/time_tracking_details', array(
             'task' => $task,
-            'redirect' => $redirect,
+            'subtask_paginator' => $subtask_paginator,
         )));
     }
 
     /**
-     * Open a task
+     * Display the task transitions
      *
      * @access public
      */
-    public function open()
+    public function transitions()
     {
         $task = $this->getTask();
 
-        if ($this->request->getStringParam('confirmation') === 'yes') {
-
-            $this->checkCSRFParam();
-
-            if ($this->taskStatus->open($task['id'])) {
-                $this->session->flash(t('Task opened successfully.'));
-            } else {
-                $this->session->flashError(t('Unable to open this task.'));
-            }
-
-            $this->response->redirect($this->helper->url->to('task', 'show', array('project_id' => $task['project_id'], 'task_id' => $task['id'])));
-        }
-
-        $this->response->html($this->taskLayout('task/open', array(
+        $this->response->html($this->taskLayout('task/transitions', array(
             'task' => $task,
+            'transitions' => $this->transition->getAllByTask($task['id']),
         )));
     }
 
@@ -365,152 +172,4 @@ class Task extends Base
             'task' => $task,
         )));
     }
-
-    /**
-     * Edit description form
-     *
-     * @access public
-     */
-    public function description()
-    {
-        $task = $this->getTask();
-        $ajax = $this->request->isAjax() || $this->request->getIntegerParam('ajax');
-
-        if ($this->request->isPost()) {
-
-            $values = $this->request->getValues();
-
-            list($valid, $errors) = $this->taskValidator->validateDescriptionCreation($values);
-
-            if ($valid) {
-
-                if ($this->taskModification->update($values)) {
-                    $this->session->flash(t('Task updated successfully.'));
-                }
-                else {
-                    $this->session->flashError(t('Unable to update your task.'));
-                }
-
-                if ($ajax) {
-                    $this->response->redirect($this->helper->url->to('board', 'show', array('project_id' => $task['project_id'])));
-                }
-                else {
-                    $this->response->redirect($this->helper->url->to('task', 'show', array('project_id' => $task['project_id'], 'task_id' => $task['id'])));
-                }
-            }
-        }
-        else {
-            $values = $task;
-            $errors = array();
-        }
-
-        $params = array(
-            'values' => $values,
-            'errors' => $errors,
-            'task' => $task,
-            'ajax' => $ajax,
-        );
-
-        if ($ajax) {
-            $this->response->html($this->template->render('task/edit_description', $params));
-        }
-        else {
-            $this->response->html($this->taskLayout('task/edit_description', $params));
-        }
-    }
-
-    /**
-     * Edit recurrence form
-     *
-     * @access public
-     */
-    public function recurrence()
-    {
-        $task = $this->getTask();
-
-        if ($this->request->isPost()) {
-
-            $values = $this->request->getValues();
-
-            list($valid, $errors) = $this->taskValidator->validateEditRecurrence($values);
-
-            if ($valid) {
-
-                if ($this->taskModification->update($values)) {
-                    $this->session->flash(t('Task updated successfully.'));
-                }
-                else {
-                    $this->session->flashError(t('Unable to update your task.'));
-                }
-
-                $this->response->redirect($this->helper->url->to('task', 'show', array('project_id' => $task['project_id'], 'task_id' => $task['id'])));
-            }
-        }
-        else {
-            $values = $task;
-            $errors = array();
-        }
-
-        $params = array(
-            'values' => $values,
-            'errors' => $errors,
-            'task' => $task,
-            'recurrence_status_list' => $this->task->getRecurrenceStatusList(),
-            'recurrence_trigger_list' => $this->task->getRecurrenceTriggerList(),
-            'recurrence_timeframe_list' => $this->task->getRecurrenceTimeframeList(),
-            'recurrence_basedate_list' => $this->task->getRecurrenceBasedateList(),
-        );
-
-        $this->response->html($this->taskLayout('task/edit_recurrence', $params));
-    }
-
-    /**
-     * Display the time tracking details
-     *
-     * @access public
-     */
-    public function timesheet()
-    {
-        $task = $this->getTask();
-
-        $subtask_paginator = $this->paginator
-            ->setUrl('task', 'timesheet', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'pagination' => 'subtasks'))
-            ->setMax(15)
-            ->setOrder('start')
-            ->setDirection('DESC')
-            ->setQuery($this->subtaskTimeTracking->getTaskQuery($task['id']))
-            ->calculateOnlyIf($this->request->getStringParam('pagination') === 'subtasks');
-
-        $this->response->html($this->taskLayout('task/time_tracking', array(
-            'task' => $task,
-            'subtask_paginator' => $subtask_paginator,
-        )));
-    }
-
-    /**
-     * Display the task transitions
-     *
-     * @access public
-     */
-    public function transitions()
-    {
-        $task = $this->getTask();
-
-        $this->response->html($this->taskLayout('task/transitions', array(
-            'task' => $task,
-            'transitions' => $this->transition->getAllByTask($task['id']),
-        )));
-    }
-
-    /**
-     * Set automatically the start date
-     *
-     * @access public
-     */
-    public function start()
-    {
-        $task = $this->getTask();
-        $this->taskModification->update(array('id' => $task['id'], 'date_started' => time()));
-        $this->response->redirect($this->helper->url->to('task', 'show', array('project_id' => $task['project_id'], 'task_id' => $task['id'])));
-    }
 }
diff --git a/app/Controller/Taskcreation.php b/app/Controller/Taskcreation.php
new file mode 100644
index 00000000..7c841e10
--- /dev/null
+++ b/app/Controller/Taskcreation.php
@@ -0,0 +1,86 @@
+<?php
+
+namespace Controller;
+
+use Model\Project as ProjectModel;
+
+/**
+ * Task Creation controller
+ *
+ * @package  controller
+ * @author   Frederic Guillot
+ */
+class Taskcreation extends Base
+{
+    /**
+     * Display a form to create a new task
+     *
+     * @access public
+     */
+    public function create(array $values = array(), array $errors = array())
+    {
+        $project = $this->getProject();
+        $method = $this->request->isAjax() ? 'render' : 'layout';
+        $swimlanes_list = $this->swimlane->getList($project['id'], false, true);
+
+        if (empty($values)) {
+
+            $values = array(
+                'swimlane_id' => $this->request->getIntegerParam('swimlane_id', key($swimlanes_list)),
+                'column_id' => $this->request->getIntegerParam('column_id'),
+                'color_id' => $this->request->getStringParam('color_id', $this->color->getDefaultColor()),
+                'owner_id' => $this->request->getIntegerParam('owner_id'),
+                'another_task' => $this->request->getIntegerParam('another_task'),
+            );
+        }
+
+        $this->response->html($this->template->$method('task_creation/form', array(
+            'ajax' => $this->request->isAjax(),
+            'errors' => $errors,
+            'values' => $values + array('project_id' => $project['id']),
+            'projects_list' => $this->project->getListByStatus(ProjectModel::ACTIVE),
+            'columns_list' => $this->board->getColumnsList($project['id']),
+            'users_list' => $this->projectPermission->getMemberList($project['id'], true, false, true),
+            'colors_list' => $this->color->getList(),
+            'categories_list' => $this->category->getList($project['id']),
+            'swimlanes_list' => $swimlanes_list,
+            'date_format' => $this->config->get('application_date_format'),
+            'date_formats' => $this->dateParser->getAvailableFormats(),
+            'title' => $project['name'].' &gt; '.t('New task')
+        )));
+    }
+
+    /**
+     * Validate and save a new task
+     *
+     * @access public
+     */
+    public function save()
+    {
+        $project = $this->getProject();
+        $values = $this->request->getValues();
+
+        list($valid, $errors) = $this->taskValidator->validateCreation($values);
+
+        if ($valid) {
+
+            if ($this->taskCreation->create($values)) {
+                $this->session->flash(t('Task created successfully.'));
+
+                if (isset($values['another_task']) && $values['another_task'] == 1) {
+                    unset($values['title']);
+                    unset($values['description']);
+                    $this->response->redirect($this->helper->url->to('taskcreation', 'create', $values));
+                }
+                else {
+                    $this->response->redirect($this->helper->url->to('board', 'show', array('project_id' => $project['id'])));
+                }
+            }
+            else {
+                $this->session->flashError(t('Unable to create your task.'));
+            }
+        }
+
+        $this->create($values, $errors);
+    }
+}
diff --git a/app/Controller/Taskmodification.php b/app/Controller/Taskmodification.php
new file mode 100644
index 00000000..56d2b9f9
--- /dev/null
+++ b/app/Controller/Taskmodification.php
@@ -0,0 +1,212 @@
+<?php
+
+namespace Controller;
+
+/**
+ * Task Modification controller
+ *
+ * @package  controller
+ * @author   Frederic Guillot
+ */
+class Taskmodification extends Base
+{
+    /**
+     * Set automatically the start date
+     *
+     * @access public
+     */
+    public function start()
+    {
+        $task = $this->getTask();
+        $this->taskModification->update(array('id' => $task['id'], 'date_started' => time()));
+        $this->response->redirect($this->helper->url->to('task', 'show', array('project_id' => $task['project_id'], 'task_id' => $task['id'])));
+    }
+
+    /**
+     * Update time tracking information
+     *
+     * @access public
+     */
+    public function time()
+    {
+        $task = $this->getTask();
+        $values = $this->request->getValues();
+
+        list($valid,) = $this->taskValidator->validateTimeModification($values);
+
+        if ($valid && $this->taskModification->update($values)) {
+            $this->session->flash(t('Task updated successfully.'));
+        }
+        else {
+            $this->session->flashError(t('Unable to update your task.'));
+        }
+
+        $this->response->redirect($this->helper->url->to('task', 'show', array('project_id' => $task['project_id'], 'task_id' => $task['id'])));
+    }
+
+    /**
+     * Edit description form
+     *
+     * @access public
+     */
+    public function description()
+    {
+        $task = $this->getTask();
+        $ajax = $this->request->isAjax() || $this->request->getIntegerParam('ajax');
+
+        if ($this->request->isPost()) {
+
+            $values = $this->request->getValues();
+
+            list($valid, $errors) = $this->taskValidator->validateDescriptionCreation($values);
+
+            if ($valid) {
+
+                if ($this->taskModification->update($values)) {
+                    $this->session->flash(t('Task updated successfully.'));
+                }
+                else {
+                    $this->session->flashError(t('Unable to update your task.'));
+                }
+
+                if ($ajax) {
+                    $this->response->redirect($this->helper->url->to('board', 'show', array('project_id' => $task['project_id'])));
+                }
+                else {
+                    $this->response->redirect($this->helper->url->to('task', 'show', array('project_id' => $task['project_id'], 'task_id' => $task['id'])));
+                }
+            }
+        }
+        else {
+            $values = $task;
+            $errors = array();
+        }
+
+        $params = array(
+            'values' => $values,
+            'errors' => $errors,
+            'task' => $task,
+            'ajax' => $ajax,
+        );
+
+        if ($ajax) {
+            $this->response->html($this->template->render('task_modification/edit_description', $params));
+        }
+        else {
+            $this->response->html($this->taskLayout('task_modification/edit_description', $params));
+        }
+    }
+
+    /**
+     * Display a form to edit a task
+     *
+     * @access public
+     */
+    public function edit(array $values = array(), array $errors = array())
+    {
+        $task = $this->getTask();
+        $ajax = $this->request->isAjax();
+
+        if (empty($values)) {
+            $values = $task;
+        }
+
+        $this->dateParser->format($values, array('date_due'));
+
+        $params = array(
+            'values' => $values,
+            'errors' => $errors,
+            'task' => $task,
+            'users_list' => $this->projectPermission->getMemberList($task['project_id']),
+            'colors_list' => $this->color->getList(),
+            'categories_list' => $this->category->getList($task['project_id']),
+            'date_format' => $this->config->get('application_date_format'),
+            'date_formats' => $this->dateParser->getAvailableFormats(),
+            'ajax' => $ajax,
+        );
+
+        if ($ajax) {
+            $this->response->html($this->template->render('task_modification/edit_task', $params));
+        }
+        else {
+            $this->response->html($this->taskLayout('task_modification/edit_task', $params));
+        }
+    }
+
+    /**
+     * Validate and update a task
+     *
+     * @access public
+     */
+    public function update()
+    {
+        $task = $this->getTask();
+        $values = $this->request->getValues();
+
+        list($valid, $errors) = $this->taskValidator->validateModification($values);
+
+        if ($valid) {
+
+            if ($this->taskModification->update($values)) {
+                $this->session->flash(t('Task updated successfully.'));
+
+                if ($this->request->getIntegerParam('ajax')) {
+                    $this->response->redirect($this->helper->url->to('board', 'show', array('project_id' => $task['project_id'])));
+                }
+                else {
+                    $this->response->redirect($this->helper->url->to('task', 'show', array('project_id' => $task['project_id'], 'task_id' => $task['id'])));
+                }
+            }
+            else {
+                $this->session->flashError(t('Unable to update your task.'));
+            }
+        }
+
+        $this->edit($values, $errors);
+    }
+
+    /**
+     * Edit recurrence form
+     *
+     * @access public
+     */
+    public function recurrence()
+    {
+        $task = $this->getTask();
+
+        if ($this->request->isPost()) {
+
+            $values = $this->request->getValues();
+
+            list($valid, $errors) = $this->taskValidator->validateEditRecurrence($values);
+
+            if ($valid) {
+
+                if ($this->taskModification->update($values)) {
+                    $this->session->flash(t('Task updated successfully.'));
+                }
+                else {
+                    $this->session->flashError(t('Unable to update your task.'));
+                }
+
+                $this->response->redirect($this->helper->url->to('task', 'show', array('project_id' => $task['project_id'], 'task_id' => $task['id'])));
+            }
+        }
+        else {
+            $values = $task;
+            $errors = array();
+        }
+
+        $params = array(
+            'values' => $values,
+            'errors' => $errors,
+            'task' => $task,
+            'recurrence_status_list' => $this->task->getRecurrenceStatusList(),
+            'recurrence_trigger_list' => $this->task->getRecurrenceTriggerList(),
+            'recurrence_timeframe_list' => $this->task->getRecurrenceTimeframeList(),
+            'recurrence_basedate_list' => $this->task->getRecurrenceBasedateList(),
+        );
+
+        $this->response->html($this->taskLayout('task_modification/edit_recurrence', $params));
+    }
+}
diff --git a/app/Controller/Taskstatus.php b/app/Controller/Taskstatus.php
new file mode 100644
index 00000000..a47d9da3
--- /dev/null
+++ b/app/Controller/Taskstatus.php
@@ -0,0 +1,79 @@
+<?php
+
+namespace Controller;
+
+/**
+ * Task Status controller
+ *
+ * @package  controller
+ * @author   Frederic Guillot
+ */
+class Taskstatus extends Base
+{
+    /**
+     * Close a task
+     *
+     * @access public
+     */
+    public function close()
+    {
+        $task = $this->getTask();
+        $redirect = $this->request->getStringParam('redirect');
+
+        if ($this->request->getStringParam('confirmation') === 'yes') {
+
+            $this->checkCSRFParam();
+
+            if ($this->taskStatus->close($task['id'])) {
+                $this->session->flash(t('Task closed successfully.'));
+            } else {
+                $this->session->flashError(t('Unable to close this task.'));
+            }
+
+            if ($redirect === 'board') {
+                $this->response->redirect($this->helper->url->to('board', 'show', array('project_id' => $task['project_id'])));
+            }
+
+            $this->response->redirect($this->helper->url->to('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])));
+        }
+
+        if ($this->request->isAjax()) {
+            $this->response->html($this->template->render('task_status/close', array(
+                'task' => $task,
+                'redirect' => $redirect,
+            )));
+        }
+
+        $this->response->html($this->taskLayout('task_status/close', array(
+            'task' => $task,
+            'redirect' => $redirect,
+        )));
+    }
+
+    /**
+     * Open a task
+     *
+     * @access public
+     */
+    public function open()
+    {
+        $task = $this->getTask();
+
+        if ($this->request->getStringParam('confirmation') === 'yes') {
+
+            $this->checkCSRFParam();
+
+            if ($this->taskStatus->open($task['id'])) {
+                $this->session->flash(t('Task opened successfully.'));
+            } else {
+                $this->session->flashError(t('Unable to open this task.'));
+            }
+
+            $this->response->redirect($this->helper->url->to('task', 'show', array('project_id' => $task['project_id'], 'task_id' => $task['id'])));
+        }
+
+        $this->response->html($this->taskLayout('task_status/open', array(
+            'task' => $task,
+        )));
+    }
+}
diff --git a/app/Model/Acl.php b/app/Model/Acl.php
index 6ee78faa..95056de6 100644
--- a/app/Model/Acl.php
+++ b/app/Model/Acl.php
@@ -42,6 +42,9 @@ class Acl extends Base
         'subtask' => '*',
         'task' => '*',
         'taskduplication' => '*',
+        'taskcreation' => '*',
+        'taskmodification' => '*',
+        'taskstatus' => '*',
         'tasklink' => '*',
         'timer' => '*',
         'calendar' => array('show', 'project'),
diff --git a/app/Template/board/table_container.php b/app/Template/board/table_container.php
index 9d3a1134..65ccdc4f 100644
--- a/app/Template/board/table_container.php
+++ b/app/Template/board/table_container.php
@@ -8,7 +8,7 @@
                data-check-interval="<?= $board_private_refresh_interval ?>"
                data-save-url="<?= $this->url->href('board', 'save', array('project_id' => $project['id'])) ?>"
                data-check-url="<?= $this->url->href('board', 'check', array('project_id' => $project['id'], 'timestamp' => time())) ?>"
-               data-task-creation-url="<?= $this->url->href('task', 'create', array('project_id' => $project['id'])) ?>"
+               data-task-creation-url="<?= $this->url->href('taskcreation', 'create', array('project_id' => $project['id'])) ?>"
         >
     <?php endif ?>
 
diff --git a/app/Template/board/table_swimlane.php b/app/Template/board/table_swimlane.php
index 436c53b5..4cd137cb 100644
--- a/app/Template/board/table_swimlane.php
+++ b/app/Template/board/table_swimlane.php
@@ -15,7 +15,7 @@
     <th class="board-column">
         <?php if (! $not_editable): ?>
             <div class="board-add-icon">
-                <?= $this->url->link('+', 'task', 'create', array('project_id' => $column['project_id'], 'column_id' => $column['id'], 'swimlane_id' => $swimlane['id']), false, 'task-board-popover', t('Add a new task')) ?>
+                <?= $this->url->link('+', 'taskcreation', 'create', array('project_id' => $column['project_id'], 'column_id' => $column['id'], 'swimlane_id' => $swimlane['id']), false, 'task-board-popover', t('Add a new task')) ?>
             </div>
         <?php endif ?>
 
diff --git a/app/Template/board/task_menu.php b/app/Template/board/task_menu.php
index a84b972d..71963b5e 100644
--- a/app/Template/board/task_menu.php
+++ b/app/Template/board/task_menu.php
@@ -4,12 +4,12 @@
         <ul>
             <li><i class="fa fa-user"></i> <?= $this->url->link(t('Change assignee'), 'board', 'changeAssignee', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?></li>
             <li><i class="fa fa-tag"></i> <?= $this->url->link(t('Change category'), 'board', 'changeCategory', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?></li>
-            <li><i class="fa fa-align-left"></i> <?= $this->url->link(t('Change description'), 'task', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?></li>
-            <li><i class="fa fa-pencil-square-o"></i> <?= $this->url->link(t('Edit this task'), 'task', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?></li>
+            <li><i class="fa fa-align-left"></i> <?= $this->url->link(t('Change description'), 'taskmodification', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?></li>
+            <li><i class="fa fa-pencil-square-o"></i> <?= $this->url->link(t('Edit this task'), 'taskmodification', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?></li>
             <li><i class="fa fa-comment-o"></i> <?= $this->url->link(t('Add a comment'), 'comment', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?></li>
             <li><i class="fa fa-code-fork"></i> <?= $this->url->link(t('Add a link'), 'tasklink', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?></li>
             <li><i class="fa fa-camera"></i> <?= $this->url->link(t('Add a screenshot'), 'board', 'screenshot', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?></li>
-            <li><i class="fa fa-close"></i> <?= $this->url->link(t('Close this task'), 'task', 'close', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'redirect' => 'board'), false, 'task-board-popover') ?></li>
+            <li><i class="fa fa-close"></i> <?= $this->url->link(t('Close this task'), 'taskstatus', 'close', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'redirect' => 'board'), false, 'task-board-popover') ?></li>
         </ul>
     </span>
 </span>
diff --git a/app/Template/task/close.php b/app/Template/task/close.php
deleted file mode 100644
index 160d5400..00000000
--- a/app/Template/task/close.php
+++ /dev/null
@@ -1,15 +0,0 @@
-<div class="page-header">
-    <h2><?= t('Close a task') ?></h2>
-</div>
-
-<div class="confirm">
-    <p class="alert alert-info">
-        <?= t('Do you really want to close the task "%s" as well as all subtasks?', $this->e($task['title'])) ?>
-    </p>
-
-    <div class="form-actions">
-        <?= $this->url->link(t('Yes'), 'task', 'close', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'confirmation' => 'yes', 'redirect' => $redirect), true, 'btn btn-red') ?>
-        <?= t('or') ?>
-        <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?>
-    </div>
-</div>
\ No newline at end of file
diff --git a/app/Template/task/description.php b/app/Template/task/description.php
new file mode 100644
index 00000000..f823e7d6
--- /dev/null
+++ b/app/Template/task/description.php
@@ -0,0 +1,33 @@
+<?php if (! empty($task['description'])): ?>
+    <div id="description" class="task-show-section">
+        <div class="page-header">
+            <h2><?= t('Description') ?></h2>
+        </div>
+
+        <article class="markdown task-show-description">
+            <?php if (! isset($is_public)): ?>
+                <?= $this->text->markdown(
+                    $task['description'],
+                    array(
+                        'controller' => 'task',
+                        'action' => 'show',
+                        'params' => array(
+                            'project_id' => $task['project_id']
+                        )
+                    )
+                ) ?>
+            <?php else: ?>
+                <?= $this->text->markdown(
+                    $task['description'],
+                    array(
+                        'controller' => 'task',
+                        'action' => 'readonly',
+                        'params' => array(
+                            'token' => $project['token']
+                        )
+                    )
+                ) ?>
+            <?php endif ?>
+        </article>
+    </div>
+<?php endif ?>
\ No newline at end of file
diff --git a/app/Template/task/edit.php b/app/Template/task/edit.php
deleted file mode 100644
index 359df779..00000000
--- a/app/Template/task/edit.php
+++ /dev/null
@@ -1,68 +0,0 @@
-<div class="page-header">
-    <h2><?= t('Edit a task') ?></h2>
-</div>
-<section id="task-section">
-<form method="post" action="<?= $this->url->href('task', 'update', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'ajax' => $ajax)) ?>" autocomplete="off">
-
-    <?= $this->form->csrf() ?>
-
-    <div class="form-column">
-
-        <?= $this->form->label(t('Title'), 'title') ?>
-        <?= $this->form->text('title', $values, $errors, array('autofocus', 'required', 'maxlength="200"', 'tabindex="1"')) ?><br/>
-
-        <?= $this->form->label(t('Description'), 'description') ?>
-
-        <div class="form-tabs">
-            <div class="write-area">
-                <?= $this->form->textarea('description', $values, $errors, array('placeholder="'.t('Leave a description').'"', 'tabindex="2"')) ?>
-            </div>
-            <div class="preview-area">
-                <div class="markdown"></div>
-            </div>
-            <ul class="form-tabs-nav">
-                <li class="form-tab form-tab-selected">
-                    <i class="fa fa-pencil-square-o fa-fw"></i><a id="markdown-write" href="#"><?= t('Write') ?></a>
-                </li>
-                <li class="form-tab">
-                    <a id="markdown-preview" href="#"><i class="fa fa-eye fa-fw"></i><?= t('Preview') ?></a>
-                </li>
-            </ul>
-        </div>
-
-        <div class="form-help"><a href="http://kanboard.net/documentation/syntax-guide" target="_blank" rel="noreferrer"><?= t('Write your text in Markdown') ?></a></div>
-
-    </div>
-
-    <div class="form-column">
-        <?= $this->form->hidden('id', $values) ?>
-        <?= $this->form->hidden('project_id', $values) ?>
-
-        <?= $this->form->label(t('Assignee'), 'owner_id') ?>
-        <?= $this->form->select('owner_id', $users_list, $values, $errors, array('tabindex="3"')) ?><br/>
-
-        <?= $this->form->label(t('Category'), 'category_id') ?>
-        <?= $this->form->select('category_id', $categories_list, $values, $errors, array('tabindex="4"')) ?><br/>
-
-        <?= $this->form->label(t('Color'), 'color_id') ?>
-        <?= $this->form->select('color_id', $colors_list, $values, $errors, array('tabindex="5"')) ?><br/>
-
-        <?= $this->form->label(t('Complexity'), 'score') ?>
-        <?= $this->form->number('score', $values, $errors, array('tabindex="6"')) ?><br/>
-
-        <?= $this->form->label(t('Due Date'), 'date_due') ?>
-        <?= $this->form->text('date_due', $values, $errors, array('placeholder="'.$this->text->in($date_format, $date_formats).'"', 'tabindex="7"'), 'form-date') ?><br/>
-        <div class="form-help"><?= t('Others formats accepted: %s and %s', date('Y-m-d'), date('Y_m_d')) ?></div>
-    </div>
-
-    <div class="form-actions">
-        <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue" tabindex="10">
-        <?= t('or') ?>
-        <?php if ($ajax): ?>
-            <?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $task['project_id']), false, 'close-popover') ?>
-        <?php else: ?>
-            <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
-        <?php endif ?>
-    </div>
-</form>
-</section>
diff --git a/app/Template/task/edit_description.php b/app/Template/task/edit_description.php
deleted file mode 100644
index 99a547e1..00000000
--- a/app/Template/task/edit_description.php
+++ /dev/null
@@ -1,38 +0,0 @@
-<div class="page-header">
-    <h2><?= t('Edit the description') ?></h2>
-</div>
-
-<form method="post" action="<?= $this->url->href('task', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'ajax' => $ajax)) ?>" autocomplete="off">
-
-    <?= $this->form->csrf() ?>
-    <?= $this->form->hidden('id', $values) ?>
-
-    <div class="form-tabs">
-        <ul class="form-tabs-nav">
-            <li class="form-tab form-tab-selected">
-                <i class="fa fa-pencil-square-o fa-fw"></i><a id="markdown-write" href="#"><?= t('Write') ?></a>
-            </li>
-            <li class="form-tab">
-                <a id="markdown-preview" href="#"><i class="fa fa-eye fa-fw"></i><?= t('Preview') ?></a>
-            </li>
-        </ul>
-        <div class="write-area">
-            <?= $this->form->textarea('description', $values, $errors, array('autofocus', 'placeholder="'.t('Leave a description').'"'), 'task-show-description-textarea') ?>
-        </div>
-        <div class="preview-area">
-            <div class="markdown"></div>
-        </div>
-    </div>
-
-    <div class="form-help"><a href="http://kanboard.net/documentation/syntax-guide" target="_blank" rel="noreferrer"><?= t('Write your text in Markdown') ?></a></div>
-
-    <div class="form-actions">
-        <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
-        <?= t('or') ?>
-        <?php if ($ajax): ?>
-            <?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $task['project_id'])) ?>
-        <?php else: ?>
-            <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
-        <?php endif ?>
-    </div>
-</form>
diff --git a/app/Template/task/edit_recurrence.php b/app/Template/task/edit_recurrence.php
deleted file mode 100644
index e7c4c8f8..00000000
--- a/app/Template/task/edit_recurrence.php
+++ /dev/null
@@ -1,47 +0,0 @@
-<div class="page-header">
-    <h2><?= t('Edit recurrence') ?></h2>
-</div>
-
-<?php if ($task['recurrence_status'] != \Model\Task::RECURRING_STATUS_NONE): ?>
-<div class="listing">
-    <?= $this->render('task/recurring_info', array(
-        'task' => $task,
-        'recurrence_trigger_list' => $recurrence_trigger_list,
-        'recurrence_timeframe_list' => $recurrence_timeframe_list,
-        'recurrence_basedate_list' => $recurrence_basedate_list,
-    )) ?>
-</div>
-<?php endif ?>
-
-<?php if ($task['recurrence_status'] != \Model\Task::RECURRING_STATUS_PROCESSED): ?>
-
-    <form method="post" action="<?= $this->url->href('task', 'recurrence', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off">
-
-        <?= $this->form->csrf() ?>
-
-        <?= $this->form->hidden('id', $values) ?>
-        <?= $this->form->hidden('project_id', $values) ?>
-
-        <?= $this->form->label(t('Generate recurrent task'), 'recurrence_status') ?>
-        <?= $this->form->select('recurrence_status', $recurrence_status_list, $values, $errors) ?>
-
-        <?= $this->form->label(t('Trigger to generate recurrent task'), 'recurrence_trigger') ?>
-        <?= $this->form->select('recurrence_trigger', $recurrence_trigger_list, $values, $errors) ?>
-
-        <?= $this->form->label(t('Factor to calculate new due date'), 'recurrence_factor') ?>
-        <?= $this->form->number('recurrence_factor', $values, $errors) ?>
-
-        <?= $this->form->label(t('Timeframe to calculate new due date'), 'recurrence_timeframe') ?>
-        <?= $this->form->select('recurrence_timeframe', $recurrence_timeframe_list, $values, $errors) ?>
-
-        <?= $this->form->label(t('Base date to calculate new due date'), 'recurrence_basedate') ?>
-        <?= $this->form->select('recurrence_basedate', $recurrence_basedate_list, $values, $errors) ?>
-
-        <div class="form-actions">
-            <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
-            <?= t('or') ?>
-            <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
-        </div>
-    </form>
-
-<?php endif ?>
\ No newline at end of file
diff --git a/app/Template/task/new.php b/app/Template/task/new.php
deleted file mode 100644
index 8fcdacdf..00000000
--- a/app/Template/task/new.php
+++ /dev/null
@@ -1,84 +0,0 @@
-<?php if (! $ajax): ?>
-<div class="page-header">
-    <ul>
-        <li><i class="fa fa-th fa-fw"></i><?= $this->url->link(t('Back to the board'), 'board', 'show', array('project_id' => $values['project_id'])) ?></li>
-    </ul>
-</div>
-<?php else: ?>
-<div class="page-header">
-    <h2><?= t('New task') ?></h2>
-</div>
-<?php endif ?>
-
-<section id="task-section">
-<form method="post" action="<?= $this->url->href('task', 'save', array('project_id' => $values['project_id'])) ?>" autocomplete="off">
-
-    <?= $this->form->csrf() ?>
-
-    <div class="form-column">
-        <?= $this->form->label(t('Title'), 'title') ?>
-        <?= $this->form->text('title', $values, $errors, array('autofocus', 'required', 'maxlength="200"', 'tabindex="1"'), 'form-input-large') ?><br/>
-
-        <?= $this->form->label(t('Description'), 'description') ?>
-
-        <div class="form-tabs">
-            <div class="write-area">
-                <?= $this->form->textarea('description', $values, $errors, array('placeholder="'.t('Leave a description').'"', 'tabindex="2"')) ?>
-            </div>
-            <div class="preview-area">
-                <div class="markdown"></div>
-            </div>
-            <ul class="form-tabs-nav">
-                <li class="form-tab form-tab-selected">
-                    <i class="fa fa-pencil-square-o fa-fw"></i><a id="markdown-write" href="#"><?= t('Write') ?></a>
-                </li>
-                <li class="form-tab">
-                    <a id="markdown-preview" href="#"><i class="fa fa-eye fa-fw"></i><?= t('Preview') ?></a>
-                </li>
-            </ul>
-        </div>
-
-        <div class="form-help"><a href="http://kanboard.net/documentation/syntax-guide" target="_blank" rel="noreferrer"><?= t('Write your text in Markdown') ?></a></div>
-
-        <?php if (! isset($duplicate)): ?>
-            <?= $this->form->checkbox('another_task', t('Create another task'), 1, isset($values['another_task']) && $values['another_task'] == 1) ?>
-        <?php endif ?>
-    </div>
-
-    <div class="form-column">
-        <?= $this->form->hidden('project_id', $values) ?>
-
-        <?= $this->form->label(t('Assignee'), 'owner_id') ?>
-        <?= $this->form->select('owner_id', $users_list, $values, $errors, array('tabindex="3"')) ?><br/>
-
-        <?= $this->form->label(t('Category'), 'category_id') ?>
-        <?= $this->form->select('category_id', $categories_list, $values, $errors, array('tabindex="4"')) ?><br/>
-
-        <?php if (! (count($swimlanes_list) === 1 && key($swimlanes_list) === 0)): ?>
-        <?= $this->form->label(t('Swimlane'), 'swimlane_id') ?>
-        <?= $this->form->select('swimlane_id', $swimlanes_list, $values, $errors, array('tabindex="5"')) ?><br/>
-        <?php endif ?>
-
-        <?= $this->form->label(t('Column'), 'column_id') ?>
-        <?= $this->form->select('column_id', $columns_list, $values, $errors, array('tabindex="6"')) ?><br/>
-
-        <?= $this->form->label(t('Color'), 'color_id') ?>
-        <?= $this->form->select('color_id', $colors_list, $values, $errors, array('tabindex="7"')) ?><br/>
-
-        <?= $this->form->label(t('Complexity'), 'score') ?>
-        <?= $this->form->number('score', $values, $errors, array('tabindex="8"')) ?><br/>
-
-        <?= $this->form->label(t('Original estimate'), 'time_estimated') ?>
-        <?= $this->form->numeric('time_estimated', $values, $errors, array('tabindex="9"')) ?> <?= t('hours') ?><br/>
-
-        <?= $this->form->label(t('Due Date'), 'date_due') ?>
-        <?= $this->form->text('date_due', $values, $errors, array('placeholder="'.$this->text->in($date_format, $date_formats).'"', 'tabindex="10"'), 'form-date') ?><br/>
-        <div class="form-help"><?= t('Others formats accepted: %s and %s', date('Y-m-d'), date('Y_m_d')) ?></div>
-    </div>
-
-    <div class="form-actions">
-        <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue" tabindex="11"/>
-        <?= t('or') ?> <?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $values['project_id']), false, 'close-popover') ?>
-    </div>
-</form>
-</section>
diff --git a/app/Template/task/open.php b/app/Template/task/open.php
deleted file mode 100644
index fbcc1111..00000000
--- a/app/Template/task/open.php
+++ /dev/null
@@ -1,15 +0,0 @@
-<div class="page-header">
-    <h2><?= t('Open a task') ?></h2>
-</div>
-
-<div class="confirm">
-    <p class="alert alert-info">
-        <?= t('Do you really want to open this task: "%s"?', $this->e($task['title'])) ?>
-    </p>
-
-    <div class="form-actions">
-        <?= $this->url->link(t('Yes'), 'task', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'confirmation' => 'yes'), true, 'btn btn-red') ?>
-        <?= t('or') ?>
-        <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
-    </div>
-</div>
\ No newline at end of file
diff --git a/app/Template/task/public.php b/app/Template/task/public.php
index 73116de9..e3105488 100644
--- a/app/Template/task/public.php
+++ b/app/Template/task/public.php
@@ -4,7 +4,7 @@
 
     <p class="pull-right"><?= $this->url->link(t('Back to the board'), 'board', 'readonly', array('token' => $project['token'])) ?></p>
 
-    <?= $this->render('task/show_description', array(
+    <?= $this->render('task/description', array(
         'task' => $task,
         'project' => $project,
         'is_public' => true
diff --git a/app/Template/task/show.php b/app/Template/task/show.php
index a594d906..68d63c58 100644
--- a/app/Template/task/show.php
+++ b/app/Template/task/show.php
@@ -6,10 +6,10 @@
     'recurrence_basedate_list' => $this->task->recurrenceBasedates(),
 )) ?>
 
-<?= $this->render('task/time', array('task' => $task, 'values' => $values, 'date_format' => $date_format, 'date_formats' => $date_formats)) ?>
-<?= $this->render('task/show_description', array('task' => $task)) ?>
+<?= $this->render('task_modification/edit_time', array('task' => $task, 'values' => $values, 'date_format' => $date_format, 'date_formats' => $date_formats)) ?>
+<?= $this->render('task/description', array('task' => $task)) ?>
 <?= $this->render('tasklink/show', array('task' => $task, 'links' => $links, 'link_label_list' => $link_label_list)) ?>
 <?= $this->render('subtask/show', array('task' => $task, 'subtasks' => $subtasks, 'project' => $project, 'users_list' => isset($users_list) ? $users_list : array())) ?>
-<?= $this->render('task/timesheet', array('task' => $task)) ?>
+<?= $this->render('task/time_tracking_summary', array('task' => $task)) ?>
 <?= $this->render('file/show', array('task' => $task, 'files' => $files, 'images' => $images)) ?>
 <?= $this->render('task/comments', array('task' => $task, 'comments' => $comments, 'project' => $project)) ?>
diff --git a/app/Template/task/show_description.php b/app/Template/task/show_description.php
deleted file mode 100644
index f823e7d6..00000000
--- a/app/Template/task/show_description.php
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php if (! empty($task['description'])): ?>
-    <div id="description" class="task-show-section">
-        <div class="page-header">
-            <h2><?= t('Description') ?></h2>
-        </div>
-
-        <article class="markdown task-show-description">
-            <?php if (! isset($is_public)): ?>
-                <?= $this->text->markdown(
-                    $task['description'],
-                    array(
-                        'controller' => 'task',
-                        'action' => 'show',
-                        'params' => array(
-                            'project_id' => $task['project_id']
-                        )
-                    )
-                ) ?>
-            <?php else: ?>
-                <?= $this->text->markdown(
-                    $task['description'],
-                    array(
-                        'controller' => 'task',
-                        'action' => 'readonly',
-                        'params' => array(
-                            'token' => $project['token']
-                        )
-                    )
-                ) ?>
-            <?php endif ?>
-        </article>
-    </div>
-<?php endif ?>
\ No newline at end of file
diff --git a/app/Template/task/sidebar.php b/app/Template/task/sidebar.php
index 942e7d01..1116040a 100644
--- a/app/Template/task/sidebar.php
+++ b/app/Template/task/sidebar.php
@@ -15,20 +15,20 @@
         </li>
         <?php if ($task['time_estimated'] > 0 || $task['time_spent'] > 0): ?>
         <li>
-            <?= $this->url->link(t('Time tracking'), 'task', 'timesheet', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
+            <?= $this->url->link(t('Time tracking'), 'task', 'timetracking', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
         </li>
         <?php endif ?>
     </ul>
     <h2><?= t('Actions') ?></h2>
     <ul>
         <li>
-            <?= $this->url->link(t('Edit the task'), 'task', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
+            <?= $this->url->link(t('Edit the task'), 'taskmodification', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
         </li>
         <li>
-            <?= $this->url->link(t('Edit the description'), 'task', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
+            <?= $this->url->link(t('Edit the description'), 'taskmodification', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
         </li>
         <li>
-            <?= $this->url->link(t('Edit recurrence'), 'task', 'recurrence', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
+            <?= $this->url->link(t('Edit recurrence'), 'taskmodification', 'recurrence', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
         </li>
         <li>
             <?= $this->url->link(t('Add a sub-task'), 'subtask', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
@@ -56,9 +56,9 @@
         </li>
         <li>
             <?php if ($task['is_active'] == 1): ?>
-                <?= $this->url->link(t('Close this task'), 'task', 'close', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
+                <?= $this->url->link(t('Close this task'), 'taskstatus', 'close', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
             <?php else: ?>
-                <?= $this->url->link(t('Open this task'), 'task', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
+                <?= $this->url->link(t('Open this task'), 'taskstatus', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
             <?php endif ?>
         </li>
         <?php if ($this->task->canRemove($task)): ?>
diff --git a/app/Template/task/time.php b/app/Template/task/time.php
deleted file mode 100644
index 90407d7a..00000000
--- a/app/Template/task/time.php
+++ /dev/null
@@ -1,20 +0,0 @@
-<form method="post" action="<?= $this->url->href('task', 'time', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" class="form-inline task-time-form" autocomplete="off">
-
-    <?php if (empty($values['date_started'])): ?>
-        <?= $this->url->link('<i class="fa fa-play"></i>', 'task', 'start', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-show-start-link', t('Set automatically the start date')) ?>
-    <?php endif ?>
-
-    <?= $this->form->csrf() ?>
-    <?= $this->form->hidden('id', $values) ?>
-
-    <?= $this->form->label(t('Start date'), 'date_started') ?>
-    <?= $this->form->text('date_started', $values, array(), array('placeholder="'.$this->text->in($date_format, $date_formats).'"'), 'form-datetime') ?>
-
-    <?= $this->form->label(t('Time estimated'), 'time_estimated') ?>
-    <?= $this->form->numeric('time_estimated', $values, array(), array('placeholder="'.t('hours').'"')) ?>
-
-    <?= $this->form->label(t('Time spent'), 'time_spent') ?>
-    <?= $this->form->numeric('time_spent', $values, array(), array('placeholder="'.t('hours').'"')) ?>
-
-    <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
-</form>
\ No newline at end of file
diff --git a/app/Template/task/time_tracking.php b/app/Template/task/time_tracking.php
deleted file mode 100644
index 441cb585..00000000
--- a/app/Template/task/time_tracking.php
+++ /dev/null
@@ -1,27 +0,0 @@
-<?= $this->render('task/timesheet', array('task' => $task)) ?>
-
-<h3><?= t('Subtask timesheet') ?></h3>
-<?php if ($subtask_paginator->isEmpty()): ?>
-    <p class="alert"><?= t('There is nothing to show.') ?></p>
-<?php else: ?>
-    <table class="table-fixed">
-        <tr>
-            <th class="column-15"><?= $subtask_paginator->order(t('User'), 'username') ?></th>
-            <th><?= $subtask_paginator->order(t('Subtask'), 'subtask_title') ?></th>
-            <th class="column-20"><?= $subtask_paginator->order(t('Start'), 'start') ?></th>
-            <th class="column-20"><?= $subtask_paginator->order(t('End'), 'end') ?></th>
-            <th class="column-10"><?= $subtask_paginator->order(t('Time spent'), 'time_spent') ?></th>
-        </tr>
-        <?php foreach ($subtask_paginator->getCollection() as $record): ?>
-        <tr>
-            <td><?= $this->url->link($this->e($record['user_fullname'] ?: $record['username']), 'user', 'show', array('user_id' => $record['user_id'])) ?></td>
-            <td><?= t($record['subtask_title']) ?></td>
-            <td><?= dt('%B %e, %Y at %k:%M %p', $record['start']) ?></td>
-            <td><?= dt('%B %e, %Y at %k:%M %p', $record['end']) ?></td>
-            <td><?= n($record['time_spent']).' '.t('hours') ?></td>
-        </tr>
-        <?php endforeach ?>
-    </table>
-
-    <?= $subtask_paginator ?>
-<?php endif ?>
\ No newline at end of file
diff --git a/app/Template/task/time_tracking_details.php b/app/Template/task/time_tracking_details.php
new file mode 100644
index 00000000..faa07cb8
--- /dev/null
+++ b/app/Template/task/time_tracking_details.php
@@ -0,0 +1,27 @@
+<?= $this->render('task/time_tracking_summary', array('task' => $task)) ?>
+
+<h3><?= t('Subtask timesheet') ?></h3>
+<?php if ($subtask_paginator->isEmpty()): ?>
+    <p class="alert"><?= t('There is nothing to show.') ?></p>
+<?php else: ?>
+    <table class="table-fixed">
+        <tr>
+            <th class="column-15"><?= $subtask_paginator->order(t('User'), 'username') ?></th>
+            <th><?= $subtask_paginator->order(t('Subtask'), 'subtask_title') ?></th>
+            <th class="column-20"><?= $subtask_paginator->order(t('Start'), 'start') ?></th>
+            <th class="column-20"><?= $subtask_paginator->order(t('End'), 'end') ?></th>
+            <th class="column-10"><?= $subtask_paginator->order(t('Time spent'), 'time_spent') ?></th>
+        </tr>
+        <?php foreach ($subtask_paginator->getCollection() as $record): ?>
+        <tr>
+            <td><?= $this->url->link($this->e($record['user_fullname'] ?: $record['username']), 'user', 'show', array('user_id' => $record['user_id'])) ?></td>
+            <td><?= t($record['subtask_title']) ?></td>
+            <td><?= dt('%B %e, %Y at %k:%M %p', $record['start']) ?></td>
+            <td><?= dt('%B %e, %Y at %k:%M %p', $record['end']) ?></td>
+            <td><?= n($record['time_spent']).' '.t('hours') ?></td>
+        </tr>
+        <?php endforeach ?>
+    </table>
+
+    <?= $subtask_paginator ?>
+<?php endif ?>
\ No newline at end of file
diff --git a/app/Template/task/time_tracking_summary.php b/app/Template/task/time_tracking_summary.php
new file mode 100644
index 00000000..0210be7e
--- /dev/null
+++ b/app/Template/task/time_tracking_summary.php
@@ -0,0 +1,13 @@
+<?php if ($task['time_estimated'] > 0 || $task['time_spent'] > 0): ?>
+
+<div class="page-header">
+    <h2><?= t('Time tracking') ?></h2>
+</div>
+
+<ul class="listing">
+    <li><?= t('Estimate:') ?> <strong><?= $this->e($task['time_estimated']) ?></strong> <?= t('hours') ?></li>
+    <li><?= t('Spent:') ?> <strong><?= $this->e($task['time_spent']) ?></strong> <?= t('hours') ?></li>
+    <li><?= t('Remaining:') ?> <strong><?= $this->e($task['time_estimated'] - $task['time_spent']) ?></strong> <?= t('hours') ?></li>
+</ul>
+
+<?php endif ?>
\ No newline at end of file
diff --git a/app/Template/task/timesheet.php b/app/Template/task/timesheet.php
deleted file mode 100644
index 0210be7e..00000000
--- a/app/Template/task/timesheet.php
+++ /dev/null
@@ -1,13 +0,0 @@
-<?php if ($task['time_estimated'] > 0 || $task['time_spent'] > 0): ?>
-
-<div class="page-header">
-    <h2><?= t('Time tracking') ?></h2>
-</div>
-
-<ul class="listing">
-    <li><?= t('Estimate:') ?> <strong><?= $this->e($task['time_estimated']) ?></strong> <?= t('hours') ?></li>
-    <li><?= t('Spent:') ?> <strong><?= $this->e($task['time_spent']) ?></strong> <?= t('hours') ?></li>
-    <li><?= t('Remaining:') ?> <strong><?= $this->e($task['time_estimated'] - $task['time_spent']) ?></strong> <?= t('hours') ?></li>
-</ul>
-
-<?php endif ?>
\ No newline at end of file
diff --git a/app/Template/task_creation/form.php b/app/Template/task_creation/form.php
new file mode 100644
index 00000000..84f28a1e
--- /dev/null
+++ b/app/Template/task_creation/form.php
@@ -0,0 +1,84 @@
+<?php if (! $ajax): ?>
+<div class="page-header">
+    <ul>
+        <li><i class="fa fa-th fa-fw"></i><?= $this->url->link(t('Back to the board'), 'board', 'show', array('project_id' => $values['project_id'])) ?></li>
+    </ul>
+</div>
+<?php else: ?>
+<div class="page-header">
+    <h2><?= t('New task') ?></h2>
+</div>
+<?php endif ?>
+
+<section id="task-section">
+<form method="post" action="<?= $this->url->href('taskcreation', 'save', array('project_id' => $values['project_id'])) ?>" autocomplete="off">
+
+    <?= $this->form->csrf() ?>
+
+    <div class="form-column">
+        <?= $this->form->label(t('Title'), 'title') ?>
+        <?= $this->form->text('title', $values, $errors, array('autofocus', 'required', 'maxlength="200"', 'tabindex="1"'), 'form-input-large') ?><br/>
+
+        <?= $this->form->label(t('Description'), 'description') ?>
+
+        <div class="form-tabs">
+            <div class="write-area">
+                <?= $this->form->textarea('description', $values, $errors, array('placeholder="'.t('Leave a description').'"', 'tabindex="2"')) ?>
+            </div>
+            <div class="preview-area">
+                <div class="markdown"></div>
+            </div>
+            <ul class="form-tabs-nav">
+                <li class="form-tab form-tab-selected">
+                    <i class="fa fa-pencil-square-o fa-fw"></i><a id="markdown-write" href="#"><?= t('Write') ?></a>
+                </li>
+                <li class="form-tab">
+                    <a id="markdown-preview" href="#"><i class="fa fa-eye fa-fw"></i><?= t('Preview') ?></a>
+                </li>
+            </ul>
+        </div>
+
+        <div class="form-help"><a href="http://kanboard.net/documentation/syntax-guide" target="_blank" rel="noreferrer"><?= t('Write your text in Markdown') ?></a></div>
+
+        <?php if (! isset($duplicate)): ?>
+            <?= $this->form->checkbox('another_task', t('Create another task'), 1, isset($values['another_task']) && $values['another_task'] == 1) ?>
+        <?php endif ?>
+    </div>
+
+    <div class="form-column">
+        <?= $this->form->hidden('project_id', $values) ?>
+
+        <?= $this->form->label(t('Assignee'), 'owner_id') ?>
+        <?= $this->form->select('owner_id', $users_list, $values, $errors, array('tabindex="3"')) ?><br/>
+
+        <?= $this->form->label(t('Category'), 'category_id') ?>
+        <?= $this->form->select('category_id', $categories_list, $values, $errors, array('tabindex="4"')) ?><br/>
+
+        <?php if (! (count($swimlanes_list) === 1 && key($swimlanes_list) === 0)): ?>
+        <?= $this->form->label(t('Swimlane'), 'swimlane_id') ?>
+        <?= $this->form->select('swimlane_id', $swimlanes_list, $values, $errors, array('tabindex="5"')) ?><br/>
+        <?php endif ?>
+
+        <?= $this->form->label(t('Column'), 'column_id') ?>
+        <?= $this->form->select('column_id', $columns_list, $values, $errors, array('tabindex="6"')) ?><br/>
+
+        <?= $this->form->label(t('Color'), 'color_id') ?>
+        <?= $this->form->select('color_id', $colors_list, $values, $errors, array('tabindex="7"')) ?><br/>
+
+        <?= $this->form->label(t('Complexity'), 'score') ?>
+        <?= $this->form->number('score', $values, $errors, array('tabindex="8"')) ?><br/>
+
+        <?= $this->form->label(t('Original estimate'), 'time_estimated') ?>
+        <?= $this->form->numeric('time_estimated', $values, $errors, array('tabindex="9"')) ?> <?= t('hours') ?><br/>
+
+        <?= $this->form->label(t('Due Date'), 'date_due') ?>
+        <?= $this->form->text('date_due', $values, $errors, array('placeholder="'.$this->text->in($date_format, $date_formats).'"', 'tabindex="10"'), 'form-date') ?><br/>
+        <div class="form-help"><?= t('Others formats accepted: %s and %s', date('Y-m-d'), date('Y_m_d')) ?></div>
+    </div>
+
+    <div class="form-actions">
+        <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue" tabindex="11"/>
+        <?= t('or') ?> <?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $values['project_id']), false, 'close-popover') ?>
+    </div>
+</form>
+</section>
diff --git a/app/Template/task_modification/edit_description.php b/app/Template/task_modification/edit_description.php
new file mode 100644
index 00000000..3168f7a3
--- /dev/null
+++ b/app/Template/task_modification/edit_description.php
@@ -0,0 +1,38 @@
+<div class="page-header">
+    <h2><?= t('Edit the description') ?></h2>
+</div>
+
+<form method="post" action="<?= $this->url->href('taskmodification', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'ajax' => $ajax)) ?>" autocomplete="off">
+
+    <?= $this->form->csrf() ?>
+    <?= $this->form->hidden('id', $values) ?>
+
+    <div class="form-tabs">
+        <ul class="form-tabs-nav">
+            <li class="form-tab form-tab-selected">
+                <i class="fa fa-pencil-square-o fa-fw"></i><a id="markdown-write" href="#"><?= t('Write') ?></a>
+            </li>
+            <li class="form-tab">
+                <a id="markdown-preview" href="#"><i class="fa fa-eye fa-fw"></i><?= t('Preview') ?></a>
+            </li>
+        </ul>
+        <div class="write-area">
+            <?= $this->form->textarea('description', $values, $errors, array('autofocus', 'placeholder="'.t('Leave a description').'"'), 'task-show-description-textarea') ?>
+        </div>
+        <div class="preview-area">
+            <div class="markdown"></div>
+        </div>
+    </div>
+
+    <div class="form-help"><a href="http://kanboard.net/documentation/syntax-guide" target="_blank" rel="noreferrer"><?= t('Write your text in Markdown') ?></a></div>
+
+    <div class="form-actions">
+        <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
+        <?= t('or') ?>
+        <?php if ($ajax): ?>
+            <?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $task['project_id'])) ?>
+        <?php else: ?>
+            <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
+        <?php endif ?>
+    </div>
+</form>
diff --git a/app/Template/task_modification/edit_recurrence.php b/app/Template/task_modification/edit_recurrence.php
new file mode 100644
index 00000000..f63f1516
--- /dev/null
+++ b/app/Template/task_modification/edit_recurrence.php
@@ -0,0 +1,47 @@
+<div class="page-header">
+    <h2><?= t('Edit recurrence') ?></h2>
+</div>
+
+<?php if ($task['recurrence_status'] != \Model\Task::RECURRING_STATUS_NONE): ?>
+<div class="listing">
+    <?= $this->render('task/recurring_info', array(
+        'task' => $task,
+        'recurrence_trigger_list' => $recurrence_trigger_list,
+        'recurrence_timeframe_list' => $recurrence_timeframe_list,
+        'recurrence_basedate_list' => $recurrence_basedate_list,
+    )) ?>
+</div>
+<?php endif ?>
+
+<?php if ($task['recurrence_status'] != \Model\Task::RECURRING_STATUS_PROCESSED): ?>
+
+    <form method="post" action="<?= $this->url->href('taskmodification', 'recurrence', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off">
+
+        <?= $this->form->csrf() ?>
+
+        <?= $this->form->hidden('id', $values) ?>
+        <?= $this->form->hidden('project_id', $values) ?>
+
+        <?= $this->form->label(t('Generate recurrent task'), 'recurrence_status') ?>
+        <?= $this->form->select('recurrence_status', $recurrence_status_list, $values, $errors) ?>
+
+        <?= $this->form->label(t('Trigger to generate recurrent task'), 'recurrence_trigger') ?>
+        <?= $this->form->select('recurrence_trigger', $recurrence_trigger_list, $values, $errors) ?>
+
+        <?= $this->form->label(t('Factor to calculate new due date'), 'recurrence_factor') ?>
+        <?= $this->form->number('recurrence_factor', $values, $errors) ?>
+
+        <?= $this->form->label(t('Timeframe to calculate new due date'), 'recurrence_timeframe') ?>
+        <?= $this->form->select('recurrence_timeframe', $recurrence_timeframe_list, $values, $errors) ?>
+
+        <?= $this->form->label(t('Base date to calculate new due date'), 'recurrence_basedate') ?>
+        <?= $this->form->select('recurrence_basedate', $recurrence_basedate_list, $values, $errors) ?>
+
+        <div class="form-actions">
+            <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
+            <?= t('or') ?>
+            <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
+        </div>
+    </form>
+
+<?php endif ?>
\ No newline at end of file
diff --git a/app/Template/task_modification/edit_task.php b/app/Template/task_modification/edit_task.php
new file mode 100644
index 00000000..fe4696d6
--- /dev/null
+++ b/app/Template/task_modification/edit_task.php
@@ -0,0 +1,66 @@
+<div class="page-header">
+    <h2><?= t('Edit a task') ?></h2>
+</div>
+<section id="task-section">
+<form method="post" action="<?= $this->url->href('taskmodification', 'update', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'ajax' => $ajax)) ?>" autocomplete="off">
+
+    <?= $this->form->csrf() ?>
+
+    <div class="form-column">
+
+        <?= $this->form->label(t('Title'), 'title') ?>
+        <?= $this->form->text('title', $values, $errors, array('autofocus', 'required', 'maxlength="200"', 'tabindex="1"')) ?><br/>
+
+        <?= $this->form->label(t('Description'), 'description') ?>
+
+        <div class="form-tabs">
+            <div class="write-area">
+                <?= $this->form->textarea('description', $values, $errors, array('placeholder="'.t('Leave a description').'"', 'tabindex="2"')) ?>
+            </div>
+            <div class="preview-area">
+                <div class="markdown"></div>
+            </div>
+            <ul class="form-tabs-nav">
+                <li class="form-tab form-tab-selected">
+                    <i class="fa fa-pencil-square-o fa-fw"></i><a id="markdown-write" href="#"><?= t('Write') ?></a>
+                </li>
+                <li class="form-tab">
+                    <a id="markdown-preview" href="#"><i class="fa fa-eye fa-fw"></i><?= t('Preview') ?></a>
+                </li>
+            </ul>
+        </div>
+
+    </div>
+
+    <div class="form-column">
+        <?= $this->form->hidden('id', $values) ?>
+        <?= $this->form->hidden('project_id', $values) ?>
+
+        <?= $this->form->label(t('Assignee'), 'owner_id') ?>
+        <?= $this->form->select('owner_id', $users_list, $values, $errors, array('tabindex="3"')) ?><br/>
+
+        <?= $this->form->label(t('Category'), 'category_id') ?>
+        <?= $this->form->select('category_id', $categories_list, $values, $errors, array('tabindex="4"')) ?><br/>
+
+        <?= $this->form->label(t('Color'), 'color_id') ?>
+        <?= $this->form->select('color_id', $colors_list, $values, $errors, array('tabindex="5"')) ?><br/>
+
+        <?= $this->form->label(t('Complexity'), 'score') ?>
+        <?= $this->form->number('score', $values, $errors, array('tabindex="6"')) ?><br/>
+
+        <?= $this->form->label(t('Due Date'), 'date_due') ?>
+        <?= $this->form->text('date_due', $values, $errors, array('placeholder="'.$this->text->in($date_format, $date_formats).'"', 'tabindex="7"'), 'form-date') ?><br/>
+        <div class="form-help"><?= t('Others formats accepted: %s and %s', date('Y-m-d'), date('Y_m_d')) ?></div>
+    </div>
+
+    <div class="form-actions">
+        <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue" tabindex="10">
+        <?= t('or') ?>
+        <?php if ($ajax): ?>
+            <?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $task['project_id']), false, 'close-popover') ?>
+        <?php else: ?>
+            <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
+        <?php endif ?>
+    </div>
+</form>
+</section>
diff --git a/app/Template/task_modification/edit_time.php b/app/Template/task_modification/edit_time.php
new file mode 100644
index 00000000..8e7f9b42
--- /dev/null
+++ b/app/Template/task_modification/edit_time.php
@@ -0,0 +1,20 @@
+<form method="post" action="<?= $this->url->href('taskmodification', 'time', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" class="form-inline task-time-form" autocomplete="off">
+
+    <?php if (empty($values['date_started'])): ?>
+        <?= $this->url->link('<i class="fa fa-play"></i>', 'taskmodification', 'start', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-show-start-link', t('Set automatically the start date')) ?>
+    <?php endif ?>
+
+    <?= $this->form->csrf() ?>
+    <?= $this->form->hidden('id', $values) ?>
+
+    <?= $this->form->label(t('Start date'), 'date_started') ?>
+    <?= $this->form->text('date_started', $values, array(), array('placeholder="'.$this->text->in($date_format, $date_formats).'"'), 'form-datetime') ?>
+
+    <?= $this->form->label(t('Time estimated'), 'time_estimated') ?>
+    <?= $this->form->numeric('time_estimated', $values, array(), array('placeholder="'.t('hours').'"')) ?>
+
+    <?= $this->form->label(t('Time spent'), 'time_spent') ?>
+    <?= $this->form->numeric('time_spent', $values, array(), array('placeholder="'.t('hours').'"')) ?>
+
+    <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
+</form>
\ No newline at end of file
diff --git a/app/Template/task_status/close.php b/app/Template/task_status/close.php
new file mode 100644
index 00000000..4de3dcb2
--- /dev/null
+++ b/app/Template/task_status/close.php
@@ -0,0 +1,15 @@
+<div class="page-header">
+    <h2><?= t('Close a task') ?></h2>
+</div>
+
+<div class="confirm">
+    <p class="alert alert-info">
+        <?= t('Do you really want to close the task "%s" as well as all subtasks?', $this->e($task['title'])) ?>
+    </p>
+
+    <div class="form-actions">
+        <?= $this->url->link(t('Yes'), 'taskstatus', 'close', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'confirmation' => 'yes', 'redirect' => $redirect), true, 'btn btn-red') ?>
+        <?= t('or') ?>
+        <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?>
+    </div>
+</div>
\ No newline at end of file
diff --git a/app/Template/task_status/open.php b/app/Template/task_status/open.php
new file mode 100644
index 00000000..0043fdae
--- /dev/null
+++ b/app/Template/task_status/open.php
@@ -0,0 +1,15 @@
+<div class="page-header">
+    <h2><?= t('Open a task') ?></h2>
+</div>
+
+<div class="confirm">
+    <p class="alert alert-info">
+        <?= t('Do you really want to open this task: "%s"?', $this->e($task['title'])) ?>
+    </p>
+
+    <div class="form-actions">
+        <?= $this->url->link(t('Yes'), 'taskstatus', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'confirmation' => 'yes'), true, 'btn btn-red') ?>
+        <?= t('or') ?>
+        <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
+    </div>
+</div>
\ No newline at end of file
diff --git a/app/common.php b/app/common.php
index 815d2643..7f66c05e 100644
--- a/app/common.php
+++ b/app/common.php
@@ -86,9 +86,24 @@ if (ENABLE_URL_REWRITE) {
     // Task routes
     $container['router']->addRoute('project/:project_id/task/:task_id', 'task', 'show', array('project_id', 'task_id'));
     $container['router']->addRoute('t/:task_id', 'task', 'show', array('task_id'));
-    $container['router']->addRoute('project/:project_id/swimlane/:swimlane_id/column/:column_id', 'task', 'create', array('project_id', 'swimlane_id', 'column_id'));
     $container['router']->addRoute('public/task/:task_id/:token', 'task', 'readonly', array('task_id', 'token'));
 
+    $container['router']->addRoute('project/:project_id/task/:task_id/activity', 'activity', 'task', array('project_id', 'task_id'));
+    $container['router']->addRoute('project/:project_id/task/:task_id/screenshot', 'file', 'screenshot', array('project_id', 'task_id'));
+    $container['router']->addRoute('project/:project_id/task/:task_id/upload', 'file', 'create', array('project_id', 'task_id'));
+    $container['router']->addRoute('project/:project_id/task/:task_id/comment', 'comment', 'create', array('project_id', 'task_id'));
+    $container['router']->addRoute('project/:project_id/task/:task_id/link', 'tasklink', 'create', array('project_id', 'task_id'));
+    $container['router']->addRoute('project/:project_id/task/:task_id/transitions', 'task', 'transitions', array('project_id', 'task_id'));
+    $container['router']->addRoute('project/:project_id/task/:task_id/analytics', 'task', 'analytics', array('project_id', 'task_id'));
+    $container['router']->addRoute('project/:project_id/task/:task_id/remove', 'task', 'remove', array('project_id', 'task_id'));
+
+    $container['router']->addRoute('project/:project_id/task/:task_id/edit', 'taskmodification', 'edit', array('project_id', 'task_id'));
+    $container['router']->addRoute('project/:project_id/task/:task_id/description', 'taskmodification', 'description', array('project_id', 'task_id'));
+    $container['router']->addRoute('project/:project_id/task/:task_id/recurrence', 'taskmodification', 'recurrence', array('project_id', 'task_id'));
+
+    $container['router']->addRoute('project/:project_id/task/:task_id/close', 'taskstatus', 'close', array('task_id', 'project_id'));
+    $container['router']->addRoute('project/:project_id/task/:task_id/open', 'taskstatus', 'open', array('task_id', 'project_id'));
+
     $container['router']->addRoute('project/:project_id/task/:task_id/duplicate', 'taskduplication', 'duplicate', array('task_id', 'project_id'));
     $container['router']->addRoute('project/:project_id/task/:task_id/copy', 'taskduplication', 'copy', array('task_id', 'project_id'));
     $container['router']->addRoute('project/:project_id/task/:task_id/copy/:dst_project_id', 'taskduplication', 'copy', array('task_id', 'project_id', 'dst_project_id'));
@@ -112,7 +127,9 @@ if (ENABLE_URL_REWRITE) {
     $container['router']->addRoute('list/:project_id/:search', 'listing', 'show', array('project_id', 'search'));
 
     // Subtask routes
-    $container['router']->addRoute('project/:project_id/task/:task_id/subtask/:subtask_id', 'subtask', 'remove', array('project_id', 'task_id', 'subtask_id'));
+    $container['router']->addRoute('project/:project_id/task/:task_id/subtask/create', 'subtask', 'create', array('project_id', 'task_id'));
+    $container['router']->addRoute('project/:project_id/task/:task_id/subtask/:subtask_id/remove', 'subtask', 'confirm', array('project_id', 'task_id', 'subtask_id'));
+    $container['router']->addRoute('project/:project_id/task/:task_id/subtask/:subtask_id/edit', 'subtask', 'edit', array('project_id', 'task_id', 'subtask_id'));
 
     // Feed routes
     $container['router']->addRoute('feed/project/:token', 'feed', 'project', array('token'));
-- 
cgit v1.2.3