From 0e0a321ca70d8cbc7cd26720b53912f756df2c3f Mon Sep 17 00:00:00 2001 From: Frank Schubert Date: Tue, 7 Jan 2025 19:57:31 +0100 Subject: [PATCH] Restored old Contract View --- application/Contract/ContractController.php | 33 +++++++++++++++++++++ 1 file changed, 33 insertions(+) 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"); }