needlogin = true; $me = new User(); $me->loadMe(); $this->me = $me; $this->layout()->set("me", $me); if (!$me->can(["Fibu"])) { $this->redirect("Dashboard"); } } protected function indexAction() { $this->layout()->setTemplate("TimerecordingPermit/Index"); $timerecordingCategoriess = TimerecordingCategoryModel::getAll(); $this->layout()->set("timerecordingCategoriess", $timerecordingCategoriess); $timerecordings = TimerecordingModel::getAllPermits(); $this->layout()->set("timerecordings", $timerecordings); } protected function addAction() { } protected function editAction() { } protected function saveAction() { } protected function approveAction() { $id = $this->request->id; $timerecordings = new Timerecording($id); if (!$timerecordings->id || $timerecordings->id != $id) { $this->layout()->setFlash("Buchung nicht gefunden.", "error"); $this->redirect("TimerecordingPermit"); } $data = []; $data['approved'] = 1; $timerecordings->update($data); $timerecordings->save(); $this->redirect("TimerecordingPermit"); } }