Service view

This commit is contained in:
Michael RICOIS 2016-05-26 17:02:19 +02:00
parent b9ef026268
commit 6cd0c20981
2 changed files with 129 additions and 0 deletions

View File

@ -0,0 +1,83 @@
<div id="content">
<div class="page-header">
<h1>Service : <?=$this->Info->Label?></h1>
</div>
<table class="table table-hover">
<tbody>
<tr>
<th scope="row">Nom</th>
<td><?=$this->Info->Label?></td>
</tr>
<tr>
<th scope="row">Type de score</th>
<td><?=$this->Info->TypeScore?></td>
</tr>
<tr>
<th scope="row">Type d'acces</th>
<td><?=$this->Info->TypeAcces?></td>
</tr>
<tr>
<th scope="row">Modifiable</th>
<td>
<?php if ($this->Info->Editable == 1) {?>Oui<?php } else {?>Non<?php }?>
</td>
</tr>
<tr>
<th scope="row">Actif</th>
<td><?php if ($this->Info->Active == 1) {?>Oui<?php } else {?>Non<?php }?></td>
</tr>
<tr>
<th scope="row">Crée le</th>
<td><small><?=$this->Info->DateInsert?></small></td>
</tr>
<tr>
<th scope="row">Mise à jour le</th>
<td><small><?=$this->Info->DateUpdate?></small></td>
</tr>
</tbody>
</table>
<h2>Droits d'accès</h2>
<?php if (count($this->Info->Acces->item) > 0) {?>
<?php foreach ($this->Categories as $c => $item) {?>
<div class="panel panel-info">
<div class="panel-heading"><?=$item->Label?></div>
<ul class="list-group">
<?php foreach ($item->Acces->item as $a) {?>
<?php foreach ($this->Info->Acces->item as $Access) {
$add = 1;
if ($Access->Code == $a) {
$add = 0;
break;
}
} ?>
<li class="list-group-item<?php if ($add == 0) { echo " list-group-item-success"; }?>">
<?php if (array_key_exists($a, $this->Access)) {?>
<?=$this->Access[$a]?>
<?php } else {?>
<?=$a?>
<?php }?>
<?php if ($add == 1) {?><span class="label label-warning pull-right">Inactif</span><?php }?>
</li>
<?php }?>
</ul>
</div>
<?php }?>
<?php } else {?>
<p class="bg-classes bg-danger">Aucun paramètre d'accès défini, vérifier les paramètres aux utilisateurs.</p>
<?php }?>
<h2>Restriction IPs</h2>
<?php if (count($this->Info->IP->item) > 0) {?>
<ul class="list-unstyled">
<?php foreach ($this->Info->IP->item as $ip) {?>
<li><?=$ip?></li>
<?php }?>
</ul>
<?php } else {?>
<p class="bg-classes bg-warning">Aucune restriction.</p>
<?php }?>
</div>

View File

@ -0,0 +1,46 @@
<div id="content">
<div class="page-header">
<h1>Liste des services</h1>
</div>
<?php if (count($this->List) > 0) {?>
<table class="table table-hover">
<thead>
<tr>
<th>Nom</th>
<th>Type d'accès</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php foreach ($this->List as $l) {?>
<?php
$class = 'active';
if ($l->Editable == 0) { $class = ''; } ?>
<tr class="<?=$class?>">
<td><?=$l->Label?></td>
<td><?=$l->TypeAcces?></td>
<td>
<div class="btn-group">
<button type="button" class="btn btn-xs btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true"
aria-expanded="false">Action <span class="caret"></span>
</button>
<ul class="dropdown-menu dropdown-menu-right">
<li><a href="<?=$this->url(array('module'=>'admin', 'controller'=>'service', 'action'=>'detail', 'id'=>$l->id),
'default', true)?>">Paramètres</a></li>
<li><a href="<?=$this->url(array('module'=>'admin', 'controller'=>'user', 'action'=>'index', 'code'=>$l->Code),
'default', true)?>">Utilisateurs</a></li>
</ul>
</div>
</td>
</tr>
<?php }?>
</tbody>
</table>
<?php } else {?>
<p class="bg-warning">Aucun service ! Veuillez contacter le support.</p>
<?php }?>
</div>