diff --git a/application/Contract/ContractController.php b/application/Contract/ContractController.php index 245c51ecf..9e15cdb19 100644 --- a/application/Contract/ContractController.php +++ b/application/Contract/ContractController.php @@ -92,6 +92,39 @@ class ContractController extends mfBaseController { } protected function viewAction() { + if(1) { + if(!$this->me->is(["Admin"])) { + $this->redirect("Dashboard"); + } + + $this->layout()->setTemplate("Contract/View"); + + $id = $this->request->contract_id; + if (!$id) { + $id = $this->request->id; + } + if (!is_numeric($id) || !$id) { + $this->layout()->setFlash("Vertrag nicht gefunden", "error"); + $this->redirect("Contract"); + } + + $contract = new Contract($id); + if (!$contract->id) { + $this->layout()->setFlash("Vertrag nicht gefunden", "error"); + $this->redirect("Contract"); + } + + $this->layout()->set("contract", $contract); + + if ($this->request->filter) { + $this->layout()->set("filter", $this->request->filter); + } + if ($this->request->s) { + $this->layout()->set("filter", $this->request->s); + } + return true; + } + if (!$this->me->is(["Admin"])) { $this->redirect("Dashboard"); }