ConstructionConsent: Owners editable & status/result stats

This commit is contained in:
Frank Schubert
2025-01-27 15:39:53 +01:00
parent 9f1aa95367
commit fe103d5746
3 changed files with 118 additions and 2 deletions

View File

@@ -106,6 +106,29 @@ class ConstructionConsentOwnerController extends mfBaseController
}
protected function deleteAction() {
$id = $this->request->id;
$owner = new ConstructionConsentOwner($id);
if(!$owner->id) {
$this->layout()->setFlash("Besitzer nicht gefunden!", "error");
$this->redirect("ConstructionConsent");
}
$consent = $owner->consent;
foreach($owner->files as $file) {
$file->file->delete();
$file->delete();
}
$owner->delete();
$this->layout()->setFlash("Besitzer gelöscht!", "success");
$this->redirect("ConstructionConsent", "View", ["id" => $consent->id]);
}
protected function apiAction() {
if(!$this->me->is(["Admin"])) {
$this->redirect("Dashboard");