Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

Rev 1165 Rev 1210
Line 78... Line 78...
78
			$this->parametres->masqueRecherche .= trim($_GET['au']);
78
			$this->parametres->masqueRecherche .= trim($_GET['au']);
79
		}
79
		}
80
		if (isset($_GET['bib'])) {
80
		if (isset($_GET['bib'])) {
81
			$this->parametres->masqueRecherche .= trim($_GET['bib']);
81
			$this->parametres->masqueRecherche .= trim($_GET['bib']);
82
		}
82
		}
83
		
83
 
-
 
84
		// Si spécifié, seuls les résultats du niveau spécifié sont affichés.
-
 
85
		// Passer "*" pour annuler le filtre par rang (le paramètre est mis à "null").
-
 
86
		// Par défaut, seules les espèces sont affichées (paramètre par défaut).
-
 
87
		if (isset($_GET['rang'])) {
-
 
88
			$this->parametres->rang = ($_GET['rang'] == '*' ? null : $_GET['rang']);
-
 
89
		}
84
		
90
 
85
		if (isset($_GET['type_nom'])) {
91
		if (isset($_GET['type_nom'])) {
86
			$this->parametres->typeNom = $_GET['type_nom'];
92
			$this->parametres->typeNom = $_GET['type_nom'];
87
		}
93
		}
Line 88... Line 94...
88
		
94
		
Line 93... Line 99...
93
	
99
	
94
	private function capturerParametresAvances() {
100
	private function capturerParametresAvances() {
95
		$this->capturerParametresAvancesGeneriques();
101
		$this->capturerParametresAvancesGeneriques();
96
		$this->capturerParametresAvancesDependantsLangage();
102
		$this->capturerParametresAvancesDependantsLangage();
-
 
103
		$this->capturerParametresAvancesPresenceSpecifiques();
97
		$this->capturerParametresAvancesPresenceSpecifiques();
104
		$this->capturerParametresAvancesRang();
98
	}
105
	}
-
 
106
 
-
 
107
	private function capturerParametresAvancesRang() {
-
 
108
		// rang à afficher
-
 
109
		$this->param['rang'] = $this->parametres->rang;
-
 
110
		if ($this->param['rang'] === null) {
-
 
111
			$this->param['rang'] = '*';
-
 
112
		}
-
 
113
	}
99
	
114
 
100
	private function capturerParametresAvancesGeneriques() {
115
	private function capturerParametresAvancesGeneriques() {
101
		foreach($this->parametresAvancesGeneriques as $param) {
116
		foreach($this->parametresAvancesGeneriques as $param) {
102
			if (isset($_GET[$param]) && $_GET[$param] != '') {
117
			if (isset($_GET[$param]) && $_GET[$param] != '') {
103
				$this->param[$param] = urldecode($_GET[$param]);
118
				$this->param[$param] = urldecode($_GET[$param]);
Line 158... Line 173...
158
		$this->chargerOnglets();
173
		$this->chargerOnglets();
159
		$this->chargerNbreDeTaxons();
174
		$this->chargerNbreDeTaxons();
160
		$this->chargerNomsFormates();
175
		$this->chargerNomsFormates();
161
		$this->setSortie(self::RENDU_CORPS, $this->getVue('resultat', $this->donneesTpl));
176
		$this->setSortie(self::RENDU_CORPS, $this->getVue('resultat', $this->donneesTpl));
162
	}
177
	}
163
	
-
 
Line 164... Line 178...
164
 
178
 
165
	private function chargerOnglets() {
179
	private function chargerOnglets() {
166
		$donnees = array();
180
		$donnees = array();
167
		$donnees['typeResultat'] = $this->parametres->typeResultat;
181
		$donnees['typeResultat'] = $this->parametres->typeResultat;
Line 172... Line 186...
172
			$donnees['urls']['alphab'] = $this->urls->obtenirUrlResultatAvanceOnglets('alphab', $this->param);
186
			$donnees['urls']['alphab'] = $this->urls->obtenirUrlResultatAvanceOnglets('alphab', $this->param);
173
			$donnees['urls']['retenu'] = $this->urls->obtenirUrlResultatAvanceOnglets('retenu', $this->param);
187
			$donnees['urls']['retenu'] = $this->urls->obtenirUrlResultatAvanceOnglets('retenu', $this->param);
174
			$donnees['urls']['determination'] = $this->urls->obtenirUrlResultatAvanceOnglets('determination',$this->param);
188
			$donnees['urls']['determination'] = $this->urls->obtenirUrlResultatAvanceOnglets('determination',$this->param);
175
			$donnees['urls']['decompo'] = $this->urls->obtenirUrlResultatAvanceOnglets('decompo',$this->param);
189
			$donnees['urls']['decompo'] = $this->urls->obtenirUrlResultatAvanceOnglets('decompo',$this->param);
176
		} else {
190
		} else {
177
			
-
 
178
			$donnees['urls']['alphab'] = $this->urls->obtenirUrlResultatAlphab();
191
			$donnees['urls']['alphab'] = $this->urls->obtenirUrlResultat('alphab', $this->param);
179
			$donnees['urls']['retenu'] = $this->urls->obtenirUrlResultatRetenu();
192
			$donnees['urls']['retenu'] = $this->urls->obtenirUrlResultat('retenu', $this->param);
180
			$donnees['urls']['determination'] = $this->urls->obtenirUrlResultatDetermination();
193
			$donnees['urls']['determination'] = $this->urls->obtenirUrlResultat('determination', $this->param);
181
			$donnees['urls']['decompo'] = $this->urls->obtenirUrlResultatDecompo();
194
			$donnees['urls']['decompo'] = $this->urls->obtenirUrlResultat('decompo', $this->param);
-
 
195
		}
-
 
196
		// Inversion du critère de filtrage de rang : espèces seulement VS tout (pas d'autre choix pour l'instant)
-
 
197
		//echo "PARAMS: <pre>" . print_r($this->param, true) . "</pre><br/>";
-
 
198
		$paramsAvecRangInverse = $this->param;
-
 
199
		if (array_key_exists('rang', $paramsAvecRangInverse)) {
-
 
200
			if ($paramsAvecRangInverse['rang'] == '*') {
-
 
201
				unset ($paramsAvecRangInverse['rang']);
-
 
202
			} else {
-
 
203
				$paramsAvecRangInverse['rang'] = '*';
-
 
204
			}
182
		}
205
		}
-
 
206
		//echo "PARAMS INV: <pre>" . print_r($paramsAvecRangInverse, true) . "</pre><br/>";
-
 
207
		$this->donneesTpl['urlInverse'] = $this->urls->obtenirUrlResultat($donnees['typeResultat'], $paramsAvecRangInverse);
-
 
208
		//echo "URL INV: " . $this->donneesTpl['urlInverse'] . "<br/>";
-
 
209
 
183
		$donnees['i18n']['nv'] = I18n::get('Resultat-onglets-nv');
210
		$donnees['i18n']['nv'] = I18n::get('Resultat-onglets-nv');
184
		$donnees['i18n']['ns'] = I18n::get('Resultat-onglets-ns');
211
		$donnees['i18n']['ns'] = I18n::get('Resultat-onglets-ns');
185
		$this->donneesTpl['ongletsHtml'] = $this->getVue('onglets', $donnees);
212
		$this->donneesTpl['ongletsHtml'] = $this->getVue('onglets', $donnees);
186
	}
213
	}
Line 187... Line 214...
187
 
214
 
188
	private function chargerNbreDeTaxons() {
215
	private function chargerNbreDeTaxons() {
189
		$this->donneesTpl['nbreTaxons'] = $this->resultats['entete']['total'];
216
		$this->donneesTpl['nbreTaxons'] = $this->resultats['entete']['total'];
Line -... Line 217...
-
 
217
	}
-
 
218
 
-
 
219
	// Filtre selon le rang à afficher (espèce, genre... tout)
-
 
220
	// et renvoie le nombre de taxons réellement affichés
-
 
221
	private function filtrer() {
-
 
222
		$nbTaxAff = 0;
-
 
223
		if ($this->parametres->rang != null) {
-
 
224
			foreach ($this->resultats['resultat'] as $c => $v) {
-
 
225
				$numRang = substr($v['rang.code'], strrpos($v['rang.code'], ':') +1);
-
 
226
				if ($numRang != $this->parametres->rang) {
-
 
227
					unset($this->resultats['resultat'][$c]);
-
 
228
				} else {
-
 
229
					$nbTaxAff++;
-
 
230
				}
-
 
231
			}
-
 
232
		} else {
-
 
233
			$nbTaxAff = $this->resultats['entete']['total'];
-
 
234
		}
-
 
235
		return $nbTaxAff;
190
	}
236
	}
191
 
237
 
-
 
238
	private function chargerNomsFormates() {
-
 
239
		if (Config::get('benchmark_chrono')) Chronometre::chrono("Avt mise en forme des noms");
-
 
240
 
-
 
241
		// Filtre selon $this->parametres['rang'] pour afficher seulement un rang, ou bien tous
-
 
242
		// Valable uniquement pour la recherche par nom scientifique
-
 
243
		//echo "<pre>".print_r($this->parametres, true)."</pre>";
-
 
244
		if ($this->parametres->typeNom == 'nom_scientifique') {
-
 
245
			$this->donneesTpl['nombreTaxonsAffiches'] = $this->filtrer();
-
 
246
			$this->donneesTpl['rang'] = $this->parametres->rang;
-
 
247
		} else {
-
 
248
			$this->donneesTpl['nombreTaxonsAffiches'] = $this->donneesTpl['nbreTaxons'];
-
 
249
		}
192
	private function chargerNomsFormates() {
250
		$this->donneesTpl['typeNom'] = $this->parametres->typeNom;
193
		if (Config::get('benchmark_chrono')) Chronometre::chrono("Avt mise en forme des noms");
251
 
194
		$formateur = ResultatFormateurFabrique::creer($this->parametres, $this->resultats);
252
		$formateur = ResultatFormateurFabrique::creer($this->parametres, $this->resultats);
195
		if (Config::get('benchmark_chrono')) Chronometre::chrono("Avt formatage des noms");
253
		if (Config::get('benchmark_chrono')) Chronometre::chrono("Avt formatage des noms");
196
		$formateur->formater();
254
		$formateur->formater();