Added foldable details in Preorder Index
This commit is contained in:
@@ -249,7 +249,7 @@
|
|||||||
<?php foreach($preorders as $preorder): ?>
|
<?php foreach($preorders as $preorder): ?>
|
||||||
<tr class="preorder-list-tr" id="preorder-<?=$preorder->id?>">
|
<tr class="preorder-list-tr" id="preorder-<?=$preorder->id?>">
|
||||||
<?php if($me->is(["Admin", "netowner"])): ?>
|
<?php if($me->is(["Admin", "netowner"])): ?>
|
||||||
<td class="bg-lightblue border border-end text-center pointer" onclick="togglePreorder(<?=$preorder->id?>)">
|
<td class="bg-lightblue border border-end text-center pointer" onclick="togglePreorder(<?=$preorder->id?>); return false;">
|
||||||
<i class="fas fa-fw fa-angle-down"></i>
|
<i class="fas fa-fw fa-angle-down"></i>
|
||||||
</td>
|
</td>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
@@ -309,7 +309,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<?php if($me->is(["Admin","netowner"])): ?>
|
<?php if($me->is(["Admin","netowner"])): ?>
|
||||||
<tr id="preorder-detail-<?=$preorder->id?>" style="display:none; background-color:#fff">
|
<tr id="preorder-detail-<?=$preorder->id?>" style="display:none; background-color:#fff">
|
||||||
<td colspan="12">
|
<td colspan="13">
|
||||||
<?php include(realpath(dirname(__FILE__))."/include/preorder-detail.php"); ?>
|
<?php include(realpath(dirname(__FILE__))."/include/preorder-detail.php"); ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -581,20 +581,23 @@
|
|||||||
if($('#preorder-detail-' + id).is(":hidden")) {
|
if($('#preorder-detail-' + id).is(":hidden")) {
|
||||||
$('#preorder-' + id).removeClass("bg-lightblue");
|
$('#preorder-' + id).removeClass("bg-lightblue");
|
||||||
$('#preorder-' + id).removeClass("text-info");
|
$('#preorder-' + id).removeClass("text-info");
|
||||||
|
history.replaceState(null, null, ' ');
|
||||||
} else {
|
} else {
|
||||||
$('#preorder-' + id).addClass("text-info");
|
$('#preorder-' + id).addClass("text-info");
|
||||||
$('#preorder-' + id).addClass("bg-lightblue");
|
$('#preorder-' + id).addClass("bg-lightblue");
|
||||||
|
location.hash = "preorder=" + id;
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// navigation
|
// navigation
|
||||||
var preorder;
|
var preorder_id;
|
||||||
var hash = window.location.hash.substr(1);
|
var hash = window.location.hash.substr(1);
|
||||||
var match = hash.match(/preorder=(\d+)/);
|
var match = hash.match(/preorder=(\d+)/);
|
||||||
if(match && match[1]) {
|
if(match && match[1]) {
|
||||||
preorder = match[1]
|
preorder_id = match[1]
|
||||||
togglePreorder(preorder);
|
togglePreorder(preorder_id);
|
||||||
//$('body').scrollTop($('#preorder-' + preorder).offset() - 150);
|
$('html, body').animate( {scrollTop: $('#preorder-' + preorder_id).offset().top - 230}, 200);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/footer.php"); ?>
|
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/footer.php"); ?>
|
||||||
|
|||||||
@@ -1,98 +1,254 @@
|
|||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="row justify-content-center mt-2">
|
<div class="row justify-content-center mt-2">
|
||||||
<div class="col-xl-8 col-lg-12">
|
<div class="col-12">
|
||||||
|
|
||||||
<ul class="nav nav-tabs order-tab">
|
<ul class="nav nav-tabs order-tab">
|
||||||
<li class="nav-item"><a class="nav-link active" href="#preorder-detail-<?=$order->id?>-detail" data-toggle="tab" aria-expanded="false">Details</a></li>
|
<li class="nav-item"><a class="nav-link active" href="#preorder-detail-<?=$preorder->id?>-detail" data-toggle="tab" aria-expanded="false">Details</a></li>
|
||||||
<li class="nav-item"><a class="nav-link" href="#preorder-detail-<?=$order->id?>-address" data-toggle="tab" aria-expanded="false">Adressdetails</a></li>
|
<li class="nav-item"><a class="nav-link" href="#preorder-detail-<?=$preorder->id?>-address" data-toggle="tab" aria-expanded="false">Adressdetails</a></li>
|
||||||
<li class="nav-item"><a class="nav-link" href="#preorder-detail-<?=$order->id?>-rimo" data-toggle="tab" aria-expanded="false">RIMO</a></li>
|
<li class="nav-item"><a class="nav-link" href="#preorder-detail-<?=$preorder->id?>-rimo" data-toggle="tab" aria-expanded="false">RIMO</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tab-content pt-0">
|
<div class="tab-content pt-0">
|
||||||
<div id="preorder-detail-<?=$order->id?>-detail" class="tab-pane show active">
|
<div id="preorder-detail-<?=$preorder->id?>-detail" class="tab-pane show active">
|
||||||
<div class="row justify-content-center">
|
<div class="row justify-content-center">
|
||||||
<div class="col-xl-8 col-lg-12">
|
<div class="col-12">
|
||||||
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="card-header bg-info text-white pl-2 pr-2 pt-1 pb-1">Details</div>
|
<div class="card-header bg-info text-white pl-2 pr-2 pt-1 pb-1">Details</div>
|
||||||
|
|
||||||
<table class="table table-sm table-striped">
|
<div class="row">
|
||||||
<tr>
|
<div class="col-8">
|
||||||
<th>Kampagne:</th>
|
<h3>Allgemein</h3>
|
||||||
<td><?=$preorder->campaign->name?></td>
|
<table class="table table-sm table-striped">
|
||||||
</tr><tr>
|
<tr>
|
||||||
<th>Status:</th>
|
<th>ID:</th>
|
||||||
<td><?=$preorder->status->code?> - <?=$preorder->status->name?></td>
|
<td class="text-monospace"><?=$preorder->id?></td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<th>Bestellcode:</th>
|
<th>Bestellcode:</th>
|
||||||
<td><?=$preorder->ucode?></td>
|
<td class="text-monospace"><?=$preorder->ucode?></td>
|
||||||
</tr><tr>
|
</tr><th>Kampagne:</th>
|
||||||
<th>OAID:</th>
|
<td><?=$preorder->campaign->name?></td>
|
||||||
<td><?=$preorder->oaid?></td>
|
</tr><tr>
|
||||||
</tr><tr>
|
<th>Status:</th>
|
||||||
<th>Bestelltyp:</th>
|
<td class="text-monospace"><?=$preorder->status->code?> - <?=$preorder->status->name?></td>
|
||||||
<td><?=__($preorder->type, "preorder")?></td>
|
</tr><tr>
|
||||||
</tr><tr>
|
<th>OAID:</th>
|
||||||
<th>Partner:</th>
|
<td class="text-monospace text-pink"><?=$preorder->oaid?></td>
|
||||||
<td><?=$preorder->partner->getCompanyOrName()?></td>
|
</tr><tr>
|
||||||
</tr><tr>
|
<th>Bestelltyp:</th>
|
||||||
<th>Erstellt:</th>
|
<td><?=__($preorder->type, "preorder")?></td>
|
||||||
<td class="text-monospace"><?=date("d.m.Y H:i",$preorder->create)?> (<?=$preorder->creator->name?>)</td>
|
</tr><tr>
|
||||||
</tr><tr>
|
<th>Anschlusstyp:</th>
|
||||||
<th>Zuletzt bearbeitet:</th>
|
<td><?=__($preorder->connection_type, "preorder")?></td>
|
||||||
<td class="text-monospace"><?=date("d.m.Y H:i",$preorder->edit)?> (<?=$preorder->editor->name?>)</td>
|
</tr><tr>
|
||||||
</tr>
|
<th>Ist Zusatzbestellung:</th>
|
||||||
|
<td><?=($preorder->is_additional_order) ? "Ja" : "Nein"?></td>
|
||||||
|
</tr><tr>
|
||||||
|
<th>Partner:</th>
|
||||||
|
<td><?=$preorder->partner->getCompanyOrName()?></td>
|
||||||
|
</tr><tr>
|
||||||
|
<th>Erstellt:</th>
|
||||||
|
<td class="text-monospace"><?=date("d.m.Y H:i",$preorder->create)?> (<?=$preorder->creator->name?>)</td>
|
||||||
|
</tr><tr>
|
||||||
|
<th>Zuletzt bearbeitet:</th>
|
||||||
|
<td class="text-monospace"><?=date("d.m.Y H:i",$preorder->edit)?> (<?=$preorder->editor->name?>)</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="col-4">
|
||||||
|
|
||||||
|
<h3>Zustimmungen</h3>
|
||||||
|
<table class="table table-sm table-striped">
|
||||||
|
<tr>
|
||||||
|
<th>Zustimmung AGB:</th>
|
||||||
|
<td><?=($preorder->accept_agb) ? '<i class="fas fa-fw fa-check text-success"></i>' : '<i class="fas fa-fw fa-xmark text-danger"></i>'?></td>
|
||||||
|
</tr><tr>
|
||||||
|
<th>Zustimmung DSGVO:</th>
|
||||||
|
<td><?=($preorder->accept_dsgvo) ? '<i class="fas fa-fw fa-check text-success"></i>' : '<i class="fas fa-fw fa-xmark text-danger"></i>'?></td>
|
||||||
|
</tr><tr>
|
||||||
|
<th>Zustimmung Rücktrittsrecht:</th>
|
||||||
|
<td><?=($preorder->accept_withdrawal) ? '<i class="fas fa-fw fa-check text-success"></i>' : '<i class="fas fa-fw fa-xmark text-danger"></i>'?></td>
|
||||||
|
</tr><tr>
|
||||||
|
<th>Zustimmung Datenweitergabe:</th>
|
||||||
|
<td><?=($preorder->accept_marketing) ? '<i class="fas fa-fw fa-check text-success"></i>' : '<i class="fas fa-fw fa-xmark text-danger"></i>'?></td>
|
||||||
|
</tr><tr>
|
||||||
|
<th>Zustimmung Grabungsarbeiten:</th>
|
||||||
|
<td><?=($preorder->accept_digging) ? '<i class="fas fa-fw fa-check text-success"></i>' : '<i class="fas fa-fw fa-xmark text-danger"></i>'?></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-6">
|
||||||
|
<h3>Bestelldaten</h3>
|
||||||
|
<table class="table table-sm table-striped">
|
||||||
|
<tr>
|
||||||
|
<th>Extref:</th>
|
||||||
|
<td class="text-monospace"><?=htmlentities($preorder->extref)?></td>
|
||||||
|
</tr><tr>
|
||||||
|
<th>Adressinfo:</th>
|
||||||
|
<td><?=nl2br(htmlentities($preorder->address_info))?></td>
|
||||||
|
</tr><tr>
|
||||||
|
<th>Versand an:</th>
|
||||||
|
<td><?=($preorder->address_info == "address") ? "Anschlussadresse" : "Kontaktadresse"?></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
</table>
|
<div class="col-6">
|
||||||
|
<?php if($preorder->ordered_services): ?>
|
||||||
|
<h3>Bestellte Zusatzdienste</h3>
|
||||||
|
<table class="table table-sm table-striped">
|
||||||
|
<tr>
|
||||||
|
<th>Dienst</th>
|
||||||
|
<th>Bestellt</th>
|
||||||
|
<th>Daten</th>
|
||||||
|
</tr>
|
||||||
|
<?php foreach($preorder->ordered_services as $service): ?>
|
||||||
|
<tr>
|
||||||
|
<td><?=$service->service?></td>
|
||||||
|
<td><?=($service->ordered == true || $service->ordered == 1) ? "Ja" : "Nein"?></td>
|
||||||
|
<td class="text-monospace">
|
||||||
|
<?php if($service->data): ?>
|
||||||
|
<?php foreach($service->data as $data): ?>
|
||||||
|
<?=$data->name?>: <?=$data->value?><br />
|
||||||
|
<?php endforeach; ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</table>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="preorder-detail-<?=$order->id?>-address" class="tab-pane">
|
<div id="preorder-detail-<?=$preorder->id?>-address" class="tab-pane">
|
||||||
<div class="row justify-content-center">
|
<div class="row justify-content-center">
|
||||||
<div class="col-xl-8 col-lg-12">
|
<div class="col-12">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
|
||||||
|
<div class="card-header bg-info text-white pl-2 pr-2 pt-1 pb-1">Addressdetails</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<h5>Anschlussadresse</h5>
|
|
||||||
<table>
|
<h3>Anschlussadresse</h3>
|
||||||
|
<table class="table table-sm table-striped">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Straße Hausnummer</th>
|
<th>ID</th>
|
||||||
|
<td class="text-monospace"><?=$preorder->adb_hausnummer_id?></td>
|
||||||
|
</tr><tr>
|
||||||
|
<th>OAID</th>
|
||||||
|
<td class="text-monospace text-pink"><?=$preorder->adb_hausnummer->oaid?></td>
|
||||||
|
</tr><tr>
|
||||||
|
<th>Status</th>
|
||||||
|
<td class="text-monospace"><?=$preorder->adb_hausnummer->status->code?> - <?=$preorder->adb_hausnummer->status->name?></td>
|
||||||
|
</tr><tr>
|
||||||
|
<th>Extref</th>
|
||||||
|
<td class="text-monospace"><?=$preorder->adb_hausnummer->extref?></td>
|
||||||
|
</tr><tr>
|
||||||
|
<th>Straße/Hausnummer</th>
|
||||||
<td><?=$preorder->adb_hausnummer->strasse->name?> <?=$preorder->adb_hausnummer->hausnummer?></td>
|
<td><?=$preorder->adb_hausnummer->strasse->name?> <?=$preorder->adb_hausnummer->hausnummer?></td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<th>PLZ</th>
|
<th>PLZ Ort</th>
|
||||||
<td><?=$preorder->adb_hausnummer->plz->plz?></td>
|
<td><?=$preorder->adb_hausnummer->plz->plz?> <?=$preorder->adb_hausnummer->ortschaft->name?></td>
|
||||||
</tr><tr>
|
|
||||||
<th>Ort</th>
|
|
||||||
<td><?=$preorder->adb_hausnummer->ortschaft->name?></td>
|
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<th>Gemeinde</th>
|
<th>Gemeinde</th>
|
||||||
<td><?=$preorder->adb_hausnummer->strasse->gemeinde->name?></td>
|
<td><?=$preorder->adb_hausnummer->strasse->gemeinde->name?></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h5>Nutzungseinheit</h5>
|
<h3>Nutzungseinheit</h3>
|
||||||
<table>
|
<table class="table table-sm table-striped">
|
||||||
<tr>
|
<tr>
|
||||||
<th>ID</th>
|
<th>ID</th>
|
||||||
<td><?=($preorder->adb_wohneinheit_id) ? $preorder->adb_wohneinheit_id : ""?></td>
|
<td class="text-monospace"><?=($preorder->adb_wohneinheit_id) ? $preorder->adb_wohneinheit_id : ""?></td>
|
||||||
|
</tr><tr>
|
||||||
|
<th>Status</th>
|
||||||
|
<td class="text-monospace"><?=$preorder->adb_wohneinheit->status->code?> - <?=$preorder->adb_wohneinheit->status->name?></td>
|
||||||
|
</tr><tr>
|
||||||
|
<th>OAID</th>
|
||||||
|
<td class="text-monospace text-pink"><?=$preorder->adb_wohneinheit->oaid?></td>
|
||||||
|
</tr><tr>
|
||||||
|
<th>Extref</th>
|
||||||
|
<td class="text-monospace"><?=$preorder->adb_wohneinheit->extref?></td>
|
||||||
|
</tr><tr>
|
||||||
|
<th>Block</th>
|
||||||
|
<td><?=$preorder->adb_wohneinheit->block?></td>
|
||||||
|
</tr><tr>
|
||||||
|
<th>Stiege</th>
|
||||||
|
<td><?=$preorder->adb_wohneinheit->stiege?></td>
|
||||||
|
</tr><tr>
|
||||||
|
<th>Stock</th>
|
||||||
|
<td><?=$preorder->adb_wohneinheit->stock?></td>
|
||||||
|
</tr><tr>
|
||||||
|
<th>Tür</th>
|
||||||
|
<td><?=$preorder->adb_wohneinheit->tuer?></td>
|
||||||
|
</tr><tr>
|
||||||
|
<th>Zusatz</th>
|
||||||
|
<td><?=$preorder->adb_wohneinheit->zusatz?></td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<th>Bezeichner</th>
|
<th>Bezeichner</th>
|
||||||
<td><?=$preorder->adb_wohneinheit?></td>
|
<td><?=$preorder->adb_wohneinheit->bezeichner?></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<h5>Kontakt</h5>
|
<h3>Kontaktadresse</h3>
|
||||||
|
<table class="table table-sm table-striped">
|
||||||
|
<tr>
|
||||||
|
<th>Firma</th>
|
||||||
|
<td><?=$preorder->company?></td>
|
||||||
|
</tr><tr>
|
||||||
|
<th>UID</th>
|
||||||
|
<td><?=$preorder->uidy?></td>
|
||||||
|
</tr><tr>
|
||||||
|
<th>Vorname</th>
|
||||||
|
<td><?=$preorder->firstname?></td>
|
||||||
|
</tr><tr>
|
||||||
|
<th>Nachname</th>
|
||||||
|
<td><?=$preorder->lastname?></td>
|
||||||
|
</tr><tr>
|
||||||
|
<th>Straße</th>
|
||||||
|
<td>
|
||||||
|
<?=$preorder->street?> <?=$preorder->housenumber?>
|
||||||
|
<?=($preorder->block) ? "/".$preorder->block : ""?>
|
||||||
|
<?=($preorder->stiege) ? "/".$preorder->stiege : ""?>
|
||||||
|
<?=($preorder->stock) ? "/".$preorder->stock : ""?>
|
||||||
|
<?=($preorder->tuer) ? "/".$preorder->tuer : ""?>
|
||||||
|
</td>
|
||||||
|
</tr><tr>
|
||||||
|
<th>PLZ</th>
|
||||||
|
<td><?=$preorder->zip?></td>
|
||||||
|
</tr><tr>
|
||||||
|
<th>Ort</th>
|
||||||
|
<td><?=$preorder->city?></td>
|
||||||
|
</tr><tr>
|
||||||
|
<th>Telefon</th>
|
||||||
|
<td><?=$preorder->phone?></td>
|
||||||
|
</tr><tr>
|
||||||
|
<th>Email</th>
|
||||||
|
<td><?=$preorder->email?></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -102,16 +258,66 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="preorder-detail-<?=$order->id?>-rimo" class="tab-pane">
|
<div id="preorder-detail-<?=$preorder->id?>-rimo" class="tab-pane">
|
||||||
<div class="row justify-content-center">
|
<div class="row justify-content-center">
|
||||||
<div class="col-xl-8 col-lg-12">
|
<div class="col-12">
|
||||||
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
|
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="card-header bg-info text-white pl-2 pr-2 pt-1 pb-1">RIMO</div>
|
<div class="card-header bg-info text-white pl-2 pr-2 pt-1 pb-1">RIMO</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-6">
|
||||||
|
<h3>Metadaten</h3>
|
||||||
|
<table class="table table-sm table-striped">
|
||||||
|
<tr>
|
||||||
|
<th>Building Name:</th>
|
||||||
|
<td class="text-monospace"><?=$preorder->adb_hausnummer->extref?>
|
||||||
|
</tr><tr>
|
||||||
|
<th>Home External ID:</th>
|
||||||
|
<td class="text-monospace"><?=$preorder->adb_wohneinheit->extref?>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-6">
|
||||||
|
<h3>FTU</h3>
|
||||||
|
<table class="table table-sm table-striped">
|
||||||
|
<tr>
|
||||||
|
<th>FTU Name:</th>
|
||||||
|
<td class="text-monospace"><?=$preorder->adb_wohneinheit->ftu_data["name"]?>
|
||||||
|
</tr><tr>
|
||||||
|
<th>FTU External ID:</th>
|
||||||
|
<td class="text-monospace"><?=$preorder->adb_wohneinheit->ftu_data["id"]?>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<div class="col-6">
|
||||||
|
<h3>Workorder</h3>
|
||||||
|
<table class="table table-sm table-striped">
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<td class="text-monospace"><?=$preorder->adb_wohneinheit->rimo_workorder->rimo_name?></td>
|
||||||
|
</tr><tr>
|
||||||
|
<th>External ID</th>
|
||||||
|
<td class="text-monospace"><?=$preorder->adb_wohneinheit->rimo_workorder->rimo_id?></td>
|
||||||
|
</tr><tr>
|
||||||
|
<th>Status</th>
|
||||||
|
<td><?=$preorder->adb_wohneinheit->rimo_workorder->rimo_status?></td>
|
||||||
|
</tr><tr>
|
||||||
|
<th>Erstellt</th>
|
||||||
|
<td class="text-monospace"><?=($preorder->adb_wohneinheit->rimo_workorder->id) ? date("d.m.Y H:i:s", $preorder->adb_wohneinheit->rimo_workorder->create) : ""?></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -119,32 +325,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="preorder-detail-<?=$order->id?>-files" class="tab-pane">
|
|
||||||
<div class="row justify-content-center">
|
|
||||||
<div class="col-xl-8 col-lg-12">
|
|
||||||
<div class="card">
|
|
||||||
<div class="card-body">
|
|
||||||
Files
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="order-detail-<?=$order->id?>-technician" class="tab-pane">
|
|
||||||
<div class="row justify-content-center">
|
|
||||||
<div class="col-xl-8 col-lg-12">
|
|
||||||
<div class="card">
|
|
||||||
<div class="card-body">
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -6,9 +6,10 @@ class ADBHausnummer extends mfBaseModel {
|
|||||||
private $ortschaft;
|
private $ortschaft;
|
||||||
private $strasse;
|
private $strasse;
|
||||||
private $plz;
|
private $plz;
|
||||||
|
private $status;
|
||||||
private $freigaben = [];
|
private $freigaben = [];
|
||||||
private $wohneinheiten = [];
|
private $wohneinheiten = [];
|
||||||
|
|
||||||
protected function init() {
|
protected function init() {
|
||||||
$this->db = FronkDB::singleton(ADDRESSDB_DBHOST, ADDRESSDB_DBUSER, ADDRESSDB_DBPASS, ADDRESSDB_DBNAME);
|
$this->db = FronkDB::singleton(ADDRESSDB_DBHOST, ADDRESSDB_DBUSER, ADDRESSDB_DBPASS, ADDRESSDB_DBNAME);
|
||||||
$this->table = "Hausnummer";
|
$this->table = "Hausnummer";
|
||||||
@@ -126,7 +127,12 @@ class ADBHausnummer extends mfBaseModel {
|
|||||||
}
|
}
|
||||||
return $this->wohneinheiten;
|
return $this->wohneinheiten;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($name == "status") {
|
||||||
|
$this->status = new ADBStatus($this->status_id);
|
||||||
|
return $this->status;
|
||||||
|
}
|
||||||
|
|
||||||
$classname = ucfirst($name);
|
$classname = ucfirst($name);
|
||||||
$idfield = $name."_id";
|
$idfield = $name."_id";
|
||||||
$this->$name = new $classname($this->$idfield);
|
$this->$name = new $classname($this->$idfield);
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class ADBStatus extends mfBaseModel {
|
||||||
|
|
||||||
|
public function init() {
|
||||||
|
$this->db = FronkDB::singleton(ADDRESSDB_DBHOST, ADDRESSDB_DBUSER, ADDRESSDB_DBPASS, ADDRESSDB_DBNAME);
|
||||||
|
$this->table = "Status";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,136 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class StatusModel {
|
||||||
|
public $code;
|
||||||
|
public $name;
|
||||||
|
|
||||||
|
public $create_by;
|
||||||
|
public $edit_by;
|
||||||
|
public $create;
|
||||||
|
public $edit;
|
||||||
|
|
||||||
|
public static function create(Array $data) {
|
||||||
|
$model = new Status();
|
||||||
|
|
||||||
|
foreach($data as $field => $value) {
|
||||||
|
if(property_exists(get_called_class(), $field)) {
|
||||||
|
$model->$field = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$me = mfValuecache::singleton()->get("me");
|
||||||
|
if(!$me) {
|
||||||
|
$me = new User();
|
||||||
|
$me->loadMe();
|
||||||
|
mfValuecache::singleton()->set("me", $me);
|
||||||
|
}
|
||||||
|
|
||||||
|
if($model->create_by === null) {
|
||||||
|
$model->create_by = $me->id;
|
||||||
|
}
|
||||||
|
if($model->edit_by === null) {
|
||||||
|
$model->edit_by = $me->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $model;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static function getAll() {
|
||||||
|
$items = [];
|
||||||
|
|
||||||
|
$db = FronkDB::singleton();
|
||||||
|
|
||||||
|
$res = $db->select("Status", "*");
|
||||||
|
if($db->num_rows($res)) {
|
||||||
|
while($data = $db->fetch_object($res)) {
|
||||||
|
$items[] = new Status($data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $items;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getFirst($filter = false) {
|
||||||
|
$db = FronkDB::singleton();
|
||||||
|
|
||||||
|
$where = self::getSqlFilter($filter);
|
||||||
|
$res = $db->select("Status", "*", "$where ORDER BY code, name");
|
||||||
|
if($db->num_rows($res)) {
|
||||||
|
$data = $db->fetch_object($res);
|
||||||
|
$item = new Status($data);
|
||||||
|
if($item->id) {
|
||||||
|
return $item;
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function count($filter) {
|
||||||
|
$db = FronkDB::singleton();
|
||||||
|
|
||||||
|
$where = self::getSqlFilter($filter);
|
||||||
|
$sql = "SELECT COUNT(*) as cnt FROM Status
|
||||||
|
WHERE $where
|
||||||
|
";
|
||||||
|
|
||||||
|
mfLoghandler::singleton()->debug($sql);
|
||||||
|
|
||||||
|
$res = $db->query($sql);
|
||||||
|
if($db->num_rows($res)) {
|
||||||
|
$data = $db->fetch_object($res);
|
||||||
|
return $data->cnt;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function search($filter, $limit = false) {
|
||||||
|
$items = [];
|
||||||
|
$db = FronkDB::singleton();
|
||||||
|
|
||||||
|
$where = self::getSqlFilter($filter);
|
||||||
|
|
||||||
|
$sql = "SELECT * FROM Status
|
||||||
|
WHERE $where
|
||||||
|
ORDER BY code, name
|
||||||
|
";
|
||||||
|
|
||||||
|
if(is_array($limit) && count($limit)) {
|
||||||
|
if(is_numeric($limit['start']) && is_numeric($limit['count'])) {
|
||||||
|
$sql .= " LIMIT ".$limit['start'].", ".$limit['count'];
|
||||||
|
} elseif(is_numeric($count)) {
|
||||||
|
$sql .= " LIMIT ".$limit['count'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mfLoghandler::singleton()->debug($sql);
|
||||||
|
|
||||||
|
$res = $db->query($sql);
|
||||||
|
if($db->num_rows($res)) {
|
||||||
|
while($data = $db->fetch_object($res)) {
|
||||||
|
$items[] = new Status($data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $items;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function getSqlFilter($filter) {
|
||||||
|
$where = "1=1 ";
|
||||||
|
|
||||||
|
//var_dump($filter);exit;
|
||||||
|
|
||||||
|
if(array_key_exists("code", $filter)) {
|
||||||
|
$code = $filter['code'];
|
||||||
|
if(is_numeric($code)) {
|
||||||
|
$where .= " AND code=$code";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//var_dump($filter, $where);exit;
|
||||||
|
return $where;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -3,7 +3,9 @@
|
|||||||
class ADBWohneinheit extends mfBaseModel {
|
class ADBWohneinheit extends mfBaseModel {
|
||||||
private $hausnummer;
|
private $hausnummer;
|
||||||
private $rimo_workorder;
|
private $rimo_workorder;
|
||||||
|
private $ftu_data;
|
||||||
|
private $status;
|
||||||
|
|
||||||
protected function init() {
|
protected function init() {
|
||||||
$this->db = FronkDB::singleton(ADDRESSDB_DBHOST, ADDRESSDB_DBUSER, ADDRESSDB_DBPASS, ADDRESSDB_DBNAME);
|
$this->db = FronkDB::singleton(ADDRESSDB_DBHOST, ADDRESSDB_DBUSER, ADDRESSDB_DBPASS, ADDRESSDB_DBNAME);
|
||||||
$this->table = "Wohneinheit";
|
$this->table = "Wohneinheit";
|
||||||
@@ -131,37 +133,31 @@ class ADBWohneinheit extends mfBaseModel {
|
|||||||
return $code;
|
return $code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function afterLoad() {
|
public function getExternalData() {
|
||||||
//$this->hausnummer = new ADBHausnummer($this->hausnummer_id);
|
if(!$this->external_data) return [];
|
||||||
//$this->loadStatus();
|
|
||||||
//$this->loadProvider();
|
$extdata = json_decode($this->external_data, true);
|
||||||
|
if(is_array($extdata) && count($extdata)) {
|
||||||
|
return $extdata;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
public function loadStatus() {
|
public function getExternalRimoData() {
|
||||||
if(!$this->id) {
|
$extdata = $this->getExternalData();
|
||||||
|
if(!is_array($extdata) || !count($extdata)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$status = HausnummerStatus::singleton();
|
//var_dump($extdata);exit;
|
||||||
$this->status = $status->getObject($this->status_id);
|
if(array_key_exists("rimo", $extdata) && count($extdata['rimo'])) {
|
||||||
}
|
$rimo_data = $extdata['rimo'];
|
||||||
|
if(is_array($extdata['rimo']) && count($extdata['rimo'])) {
|
||||||
public function loadProvider() {
|
return $rimo_data;
|
||||||
if(!$this->id) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
$res = $this->db->select("HausnummerProvider", "*", "hausnummer_id=".$this->id);
|
|
||||||
if($this->db->num_rows($res)) {
|
|
||||||
while($data = $this->db->fetch_object($res)) {
|
|
||||||
$provider = new Provider($data->provider_id);
|
|
||||||
$this->providerlist[$provider->id] = $provider->name;
|
|
||||||
$this->providers[] = $provider;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return false;
|
||||||
}*/
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getProperty($name) {
|
public function getProperty($name) {
|
||||||
if($this->$name == null) {
|
if($this->$name == null) {
|
||||||
@@ -175,7 +171,29 @@ class ADBWohneinheit extends mfBaseModel {
|
|||||||
$this->rimo_workorder = RimoWorkorderModel::getFirst(['adb_wohneinheit_id' => $this->id]);
|
$this->rimo_workorder = RimoWorkorderModel::getFirst(['adb_wohneinheit_id' => $this->id]);
|
||||||
return $this->rimo_workorder;
|
return $this->rimo_workorder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($name == "ftu_data") {
|
||||||
|
$rimo_data = $this->getExternalRimoData();
|
||||||
|
|
||||||
|
if(!is_array($rimo_data) || !count($rimo_data)) {
|
||||||
|
return ['id' => "", 'name' => ""];
|
||||||
|
}
|
||||||
|
|
||||||
|
if(array_key_exists("ftu", $rimo_data)) {
|
||||||
|
$ftu_data = $rimo_data['ftu'];
|
||||||
|
if($ftu_data['id'] || $ftu_data['name']) {
|
||||||
|
$this->ftu_data = $ftu_data;
|
||||||
|
return $this->ftu_data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ['id' => "", 'name' => ""];
|
||||||
|
}
|
||||||
|
|
||||||
|
if($name == "status") {
|
||||||
|
$this->status = new ADBStatus($this->status_id);
|
||||||
|
return $this->status;
|
||||||
|
}
|
||||||
|
|
||||||
$classname = ucfirst($name);
|
$classname = ucfirst($name);
|
||||||
$idfield = $name."_id";
|
$idfield = $name."_id";
|
||||||
$this->$name = new $classname($this->$idfield);
|
$this->$name = new $classname($this->$idfield);
|
||||||
|
|||||||
@@ -464,6 +464,7 @@ class PreorderApicontroller extends mfBaseApicontroller {
|
|||||||
$where = "1=1 ";
|
$where = "1=1 ";
|
||||||
$unit = false;
|
$unit = false;
|
||||||
|
|
||||||
|
// We ignore Stock when matching units
|
||||||
$unit_search_count_without_stock = count($unit_search);
|
$unit_search_count_without_stock = count($unit_search);
|
||||||
if(array_key_exists("stock", $unit_search) && $unit_search['stock']) {
|
if(array_key_exists("stock", $unit_search) && $unit_search['stock']) {
|
||||||
$unit_search_count_without_stock--;
|
$unit_search_count_without_stock--;
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ class Preorder extends mfBaseModel {
|
|||||||
private $building;
|
private $building;
|
||||||
private $adb_hausnummer;
|
private $adb_hausnummer;
|
||||||
private $adb_wohneinheit;
|
private $adb_wohneinheit;
|
||||||
|
private $services;
|
||||||
|
private $ordered_services;
|
||||||
private $creator;
|
private $creator;
|
||||||
private $editor;
|
private $editor;
|
||||||
private $attribute = [];
|
private $attribute = [];
|
||||||
@@ -314,7 +316,7 @@ class Preorder extends mfBaseModel {
|
|||||||
return $a;
|
return $a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getProperty($name) {
|
public function getProperty($name) {
|
||||||
if($this->$name == null) {
|
if($this->$name == null) {
|
||||||
|
|
||||||
@@ -366,8 +368,35 @@ class Preorder extends mfBaseModel {
|
|||||||
return $this->adb_wohneinheit;
|
return $this->adb_wohneinheit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($name == "addon_services") {
|
if($name == "services") {
|
||||||
|
if(!$this->addon_services) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
$addon_services = json_decode($this->addon_services);
|
||||||
|
if(json_last_error() === JSON_ERROR_NONE) {
|
||||||
|
$this->services = $addon_services;
|
||||||
|
return $this->services;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($name == "ordered_services") {
|
||||||
|
if(!$this->addon_services) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
$ordered_services = [];
|
||||||
|
$addon_services = json_decode($this->addon_services);
|
||||||
|
if(json_last_error() === JSON_ERROR_NONE) {
|
||||||
|
foreach($addon_services as $s) {
|
||||||
|
if($s->ordered) {
|
||||||
|
$ordered_services[] = $s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->ordered_services = $ordered_services;
|
||||||
|
return $this->ordered_services;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($name == "attribute") {
|
if($name == "attribute") {
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class PreorderstatusModel {
|
|||||||
public static function getAll() {
|
public static function getAll() {
|
||||||
$items = [];
|
$items = [];
|
||||||
|
|
||||||
$db = FronkDB::singleton();
|
$db = FronkDB::singleton(ADDRESSDB_DBHOST, ADDRESSDB_DBUSER, ADDRESSDB_DBPASS, ADDRESSDB_DBNAME);
|
||||||
|
|
||||||
$res = $db->select("Preorderstatus", "*");
|
$res = $db->select("Preorderstatus", "*");
|
||||||
if($db->num_rows($res)) {
|
if($db->num_rows($res)) {
|
||||||
@@ -57,7 +57,7 @@ class PreorderstatusModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static function getFirst($filter = false) {
|
public static function getFirst($filter = false) {
|
||||||
$db = FronkDB::singleton();
|
$db = FronkDB::singleton(ADDRESSDB_DBHOST, ADDRESSDB_DBUSER, ADDRESSDB_DBPASS, ADDRESSDB_DBNAME);
|
||||||
|
|
||||||
$where = self::getSqlFilter($filter);
|
$where = self::getSqlFilter($filter);
|
||||||
$res = $db->select("Preorderstatus", "*", "$where ORDER BY code, name");
|
$res = $db->select("Preorderstatus", "*", "$where ORDER BY code, name");
|
||||||
@@ -74,7 +74,7 @@ class PreorderstatusModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static function count($filter) {
|
public static function count($filter) {
|
||||||
$db = FronkDB::singleton();
|
$db = FronkDB::singleton(ADDRESSDB_DBHOST, ADDRESSDB_DBUSER, ADDRESSDB_DBPASS, ADDRESSDB_DBNAME);
|
||||||
|
|
||||||
$where = self::getSqlFilter($filter);
|
$where = self::getSqlFilter($filter);
|
||||||
$sql = "SELECT COUNT(*) as cnt FROM Preorderstatus
|
$sql = "SELECT COUNT(*) as cnt FROM Preorderstatus
|
||||||
@@ -93,7 +93,7 @@ class PreorderstatusModel {
|
|||||||
|
|
||||||
public static function search($filter, $limit = false) {
|
public static function search($filter, $limit = false) {
|
||||||
$items = [];
|
$items = [];
|
||||||
$db = FronkDB::singleton();
|
$db = FronkDB::singleton(ADDRESSDB_DBHOST, ADDRESSDB_DBUSER, ADDRESSDB_DBPASS, ADDRESSDB_DBNAME);
|
||||||
|
|
||||||
$where = self::getSqlFilter($filter);
|
$where = self::getSqlFilter($filter);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user