-<h1>Liste d'instances</h1>
+<h1>
+ <?php echo $this->Html->link(
+ 'Nouvelle instance',
+ array('controller' => 'instances', 'action' => 'add')
+); ?>
+</h1>
<table>
<tr>
- <th>Nom</th>
- <th>Historique</th>
- <th>Version</th>
<th>Référence</th>
+ <th>Produit</th>
+ <th>Version</th>
+ <th>Alertes</th>
<th>Actions</th>
</tr>
<?php foreach ($instances as $instance): ?>
<tr>
+ <td><?php echo $instance['Instance']['reference']; ?></td>
+ <td><?php echo $instance['Instance']['nom']; ?></td>
+ <td><?php echo $instance['Instance']['version']; ?></td>
<td>
- <?php echo $this->Html->link(
- $instance['Instance']['nom'],
- array('controller' => 'instances', 'action' => 'edit', $instance['Instance']['id'])
- );
+ <?php if(array_key_exists($instance['Instance']['id'], $historiques)) {
+ $historique = $historiques[$instance['Instance']['id']];
?>
- </td>
- <td>
<table>
- <?php $historique = $historiques[$instance['Instance']['id']]; ?>
<tr>
- <th>Création</th>
<?php if(array_key_exists($historique['Historique']['id'], $totalAlertes)) { ?>
- <th>Alertes</th>
+ <th>Message</th>
<th>Actions</th>
<?php } ?>
</tr>
<tr>
- <td>
- <?php echo $historique['Historique']['installation'] ?>
- </td>
<?php if(array_key_exists($historique['Historique']['id'], $totalAlertes)) { ?>
<?php foreach ($totalAlertes[$historiques[$instance['Instance']['id']]['Historique']['id']] as $alerte): ?>
<td>
} ?>
</tr>
</table>
+ <?php } else { echo "TEST"; } ?>
</td>
- <td><?php echo $instance['Instance']['version']; ?></td>
- <td><?php echo $instance['Instance']['reference']; ?></td>
<td>
- <?php
- echo $this->Form->postLink(
+ <?php echo $this->Html->link(
+ 'Editer',
+ array('controller' => 'instances', 'action' => 'edit', $instance['Instance']['id'])
+ ).' - '.
+ $this->Form->postLink(
'Supprimer',
array('action' => 'delete', $instance['Instance']['id']),
array('confirm' => 'Etes-vous certain ?')
</tr>
<?php endforeach; ?>
<?php unset($instance); ?>
- <?php echo $this->Html->link(
- 'Ajouter une instance',
- array('controller' => 'instances', 'action' => 'add')
- ); ?>
</table>