ConstructionConsent Basic Building data

This commit is contained in:
Frank Schubert
2025-01-20 15:24:14 +01:00
parent 269456eed6
commit e82e66ceae
5 changed files with 136 additions and 19 deletions

View File

@@ -47,7 +47,7 @@
<div class="col-lg-10">
<select class="form-control" name="object_type" id="object_type">
<option value="building" <?=(isset($item) && $item->object_type == "building" ? "selected='selected'" : "")?>>Gebäude</option>
<option value="street" <?=(isset($item) && $item->object_type == "street" ? "selected='selected'" : "")?>>Straße/Grunstück</option>
<option value="street" <?=(isset($item) && $item->object_type == "street" ? "selected='selected'" : "")?>>Straße/Grundstück</option>
</select>
</div>
</div>
@@ -59,7 +59,20 @@
</div>
</div>
<div id="street-search">
<div id="address-search" class="<?=(!isset($item) || (isset($item) && $item->object_type == "building")) ? "" : "hidden"?>">
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="adb_hausnummer_id">Gebäude *</label>
<div class="col-lg-10">
<select class="form-control" name="adb_hausnummer_id" id="adb_hausnummer_id">
<?php if(isset($item) && $item->adb_hausnummer_id): ?>
<option value="<?=$item->adb_hausnummer_id?>" selected="selected"><?=$item->adb_hausnummer->gemeinde->name?>, <?=$item->adb_hausnummer->strasse->name?> <?=$item->adb_hausnummer->hausnummer?></option>
<?php endif; ?>
</select>
</div>
</div>
</div>
<div id="street-search" class="<?=(!isset($item) || $item->object_type != "street") ? "hidden" : ""?>">
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="adb_strasse_id">Straße *</label>
<div class="col-lg-10">
@@ -73,6 +86,8 @@
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="ez">Grundbuch Einlagezahl EZ</label>
<div class="col-lg-10">
@@ -243,6 +258,22 @@
});
*/
$("#object_type").change(() => {
var type = $("#object_type").val();
if(type == "street") {
$("#address-search").hide();
$("#adb_hausnummer_id").val("").change();
$("#street-search").show();
} else {
$("#street-search").hide();
$("#adb_strasse_id").val("").change();
$("#address-search").show();
}
});
$('#adb_strasse_id').select2({
ajax: {
url: '<?=self::getUrl("ConstructionConsent", "api")?>',
@@ -261,6 +292,24 @@
allowClear: true
});
$('#adb_hausnummer_id').select2({
ajax: {
url: '<?=self::getUrl("ConstructionConsent", "api")?>',
data: (params) => {
return {
q: params.term,
do: "findAddress",
project_id: $("#constructionconsentproject_id :selected").val()
}
},
delay: 250,
dataType: 'json'
},
minimumInputLength: 2,
placeholder: "Suche nach Adresse",
allowClear: true
});
$('#plan_adb_hausnummer_id').select2({
ajax: {
url: '<?=self::getUrl("ConstructionConsent", "api")?>',
@@ -314,7 +363,7 @@
$("#plan_preview").attr("src", URL.createObjectURL(file));
}
});
$("#constructionconsentproject_id").change(() => {
$("#adb_strasse_id").val("").change();

View File

@@ -62,7 +62,7 @@ $pagination_entity_name = "Zustimmungserklärungen";
<div class="row mt-2">
<div class="col">
<button type="submit" class="btn btn-primary"><i class="far fa-search fa-fw"></i> Filter anwenden</button>
<a class="btn btn-secondary" href="<?=self::getUrl("ConstructionConsent", "", ["resetFilter" => 1, "filter" => ["project_id" => $filter["project_id"]]])?>"><i class="far fa-xmark fa-fw"></i> Filter zurücksetzen</a>
<a class="btn btn-secondary" href="<?=self::getUrl("ConstructionConsent", "", ["resetFilter" => 1, "filter" => ["project_id" => (is_array($filter) && array_key_exists("project_id", $filter) ? $filter["project_id"] : "")]])?>"><i class="far fa-xmark fa-fw"></i> Filter zurücksetzen</a>
</div>
</div>
</form>
@@ -80,7 +80,7 @@ $pagination_entity_name = "Zustimmungserklärungen";
<h4 class="header-title">Liste aller Zustimmmungserklärungen</h4>
</div>
<div class="float-right">
<a class="btn btn-primary" href="<?=self::getUrl("ConstructionConsent", "add", ["project_id" => $filter["project_id"]])?>"><i class="fas fa-plus"></i> Neue Zustimmungserklärung anlegen</a>
<a class="btn btn-primary" href="<?=self::getUrl("ConstructionConsent", "add", ["project_id" => (is_array($filter) && array_key_exists("project_id", $filter) ? $filter["project_id"] : "")])?>"><i class="fas fa-plus"></i> Neue Zustimmungserklärung anlegen</a>
</div>
</div>
</div>
@@ -108,7 +108,7 @@ $pagination_entity_name = "Zustimmungserklärungen";
<td><?=__($item->object_type)?></td>
<td>
<?php if($item->object_type == "street"): ?>
<?=$item->adb_strasse->name?>
<?=$item->adb_strasse->name?>, <?=$item->adb_strasse->ortschaft->name?><br />
<?=$item->adb_strasse->gemeinde->name?>
<?php else: ?>
<?=$item->adb_hausnummer->strasse->name?>

View File

@@ -51,10 +51,28 @@ $pagination_entity_name = "Adressen";
</tr><tr>
<th>Objekttyp</th>
<td><?=__($item->object_type, "consent")?></td>
</tr><tr>
<th>Straße</th>
<td><?=$item->adb_strasse->gemeinde->name?>, <?=$item->adb_strasse->name?></td>
</tr><tr>
</tr>
<?php if($item->object_type == "building"): ?>
<tr>
<th>Gebäude</th>
<td>
<?=$item->adb_hausnummer->ortschaft->name?>, <?=$item->adb_hausnummer->strasse->name?> <?=$item->adb_hausnummer->hausnummer?><br />
<?=$item->adb_hausnummer->strasse->gemeinde->name?>
</td>
</tr><tr>
<th>Anzahl Bestellungen</th>
<td><?=$item->preorder_count?></td>
</tr>
<?php else: ?>
<tr>
<th>Straße</th>
<td>
<?=$item->adb_strasse->ortschaft->name?>, <?=$item->adb_strasse->name?><br />
<?=$item->adb_strasse->gemeinde->name?>
</td>
</tr>
<?php endif; ?>
<tr>
<th>Geplante Länge</th>
<td><?=$item->usage_length?> lfm</td>
</tr><tr>
@@ -88,7 +106,17 @@ $pagination_entity_name = "Adressen";
<?php endif; ?>
Die Nutzung der Liegenschaft seitens BB dient der Eigenversorgung der GE und/oder dessen Nutzer(in) und wird dieser entgeltlos zugestimmt
</td>
</tr><tr>
</tr>
<?php if($item->object_type == "building"): ?>
<tr>
<td colspan="2"><h4>Metadaten</h4></td>
</tr><tr>
<th>Anzahl Bestellungen</th>
<td><?=$item->preorder_count?></td>
</tr>
<?php endif; ?>
<tr>
<td colspan="2"><h4>Grundbuchdaten</h4></td>
</tr><tr>
<th>EZ</th>
@@ -193,9 +221,9 @@ $pagination_entity_name = "Adressen";
</div>
<div>
<?php foreach($owner->files as $file): ?>
<?php if(is_array($owner->files) && count($owner->files)): foreach($owner->files as $file): ?>
<a href="<?=self::getUrl("File", "download", ["id" => $file->file_id])?>"><i class="far fa-fw fa-file"></i> <?=$file->filename?></a><br />
<?php endforeach; ?>
<?php endforeach; endif; ?>
</div>
<hr />