added contact edit button

This commit is contained in:
Luca Haid
2025-03-25 10:38:20 +01:00
parent 7be3446383
commit 321726718f
11 changed files with 157 additions and 50 deletions
@@ -9,7 +9,11 @@ class ConstructionConsentJournalController extends mfBaseController {
$this->me = $me;
$this->layout()->set("me",$me);
if (!($me->is(["Admin","netowner","salespartner"]) && in_array($me->address_id, [1,209,5908]))) $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 saveAction() {
@@ -28,6 +32,11 @@ class ConstructionConsentJournalController extends mfBaseController {
$this->redirect("ConstructionConsent");
}
if (!in_array($consent->constructionconsentproject_id, $this->constructionConsentProjects)) {
$this->layout()->setFlash("Sie sind nicht berechtigt, diese Zustimmungserklärung zu bearbeiten", "error");
$this->redirect("ConstructionConsent");
}
$text = trim(htmlentities($r->text));
if(!$text) {
$this->layout()->setFlash("Bitte Text eingeben", "error");