Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 127 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 127 Rev 156
Line 51... Line 51...
51
		$form = I18n::get('Recherche-form-nom');
51
		$form = I18n::get('Recherche-form-nom');
52
		if ($res == false || $res['entete']['total'] == 0) { // recherche nom approché
52
		if ($res == false || $res['entete']['total'] == 0) { // recherche nom approché
53
			$approche = $this->rechercherNomApproche($noms);
53
			$approche = $this->rechercherNomApproche($noms);
54
		} elseif ($res['entete']['total'] == 1 || $this->submit == $form['fiche']) { // renvoie à la fiche
54
		} elseif ($res['entete']['total'] == 1 || $this->submit == $form['fiche']) { // renvoie à la fiche
55
			$ids = array_keys($res['resultat']);
55
			$ids = array_keys($res['resultat']);
56
			$url = $this->obtenirUrlFiche($ids[0]);
56
			$url = $this->urls->obtenirUrlFiche($ids[0]);
57
			$this->redirigerVers($url);
57
			$this->redirigerVers($url);
58
		} else { // affiche les résultats
58
		} else { // affiche les résultats
59
			$res['type'] = $this->type_nom;
59
			$res['type'] = $this->type_nom;
60
			Registre::set('resultats', $res);
60
			Registre::set('resultats', $res);
61
			$approche = 'ok';
61
			$approche = 'ok';
Line 71... Line 71...
71
		$res = $noms->getRechercheFloue($this->nom);
71
		$res = $noms->getRechercheFloue($this->nom);
72
		if (!($res == false || $res['entete']['total'] == 0)) {
72
		if (!($res == false || $res['entete']['total'] == 0)) {
73
			for ($i = 0; $i < 3; $i++) {
73
			for ($i = 0; $i < 3; $i++) {
74
				$nom_proche = array_shift($res['resultat']);
74
				$nom_proche = array_shift($res['resultat']);
75
				$approche[$i]['nom'] = ($this->type_nom == 'nom_vernaculaire') ? $nom_proche['nom'] : $nom_proche['nom_sci'];
75
				$approche[$i]['nom'] = ($this->type_nom == 'nom_vernaculaire') ? $nom_proche['nom'] : $nom_proche['nom_sci'];
76
				$approche[$i]['url_nom_approche'] = $this->obtenirUrlRechercheSimple($approche[$i]['nom'], $this->type_nom);
76
				$approche[$i]['url_nom_approche'] = $this->urls->obtenirUrlRechercheSimple($approche[$i]['nom'], $this->type_nom);
77
			}
77
			}
78
		}
78
		}
79
		return $approche;
79
		return $approche;
80
	}
80
	}