Restored old Contract View

This commit is contained in:
Frank Schubert
2025-01-07 19:57:31 +01:00
parent 9368397785
commit 0e0a321ca7

View File

@@ -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");
}