Subversion Repositories eFlore/Projets.eflore-projets

Compare Revisions

Ignore whitespace Rev 607 → Rev 608

/trunk/services/modules/0.1/nvjfl/NomsVernaculaires.php
273,24 → 273,23
}
return $reponse;
}
 
public function formaterNomsVernaculaires($resultat) {
//on remplit la table $table_retour_json['entete']
$table_retour_json['entete']['masque'] = $this->recupererMasque();
$table_retour_json['entete']['depart'] = $this->limite_requete['depart'];
$table_retour_json['entete']['limite'] = $this->limite_requete['limite'];
$table_retour_json['entete']['total'] = $this->total_resultat;
public function ajouterJsonEnTeteNV() {
$table_retour_json['masque'] = $this->recupererMasque();
$table_retour_json['depart'] = $this->limite_requete['depart'];
$table_retour_json['limite'] = $this->limite_requete['limite'];
$table_retour_json['total'] = $this->total_resultat;
$url = $this->formulerUrl($this->total_resultat, '/noms-vernaculaires');
if (isset($url['precedent']) && $url['precedent'] != '') { $table_retour_json['entete']['href.precedent'] = $url['precedent']; }
if (isset($url['suivant']) && $url['suivant'] != '') { $table_retour_json['entete']['href.suivant'] = $url['suivant']; }
//on remplit la table $table_retour_json['resultat']
if (isset($this->parametres['masque.nv'])) {
$resultat = $this->trierRechercheFloue($this->parametres['masque.nv'], $resultat, 'nom_vernaculaire');
if (isset($url['precedent']) && $url['precedent'] != '') {
$table_retour_json['href.precedent'] = $url['precedent'];
}
if (isset($this->parametres['masque'])) {
$resultat = $this->trierRechercheFloue($this->parametres['masque'], $resultat, 'nom_vernaculaire');
if (isset($url['suivant']) && $url['suivant'] != '') {
$table_retour_json['href.suivant'] = $url['suivant'];
}
return $table_retour_json;
}
public function ajouterJsonResultatNV($resultat) {
foreach ($resultat as $tab) {
foreach ($tab as $key => $valeur) {
if ($valeur != '') {
301,15 → 300,32
}
}
}
if ($this->retour_format == 'max') $this->table_retour['href'] = $this->ajouterHref('noms-vernaculaires', $num);
if ($this->retour_format == 'max') $this->table_retour['href'] = $this->ajouterHref('noms-vernaculaires', $num);
$resultat_json[$num] = $this->table_retour;
$this->table_retour = array();
}
return $resultat_json;
}
 
$table_retour_json['resultat'] = $resultat_json;
public function formaterNomsVernaculaires($resultat) {
$table_retour_json['entete'] = $this->ajouterJsonEnTeteNV();
$resultat = $this->hierarchiserResultat($resultat);
$table_retour_json['resultat'] = $this->ajouterJsonResultatNV($resultat);
return $table_retour_json;
}
public function hierarchiserResultat($resultat) {
//tri recherche floue
if (isset($this->parametres['masque.nv'])) {
$resultat = $this->trierRechercheFloue($this->parametres['masque.nv'], $resultat, 'nom_vernaculaire');
}
if (isset($this->parametres['masque'])) {
$resultat = $this->trierRechercheFloue($this->parametres['masque'], $resultat, 'nom_vernaculaire');
}
return $resultat;
}
public function recupererMasque() {
$tab_masque = array();
foreach ($this->parametres as $param=>$valeur) {