Merge branch 'fronkdev' into 'master'

Added foldable details in Preorder Index

See merge request fronk/thetool!111
This commit is contained in:
Frank Schubert
2023-10-31 12:56:22 +00:00
10 changed files with 616 additions and 41 deletions

View File

@@ -228,6 +228,9 @@
<table class="table table-striped table-hover">
<tr>
<?php if($me->is(["Admin", "netowner"])): ?>
<th></th>
<?php endif; ?>
<?php if(!$me->is("preorderfront")): ?><th>Kampagne</th><?php endif; ?>
<th>Bestelltyp<br />Bestellcode</th>
<th>Status</th>
@@ -244,7 +247,12 @@
<th></th>
</tr>
<?php foreach($preorders as $preorder): ?>
<tr>
<tr class="preorder-list-tr" id="preorder-<?=$preorder->id?>">
<?php if($me->is(["Admin", "netowner"])): ?>
<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>
</td>
<?php endif; ?>
<?php if(!$me->is("preorderfront")): ?><td><?=$preorder->campaign->name?></td><?php endif; ?>
<td>
<?=__($preorder->type, "preorder")?><br />
@@ -294,11 +302,20 @@
<?php endif; ?>
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;">
<?php if(!$me->is("preorderfront")): ?>
<a href="<?=self::getUrl("Preorder", "edit", ["id" => $preorder->id])?>"><i class="far fa-edit" title="Vorbestellkampagne Bearbeiten"></i></a>
<a href="<?=self::getUrl("Preorder", "edit", ["id" => $preorder->id])?>"><i class="far fa-edit" title="Vorbestellung Bearbeiten"></i></a>
<a href="<?=self::getUrl("Preorder", "delete", ["id" => $preorder->id, "filter" => $filter])?>" class="text-danger" onclick="if(!confirm('Vorbestellung wirklich löschen?')) return false;" title="Vorbestellung Löschen"><i class="fas fa-trash"></i></a>
<?php endif; ?>
</td>
</tr>
<?php if($me->is(["Admin","netowner"])): ?>
<tr id="preorder-detail-<?=$preorder->id?>" style="display:none; background-color:#fff">
<td colspan="13">
<?php include(realpath(dirname(__FILE__))."/include/preorder-detail.php"); ?>
</td>
</tr>
<tr style="display:none;"></tr>
<?php endif; ?>
<?php endforeach; ?>
</table>
@@ -557,5 +574,30 @@
<?php if(is_array($filter) && count($filter)): ?>
//refreshMap();
<?php endif; ?>
function togglePreorder(id) {
$('#preorder-detail-' + id).toggle();
if($('#preorder-detail-' + id).is(":hidden")) {
$('#preorder-' + id).removeClass("bg-lightblue");
$('#preorder-' + id).removeClass("text-info");
history.replaceState(null, null, ' ');
} else {
$('#preorder-' + id).addClass("text-info");
$('#preorder-' + id).addClass("bg-lightblue");
location.hash = "preorder=" + id;
return false;
}
}
// navigation
var preorder_id;
var hash = window.location.hash.substr(1);
var match = hash.match(/preorder=(\d+)/);
if(match && match[1]) {
preorder_id = match[1]
togglePreorder(preorder_id);
$('html, body').animate( {scrollTop: $('#preorder-' + preorder_id).offset().top - 230}, 200);
}
</script>
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/footer.php"); ?>

View File

@@ -0,0 +1,332 @@
<div class="card">
<div class="card-body">
<div class="row justify-content-center mt-2">
<div class="col-12">
<ul class="nav nav-tabs order-tab">
<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-<?=$preorder->id?>-address" data-toggle="tab" aria-expanded="false">Adressdetails</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>
</div>
</div>
<div class="tab-content pt-0">
<div id="preorder-detail-<?=$preorder->id?>-detail" class="tab-pane show active">
<div class="row justify-content-center">
<div class="col-12">
<div class="card">
<div class="card-body">
<div class="card-header bg-info text-white pl-2 pr-2 pt-1 pb-1">Details</div>
<div class="row">
<div class="col-8">
<h3>Allgemein</h3>
<table class="table table-sm table-striped">
<tr>
<th>ID:</th>
<td class="text-monospace"><?=$preorder->id?></td>
</tr><tr>
<th>Bestellcode:</th>
<td class="text-monospace"><?=$preorder->ucode?></td>
</tr><th>Kampagne:</th>
<td><?=$preorder->campaign->name?></td>
</tr><tr>
<th>Status:</th>
<td class="text-monospace"><?=$preorder->status->code?> - <?=$preorder->status->name?></td>
</tr><tr>
<th>OAID:</th>
<td class="text-monospace text-pink"><?=$preorder->oaid?></td>
</tr><tr>
<th>Bestelltyp:</th>
<td><?=__($preorder->type, "preorder")?></td>
</tr><tr>
<th>Anschlusstyp:</th>
<td><?=__($preorder->connection_type, "preorder")?></td>
</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>
<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 id="preorder-detail-<?=$preorder->id?>-address" class="tab-pane">
<div class="row justify-content-center">
<div class="col-12">
<div class="card">
<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="col-6">
<h3>Anschlussadresse</h3>
<table class="table table-sm table-striped">
<tr>
<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>
</tr><tr>
<th>PLZ Ort</th>
<td><?=$preorder->adb_hausnummer->plz->plz?> <?=$preorder->adb_hausnummer->ortschaft->name?></td>
</tr><tr>
<th>Gemeinde</th>
<td><?=$preorder->adb_hausnummer->strasse->gemeinde->name?></td>
</tr>
</table>
<h3>Nutzungseinheit</h3>
<table class="table table-sm table-striped">
<tr>
<th>ID</th>
<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>
<th>Bezeichner</th>
<td><?=$preorder->adb_wohneinheit->bezeichner?></td>
</tr>
</table>
</div>
<div class="col-6">
<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>
</div>
</div>
</div>
<div id="preorder-detail-<?=$preorder->id?>-rimo" class="tab-pane">
<div class="row justify-content-center">
<div class="col-12">
<div class="card">
<div class="card-body">
<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>
</div>
</div>

View File

@@ -87,8 +87,8 @@
<i class="fad fa-fw fa-running"></i>Netzbetrieb <div class="arrow-down"></div>
</a>
<ul class="submenu">
<?php if($me->can("Cpeprovisioning")): ?><li><a href="<?=self::getUrl("Cpeprovisioning")?>"><i class="fad fa-fw fa-hdd text-info"></i> CPE Provisioning</a></li><?php endif; ?>
<?php if($me->can("Cpeshipping")): ?><li><a href="<?=self::getUrl("Cpeshipping")?>"><i class="fad fa-fw fa-shipping-fast text-info"></i> CPE Versand</a></li><?php endif; ?>
<?php if($me->isAdmin() || $me->can("Cpeprovisioning")): ?><li><a href="<?=self::getUrl("Cpeprovisioning")?>"><i class="fad fa-fw fa-hdd text-info"></i> CPE Provisioning</a></li><?php endif; ?>
<?php if($me->isAdmin() || $me->can("Cpeshipping")): ?><li><a href="<?=self::getUrl("Cpeshipping")?>"><i class="fad fa-fw fa-shipping-fast text-info"></i> CPE Versand</a></li><?php endif; ?>
</ul>
</li>
<?php endif; ?>