diff options
Diffstat (limited to 'app/Model/Subtask.php')
-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; } /** |