ConstructionConsent live
This commit is contained in:
@@ -30,9 +30,9 @@ $pagination_entity_name = "Adressen";
|
||||
|
||||
|
||||
<?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>
|
||||
<!--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>
|
||||
<!--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>
|
||||
@@ -114,8 +114,52 @@ $pagination_entity_name = "Adressen";
|
||||
<tr>
|
||||
<td colspan="2"><h4>Metadaten</h4></td>
|
||||
</tr><tr>
|
||||
<th>Anzahl Bestellungen</th>
|
||||
<td><?=$item->preorder_count?></td>
|
||||
<th>Termine</th>
|
||||
<td>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th></th>
|
||||
<th class="text-left">Begehungstermin</th>
|
||||
<th class="text-left">Durchgeführt</th>
|
||||
<th class="text-left">Begehungsprotokoll</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Planer</th>
|
||||
<td class="text-monospace"><a data-toggle="modal" data-target="#plannerDateModal" href="#"><i class="fas fa-fw fa-edit"></i></a> <?=($item->inspection_date_planner) ? date("d.m.Y", $item->inspection_date_planner) : ""?></td>
|
||||
<td><input type="checkbox" id="inspection_planner" class="switchery" data-size="small" data-color="#25b343" data-toggle-param="inspection_planner" <?=($item->inspection_planner) ? "checked='checked'" : ""?> /></td>
|
||||
<td>
|
||||
<?php if($item->inspection_protocol_planner): ?>
|
||||
<a href="<?=self::getUrl("File", "download", ["id" => $item->inspection_protocol_planner->file_id])?>">Begehungsprotokoll</a>
|
||||
<a class="text-danger" href="<?=self::getUrl("ConstructionConsent", "deleteFile", ["id" => $item->id, "file_id" => $item->inspection_protocol_planner->file_id])?>" onclick="if(!confirm('Begehungsprotokoll wirklich löschen?')) return false;" title="Begehungsprotokoll Löschen"><i class="far fa-fw fa-trash-alt"></i></a>
|
||||
<?php else: ?>
|
||||
<a data-toggle="modal" data-target="#inspectionProtocolPlanner" href="#" title="Begehungsprotokoll Hochladen"><i class="far fa-fw fa-file-upload"></i></a>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Elektriker</th>
|
||||
<td class="text-monospace"><a data-toggle="modal" data-target="#electricianDateModal" href="#"><i class="fas fa-fw fa-edit"></i></a> <?=($item->inspection_date_electrician) ? date("d.m.Y", $item->inspection_date_electrician) : ""?></td>
|
||||
<td><input type="checkbox" id="inspection_electrician" class="switchery" data-size="small" data-color="#25b343" data-toggle-param="inspection_electrician" <?=($item->inspection_electrician) ? "checked='checked'" : ""?> /></td>
|
||||
<td>
|
||||
<?php if($item->inspection_protocol_electrician): ?>
|
||||
<a href="<?=self::getUrl("File", "download", ["id" => $item->inspection_protocol_electrician->file_id])?>">Begehungsprotokoll</a>
|
||||
<a class="text-danger" href="<?=self::getUrl("ConstructionConsent", "deleteFile", ["id" => $item->id, "file_id" => $item->inspection_protocol_electrician->file_id])?>" onclick="if(!confirm('Begehungsprotokoll wirklich löschen?')) return false;" title="Begehungsprotokoll Löschen"><i class="far fa-fw fa-trash-alt"></i></a>
|
||||
<?php else: ?>
|
||||
<a data-toggle="modal" data-target="#inspectionProtocolElectrician" href="#" title="Begehungsprotokoll Hochladen"><i class="far fa-fw fa-file-upload"></i></a>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr><tr>
|
||||
<th>Bauvortschritt</th>
|
||||
<td>
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item"><input type="checkbox" class="switchery" id="conduit_installed_building" data-size="small" data-color="#25b343" onchange="saveCheckbox('conduit_installed_building')" <?=($item->conduit_installed_building) ? "checked='checked'" : ""?> /> FTTx Location mit Leerrohr versorgt</li>
|
||||
<li class="list-group-item"><input type="checkbox" class="switchery" id="conduit_installed_ftu" data-size="small" data-color="#25b343" onchange="saveCheckbox('conduit_installed_ftu')" <?=($item->conduit_installed_ftu) ? "checked='checked'" : ""?> /> Leerrohr bis HAK verlegt</li>
|
||||
<li class="list-group-item"><input type="checkbox" class="switchery" id="inhouse_cabling" data-size="small" data-color="#25b343" onchange="saveCheckbox('inhouse_cabling')" <?=($item->inhouse_cabling) ? "checked='checked'" : ""?> /> Inhouseverkabelung von Wohneinheiten erledigt</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
|
||||
@@ -203,7 +247,7 @@ $pagination_entity_name = "Adressen";
|
||||
<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>
|
||||
<!--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>
|
||||
@@ -538,9 +582,158 @@ $pagination_entity_name = "Adressen";
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="plannerDateModal" aria-hidden="true" aria-labelledby="#plannerDateLabel" tabindex="-1">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<form method="post" action="<?=self::getUrl("ConstructionConsent", "saveDate")?>" enctype="multipart/form-data">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title" id="ownerUploadLabel">Begehung mit Planer</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="consent_id" id="plannerdate_consent_id" value="<?=$item->id?>" />
|
||||
|
||||
<div class="form-group">
|
||||
<label for="" class="col-form-label">Termin *</label>
|
||||
<input type="text" class="form-control" name="inspection_date_planner" id="inspection_date_planner" value="<?=($item->inspection_date_planner) ? date("d.m.Y", $item->inspection_date_planner) : ""?>" />
|
||||
</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="electricianDateModal" aria-hidden="true" aria-labelledby="#electricianDateLabel" tabindex="-1">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<form method="post" action="<?=self::getUrl("ConstructionConsent", "saveDate")?>" enctype="multipart/form-data">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title" id="ownerUploadLabel">Begehung mit Elektriker</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="consent_id" id="electriciandate_consent_id" value="<?=$item->id?>" />
|
||||
|
||||
<div class="form-group">
|
||||
<label for="" class="col-form-label">Termin *</label>
|
||||
<input type="text" class="form-control" name="inspection_date_electrician" id="inspection_date_electrician" value="<?=($item->inspection_date_electrician) ? date("d.m.Y", $item->inspection_date_electrician) : ""?>" />
|
||||
</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="inspectionProtocolPlanner" aria-hidden="true" aria-labelledby="#inspectionProtocolPlannerLabel" tabindex="-1">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<form method="post" action="<?=self::getUrl("ConstructionConsent", "uploadFile")?>" enctype="multipart/form-data">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title" id="inspectionProtocolPlannerLabel">Begehungsprotokoll hochladen</h3>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<h4>Begehung mit Planer</h4>
|
||||
|
||||
<input type="hidden" name="consent_id" id="inspection_protocol_upload_id" value="<?=$item->id?>" />
|
||||
<input type="hidden" name="upload_type" id="inspection_protocol_planner_upload_type" value="planner" />
|
||||
|
||||
<div class="form-group">
|
||||
<label for="inspection_protocol_planner_file" class="col-form-label">Datei auswählen *</label>
|
||||
<input type="file" class="form-control" name="inspection_protocol_file" id="inspection_protocol_planner_file" />
|
||||
</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>
|
||||
|
||||
<div class="modal fade" id="inspectionProtocolElectrician" aria-hidden="true" aria-labelledby="#inspectionProtocolElectricianLabel" tabindex="-1">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<form method="post" action="<?=self::getUrl("ConstructionConsent", "uploadFile")?>" enctype="multipart/form-data">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title" id="inspectionProtocolElectricianLabel">Begehungsprotokoll hochladen</h3>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<h4>Begehung mit Elektriker</h4>
|
||||
|
||||
<input type="hidden" name="consent_id" id="inspection_protocol_upload_id" value="<?=$item->id?>" />
|
||||
<input type="hidden" name="upload_type" id="inspection_protocol_electrician_upload_type" value="electrician" />
|
||||
|
||||
<div class="form-group">
|
||||
<label for="inspection_protocol_electrician_file" class="col-form-label">Datei auswählen *</label>
|
||||
<input type="file" class="form-control" name="inspection_protocol_file" id="inspection_protocol_electrician_file" />
|
||||
</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">
|
||||
|
||||
var switcheries = [];
|
||||
Array.from(document.getElementsByClassName("switchery")).forEach(function(elem) {
|
||||
let color = $(elem).data("color");
|
||||
let size = $(elem).data("size");
|
||||
switcheries.push(new Switchery(elem, {color: color, size: size}));
|
||||
|
||||
if($(elem).data("toggle-param")) {
|
||||
$(elem).on("change", function() {
|
||||
saveCheckbox($(this).data("toggle-param"));
|
||||
});
|
||||
}
|
||||
});
|
||||
//var blah = new Switchery();
|
||||
/*$(".switchery").each(() => {
|
||||
console.log($(this).id);
|
||||
|
||||
});*/
|
||||
|
||||
$("#inspection_date_planner,#inspection_date_electrician").datepicker({
|
||||
language: 'de',
|
||||
format: "dd.mm.yyyy",
|
||||
showWeekDays: true,
|
||||
todayBtn: 'linked',
|
||||
autoclose: true
|
||||
});
|
||||
|
||||
function openOwnerUploadModal(oid) {
|
||||
$('#owner-upload-owner_id').val(oid);
|
||||
$("#consentOwnerUpload").val("");
|
||||
@@ -642,10 +835,88 @@ $pagination_entity_name = "Adressen";
|
||||
'json');
|
||||
}
|
||||
|
||||
function toggleJournal(order_id) {
|
||||
$("#journal-container").find("div.opener").remove();
|
||||
$("#journal-container").css("max-height", "750px").css("overflow", "auto");
|
||||
}
|
||||
|
||||
/*var inspectionToggleLock = false;
|
||||
function toggleInspection(type) {
|
||||
if(inspectionToggleLock) return;
|
||||
|
||||
var iplan = 0;
|
||||
var ielec = 0;
|
||||
|
||||
console.log(type);
|
||||
|
||||
if(type != "planner" && type != "electrician") return false;
|
||||
|
||||
iplan = $("#inspection_planner").prop("checked") ? 1 : 0;
|
||||
ielec = $("#inspection_electrician").prop("checked") ? 1 : 0;
|
||||
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: "<?=self::getUrl("ConstructionConsent", "api")?>",
|
||||
data: {
|
||||
'do': "saveInspection",
|
||||
id: <?=$item->id?>,
|
||||
inspection_planner: iplan,
|
||||
inspection_electrician: ielec
|
||||
},
|
||||
context: {
|
||||
type: type
|
||||
},
|
||||
success: function(success) {
|
||||
if (success.status != "OK") {
|
||||
console.log("#inspection_" + this.type);
|
||||
console.log($("#inspection_" + this.type));
|
||||
inspectionToggleLock = true;
|
||||
$("#inspection_" + this.type).click();
|
||||
notify("error", "Status konnte nicht gespeichert werden");
|
||||
inspectionToggleLock = false;
|
||||
}
|
||||
},
|
||||
returnType: 'json'
|
||||
});
|
||||
|
||||
}*/
|
||||
|
||||
var checkboxToggleLock = false;
|
||||
function saveCheckbox(type) {
|
||||
if(checkboxToggleLock) return;
|
||||
console.log(type);
|
||||
|
||||
if(type != "inspection_planner" && type != "inspection_electrician" && type != "conduit_installed_building" && type != "conduit_installed_ftu" && type != "inhouse_cabling") return false;
|
||||
|
||||
let update_data = {
|
||||
'do': "saveCheckbox",
|
||||
id: <?=$item->id?>,
|
||||
};
|
||||
|
||||
update_data[type] = $("#" + type).prop("checked") ? 1 : 0;
|
||||
/*if(type == "inspection_electrician") update_data.inspection_electrician = $("#inspection_electrician").prop("checked") ? 1 : 0;
|
||||
if(type == "conduit_installed_building") update_data.conduit_installed_building = $("#conduit_installed_building").prop("checked") ? 1 : 0;
|
||||
if(type == "conduit_installed_ftu") update_data.conduit_installed_ftu = $("#conduit_installed_ftu").prop("checked") ? 1 : 0;
|
||||
if(type == "inhouse_cabling") update_data.inhouse_cabling = $("#inhouse_cabling").prop("checked") ? 1 : 0;*/
|
||||
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: "<?=self::getUrl("ConstructionConsent", "api")?>",
|
||||
data: update_data,
|
||||
context: {
|
||||
type: type
|
||||
},
|
||||
success: function(success) {
|
||||
if (success.status != "OK") {
|
||||
console.log("#" + this.type);
|
||||
console.log($("#" + this.type));
|
||||
checkboxToggleLock = true;
|
||||
$("#" + this.type).click();
|
||||
notify("error", "Status konnte nicht gespeichert werden");
|
||||
checkboxToggleLock = false;
|
||||
} else {
|
||||
notify("success", "Status erfolgreich gespeichert");
|
||||
}
|
||||
},
|
||||
returnType: 'json'
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user