diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-02-04 21:38:53 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-02-04 21:38:53 -0500 |
commit | 0f2b46dd6a9a1dc17768de2c415f382df95142e8 (patch) | |
tree | 55191fce45c7c06b7d2b45834ea4151745c3db77 /app/Model | |
parent | 346151e103431e8de12520b26daae10676b8faf5 (diff) |
Do not refresh the whole page when changing subtask status (work in progress)
Diffstat (limited to 'app/Model')
-rw-r--r-- | app/Model/Subtask.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/Model/Subtask.php b/app/Model/Subtask.php index 1e989ad5..14853941 100644 --- a/app/Model/Subtask.php +++ b/app/Model/Subtask.php @@ -353,15 +353,16 @@ class Subtask extends Base * * @access public * @param integer $subtask_id - * @return bool + * @return boolean|integer */ public function toggleStatus($subtask_id) { $subtask = $this->getById($subtask_id); + $status = ($subtask['status'] + 1) % 3; $values = array( 'id' => $subtask['id'], - 'status' => ($subtask['status'] + 1) % 3, + 'status' => $status, 'task_id' => $subtask['task_id'], ); @@ -369,7 +370,7 @@ class Subtask extends Base $values['user_id'] = $this->userSession->getId(); } - return $this->update($values); + return $this->update($values) ? $status : false; } /** |