Do not refresh the whole page when changing subtask status (work in progress)

This commit is contained in:
Frederic Guillot
2016-02-04 21:38:53 -05:00
parent 346151e103
commit 0f2b46dd6a
21 changed files with 243 additions and 254 deletions

View File

@@ -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;
}
/**