/** * Handling delete! signal. * @param int $id The id of the task. */ public function handleDelete($id) { $user = $this->getUser(); if ($user->isLoggedIn()) { $this->tasksModel->deleteItem($id); $this->flashMessage('Zakázka byla úspěšně smazána.', 'success'); $this->redrawControl('taskContainer'); } else { $this->flashMessage('Pro provedení této operace je nutné být přihlášen.', 'error'); $this->redirect('Sign:in'); } }