Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

Rev 43 Rev 53
Line 4... Line 4...
4
	//+----------------------------------------------------------------------------------------------------------------+
4
	//+----------------------------------------------------------------------------------------------------------------+
5
	// Méthodes
5
	// Méthodes
6
	/**
6
	/**
7
	 * Fonction d'affichage par défaut
7
	 * Fonction d'affichage par défaut
8
	 */
8
	 */
-
 
9
	
-
 
10
	
9
	public function executerActionParDefaut() {
11
	public function executerActionParDefaut() {
-
 
12
		if (isset($_GET['referentiel'])) {
-
 
13
			Registre::set('parametres.referentiel', $_GET['referentiel']);
-
 
14
		}
10
		$this->executerAccueil();
15
		$this->executerAccueil();
11
	}
16
	}
Line 12... Line 17...
12
	
17
	
13
	public function executerAccueil() {
18
	public function executerAccueil() {
Line 31... Line 36...
31
	
36
	
32
	public function executerRechercheNom() {
37
	public function executerRechercheNom() {
33
		if ($_GET['eflore_nom'] == '') {
38
		if ($_GET['eflore_nom'] == '') {
34
			$donnees['information'] = 'Veuillez saisir un radical contenant au moins 3 caractères alphabétiques !';
39
			$donnees['information'] = 'Veuillez saisir un radical contenant au moins 3 caractères alphabétiques !';
-
 
40
		} elseif ($_GET['eflore_type_nom'] == 'nom_vernaculaire') {
35
		} elseif ($_GET['eflore_type_nom'] == 'nom_vernaculaire') {
41
			$noms = new NomsVernaculaires(Config::get('referentielVerna'));
36
			$donnees['nom_approche'] = $_GET['eflore_nom'];//$this->getNomVerna();
42
			$donnees['nom_approche'] = $this->rechercherNom($noms);
-
 
43
		} else {
37
		} else {
44
			$noms = new Noms(Registre::get('parametres.referentiel'));
38
			$donnees['nom_approche'] = $_GET['eflore_nom'];
45
			$donnees['nom_approche'] = $this->rechercherNom($noms);
39
		}
46
		}
40
		if (isset($donnees)) {
47
		if (isset($donnees)) {
41
			$donnees['eflore_type_nom'] = $_GET['eflore_type_nom'];
48
			$donnees['eflore_type_nom'] = $_GET['eflore_type_nom'];
42
			$donnees['i18n'] = I18n::get('Recherche-accueil');
49
			$donnees['i18n'] = I18n::get('Recherche-accueil');
Line 49... Line 56...
49
			$this->setSortie(self::RENDU_CORPS, $this->getVue('recherche_accueil', $donnees));
56
			$this->setSortie(self::RENDU_CORPS, $this->getVue('recherche_accueil', $donnees));
50
		} else {
57
		} else {
51
			// envoyerResultat;
58
			// envoyerResultat;
52
		}
59
		}
53
	}
60
	}
-
 
61
	
-
 
62
	public function rechercherNom($noms) {
-
 
63
		$noms_approches = '';
-
 
64
		$res = $noms->getRechercheEtendue($_GET['eflore_nom']); //print_r($res);
-
 
65
		if ($res == false || $res->entete->total == 0) {
-
 
66
			$res = $noms->getRechercheFloue($_GET['eflore_nom']);
-
 
67
			if (!($res == false || $res->entete->total == 0)) {
-
 
68
				$res = (array) $res->resultat;
-
 
69
				$noms_appr = array_shift($res); //print_r($noms_appr);
-
 
70
				/*foreach ($res->resultat as $id=>$nom) {
-
 
71
					$noms_approches[$id]['nom'] = ($_GET['eflore_type_nom'] == 'nom_vernaculaire') ? $nom->nom : $nom->nom_sci;
-
 
72
					$noms_approches[$id]['url'] = $nom->href;
-
 
73
				}*/
-
 
74
			}
-
 
75
		}
-
 
76
		return $noms_approches;
-
 
77
	}
54
}
78
}
55
?>
79
?>
56
80