Line 155... |
Line 155... |
155 |
$noms = ($this->type_nom == 'nom_vernaculaire')
|
155 |
$noms = ($this->type_nom == 'nom_vernaculaire')
|
156 |
? new NomsVernaculaires(Config::get(Registre::get('parametres.referentiel').'.referentielVerna'))
|
156 |
? new NomsVernaculaires(Config::get(Registre::get('parametres.referentiel').'.referentielVerna'))
|
157 |
: new Noms(Registre::get('parametres.referentiel'));
|
157 |
: new Noms(Registre::get('parametres.referentiel'));
|
158 |
$approche = '';
|
158 |
$approche = '';
|
159 |
$res = $noms->getRechercheEtendue($this->nom, $this->type_resultat);
|
159 |
$res = $noms->getRechercheEtendue($this->nom, $this->type_resultat);
|
160 |
echo "RES: <pre>".print_r($res,true)."</pre>";
|
- |
|
161 |
$form = I18n::get('Recherche-form-nom');
|
160 |
$form = I18n::get('Recherche-form-nom');
|
162 |
if ($res == false || $res['entete']['total'] === 0) { // recherche nom approché
|
161 |
if ($res == false || $res['entete']['total'] === 0) { // recherche nom approché
|
163 |
$approche = $this->rechercherNomApproche($noms);
|
162 |
$approche = $this->rechercherNomApproche($noms);
|
164 |
} elseif ($res['entete']['total'] == 1 || $this->acces_fiche) { // renvoie à la fiche
|
163 |
} elseif ($res['entete']['total'] == 1 || $this->acces_fiche) { // renvoie à la fiche
|
165 |
$approche = $this->traiterAccesFiche($res);
|
164 |
$approche = $this->traiterAccesFiche($res);
|
Line 194... |
Line 193... |
194 |
}
|
193 |
}
|
Line 195... |
Line 194... |
195 |
|
194 |
|
196 |
private function rechercherNomApproche($noms) {
|
195 |
private function rechercherNomApproche($noms) {
|
197 |
$approche = '';
|
196 |
$approche = '';
|
198 |
$res = $noms->getRechercheFloue($this->nom);
|
197 |
$res = $noms->getRechercheFloue($this->nom);
|
199 |
if (!($res == false || $res['entete']['total'] == 0)) {
|
198 |
if (!($res == false || $res['entete']['total'] === 0)) {
|
200 |
for ($i = 0; $i < 3; $i++) {
|
199 |
for ($i = 0; $i < 3; $i++) {
|
201 |
$nom_proche = array_shift($res['resultat']);
|
200 |
$nom_proche = array_shift($res['resultat']);
|
202 |
$approche[$i]['nom'] = ($this->type_nom == 'nom_vernaculaire') ? $nom_proche['nom'] : $nom_proche['nom_sci'];
|
201 |
$approche[$i]['nom'] = ($this->type_nom == 'nom_vernaculaire') ? $nom_proche['nom'] : $nom_proche['nom_sci'];
|
203 |
$approche[$i]['url_nom_approche'] = $this->urls->obtenirUrlRechercheSimple($approche[$i]['nom'], $this->type_nom);
|
202 |
$approche[$i]['url_nom_approche'] = $this->urls->obtenirUrlRechercheSimple($approche[$i]['nom'], $this->type_nom);
|