/**
  * Handling state! signal.
  * @param  int 	$val 	Either 0 or 1, depending on the state before.
  * @param  int 	$id 	The id of the task.
  */
 public function handleState($val, $id)
 {
     $user = $this->getUser();
     if ($user->isLoggedIn()) {
         $this->tasksModel->updateState($val, $id);
         $this->flashMessage('Stav zakázky byl úspěšně upraven.', 'success');
         $this->redrawControl('taskContainer');
     } else {
         $this->flashMessage('Pro provedení této operace je nutné být přihlášen.', 'error');
         $this->redirect('Sign:in');
     }
 }