added contact edit button
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user