431 lines
22 KiB
PHP
431 lines
22 KiB
PHP
<?php
|
|
$pagination_entity_name = "Adressen";
|
|
?>
|
|
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/header.php"); ?>
|
|
|
|
<!-- start page title -->
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<div class="page-title-box">
|
|
<div class="page-title-right">
|
|
<ol class="breadcrumb m-0">
|
|
<li class="breadcrumb-item"><a href="<?=self::getUrl("Dashboard")?>"><?=MFAPPNAME_SLUG?></a></li>
|
|
<li class="breadcrumb-item"><a href="<?=self::getUrl("ConstructionConsent")?>">Zustimmungserklärungen</a></li>
|
|
<li class="breadcrumb-item active"><?=$item->name?></li>
|
|
</ol>
|
|
</div>
|
|
<h4 class="page-title">Zustimmungserkärungen</h4>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- end page title -->
|
|
|
|
<div class="row">
|
|
<div class="col-lg-12">
|
|
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<a href="<?=self::getUrl("ConstructionConsent")?>" class="btn btn-secondary mr-1"><i class="fas fa-fw fa-list"></i> Zurück zur Übersicht</a>
|
|
<a href="<?=self::getUrl("ConstructionConsent","edit", ['id' => $item->id])?>" class="btn btn-outline-success"><i class="fas fa-fw fa-edit"></i> Zustimmungserklärung bearbeiten</a>
|
|
|
|
|
|
<?php if(!is_array($item->owners) || !count($item->owners)):?>
|
|
<a href="#" class="float-right btn btn-outline-primary disabled mr-1"><i class="fas fa-fw fa-envelope"></i> Zustimmungserklärungsformular an alle Besitzer senden</a>
|
|
<?php else: ?>
|
|
<a href="<?=self::getUrl("ConstructionConsent", "Send", ["id" => $item->id])?>" class="float-right btn btn-primary mr-1"><i class="fas fa-fw fa-envelope"></i> Zustimmungserklärungsformular an alle Besitzer senden</a>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-5">
|
|
|
|
<div class="card border-top-primary">
|
|
<div class="card-body">
|
|
<h3 class="text-center mb-3">Zustimmungserklärung <?=$item->name?></h3>
|
|
|
|
<table class="table table-sm table-striped view-table">
|
|
<tr>
|
|
<th>Projekt</th>
|
|
<td><?=$item->project->name?></td>
|
|
</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>
|
|
<th>Geplante Länge</th>
|
|
<td><?=$item->usage_length?> lfm</td>
|
|
</tr><tr>
|
|
<th>Geplante Nutzung</th>
|
|
<td>
|
|
<?php if($item->usage_pipe_on_plot): ?>
|
|
<i class="fas fa-fw fa-check text-success"></i>
|
|
<?php else: ?>
|
|
<i class="fas fa-fw fa-xmark"></i>
|
|
<?php endif; ?>
|
|
Verlegung von Rohren und Lichtwellenleitern am Grundstück<br />
|
|
|
|
<?php if($item->usage_pipe_in_building): ?>
|
|
<i class="fas fa-fw fa-check text-success"></i>
|
|
<?php else: ?>
|
|
<i class="fas fa-fw fa-xmark"></i>
|
|
<?php endif; ?>
|
|
Verlegung von Rohren und Lichtwellenleitern in den darauf befindlichen Gebäuden<br />
|
|
|
|
<?php if($item->usage_manhole): ?>
|
|
<i class="fas fa-fw fa-check text-success"></i>
|
|
<?php else: ?>
|
|
<i class="fas fa-fw fa-xmark"></i>
|
|
<?php endif; ?>
|
|
Errichtung eines Schachtes/einer Kabelmontagegrube und/oder eines LWL-Verteilschrankes/einer LWL-Abschlussbox<br />
|
|
|
|
<?php if($item->usage_owner): ?>
|
|
<i class="fas fa-fw fa-check text-success"></i>
|
|
<?php else: ?>
|
|
<i class="fas fa-fw fa-xmark"></i>
|
|
<?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>
|
|
<td colspan="2"><h4>Grundbuchdaten</h4></td>
|
|
</tr><tr>
|
|
<th>EZ</th>
|
|
<td><?=$item->ez?></td>
|
|
</tr><tr>
|
|
<th>KG</th>
|
|
<td><?=$item->kg?></td>
|
|
</tr><tr>
|
|
<th>GST</th>
|
|
<td><?=$item->gst?></td>
|
|
</tr><tr>
|
|
<th>GSTNR</th>
|
|
<td><?=$item->gstnr?></td>
|
|
</tr><tr>
|
|
<th>Plan/Skizze</th>
|
|
<td>
|
|
<?php if($item->file): ?>
|
|
<!--img src="<?=self::getUrl("File", "Download", ["id" => $item->file->file_id])?>" style="max-width: 480px;"/-->
|
|
<img src="<?=$item->file->file->asDataUrl()?>" style="max-width: 480px;" />
|
|
<?php endif; ?>
|
|
</td>
|
|
</tr><tr>
|
|
<th></th>
|
|
<td></td>
|
|
</tr><tr>
|
|
<th>Erstellt</th>
|
|
<td class="text-monospace"><?=date("d.m.Y H:i:s", $item->create)?> (<?=$item->creator->name?>)</td>
|
|
</tr><tr>
|
|
<th>Letzte Bearbeitung</th>
|
|
<td class="text-monospace"><?=date("d.m.Y H:i:s", $item->edit)?> (<?=$item->editor->name?>)</td>
|
|
</tr>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-7">
|
|
|
|
<div class="card border-top-success">
|
|
<div class="card-body">
|
|
<h3 class="text-center mb-3">Objektbesitzer
|
|
<small><a data-toggle="modal" data-target="#newOwnerModal" href="#"><i class="fas fa-plus"></i> Neuen Besitzer hinzufügen</a></small>
|
|
</h3>
|
|
|
|
<button class="btn btn-sm btn-outline-primary mb-2"><i class="fas fa-down fa-fw"></i> Grundbuch jetzt abfragen</button>
|
|
|
|
<?php if(!is_array($item->owners) || !count($item->owners)): ?>
|
|
<i>Noch keine Besitzer bekannt</i>
|
|
<?php else: ?>
|
|
<table class="table table-sm table-striped table-hover">
|
|
<tr>
|
|
<th></th>
|
|
<th>Name/Anschrift</th>
|
|
<th>Telefon<br />Fax<br />Email</th>
|
|
<th>Anfragestatus</th>
|
|
<th>Ergebnis</th>
|
|
</tr>
|
|
<?php foreach($item->owners as $owner): ?>
|
|
<tr>
|
|
<td style="font-size: 1.4em;">
|
|
<a href="<?=self::getUrl("ConstructionConsent", "Download", ["owner_id" => $owner->id])?>" title="Zustimmungserklärungsformular herunterladen"><i class="far fa-fw fa-file-download"></i></a>
|
|
</td>
|
|
<td>
|
|
<strong><?=$owner->name?></strong><br />
|
|
<?=$owner->street?><br />
|
|
<?=$owner->zip?> <?=$owner->city?><br />
|
|
<?=$owner->country?>
|
|
</td>
|
|
<td>
|
|
<?=$owner->phone?><br />
|
|
<?=$owner->fax?><br />
|
|
<?=$owner->email?>
|
|
</td>
|
|
<td class="text-monospace">
|
|
<span id="status-<?=$owner->id?>-text" data-status-id="<?=$owner->status?>"><span id="status-<?=$owner->id?>-statustext"><?=__($owner->status, "consent")?></span> <a href="#" onclick="return toggleStatusControl(<?=$owner->id?>)"><i class="fas fa-fw fa-edit"></i></a></span>
|
|
<div class="input-group" id="status-<?=$owner->id?>-input" style="display:none">
|
|
<select class="form-control">
|
|
<option value="new" <?=($owner->status == "new") ? "selected='selected'" : ""?>><?=__("new", "consent")?></option>
|
|
<option value="requested" <?=($owner->status == "requested") ? "selected='selected'" : ""?>><?=__("requested", "consent")?></option>
|
|
<option value="answered" <?=($owner->status == "answered") ? "selected='selected'" : ""?>><?=__("answered", "consent")?></option>
|
|
</select>
|
|
<div class="input-group-append">
|
|
<button type="button" class="btn btn-primary" title="Speichern" onclick="saveStatusControl(<?=$owner->id?>)"><i class="fas fa-check"></i></button>
|
|
<button type="button" class="btn btn-secondary" title="Abbrechen" onclick="toggleStatusControl(<?=$owner->id?>)"><i class="fas fa-times"></i></button>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
<td class="text-monospace">
|
|
<span id="result-<?=$owner->id?>-text" data-result-id="<?=$owner->result?>"><span id="result-<?=$owner->id?>-resulttext"><?=($owner->result) ? __($owner->result, "consent") : ""?></span> <a href="#" onclick="return toggleResultControl(<?=$owner->id?>)"><i class="fas fa-fw fa-edit"></i></a></span>
|
|
<div class="input-group" id="result-<?=$owner->id?>-input" style="display:none">
|
|
<select class="form-control">
|
|
<option></option>
|
|
<option value="success" <?=($owner->result == "success") ? "selected='selected'" : ""?>><?=__("success", "consent")?></option>
|
|
<option value="failure" <?=($owner->result == "failure") ? "selected='selected'" : ""?>><?=__("failure", "consent")?></option>
|
|
</select>
|
|
<div class="input-group-append">
|
|
<button type="button" class="btn btn-primary" title="Speichern" onclick="saveResultControl(<?=$owner->id?>)"><i class="fas fa-check"></i></button>
|
|
<button type="button" class="btn btn-secondary" title="Abbrechen" onclick="toggleResultControl(<?=$owner->id?>)"><i class="fas fa-times"></i></button>
|
|
</div>
|
|
</div>
|
|
|
|
<div>
|
|
<?php 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; ?>
|
|
</div>
|
|
|
|
<hr />
|
|
<div class="mt-2"><a href="#" onclick="openOwnerUploadModal(<?=$owner->id?>); return false;"><i class="far fa-cloud-upload" style="font-size: 1.4em;"></i> Dokument hochladen</a></div>
|
|
</td>
|
|
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</table>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal fade" id="newOwnerModal" aria-hidden="true" aria-labelledby="#newOwnerModelLabel" tabindex="-1">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<form method="post" action="<?=self::getUrl("ConstructionConsentOwner", "save")?>">
|
|
<div class="modal-header">
|
|
<h3 class="modal-title" id="newOwnerModelLabel">Neuen Besitzer hinzufügen</h3>
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
|
|
<input type="hidden" name="constructionconsent_id" value="<?=$item->id?>" />
|
|
<h4>Name & Anschrift</h4>
|
|
|
|
<div class="form-group">
|
|
<label for="name" class="col-form-label">Name:</label>
|
|
<textarea class="form-control" name="name" id="name"></textarea>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="street" class="col-form-label">Straße:</label>
|
|
<input type="text" class="form-control" name="street" id="street" />
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="zip" class="col-form-label">PLZ / Ort:</label>
|
|
<div class="row">
|
|
<div class="col-4">
|
|
<input type="text" class="form-control" name="zip" id="zip" />
|
|
</div>
|
|
<div class="col-8">
|
|
<input type="text" class="form-control" name="city" id="city" />
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="country" class="col-form-label">Land:</label>
|
|
<input type="text" class="form-control" name="country" id="country" />
|
|
<small>Kann leer bleiben für Österreich</small>
|
|
</div>
|
|
|
|
<h4>Kontakt</h4>
|
|
|
|
<div class="form-group">
|
|
<label for="phone" class="col-form-label">Telefon:</label>
|
|
<input type="text" class="form-control" name="phone" id="phone" />
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="fax" class="col-form-label">Fax:</label>
|
|
<input type="text" class="form-control" name="fax" id="fax" />
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="email" class="col-form-label">Email:</label>
|
|
<input type="text" class="form-control" name="email" id="email" />
|
|
</div>
|
|
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Abbrechen</button>
|
|
<button type="submit" class="btn btn-primary">Speichern</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal fade" id="ownerUpload" aria-hidden="true" aria-labelledby="#ownerUploadLabel" tabindex="-1">
|
|
<div class="modal-dialog modal-dialog-centered">
|
|
<div class="modal-content">
|
|
<form method="post" action="<?=self::getUrl("ConstructionConsentOwner", "uploadDocument")?>" enctype="multipart/form-data">
|
|
<div class="modal-header">
|
|
<h3 class="modal-title" id="ownerUploadLabel">Dokument hochladen</h3>
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
|
|
<input type="hidden" name="owner_id" id="owner-upload-owner_id" value="" />
|
|
|
|
<div class="form-group">
|
|
<label for="owner-upload-name" class="col-form-label">Name *</label>
|
|
<input type="text" class="form-control" name="name" id="owner-upload-name" />
|
|
<small>Beschreibender Kurzname, z.B: Zustimmung oder Ablehnung</small>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="consentOwnerUpload" class="col-form-label">Datei auswählen *</label>
|
|
<input type="file" class="form-control" name="consentOwnerUpload" id="consentOwnerUpload" />
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Abbrechen</button>
|
|
<button type="submit" class="btn btn-primary">Hochladen</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
function openOwnerUploadModal(oid) {
|
|
$('#owner-upload-owner_id').val(oid);
|
|
$("#consentOwnerUpload").val("");
|
|
$("#owner-upload-name").val("");
|
|
|
|
$('#ownerUpload').modal();
|
|
|
|
|
|
}
|
|
|
|
function toggleStatusControl(oid) {
|
|
// set select to current status id
|
|
$("#status-" + oid + "-input select").val($("#status-" + oid + "-text").data("status-id"));
|
|
|
|
// toggle controls
|
|
$("#status-" + oid + "-text").toggle();
|
|
$("#status-" + oid + "-input").toggle();
|
|
|
|
return false;
|
|
}
|
|
|
|
function saveStatusControl(oid) {
|
|
if(!Number.isInteger(oid) || oid < 1) {
|
|
return false;
|
|
}
|
|
|
|
var value = $("#status-" + oid + "-input select").val();
|
|
|
|
$.post("<?=self::getUrl("ConstructionConsentOwner","Api")?>",
|
|
{
|
|
'do': "updateStatus",
|
|
id: oid,
|
|
status: value
|
|
},
|
|
function(success) {
|
|
if(success.status == "OK") {
|
|
var update = success.result.update;
|
|
|
|
$("#status-" + update.id + "-statustext").text(update.status_text);
|
|
$("#status-" + update.id + "-text")
|
|
.addClass("text-success")
|
|
.data("status-id", update.status);
|
|
|
|
setTimeout(() => {
|
|
$("#status-" + update.id + "-text").removeClass("text-success")
|
|
}, 1500);
|
|
|
|
toggleStatusControl(oid);
|
|
|
|
}
|
|
|
|
},
|
|
'json');
|
|
}
|
|
|
|
|
|
function toggleResultControl(oid) {
|
|
// set select to current result id
|
|
$("#result-" + oid + "-input select").val($("#result-" + oid + "-text").data("result-id"));
|
|
|
|
// toggle controls
|
|
$("#result-" + oid + "-text").toggle();
|
|
$("#result-" + oid + "-input").toggle();
|
|
|
|
return false;
|
|
}
|
|
|
|
function saveResultControl(oid) {
|
|
if(!Number.isInteger(oid) || oid < 1) {
|
|
return false;
|
|
}
|
|
|
|
var value = $("#result-" + oid + "-input select").val();
|
|
|
|
$.post("<?=self::getUrl("ConstructionConsentOwner","Api")?>",
|
|
{
|
|
'do': "updateResult",
|
|
id: oid,
|
|
result: value
|
|
},
|
|
function(success) {
|
|
if(success.status == "OK") {
|
|
var update = success.result.update;
|
|
|
|
$("#result-" + update.id + "-resulttext").text(update.result_text);
|
|
$("#result-" + update.id + "-text")
|
|
.addClass("text-success")
|
|
.data("result-id", update.result);
|
|
|
|
setTimeout(() => {
|
|
$("#result-" + update.id + "-text").removeClass("text-success")
|
|
}, 1500);
|
|
|
|
toggleResultControl(update.id);
|
|
|
|
}
|
|
|
|
},
|
|
'json');
|
|
}
|
|
|
|
</script>
|
|
|
|
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/footer.php"); ?>
|