28,6 → 28,7 |
$this->conteneur = $conteneur == null ? new Conteneur() : $conteneur; |
$this->conteneur->chargerConfiguration('config_departements.ini'); |
$this->conteneur->chargerConfiguration('config_observations.ini'); |
$this->conteneur->chargerConfiguration('config_votes.ini'); |
$this->navigation = $conteneur->getNavigation(); |
$this->masque = $conteneur->getMasque(); |
$this->gestionBdd = $conteneur->getGestionBdd(); |
70,6 → 71,7 |
private function configurer() { |
$this->mappingFiltre = $this->conteneur->getParametre('mapping_masque'); |
$this->mappingObservation = $this->conteneur->getParametre('mapping_observation'); |
$this->mappingVotes = $this->conteneur->getParametre('mapping_votes'); |
} |
|
/** |
313,7 → 315,7 |
|
$resultatsVotes = $this->bdd->recupererTous($requeteVotes); |
foreach ($resultatsVotes as $vote) { |
$propositions[$vote['ce_proposition']]['votes'][] = $vote; |
$propositions[$vote['ce_proposition']]['votes'][] = $this->formaterVotes($vote); |
} |
return $propositions; |
} |
385,6 → 387,18 |
return $urlImage; |
} |
|
/** |
* Formater un vote en fonction du fichier de configuration config_votes.ini |
* @param $votes array() |
* */ |
private function formaterVotes($vote) { |
$retour = array(); |
foreach ($vote as $param=>$valeur) { |
$retour[$vote['id_vote']][$this->mappingVotes[$param]] = $valeur; |
} |
return $retour; |
} |
|
private function proteger($valeur) { |
if (is_array($valeur)) { |
return $this->bdd->protegerTableau($valeur); |