Added Borderpoint status to Preorder

This commit is contained in:
Frank Schubert
2025-05-07 18:33:20 +02:00
parent c7ce28acf8
commit 678544ced7
9 changed files with 336 additions and 143 deletions
@@ -378,131 +378,133 @@
<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>Building External ID:</th>
<td class="text-monospace"><?=$preorder->adb_hausnummer->rimo_id?>
</tr><tr>
<th>Building Execution State:</th>
<td class="text-monospace"><?=$preorder->adb_hausnummer->rimo_ex_state?>
</tr><tr>
<th>Building Operational State:</th>
<td class="text-monospace"><?=($preorder->adb_hausnummer->rimo_op_state != "Undefined") ? $preorder->adb_hausnummer->rimo_op_state : ""?>
</tr><tr>
<th>Home External ID:</th>
<td class="text-monospace"><?=$preorder->adb_wohneinheit->extref?>
</tr><tr>
<th>Home Execution State:</th>
<td class="text-monospace"><?=$preorder->adb_wohneinheit->rimo_ex_state?>
</tr><tr>
<th>Home Operational State:</th>
<td class="text-monospace"><?=($preorder->adb_wohneinheit->rimo_op_state != "Undefined") ? $preorder->adb_wohneinheit->rimo_op_state : ""?>
</tr>
</table>
<div class="row col">
<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>Building External ID:</th>
<td class="text-monospace"><?=$preorder->adb_hausnummer->rimo_id?>
</tr><tr>
<th>Building Execution State:</th>
<td class="text-monospace"><?=$preorder->adb_hausnummer->rimo_ex_state?>
</tr><tr>
<th>Building Operational State:</th>
<td class="text-monospace"><?=($preorder->adb_hausnummer->rimo_op_state != "Undefined") ? $preorder->adb_hausnummer->rimo_op_state : ""?>
</tr><tr>
<th>Home External ID:</th>
<td class="text-monospace"><?=$preorder->adb_wohneinheit->extref?>
</tr><tr>
<th>Home Execution State:</th>
<td class="text-monospace"><?=$preorder->adb_wohneinheit->rimo_ex_state?>
</tr><tr>
<th>Home Operational State:</th>
<td class="text-monospace"><?=($preorder->adb_wohneinheit->rimo_op_state != "Undefined") ? $preorder->adb_wohneinheit->rimo_op_state : ""?>
</tr>
</table>
</div>
<div class="row">
<div class="col workorder-container">
<h3>Workorder</h3>
<?php if($preorder->adb_wohneinheit_id && is_array($preorder->adb_wohneinheit->rimo_workorders) && count($preorder->adb_wohneinheit->rimo_workorders)): ?>
<?php foreach($preorder->adb_wohneinheit->rimo_workorders as $wo): ?>
<h4>
<?=$wo->rimo_name?>
<a href="<?=self::getUrl("RimoWorkorder", "downloadAh", ["id" => $wo->id])?>" onclick="event.preventDefault(); downloadWorkorderAha(<?=$wo->id?>);"><i class="fas fa-fw fa-file-download ml-2"></i> AHA Blatt</a>
</h4>
<small id="preorder-detail-<?=$preorder->id?>-workorder-<?=$wo->id?>-del"><a href="#" onclick="if(confirm('Achtung: Löscht die Workorder in thetool, aber NICHT in RIMO!')) return deleteWorkorder(<?=$preorder->id?>, <?=$wo->id?>)" class="text-danger"><i class="far fa-times-circle"></i> Workorder löschen</a></small>
<table class="table table-sm table-striped" id="preorder-detail-<?=$preorder->id?>-workorder-<?=$wo->id?>">
<tr>
<th>Name</th>
<td class="text-monospace"><?=$wo->rimo_name?></td>
</tr><tr>
<th>External ID</th>
<td class="text-monospace"><?=$wo->rimo_id?></td>
</tr><tr>
<th>Status</th>
<td><?=$wo->rimo_status?></td>
</tr>
<?php if($wo->rimo_team_name): ?>
<tr>
<th>Zugewiesen an:</th>
<td><?=$wo->rimo_team_name?></td>
</tr>
<?php endif; ?>
<tr>
<th>Erstellt</th>
<td class="text-monospace"><?=date("d.m.Y H:i:s", $wo->create)?></td>
</tr>
<tr>
<th>Bemerkung</th>
<td id="wo-remark-<?=$preorder->id?>-<?=$wo->id?>">
<div class="input-group mb-2">
<input type="text" class="form-control" name="new_remark" placeholder="Bemerkung hinzufügen" />
<div class="input-group-append">
<button class="btn btn-primary" type="button" id="button-addon2" onclick="saveRemark(<?=$preorder->id?>, <?=$wo->id?>)">Hinzufügen</button>
</div>
</div>
<div class="remark-text border p-1 text-monospace" id="preorder-detail-<?=$preorder->id?>-workorder-<?=$wo->id?>-remarks">
<?=nl2br(htmlentities($wo->remarks))?>
</div>
</td>
</tr>
</table>
<?php endforeach; ?>
<?php else: ?>
<button type="button" class="btn btn-outline-primary create-workorder" onclick="createWorkorder(<?=$preorder->id?>)"><i class="fas fa-fw fa-plus"></i> <i class="fas fa-r"></i><i class="fas fa-fw fa-gears"></i> Wokorder erstellen</button>
<?php endif; ?>
</div>
</div>
</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>
<h3>FCP</h3>
<?php
if($preorder->fcp): ?>
<div class="row col">
<h3>FTU</h3>
<table class="table table-sm table-striped">
<tr>
<th>FCP Name:</th>
<td class="text-monospace"><?=$preorder->fcp->name?>
</tr><tr>
<th>FCP External ID:</th>
<td class="text-monospace"><?=$preorder->fcp->rimo_id?>
</tr>
<tr>
<th>FCP Execution State:</th>
<td class="text-monospace"><?=$preorder->fcp->rimo_ex_state?>
</tr><tr>
<th>FCP Operational State:</th>
<td class="text-monospace"><?=($preorder->fcp->rimo_op_state != "Undefined") ? $preorder->fcp->rimo_op_state : ""?>
</tr><tr>
<th>FCP Building Type:</th>
<td class="text-monospace"><?=$preorder->fcp->building_type?>
</tr>
<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>
<?php else: ?>
<p>Kein FCP zugewiesen</p>
<?php endif; ?>
</div>
</div>
<div class="row">
<div class="col-6 workorder-container">
<h3>Workorder</h3>
<?php if($preorder->adb_wohneinheit_id && is_array($preorder->adb_wohneinheit->rimo_workorders) && count($preorder->adb_wohneinheit->rimo_workorders)): ?>
<?php foreach($preorder->adb_wohneinheit->rimo_workorders as $wo): ?>
<h4>
<?=$wo->rimo_name?>
<a href="<?=self::getUrl("RimoWorkorder", "downloadAh", ["id" => $wo->id])?>" onclick="event.preventDefault(); downloadWorkorderAha(<?=$wo->id?>);"><i class="fas fa-fw fa-file-download ml-2"></i> AHA Blatt</a>
</h4>
<small id="preorder-detail-<?=$preorder->id?>-workorder-<?=$wo->id?>-del"><a href="#" onclick="if(confirm('Achtung: Löscht die Workorder in thetool, aber NICHT in RIMO!')) return deleteWorkorder(<?=$preorder->id?>, <?=$wo->id?>)" class="text-danger"><i class="far fa-times-circle"></i> Workorder löschen</a></small>
<table class="table table-sm table-striped" id="preorder-detail-<?=$preorder->id?>-workorder-<?=$wo->id?>">
<h3>FCP</h3>
<?php
if($preorder->fcp): ?>
<table class="table table-sm table-striped">
<tr>
<th>Name</th>
<td class="text-monospace"><?=$wo->rimo_name?></td>
<th>FCP Name:</th>
<td class="text-monospace"><?=$preorder->fcp->name?>
</tr><tr>
<th>External ID</th>
<td class="text-monospace"><?=$wo->rimo_id?></td>
<th>FCP External ID:</th>
<td class="text-monospace"><?=$preorder->fcp->rimo_id?>
</tr>
<tr>
<th>FCP Execution State:</th>
<td class="text-monospace"><?=$preorder->fcp->rimo_ex_state?>
</tr><tr>
<th>Status</th>
<td><?=$wo->rimo_status?></td>
</tr>
<?php if($wo->rimo_team_name): ?>
<tr>
<th>Zugewiesen an:</th>
<td><?=$wo->rimo_team_name?></td>
</tr>
<?php endif; ?>
<tr>
<th>Erstellt</th>
<td class="text-monospace"><?=date("d.m.Y H:i:s", $wo->create)?></td>
</tr>
<tr>
<th>Bemerkung</th>
<td id="wo-remark-<?=$preorder->id?>-<?=$wo->id?>">
<div class="input-group mb-2">
<input type="text" class="form-control" name="new_remark" placeholder="Bemerkung hinzufügen" />
<div class="input-group-append">
<button class="btn btn-primary" type="button" id="button-addon2" onclick="saveRemark(<?=$preorder->id?>, <?=$wo->id?>)">Hinzufügen</button>
</div>
</div>
<div class="remark-text border p-1 text-monospace" id="preorder-detail-<?=$preorder->id?>-workorder-<?=$wo->id?>-remarks">
<?=nl2br(htmlentities($wo->remarks))?>
</div>
</td>
<th>FCP Operational State:</th>
<td class="text-monospace"><?=($preorder->fcp->rimo_op_state != "Undefined") ? $preorder->fcp->rimo_op_state : ""?>
</tr><tr>
<th>FCP Building Type:</th>
<td class="text-monospace"><?=$preorder->fcp->building_type?>
</tr>
</table>
<?php endforeach; ?>
<?php else: ?>
<p>Kein FCP zugewiesen</p>
<?php endif; ?>
<?php else: ?>
<button type="button" class="btn btn-outline-primary create-workorder" onclick="createWorkorder(<?=$preorder->id?>)"><i class="fas fa-fw fa-plus"></i> <i class="fas fa-r"></i><i class="fas fa-fw fa-gears"></i> Wokorder erstellen</button>
<?php endif; ?>
</div>
</div>
<div class="col-6">
<div class="row col">
<h3>
Patchposition
<?php if($preorder->adb_wohneinheit_id): ?>
@@ -559,6 +561,7 @@
</div>
</div>
</div>
</div>
</div>
<div id="preorder-detail-<?=$preorder->id?>-flags" class="tab-pane">
@@ -570,16 +573,47 @@
<div class="row">
<div class="col-6">
<h3>Bestellstatus</h3>
<table class="table table-sm table-striped">
<tr>
<th>Status Code</th>
<td class="text-monospace"><?=$preorder->status->code?></td>
</tr><tr>
<th>Status Text</th>
<td class="text-monospace"><?=$preorder->status->name?></td>
</tr>
</table>
<div class="row">
<div class="col">
<h3>Bestellstatus</h3>
<table class="table table-sm table-striped">
<tr>
<th>Status Code</th>
<td class="text-monospace"><?=$preorder->status->code?></td>
</tr><tr>
<th>Status Text</th>
<td class="text-monospace"><?=$preorder->status->name?></td>
</tr>
</table>
</div>
</div>
<div class="row">
<div class="col">
<h3>Borderpoint Status</h3>
<div class="row">
<div class="col-3 text-center">
<label>
<input type="radio" class="form-control" name="borderpoint_status_<?=$preorder->id?>" id="borderpoint_need_measurement" value="need_measurement" <?=($preorder->borderpoint_status == "need_measurement") ? "checked='checked'" : ""?> />
Messung erforderlich
</label>
</div>
<div class="col-3 text-center">
<label>
<input type="radio" class="form-control" name="borderpoint_status_<?=$preorder->id?>" id="borderpoint_informed" value="informed" <?=($preorder->borderpoint_status == "informed") ? "checked='checked'" : ""?> />
Beauskunftet
</label>
</div>
<div class="col-3 text-center">
<label>
<input type="radio" class="form-control" name="borderpoint_status_<?=$preorder->id?>" id="borderpoint_need_digging" value="need_digging" <?=($preorder->borderpoint_status == "need_digging") ? "checked='checked'" : ""?> />
Grabung ausständig
</label>
</div>
</div>
</div>
</div>
</div>
<div class="col-6">
<h3>Statusflags</h3>