Files
thetool/Layout/default/Patching/Index.php
2022-04-19 21:41:08 +02:00

197 lines
11 KiB
PHP

<?php
$pagination_baseurl = $this->getUrl($Mod,"Index");
$pagination_baseurl_params = ["filter" => $filter];
$pagination_entity_name = "Patchungen";
?>
<?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 active">Patchungen</li>
</ol>
</div>
<h4 class="page-title">Patchungen</h4>
</div>
</div>
</div>
<!-- end page title -->
<div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-body mb-3">
<h4 class="header-title mb-3">Filter</h4>
<form method="get" action="<?=self::getUrl("Patching")?>">
<div class="row">
<div class="col-1">
<label class="form-label" for="filter_network_id">Netzgebiet</label>
<select name="filter[network_id]" id="filter_network_id" class="form-control">
<option></option>
<?php foreach($mynetworks as $fnet): ?>
<option value="<?=$fnet->id?>" <?=($filter['network_id'] == $fnet->id) ? "selected='selected'" : ""?>><?=$fnet->name?></option>
<?php endforeach; ?>
</select>
</div>
<div class="col-2">
<label class="form-label" for="filter_pop_id">POP</label>
<select name="filter[pop_id]" id="filter_pop_id" class="form-control">
<option></option>
<?php foreach($mynetworks as $fnet): ?>
<?php if(is_array($fnet->pops) && count($fnet->pops)): ?>
<optgroup label="<?=$fnet->name?>">
<?php foreach($fnet->pops as $pop): ?>
<option value="<?=$pop->id?>" <?=($filter['pop_id'] == $pop->id) ? "selected='selected'" : ""?>><?=$pop->name?></option>
<?php endforeach; ?>
</optgroup>
<?php endif; ?>
<?php endforeach; ?>
</select>
</div>
<div class="col-2">
<label class="form-label" for="filter_patched">Patchstatus</label>
<select name="filter[patched]" id="filter_patched" class="form-control">
<option value="0" <?=($filter['patched'] < 1) ? "selected='selected'" : ""?>>Nicht gepatched</option>
<option value="1" <?=($filter['patched'] == 1) ? "selected='selected'" : ""?>>Gepatched</option>
<option value="2" <?=($filter['patched'] == 2) ? "selected='selected'" : ""?>>Vorpatchen</option>
</select>
</div>
<div class="col-2">
<label class="form-label" for="filter_hide_delayed_finish">Verzögerte Herstellung</label>
<select name="filter[hide_delayed_finish]" id="filter_hide_delayed_finish" class="form-control">
<option value="0" <?=(array_key_exists("hide_delayed_finish", $filter) &&$filter['hide_delayed_finish'] != 1) ? "selected='selected'" : ""?>>Anzeigen</option>
<option value="1" <?=(!array_key_exists("hide_delayed_finish", $filter) || $filter['hide_delayed_finish'] == 1) ? "selected='selected'" : ""?>>Nicht anzeigen</option>
</select>
</div>
<div class="col-1">
<label class="form-label" for="filter_code">Objekt ID</label>
<input type="text" class="form-control" name="filter[code]" id="filter_code" value="<?=$filter['code']?>" />
</div>
<div class="col-2">
<label class="form-label" for="filter_street">Straße</label>
<input type="text" class="form-control" name="filter[street]" id="filter_street" value="<?=$filter['street']?>" />
</div>
</div>
<div class="row mt-2">
<div class="col">
<button type="submit" class="btn btn-primary">Filter anwenden</button>
<a class="btn btn-secondary" href="<?=self::getUrl("Patching")?>">Filter zurücksetzen</a>
</div>
</div>
</form>
</div>
</div>
<div class="card">
<div class="card-body mb-3">
<h4 class="header-title">Patchungen</h4>
<?php include(realpath(dirname(__FILE__)."/../")."/tpl/pagination.php"); ?>
<?php include(realpath(dirname(__FILE__)."/../")."/tpl/pagination-summary.php"); ?>
<table class="table table-striped table-hover">
<tr class="table-bordered text-center">
<th colspan="4">Standort</th>
<th colspan="2">ODF</th>
<th colspan="5">Abschluss/Device</th>
<th></th>
</tr>
<tr class="table-bordered">
<th>Netzgebiet</th>
<th>POP</th>
<th>Kunde</th>
<th>Standort</th>
<th>Patchposition ODF</th>
<th>ODF Port</th>
<th>Typ</th>
<th>Splitter / Gerät</th>
<th>Port</th>
<th>Gepatched</th>
<th>Von</th>
<th></th>
</tr>
<?php foreach($terminations as $term): ?>
<tr>
<td><?=$term->building->network->name?></td>
<td>
<?php if($term->getPop()): ?>
<?=$term->getPop()->name?>
<?php else: ?>
<?=$term->building->pop->name?>
<?php endif; ?>
</td>
<td><?=($term->order->owner) ? $term->order->owner->customer_number : ""?><br /> <?=($term->order->owner) ? $term->order->owner->getCompanyOrName() : ""?></td>
<td>
<?=$term->building->street?><br />
<?=$term->building->zip?> <?=$term->building->city?>
</td>
<td class="text-mono text-primary" title="Schrank: <?=($term->workflowitems["ist_schrank"]->value->id) ? $term->workflowitems["ist_schrank"]->value->value_string : $term->workflowitems["schrank"]->value->value_string?> / Einschub: <?=($term->workflowitems["ist_baugruppe"]->value->id) ? $term->workflowitems["ist_baugruppe"]->value->value_string : $term->workflowitems["baugruppe"]->value->value_string?> / Modul: <?=($term->workflowitems["ist_modul"]->value->id) ? $term->workflowitems["ist_modul"]->value->value_string : $term->workflowitems["modul"]->value->value_string?> / Port: <?=($term->workflowitems["ist_ports"]->value->id) ? $term->workflowitems["ist_ports"]->value->value_string : $term->workflowitems["ports"]->value->value_string?>">
<?=($term->workflowitems["ist_schrank"]->value->id) ? $term->workflowitems["ist_schrank"]->value->value_string : $term->workflowitems["schrank"]->value->value_string?> /
<?=($term->workflowitems["ist_baugruppe"]->value->id) ? $term->workflowitems["ist_baugruppe"]->value->value_string : $term->workflowitems["baugruppe"]->value->value_string?> /
<?=($term->workflowitems["ist_modul"]->value->id) ? $term->workflowitems["ist_modul"]->value->value_string : $term->workflowitems["modul"]->value->value_string?> /
<?=($term->workflowitems["ist_ports"]->value->id) ? $term->workflowitems["ist_ports"]->value->value_string : $term->workflowitems["ports"]->value->value_string?>
</td>
<td>
<select name="linework_port" form="term-form-<?=$term->id?>" class="form-control">
<?php foreach($term->getLineworkportPairs() as $ports): ?>
<?php foreach($ports as $p): ?>
<option value="<?=$p?>" <?=($term->patching->linework_ports == $p) ? "selected='selected'" : ""?>><?=$p?></option>
<?php endforeach; ?>
<?php endforeach; ?>
</select>
</td>
<td>
<select name="device_type" form="term-form-<?=$term->id?>" class="form-control">
<option></option>
<option value="splitter" <?=($term->patching->device_type == "splitter") ? "selected='selected'" : ""?>>Splitter</option>
<option value="pon" <?=($term->patching->device_type == "pon") ? "selected='selected'" : ""?>>Shared PON-Port</option>
<option value="switch" <?=($term->patching->device_type == "switch") ? "selected='selected'" : ""?>>Switch</option>
</select>
</td>
<td><input type="text" class="form-control" form="term-form-<?=$term->id?>" name="device_name" value="<?=$term->patching->device_name?>" placeholder="Splitte / Gerät" /></td>
<td><input type="text" class="form-control" form="term-form-<?=$term->id?>" name="device_port" value="<?=$term->patching->device_port?>" placeholder="Port" /></td>
<td><input type="checkbox" class="form-control" form="term-form-<?=$term->id?>" name="patched" value="1" <?=($term->patching->patched == 1) ? "checked='checked'" : ""?> /></td>
<td <?=($term->patching->patched == 1 && $term->patching->patched_by) ? "title='Gepatched: ".date("d.m.Y H:i",$term->patching->patched_date)." von ".$term->patching->patcher->name." (".$term->patching->patcher->address->getCompanyOrName(true).")'" : ""?>>
<?php if($term->patching->patched == 1 && $term->patching->patched_by): ?>
<?=($term->patching->patcher) ? $term->patching->patcher->getAbbrName() : ""?>
<?php endif; ?>
</td>
<td>
<form method="post" id="term-form-<?=$term->id?>" action="<?=self::getUrl("Patching","save", ["s" => $pagination['start'], "filter" => $filter])?>">
<input type="hidden" name="termination_id" value="<?=$term->id?>" />
<input type="submit" class="btn btn-primary" value="Speichern" />
</form>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php include(realpath(dirname(__FILE__)."/../")."/tpl/pagination-summary.php"); ?>
<?php include(realpath(dirname(__FILE__)."/../")."/tpl/pagination.php"); ?>
</div>
</div>
</div>
</div>
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/footer.php"); ?>