Commit f6924d13 authored by JonathanMM's avatar JonathanMM

Déplacement du calcul de l'affichage pour savoir si une station est ouverte ou pas du côté front

parent f259bbc1
......@@ -781,7 +781,7 @@ function getDataConso($idConso, $longitude = null, $latitude = null)
'codeStr' => displayCodeStation($station['code']),
'name' => $station['name'],
'dateOuverture' => is_null($station['dateOuverture']) ? 'Non ouvert' : $station['dateOuverture'],
'state' => (($station['state'] == 'Operative' && $station['nbEDock'] != 0) ? 'Ouverte' : 'En travaux'),
'state' => $station['state'],
'nbBike' => $station['nbBike'],
'nbEbike' => $station['nbEBike'],
'nbFreeEDock' => $station['nbFreeEDock'],
......@@ -841,10 +841,10 @@ function getCommunesCarte($idConso)
//interprétation de l'état de la station 0=état non prévu
switch($station['state'])
{
case 'En travaux':
case 'Work in progress':
$etat = ETAT_TRAVAUX;
break;
case 'Ouverte':
case 'Operative':
$etat = ETAT_OUVERTE;
break;
default:
......
......@@ -118,7 +118,14 @@
return putZero(date.getDate()) + '/' + putZero(date.getMonth()+1) + '/' + date.getFullYear();
}
},{
data: 'state'
data: 'state',
render: function(data, type, row, meta)
{
if(data == 'Operative' && row.nbEDock > 0)
return 'Ouverte';
else
return 'En travaux';
}
},{
data: 'nbBike'
},{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment