added new features

This commit is contained in:
Luca Haid
2025-03-25 13:49:16 +01:00
parent c94d7de181
commit af6a4e02f5
7 changed files with 199 additions and 33 deletions

View File

@@ -111,6 +111,7 @@ class ConstructionConsentController extends mfBaseController {
protected function viewAction() : void {
$this->layout()->setTemplate("ConstructionConsent/View");
$this->layout()->set("is_admin", $this->me->isAdmin());
$id = $this->request->id;
if(!is_numeric($id) || $id < 1) {
@@ -1027,4 +1028,20 @@ class ConstructionConsentController extends mfBaseController {
"status_light_green" => getFilteredCount("status_light", "green", $baseFilter)
];
}
protected function approveOverrideAction() {
$consent_id = $this->request->consent_id;
$checked = $this->request->checked;
$consent = new ConstructionConsent($consent_id);
if(!$consent->id) {
$this->returnJson(["status" => "error"]);
}
$consent->update(["approve_override" => $checked]);
$consent->save();
$this->returnJson(["status" => "OK"]);
}
}