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
+7 -3
View File
@@ -8,8 +8,12 @@
<li class="breadcrumb-item"><a href="<?= self::getUrl("Dashboard") ?>"><?= MFAPPNAME_SLUG ?></a></li>
<li class="breadcrumb-item"><a href="<?=self::getUrl("ConstructionConsentProject")?>">Zustimmungserklärungsprojekte</a></li>
<li class="breadcrumb-item"><a href="<?=self::getUrl("ConstructionConsent")?>">Zustimmungserklärungen</a></li>
<?php if(isset($item)): ?>
<li class="breadcrumb-item"><a href="<?=self::getUrl("ConstructionConsent", "View", ["id" => $item->id])?>"><?=htmlentities($item->name)?></a></li>
<li class="breadcrumb-item active">bearbeiten</li>
<?php endif; ?>
<li class="breadcrumb-item active">
<?= ($Action == "add") ? "Neue " : "" ?>Zustimmungserklärung <?= ($Action == "edit") ? "bearbeiten " : "" ?>
</li>
</ol>
</div>
<h4 class="page-title">Zustimmungserklärung</h4>
@@ -37,7 +41,7 @@
<label class="col-lg-2 col-form-label" for="constructionconsentproject_id">Projekt *</label>
<div class="col-lg-10">
<select class="form-control" name="constructionconsentproject_id" id="constructionconsentproject_id">
<?php foreach(ConstructionConsentProject::getAll() as $project): ?>
<?php foreach(ConstructionConsentProject::search(['id' => $allowed_projects]) as $project): ?>
<option value="<?=$project->id?>" <?=(isset($project_id) && $project_id == $project->id || isset($item) && $item->constructionconsentproject_id == $project->id) ? "selected='selected'" : ""?>><?=$project->name?></option>
<?php endforeach; ?>
</select>
@@ -204,7 +208,7 @@
<h5 class="card-header">Plan Vorschau <button type='button' id="delete-rimo-plan" class='ml-2 btn btn-sm btn-outline-danger pointer <?=($item->file && $item->file->file && $item->file->file->fileExists()) ? "" : "hidden" ?>' onclick='deletePlan()'><i class='fas fa-fw fa-trash'></i> Plan löschen</button></h5>
<div class="card-body" id="rimo-plan-container">
<input type="hidden" name="submit_plan_file_id" id="submit_plan_file_id" value="" />
<img id="plan_preview" style="max-width: 1200px;" <?=($item->file && $item->file->file && $item->file->file->fileExists()) ? "src=".$item->file->file->asDataUrl()."" : "" ?> />
<img id="plan_preview" style="max-width: 1200px;" <?=(isset($item) && $item->file && $item->file->file && $item->file->file->fileExists()) ? "src=".$item->file->file->asDataUrl()."" : "" ?> />
</div>
</div>
+1 -1
View File
@@ -37,7 +37,7 @@ $pagination_entity_name = "Zustimmungserklärungen";
<label class="form-label" for="filter_project_id">Projekt</label>
<select name="filter[project_id]" id="filter_project_id" class="form-control">
<option value="">Alle</option>
<?php foreach(ConstructionConsentProject::getAll() as $p): ?>
<?php foreach(ConstructionConsentProject::search(['id' => $allowed_projects]) as $p): ?>
<option value="<?=$p->id?>" <?=(is_array($filter) && array_key_exists("project_id", $filter) && $p->id == $filter["project_id"]) ? "selected='selected'" : ""?>><?=$p->name?></option>
<?php endforeach; ?>
</select>
+37
View File
@@ -257,6 +257,38 @@ $siteTitle = "Benutzer";
</div>
</div>
</div>
<div class="card">
<div class="card-body">
<h4 class="card-title mb-3">Zustimmungserklärungen</h4>
<div class="form-group" id="constructionconsent-projects-container">
<label for="constructionconsent_projects">Zustimmungserklärungsprojekte:</label>
<?php
$constructionConsent_projects = [];
if($user->id) {
$constructionConsent_projects = json_decode((new WorkerFlag($user->id, "constructionConsent_projects"))->value());
if(!$constructionConsent_projects) {
$constructionConsent_projects = [];
}
}
?>
<select name="constructionconsent_projects[]" id="constructionconsent_projects"
class="form-control" multiple="multiple">
<?php foreach(ConstructionConsentProject::getAll() as $project): ?>
<option value="<?=$project->id?>" <?=(in_array($project->id, $constructionConsent_projects)) ? "selected='selected'" : ""?>><?=$project->name?></option>
<?php endforeach; ?>
</select>
<small>Benutzer kann nur Zustimmungserklärungen in diesen Projekten sehen</small>
</div>
</div>
</div>
<div class="card">
<div class="card-body">
@@ -481,6 +513,11 @@ $siteTitle = "Benutzer";
placeholder: "",
closeOnSelect: false
});
$("#constructionconsent_projects").select2({
allowClear: true,
placeholder: "",
closeOnSelect: false
});
<?php if(!$user || (!$user->is("preorderfront") && !$user->is("preorderaddressreporting")) ): ?>
//$("#preorder-network-container").hide();