Added Role view to Network

This commit is contained in:
Frank Schubert
2021-07-01 20:56:41 +02:00
parent e70c714b60
commit 72c67c9d35
12 changed files with 258 additions and 26 deletions

View File

@@ -125,19 +125,34 @@
<h4>Berechtigungen</h4>
<div class="card">
<div class="card-body">
<?php if(is_array($network->pops) && count($network->pops)): ?>
<?php if(is_array($network->addresstypes) && count($network->addresstypes)): ?>
<table class="table">
<tr>
<th>Name</th>
<th>GPS (Breite, Länge)</th>
<th>Standortinfo</th>
<?php foreach(['netowner','salespartner','pipeworker','lineworker','pipeplanner','lineplanner','netoperator',] as $role): ?>
<th><?=__($role)?></th>
<?php endforeach ?>
<th></th>
</tr>
<?php foreach($network->pops as $pop): ?>
<?php foreach($network->addresstypes as $address_id => $addresstypes): ?>
<tr>
<td><?=$pop->name?></td>
<td><?=$pop->gps_lat?>, <?=$pop->gps_long?></td>
<td><?=nl2br($pop->location)?></td>
<td><?=AddressModel::getOne($address_id)->getCompanyOrName()?></td>
<?php foreach(TT_NETWORK_ROLES as $role): ?>
<td>
<?php if(AddresstypeModel::getFirst(['address_id' => $address_id, 'addresstype' => [$role]]) !== null): ?>
<input
type="checkbox"
name="role_<?=$role?>[<?=$address_id?>]"
value="1"
<?php foreach($addresstypes as $type): ?>
<?php if($type->type == $role): ?>
checked='checked'
<?php continue; endif; ?>
<?php endforeach; ?>
/>
<?php endif; ?>
</td>
<?php endforeach; ?>
<td class="controls" style="text-align: left; letter-spacing: 4px; font-size: 1.1em;">
<a href="<?=self::getUrl("Pop", "edit", ["id" => $pop->id])?>"><i class="far fa-edit" title="Bearbeiten"></i></a>
<a href="<?=self::getUrl("Pop", "delete", ["id" => $pop->id])?>" class="text-danger" title="Löschen"><i class="fas fa-trash"></i></a>