Erreur de calcul du total des évènements nationaux

This commit is contained in:
Vincent Calame 2021-12-08 18:40:29 +01:00 committed by root
parent 9a4a10ec95
commit 272404dac4
2 changed files with 6 additions and 2 deletions

View File

@ -51,12 +51,16 @@ class LefPays {
public function toArray() {
$evenementsnationaux;
$totalevenementsnationaux = 0;
if ($this->lieuxnationaux) {
$evenementsnationaux = $this->lieuxnationaux->toArray();
foreach($evenementsnationaux as $key => $array) {
$totalevenementsnationaux = $totalevenementsnationaux + count($array);
}
} else {
$evenementsnationaux = array();
}
return array("name" => $this->name, "code" => $this->code, "sousregions" => $this->regions, "evenementsnationaux" => $evenementsnationaux);
return array("name" => $this->name, "code" => $this->code, "sousregions" => $this->regions, "evenementsnationaux" => $evenementsnationaux, "totalevenementsnationaux" => $totalevenementsnationaux);
}
}

View File

@ -2,7 +2,7 @@
<BOUCLE_repartition(DATA){source tableau, #GET{repartition/pays}}>
<h3 class="spip">#VALEUR{name}</h3>
<B_evenementsnationaux>
<details class="evenement-Details"><summary class="evenement-Summary">[(#VALEUR{code}|=={internet}|?{'En ligne', 'À léchelle nationale'})] <span class="evenement-Total">([(#VALEUR|count)])</span></summary>
<details class="evenement-Details"><summary class="evenement-Summary">[(#VALEUR{code}|=={internet}|?{'En ligne', 'À léchelle nationale'})] <span class="evenement-Total">([(#VALEUR{totalevenementsnationaux})])</span></summary>
<BOUCLE_evenementsnationaux(DATA) {source tableau, #VALEUR{evenementsnationaux}}>
[<h5 class="spip">(#CLE)</h5>]