added contact edit button
This commit is contained in:
@@ -11,7 +11,11 @@ class ConstructionConsentOwnerController extends mfBaseController
|
||||
$this->me = $me;
|
||||
$this->layout()->set("me", $me);
|
||||
|
||||
if (!($me->is(["Admin","netowner","salespartner"]) && in_array($me->address_id, [1,209,5908,2187]))) $this->redirect("Dashboard");
|
||||
if ($this->me->is("Admin")) $this->constructionConsentProjects = array_column(ConstructionConsentProject::getAll(), 'id');
|
||||
else {
|
||||
$constructionConsentProjects = json_decode((new WorkerFlag($this->me->id, "constructionConsent_projects"))->value() ?? '[]');
|
||||
empty($constructionConsentProjects) ? $this->redirect("Dashboard") : $this->constructionConsentProjects = $constructionConsentProjects;
|
||||
}
|
||||
}
|
||||
|
||||
protected function uploadDocumentAction() {
|
||||
@@ -76,6 +80,11 @@ class ConstructionConsentOwnerController extends mfBaseController
|
||||
$this->redirect("ConstructionConsent");
|
||||
}
|
||||
|
||||
if (!in_array($cc->constructionconsentproject_id, $this->constructionConsentProjects)) {
|
||||
$this->layout()->setFlash("Sie sind nicht berechtigt, diese Zustimmungserklärung zu bearbeiten", "error");
|
||||
$this->redirect("ConstructionConsent");
|
||||
}
|
||||
|
||||
$data = [];
|
||||
$data["constructionconsent_id"] = $cc_id;
|
||||
$data["title"] = $r->title;
|
||||
@@ -128,6 +137,11 @@ class ConstructionConsentOwnerController extends mfBaseController
|
||||
|
||||
$consent = $owner->consent;
|
||||
|
||||
if (!in_array($consent->constructionconsentproject_id, $this->constructionConsentProjects)) {
|
||||
$this->layout()->setFlash("Sie sind nicht berechtigt, diese Zustimmungserklärung zu bearbeiten", "error");
|
||||
$this->redirect("ConstructionConsent");
|
||||
}
|
||||
|
||||
foreach($owner->files as $file) {
|
||||
$file->file->delete();
|
||||
$file->delete();
|
||||
|
||||
Reference in New Issue
Block a user