ConstructionConsent: Owners editable & status/result stats
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user