array('controller' => 'instances', 'action' => 'add')
); ?>
</h1>
+<button onclick="checkInfosInstances();">Vérifier ces informations avec Sugar</button>
<table>
<tr>
- <th>Référence</th>
- <th>Produit</th>
+ <th>Référence fiche d'installation</th>
<th>Client</th>
- <th>Version</th>
- <th>Alertes</th>
+ <th>Produit</th>
+ <th>Version déclarée</th>
+ <th>Canal</th>
+ <?php if(isset($totalAlertes) && count($totalAlertes) > 0) { ?>
+ <th>Alertes</th>
+ <?php } ?>
<th>Actions</th>
</tr>
<?php foreach ($instances as $instance): ?>
<tr>
<td><?php echo $instance['Instance']['reference']; ?></td>
- <td><?php echo $instance['Instance']['nom']; ?></td>
<?php if(array_key_exists($instance['Instance']['id'], $clients)) {
$client = $clients[$instance['Instance']['id']]; ?>
- <td><?php echo $client; ?></td>
+ <td><?php echo $client['Client']['identifiant_AP']; ?></td>
<?php } else { ?>
<td>Client pour cette instance inexistant ou introuvable</td>
<?php } ?>
- <td><?php echo $instance['Instance']['version']; ?></td>
+ <td><?php echo $instance['Instance']['nom']; ?></td>
+
+ <td><?php
+ if(array_key_exists($instance['Instance']['id'], $last_updates)) {
+ $last_update = $last_updates[$instance['Instance']['id']];
+ echo $instance['Instance']['version']." le ".$last_update;
+ } else {
+ echo $instance['Instance']['version'];
+ }
+
+ ?>
+ </td>
+
+ <td><?php echo strtoupper($instance['Instance']['canal']); ?></td>
<?php if(array_key_exists($instance['Instance']['id'], $historiques)) {
$historique = $historiques[$instance['Instance']['id']];
+ if(isset($totalAlertes) && count($totalAlertes) > 0) {
?>
<td>
<table>
<th>Actions</th>
<?php } ?>
</tr>
- <tr>
<?php if(array_key_exists($historique['Historique']['id'], $totalAlertes)) { ?>
<?php foreach ($totalAlertes[$historiques[$instance['Instance']['id']]['Historique']['id']] as $alerte): ?>
- <td>
- <?php echo $alerte['Alerte']['message'] ?>
- </td>
- <td>
- <?php
- echo $this->Html->link(
- $this->Html->image('validate.png', array('class' => 'button')),
- array('controller' => 'historiques', 'action' => 'actionAlerte', $historique['Historique']['id'], $alerte['Alerte']['id']),
- array('escape' => false)
- )
- .' '.
- $this->Html->link(
- $this->Html->image('delete.png', array('class' => 'button')), '#',
- array('escape' => false,
- 'onclick' => 'actionMaintien('.$instance['Instance']['id'].', '.$historique['Historique']['id'].', '.$alerte['Alerte']['id'].')'
- )
- );
- ?>
- </td>
+
+ <tr>
+ <td>
+ <?php echo $alerte['Alerte']['message'] ?>
+ </td>
+ <td>
+ <?php
+ $reference = str_replace("/", "SLASH", $instance['Instance']['reference']);
+ echo $this->Html->link(
+ $this->Html->image('validate.png', array('class' => 'button')),
+ array('controller' => 'historiques', 'action' => 'actionAlerte', $historique['Historique']['id'], $alerte['Alerte']['id'], true, $reference),
+ array('escape' => false)
+ )
+ .' '.
+ $this->Html->link(
+ $this->Html->image('delete.png', array('class' => 'button')), '#',
+ array('escape' => false,
+ 'onclick' => 'actionMaintien('.$instance['Instance']['id'].', '.$historique['Historique']['id'].', '.$alerte['Alerte']['id'].')'
+ )
+ );
+ ?>
+ </td>
+ </tr>
<?php endforeach; ?>
<?php unset($alerte);
} ?>
- </tr>
</table>
</td>
+ <?php }?>
<td>
<?php echo $this->Html->link(
$this->Html->image('edit.jpg', array('class' => 'button')),
})();
var actionMaintien = function (instance_id, historique_id, alerte_id) {
- var garderMaintien = confirm("Conserver le maintien de l'instance ?");
+ var urlActionAlerte = "/historiques/actionAlerte/"+historique_id+"/"+alerte_id+"/false",
+ garderMaintien = confirm("Conserver le maintien de l'instance ?");
if(garderMaintien) {
alert('Maintien conservé');
- location.href = "/historiques/actionAlerte/"+historique_id+"/"+alerte_id;
+ location.href = urlActionAlerte;
} else {
alert('Maintien supprimé');
$.ajax({
if ( console && console.log ) {
//console.log( "Sample of data:", data.slice( 0, 100 ) );
}
- location.href = "/historiques/actionAlerte/"+historique_id+"/"+alerte_id;
+ location.href = urlActionAlerte;
});
}
};
}
}
};
+
+ var checkInfosInstances = function () {
+ $.ajax({
+ url: "http://allo_serveur/?action=check_synchro_info_version",
+ beforeSend: function( xhr ) {
+ xhr.overrideMimeType( "text/plain; charset=x-user-defined" );
+ }
+ })
+ .done(function( data ) {
+ if ( console && console.log ) {
+ //console.log( "Sample of data:", data.slice( 0, 100 ) );
+ }
+ location.href = "/instances";
+ });
+ };
</script>
\ No newline at end of file