In Progress -> Done. */ public function change() { $task = $this->getTask(); $subtask = $this->getSubtask(); if ($subtask['status'] == SubtaskModel::STATUS_DONE) { $status = SubtaskModel::STATUS_TODO; } else { $status = SubtaskModel::STATUS_DONE; } $subtask['status'] = $status; $this->subtaskModel->update($subtask); if ($this->request->getIntegerParam('refresh-table') === 0) { $html = $this->helper->subtask->toggleStatus($subtask, $task['project_id']); } else { $html = $this->renderTable($task); } $this->response->html($html); } protected function renderTable(array $task) { return $this->template->render('subtask/table', array( 'task' => $task, 'subtasks' => $this->subtaskModel->getAll($task['id']), 'editable' => true, )); } } ?>