Subversion Repositories Applications.referentiel

Rev

Rev 174 | Rev 176 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 174 Rev 175
1
<?php
1
<?php
2
// Encodage : UTF-8
2
// Encodage : UTF-8
3
// +-------------------------------------------------------------------------------------------------------------------+
3
// +-------------------------------------------------------------------------------------------------------------------+
4
/**
4
/**
5
* Tests de référentiels de nomenclature et taxonomie
5
* Tests de référentiels de nomenclature et taxonomie
6
*
6
*
7
* Description : classe permettant de tester les référentiels selon le manuel technique
7
* Description : classe permettant de tester les référentiels selon le manuel technique
8
* Utilisation : php script.php tests -p bdnff -a tout
8
* Utilisation : php script.php tests -p bdnff -a tout
9
*
9
*
10
//Auteur original :
10
//Auteur original :
11
* @author       Jean-Pascal MILCENT <jpm@tela-botanica.org>
11
* @author       Jean-Pascal MILCENT <jpm@tela-botanica.org>
12
* @copyright	Tela-Botanica 1999-2010
12
* @copyright	Tela-Botanica 1999-2010
13
* @link			http://www.tela-botanica.org/wikini/RTaxMethodo/wakka.php?wiki=MaNuel
13
* @link			http://www.tela-botanica.org/wikini/RTaxMethodo/wakka.php?wiki=MaNuel
14
* @licence		GPL v3 & CeCILL v2
14
* @licence		GPL v3 & CeCILL v2
15
* @version		$Id$
15
* @version		$Id$
16
*/
16
*/
17
// +-------------------------------------------------------------------------------------------------------------------+
17
// +-------------------------------------------------------------------------------------------------------------------+
18
// TODO : supprimer l'utilisation du paramêtres 'p' et chercher les infos depuis la bdd
18
// TODO : supprimer l'utilisation du paramêtres 'p' et chercher les infos depuis la bdd
19
class Tests extends ScriptCommande {
19
class Tests extends ScriptCommande {
20
	
20
	
21
	const SCRIPT_NOM = 'tests';
21
	const SCRIPT_NOM = 'tests';
22
	
22
	
23
	private $projet = null;
23
	private $projet = null;
24
	private $traitement = null;
24
	private $traitement = null;
25
	
25
	
26
	private $manuel = null;
26
	private $manuel = null;
27
	private $tests = null;
27
	private $tests = null;
28
	private $colonnes = null;
28
	private $colonnes = null;
29
	private $analyses = null;
29
	private $analyses = null;
30
	private $noms = null;
30
	private $noms = null;
31
	
31
	
32
	private $resultatDao = null;
32
	private $resultatDao = null;
33
	private $traitementDao = null;
33
	private $traitementDao = null;
34
	private $tableStructureDao = null;
34
	private $tableStructureDao = null;
35
	private $referentielDao = null;
35
	private $referentielDao = null;
36
	
36
	
37
	public function executer() {
37
	public function executer() {
38
		$this->manuel = parse_ini_file(Config::get('chemin_appli').DS.'..'.DS.'configurations'.DS.'referentiel_v4.1.ini');
38
		$this->manuel = parse_ini_file(Config::get('chemin_appli').DS.'..'.DS.'configurations'.DS.'referentiel_v4.1.ini');
39
		$this->tests = parse_ini_file($this->getModuleChemin().DS.'configurations'.DS.'tests.ini', true);
39
		$this->tests = parse_ini_file($this->getModuleChemin().DS.'configurations'.DS.'tests.ini', true);
40
		
40
		
41
		$this->resultatDao = new ResultatDao();
41
		$this->resultatDao = new ResultatDao();
42
		$this->traitementDao = new TraitementDao();
42
		$this->traitementDao = new TraitementDao();
43
		Debug::printr('Dans le script test');
43
		Debug::printr('Dans le script test');
44
		// Récupération du dernier traitement demandé
44
		// Récupération du dernier traitement demandé
45
		$this->traitement = $this->traitementDao->getDernierTraitement('tout', self::SCRIPT_NOM);
45
		$this->traitement = $this->traitementDao->getDernierTraitement('tout', self::SCRIPT_NOM);
46
		if (isset($this->traitement)) {
46
		if (isset($this->traitement)) {
47
			$this->projet = $this->traitement['referentiel_code']; // Récupération du nom de projet
47
			$this->projet = $this->traitement['referentiel_code']; // Récupération du nom de projet
48
			Debug::printr($this->traitement);
48
			Debug::printr($this->traitement);
49
			// Écriture de la date de début du traitement
49
			// Écriture de la date de début du traitement
50
			Debug::printr('Debute:'.$this->traitementDao->debuterTraitement($this->traitement['id_traitement']));
50
			Debug::printr('Debute:'.$this->traitementDao->debuterTraitement($this->traitement['id_traitement']));
51
			
51
			
52
			// Nettoyage des traitements obsolètes
52
			// Nettoyage des traitements obsolètes
53
			$traitements_obsoletes = $this->traitementDao->getTraitementsObsoletes($this->projet, self::SCRIPT_NOM);
53
			$traitements_obsoletes = $this->traitementDao->getTraitementsObsoletes($this->projet, self::SCRIPT_NOM);
54
			if (isset($traitements_obsoletes)) {
54
			if (isset($traitements_obsoletes)) {
55
				Debug::printr('Supp. obsoletes:'.$this->traitementDao->supprimer($traitements_obsoletes));
55
				Debug::printr('Supp. obsoletes:'.$this->traitementDao->supprimer($traitements_obsoletes));
56
			}
56
			}
57
			
57
			
58
			$this->tableStructureDao = new TableStructureDao();
58
			$this->tableStructureDao = new TableStructureDao();
59
			$this->referentielDao = new ReferentielDao();
59
			$this->referentielDao = new ReferentielDao();
60
			
60
			
61
			// Lancement du test demandé
61
			// Lancement du test demandé
62
			$cmd = $this->getParam('a');
62
			$cmd = $this->getParam('a');
63
	    	switch ($cmd) {
63
	    	switch ($cmd) {
64
				case 'tout' :
64
				case 'tout' :
65
					Debug::printr('Départ lancement test:');
65
					Debug::printr('Départ lancement test:');
66
					$this->recupererDonnees();
66
					$this->recupererDonnees();
67
					$this->lancerTests();
67
					$this->lancerTests();
68
					break;
68
					break;
69
				case 'test11' :
69
				case 'test11' :
70
					$this->recupererDonnees();
70
					$this->recupererDonnees();
71
					Debug::printr('Départ lancement test 11 :');
71
					Debug::printr('Départ lancement test 11 :');
72
					$this->testerClassificationRang();
72
					$this->testerClassificationRang();
73
					break;
73
					break;
74
				default :
74
				default :
75
					$this->traiterErreur('Erreur : la commande "%s" n\'existe pas!', array($cmd));
75
					$this->traiterErreur('Erreur : la commande "%s" n\'existe pas!', array($cmd));
76
			}
76
			}
77
			// Écriture de la date de fin du traitement
77
			// Écriture de la date de fin du traitement
78
			Debug::printr('Termine:'.$this->traitementDao->terminerTraitement($this->traitement['id_traitement']));
78
			Debug::printr('Termine:'.$this->traitementDao->terminerTraitement($this->traitement['id_traitement']));
79
		} else {
79
		} else {
80
			Debug::printr("Aucun dernier traitement trouvé pour le script '".self::SCRIPT_NOM."' !");
80
			Debug::printr("Aucun dernier traitement trouvé pour le script '".self::SCRIPT_NOM."' !");
81
		}
81
		}
82
    }
82
    }
83
    
83
    
84
    public function recupererDonnees() {
84
    public function recupererDonnees() {
85
		// Récupération des données à tester
85
		// Récupération des données à tester
86
		$this->colonnes = $this->tableStructureDao->getColonnes($this->projet);
86
		$this->colonnes = $this->tableStructureDao->getColonnes($this->projet);
87
		$this->analyses = $this->tableStructureDao->getAnalyse($this->projet);
87
		$this->analyses = $this->tableStructureDao->getAnalyse($this->projet);
88
		$this->noms = $this->referentielDao->getTout($this->projet);
88
		$this->noms = $this->referentielDao->getTout($this->projet);
89
		Debug::printr('Nbre noms :'.count($this->noms));
89
		Debug::printr('Nbre noms :'.count($this->noms));
90
    }
90
    }
-
 
91
    
-
 
92
    public function lancerTestsAuto() {
-
 
93
		$resultats = array();
-
 
94
 
-
 
95
		// Lancement des tests unitaires
-
 
96
    	foreach (array_keys($this->tests) as $numero) {
-
 
97
			$info = $this->getInfosTest($numero);
-
 
98
    		
-
 
99
    		if ($numero < 5) {
-
 
100
    			// Tests spéciaux vérifiant la structure de la table
-
 
101
    			$resultats[] = $this->lancerTestUnitaire($info);
-
 
102
    		} else if ($numero >= 5 && $this->verifierResultats($resultats)) {		
-
 
103
				// Si la structure est bonne nous lançons les autres tests
-
 
104
				
-
 
105
    		}
-
 
106
		}
-
 
107
    }
-
 
108
    
-
 
109
    public function lancerTestUnitaire($info) {
-
 
110
		$methodeDeTest = $info['methode'];
-
 
111
    	$erreurs = $this->$methodeDeTest;
-
 
112
    	
-
 
113
    	// Analyse des résultats
-
 
114
    	if (isset($erreurs['special'])) {
-
 
115
    		$info = $erreurs;
-
 
116
    	} else {
-
 
117
			if (count($erreurs) > 0) {
-
 
118
				$info['message']['entete'] = explode(',', $info['entete']);
-
 
119
				$info['message']['lignes'] = $erreurs;
-
 
120
			} else {
-
 
121
				$info['resultat'] = true;
-
 
122
			}
-
 
123
    	}
-
 
124
    	
-
 
125
		$this->traiterResultatTest($info);
-
 
126
		
-
 
127
		if ($info['numero'] < 5) {
-
 
128
			return ($info['resultat'] ? '1' : '0');
-
 
129
		}
-
 
130
    }
91
    
131
    
92
    public function lancerTests() {
132
    public function lancerTests() {
93
		// Lancement des tests unitaires
133
		// Lancement des tests unitaires
94
		$resultats = array();
134
		$resultats = array();
95
		$resultats[] = $this->testerNombreDeChamps($this->colonnes);
135
		$resultats[] = $this->testerNombreDeChamps();
96
		$resultats[] = $this->testerNomDesChamps($this->colonnes);
136
		$resultats[] = $this->testerNomDesChamps();
97
		$resultats[] = $this->testerTypeDesChamps($this->colonnes);
137
		$resultats[] = $this->testerTypeDesChamps();
98
		$resultats[] = $this->testerNumNomClePrimaire($this->colonnes);
138
		$resultats[] = $this->testerNumNomClePrimaire();
99
		
139
		
100
		// Si la structure est bonne nous lançons les autres tests
140
		// Si la structure est bonne nous lançons les autres tests
101
		Debug::printr($resultats);
141
		Debug::printr($resultats);
102
		if ($this->verifierResultats($resultats)) {
142
		if ($this->verifierResultats($resultats)) {
103
			$this->testerTailleDesChamps($this->colonnes, $this->analyses);
143
			$this->testerTailleDesChamps();
104
			
144
			
105
			$this->testerNumNomSuperieurAZero();
145
			$this->testerNumNomSuperieurAZero();
106
			
146
			
107
			$this->testerNumNomRetenuSuperieurAZero();
147
			$this->testerNumNomRetenuSuperieurAZero();
108
			$this->testerNumTaxSupEgalZeroUnique();
148
			$this->testerNumTaxSupEgalZeroUnique();
109
			$this->testerTaxSupPourTaxon();
149
			$this->testerTaxSupPourTaxon();
110
			$this->testerExitenceTaxonSuperieur();
150
			$this->testerExitenceTaxonSuperieur();
111
			$this->testerClassificationRang();	
151
			$this->testerClassificationRang();	
112
			$this->testerClassification();
152
			$this->testerClassification();
113
			
153
			
114
			$this->testerRang();
154
			$this->testerRang();
115
			
155
			
116
			$this->testerNomCompletSupraGenerique();
156
			$this->testerNomCompletSupraGenerique();
117
			$this->testerNomCompletGenre();
157
			$this->testerNomCompletGenre();
118
			$this->testerNomCompletInfraGenre();
158
			$this->testerNomCompletInfraGenre();
119
			$this->testerNomCompletEspece();
159
			$this->testerNomCompletEspece();
120
			$this->testerNomCompletInfraSpecifique();
160
			$this->testerNomCompletInfraSpecifique();
121
	
161
	
122
			$this->testerNomSupraGeneriqueEspaces();
162
			$this->testerNomSupraGeneriqueEspaces();
123
			$this->testerNomSupraGeneriqueSyntaxe();
163
			$this->testerNomSupraGeneriqueSyntaxe();
124
			$this->testerNomSupraGeneriqueRang();
164
			$this->testerNomSupraGeneriqueRang();
125
			
165
			
126
			$this->testerGenreEspaces();
166
			$this->testerGenreEspaces();
127
			$this->testerGenreSyntaxe();
167
			$this->testerGenreSyntaxe();
128
			$this->testerGenreRang();
168
			$this->testerGenreRang();
129
			
169
			
130
			$this->testerEpitheteInfraGeneriqueEspaces();
170
			$this->testerEpitheteInfraGeneriqueEspaces();
131
			$this->testerEpitheteInfraGeneriqueSyntaxe();
171
			$this->testerEpitheteInfraGeneriqueSyntaxe();
132
			$this->testerEpitheteInfraGeneriqueRang();
172
			$this->testerEpitheteInfraGeneriqueRang();
133
			
173
			
134
			$this->testerEpitheteSpEspaces();
174
			$this->testerEpitheteSpEspaces();
135
			$this->testerEpitheteSpSyntaxe();
175
			$this->testerEpitheteSpSyntaxe();
136
			$this->testerEpitheteSpRang();
176
			$this->testerEpitheteSpRang();
137
			
177
			
138
			$this->testerTypeEpitheteEspaces();
178
			$this->testerTypeEpitheteEspaces();
139
			$this->testerTypeEpitheteSyntaxe();
179
			$this->testerTypeEpitheteSyntaxe();
140
			$this->testerTypeEpitheteHybridite();
180
			$this->testerTypeEpitheteHybridite();
141
			
181
			
142
			$this->testerEpitheteInfraSpEspaces();
182
			$this->testerEpitheteInfraSpEspaces();
143
			$this->testerEpitheteInfraSpSyntaxe();
183
			$this->testerEpitheteInfraSpSyntaxe();
144
			$this->testerEpitheteInfraSpRang();
184
			$this->testerEpitheteInfraSpRang();
145
			
185
			
146
			$this->testerGroupeCultivarSyntaxe();
186
			$this->testerGroupeCultivarSyntaxe();
147
			$this->testerGroupeCultivarRang();		
187
			$this->testerGroupeCultivarRang();		
148
			
188
			
149
			$this->testerCultivarSyntaxe();
189
			$this->testerCultivarSyntaxe();
150
			$this->testerCultivarRang();
190
			$this->testerCultivarRang();
151
			
191
			
152
			$this->testerNomCommercialSyntaxe();
192
			$this->testerNomCommercialSyntaxe();
153
			$this->testerNomCommercialPresenceCultivar();
193
			$this->testerNomCommercialPresenceCultivar();
154
			
194
			
155
			$this->testerAuteurSyntaxe();
195
			$this->testerAuteurSyntaxe();
156
			
196
			
157
			$this->testerAnneeSyntaxe();
197
			$this->testerAnneeSyntaxe();
158
			
198
			
159
			$this->testerBiblioOrigineSyntaxe();
199
			$this->testerBiblioOrigineSyntaxe();
160
			
200
			
161
			$this->testerHomonymieSyntaxe();
201
			$this->testerHomonymieSyntaxe();
162
			$this->testerHomonymieExistence();
202
			$this->testerHomonymieExistence();
163
			
203
			
164
			$this->testerBasionymeSyntaxe();
204
			$this->testerBasionymeSyntaxe();
165
			$this->testerBasionymeExistence();
205
			$this->testerBasionymeExistence();
166
			
206
			
167
			$this->testerSynonymeProparteSyntaxe();
207
			$this->testerSynonymeProparteSyntaxe();
168
			$this->testerSynonymeProparteExistence();
208
			$this->testerSynonymeProparteExistence();
169
			
209
			
170
			$this->testerSynonymeDouteuxSyntaxe();
210
			$this->testerSynonymeDouteuxSyntaxe();
171
			$this->testerSynonymeDouteuxNumNomRetenu();
211
			$this->testerSynonymeDouteuxNumNomRetenu();
172
			
212
			
173
			$this->testerSynonymeMalAppliqueSyntaxe();
213
			$this->testerSynonymeMalAppliqueSyntaxe();
174
			
214
			
175
			$this->testerSynonymeOrthographiqueSyntaxe();
215
			$this->testerSynonymeOrthographiqueSyntaxe();
176
			$this->testerSynonymeOrthographiqueExistence();
216
			$this->testerSynonymeOrthographiqueExistence();
177
			
217
			
178
			$this->testerHybrideParent01Syntaxe();
218
			$this->testerHybrideParent01Syntaxe();
179
			$this->testerHybrideParent01Existence();
219
			$this->testerHybrideParent01Existence();
180
			$this->testerHybrideParent02Syntaxe();
220
			$this->testerHybrideParent02Syntaxe();
181
			$this->testerHybrideParent02Existence();
221
			$this->testerHybrideParent02Existence();
182
			
222
			
183
			$this->testerPresenceSyntaxe();
223
			$this->testerPresenceSyntaxe();
184
			$this->testerStatutOrigineSyntaxe();
224
			$this->testerStatutOrigineSyntaxe();
185
			$this->testerStatutIntroductionSyntaxe();
225
			$this->testerStatutIntroductionSyntaxe();
186
			$this->testerStatutCultureSyntaxe();
226
			$this->testerStatutCultureSyntaxe();
187
			$this->testerExclureTaxRefSyntaxe();
227
			$this->testerExclureTaxRefSyntaxe();
188
		}
228
		}
189
	}
229
	}
-
 
230
	
190
	private function verifierResultats($resultats) {
231
	private function verifierResultats($resultats) {
191
		$ok = true;
232
		$ok = true;
192
		foreach ($resultats as $resultat) {
233
		foreach ($resultats as $resultat) {
193
			if ($resultat == '0') {
234
			if ($resultat == '0') {
194
				$ok = false;
235
				$ok = false;
195
				break;
236
				break;
196
			}
237
			}
197
		}
238
		}
198
		return $ok;
239
		return $ok;
199
	}
240
	}
200
	
241
	
201
	//+--------------------------------------------------------------------------------------------------------------+//
242
	//+--------------------------------------------------------------------------------------------------------------+//
202
	// Enregistrement des résultats
243
	// Enregistrement des résultats
203
	private function traiterResultatTest($info) {
244
	private function traiterResultatTest($info) {
204
		Debug::printr($info['nom']);
245
		Debug::printr($info['nom']);
205
		if (isset($info['message'])) {
246
		if (isset($info['message'])) {
206
			if (is_array($info['message'])) {
247
			if (is_array($info['message'])) {
207
				$info['message'] = $this->getVue('tests/squelettes/message_table', $info);
248
				$info['message'] = $this->getVue('tests/squelettes/message_table', $info);
208
			} else {
249
			} else {
209
				$info['message'] = $this->getVue('tests/squelettes/message_p', $info);
250
				$info['message'] = $this->getVue('tests/squelettes/message_p', $info);
210
			}
251
			}
211
		}
252
		}
212
		$this->resultatDao->ajouter($this->traitement['id_traitement'], $info);
253
		$this->resultatDao->ajouter($this->traitement['id_traitement'], $info);
213
		$info = null;
254
		$info = null;
214
	}
255
	}
215
	
256
	
216
	//+--------------------------------------------------------------------------------------------------------------+//
257
	//+--------------------------------------------------------------------------------------------------------------+//
217
	// TESTS
258
	// TESTS
218
	
259
	
219
	/**
260
	/**
220
	 * Test #01
261
	 * Test #01
221
	 */
262
	 */
222
	private function testerNombreDeChamps($colonnes) {
263
	private function testerNombreDeChamps() {
223
		$info = $this->getInfosTest(1);
264
		$info = $this->getInfosTest(1);
-
 
265
		$info['special'] = true;
224
		
266
		
225
		$nbre_colonnes = count($colonnes);
267
		$nbre_colonnes = count($this->colonnes);
226
		$info['message'] = $nbre_colonnes;
268
		$info['message'] = $nbre_colonnes;
227
		if ($nbre_colonnes >= 35) {
269
		if ($nbre_colonnes >= 35) {
228
			$info['resultat'] = true;
270
			$info['resultat'] = true;
229
		}
271
		}
230
		$this->traiterResultatTest($info);
-
 
-
 
272
		
231
		return ($info['resultat'] ? '1' : '0');
273
		return $info;
232
	}
274
	}
233
	
275
	
234
	/**
276
	/**
235
	 * Test #02
277
	 * Test #02
236
	 */
278
	 */
237
	private function testerNomDesChamps($colonnes) {
279
	private function testerNomDesChamps() {
238
		$info = $this->getInfosTest(2);
280
		$info = $this->getInfosTest(2);
-
 
281
		$info['special'] = true;
239
		
282
		
240
		$champs_attendus = explode(',', $this->manuel['champs']);
283
		$champs_attendus = explode(',', $this->manuel['champs']);
241
		$champs_presents = array();
284
		$champs_presents = array();
242
		foreach ($colonnes as $colonne) {
285
		foreach ($this->colonnes as $colonne) {
243
			$champs_presents[$colonne['Field']] = $colonne;
286
			$champs_presents[$colonne['Field']] = $colonne;
244
		}
287
		}
245
		
288
		
246
		$ok = true;
289
		$ok = true;
247
		$champs_manquant = array(); 
290
		$champs_manquant = array(); 
248
		foreach ($champs_attendus as $champ_attendu) {
291
		foreach ($champs_attendus as $champ_attendu) {
249
			if (!isset($champs_presents[$champ_attendu])) {
292
			if (!isset($champs_presents[$champ_attendu])) {
250
				$champs_manquant[] = $champ_attendu; 
293
				$champs_manquant[] = $champ_attendu; 
251
				$ok = false;
294
				$ok = false;
252
			}
295
			}
253
		}
296
		}
-
 
297
		
254
		$info['resultat'] = $ok;
298
		$info['resultat'] = $ok;
255
		if (!$ok) {
299
		if (!$ok) {
256
			$info['message'] = sprintf($info['message'], implode(', ', $champs_manquant));
300
			$info['message'] = sprintf($info['message'], implode(', ', $champs_manquant));
257
		}
301
		}
258
		
-
 
259
		$this->traiterResultatTest($info);
302
		
260
		return ($info['resultat'] ? '1' : '0');
303
		return $info;
261
	}
304
	}
262
	
305
	
263
	/**
306
	/**
264
	 * Test #03
307
	 * Test #03
265
	 */
308
	 */
266
	private function testerTypeDesChamps($colonnes) {
309
	private function testerTypeDesChamps() {
267
		$info = $this->getInfosTest(3);
-
 
268
		
-
 
269
		$champs_attendus = explode(',', $this->manuel['champs_type']);
310
		$champs_attendus = explode(',', $this->manuel['champs_type']);
270
		$champs_presents = array();
311
		$champs_presents = array();
271
		foreach ($colonnes as $colonne) {
312
		foreach ($this->colonnes as $colonne) {
272
			$champs_presents[$colonne['Field']] = $colonne['Type'];
313
			$champs_presents[$colonne['Field']] = $colonne['Type'];
273
		}
314
		}
274
		
315
		
275
		// Recercherche des erreurs
316
		// Recercherche des erreurs
276
		$champs_erreur = array(); 
317
		$champs_erreur = array(); 
277
		foreach ($champs_attendus as $champ_attendu) {
318
		foreach ($champs_attendus as $champ_attendu) {
278
			list($champ_attendu_nom, $champ_attendu_type_taille) = explode('=', trim($champ_attendu));
319
			list($champ_attendu_nom, $champ_attendu_type_taille) = explode('=', trim($champ_attendu));
279
			list($champ_attendu_type, $champ_attendu_taille) = explode('|', trim($champ_attendu_type_taille));
320
			list($champ_attendu_type, $champ_attendu_taille) = explode('|', trim($champ_attendu_type_taille));
280
			
321
			
281
			if (isset($champs_presents[$champ_attendu_nom])) {
322
			if (isset($champs_presents[$champ_attendu_nom])) {
282
				$champs_present_type = $champs_presents[$champ_attendu_nom];
323
				$champs_present_type = $champs_presents[$champ_attendu_nom];
283
				
324
				
284
				if (($champ_attendu_type == 'VARCHAR' && strstr($champs_present_type, 'varchar') === false)
325
				if (($champ_attendu_type == 'VARCHAR' && strstr($champs_present_type, 'varchar') === false)
285
					|| ($champ_attendu_type == 'TEXT' && strstr($champs_present_type, 'text') === false)
326
					|| ($champ_attendu_type == 'TEXT' && strstr($champs_present_type, 'text') === false)
286
					|| ($champ_attendu_type == 'INT' && strstr($champs_present_type, 'int') === false) 
327
					|| ($champ_attendu_type == 'INT' && strstr($champs_present_type, 'int') === false) 
287
					|| ($champ_attendu_type == 'BOOL' && preg_match('/(?:bool|boolean|tinyint\(1\))/i', $champs_present_type) === false)) {
328
					|| ($champ_attendu_type == 'BOOL' && preg_match('/(?:bool|boolean|tinyint\(1\))/i', $champs_present_type) === false)) {
288
					$champs_erreur[] = $champ_attendu." vaut ".$champs_present_type;
329
					$champs_erreur[] = array($champ_attendu, $champ_attendu_type, $champs_present_type);
289
				}
330
				}
290
			}
331
			}
291
		}
332
		}
292
		
-
 
293
		// Analyse des résultats
-
 
294
		if (count($champs_erreur) > 0) {
333
		return $champs_erreur;
295
			$info['message'] = sprintf($info['message'], implode(', ', $champs_erreur));
-
 
296
		} else {
-
 
297
			$info['resultat'] = true;
-
 
298
		}
-
 
299
		
-
 
300
		$this->traiterResultatTest($info);
-
 
301
		return ($info['resultat'] ? '1' : '0');
-
 
302
	}
334
	}
303
	
335
	
304
	/**
336
	/**
305
	 * Test #04
337
	 * Test #04
306
	 */
338
	 */
307
	private function testerNumNomClePrimaire($colonnes) {
339
	private function testerNumNomClePrimaire() {
308
		$info = $this->getInfosTest(4);
340
		$info = $this->getInfosTest(4);
-
 
341
		$info['special'] = true;
309
		
342
		
310
		foreach ($colonnes as $colonne) {
343
		foreach ($this->colonnes as $colonne) {
311
			if ($colonne['Field'] == 'num_nom' && $colonne['Key'] == 'PRI') {
344
			if ($colonne['Field'] == 'num_nom' && $colonne['Key'] == 'PRI') {
312
				$info['resultat'] = true;
345
				$info['resultat'] = true;
313
			}
346
			}
314
		}
347
		}
315
		
-
 
316
		$this->traiterResultatTest($info);
-
 
317
		return ($info['resultat'] ? '1' : '0');
348
		return $info;
318
	}
349
	}
319
	
350
	
320
	
351
	
321
	/**
352
	/**
322
	 * Test #05
353
	 * Test #05
323
	 */
354
	 */
324
	private function testerTailleDesChamps($colonnes, $analyses) {
355
	private function testerTailleDesChamps() {
325
		$info = $this->getInfosTest(5);
-
 
326
		
-
 
327
		$tailles_champs_maxi = array();
356
		$tailles_champs_maxi = array();
328
		foreach ($colonnes as $colonne) {
357
		foreach ($this->colonnes as $colonne) {
329
			if (preg_match('/^varchar\(([0-9]+)\)$/', $colonne['Type'], $match)) {
358
			if (preg_match('/^varchar\(([0-9]+)\)$/', $colonne['Type'], $match)) {
330
				$tailles_champs_maxi[$colonne['Field']] = $match[1];
359
				$tailles_champs_maxi[$colonne['Field']] = $match[1];
331
			}
360
			}
332
		}
361
		}
333
		
362
		
334
		$tailles_trouvees = array();
363
		$tailles_trouvees = array();
335
		foreach ($analyses as $analyse) {
364
		foreach ($this->analyses as $analyse) {
336
			if (preg_match('/\.([^.]+)$/', $analyse['Field_name'], $match)) {
365
			if (preg_match('/\.([^.]+)$/', $analyse['Field_name'], $match)) {
337
				$tailles_trouvees[$match[1]] = $analyse['Max_length'];
366
				$tailles_trouvees[$match[1]] = $analyse['Max_length'];
338
			}
367
			}
339
		}
368
		}
340
		
369
		
341
		$champs_erreur = array();
370
		$champs_erreur = array();
342
		$champs_attendus = explode(',', $this->manuel['champs']);
371
		$champs_attendus = explode(',', $this->manuel['champs']);
343
		foreach ($champs_attendus as $champ_attendu) {
372
		foreach ($champs_attendus as $champ_attendu) {
344
			if (isset($tailles_champs_maxi[$champ_attendu]) && isset($tailles_trouvees[$champ_attendu])) {
373
			if (isset($tailles_champs_maxi[$champ_attendu]) && isset($tailles_trouvees[$champ_attendu])) {
345
				if ($tailles_champs_maxi[$champ_attendu] == $tailles_trouvees[$champ_attendu]) {
374
				if ($tailles_champs_maxi[$champ_attendu] == $tailles_trouvees[$champ_attendu]) {
346
					$champs_erreur[] = $champ_attendu;
375
					$champs_erreur[] = array($champ_attendu, $tailles_champs_maxi[$champ_attendu], $tailles_trouvees[$champ_attendu]);
347
				}
376
				}
348
			}
377
			}
349
		}
378
		}
350
		
-
 
351
		// Analyse des résultats
-
 
352
		if (count($champs_erreur) > 0) {
379
		return $champs_erreur;
353
			$info['message'] = sprintf($info['message'], implode(', ', $champs_erreur));
-
 
354
		} else {
-
 
355
			$info['resultat'] = true;
-
 
356
		}
-
 
357
		
-
 
358
		$this->traiterResultatTest($info);
-
 
359
	}
380
	}
360
		
381
		
361
	/**
382
	/**
362
	 * Test #06
383
	 * Test #06
363
	 */
384
	 */
364
	private function testerNumNomSuperieurAZero() {
385
	private function testerNumNomSuperieurAZero() {
365
		$info = $this->getInfosTest(6);
-
 
366
		
-
 
367
		// Réalisation du test
386
		// Réalisation du test
368
		$noms_erreur = array();
387
		$noms_erreur = array();
369
		foreach ($this->noms as &$nom) {
388
		foreach ($this->noms as &$nom) {
370
			if ($nom['num_nom'] <= 0) {
389
			if ($nom['num_nom'] <= 0) {
371
				$noms_erreur[] = $nom['num_nom'];
390
				$noms_erreur[] = array($nom['num_nom']);
372
			}
391
			}
373
		}
392
		}
374
		
-
 
375
		// Analyse des résultats
-
 
376
		if (count($noms_erreur) > 0) {
393
		return $noms_erreur;
377
			$info['message'] = sprintf($info['message'], count($noms_erreur));
-
 
378
		} else {
-
 
379
			$info['resultat'] = true;
-
 
380
		}
-
 
381
		
-
 
382
		$this->traiterResultatTest($info);
-
 
383
	}
394
	}
384
	
395
	
385
	/**
396
	/**
386
	 * Test #07
397
	 * Test #07
387
	 */
398
	 */
388
	private function testerNumNomRetenuSuperieurAZero() {
399
	private function testerNumNomRetenuSuperieurAZero() {
389
		$info = $this->getInfosTest(7);
400
		$info = $this->getInfosTest(7);
390
		
401
		
391
		// Réalisation du test
402
		// Réalisation du test
392
		$noms_erreur = array();
403
		$noms_erreur = array();
393
		foreach ($this->noms as &$nom) {
404
		foreach ($this->noms as &$nom) {
394
			if ($nom['num_nom_retenu'] != '' && $nom['num_nom_retenu'] <= 0) {
405
			if ($nom['num_nom_retenu'] != '' && $nom['num_nom_retenu'] <= 0) {
395
				$noms_erreur[] = $nom['num_nom'];
406
				$noms_erreur[] = array($nom['num_nom'], $nom['num_nom_retenu']);
396
			}
407
			}
397
		}
408
		}
398
		
409
		
399
		// Analyse des résultats
410
		// Analyse des résultats
400
		if (count($noms_erreur) > 0) {
411
		if (count($noms_erreur) > 0) {
401
			$info['message'] = sprintf($info['message'], count($noms_erreur), implode(', ', $noms_erreur));
412
			$info['message']['entete'] = array('num_nom', 'num_nom_retenu');
-
 
413
			$info['message']['lignes'] = $noms_erreur;
402
		} else {
414
		} else {
403
			$info['resultat'] = true;
415
			$info['resultat'] = true;
404
		}
416
		}
405
		
417
		
406
		$this->traiterResultatTest($info);
418
		$this->traiterResultatTest($info);
407
	}
419
	}
408
	
420
	
409
	/**
421
	/**
410
	 * Test #08
422
	 * Test #08
411
	 */
423
	 */
412
	private function testerNumTaxSupEgalZeroUnique() {
424
	private function testerNumTaxSupEgalZeroUnique() {
413
		$info = $this->getInfosTest(8);
425
		$info = $this->getInfosTest(8);
414
		
426
		
415
		// Réalisation du test
427
		// Réalisation du test
416
		$noms_erreur = array();
428
		$noms_erreur = array();
417
		foreach ($this->noms as &$nom) {
429
		foreach ($this->noms as &$nom) {
418
			if (preg_match('/^0$/', $nom['num_tax_sup'])) {
430
			if (preg_match('/^0$/', $nom['num_tax_sup'])) {
419
				$noms_erreur[] = $nom['num_nom'];
431
				$noms_erreur[] = array($nom['num_nom'], $nom['num_tax_sup']);
420
			}
432
			}
421
		}
433
		}
422
		
434
		
423
		// Analyse des résultats
435
		// Analyse des résultats
424
		if (count($noms_erreur) > 1) {
436
		if (count($noms_erreur) > 1) {
425
			$info['message'] = sprintf($info['message'], count($noms_erreur), implode(', ', $noms_erreur));
437
			$info['message']['entete'] = array('num_nom', 'num_tax_sup');
-
 
438
			$info['message']['lignes'] = $noms_erreur;
426
		} else {
439
		} else {
427
			$info['resultat'] = true;
440
			$info['resultat'] = true;
428
		}
441
		}
429
		
442
		
430
		$this->traiterResultatTest($info);
443
		$this->traiterResultatTest($info);
431
	}
444
	}
432
	
445
	
433
	/**
446
	/**
434
	 * Test #09
447
	 * Test #09
435
	 */
448
	 */
436
	private function testerTaxSupPourTaxon() {
449
	private function testerTaxSupPourTaxon() {
437
		$info = $this->getInfosTest(9);
450
		$info = $this->getInfosTest(9);
438
		
451
		
439
		// Réalisation du test
452
		// Réalisation du test
440
		$noms_erreur = array();
453
		$noms_erreur = array();
441
		foreach ($this->noms as &$nom) {
454
		foreach ($this->noms as &$nom) {
442
			if ($nom['num_nom_retenu'] != $nom['num_nom'] && $nom['num_tax_sup'] != '') {
455
			if ($nom['num_nom_retenu'] != $nom['num_nom'] && $nom['num_tax_sup'] != '') {
443
				$noms_erreur[] = $nom['num_nom']; 
456
				$noms_erreur[] = array($nom['num_nom'], $nom['num_tax_sup']); 
444
			}
457
			}
445
		}
458
		}
446
		
459
		
447
		// Analyse des résultats
460
		// Analyse des résultats
448
		if (count($noms_erreur) > 0) {
461
		if (count($noms_erreur) > 0) {
449
			$info['message'] = sprintf($info['message'], count($noms_erreur), implode(', ', $noms_erreur));
462
			$info['message']['entete'] = array('num_nom', 'num_tax_sup');
-
 
463
			$info['message']['lignes'] = $noms_erreur;
450
		} else {
464
		} else {
451
			$info['resultat'] = true;
465
			$info['resultat'] = true;
452
		}
466
		}
453
		
467
		
454
		$this->traiterResultatTest($info);
468
		$this->traiterResultatTest($info);
455
	}
469
	}
456
	
470
	
457
	/**
471
	/**
458
	 * Test #10
472
	 * Test #10
459
	 */
473
	 */
460
	private function testerExitenceTaxonSuperieur() {
474
	private function testerExitenceTaxonSuperieur() {
461
		$info = $this->getInfosTest(10);
475
		$info = $this->getInfosTest(10);
462
		
476
		
463
		// Réalisation du test
477
		// Réalisation du test
464
		$noms_erreur = array();
478
		$noms_erreur = array();
465
		foreach ($this->noms as &$nom) {
479
		foreach ($this->noms as &$nom) {
466
			if ($nom['num_nom_retenu'] == $nom['num_nom']) {
480
			if ($nom['num_nom_retenu'] == $nom['num_nom']) {
467
				if ($nom['num_tax_sup'] != 0 && !isset($this->noms[$nom['num_tax_sup']])) {
481
				if ($nom['num_tax_sup'] != 0 && !isset($this->noms[$nom['num_tax_sup']])) {
468
					$noms_erreur[] = $nom['num_nom'];
482
					$noms_erreur[] = array($nom['num_nom'], $nom['num_tax_sup']);
469
				} 
483
				} 
470
			}
484
			}
471
		}
485
		}
472
		
486
		
473
		// Analyse des résultats
487
		// Analyse des résultats
474
		if (count($noms_erreur) > 0) {
488
		if (count($noms_erreur) > 0) {
475
			$info['message'] = sprintf($info['message'], count($noms_erreur), implode(', ', $noms_erreur));
489
			$info['message']['entete'] = array('num_nom', 'num_tax_sup');
-
 
490
			$info['message']['lignes'] = $noms_erreur;
476
		} else {
491
		} else {
477
			$info['resultat'] = true;
492
			$info['resultat'] = true;
478
		}
493
		}
479
		
494
		
480
		$this->traiterResultatTest($info);
495
		$this->traiterResultatTest($info);
481
	}
496
	}
482
	
497
	
483
	/**
498
	/**
484
	 * Test #11
499
	 * Test #11
485
	 */
500
	 */
486
	private function testerClassificationRang() {
501
	private function testerClassificationRang() {
487
		$info = $this->getInfosTest(11);
502
		$info = $this->getInfosTest(11);
488
		
503
		
489
		// Réalisation du test
504
		// Réalisation du test
490
		$noms_erreur = array();
505
		$noms_erreur = array();
491
		foreach ($this->noms as &$nom) {
506
		foreach ($this->noms as &$nom) {
492
			if ($nom['num_nom_retenu'] == $nom['num_nom']) {
507
			if ($nom['num_nom_retenu'] == $nom['num_nom']) {
493
				if (isset($this->noms[$nom['num_tax_sup']])) {
508
				if (isset($this->noms[$nom['num_tax_sup']])) {
494
					$nom_sup = $this->noms[$nom['num_tax_sup']];
509
					$nom_sup = $this->noms[$nom['num_tax_sup']];
495
					if ($nom_sup['rang'] >= $nom['rang']) {
510
					if ($nom_sup['rang'] >= $nom['rang']) {
496
						// Prise en compte de l'exception des clades
511
						// Prise en compte de l'exception des clades
497
						if (! ($nom_sup['rang'] == 70 && $nom['rang'] == 70)) {
512
						if (! ($nom_sup['rang'] == 70 && $nom['rang'] == 70)) {
498
							$noms_erreur[] = $nom['num_nom'];
513
							$noms_erreur[] = array($nom['num_nom'], $nom['rang'], $nom_sup['num_nom'], $nom_sup['rang']);
499
						}
514
						}
500
					}
515
					}
501
				}
516
				}
502
			}
517
			}
503
		}
518
		}
504
		
519
		
505
		// Analyse des résultats
520
		// Analyse des résultats
506
		if (count($noms_erreur) > 0) {
521
		if (count($noms_erreur) > 0) {
507
			$info['message'] = sprintf($info['message'], count($noms_erreur), implode(', ', $noms_erreur));
522
			$info['message']['entete'] = array('num_nom', 'rang', 'Taxon supérieur num_nom', 'Taxon supérieur rang');
-
 
523
			$info['message']['lignes'] = $noms_erreur;
508
		} else {
524
		} else {
509
			$info['resultat'] = true;
525
			$info['resultat'] = true;
510
		}
526
		}
511
		
527
		
512
		$this->traiterResultatTest($info);
528
		$this->traiterResultatTest($info);
513
	}
529
	}
514
	
530
	
515
	/**
531
	/**
516
	 * Test #12
532
	 * Test #12
517
	 */
533
	 */
518
	private function testerClassification() {
534
	private function testerClassification() {
519
		$info = $this->getInfosTest(12);
535
		$info = $this->getInfosTest(12);
520
		
536
		
521
		// Réalisation du test
537
		// Réalisation du test
522
		$noms_erreur = array();
538
		$noms_erreur = array();
523
		$this->noms_ok = array();
539
		$this->noms_ok = array();
524
		foreach ($this->noms as &$nom) {
540
		foreach ($this->noms as &$nom) {
525
			if ($nom['num_nom_retenu'] == $nom['num_nom']) {
541
			if ($nom['num_nom_retenu'] == $nom['num_nom']) {
526
				if (isset($this->noms_ok[$nom['num_tax_sup']])) {
542
				if (isset($this->noms_ok[$nom['num_tax_sup']])) {
527
					$this->noms_ok[$nom['num_nom']] = true;
543
					$this->noms_ok[$nom['num_nom']] = true;
528
				} else {
544
				} else {
529
					$this->detection_boucle_infini = array();
545
					$this->detection_boucle_infini = array();
530
					$classif_ok = $this->remonterClassif($nom);
546
					$classif_ok = $this->remonterClassif($nom);
531
					unset($this->detection_boucle_infini); 
547
					unset($this->detection_boucle_infini); 
532
					
548
					
533
					if ($classif_ok === false) {
-
 
534
						$noms_erreur[] = $nom['num_nom'];
-
 
535
					} else {
549
					if ($classif_ok === true) {
-
 
550
						$this->noms_ok[$nom['num_nom']] = $classif_ok;
-
 
551
					} else {
536
						$this->noms_ok[$nom['num_nom']] = $classif_ok;
552
						$noms_erreur[] = array($nom['num_nom'], $classif_ok);
537
					}
553
					}
538
				}
554
				}
539
			}
555
			}
540
		}
556
		}
541
		unset($this->noms_ok);
557
		unset($this->noms_ok);
542
		
558
		
543
		// Analyse des résultats
559
		// Analyse des résultats
544
		if (count($noms_erreur) > 0) {
560
		if (count($noms_erreur) > 0) {
545
			$info['message'] = sprintf($info['message'], count($noms_erreur), implode(', ', $noms_erreur));
561
			$info['message']['entete'] = array('num_nom', 'Message du problème');
-
 
562
			$info['message']['lignes'] = $noms_erreur;
546
		} else {
563
		} else {
547
			$info['resultat'] = true;
564
			$info['resultat'] = true;
548
		}
565
		}
549
		
566
		
550
		$this->traiterResultatTest($info);
567
		$this->traiterResultatTest($info);
551
	}
568
	}
552
	
569
	
553
	private function remonterClassif(&$nom) {
570
	private function remonterClassif(&$nom) {
554
		$this->detection_boucle_infini[$nom['num_nom']] = true;
571
		$this->detection_boucle_infini[$nom['num_nom']] = true;
555
		if (preg_match('/^[0-9]*$/', $nom['num_tax_sup'])) {
572
		if (preg_match('/^[0-9]*$/', $nom['num_tax_sup'])) {
556
			if (isset($this->noms_ok[$nom['num_tax_sup']])) {
573
			if (isset($this->noms_ok[$nom['num_tax_sup']])) {
557
				$this->noms_ok[$nom['num_nom']] = true;
574
				$this->noms_ok[$nom['num_nom']] = true;
558
				return true;
575
				return true;
559
			} else if (!isset($this->noms[$nom['num_tax_sup']]) && $nom['num_tax_sup'] == '0') {
576
			} else if (!isset($this->noms[$nom['num_tax_sup']]) && $nom['num_tax_sup'] == '0') {
560
				$this->noms_ok[$nom['num_nom']] = true;
577
				$this->noms_ok[$nom['num_nom']] = true;
561
				return true;
578
				return true;
562
			} else if (!isset($this->noms[$nom['num_tax_sup']]) && $nom['num_tax_sup'] != '0') {
579
			} else if (!isset($this->noms[$nom['num_tax_sup']]) && $nom['num_tax_sup'] != '0') {
563
				return false;
580
				return 'Hiérarchie avec le taxon #'.$nom['num_nom'].' ayant un taxon superieur #'.$nom['num_tax_sup'].' inexistant';
564
			} else if (isset($this->detection_boucle_infini[$nom['num_tax_sup']])) {
581
			} else if (isset($this->detection_boucle_infini[$nom['num_tax_sup']])) {
565
				return false;
582
				return 'Boucle infinie pour le taxon #'.$nom['num_tax_sup'];
566
			} else {
583
			} else {
567
				$retour = $this->remonterClassif($this->noms[$nom['num_tax_sup']]);
584
				$retour = $this->remonterClassif($this->noms[$nom['num_tax_sup']]);
568
				if ($retour === true) {
585
				if ($retour === true) {
569
					$this->noms_ok[$nom['num_tax_sup']] = true;
586
					$this->noms_ok[$nom['num_tax_sup']] = true;
570
				}
587
				}
571
				return $retour;
588
				return $retour;
572
			}
589
			}
573
		} else {
590
		} else {
574
			return false;
591
			return 'Valeur num_tax_sup incorrecte : '.$nom['num_tax_sup'];
575
		}
592
		}
576
	}
593
	}
577
	
594
	
578
	/**
595
	/**
579
	 * Test #13
596
	 * Test #13
580
	 */
597
	 */
581
	private function testerRang() {
598
	private function testerRang() {
582
		$info = $this->getInfosTest(13);
599
		$info = $this->getInfosTest(13);
583
		
600
		
584
		$rangs = array_flip(explode(',', $this->manuel['rangs']));
601
		$rangs = array_flip(explode(',', $this->manuel['rangs']));
585
		
602
		
586
		// Réalisation du test
603
		// Réalisation du test
587
		$noms_erreur = array();
604
		$noms_erreur = array();
588
		foreach ($this->noms as &$nom) {
605
		foreach ($this->noms as &$nom) {
589
			if (!isset($rangs[$nom['rang']])) {
606
			if (!isset($rangs[$nom['rang']])) {
590
				$noms_erreur[] = $nom['num_nom'];
607
				$noms_erreur[] = array($nom['num_nom'], $nom['rang']);
591
			}
608
			}
592
		}
609
		}
593
		
610
		
594
		// Analyse des résultats
611
		// Analyse des résultats
595
		if (count($noms_erreur) > 0) {
612
		if (count($noms_erreur) > 0) {
596
			$info['message'] = sprintf($info['message'], count($noms_erreur), implode(', ', $noms_erreur));
613
			$info['message']['entete'] = array('num_nom', 'Rang');
-
 
614
			$info['message']['lignes'] = $noms_erreur;
597
		} else {
615
		} else {
598
			$info['resultat'] = true;
616
			$info['resultat'] = true;
599
		}
617
		}
600
		
618
		
601
		$this->traiterResultatTest($info);
619
		$this->traiterResultatTest($info);
602
	}
620
	}
603
	
621
	
604
	/**
622
	/**
605
	 * Test #14
623
	 * Test #14
606
	 */
624
	 */
607
	private function testerNomCompletSupraGenerique() {
625
	private function testerNomCompletSupraGenerique() {
608
		$info = $this->getInfosTest(14);
626
		$info = $this->getInfosTest(14);
609
		$info['description'] = sprintf($info['description'], $this->manuel['rang_genre']);
627
		$info['description'] = sprintf($info['description'], $this->manuel['rang_genre']);
610
		
628
		
611
		// Réalisation du test
629
		// Réalisation du test
612
		$noms_erreur = array();
630
		$noms_erreur = array();
613
		foreach ($this->noms as &$nom) {
631
		foreach ($this->noms as &$nom) {
614
			if ($nom['rang'] < $this->manuel['rang_genre']) {
632
			if ($nom['rang'] < $this->manuel['rang_genre']) {
615
				$suffixe_plte_cultivee = $this->construireSuffixeNomPltCultivee($nom);
633
				$suffixe_plte_cultivee = $this->construireSuffixeNomPltCultivee($nom);
616
				$nom_sci_ideal = $this->formaterStyleNomGenre($nom['nom_supra_generique']);
634
				$nom_sci_ideal = $this->formaterStyleNomGenre($nom['nom_supra_generique']);
617
				$nom_sci_ideal .= ($suffixe_plte_cultivee != '' ? ' '.$suffixe_plte_cultivee : '');
635
				$nom_sci_ideal .= ($suffixe_plte_cultivee != '' ? ' '.$suffixe_plte_cultivee : '');
618
				if ($nom['nom_sci'] != $nom_sci_ideal) {
636
				if ($nom['nom_sci'] != $nom_sci_ideal) {
619
					$nom_sci_traite = $this->repererEspace($nom['nom_sci']);
637
					$nom_sci_traite = $this->repererEspace($nom['nom_sci']);
620
					$noms_erreur[] = array($nom['num_nom'], $nom_sci_traite, $nom_sci_ideal);
638
					$noms_erreur[] = array($nom['num_nom'], $nom_sci_traite, $nom_sci_ideal);
621
				}
639
				}
622
			}
640
			}
623
		}
641
		}
624
		
642
		
625
		// Analyse des résultats
643
		// Analyse des résultats
626
		if (count($noms_erreur) > 0) {
644
		if (count($noms_erreur) > 0) {
627
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'nom_sci corrigé');
645
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'nom_sci corrigé');
628
			$info['message']['lignes'] = $noms_erreur;
646
			$info['message']['lignes'] = $noms_erreur;
629
		} else {
647
		} else {
630
			$info['resultat'] = true;
648
			$info['resultat'] = true;
631
		}
649
		}
632
		
650
		
633
		$this->traiterResultatTest($info);
651
		$this->traiterResultatTest($info);
634
	}
652
	}
635
	
653
	
636
	/**
654
	/**
637
	 * Test #15
655
	 * Test #15
638
	 */
656
	 */
639
	private function testerNomCompletGenre() {
657
	private function testerNomCompletGenre() {
640
		$info = $this->getInfosTest(15);
658
		$info = $this->getInfosTest(15);
641
		$info['description'] = sprintf($info['description'], $this->manuel['rang_genre']);
659
		$info['description'] = sprintf($info['description'], $this->manuel['rang_genre']);
642
		
660
		
643
		// Réalisation du test
661
		// Réalisation du test
644
		$noms_erreur = array();
662
		$noms_erreur = array();
645
		foreach ($this->noms as &$nom) {
663
		foreach ($this->noms as &$nom) {
646
			if ($nom['rang'] == $this->manuel['rang_genre']) {
664
			if ($nom['rang'] == $this->manuel['rang_genre']) {
647
				$suffixe_plte_cultivee = $this->construireSuffixeNomPltCultivee($nom);
665
				$suffixe_plte_cultivee = $this->construireSuffixeNomPltCultivee($nom);
648
				$nom_sci_ideal = $this->formaterStyleNomGenre($nom['genre']);
666
				$nom_sci_ideal = $this->formaterStyleNomGenre($nom['genre']);
649
				$nom_sci_ideal .= ($suffixe_plte_cultivee != '' ? ' '.$suffixe_plte_cultivee : '');
667
				$nom_sci_ideal .= ($suffixe_plte_cultivee != '' ? ' '.$suffixe_plte_cultivee : '');
650
				if ($nom['nom_sci'] != $nom_sci_ideal) {
668
				if ($nom['nom_sci'] != $nom_sci_ideal) {
651
					$nom_sci_traite = $this->repererEspace($nom['nom_sci']);
669
					$nom_sci_traite = $this->repererEspace($nom['nom_sci']);
652
					$noms_erreur[] = array($nom['num_nom'], $nom_sci_traite, $nom_sci_ideal);
670
					$noms_erreur[] = array($nom['num_nom'], $nom_sci_traite, $nom_sci_ideal);
653
				}
671
				}
654
			}
672
			}
655
		}
673
		}
656
		
674
		
657
		// Analyse des résultats
675
		// Analyse des résultats
658
		if (count($noms_erreur) > 0) {
676
		if (count($noms_erreur) > 0) {
659
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'nom_sci corrigé');
677
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'nom_sci corrigé');
660
			$info['message']['lignes'] = $noms_erreur;
678
			$info['message']['lignes'] = $noms_erreur;
661
		} else {
679
		} else {
662
			$info['resultat'] = true;
680
			$info['resultat'] = true;
663
		}
681
		}
664
		
682
		
665
		$this->traiterResultatTest($info);
683
		$this->traiterResultatTest($info);
666
	}
684
	}
667
	
685
	
668
	/**
686
	/**
669
	 * Test #16
687
	 * Test #16
670
	 */
688
	 */
671
	private function testerNomCompletInfraGenre() {
689
	private function testerNomCompletInfraGenre() {
672
		$info = $this->getInfosTest(16);
690
		$info = $this->getInfosTest(16);
673
		$info['description'] = sprintf($info['description'], $this->manuel['rang_genre'], $this->manuel['rang_sp']);
691
		$info['description'] = sprintf($info['description'], $this->manuel['rang_genre'], $this->manuel['rang_sp']);
674
		
692
		
675
		// Réalisation du test
693
		// Réalisation du test
676
		$noms_erreur = array();
694
		$noms_erreur = array();
677
		foreach ($this->noms as &$nom) {
695
		foreach ($this->noms as &$nom) {
678
			if ($nom['rang'] > $this->manuel['rang_genre'] && $nom['rang'] < $this->manuel['rang_sp']) {
696
			if ($nom['rang'] > $this->manuel['rang_genre'] && $nom['rang'] < $this->manuel['rang_sp']) {
679
				$suffixe_plte_cultivee = $this->construireSuffixeNomPltCultivee($nom);
697
				$suffixe_plte_cultivee = $this->construireSuffixeNomPltCultivee($nom);
680
				$nom_sci_ideal = '';
698
				$nom_sci_ideal = '';
681
				if ($nom['type_epithete'] == 'agg.') {
699
				if ($nom['type_epithete'] == 'agg.') {
682
					$nom_sci_ideal = $this->formaterStyleNomGenre($nom['genre']);
700
					$nom_sci_ideal = $this->formaterStyleNomGenre($nom['genre']);
683
					$nom_sci_ideal .= ' '.$this->formaterStyleNomGenre($nom['epithete_infra_generique']);
701
					$nom_sci_ideal .= ' '.$this->formaterStyleNomGenre($nom['epithete_infra_generique']);
684
					$nom_sci_ideal .= ' '.$nom['type_epithete'];
702
					$nom_sci_ideal .= ' '.$nom['type_epithete'];
685
				} else {
703
				} else {
686
					$nom_sci_ideal = $this->formaterStyleNomGenre($nom['genre']);
704
					$nom_sci_ideal = $this->formaterStyleNomGenre($nom['genre']);
687
					$nom_sci_ideal .= ' '.$nom['type_epithete'];
705
					$nom_sci_ideal .= ' '.$nom['type_epithete'];
688
					$nom_sci_ideal .= ' '.$this->formaterStyleNomGenre($nom['epithete_infra_generique']);
706
					$nom_sci_ideal .= ' '.$this->formaterStyleNomGenre($nom['epithete_infra_generique']);
689
				}
707
				}
690
				$nom_sci_ideal .= ($suffixe_plte_cultivee != '' ? ' '.$suffixe_plte_cultivee : '');
708
				$nom_sci_ideal .= ($suffixe_plte_cultivee != '' ? ' '.$suffixe_plte_cultivee : '');
691
				if ($nom['nom_sci'] != $nom_sci_ideal) {
709
				if ($nom['nom_sci'] != $nom_sci_ideal) {
692
					$nom_sci_traite = $this->repererEspace($nom['nom_sci']);
710
					$nom_sci_traite = $this->repererEspace($nom['nom_sci']);
693
					$noms_erreur[] = array($nom['num_nom'], $nom_sci_traite, $nom_sci_ideal);
711
					$noms_erreur[] = array($nom['num_nom'], $nom_sci_traite, $nom_sci_ideal);
694
				}
712
				}
695
			}
713
			}
696
		}
714
		}
697
		
715
		
698
		// Analyse des résultats
716
		// Analyse des résultats
699
		if (count($noms_erreur) > 0) {
717
		if (count($noms_erreur) > 0) {
700
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'nom_sci corrigé');
718
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'nom_sci corrigé');
701
			$info['message']['lignes'] = $noms_erreur;
719
			$info['message']['lignes'] = $noms_erreur;
702
		} else {
720
		} else {
703
			$info['resultat'] = true;
721
			$info['resultat'] = true;
704
		}
722
		}
705
		$noms_erreur = null;
723
		$noms_erreur = null;
706
		
724
		
707
		$this->traiterResultatTest($info);
725
		$this->traiterResultatTest($info);
708
	}
726
	}
709
	
727
	
710
	/**
728
	/**
711
	 * Test #17
729
	 * Test #17
712
	 */
730
	 */
713
	private function testerNomCompletEspece() {
731
	private function testerNomCompletEspece() {
714
		$info = $this->getInfosTest(17);
732
		$info = $this->getInfosTest(17);
715
		$info['description'] = sprintf($info['description'], $this->manuel['rang_sp']);
733
		$info['description'] = sprintf($info['description'], $this->manuel['rang_sp']);
716
		
734
		
717
		// Réalisation du test
735
		// Réalisation du test
718
		$noms_erreur = array();
736
		$noms_erreur = array();
719
		foreach ($this->noms as &$nom) {
737
		foreach ($this->noms as &$nom) {
720
			if ($nom['rang'] == $this->manuel['rang_sp']) {
738
			if ($nom['rang'] == $this->manuel['rang_sp']) {
721
				$suffixe_plte_cultivee = $this->construireSuffixeNomPltCultivee($nom);
739
				$suffixe_plte_cultivee = $this->construireSuffixeNomPltCultivee($nom);
722
				$nom_sci_ideal = $this->formaterStyleNomGenre($nom['genre']);
740
				$nom_sci_ideal = $this->formaterStyleNomGenre($nom['genre']);
723
				$nom_sci_ideal .= ' '.strtolower($nom['epithete_sp']);
741
				$nom_sci_ideal .= ' '.strtolower($nom['epithete_sp']);
724
				$nom_sci_ideal .= ($suffixe_plte_cultivee != '' ? ' '.$suffixe_plte_cultivee : '');
742
				$nom_sci_ideal .= ($suffixe_plte_cultivee != '' ? ' '.$suffixe_plte_cultivee : '');
725
				if ($nom['nom_sci'] != $nom_sci_ideal) {
743
				if ($nom['nom_sci'] != $nom_sci_ideal) {
726
					$nom_sci_traite = $this->repererEspace($nom['nom_sci']);
744
					$nom_sci_traite = $this->repererEspace($nom['nom_sci']);
727
					$noms_erreur[] = array($nom['num_nom'], $nom_sci_traite, $nom_sci_ideal);
745
					$noms_erreur[] = array($nom['num_nom'], $nom_sci_traite, $nom_sci_ideal);
728
				}
746
				}
729
			}
747
			}
730
		}
748
		}
731
		
749
		
732
		// Analyse des résultats
750
		// Analyse des résultats
733
		if (count($noms_erreur) > 0) {
751
		if (count($noms_erreur) > 0) {
734
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'nom_sci corrigé');
752
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'nom_sci corrigé');
735
			$info['message']['lignes'] = $noms_erreur;
753
			$info['message']['lignes'] = $noms_erreur;
736
		} else {
754
		} else {
737
			$info['resultat'] = true;
755
			$info['resultat'] = true;
738
		}
756
		}
739
		$noms_erreur = null;
757
		$noms_erreur = null;
740
		
758
		
741
		$this->traiterResultatTest($info);
759
		$this->traiterResultatTest($info);
742
	}
760
	}
743
	
761
	
744
	/**
762
	/**
745
	 * Test #18
763
	 * Test #18
746
	 */
764
	 */
747
	private function testerNomCompletInfraSpecifique() {
765
	private function testerNomCompletInfraSpecifique() {
748
		$info = $this->getInfosTest(18);
766
		$info = $this->getInfosTest(18);
749
		$info['description'] = sprintf($info['description'], $this->manuel['rang_sp']);
767
		$info['description'] = sprintf($info['description'], $this->manuel['rang_sp']);
750
		
768
		
751
		// Réalisation du test
769
		// Réalisation du test
752
		$noms_erreur = array();
770
		$noms_erreur = array();
753
		foreach ($this->noms as &$nom) {
771
		foreach ($this->noms as &$nom) {
754
			if ($nom['rang'] > $this->manuel['rang_sp']) {
772
			if ($nom['rang'] > $this->manuel['rang_sp']) {
755
				$suffixe_plte_cultivee = $this->construireSuffixeNomPltCultivee($nom);
773
				$suffixe_plte_cultivee = $this->construireSuffixeNomPltCultivee($nom);
756
				$nom_sci_ideal = $this->formaterStyleNomGenre($nom['genre']);
774
				$nom_sci_ideal = $this->formaterStyleNomGenre($nom['genre']);
757
				$nom_sci_ideal .= ' '.strtolower($nom['epithete_sp']);
775
				$nom_sci_ideal .= ' '.strtolower($nom['epithete_sp']);
758
				$nom_sci_ideal .= ' '.strtolower($nom['type_epithete']);
776
				$nom_sci_ideal .= ' '.strtolower($nom['type_epithete']);
759
				$nom_sci_ideal .= ' '.strtolower($nom['epithete_infra_sp']);
777
				$nom_sci_ideal .= ' '.strtolower($nom['epithete_infra_sp']);
760
				$nom_sci_ideal .= ($suffixe_plte_cultivee != '' ? ' '.$suffixe_plte_cultivee : '');
778
				$nom_sci_ideal .= ($suffixe_plte_cultivee != '' ? ' '.$suffixe_plte_cultivee : '');
761
				if ($nom['nom_sci'] != $nom_sci_ideal) {
779
				if ($nom['nom_sci'] != $nom_sci_ideal) {
762
					$nom_sci_traite = $this->repererEspace($nom['nom_sci']);
780
					$nom_sci_traite = $this->repererEspace($nom['nom_sci']);
763
					$noms_erreur[] = array($nom['num_nom'], $nom_sci_traite, $nom_sci_ideal);
781
					$noms_erreur[] = array($nom['num_nom'], $nom_sci_traite, $nom_sci_ideal);
764
				}
782
				}
765
			}
783
			}
766
		}
784
		}
767
		
785
		
768
		// Analyse des résultats
786
		// Analyse des résultats
769
		if (count($noms_erreur) > 0) {
787
		if (count($noms_erreur) > 0) {
770
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'nom_sci corrigé');
788
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'nom_sci corrigé');
771
			$info['message']['lignes'] = $noms_erreur;
789
			$info['message']['lignes'] = $noms_erreur;
772
		} else {
790
		} else {
773
			$info['resultat'] = true;
791
			$info['resultat'] = true;
774
		}
792
		}
775
		$noms_erreur = null;
793
		$noms_erreur = null;
776
		
794
		
777
		$this->traiterResultatTest($info);
795
		$this->traiterResultatTest($info);
778
	}
796
	}
779
	
797
	
780
	/**
798
	/**
781
	 * Test #19
799
	 * Test #19
782
	 */
800
	 */
783
	private function testerNomSupraGeneriqueEspaces() {
801
	private function testerNomSupraGeneriqueEspaces() {
784
		$info = $this->getInfosTest(19);
802
		$info = $this->getInfosTest(19);
785
		
803
		
786
		// Réalisation du test
804
		// Réalisation du test
787
		$noms_erreur = array();
805
		$noms_erreur = array();
788
		foreach ($this->noms as &$nom) {
806
		foreach ($this->noms as &$nom) {
789
			if ($nom['nom_supra_generique'] != '') {
807
			if ($nom['nom_supra_generique'] != '') {
790
				if (preg_match('/(?:^\s+(?!:\s+)|(?!:\s+)\s+$)/', $nom['nom_supra_generique'])) {
808
				if (preg_match('/(?:^\s+(?!:\s+)|(?!:\s+)\s+$)/', $nom['nom_supra_generique'])) {
791
					$nom_supra_generique_traite = $this->repererEspace($nom['nom_supra_generique']);
809
					$nom_supra_generique_traite = $this->repererEspace($nom['nom_supra_generique']);
792
					$noms_erreur[] = array($nom['num_nom'], $nom_supra_generique_traite);
810
					$noms_erreur[] = array($nom['num_nom'], $nom_supra_generique_traite);
793
				}
811
				}
794
			}
812
			}
795
		}
813
		}
796
		
814
		
797
		// Analyse des résultats
815
		// Analyse des résultats
798
		if (count($noms_erreur) > 0) {
816
		if (count($noms_erreur) > 0) {
799
			$info['message']['entete'] = array('num_nom', 'nom_supra_generique erroné');
817
			$info['message']['entete'] = array('num_nom', 'nom_supra_generique erroné');
800
			$info['message']['lignes'] = $noms_erreur;
818
			$info['message']['lignes'] = $noms_erreur;
801
		} else {
819
		} else {
802
			$info['resultat'] = true;
820
			$info['resultat'] = true;
803
		}
821
		}
804
		$noms_erreur = null;
822
		$noms_erreur = null;
805
		
823
		
806
		$this->traiterResultatTest($info);
824
		$this->traiterResultatTest($info);
807
	}
825
	}
808
	
826
	
809
	/**
827
	/**
810
	 * Test #20
828
	 * Test #20
811
	 */
829
	 */
812
	private function testerNomSupraGeneriqueSyntaxe() {
830
	private function testerNomSupraGeneriqueSyntaxe() {
813
		$info = $this->getInfosTest(20);
831
		$info = $this->getInfosTest(20);
814
		
832
		
815
		// Réalisation du test
833
		// Réalisation du test
816
		$noms_erreur = array();
834
		$noms_erreur = array();
817
		foreach ($this->noms as &$nom) {
835
		foreach ($this->noms as &$nom) {
818
			if ($nom['nom_supra_generique'] != '') {
836
			if ($nom['nom_supra_generique'] != '') {
819
				if (!preg_match('/^[A-ZÄËḦÏÖÜẄẌŸ][-a-zäëḧïöẗüẅẍÿ]+$/', $nom['nom_supra_generique'])) {
837
				if (!preg_match('/^[A-ZÄËḦÏÖÜẄẌŸ][-a-zäëḧïöẗüẅẍÿ]+$/', $nom['nom_supra_generique'])) {
820
					$nom_supra_generique_traite = $this->repererEspace($nom['nom_supra_generique']);
838
					$nom_supra_generique_traite = $this->repererEspace($nom['nom_supra_generique']);
821
					$noms_erreur[] = array($nom['num_nom'], $nom_supra_generique_traite);
839
					$noms_erreur[] = array($nom['num_nom'], $nom_supra_generique_traite);
822
				}
840
				}
823
			}
841
			}
824
		}
842
		}
825
		
843
		
826
		// Analyse des résultats
844
		// Analyse des résultats
827
		if (count($noms_erreur) > 0) {
845
		if (count($noms_erreur) > 0) {
828
			$info['message']['entete'] = array('num_nom', 'nom_supra_generique erroné');
846
			$info['message']['entete'] = array('num_nom', 'nom_supra_generique erroné');
829
			$info['message']['lignes'] = $noms_erreur;
847
			$info['message']['lignes'] = $noms_erreur;
830
		} else {
848
		} else {
831
			$info['resultat'] = true;
849
			$info['resultat'] = true;
832
		}
850
		}
833
		$noms_erreur = null;
851
		$noms_erreur = null;
834
		
852
		
835
		$this->traiterResultatTest($info);
853
		$this->traiterResultatTest($info);
836
	}
854
	}
837
	
855
	
838
	/**
856
	/**
839
	 * Test #21
857
	 * Test #21
840
	 */
858
	 */
841
	private function testerNomSupraGeneriqueRang() {
859
	private function testerNomSupraGeneriqueRang() {
842
		$info = $this->getInfosTest(21);
860
		$info = $this->getInfosTest(21);
843
		$info['nom'] = sprintf($info['nom'], $this->manuel['rang_genre']);
861
		$info['nom'] = sprintf($info['nom'], $this->manuel['rang_genre']);
844
		$info['description'] = sprintf($info['description'], $this->manuel['rang_genre']);
862
		$info['description'] = sprintf($info['description'], $this->manuel['rang_genre']);
845
		
863
		
846
		// Réalisation du test
864
		// Réalisation du test
847
		$noms_erreur = array();
865
		$noms_erreur = array();
848
		foreach ($this->noms as &$nom) {
866
		foreach ($this->noms as &$nom) {
849
			if ($nom['nom_supra_generique'] != '') {
867
			if ($nom['nom_supra_generique'] != '') {
850
				if ($nom['rang'] >= $this->manuel['rang_genre']) {
868
				if ($nom['rang'] >= $this->manuel['rang_genre']) {
851
					$noms_erreur[] = array($nom['num_nom'], $nom['nom_sci'], $nom['rang']);
869
					$noms_erreur[] = array($nom['num_nom'], $nom['nom_sci'], $nom['rang']);
852
				}
870
				}
853
			}
871
			}
854
		}
872
		}
855
		
873
		
856
		// Analyse des résultats
874
		// Analyse des résultats
857
		if (count($noms_erreur) > 0) {
875
		if (count($noms_erreur) > 0) {
858
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'rang erroné');
876
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'rang erroné');
859
			$info['message']['lignes'] = $noms_erreur;
877
			$info['message']['lignes'] = $noms_erreur;
860
		} else {
878
		} else {
861
			$info['resultat'] = true;
879
			$info['resultat'] = true;
862
		}
880
		}
863
		$noms_erreur = null;
881
		$noms_erreur = null;
864
		
882
		
865
		$this->traiterResultatTest($info);
883
		$this->traiterResultatTest($info);
866
	}
884
	}
867
	
885
	
868
	/**
886
	/**
869
	 * Test #22
887
	 * Test #22
870
	 */
888
	 */
871
	private function testerGenreEspaces() {
889
	private function testerGenreEspaces() {
872
		$info = $this->getInfosTest(22);
890
		$info = $this->getInfosTest(22);
873
		
891
		
874
		// Réalisation du test
892
		// Réalisation du test
875
		$noms_erreur = array();
893
		$noms_erreur = array();
876
		foreach ($this->noms as &$nom) {
894
		foreach ($this->noms as &$nom) {
877
			if ($nom['genre'] != '') {
895
			if ($nom['genre'] != '') {
878
				if (preg_match('/(?:^\s+(?!:\s+)|(?!:\s+)\s{2,}(?!:\s+)|(?!:\s+)\s+$)/', $nom['genre'])) {
896
				if (preg_match('/(?:^\s+(?!:\s+)|(?!:\s+)\s{2,}(?!:\s+)|(?!:\s+)\s+$)/', $nom['genre'])) {
879
					$nom_traite = $this->repererEspace($nom['genre']);
897
					$nom_traite = $this->repererEspace($nom['genre']);
880
					$noms_erreur[] = array($nom['num_nom'], $nom_traite);
898
					$noms_erreur[] = array($nom['num_nom'], $nom_traite);
881
				}
899
				}
882
			}
900
			}
883
		}
901
		}
884
		
902
		
885
		// Analyse des résultats
903
		// Analyse des résultats
886
		if (count($noms_erreur) > 0) {
904
		if (count($noms_erreur) > 0) {
887
			$info['message']['entete'] = array('num_nom', 'genre erroné');
905
			$info['message']['entete'] = array('num_nom', 'genre erroné');
888
			$info['message']['lignes'] = $noms_erreur;
906
			$info['message']['lignes'] = $noms_erreur;
889
		} else {
907
		} else {
890
			$info['resultat'] = true;
908
			$info['resultat'] = true;
891
		}
909
		}
892
		$noms_erreur = null;
910
		$noms_erreur = null;
893
		
911
		
894
		$this->traiterResultatTest($info);
912
		$this->traiterResultatTest($info);
895
	}
913
	}
896
	
914
	
897
	/**
915
	/**
898
	 * Test #23
916
	 * Test #23
899
	 */
917
	 */
900
	private function testerGenreSyntaxe() {
918
	private function testerGenreSyntaxe() {
901
		$info = $this->getInfosTest(23);
919
		$info = $this->getInfosTest(23);
902
		
920
		
903
		// Réalisation du test
921
		// Réalisation du test
904
		$noms_erreur = array();
922
		$noms_erreur = array();
905
		foreach ($this->noms as &$nom) {
923
		foreach ($this->noms as &$nom) {
906
			if ($nom['genre'] != '') {
924
			if ($nom['genre'] != '') {
907
				$mots = explode(' ', $nom['genre']);
925
				$mots = explode(' ', $nom['genre']);
908
				foreach ($mots as $mot) {
926
				foreach ($mots as $mot) {
909
					if (!(preg_match('/^[+x]$/', $mot) || $this->verifierEpitheteGenre($mot))) {
927
					if (!(preg_match('/^[+x]$/', $mot) || $this->verifierEpitheteGenre($mot))) {
910
						$nom_traite = $this->repererEspace($nom['genre']);
928
						$nom_traite = $this->repererEspace($nom['genre']);
911
						$noms_erreur[] = array($nom['num_nom'], $nom_traite);
929
						$noms_erreur[] = array($nom['num_nom'], $nom_traite);
912
					}
930
					}
913
				}
931
				}
914
			}
932
			}
915
		}
933
		}
916
		
934
		
917
		// Analyse des résultats
935
		// Analyse des résultats
918
		if (count($noms_erreur) > 0) {
936
		if (count($noms_erreur) > 0) {
919
			$info['message']['entete'] = array('num_nom', 'genre erroné');
937
			$info['message']['entete'] = array('num_nom', 'genre erroné');
920
			$info['message']['lignes'] = $noms_erreur;
938
			$info['message']['lignes'] = $noms_erreur;
921
		} else {
939
		} else {
922
			$info['resultat'] = true;
940
			$info['resultat'] = true;
923
		}
941
		}
924
		$noms_erreur = null;
942
		$noms_erreur = null;
925
		
943
		
926
		$this->traiterResultatTest($info);
944
		$this->traiterResultatTest($info);
927
	}
945
	}
928
	
946
	
929
	/**
947
	/**
930
	 * Test #24
948
	 * Test #24
931
	 */
949
	 */
932
	private function testerGenreRang() {
950
	private function testerGenreRang() {
933
		$info = $this->getInfosTest(24);
951
		$info = $this->getInfosTest(24);
934
		$info['nom'] = sprintf($info['nom'], $this->manuel['rang_genre']);
952
		$info['nom'] = sprintf($info['nom'], $this->manuel['rang_genre']);
935
		$info['description'] = sprintf($info['description'], $this->manuel['rang_genre']);
953
		$info['description'] = sprintf($info['description'], $this->manuel['rang_genre']);
936
		
954
		
937
		// Réalisation du test
955
		// Réalisation du test
938
		$noms_erreur = array();
956
		$noms_erreur = array();
939
		foreach ($this->noms as &$nom) {
957
		foreach ($this->noms as &$nom) {
940
			if ($nom['genre'] != '') {
958
			if ($nom['genre'] != '') {
941
				if ($nom['rang'] < $this->manuel['rang_genre']) {
959
				if ($nom['rang'] < $this->manuel['rang_genre']) {
942
					$noms_erreur[] = array($nom['num_nom'], $nom['nom_sci'], $nom['rang']);
960
					$noms_erreur[] = array($nom['num_nom'], $nom['nom_sci'], $nom['rang']);
943
				}
961
				}
944
			}
962
			}
945
		}
963
		}
946
		
964
		
947
		// Analyse des résultats
965
		// Analyse des résultats
948
		if (count($noms_erreur) > 0) {
966
		if (count($noms_erreur) > 0) {
949
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'rang erroné');
967
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'rang erroné');
950
			$info['message']['lignes'] = $noms_erreur;
968
			$info['message']['lignes'] = $noms_erreur;
951
		} else {
969
		} else {
952
			$info['resultat'] = true;
970
			$info['resultat'] = true;
953
		}
971
		}
954
		$noms_erreur = null;
972
		$noms_erreur = null;
955
		
973
		
956
		$this->traiterResultatTest($info);
974
		$this->traiterResultatTest($info);
957
	}
975
	}
958
		
976
		
959
	/**
977
	/**
960
	 * Test #25
978
	 * Test #25
961
	 */
979
	 */
962
	private function testerEpitheteInfraGeneriqueSyntaxe() {
980
	private function testerEpitheteInfraGeneriqueSyntaxe() {
963
		$info = $this->getInfosTest(25);
981
		$info = $this->getInfosTest(25);
964
		
982
		
965
		// Réalisation du test
983
		// Réalisation du test
966
		$noms_erreur = array();
984
		$noms_erreur = array();
967
		foreach ($this->noms as &$nom) {
985
		foreach ($this->noms as &$nom) {
968
			if ($nom['epithete_infra_generique'] != '') {
986
			if ($nom['epithete_infra_generique'] != '') {
969
				if (!preg_match('/^[A-ZÄËḦÏÖÜẄẌŸ][-a-zäëḧïöẗüẅẍÿ]+/', $nom['epithete_infra_generique'])) {
987
				if (!preg_match('/^[A-ZÄËḦÏÖÜẄẌŸ][-a-zäëḧïöẗüẅẍÿ]+/', $nom['epithete_infra_generique'])) {
970
					$epithete_traite = $this->repererEspace($nom['epithete_infra_generique']);
988
					$epithete_traite = $this->repererEspace($nom['epithete_infra_generique']);
971
					$noms_erreur[] = array($nom['num_nom'], $epithete_traite);
989
					$noms_erreur[] = array($nom['num_nom'], $epithete_traite);
972
				}
990
				}
973
			}
991
			}
974
		}
992
		}
975
		
993
		
976
		// Analyse des résultats
994
		// Analyse des résultats
977
		if (count($noms_erreur) > 0) {
995
		if (count($noms_erreur) > 0) {
978
			$info['message']['entete'] = array('num_nom', 'epithete_infra_generique erroné');
996
			$info['message']['entete'] = array('num_nom', 'epithete_infra_generique erroné');
979
			$info['message']['lignes'] = $noms_erreur;
997
			$info['message']['lignes'] = $noms_erreur;
980
		} else {
998
		} else {
981
			$info['resultat'] = true;
999
			$info['resultat'] = true;
982
		}
1000
		}
983
		$noms_erreur = null;
1001
		$noms_erreur = null;
984
		
1002
		
985
		$this->traiterResultatTest($info);
1003
		$this->traiterResultatTest($info);
986
	}
1004
	}
987
	
1005
	
988
	/**
1006
	/**
989
	 * Test #26
1007
	 * Test #26
990
	 */
1008
	 */
991
	private function testerEpitheteInfraGeneriqueRang() {
1009
	private function testerEpitheteInfraGeneriqueRang() {
992
		$info = $this->getInfosTest(26);
1010
		$info = $this->getInfosTest(26);
993
		$info['nom'] = sprintf($info['nom'], $this->manuel['rang_genre'], $this->manuel['rang_sp']);
1011
		$info['nom'] = sprintf($info['nom'], $this->manuel['rang_genre'], $this->manuel['rang_sp']);
994
		$info['description'] = sprintf($info['description'], $this->manuel['rang_genre'], $this->manuel['rang_sp']);
1012
		$info['description'] = sprintf($info['description'], $this->manuel['rang_genre'], $this->manuel['rang_sp']);
995
		
1013
		
996
		// Réalisation du test
1014
		// Réalisation du test
997
		$noms_erreur = array();
1015
		$noms_erreur = array();
998
		foreach ($this->noms as &$nom) {
1016
		foreach ($this->noms as &$nom) {
999
			if ($nom['epithete_infra_generique'] != '') {
1017
			if ($nom['epithete_infra_generique'] != '') {
1000
				if ($nom['rang'] <= $this->manuel['rang_genre'] || $nom['rang'] >= $this->manuel['rang_sp']) {
1018
				if ($nom['rang'] <= $this->manuel['rang_genre'] || $nom['rang'] >= $this->manuel['rang_sp']) {
1001
					$noms_erreur[] = array($nom['num_nom'], $nom['nom_sci'], $nom['rang']);
1019
					$noms_erreur[] = array($nom['num_nom'], $nom['nom_sci'], $nom['rang']);
1002
				}
1020
				}
1003
			}
1021
			}
1004
		}
1022
		}
1005
		
1023
		
1006
		// Analyse des résultats
1024
		// Analyse des résultats
1007
		if (count($noms_erreur) > 0) {
1025
		if (count($noms_erreur) > 0) {
1008
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'rang erroné');
1026
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'rang erroné');
1009
			$info['message']['lignes'] = $noms_erreur;
1027
			$info['message']['lignes'] = $noms_erreur;
1010
		} else {
1028
		} else {
1011
			$info['resultat'] = true;
1029
			$info['resultat'] = true;
1012
		}
1030
		}
1013
		$noms_erreur = null;
1031
		$noms_erreur = null;
1014
		
1032
		
1015
		$this->traiterResultatTest($info);
1033
		$this->traiterResultatTest($info);
1016
	}
1034
	}
1017
	
1035
	
1018
	/**
1036
	/**
1019
	 * Test #27
1037
	 * Test #27
1020
	 */
1038
	 */
1021
	private function testerEpitheteInfraGeneriqueEspaces() {
1039
	private function testerEpitheteInfraGeneriqueEspaces() {
1022
		$info = $this->getInfosTest(27);
1040
		$info = $this->getInfosTest(27);
1023
		
1041
		
1024
		// Réalisation du test
1042
		// Réalisation du test
1025
		$noms_erreur = array();
1043
		$noms_erreur = array();
1026
		foreach ($this->noms as &$nom) {
1044
		foreach ($this->noms as &$nom) {
1027
			if ($nom['epithete_infra_generique'] != '') {
1045
			if ($nom['epithete_infra_generique'] != '') {
1028
				if (preg_match('/(?:^\s+(?!:\s+)|(?!:\s+)\s{2,}(?!:\s+)|(?!:\s+)\s+$)/', $nom['epithete_infra_generique'])) {
1046
				if (preg_match('/(?:^\s+(?!:\s+)|(?!:\s+)\s{2,}(?!:\s+)|(?!:\s+)\s+$)/', $nom['epithete_infra_generique'])) {
1029
					$epithete_traite = $this->repererEspace($nom['epithete_infra_generique']);
1047
					$epithete_traite = $this->repererEspace($nom['epithete_infra_generique']);
1030
					$noms_erreur[] = array($nom['num_nom'], $epithete_traite);
1048
					$noms_erreur[] = array($nom['num_nom'], $epithete_traite);
1031
				}
1049
				}
1032
			}
1050
			}
1033
		}
1051
		}
1034
		
1052
		
1035
		// Analyse des résultats
1053
		// Analyse des résultats
1036
		if (count($noms_erreur) > 0) {
1054
		if (count($noms_erreur) > 0) {
1037
			$info['message']['entete'] = array('num_nom', 'epithete_infra_generique erroné');
1055
			$info['message']['entete'] = array('num_nom', 'epithete_infra_generique erroné');
1038
			$info['message']['lignes'] = $noms_erreur;
1056
			$info['message']['lignes'] = $noms_erreur;
1039
		} else {
1057
		} else {
1040
			$info['resultat'] = true;
1058
			$info['resultat'] = true;
1041
		}
1059
		}
1042
		$noms_erreur = null;
1060
		$noms_erreur = null;
1043
		
1061
		
1044
		$this->traiterResultatTest($info);
1062
		$this->traiterResultatTest($info);
1045
	}
1063
	}
1046
	
1064
	
1047
	/**
1065
	/**
1048
	 * Test #28
1066
	 * Test #28
1049
	 */
1067
	 */
1050
	private function testerEpitheteSpEspaces() {
1068
	private function testerEpitheteSpEspaces() {
1051
		$info = $this->getInfosTest(28);
1069
		$info = $this->getInfosTest(28);
1052
		
1070
		
1053
		// Réalisation du test
1071
		// Réalisation du test
1054
		$noms_erreur = array();
1072
		$noms_erreur = array();
1055
		foreach ($this->noms as &$nom) {
1073
		foreach ($this->noms as &$nom) {
1056
			if ($nom['epithete_sp'] != '') {
1074
			if ($nom['epithete_sp'] != '') {
1057
				if (preg_match('/(?:^\s+(?!:\s+)|(?!:\s+)\s{2,}(?!:\s+)|(?!:\s+)\s+$)/', $nom['epithete_sp'])) {
1075
				if (preg_match('/(?:^\s+(?!:\s+)|(?!:\s+)\s{2,}(?!:\s+)|(?!:\s+)\s+$)/', $nom['epithete_sp'])) {
1058
					$epithete_traite = $this->repererEspace($nom['epithete_sp']);
1076
					$epithete_traite = $this->repererEspace($nom['epithete_sp']);
1059
					$noms_erreur[] = array($nom['num_nom'], $epithete_traite);
1077
					$noms_erreur[] = array($nom['num_nom'], $epithete_traite);
1060
				}
1078
				}
1061
			}
1079
			}
1062
		}
1080
		}
1063
		
1081
		
1064
		// Analyse des résultats
1082
		// Analyse des résultats
1065
		if (count($noms_erreur) > 0) {
1083
		if (count($noms_erreur) > 0) {
1066
			$info['message']['entete'] = array('num_nom', 'epithete_sp erroné');
1084
			$info['message']['entete'] = array('num_nom', 'epithete_sp erroné');
1067
			$info['message']['lignes'] = $noms_erreur;
1085
			$info['message']['lignes'] = $noms_erreur;
1068
		} else {
1086
		} else {
1069
			$info['resultat'] = true;
1087
			$info['resultat'] = true;
1070
		}
1088
		}
1071
		$noms_erreur = null;
1089
		$noms_erreur = null;
1072
		
1090
		
1073
		$this->traiterResultatTest($info);
1091
		$this->traiterResultatTest($info);
1074
	}
1092
	}
1075
	
1093
	
1076
	/**
1094
	/**
1077
	 * Test #29
1095
	 * Test #29
1078
	 */
1096
	 */
1079
	private function testerEpitheteSpSyntaxe() {
1097
	private function testerEpitheteSpSyntaxe() {
1080
		$info = $this->getInfosTest(29);
1098
		$info = $this->getInfosTest(29);
1081
		
1099
		
1082
		// Réalisation du test
1100
		// Réalisation du test
1083
		$noms_erreur = array();
1101
		$noms_erreur = array();
1084
		foreach ($this->noms as &$nom) {
1102
		foreach ($this->noms as &$nom) {
1085
			if ($nom['epithete_sp'] != '') {
1103
			if ($nom['epithete_sp'] != '') {
1086
				$mots = explode(' ', $nom['epithete_sp']);
1104
				$mots = explode(' ', $nom['epithete_sp']);
1087
				foreach ($mots as $mot) {
1105
				foreach ($mots as $mot) {
1088
					if (!(preg_match('/^[+x]$/', $mot) || $this->verifierEpitheteSp($mot))) {
1106
					if (!(preg_match('/^[+x]$/', $mot) || $this->verifierEpitheteSp($mot))) {
1089
						$epithete_traite = $this->repererEspace($nom['epithete_sp']);
1107
						$epithete_traite = $this->repererEspace($nom['epithete_sp']);
1090
						$noms_erreur[] = array($nom['num_nom'], $epithete_traite);
1108
						$noms_erreur[] = array($nom['num_nom'], $epithete_traite);
1091
					}
1109
					}
1092
				}
1110
				}
1093
			}
1111
			}
1094
		}
1112
		}
1095
		
1113
		
1096
		// Analyse des résultats
1114
		// Analyse des résultats
1097
		if (count($noms_erreur) > 0) {
1115
		if (count($noms_erreur) > 0) {
1098
			$info['message']['entete'] = array('num_nom', 'epithete_sp erroné');
1116
			$info['message']['entete'] = array('num_nom', 'epithete_sp erroné');
1099
			$info['message']['lignes'] = $noms_erreur;
1117
			$info['message']['lignes'] = $noms_erreur;
1100
		} else {
1118
		} else {
1101
			$info['resultat'] = true;
1119
			$info['resultat'] = true;
1102
		}
1120
		}
1103
		$noms_erreur = null;
1121
		$noms_erreur = null;
1104
		
1122
		
1105
		$this->traiterResultatTest($info);
1123
		$this->traiterResultatTest($info);
1106
	}
1124
	}
1107
	
1125
	
1108
	/**
1126
	/**
1109
	 * Test #30
1127
	 * Test #30
1110
	 */
1128
	 */
1111
	private function testerEpitheteSpRang() {
1129
	private function testerEpitheteSpRang() {
1112
		$info = $this->getInfosTest(30);
1130
		$info = $this->getInfosTest(30);
1113
		$info['nom'] = sprintf($info['nom'], $this->manuel['rang_sp']);
1131
		$info['nom'] = sprintf($info['nom'], $this->manuel['rang_sp']);
1114
		$info['description'] = sprintf($info['description'], $this->manuel['rang_sp']);
1132
		$info['description'] = sprintf($info['description'], $this->manuel['rang_sp']);
1115
		
1133
		
1116
		// Réalisation du test
1134
		// Réalisation du test
1117
		$noms_erreur = array();
1135
		$noms_erreur = array();
1118
		foreach ($this->noms as &$nom) {
1136
		foreach ($this->noms as &$nom) {
1119
			if ($nom['epithete_sp'] != '') {
1137
			if ($nom['epithete_sp'] != '') {
1120
				if ($nom['rang'] < $this->manuel['rang_sp']) {
1138
				if ($nom['rang'] < $this->manuel['rang_sp']) {
1121
					$noms_erreur[] = array($nom['num_nom'], $nom['nom_sci'], $nom['rang']);
1139
					$noms_erreur[] = array($nom['num_nom'], $nom['nom_sci'], $nom['rang']);
1122
				}
1140
				}
1123
			}
1141
			}
1124
		}
1142
		}
1125
		
1143
		
1126
		// Analyse des résultats
1144
		// Analyse des résultats
1127
		if (count($noms_erreur) > 0) {
1145
		if (count($noms_erreur) > 0) {
1128
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'rang erroné');
1146
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'rang erroné');
1129
			$info['message']['lignes'] = $noms_erreur;
1147
			$info['message']['lignes'] = $noms_erreur;
1130
		} else {
1148
		} else {
1131
			$info['resultat'] = true;
1149
			$info['resultat'] = true;
1132
		}
1150
		}
1133
		$noms_erreur = null;
1151
		$noms_erreur = null;
1134
		
1152
		
1135
		$this->traiterResultatTest($info);
1153
		$this->traiterResultatTest($info);
1136
	}
1154
	}
1137
	
1155
	
1138
	/**
1156
	/**
1139
	 * Test #31
1157
	 * Test #31
1140
	 */
1158
	 */
1141
	private function testerTypeEpitheteEspaces() {
1159
	private function testerTypeEpitheteEspaces() {
1142
		$info = $this->getInfosTest(31);
1160
		$info = $this->getInfosTest(31);
1143
		
1161
		
1144
		// Réalisation du test
1162
		// Réalisation du test
1145
		$noms_erreur = array();
1163
		$noms_erreur = array();
1146
		foreach ($this->noms as &$nom) {
1164
		foreach ($this->noms as &$nom) {
1147
			if ($nom['type_epithete'] != '') {
1165
			if ($nom['type_epithete'] != '') {
1148
				if (preg_match('/\s+/', $nom['type_epithete'])) {
1166
				if (preg_match('/\s+/', $nom['type_epithete'])) {
1149
					$valeur_traitee = $this->repererEspace($nom['epithete_sp']);
1167
					$valeur_traitee = $this->repererEspace($nom['epithete_sp']);
1150
					$noms_erreur[] = array($nom['num_nom'], $valeur_traitee);
1168
					$noms_erreur[] = array($nom['num_nom'], $valeur_traitee);
1151
				}
1169
				}
1152
			}
1170
			}
1153
		}
1171
		}
1154
		
1172
		
1155
		// Analyse des résultats
1173
		// Analyse des résultats
1156
		if (count($noms_erreur) > 0) {
1174
		if (count($noms_erreur) > 0) {
1157
			$info['message']['entete'] = array('num_nom', 'type_epithete erroné');
1175
			$info['message']['entete'] = array('num_nom', 'type_epithete erroné');
1158
			$info['message']['lignes'] = $noms_erreur;
1176
			$info['message']['lignes'] = $noms_erreur;
1159
		} else {
1177
		} else {
1160
			$info['resultat'] = true;
1178
			$info['resultat'] = true;
1161
		}
1179
		}
1162
		
1180
		
1163
		$this->traiterResultatTest($info);
1181
		$this->traiterResultatTest($info);
1164
	}
1182
	}
1165
	
1183
	
1166
	/**
1184
	/**
1167
	 * Test #32
1185
	 * Test #32
1168
	 */
1186
	 */
1169
	private function testerTypeEpitheteSyntaxe() {
1187
	private function testerTypeEpitheteSyntaxe() {
1170
		$info = $this->getInfosTest(32);
1188
		$info = $this->getInfosTest(32);
1171
		
1189
		
1172
		// Réalisation du test
1190
		// Réalisation du test
1173
		$noms_erreur = array();
1191
		$noms_erreur = array();
1174
		foreach ($this->noms as &$nom) {
1192
		foreach ($this->noms as &$nom) {
1175
			if ($nom['type_epithete'] != '') {
1193
			if ($nom['type_epithete'] != '') {
1176
				if (!$this->verifierTypeEpithete($nom['type_epithete'])) {
1194
				if (!$this->verifierTypeEpithete($nom['type_epithete'])) {
1177
					$noms_erreur[] = array($nom['num_nom'],  $nom['type_epithete']);
1195
					$noms_erreur[] = array($nom['num_nom'],  $nom['type_epithete']);
1178
				}
1196
				}
1179
			}
1197
			}
1180
		}
1198
		}
1181
		
1199
		
1182
		// Analyse des résultats
1200
		// Analyse des résultats
1183
		if (count($noms_erreur) > 0) {
1201
		if (count($noms_erreur) > 0) {
1184
			$info['message']['entete'] = array('num_nom', 'type_epithete erroné');
1202
			$info['message']['entete'] = array('num_nom', 'type_epithete erroné');
1185
			$info['message']['lignes'] = $noms_erreur;
1203
			$info['message']['lignes'] = $noms_erreur;
1186
		} else {
1204
		} else {
1187
			$info['resultat'] = true;
1205
			$info['resultat'] = true;
1188
		}
1206
		}
1189
		
1207
		
1190
		$this->traiterResultatTest($info);
1208
		$this->traiterResultatTest($info);
1191
	}
1209
	}
1192
	
1210
	
1193
	/**
1211
	/**
1194
	 * Test #33
1212
	 * Test #33
1195
	 */
1213
	 */
1196
	private function testerTypeEpitheteHybridite() {
1214
	private function testerTypeEpitheteHybridite() {
1197
		$info = $this->getInfosTest(33);
1215
		$info = $this->getInfosTest(33);
1198
		
1216
		
1199
		// Réalisation du test
1217
		// Réalisation du test
1200
		$noms_erreur = array();
1218
		$noms_erreur = array();
1201
		foreach ($this->noms as &$nom) {
1219
		foreach ($this->noms as &$nom) {
1202
			if ($nom['type_epithete'] != '') {
1220
			if ($nom['type_epithete'] != '') {
1203
				if (preg_match('/^(?:n-|notho-)/', $nom['type_epithete'])) {
1221
				if (preg_match('/^(?:n-|notho-)/', $nom['type_epithete'])) {
1204
					$noms_erreur[] = array($nom['num_nom'], $nom['type_epithete']);
1222
					$noms_erreur[] = array($nom['num_nom'], $nom['type_epithete']);
1205
				}
1223
				}
1206
			}
1224
			}
1207
		}
1225
		}
1208
		
1226
		
1209
		// Analyse des résultats
1227
		// Analyse des résultats
1210
		if (count($noms_erreur) > 0) {
1228
		if (count($noms_erreur) > 0) {
1211
			$info['message']['entete'] = array('num_nom', 'type_epithete erroné');
1229
			$info['message']['entete'] = array('num_nom', 'type_epithete erroné');
1212
			$info['message']['lignes'] = $noms_erreur;
1230
			$info['message']['lignes'] = $noms_erreur;
1213
		} else {
1231
		} else {
1214
			$info['resultat'] = true;
1232
			$info['resultat'] = true;
1215
		}
1233
		}
1216
		
1234
		
1217
		$this->traiterResultatTest($info);
1235
		$this->traiterResultatTest($info);
1218
	}
1236
	}
1219
	
1237
	
1220
	/**
1238
	/**
1221
	 * Test #34
1239
	 * Test #34
1222
	 */
1240
	 */
1223
	private function testerEpitheteInfraSpEspaces() {
1241
	private function testerEpitheteInfraSpEspaces() {
1224
		$info = $this->getInfosTest(34);
1242
		$info = $this->getInfosTest(34);
1225
		
1243
		
1226
		// Réalisation du test
1244
		// Réalisation du test
1227
		$noms_erreur = array();
1245
		$noms_erreur = array();
1228
		foreach ($this->noms as &$nom) {
1246
		foreach ($this->noms as &$nom) {
1229
			if ($nom['epithete_infra_sp'] != '') {
1247
			if ($nom['epithete_infra_sp'] != '') {
1230
				if (preg_match('/(?:^\s+(?!:\s+)|(?!:\s+)\s{2,}(?!:\s+)|(?!:\s+)\s+$)/', $nom['epithete_infra_sp'])) {
1248
				if (preg_match('/(?:^\s+(?!:\s+)|(?!:\s+)\s{2,}(?!:\s+)|(?!:\s+)\s+$)/', $nom['epithete_infra_sp'])) {
1231
					$epithete_traite = $this->repererEspace($nom['epithete_infra_sp']);
1249
					$epithete_traite = $this->repererEspace($nom['epithete_infra_sp']);
1232
					$noms_erreur[] = array($nom['num_nom'], $epithete_traite);
1250
					$noms_erreur[] = array($nom['num_nom'], $epithete_traite);
1233
				}
1251
				}
1234
			}
1252
			}
1235
		}
1253
		}
1236
		
1254
		
1237
		// Analyse des résultats
1255
		// Analyse des résultats
1238
		if (count($noms_erreur) > 0) {
1256
		if (count($noms_erreur) > 0) {
1239
			$info['message']['entete'] = array('num_nom', 'epithete_infra_sp erroné');
1257
			$info['message']['entete'] = array('num_nom', 'epithete_infra_sp erroné');
1240
			$info['message']['lignes'] = $noms_erreur;
1258
			$info['message']['lignes'] = $noms_erreur;
1241
		} else {
1259
		} else {
1242
			$info['resultat'] = true;
1260
			$info['resultat'] = true;
1243
		}
1261
		}
1244
		$noms_erreur = null;
1262
		$noms_erreur = null;
1245
		
1263
		
1246
		$this->traiterResultatTest($info);
1264
		$this->traiterResultatTest($info);
1247
	}
1265
	}
1248
	
1266
	
1249
	/**
1267
	/**
1250
	 * Test #35
1268
	 * Test #35
1251
	 */
1269
	 */
1252
	private function testerEpitheteInfraSpSyntaxe() {
1270
	private function testerEpitheteInfraSpSyntaxe() {
1253
		$info = $this->getInfosTest(35);
1271
		$info = $this->getInfosTest(35);
1254
		
1272
		
1255
		// Réalisation du test
1273
		// Réalisation du test
1256
		$noms_erreur = array();
1274
		$noms_erreur = array();
1257
		foreach ($this->noms as &$nom) {
1275
		foreach ($this->noms as &$nom) {
1258
			if ($nom['epithete_infra_sp'] != '') {
1276
			if ($nom['epithete_infra_sp'] != '') {
1259
				$mots = explode(' ', $nom['epithete_infra_sp']);
1277
				$mots = explode(' ', $nom['epithete_infra_sp']);
1260
				foreach ($mots as $mot) {
1278
				foreach ($mots as $mot) {
1261
					if (!(preg_match('/^[+x]$/', $mot) || $this->verifierTypeEpithete($mot)|| $this->verifierEpitheteSp($mot))) {
1279
					if (!(preg_match('/^[+x]$/', $mot) || $this->verifierTypeEpithete($mot)|| $this->verifierEpitheteSp($mot))) {
1262
						$epithete_traite = $this->repererEspace($nom['epithete_infra_sp']);
1280
						$epithete_traite = $this->repererEspace($nom['epithete_infra_sp']);
1263
						$noms_erreur[] = array($nom['num_nom'], $epithete_traite);
1281
						$noms_erreur[] = array($nom['num_nom'], $epithete_traite);
1264
					}
1282
					}
1265
				}
1283
				}
1266
			}
1284
			}
1267
		}
1285
		}
1268
		
1286
		
1269
		// Analyse des résultats
1287
		// Analyse des résultats
1270
		if (count($noms_erreur) > 0) {
1288
		if (count($noms_erreur) > 0) {
1271
			$info['message']['entete'] = array('num_nom', 'epithete_infra_sp erroné');
1289
			$info['message']['entete'] = array('num_nom', 'epithete_infra_sp erroné');
1272
			$info['message']['lignes'] = $noms_erreur;
1290
			$info['message']['lignes'] = $noms_erreur;
1273
		} else {
1291
		} else {
1274
			$info['resultat'] = true;
1292
			$info['resultat'] = true;
1275
		}
1293
		}
1276
		$noms_erreur = null;
1294
		$noms_erreur = null;
1277
		
1295
		
1278
		$this->traiterResultatTest($info);
1296
		$this->traiterResultatTest($info);
1279
	}
1297
	}
1280
	
1298
	
1281
	/**
1299
	/**
1282
	 * Test #36
1300
	 * Test #36
1283
	 */
1301
	 */
1284
	private function testerEpitheteInfraSpRang() {
1302
	private function testerEpitheteInfraSpRang() {
1285
		$info = $this->getInfosTest(36);
1303
		$info = $this->getInfosTest(36);
1286
		$info['nom'] = sprintf($info['nom'], $this->manuel['rang_sp']);
1304
		$info['nom'] = sprintf($info['nom'], $this->manuel['rang_sp']);
1287
		$info['description'] = sprintf($info['description'], $this->manuel['rang_sp']);
1305
		$info['description'] = sprintf($info['description'], $this->manuel['rang_sp']);
1288
		
1306
		
1289
		// Réalisation du test
1307
		// Réalisation du test
1290
		$noms_erreur = array();
1308
		$noms_erreur = array();
1291
		foreach ($this->noms as &$nom) {
1309
		foreach ($this->noms as &$nom) {
1292
			if ($nom['epithete_infra_sp'] != '') {
1310
			if ($nom['epithete_infra_sp'] != '') {
1293
				if ($nom['rang'] < $this->manuel['rang_sp']) {
1311
				if ($nom['rang'] < $this->manuel['rang_sp']) {
1294
					$noms_erreur[] = array($nom['num_nom'], $nom['nom_sci'], $nom['rang']);
1312
					$noms_erreur[] = array($nom['num_nom'], $nom['nom_sci'], $nom['rang']);
1295
				}
1313
				}
1296
			}
1314
			}
1297
		}
1315
		}
1298
		
1316
		
1299
		// Analyse des résultats
1317
		// Analyse des résultats
1300
		if (count($noms_erreur) > 0) {
1318
		if (count($noms_erreur) > 0) {
1301
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'rang erroné');
1319
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'rang erroné');
1302
			$info['message']['lignes'] = $noms_erreur;
1320
			$info['message']['lignes'] = $noms_erreur;
1303
		} else {
1321
		} else {
1304
			$info['resultat'] = true;
1322
			$info['resultat'] = true;
1305
		}
1323
		}
1306
		$noms_erreur = null;
1324
		$noms_erreur = null;
1307
		
1325
		
1308
		$this->traiterResultatTest($info);
1326
		$this->traiterResultatTest($info);
1309
	}
1327
	}
1310
	
1328
	
1311
	/**
1329
	/**
1312
	 * Test #37
1330
	 * Test #37
1313
	 */
1331
	 */
1314
	private function testerGroupeCultivarSyntaxe() {
1332
	private function testerGroupeCultivarSyntaxe() {
1315
		$info = $this->getInfosTest(37);
1333
		$info = $this->getInfosTest(37);
1316
		
1334
		
1317
		// Réalisation du test
1335
		// Réalisation du test
1318
		$noms_erreur = array();
1336
		$noms_erreur = array();
1319
		foreach ($this->noms as &$nom) {
1337
		foreach ($this->noms as &$nom) {
1320
			if ($nom['cultivar_groupe'] != '') {
1338
			if ($nom['cultivar_groupe'] != '') {
1321
				if (!$this->verifierEpitheteGroupeCultivar($nom['cultivar_groupe'])) {
1339
				if (!$this->verifierEpitheteGroupeCultivar($nom['cultivar_groupe'])) {
1322
					$epithete_traite = $this->repererEspace($nom['cultivar_groupe']);
1340
					$epithete_traite = $this->repererEspace($nom['cultivar_groupe']);
1323
					$noms_erreur[] = array($nom['num_nom'], $epithete_traite);
1341
					$noms_erreur[] = array($nom['num_nom'], $epithete_traite);
1324
				}
1342
				}
1325
			}
1343
			}
1326
		}
1344
		}
1327
		
1345
		
1328
		// Analyse des résultats
1346
		// Analyse des résultats
1329
		if (count($noms_erreur) > 0) {
1347
		if (count($noms_erreur) > 0) {
1330
			$info['message']['entete'] = array('num_nom', 'cultivar_groupe erroné');
1348
			$info['message']['entete'] = array('num_nom', 'cultivar_groupe erroné');
1331
			$info['message']['lignes'] = $noms_erreur;
1349
			$info['message']['lignes'] = $noms_erreur;
1332
		} else {
1350
		} else {
1333
			$info['resultat'] = true;
1351
			$info['resultat'] = true;
1334
		}
1352
		}
1335
		$noms_erreur = null;
1353
		$noms_erreur = null;
1336
		
1354
		
1337
		$this->traiterResultatTest($info);
1355
		$this->traiterResultatTest($info);
1338
	}
1356
	}
1339
	
1357
	
1340
	/**
1358
	/**
1341
	 * Test #38
1359
	 * Test #38
1342
	 */
1360
	 */
1343
	private function testerGroupeCultivarRang() {
1361
	private function testerGroupeCultivarRang() {
1344
		$info = $this->getInfosTest(38);
1362
		$info = $this->getInfosTest(38);
1345
		$info['nom'] = sprintf($info['nom'], $this->manuel['rang_genre']);
1363
		$info['nom'] = sprintf($info['nom'], $this->manuel['rang_genre']);
1346
		$info['description'] = sprintf($info['description'], $this->manuel['rang_genre']);
1364
		$info['description'] = sprintf($info['description'], $this->manuel['rang_genre']);
1347
		
1365
		
1348
		// Réalisation du test
1366
		// Réalisation du test
1349
		$noms_erreur = array();
1367
		$noms_erreur = array();
1350
		foreach ($this->noms as &$nom) {
1368
		foreach ($this->noms as &$nom) {
1351
			if ($nom['cultivar_groupe'] != '') {
1369
			if ($nom['cultivar_groupe'] != '') {
1352
				if ($nom['rang'] < $this->manuel['rang_genre']) {
1370
				if ($nom['rang'] < $this->manuel['rang_genre']) {
1353
					$noms_erreur[] = array($nom['num_nom'], $nom['nom_sci'], $nom['rang']);
1371
					$noms_erreur[] = array($nom['num_nom'], $nom['nom_sci'], $nom['rang']);
1354
				}
1372
				}
1355
			}
1373
			}
1356
		}
1374
		}
1357
		
1375
		
1358
		// Analyse des résultats
1376
		// Analyse des résultats
1359
		if (count($noms_erreur) > 0) {
1377
		if (count($noms_erreur) > 0) {
1360
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'rang erroné');
1378
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'rang erroné');
1361
			$info['message']['lignes'] = $noms_erreur;
1379
			$info['message']['lignes'] = $noms_erreur;
1362
		} else {
1380
		} else {
1363
			$info['resultat'] = true;
1381
			$info['resultat'] = true;
1364
		}
1382
		}
1365
		$noms_erreur = null;
1383
		$noms_erreur = null;
1366
		
1384
		
1367
		$this->traiterResultatTest($info);
1385
		$this->traiterResultatTest($info);
1368
	}
1386
	}
1369
	
1387
	
1370
	/**
1388
	/**
1371
	 * Test #39
1389
	 * Test #39
1372
	 */
1390
	 */
1373
	private function testerCultivarSyntaxe() {
1391
	private function testerCultivarSyntaxe() {
1374
		$info = $this->getInfosTest(39);
1392
		$info = $this->getInfosTest(39);
1375
 
1393
 
1376
		// Réalisation du test
1394
		// Réalisation du test
1377
		$noms_erreur = array();
1395
		$noms_erreur = array();
1378
		foreach ($this->noms as &$nom) {
1396
		foreach ($this->noms as &$nom) {
1379
			if ($nom['cultivar'] != '') {
1397
			if ($nom['cultivar'] != '') {
1380
				if (!$this->verifierEpitheteCultivar($nom['cultivar'])) {
1398
				if (!$this->verifierEpitheteCultivar($nom['cultivar'])) {
1381
					$epithete_traite = $this->repererEspace($nom['cultivar']);
1399
					$epithete_traite = $this->repererEspace($nom['cultivar']);
1382
					$noms_erreur[] = array($nom['num_nom'], $epithete_traite);
1400
					$noms_erreur[] = array($nom['num_nom'], $epithete_traite);
1383
				}
1401
				}
1384
			}
1402
			}
1385
		}
1403
		}
1386
		
1404
		
1387
		// Analyse des résultats
1405
		// Analyse des résultats
1388
		if (count($noms_erreur) > 0) {
1406
		if (count($noms_erreur) > 0) {
1389
			$info['message']['entete'] = array('num_nom', 'cultivar erroné');
1407
			$info['message']['entete'] = array('num_nom', 'cultivar erroné');
1390
			$info['message']['lignes'] = $noms_erreur;
1408
			$info['message']['lignes'] = $noms_erreur;
1391
		} else {
1409
		} else {
1392
			$info['resultat'] = true;
1410
			$info['resultat'] = true;
1393
		}
1411
		}
1394
		$noms_erreur = null;
1412
		$noms_erreur = null;
1395
		
1413
		
1396
		$this->traiterResultatTest($info);
1414
		$this->traiterResultatTest($info);
1397
	}
1415
	}
1398
	
1416
	
1399
	/**
1417
	/**
1400
	 * Test #40
1418
	 * Test #40
1401
	 */
1419
	 */
1402
	private function testerCultivarRang() {
1420
	private function testerCultivarRang() {
1403
		$info = $this->getInfosTest(40);
1421
		$info = $this->getInfosTest(40);
1404
		$info['nom'] = sprintf($info['nom'], $this->manuel['rang_genre']);
1422
		$info['nom'] = sprintf($info['nom'], $this->manuel['rang_genre']);
1405
		$info['description'] = sprintf($info['description'], $this->manuel['rang_genre']);
1423
		$info['description'] = sprintf($info['description'], $this->manuel['rang_genre']);
1406
		
1424
		
1407
		// Réalisation du test
1425
		// Réalisation du test
1408
		$noms_erreur = array();
1426
		$noms_erreur = array();
1409
		foreach ($this->noms as &$nom) {
1427
		foreach ($this->noms as &$nom) {
1410
			if ($nom['cultivar'] != '') {
1428
			if ($nom['cultivar'] != '') {
1411
				if ($nom['rang'] < $this->manuel['rang_genre']) {
1429
				if ($nom['rang'] < $this->manuel['rang_genre']) {
1412
					$noms_erreur[] = array($nom['num_nom'], $nom['nom_sci'], $nom['rang']);
1430
					$noms_erreur[] = array($nom['num_nom'], $nom['nom_sci'], $nom['rang']);
1413
				}
1431
				}
1414
			}
1432
			}
1415
		}
1433
		}
1416
		
1434
		
1417
		// Analyse des résultats
1435
		// Analyse des résultats
1418
		if (count($noms_erreur) > 0) {
1436
		if (count($noms_erreur) > 0) {
1419
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'rang erroné');
1437
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'rang erroné');
1420
			$info['message']['lignes'] = $noms_erreur;
1438
			$info['message']['lignes'] = $noms_erreur;
1421
		} else {
1439
		} else {
1422
			$info['resultat'] = true;
1440
			$info['resultat'] = true;
1423
		}
1441
		}
1424
		$noms_erreur = null;
1442
		$noms_erreur = null;
1425
		
1443
		
1426
		$this->traiterResultatTest($info);
1444
		$this->traiterResultatTest($info);
1427
	}
1445
	}
1428
	
1446
	
1429
	/**
1447
	/**
1430
	 * Test #41
1448
	 * Test #41
1431
	 */
1449
	 */
1432
	private function testerNomCommercialSyntaxe() {
1450
	private function testerNomCommercialSyntaxe() {
1433
		$info = $this->getInfosTest(41);
1451
		$info = $this->getInfosTest(41);
1434
		
1452
		
1435
		// Réalisation du test
1453
		// Réalisation du test
1436
		$noms_erreur = array();
1454
		$noms_erreur = array();
1437
		foreach ($this->noms as &$nom) {
1455
		foreach ($this->noms as &$nom) {
1438
			if ($nom['nom_commercial'] != '') {
1456
			if ($nom['nom_commercial'] != '') {
1439
				if (!$this->verifierNomCommercial($nom['nom_commercial'])) {
1457
				if (!$this->verifierNomCommercial($nom['nom_commercial'])) {
1440
					$epithete_traite = $this->repererEspace($nom['nom_commercial']);
1458
					$epithete_traite = $this->repererEspace($nom['nom_commercial']);
1441
					$noms_erreur[] = array($nom['num_nom'], $epithete_traite);
1459
					$noms_erreur[] = array($nom['num_nom'], $epithete_traite);
1442
				}
1460
				}
1443
			}
1461
			}
1444
		}
1462
		}
1445
		
1463
		
1446
		// Analyse des résultats
1464
		// Analyse des résultats
1447
		if (count($noms_erreur) > 0) {
1465
		if (count($noms_erreur) > 0) {
1448
			$info['message']['entete'] = array('num_nom', 'cultivar erroné');
1466
			$info['message']['entete'] = array('num_nom', 'cultivar erroné');
1449
			$info['message']['lignes'] = $noms_erreur;
1467
			$info['message']['lignes'] = $noms_erreur;
1450
		} else {
1468
		} else {
1451
			$info['resultat'] = true;
1469
			$info['resultat'] = true;
1452
		}
1470
		}
1453
		$noms_erreur = null;
1471
		$noms_erreur = null;
1454
		
1472
		
1455
		$this->traiterResultatTest($info);
1473
		$this->traiterResultatTest($info);
1456
	}
1474
	}
1457
	
1475
	
1458
	/**
1476
	/**
1459
	 * Test #42
1477
	 * Test #42
1460
	 */
1478
	 */
1461
	private function testerNomCommercialPresenceCultivar() {
1479
	private function testerNomCommercialPresenceCultivar() {
1462
		$info = $this->getInfosTest(42);
1480
		$info = $this->getInfosTest(42);
1463
		
1481
		
1464
		// Réalisation du test
1482
		// Réalisation du test
1465
		$noms_erreur = array();
1483
		$noms_erreur = array();
1466
		foreach ($this->noms as &$nom) {
1484
		foreach ($this->noms as &$nom) {
1467
			if ((isset($nom['nom_commercial']) && $nom['nom_commercial'] != '') && ($nom['cultivar'] == '' && $nom['cultivar_groupe'] == '')) {
1485
			if ((isset($nom['nom_commercial']) && $nom['nom_commercial'] != '') && ($nom['cultivar'] == '' && $nom['cultivar_groupe'] == '')) {
1468
				$noms_erreur[] = array($nom['num_nom'], $nom['nom_sci']);
1486
				$noms_erreur[] = array($nom['num_nom'], $nom['nom_sci']);
1469
			}
1487
			}
1470
		}
1488
		}
1471
		
1489
		
1472
		// Analyse des résultats
1490
		// Analyse des résultats
1473
		if (count($noms_erreur) > 0) {
1491
		if (count($noms_erreur) > 0) {
1474
			$info['message']['entete'] = array('num_nom', 'nom_commercial sans cultivar ou cultivar_groupe');
1492
			$info['message']['entete'] = array('num_nom', 'nom_commercial sans cultivar ou cultivar_groupe');
1475
			$info['message']['lignes'] = $noms_erreur;
1493
			$info['message']['lignes'] = $noms_erreur;
1476
		} else {
1494
		} else {
1477
			$info['resultat'] = true;
1495
			$info['resultat'] = true;
1478
		}
1496
		}
1479
		$noms_erreur = null;
1497
		$noms_erreur = null;
1480
		
1498
		
1481
		$this->traiterResultatTest($info);
1499
		$this->traiterResultatTest($info);
1482
	}
1500
	}
1483
	
1501
	
1484
	/**
1502
	/**
1485
	 * Test #43
1503
	 * Test #43
1486
	 */
1504
	 */
1487
	private function testerAuteurSyntaxe() {
1505
	private function testerAuteurSyntaxe() {
1488
		$info = $this->getInfosTest(43);
1506
		$info = $this->getInfosTest(43);
1489
		
1507
		
1490
		// Réalisation du test
1508
		// Réalisation du test
1491
		$noms_erreur = array();
1509
		$noms_erreur = array();
1492
		foreach ($this->noms as &$nom) {
1510
		foreach ($this->noms as &$nom) {
1493
			if ($nom['auteur'] != '') {
1511
			if ($nom['auteur'] != '') {
1494
				if (!$this->verifierAuteur($nom['auteur'])) {
1512
				if (!$this->verifierAuteur($nom['auteur'])) {
1495
					$intitule_traite = $this->repererEspace($nom['auteur']);
1513
					$intitule_traite = $this->repererEspace($nom['auteur']);
1496
					$noms_erreur[] = array($nom['num_nom'], $intitule_traite);
1514
					$noms_erreur[] = array($nom['num_nom'], $intitule_traite);
1497
				}
1515
				}
1498
			}
1516
			}
1499
		}
1517
		}
1500
		
1518
		
1501
		// Analyse des résultats
1519
		// Analyse des résultats
1502
		if (count($noms_erreur) > 0) {
1520
		if (count($noms_erreur) > 0) {
1503
			$info['message']['entete'] = array('num_nom', 'auteur erroné');
1521
			$info['message']['entete'] = array('num_nom', 'auteur erroné');
1504
			$info['message']['lignes'] = $noms_erreur;
1522
			$info['message']['lignes'] = $noms_erreur;
1505
		} else {
1523
		} else {
1506
			$info['resultat'] = true;
1524
			$info['resultat'] = true;
1507
		}
1525
		}
1508
		$noms_erreur = null;
1526
		$noms_erreur = null;
1509
		
1527
		
1510
		$this->traiterResultatTest($info);
1528
		$this->traiterResultatTest($info);
1511
	}
1529
	}
1512
	
1530
	
1513
	/**
1531
	/**
1514
	 * Test #44
1532
	 * Test #44
1515
	 */
1533
	 */
1516
	private function testerAnneeSyntaxe() {
1534
	private function testerAnneeSyntaxe() {
1517
		$info = $this->getInfosTest(44);
1535
		$info = $this->getInfosTest(44);
1518
		
1536
		
1519
		// Réalisation du test
1537
		// Réalisation du test
1520
		$noms_erreur = array();
1538
		$noms_erreur = array();
1521
		foreach ($this->noms as &$nom) {
1539
		foreach ($this->noms as &$nom) {
1522
			if ($nom['annee'] != '') {
1540
			if ($nom['annee'] != '') {
1523
				if (!$this->verifierAnnee($nom['annee'])) {
1541
				if (!$this->verifierAnnee($nom['annee'])) {
1524
					$noms_erreur[] = array($nom['num_nom'], $nom['annee']);
1542
					$noms_erreur[] = array($nom['num_nom'], $nom['annee']);
1525
				}
1543
				}
1526
			}
1544
			}
1527
		}
1545
		}
1528
		
1546
		
1529
		// Analyse des résultats
1547
		// Analyse des résultats
1530
		if (count($noms_erreur) > 0) {
1548
		if (count($noms_erreur) > 0) {
1531
			$info['message']['entete'] = array('num_nom', 'annee erronée');
1549
			$info['message']['entete'] = array('num_nom', 'annee erronée');
1532
			$info['message']['lignes'] = $noms_erreur;
1550
			$info['message']['lignes'] = $noms_erreur;
1533
		} else {
1551
		} else {
1534
			$info['resultat'] = true;
1552
			$info['resultat'] = true;
1535
		}
1553
		}
1536
		$noms_erreur = null;
1554
		$noms_erreur = null;
1537
		
1555
		
1538
		$this->traiterResultatTest($info);
1556
		$this->traiterResultatTest($info);
1539
	}
1557
	}
1540
	
1558
	
1541
	/**
1559
	/**
1542
	 * Test #45
1560
	 * Test #45
1543
	 */
1561
	 */
1544
	private function testerBiblioOrigineSyntaxe() {
1562
	private function testerBiblioOrigineSyntaxe() {
1545
		$info = $this->getInfosTest(45);
1563
		$info = $this->getInfosTest(45);
1546
		
1564
		
1547
		// Réalisation du test
1565
		// Réalisation du test
1548
		$noms_erreur = array();
1566
		$noms_erreur = array();
1549
		foreach ($this->noms as &$nom) {
1567
		foreach ($this->noms as &$nom) {
1550
			if ($nom['biblio_origine'] != '') {
1568
			if ($nom['biblio_origine'] != '') {
1551
				if (!$this->verifierBiblioOrigine($nom['biblio_origine'])) {
1569
				if (!$this->verifierBiblioOrigine($nom['biblio_origine'])) {
1552
					$biblio_traite = $this->repererEspace($nom['biblio_origine']);
1570
					$biblio_traite = $this->repererEspace($nom['biblio_origine']);
1553
					$noms_erreur[] = array($nom['num_nom'], $biblio_traite);
1571
					$noms_erreur[] = array($nom['num_nom'], $biblio_traite);
1554
				}
1572
				}
1555
			}
1573
			}
1556
		}
1574
		}
1557
		
1575
		
1558
		// Analyse des résultats
1576
		// Analyse des résultats
1559
		if (count($noms_erreur) > 0) {
1577
		if (count($noms_erreur) > 0) {
1560
			$info['message']['entete'] = array('num_nom', 'biblio_origine erroné');
1578
			$info['message']['entete'] = array('num_nom', 'biblio_origine erroné');
1561
			$info['message']['lignes'] = $noms_erreur;
1579
			$info['message']['lignes'] = $noms_erreur;
1562
		} else {
1580
		} else {
1563
			$info['resultat'] = true;
1581
			$info['resultat'] = true;
1564
		}
1582
		}
1565
		$noms_erreur = null;
1583
		$noms_erreur = null;
1566
		
1584
		
1567
		$this->traiterResultatTest($info);
1585
		$this->traiterResultatTest($info);
1568
	}
1586
	}
1569
	
1587
	
1570
	/**
1588
	/**
1571
	 * Test #46
1589
	 * Test #46
1572
	 */
1590
	 */
1573
	private function testerHomonymieSyntaxe() {
1591
	private function testerHomonymieSyntaxe() {
1574
		$info = $this->getInfosTest(46);
1592
		$info = $this->getInfosTest(46);
1575
		
1593
		
1576
		// Réalisation du test
1594
		// Réalisation du test
1577
		$noms_erreur = array();
1595
		$noms_erreur = array();
1578
		foreach ($this->noms as &$nom) {
1596
		foreach ($this->noms as &$nom) {
1579
			if ($nom['homonyme'] != '') {
1597
			if ($nom['homonyme'] != '') {
1580
				if (!$this->verifierBooleen($nom['homonyme'])) {
1598
				if (!$this->verifierBooleen($nom['homonyme'])) {
1581
					$noms_erreur[] = array($nom['num_nom'], $nom['homonyme']);
1599
					$noms_erreur[] = array($nom['num_nom'], $nom['homonyme']);
1582
				}
1600
				}
1583
			}
1601
			}
1584
		}
1602
		}
1585
		
1603
		
1586
		// Analyse des résultats
1604
		// Analyse des résultats
1587
		if (count($noms_erreur) > 0) {
1605
		if (count($noms_erreur) > 0) {
1588
			$info['message']['entete'] = array('num_nom', 'homonyme erroné');
1606
			$info['message']['entete'] = array('num_nom', 'homonyme erroné');
1589
			$info['message']['lignes'] = $noms_erreur;
1607
			$info['message']['lignes'] = $noms_erreur;
1590
		} else {
1608
		} else {
1591
			$info['resultat'] = true;
1609
			$info['resultat'] = true;
1592
		}
1610
		}
1593
		$noms_erreur = null;
1611
		$noms_erreur = null;
1594
		
1612
		
1595
		$this->traiterResultatTest($info);
1613
		$this->traiterResultatTest($info);
1596
	}
1614
	}
1597
	
1615
	
1598
	/**
1616
	/**
1599
	 * Test #47
1617
	 * Test #47
1600
	 */
1618
	 */
1601
	private function testerHomonymieExistence() {
1619
	private function testerHomonymieExistence() {
1602
		$info = $this->getInfosTest(47);
1620
		$info = $this->getInfosTest(47);
1603
		
1621
		
1604
		$noms_homonymie = $this->classerNomsParNomComplet();
1622
		$noms_homonymie = $this->classerNomsParNomComplet();
1605
		
1623
		
1606
		// Réalisation du test
1624
		// Réalisation du test
1607
		$noms_erreur = array();
1625
		$noms_erreur = array();
1608
		foreach ($this->noms as &$nom) {
1626
		foreach ($this->noms as &$nom) {
1609
			if ($nom['homonyme'] != '0' && $nom['homonyme'] != '') {
1627
			if ($nom['homonyme'] != '0' && $nom['homonyme'] != '') {
1610
				if ($noms_homonymie[$nom['nom_sci']] <= 1) {
1628
				if ($noms_homonymie[$nom['nom_sci']] <= 1) {
1611
					$noms_erreur[] = array($nom['num_nom'], $nom['nom_sci']);
1629
					$noms_erreur[] = array($nom['num_nom'], $nom['nom_sci']);
1612
				}
1630
				}
1613
			}
1631
			}
1614
		}
1632
		}
1615
		$noms_homonymie = null;
1633
		$noms_homonymie = null;
1616
		
1634
		
1617
		// Analyse des résultats
1635
		// Analyse des résultats
1618
		if (count($noms_erreur) > 0) {
1636
		if (count($noms_erreur) > 0) {
1619
			$info['message']['entete'] = array('num_nom', 'homonyme introuvable');
1637
			$info['message']['entete'] = array('num_nom', 'homonyme introuvable');
1620
			$info['message']['lignes'] = $noms_erreur;
1638
			$info['message']['lignes'] = $noms_erreur;
1621
		} else {
1639
		} else {
1622
			$info['resultat'] = true;
1640
			$info['resultat'] = true;
1623
		}
1641
		}
1624
		$noms_erreur = null;
1642
		$noms_erreur = null;
1625
		
1643
		
1626
		$this->traiterResultatTest($info);
1644
		$this->traiterResultatTest($info);
1627
	}
1645
	}
1628
	
1646
	
1629
	/**
1647
	/**
1630
	 * Test #48
1648
	 * Test #48
1631
	 */
1649
	 */
1632
	private function testerBasionymeSyntaxe() {
1650
	private function testerBasionymeSyntaxe() {
1633
		$info = $this->getInfosTest(48);
1651
		$info = $this->getInfosTest(48);
1634
		
1652
		
1635
		// Réalisation du test
1653
		// Réalisation du test
1636
		$noms_erreur = array();
1654
		$noms_erreur = array();
1637
		foreach ($this->noms as &$nom) {
1655
		foreach ($this->noms as &$nom) {
1638
			if ($nom['basionyme'] != '') {
1656
			if ($nom['basionyme'] != '') {
1639
				if (!$this->verifierNombre($nom['basionyme'])) {
1657
				if (!$this->verifierNombre($nom['basionyme'])) {
1640
					$noms_erreur[] = array($nom['num_nom'], $nom['basionyme']);
1658
					$noms_erreur[] = array($nom['num_nom'], $nom['basionyme']);
1641
				}
1659
				}
1642
			}
1660
			}
1643
		}
1661
		}
1644
		
1662
		
1645
		// Analyse des résultats
1663
		// Analyse des résultats
1646
		if (count($noms_erreur) > 0) {
1664
		if (count($noms_erreur) > 0) {
1647
			$info['message']['entete'] = array('num_nom', 'basionyme erroné');
1665
			$info['message']['entete'] = array('num_nom', 'basionyme erroné');
1648
			$info['message']['lignes'] = $noms_erreur;
1666
			$info['message']['lignes'] = $noms_erreur;
1649
		} else {
1667
		} else {
1650
			$info['resultat'] = true;
1668
			$info['resultat'] = true;
1651
		}
1669
		}
1652
		$noms_erreur = null;
1670
		$noms_erreur = null;
1653
		
1671
		
1654
		$this->traiterResultatTest($info);
1672
		$this->traiterResultatTest($info);
1655
	}
1673
	}
1656
 
1674
 
1657
	/**
1675
	/**
1658
	 * Test #49
1676
	 * Test #49
1659
	 */
1677
	 */
1660
	private function testerBasionymeExistence() {
1678
	private function testerBasionymeExistence() {
1661
		$info = $this->getInfosTest(49);
1679
		$info = $this->getInfosTest(49);
1662
		
1680
		
1663
		// Réalisation du test
1681
		// Réalisation du test
1664
		$noms_erreur = array();
1682
		$noms_erreur = array();
1665
		foreach ($this->noms as &$nom) {
1683
		foreach ($this->noms as &$nom) {
1666
			if ($nom['basionyme'] != '') {
1684
			if ($nom['basionyme'] != '') {
1667
				if (!isset($this->noms[$nom['basionyme']])) {
1685
				if (!isset($this->noms[$nom['basionyme']])) {
1668
					$noms_erreur[] = array($nom['num_nom'], $nom['basionyme']);
1686
					$noms_erreur[] = array($nom['num_nom'], $nom['basionyme']);
1669
				}
1687
				}
1670
			}
1688
			}
1671
		}
1689
		}
1672
		
1690
		
1673
		// Analyse des résultats
1691
		// Analyse des résultats
1674
		if (count($noms_erreur) > 0) {
1692
		if (count($noms_erreur) > 0) {
1675
			$info['message']['entete'] = array('num_nom', 'basionyme introuvable');
1693
			$info['message']['entete'] = array('num_nom', 'basionyme introuvable');
1676
			$info['message']['lignes'] = $noms_erreur;
1694
			$info['message']['lignes'] = $noms_erreur;
1677
		} else {
1695
		} else {
1678
			$info['resultat'] = true;
1696
			$info['resultat'] = true;
1679
		}
1697
		}
1680
		$noms_erreur = null;
1698
		$noms_erreur = null;
1681
		
1699
		
1682
		$this->traiterResultatTest($info);
1700
		$this->traiterResultatTest($info);
1683
	}
1701
	}
1684
	
1702
	
1685
	/**
1703
	/**
1686
	 * Test #50
1704
	 * Test #50
1687
	 */
1705
	 */
1688
	private function testerSynonymeProparteSyntaxe() {
1706
	private function testerSynonymeProparteSyntaxe() {
1689
		$info = $this->getInfosTest(50);
1707
		$info = $this->getInfosTest(50);
1690
		
1708
		
1691
		// Réalisation du test
1709
		// Réalisation du test
1692
		$noms_erreur = array();
1710
		$noms_erreur = array();
1693
		foreach ($this->noms as &$nom) {
1711
		foreach ($this->noms as &$nom) {
1694
			if ($nom['synonyme_proparte'] != '') {
1712
			if ($nom['synonyme_proparte'] != '') {
1695
				if (!$this->verifierNombreSuite($nom['synonyme_proparte'])) {
1713
				if (!$this->verifierNombreSuite($nom['synonyme_proparte'])) {
1696
					$noms_erreur[] = array($nom['num_nom'], $nom['synonyme_proparte']);
1714
					$noms_erreur[] = array($nom['num_nom'], $nom['synonyme_proparte']);
1697
				}
1715
				}
1698
			}
1716
			}
1699
		}
1717
		}
1700
		
1718
		
1701
		// Analyse des résultats
1719
		// Analyse des résultats
1702
		if (count($noms_erreur) > 0) {
1720
		if (count($noms_erreur) > 0) {
1703
			$info['message']['entete'] = array('num_nom', 'synonyme_proparte erroné');
1721
			$info['message']['entete'] = array('num_nom', 'synonyme_proparte erroné');
1704
			$info['message']['lignes'] = $noms_erreur;
1722
			$info['message']['lignes'] = $noms_erreur;
1705
		} else {
1723
		} else {
1706
			$info['resultat'] = true;
1724
			$info['resultat'] = true;
1707
		}
1725
		}
1708
		$noms_erreur = null;
1726
		$noms_erreur = null;
1709
		
1727
		
1710
		$this->traiterResultatTest($info);
1728
		$this->traiterResultatTest($info);
1711
	}
1729
	}
1712
	
1730
	
1713
	/**
1731
	/**
1714
	 * Test #51
1732
	 * Test #51
1715
	 */
1733
	 */
1716
	private function testerSynonymeProparteExistence() {
1734
	private function testerSynonymeProparteExistence() {
1717
		$info = array('nom' => 'synonyme_proparte -> existence',
-
 
1718
			'description' => "Si le champ synonyme_proparte contient un ou plusieurs nombres alors chacun d'entre eux ".
-
 
1719
								"doit correspondre à une valeur du champ num_nom.",
-
 
1720
			'resultat' => false);
1735
		$info = $this->getInfosTest(51);
1721
		
1736
		
1722
		// Réalisation du test
1737
		// Réalisation du test
1723
		$noms_erreur = array();
1738
		$noms_erreur = array();
1724
		foreach ($this->noms as &$nom) {
1739
		foreach ($this->noms as &$nom) {
1725
			if ($nom['synonyme_proparte'] != '') {
1740
			if ($nom['synonyme_proparte'] != '') {
1726
				$num_nom_a_verifier = explode(',', $nom['synonyme_proparte']);
1741
				$num_nom_a_verifier = explode(',', $nom['synonyme_proparte']);
1727
				$num_nom_en_erreur = array();
1742
				$num_nom_en_erreur = array();
1728
				foreach ($num_nom_a_verifier as $num_nom) {
1743
				foreach ($num_nom_a_verifier as $num_nom) {
1729
					if (!isset($this->noms[$num_nom])) {
1744
					if (!isset($this->noms[$num_nom])) {
1730
						$num_nom_en_erreur[] = $num_nom;
1745
						$num_nom_en_erreur[] = $num_nom;
1731
					}
1746
					}
1732
				}
1747
				}
1733
				if (count($nbre_en_erreur) > 0) {
1748
				if (count($nbre_en_erreur) > 0) {
1734
					$noms_erreur[] = array($nom['num_nom'], implode(',', $num_nom_en_erreur));
1749
					$noms_erreur[] = array($nom['num_nom'], implode(',', $num_nom_en_erreur));
1735
				}
1750
				}
1736
			}
1751
			}
1737
		}
1752
		}
1738
		
1753
		
1739
		// Analyse des résultats
1754
		// Analyse des résultats
1740
		if (count($noms_erreur) > 0) {
1755
		if (count($noms_erreur) > 0) {
1741
			$info['message']['entete'] = array('num_nom', 'synonyme_proparte introuvable');
1756
			$info['message']['entete'] = array('num_nom', 'synonyme_proparte introuvable');
1742
			$info['message']['lignes'] = $noms_erreur;
1757
			$info['message']['lignes'] = $noms_erreur;
1743
		} else {
1758
		} else {
1744
			$info['resultat'] = true;
1759
			$info['resultat'] = true;
1745
		}
1760
		}
1746
		$noms_erreur = null;
1761
		$noms_erreur = null;
1747
		
1762
		
1748
		$this->traiterResultatTest($info);
1763
		$this->traiterResultatTest($info);
1749
	}
1764
	}
1750
	
1765
	
1751
	/**
1766
	/**
1752
	 * Test #52
1767
	 * Test #52
1753
	 */
1768
	 */
1754
	private function testerSynonymeDouteuxSyntaxe() {
1769
	private function testerSynonymeDouteuxSyntaxe() {
1755
		$info = array('nom' => 'synonyme_douteux -> syntaxe',
-
 
1756
			'description' => "Le champ synonyme_douteux contient soit :\n".
-
 
1757
			" - une valeur vide,\n".
-
 
1758
			" - le chiffre 1.",
-
 
1759
			'resultat' => false);
1770
		$info = $this->getInfosTest(52);
1760
		
1771
		
1761
		// Réalisation du test
1772
		// Réalisation du test
1762
		$noms_erreur = array();
1773
		$noms_erreur = array();
1763
		foreach ($this->noms as &$nom) {
1774
		foreach ($this->noms as &$nom) {
1764
			if ($nom['synonyme_douteux'] != '') {
1775
			if ($nom['synonyme_douteux'] != '') {
1765
				if (!$this->verifierBooleen($nom['synonyme_douteux'])) {
1776
				if (!$this->verifierBooleen($nom['synonyme_douteux'])) {
1766
					$noms_erreur[] = array($nom['num_nom'], $nom['synonyme_douteux']);
1777
					$noms_erreur[] = array($nom['num_nom'], $nom['synonyme_douteux']);
1767
				}
1778
				}
1768
			}
1779
			}
1769
		}
1780
		}
1770
		
1781
		
1771
		// Analyse des résultats
1782
		// Analyse des résultats
1772
		if (count($noms_erreur) > 0) {
1783
		if (count($noms_erreur) > 0) {
1773
			$info['message']['entete'] = array('num_nom', 'synonyme_douteux erroné');
1784
			$info['message']['entete'] = array('num_nom', 'synonyme_douteux erroné');
1774
			$info['message']['lignes'] = $noms_erreur;
1785
			$info['message']['lignes'] = $noms_erreur;
1775
		} else {
1786
		} else {
1776
			$info['resultat'] = true;
1787
			$info['resultat'] = true;
1777
		}
1788
		}
1778
		$noms_erreur = null;
1789
		$noms_erreur = null;
1779
		
1790
		
1780
		$this->traiterResultatTest($info);
1791
		$this->traiterResultatTest($info);
1781
	}
1792
	}
1782
	
1793
	
1783
	/**
1794
	/**
1784
	 * Test #53
1795
	 * Test #53
1785
	 */
1796
	 */
1786
	private function testerSynonymeDouteuxNumNomRetenu() {
1797
	private function testerSynonymeDouteuxNumNomRetenu() {
1787
		$info = array('nom' => 'synonyme_douteux -> présence num_nom_retenu',
-
 
1788
			'description' => "Si le nom est un synonyme douteux, le champs num_nom_retenu doit être vide.",
-
 
1789
			'resultat' => false);
1798
		$info = $this->getInfosTest(53);
1790
		
1799
		
1791
		// Réalisation du test
1800
		// Réalisation du test
1792
		$noms_erreur = array();
1801
		$noms_erreur = array();
1793
		foreach ($this->noms as &$nom) {
1802
		foreach ($this->noms as &$nom) {
1794
			if ($nom['synonyme_douteux'] == 1 && $nom['num_nom_retenu'] != ' ') {
1803
			if ($nom['synonyme_douteux'] == 1 && $nom['num_nom_retenu'] != ' ') {
1795
				$noms_erreur[] = array($nom['num_nom'], $nom['synonyme_douteux'], $nom['num_nom_retenu']);
1804
				$noms_erreur[] = array($nom['num_nom'], $nom['synonyme_douteux'], $nom['num_nom_retenu']);
1796
			}
1805
			}
1797
		}
1806
		}
1798
		
1807
		
1799
		// Analyse des résultats
1808
		// Analyse des résultats
1800
		if (count($noms_erreur) > 0) {
1809
		if (count($noms_erreur) > 0) {
1801
			$info['message']['entete'] = array('num_nom', 'synonyme_douteux', 'num_nom_retenu');
1810
			$info['message']['entete'] = array('num_nom', 'synonyme_douteux', 'num_nom_retenu');
1802
			$info['message']['lignes'] = $noms_erreur;
1811
			$info['message']['lignes'] = $noms_erreur;
1803
		} else {
1812
		} else {
1804
			$info['resultat'] = true;
1813
			$info['resultat'] = true;
1805
		}
1814
		}
1806
		$noms_erreur = null;
1815
		$noms_erreur = null;
1807
		$this->traiterResultatTest($info);
1816
		$this->traiterResultatTest($info);
1808
	}
1817
	}
1809
	
1818
	
1810
	/**
1819
	/**
1811
	 * Test #54
1820
	 * Test #54
1812
	 */
1821
	 */
1813
	private function testerSynonymeMalAppliqueSyntaxe() {
1822
	private function testerSynonymeMalAppliqueSyntaxe() {
1814
		$info = array('nom' => 'synonyme_mal_applique -> syntaxe',
-
 
1815
			'description' => "Le champ synonyme_mal_applique contient soit :\n".
-
 
1816
			" - une valeur vide,\n".
-
 
1817
			" - le chiffre 1.",
-
 
1818
			'resultat' => false);
1823
		$info = $this->getInfosTest(54);
1819
		
1824
		
1820
		// Réalisation du test
1825
		// Réalisation du test
1821
		$noms_erreur = array();
1826
		$noms_erreur = array();
1822
		foreach ($this->noms as &$nom) {
1827
		foreach ($this->noms as &$nom) {
1823
			if ($nom['synonyme_mal_applique'] != '') {
1828
			if ($nom['synonyme_mal_applique'] != '') {
1824
				if (!$this->verifierBooleen($nom['synonyme_mal_applique'])) {
1829
				if (!$this->verifierBooleen($nom['synonyme_mal_applique'])) {
1825
					$noms_erreur[] = array($nom['num_nom'], $nom['synonyme_mal_applique']);
1830
					$noms_erreur[] = array($nom['num_nom'], $nom['synonyme_mal_applique']);
1826
				}
1831
				}
1827
			}
1832
			}
1828
		}
1833
		}
1829
		
1834
		
1830
		// Analyse des résultats
1835
		// Analyse des résultats
1831
		if (count($noms_erreur) > 0) {
1836
		if (count($noms_erreur) > 0) {
1832
			$info['message']['entete'] = array('num_nom', 'synonyme_mal_applique erroné');
1837
			$info['message']['entete'] = array('num_nom', 'synonyme_mal_applique erroné');
1833
			$info['message']['lignes'] = $noms_erreur;
1838
			$info['message']['lignes'] = $noms_erreur;
1834
		} else {
1839
		} else {
1835
			$info['resultat'] = true;
1840
			$info['resultat'] = true;
1836
		}
1841
		}
1837
		$noms_erreur = null;
1842
		$noms_erreur = null;
1838
		
1843
		
1839
		$this->traiterResultatTest($info);
1844
		$this->traiterResultatTest($info);
1840
	}
1845
	}
1841
	
1846
	
1842
	/**
1847
	/**
1843
	 * Test #55
1848
	 * Test #55
1844
	 */
1849
	 */
1845
	private function testerSynonymeOrthographiqueSyntaxe() {
1850
	private function testerSynonymeOrthographiqueSyntaxe() {
1846
		$info = array('nom' => 'synonyme_orthographique -> syntaxe',
-
 
1847
			'description' => "Le champ synonyme_orthographique contient soit :\n".
-
 
1848
								" - une valeur vide,\n".
-
 
1849
								" - un nombre.",
-
 
1850
			'resultat' => false);
1851
		$info = $this->getInfosTest(55);
1851
		
1852
		
1852
		// Réalisation du test
1853
		// Réalisation du test
1853
		$noms_erreur = array();
1854
		$noms_erreur = array();
1854
		foreach ($this->noms as $nom) {
1855
		foreach ($this->noms as $nom) {
1855
			if ($nom['synonyme_orthographique'] != '') {
1856
			if ($nom['synonyme_orthographique'] != '') {
1856
				if (!$this->verifierNombre($nom['synonyme_orthographique'])) {
1857
				if (!$this->verifierNombre($nom['synonyme_orthographique'])) {
1857
					$noms_erreur[] = array($nom['num_nom'], $nom['synonyme_orthographique']);
1858
					$noms_erreur[] = array($nom['num_nom'], $nom['synonyme_orthographique']);
1858
				}
1859
				}
1859
			}
1860
			}
1860
		}
1861
		}
1861
		
1862
		
1862
		// Analyse des résultats
1863
		// Analyse des résultats
1863
		if (count($noms_erreur) > 0) {
1864
		if (count($noms_erreur) > 0) {
1864
			$info['message']['entete'] = array('num_nom', 'synonyme_orthographique erroné');
1865
			$info['message']['entete'] = array('num_nom', 'synonyme_orthographique erroné');
1865
			$info['message']['lignes'] = $noms_erreur;
1866
			$info['message']['lignes'] = $noms_erreur;
1866
		} else {
1867
		} else {
1867
			$info['resultat'] = true;
1868
			$info['resultat'] = true;
1868
		}
1869
		}
1869
		$noms_erreur = null;
1870
		$noms_erreur = null;
1870
		
1871
		
1871
		$this->traiterResultatTest($info);
1872
		$this->traiterResultatTest($info);
1872
	}
1873
	}
1873
	
1874
	
1874
	/**
1875
	/**
1875
	 * Test #56
1876
	 * Test #56
1876
	 */
1877
	 */
1877
	private function testerSynonymeOrthographiqueExistence() {
1878
	private function testerSynonymeOrthographiqueExistence() {
1878
		$info = array('nom' => 'synonyme_orthographique -> existence',
-
 
1879
			'description' => "Si le champ synonyme_orthographique contient un nombre alors il doit correspondre ".
-
 
1880
								"à une valeur du champ num_nom.",
-
 
1881
			'resultat' => false);
1879
		$info = $this->getInfosTest(56);
1882
		
1880
		
1883
		// Réalisation du test
1881
		// Réalisation du test
1884
		$noms_erreur = array();
1882
		$noms_erreur = array();
1885
		foreach ($this->noms as &$nom) {
1883
		foreach ($this->noms as &$nom) {
1886
			if ($nom['synonyme_orthographique'] != '') {
1884
			if ($nom['synonyme_orthographique'] != '') {
1887
				if (!isset($this->noms[$nom['synonyme_orthographique']])) {
1885
				if (!isset($this->noms[$nom['synonyme_orthographique']])) {
1888
					$noms_erreur[] = array($nom['num_nom'], $nom['synonyme_orthographique']);
1886
					$noms_erreur[] = array($nom['num_nom'], $nom['synonyme_orthographique']);
1889
				}
1887
				}
1890
			}
1888
			}
1891
		}
1889
		}
1892
		
1890
		
1893
		// Analyse des résultats
1891
		// Analyse des résultats
1894
		if (count($noms_erreur) > 0) {
1892
		if (count($noms_erreur) > 0) {
1895
			$info['message']['entete'] = array('num_nom', 'synonyme_orthographique introuvable');
1893
			$info['message']['entete'] = array('num_nom', 'synonyme_orthographique introuvable');
1896
			$info['message']['lignes'] = $noms_erreur;
1894
			$info['message']['lignes'] = $noms_erreur;
1897
		} else {
1895
		} else {
1898
			$info['resultat'] = true;
1896
			$info['resultat'] = true;
1899
		}
1897
		}
1900
		$noms_erreur = null;
1898
		$noms_erreur = null;
1901
		
1899
		
1902
		$this->traiterResultatTest($info);
1900
		$this->traiterResultatTest($info);
1903
	}
1901
	}
1904
	
1902
	
1905
	/**
1903
	/**
1906
	 * Test #57
1904
	 * Test #57
1907
	 */
1905
	 */
1908
	private function testerHybrideParent01Syntaxe() {
1906
	private function testerHybrideParent01Syntaxe() {
1909
		$info = array('nom' => 'hybride_parent_01 -> syntaxe',
-
 
1910
			'description' => "Le champ hybride_parent_01 contient soit :\n".
-
 
1911
								" - une valeur vide,\n".
-
 
1912
								" - un nombre.",
-
 
1913
			'resultat' => false);
1907
		$info = $this->getInfosTest(57);
1914
		
1908
		
1915
		// Réalisation du test
1909
		// Réalisation du test
1916
		$noms_erreur = array();
1910
		$noms_erreur = array();
1917
		foreach ($this->noms as &$nom) {
1911
		foreach ($this->noms as &$nom) {
1918
			if ($nom['hybride_parent_01'] != '') {
1912
			if ($nom['hybride_parent_01'] != '') {
1919
				if (!$this->verifierNombre($nom['hybride_parent_01'])) {
1913
				if (!$this->verifierNombre($nom['hybride_parent_01'])) {
1920
					$noms_erreur[] = array($nom['num_nom'], $this->repererEspace($nom['hybride_parent_01']));
1914
					$noms_erreur[] = array($nom['num_nom'], $this->repererEspace($nom['hybride_parent_01']));
1921
				}
1915
				}
1922
			}
1916
			}
1923
		}
1917
		}
1924
		
1918
		
1925
		// Analyse des résultats
1919
		// Analyse des résultats
1926
		if (count($noms_erreur) > 0) {
1920
		if (count($noms_erreur) > 0) {
1927
			$info['message']['entete'] = array('num_nom', 'hybride_parent_01 erroné');
1921
			$info['message']['entete'] = array('num_nom', 'hybride_parent_01 erroné');
1928
			$info['message']['lignes'] = $noms_erreur;
1922
			$info['message']['lignes'] = $noms_erreur;
1929
		} else {
1923
		} else {
1930
			$info['resultat'] = true;
1924
			$info['resultat'] = true;
1931
		}
1925
		}
1932
		$noms_erreur = null;
1926
		$noms_erreur = null;
1933
		
1927
		
1934
		$this->traiterResultatTest($info);
1928
		$this->traiterResultatTest($info);
1935
	}
1929
	}
1936
	
1930
	
1937
	/**
1931
	/**
1938
	 * Test #58
1932
	 * Test #58
1939
	 */
1933
	 */
1940
	private function testerHybrideParent01Existence() {
1934
	private function testerHybrideParent01Existence() {
1941
		$info = array('nom' => 'hybride_parent_01 -> existence',
-
 
1942
			'description' => "Si le champ hybride_parent_01 contient un nombre alors il doit correspondre à une valeur ".
-
 
1943
								"du champ num_nom.",
-
 
1944
			'resultat' => false);
1935
		$info = $this->getInfosTest(58);
1945
		
1936
		
1946
		// Réalisation du test
1937
		// Réalisation du test
1947
		$noms_erreur = array();
1938
		$noms_erreur = array();
1948
		foreach ($this->noms as &$nom) {
1939
		foreach ($this->noms as &$nom) {
1949
			if ($nom['hybride_parent_01'] != '' && $nom['hybride_parent_01'] != '0') {
1940
			if ($nom['hybride_parent_01'] != '' && $nom['hybride_parent_01'] != '0') {
1950
				if (!isset($this->noms[$nom['hybride_parent_01']])) {
1941
				if (!isset($this->noms[$nom['hybride_parent_01']])) {
1951
					$noms_erreur[] = array($nom['num_nom'], $this->repererEspace($nom['hybride_parent_01']));
1942
					$noms_erreur[] = array($nom['num_nom'], $this->repererEspace($nom['hybride_parent_01']));
1952
				}
1943
				}
1953
			}
1944
			}
1954
		}
1945
		}
1955
		
1946
		
1956
		// Analyse des résultats
1947
		// Analyse des résultats
1957
		if (count($noms_erreur) > 0) {
1948
		if (count($noms_erreur) > 0) {
1958
			$info['message']['entete'] = array('num_nom', 'hybride_parent_01 introuvable');
1949
			$info['message']['entete'] = array('num_nom', 'hybride_parent_01 introuvable');
1959
			$info['message']['lignes'] = $noms_erreur;
1950
			$info['message']['lignes'] = $noms_erreur;
1960
		} else {
1951
		} else {
1961
			$info['resultat'] = true;
1952
			$info['resultat'] = true;
1962
		}
1953
		}
1963
		$noms_erreur = null;
1954
		$noms_erreur = null;
1964
		
1955
		
1965
		$this->traiterResultatTest($info);
1956
		$this->traiterResultatTest($info);
1966
	}
1957
	}
1967
	
1958
	
1968
	/**
1959
	/**
1969
	 * Test #59
1960
	 * Test #59
1970
	 */
1961
	 */
1971
	private function testerHybrideParent02Syntaxe() {
1962
	private function testerHybrideParent02Syntaxe() {
1972
		$info = array('nom' => 'hybride_parent_02 -> syntaxe',
-
 
1973
			'description' => "Le champ hybride_parent_02 contient soit :\n".
-
 
1974
								" - une valeur vide,\n".
-
 
1975
								" - un nombre.",
-
 
1976
			'resultat' => false);
1963
		$info = $this->getInfosTest(59);
1977
		
1964
		
1978
		// Réalisation du test
1965
		// Réalisation du test
1979
		$noms_erreur = array();
1966
		$noms_erreur = array();
1980
		foreach ($this->noms as &$nom) {
1967
		foreach ($this->noms as &$nom) {
1981
			if ($nom['hybride_parent_02'] != '') {
1968
			if ($nom['hybride_parent_02'] != '') {
1982
				if (!$this->verifierNombre($nom['hybride_parent_02'])) {
1969
				if (!$this->verifierNombre($nom['hybride_parent_02'])) {
1983
					$noms_erreur[] = array($nom['num_nom'], $this->repererEspace($nom['hybride_parent_02']));
1970
					$noms_erreur[] = array($nom['num_nom'], $this->repererEspace($nom['hybride_parent_02']));
1984
				}
1971
				}
1985
			}
1972
			}
1986
		}
1973
		}
1987
		
1974
		
1988
		// Analyse des résultats
1975
		// Analyse des résultats
1989
		if (count($noms_erreur) > 0) {
1976
		if (count($noms_erreur) > 0) {
1990
			$info['message']['entete'] = array('num_nom', 'hybride_parent_02 erroné');
1977
			$info['message']['entete'] = array('num_nom', 'hybride_parent_02 erroné');
1991
			$info['message']['lignes'] = $noms_erreur;
1978
			$info['message']['lignes'] = $noms_erreur;
1992
		} else {
1979
		} else {
1993
			$info['resultat'] = true;
1980
			$info['resultat'] = true;
1994
		}
1981
		}
1995
		$noms_erreur = null;
1982
		$noms_erreur = null;
1996
		
1983
		
1997
		$this->traiterResultatTest($info);
1984
		$this->traiterResultatTest($info);
1998
	}
1985
	}
1999
	
1986
	
2000
	/**
1987
	/**
2001
	 * Test #60
1988
	 * Test #60
2002
	 */
1989
	 */
2003
	private function testerHybrideParent02Existence() {
1990
	private function testerHybrideParent02Existence() {
2004
		$info = array('nom' => 'hybride_parent_02 -> existence',
-
 
2005
			'description' => "Si le champ hybride_parent_02 contient un nombre alors il doit correspondre à une valeur ".
-
 
2006
								"du champ num_nom.",
-
 
2007
			'resultat' => false);
1991
		$info = $this->getInfosTest(60);
2008
		
1992
		
2009
		// Réalisation du test
1993
		// Réalisation du test
2010
		$noms_erreur = array();
1994
		$noms_erreur = array();
2011
		foreach ($this->noms as &$nom) {
1995
		foreach ($this->noms as &$nom) {
2012
			if ($nom['hybride_parent_02'] != '') {
1996
			if ($nom['hybride_parent_02'] != '') {
2013
				if (!isset($this->noms[$nom['hybride_parent_02']]) && $nom['hybride_parent_02'] != '0') {
1997
				if (!isset($this->noms[$nom['hybride_parent_02']]) && $nom['hybride_parent_02'] != '0') {
2014
					$noms_erreur[] = array($nom['num_nom'], $this->repererEspace($nom['hybride_parent_02']));
1998
					$noms_erreur[] = array($nom['num_nom'], $this->repererEspace($nom['hybride_parent_02']));
2015
				}
1999
				}
2016
			}
2000
			}
2017
		}
2001
		}
2018
		
2002
		
2019
		// Analyse des résultats
2003
		// Analyse des résultats
2020
		if (count($noms_erreur) > 0) {
2004
		if (count($noms_erreur) > 0) {
2021
			$info['message']['entete'] = array('num_nom', 'hybride_parent_02 introuvable');
2005
			$info['message']['entete'] = array('num_nom', 'hybride_parent_02 introuvable');
2022
			$info['message']['lignes'] = $noms_erreur;
2006
			$info['message']['lignes'] = $noms_erreur;
2023
		} else {
2007
		} else {
2024
			$info['resultat'] = true;
2008
			$info['resultat'] = true;
2025
		}
2009
		}
2026
		$noms_erreur = null;
2010
		$noms_erreur = null;
2027
		
2011
		
2028
		$this->traiterResultatTest($info);
2012
		$this->traiterResultatTest($info);
2029
	}
2013
	}
2030
	
2014
	
2031
	/**
2015
	/**
2032
	 * Test #61
2016
	 * Test #61
2033
	 */
2017
	 */
2034
	private function testerPresenceSyntaxe() {
2018
	private function testerPresenceSyntaxe() {
2035
		$info = array('nom' => 'presence -> syntaxe',
2019
		$info = $this->getInfosTest(61);
2036
			'description' => "Le champ presence contient soit :\n".
-
 
2037
								" - le symbole tiret «-» précédant une autre information non référencée...\n".
-
 
2038
								" - une première lettre en majuscule indiquant le code standard attribué à ce taxon,\n".
-
 
2039
								" - éventuellement suivie d'un tiret puis d'une deuxième lettre en majuscule indiquant ".
-
 
2040
								"un code de présence spécifique au référentiel.",
-
 
2041
			'resultat' => false);
-
 
2042
		
2020
		
2043
		// Réalisation du test
2021
		// Réalisation du test
2044
		$noms_erreur = array();
2022
		$noms_erreur = array();
2045
		foreach ($this->noms as &$nom) {
2023
		foreach ($this->noms as &$nom) {
2046
			if ($nom['presence'] != '') {
2024
			if ($nom['presence'] != '') {
2047
				if (!$this->verifierPresence($nom['presence'])) {
2025
				if (!$this->verifierPresence($nom['presence'])) {
2048
					$noms_erreur[] = array($nom['num_nom'], $nom['presence']);
2026
					$noms_erreur[] = array($nom['num_nom'], $nom['presence']);
2049
				}
2027
				}
2050
			}
2028
			}
2051
		}
2029
		}
2052
		
2030
		
2053
		// Analyse des résultats
2031
		// Analyse des résultats
2054
		if (count($noms_erreur) > 0) {
2032
		if (count($noms_erreur) > 0) {
2055
			$info['message']['entete'] = array('num_nom', 'presence erroné');
2033
			$info['message']['entete'] = array('num_nom', 'presence erroné');
2056
			$info['message']['lignes'] = $noms_erreur;
2034
			$info['message']['lignes'] = $noms_erreur;
2057
		} else {
2035
		} else {
2058
			$info['resultat'] = true;
2036
			$info['resultat'] = true;
2059
		}
2037
		}
2060
		$noms_erreur = null;
2038
		$noms_erreur = null;
2061
		
2039
		
2062
		$this->traiterResultatTest($info);
2040
		$this->traiterResultatTest($info);
2063
	}
2041
	}
2064
	
2042
	
2065
	/**
2043
	/**
2066
	 * Test #62
2044
	 * Test #62
2067
	 */
2045
	 */
2068
	private function testerStatutOrigineSyntaxe() {
2046
	private function testerStatutOrigineSyntaxe() {
2069
		$info = array('nom' => 'statut_origine -> syntaxe',
2047
		$info = $this->getInfosTest(62);
2070
			'description' => "Le champ statut_origine peut contenir :\n".
-
 
2071
								" - le symbole tiret «-» précédant une autre information non référencée...\n".
-
 
2072
								" - une première lettre en majuscule indiquant le code standard attribué à ce taxon.\n".
-
 
2073
								" - éventuellement suivie d'un tiret puis d'une deuxième lettre en majuscule indiquant ".
-
 
2074
								"un code de présence spécifique au référentiel.",
-
 
2075
			'resultat' => false);
-
 
2076
		
2048
		
2077
		// Réalisation du test
2049
		// Réalisation du test
2078
		$noms_erreur = array();
2050
		$noms_erreur = array();
2079
		foreach ($this->noms as &$nom) {
2051
		foreach ($this->noms as &$nom) {
2080
			if ($nom['statut_origine'] != '') {
2052
			if ($nom['statut_origine'] != '') {
2081
				if (!$this->verifierStatutOrigine($nom['statut_origine'])) {
2053
				if (!$this->verifierStatutOrigine($nom['statut_origine'])) {
2082
					$noms_erreur[] = array($nom['num_nom'], $nom['statut_origine']);
2054
					$noms_erreur[] = array($nom['num_nom'], $nom['statut_origine']);
2083
				}
2055
				}
2084
			}
2056
			}
2085
		}
2057
		}
2086
		
2058
		
2087
		// Analyse des résultats
2059
		// Analyse des résultats
2088
		if (count($noms_erreur) > 0) {
2060
		if (count($noms_erreur) > 0) {
2089
			$info['message']['entete'] = array('num_nom', 'statut_origine erroné');
2061
			$info['message']['entete'] = array('num_nom', 'statut_origine erroné');
2090
			$info['message']['lignes'] = $noms_erreur;
2062
			$info['message']['lignes'] = $noms_erreur;
2091
		} else {
2063
		} else {
2092
			$info['resultat'] = true;
2064
			$info['resultat'] = true;
2093
		}
2065
		}
2094
		$noms_erreur = null;
2066
		$noms_erreur = null;
2095
		
2067
		
2096
		$this->traiterResultatTest($info);
2068
		$this->traiterResultatTest($info);
2097
	}
2069
	}
2098
	
2070
	
2099
	/**
2071
	/**
2100
	 * Test #63
2072
	 * Test #63
2101
	 */
2073
	 */
2102
	private function testerStatutIntroductionSyntaxe() {
2074
	private function testerStatutIntroductionSyntaxe() {
2103
		$info = array('nom' => 'statut_introduction -> syntaxe',
-
 
2104
			'description' => "Le champ statut_introduction peut contenir :\n".
-
 
2105
								" - le symbole tiret «-» précédant une autre information non référencée...\n".
-
 
2106
								" - une première lettre en majuscule indiquant le code standard attribué à ce taxon,\n".
-
 
2107
								" - éventuellement suivie d'un tiret puis d'une deuxième lettre en majuscule indiquant ".
-
 
2108
								"un code de présence spécifique au référentiel.",
-
 
2109
			'resultat' => false);
2075
		$info = $this->getInfosTest(63);
2110
		
2076
		
2111
		// Réalisation du test
2077
		// Réalisation du test
2112
		$noms_erreur = array();
2078
		$noms_erreur = array();
2113
		foreach ($this->noms as &$nom) {
2079
		foreach ($this->noms as &$nom) {
2114
			if ($nom['statut_introduction'] != '') {
2080
			if ($nom['statut_introduction'] != '') {
2115
				if (!$this->verifierStatutIntroduction($nom['statut_introduction'])) {
2081
				if (!$this->verifierStatutIntroduction($nom['statut_introduction'])) {
2116
					$noms_erreur[] = array($nom['num_nom'], $nom['statut_introduction']);
2082
					$noms_erreur[] = array($nom['num_nom'], $nom['statut_introduction']);
2117
				}
2083
				}
2118
			}
2084
			}
2119
		}
2085
		}
2120
		
2086
		
2121
		// Analyse des résultats
2087
		// Analyse des résultats
2122
		if (count($noms_erreur) > 0) {
2088
		if (count($noms_erreur) > 0) {
2123
			$info['message']['entete'] = array('num_nom', 'statut_introduction erroné');
2089
			$info['message']['entete'] = array('num_nom', 'statut_introduction erroné');
2124
			$info['message']['lignes'] = $noms_erreur;
2090
			$info['message']['lignes'] = $noms_erreur;
2125
		} else {
2091
		} else {
2126
			$info['resultat'] = true;
2092
			$info['resultat'] = true;
2127
		}
2093
		}
2128
		$noms_erreur = null;
2094
		$noms_erreur = null;
2129
		
2095
		
2130
		$this->traiterResultatTest($info);
2096
		$this->traiterResultatTest($info);
2131
	}
2097
	}
2132
	
2098
	
2133
	/**
2099
	/**
2134
	 * Test #64
2100
	 * Test #64
2135
	 */
2101
	 */
2136
	private function testerStatutCultureSyntaxe() {
2102
	private function testerStatutCultureSyntaxe() {
2137
		$info = array('nom' => 'statut_culture -> syntaxe',
2103
		$info = $this->getInfosTest(64);
2138
			'description' => "Le champ statut_culture peut contenir :\n".
-
 
2139
								" - le symbole tiret «-» précédant une autre information non référencée...\n".
-
 
2140
								" - une première lettre en majuscule indiquant le code standard attribué à ce taxon,\n".
-
 
2141
								" - éventuellement suivie d'un tiret puis d'une deuxième lettre en majuscule indiquant ".
-
 
2142
								"un code de présence spécifique au référentiel.",
-
 
2143
			'resultat' => false);
-
 
2144
		
2104
		
2145
		// Réalisation du test
2105
		// Réalisation du test
2146
		$noms_erreur = array();
2106
		$noms_erreur = array();
2147
		foreach ($this->noms as &$nom) {
2107
		foreach ($this->noms as &$nom) {
2148
			if ($nom['statut_culture'] != '') {
2108
			if ($nom['statut_culture'] != '') {
2149
				if (!$this->verifierStatutCulture($nom['statut_culture'])) {
2109
				if (!$this->verifierStatutCulture($nom['statut_culture'])) {
2150
					$noms_erreur[] = array($nom['num_nom'], $nom['statut_culture']);
2110
					$noms_erreur[] = array($nom['num_nom'], $nom['statut_culture']);
2151
				}
2111
				}
2152
			}
2112
			}
2153
		}
2113
		}
2154
		
2114
		
2155
		// Analyse des résultats
2115
		// Analyse des résultats
2156
		if (count($noms_erreur) > 0) {
2116
		if (count($noms_erreur) > 0) {
2157
			$info['message']['entete'] = array('num_nom', 'statut_culture erroné');
2117
			$info['message']['entete'] = array('num_nom', 'statut_culture erroné');
2158
			$info['message']['lignes'] = $noms_erreur;
2118
			$info['message']['lignes'] = $noms_erreur;
2159
		} else {
2119
		} else {
2160
			$info['resultat'] = true;
2120
			$info['resultat'] = true;
2161
		}
2121
		}
2162
		$noms_erreur = null;
2122
		$noms_erreur = null;
2163
		
2123
		
2164
		$this->traiterResultatTest($info);
2124
		$this->traiterResultatTest($info);
2165
	}
2125
	}
2166
	
2126
	
2167
	/**
2127
	/**
2168
	 * Test #65
2128
	 * Test #65
2169
	 */
2129
	 */
2170
	private function testerExclureTaxRefSyntaxe() {
2130
	private function testerExclureTaxRefSyntaxe() {
2171
		$info = $this->getInfosTest(65);
2131
		$info = $this->getInfosTest(65);
2172
		$info = array('nom' => 'exclure_taxref -> syntaxe',
-
 
2173
			'description' => "Le champ exclure_taxref contient soit :\n".
-
 
2174
			" - une valeur vide.\n".
-
 
2175
			" - une valeur null.\n".
-
 
2176
			" - le chiffre 0.\n".
-
 
2177
			" - le chiffre 1",
-
 
2178
			'resultat' => false);
-
 
2179
		
2132
	
2180
		// Réalisation du testCe n'est pas programmé.
2133
		// Réalisation du testCe n'est pas programmé.
2181
		$noms_erreur = array();
2134
		$noms_erreur = array();
2182
		foreach ($this->noms as &$nom) {
2135
		foreach ($this->noms as &$nom) {
2183
			if ($nom['exclure_taxref'] != '' && $nom['exclure_taxref'] != null) {
2136
			if ($nom['exclure_taxref'] != '' && $nom['exclure_taxref'] != null) {
2184
				if (!$this->verifierBooleen($nom['exclure_taxref'])) {
2137
				if (!$this->verifierBooleen($nom['exclure_taxref'])) {
2185
					$noms_erreur[] = array($nom['num_nom'], $nom['exclure_taxref']);
2138
					$noms_erreur[] = array($nom['num_nom'], $nom['exclure_taxref']);
2186
				}
2139
				}
2187
			}
2140
			}
2188
		}
2141
		}
2189
		
2142
		
2190
		// Analyse des résultats
2143
		// Analyse des résultats
2191
		if (count($noms_erreur) > 0) {
2144
		if (count($noms_erreur) > 0) {
2192
			$info['message']['entete'] = array('num_nom', 'exclure_taxref erroné');
2145
			$info['message']['entete'] = array('num_nom', 'exclure_taxref erroné');
2193
			$info['message']['lignes'] = $noms_erreur;
2146
			$info['message']['lignes'] = $noms_erreur;
2194
		} else {
2147
		} else {
2195
			$info['resultat'] = true;
2148
			$info['resultat'] = true;
2196
		}
2149
		}
2197
		$noms_erreur = null;
2150
		$noms_erreur = null;
2198
		
2151
		
2199
		$this->traiterResultatTest($info);
2152
		$this->traiterResultatTest($info);
2200
	}
2153
	}
2201
 
2154
 
2202
	
2155
	
2203
 
2156
 
2204
	//+--------------------------------------------------------------------------------------------------------------+//
2157
	//+--------------------------------------------------------------------------------------------------------------+//
2205
	// MÉTHODES COMMUNES aux TESTS
2158
	// MÉTHODES COMMUNES aux TESTS
2206
	
2159
	
2207
	private function verifierPresence(&$valeur) {
2160
	private function verifierPresence(&$valeur) {
2208
		$codes = $this->manuel['codes_presence'];
2161
		$codes = $this->manuel['codes_presence'];
2209
		$ok = $this->verifierStatuts($valeur, $codes);
2162
		$ok = $this->verifierStatuts($valeur, $codes);
2210
		return $ok;
2163
		return $ok;
2211
	}
2164
	}
2212
	
2165
	
2213
	private function verifierStatutOrigine(&$valeur) {
2166
	private function verifierStatutOrigine(&$valeur) {
2214
		$codes = $this->manuel['codes_statuts_origine'];
2167
		$codes = $this->manuel['codes_statuts_origine'];
2215
		$ok = $this->verifierStatuts($valeur, $codes);
2168
		$ok = $this->verifierStatuts($valeur, $codes);
2216
		return $ok;
2169
		return $ok;
2217
	}
2170
	}
2218
	
2171
	
2219
	private function verifierStatutIntroduction(&$valeur) {
2172
	private function verifierStatutIntroduction(&$valeur) {
2220
		$codes = $this->manuel['codes_statuts_introduction'];
2173
		$codes = $this->manuel['codes_statuts_introduction'];
2221
		$ok = $this->verifierStatuts($valeur, $codes);
2174
		$ok = $this->verifierStatuts($valeur, $codes);
2222
		return $ok;
2175
		return $ok;
2223
	}
2176
	}
2224
	
2177
	
2225
	private function verifierStatutCulture(&$valeur) {
2178
	private function verifierStatutCulture(&$valeur) {
2226
		$codes = $this->manuel['codes_statuts_culture'];
2179
		$codes = $this->manuel['codes_statuts_culture'];
2227
		$ok = $this->verifierStatuts($valeur, $codes);
2180
		$ok = $this->verifierStatuts($valeur, $codes);
2228
		return $ok;
2181
		return $ok;
2229
	}
2182
	}
2230
	
2183
	
2231
	private function verifierStatuts(&$valeur, &$codes) {
2184
	private function verifierStatuts(&$valeur, &$codes) {
2232
		$ok = true;
2185
		$ok = true;
2233
		if (!preg_match("/^(?:|-|[$codes](?:-[A-Z])?)$/", $valeur)) {
2186
		if (!preg_match("/^(?:|-|[$codes](?:-[A-Z])?)$/", $valeur)) {
2234
			$ok = false;
2187
			$ok = false;
2235
		}
2188
		}
2236
		return $ok;
2189
		return $ok;
2237
	}
2190
	}
2238
	
2191
	
2239
	private function verifierBooleen(&$valeur) {
2192
	private function verifierBooleen(&$valeur) {
2240
		$ok = true;
2193
		$ok = true;
2241
		if (!preg_match('/^1$/', $valeur)) {
2194
		if (!preg_match('/^1$/', $valeur)) {
2242
			$ok = false;
2195
			$ok = false;
2243
		}
2196
		}
2244
		return $ok;
2197
		return $ok;
2245
	}
2198
	}
2246
	
2199
	
2247
	private function verifierNombre(&$valeur) {
2200
	private function verifierNombre(&$valeur) {
2248
		$ok = true;
2201
		$ok = true;
2249
		if (!preg_match('/^[0-9]+$/', $valeur)) {
2202
		if (!preg_match('/^[0-9]+$/', $valeur)) {
2250
			$ok = false;
2203
			$ok = false;
2251
		}
2204
		}
2252
		return $ok;
2205
		return $ok;
2253
	}
2206
	}
2254
	
2207
	
2255
	private function verifierNombreSuite(&$valeur) {
2208
	private function verifierNombreSuite(&$valeur) {
2256
		$ok = true;
2209
		$ok = true;
2257
		if (!preg_match('/^(?:[0-9]+,)*[0-9]+$/', $valeur)) {
2210
		if (!preg_match('/^(?:[0-9]+,)*[0-9]+$/', $valeur)) {
2258
			$ok = false;
2211
			$ok = false;
2259
		}
2212
		}
2260
		return $ok;
2213
		return $ok;
2261
	}
2214
	}
2262
	
2215
	
2263
	private function verifierTypeEpithete(&$type) {
2216
	private function verifierTypeEpithete(&$type) {
2264
		$ok = false;
2217
		$ok = false;
2265
		$rejetes = $this->manuel['type_epithete_rejetes'];
2218
		$rejetes = $this->manuel['type_epithete_rejetes'];
2266
		if (preg_replace("/^(?:$rejetes)$/", '', $type) == '') {
2219
		if (preg_replace("/^(?:$rejetes)$/", '', $type) == '') {
2267
			$ok = false;
2220
			$ok = false;
2268
		} else if (preg_match('/^[a-z][-a-z]*[.]?$/', $type)) {
2221
		} else if (preg_match('/^[a-z][-a-z]*[.]?$/', $type)) {
2269
			$ok = true;
2222
			$ok = true;
2270
		}
2223
		}
2271
		return $ok;
2224
		return $ok;
2272
	}
2225
	}
2273
	
2226
	
2274
	private function verifierBiblioOrigine(&$intitule) {
2227
	private function verifierBiblioOrigine(&$intitule) {
2275
		$ok = true;
2228
		$ok = true;
2276
		if (preg_match('/(?:^\s+|\s{2,}|\s+$)/', $intitule)) {
2229
		if (preg_match('/(?:^\s+|\s{2,}|\s+$)/', $intitule)) {
2277
			$ok = false;// Contient des espaces en trop
2230
			$ok = false;// Contient des espaces en trop
2278
		} else if (!preg_match('/^(?:in [^;]+[;]|)[^,]+?(?:[,][^:]+|)(?:[:].+|)$/', $intitule)) {
2231
		} else if (!preg_match('/^(?:in [^;]+[;]|)[^,]+?(?:[,][^:]+|)(?:[:].+|)$/', $intitule)) {
2279
			$ok = false;
2232
			$ok = false;
2280
		} else if (preg_match('/(?:(?:^|[,:])\s*(?:[:,]|$))/', $intitule)) {
2233
		} else if (preg_match('/(?:(?:^|[,:])\s*(?:[:,]|$))/', $intitule)) {
2281
			$ok = false;// Contient une mauvaise suite de caractères
2234
			$ok = false;// Contient une mauvaise suite de caractères
2282
		}
2235
		}
2283
		return $ok;
2236
		return $ok;
2284
	}
2237
	}
2285
	
2238
	
2286
	private function verifierAnnee(&$annee) {
2239
	private function verifierAnnee(&$annee) {
2287
		$ok = true;
2240
		$ok = true;
2288
		if (!preg_match('/^[0-9]{4}$/', $annee)) {
2241
		if (!preg_match('/^[0-9]{4}$/', $annee)) {
2289
			$ok = false;
2242
			$ok = false;
2290
		} else if ($annee < 1753) {
2243
		} else if ($annee < 1753) {
2291
			$ok = false;
2244
			$ok = false;
2292
		}
2245
		}
2293
		return $ok;
2246
		return $ok;
2294
	}
2247
	}
2295
	
2248
	
2296
	private function verifierAuteur(&$intitule) {
2249
	private function verifierAuteur(&$intitule) {
2297
		$ok = true;
2250
		$ok = true;
2298
		$acceptes = $this->manuel['auteur_acceptes'];
2251
		$acceptes = $this->manuel['auteur_acceptes'];
2299
		if (!preg_match("/^(?:$acceptes)$/", $intitule)) {
2252
		if (!preg_match("/^(?:$acceptes)$/", $intitule)) {
2300
			if (preg_match('/(?:^\s+|\s{2,}|\s+$)/', $intitule)) {
2253
			if (preg_match('/(?:^\s+|\s{2,}|\s+$)/', $intitule)) {
2301
				$ok = false;// Contient des espaces en trop
2254
				$ok = false;// Contient des espaces en trop
2302
			} else {
2255
			} else {
2303
				$mots_rejetes = $this->manuel['auteur_mots_rejetes'];
2256
				$mots_rejetes = $this->manuel['auteur_mots_rejetes'];
2304
				$mots = explode(' ', $intitule);
2257
				$mots = explode(' ', $intitule);
2305
				foreach ($mots as $position => $mot) {
2258
				foreach ($mots as $position => $mot) {
2306
					if (preg_match("/^(?:$mots_rejetes)$/i", $mot)) {
2259
					if (preg_match("/^(?:$mots_rejetes)$/i", $mot)) {
2307
						$ok = false;// Mot rejeté
2260
						$ok = false;// Mot rejeté
2308
					} else if (preg_match("/^(?:(?:\p{L}|[.'\(\)-])+|[&])$/u", $mot)) {
2261
					} else if (preg_match("/^(?:(?:\p{L}|[.'\(\)-])+|[&])$/u", $mot)) {
2309
						continue;// Mot de l'intitulé auteur
2262
						continue;// Mot de l'intitulé auteur
2310
					} else {
2263
					} else {
2311
						$ok = false;
2264
						$ok = false;
2312
					}
2265
					}
2313
				}
2266
				}
2314
			}
2267
			}
2315
		}
2268
		}
2316
		return $ok;
2269
		return $ok;
2317
	}
2270
	}
2318
	
2271
	
2319
	private function verifierNomCommercial(&$epithete) {
2272
	private function verifierNomCommercial(&$epithete) {
2320
		$ok = false;
2273
		$ok = false;
2321
		if (preg_match("/^[[:upper:][:punct:][:digit:][:space:]]+$/", $epithete)) {
2274
		if (preg_match("/^[[:upper:][:punct:][:digit:][:space:]]+$/", $epithete)) {
2322
			$ok = true;
2275
			$ok = true;
2323
		}
2276
		}
2324
		return $ok;
2277
		return $ok;
2325
	}
2278
	}
2326
	
2279
	
2327
	private function verifierEpitheteCultivar(&$epithete) {
2280
	private function verifierEpitheteCultivar(&$epithete) {
2328
		$ok = true;
2281
		$ok = true;
2329
		$acceptes = $this->manuel['cultivar_acceptes'];
2282
		$acceptes = $this->manuel['cultivar_acceptes'];
2330
		if (!preg_match("/^(?:$acceptes)$/", $epithete)) {
2283
		if (!preg_match("/^(?:$acceptes)$/", $epithete)) {
2331
			if (preg_match('/(?:^\s+|\s{2,}|\s+$)/', $epithete)) {
2284
			if (preg_match('/(?:^\s+|\s{2,}|\s+$)/', $epithete)) {
2332
				$ok = false;// Contient des espaces en trop
2285
				$ok = false;// Contient des espaces en trop
2333
			} else {
2286
			} else {
2334
				$mots_rejetes = $this->manuel['cultivar_mots_rejetes'];
2287
				$mots_rejetes = $this->manuel['cultivar_mots_rejetes'];
2335
				$mots_mineurs = $this->manuel['mots_mineurs'];
2288
				$mots_mineurs = $this->manuel['mots_mineurs'];
2336
				$mots = explode(' ', $epithete);
2289
				$mots = explode(' ', $epithete);
2337
				foreach ($mots as $position => $mot) {
2290
				foreach ($mots as $position => $mot) {
2338
					if (preg_match("/^(?:$mots_rejetes)$/i", $mot)) {
2291
					if (preg_match("/^(?:$mots_rejetes)$/i", $mot)) {
2339
						$ok = false;// Mot rejeté
2292
						$ok = false;// Mot rejeté
2340
					} else if ($position > 0 && preg_match("/^(?:$mots_mineurs)$/", $mot)) {
2293
					} else if ($position > 0 && preg_match("/^(?:$mots_mineurs)$/", $mot)) {
2341
						continue;// Mot mineur en minuscule qui n'est pas en 1ère position
2294
						continue;// Mot mineur en minuscule qui n'est pas en 1ère position
2342
					} else {
2295
					} else {
2343
						$mots_tiret = explode('-', $mot);
2296
						$mots_tiret = explode('-', $mot);
2344
						foreach ($mots_tiret as $position_tiret => $mot_tiret) {
2297
						foreach ($mots_tiret as $position_tiret => $mot_tiret) {
2345
							if ($position_tiret > 0 && preg_match("/^(?:$mots_mineurs)$/", $mot_tiret)) {
2298
							if ($position_tiret > 0 && preg_match("/^(?:$mots_mineurs)$/", $mot_tiret)) {
2346
								continue;// Mot-tiret mineur en minuscule qui n'est pas en 1ère position
2299
								continue;// Mot-tiret mineur en minuscule qui n'est pas en 1ère position
2347
							} else if (preg_match('/^[[:upper:]][[:lower:]]+$/', $mot_tiret)) {
2300
							} else if (preg_match('/^[[:upper:]][[:lower:]]+$/', $mot_tiret)) {
2348
								continue;//Mot (ou 'mot-tiret') avec lettre initiale majuscule
2301
								continue;//Mot (ou 'mot-tiret') avec lettre initiale majuscule
2349
							} else if ($position_tiret == count($mots_tiret) && preg_match('/^[:upper:][:lower:]+[:punct:]?$/', $mot_tiret)) {
2302
							} else if ($position_tiret == count($mots_tiret) && preg_match('/^[:upper:][:lower:]+[:punct:]?$/', $mot_tiret)) {
2350
								continue;//Dernier mot (ou 'mot-tiret') avec lettre initiale majuscule, suivi d'un éventuel signe de ponctuation
2303
								continue;//Dernier mot (ou 'mot-tiret') avec lettre initiale majuscule, suivi d'un éventuel signe de ponctuation
2351
							} else {
2304
							} else {
2352
								$ok = false;
2305
								$ok = false;
2353
							}
2306
							}
2354
						}
2307
						}
2355
					}
2308
					}
2356
				}
2309
				}
2357
			}
2310
			}
2358
		}
2311
		}
2359
		return $ok;
2312
		return $ok;
2360
	}
2313
	}
2361
	
2314
	
2362
	private function verifierEpitheteGroupeCultivar(&$epithete) {
2315
	private function verifierEpitheteGroupeCultivar(&$epithete) {
2363
		$ok = true;
2316
		$ok = true;
2364
		$acceptes = $this->manuel['cultivar_gp_acceptes'];
2317
		$acceptes = $this->manuel['cultivar_gp_acceptes'];
2365
		if (!preg_match("/^(?:$acceptes)$/", $epithete)) {
2318
		if (!preg_match("/^(?:$acceptes)$/", $epithete)) {
2366
			if (preg_match('/(?:^\s+|\s{2,}|\s+$)/', $epithete)) {
2319
			if (preg_match('/(?:^\s+|\s{2,}|\s+$)/', $epithete)) {
2367
				$ok = false;// Contient des espaces en trop
2320
				$ok = false;// Contient des espaces en trop
2368
			} else {
2321
			} else {
2369
				$mots_acceptes = $this->manuel['cultivar_gp_mots_acceptes'];
2322
				$mots_acceptes = $this->manuel['cultivar_gp_mots_acceptes'];
2370
				$mots_rejetes = $this->manuel['cultivar_gp_mots_rejetes'];
2323
				$mots_rejetes = $this->manuel['cultivar_gp_mots_rejetes'];
2371
				$mots_mineurs = $this->manuel['mots_mineurs'];
2324
				$mots_mineurs = $this->manuel['mots_mineurs'];
2372
				$mots = explode(' ', $epithete);
2325
				$mots = explode(' ', $epithete);
2373
				foreach ($mots as $position => $mot) {
2326
				foreach ($mots as $position => $mot) {
2374
					if (preg_match("/^(?:$mots_acceptes)$/i", $mot)) {
2327
					if (preg_match("/^(?:$mots_acceptes)$/i", $mot)) {
2375
						continue;// Mot accepté
2328
						continue;// Mot accepté
2376
					} else if (preg_match("/^(?:$mots_rejetes)$/i", $mot)) {
2329
					} else if (preg_match("/^(?:$mots_rejetes)$/i", $mot)) {
2377
						$ok = false;// Mot rejeté
2330
						$ok = false;// Mot rejeté
2378
					} else if ($position > 0 && preg_match("/^(?:$mots_mineurs)$/", $mot)) {
2331
					} else if ($position > 0 && preg_match("/^(?:$mots_mineurs)$/", $mot)) {
2379
						continue;// Mot mineur en minuscule qui n'est pas en 1ère position
2332
						continue;// Mot mineur en minuscule qui n'est pas en 1ère position
2380
					} else {
2333
					} else {
2381
						$mots_tiret = explode('-', $mot);
2334
						$mots_tiret = explode('-', $mot);
2382
						foreach ($mots_tiret as $position_tiret => $mot_tiret) {
2335
						foreach ($mots_tiret as $position_tiret => $mot_tiret) {
2383
							if ($position_tiret > 0 && preg_match("/^(?:$mots_mineurs)$/", $mot_tiret)) {
2336
							if ($position_tiret > 0 && preg_match("/^(?:$mots_mineurs)$/", $mot_tiret)) {
2384
								continue;// Mot-tiret mineur en minuscule qui n'est pas en 1ère position dans le mot
2337
								continue;// Mot-tiret mineur en minuscule qui n'est pas en 1ère position dans le mot
2385
							} else if (preg_match('/^[[:upper:]][[:lower:]]+$/', $mot_tiret)) {
2338
							} else if (preg_match('/^[[:upper:]][[:lower:]]+$/', $mot_tiret)) {
2386
								continue;// Mot (ou 'mot-tiret') avec lettre initiale majuscule
2339
								continue;// Mot (ou 'mot-tiret') avec lettre initiale majuscule
2387
							} else if ($position_tiret == count($mots_tiret) && preg_match('/^[:upper:][:lower:]+[:punct:]?$/', $mot_tiret)) {
2340
							} else if ($position_tiret == count($mots_tiret) && preg_match('/^[:upper:][:lower:]+[:punct:]?$/', $mot_tiret)) {
2388
								continue;// Dernier mot (ou 'mot-tiret') avec lettre initiale majuscule, suivi d'un éventuel signe de ponctuation
2341
								continue;// Dernier mot (ou 'mot-tiret') avec lettre initiale majuscule, suivi d'un éventuel signe de ponctuation
2389
							} else {
2342
							} else {
2390
								$ok = false;
2343
								$ok = false;
2391
							}
2344
							}
2392
						}
2345
						}
2393
					}
2346
					}
2394
				}
2347
				}
2395
			}
2348
			}
2396
		}
2349
		}
2397
		return $ok;
2350
		return $ok;
2398
	}
2351
	}
2399
	
2352
	
2400
	private function verifierEpitheteSp(&$epithete) {
2353
	private function verifierEpitheteSp(&$epithete) {
2401
		$ok = false;
2354
		$ok = false;
2402
		if (preg_match('/^[a-zëï][-a-zëï]+$/', $epithete)) {
2355
		if (preg_match('/^[a-zëï][-a-zëï]+$/', $epithete)) {
2403
			$ok = true;
2356
			$ok = true;
2404
		} else if (preg_match('/^sp\.(?:[A-Z]|[1-9][0-9]*)$/', $epithete)) {
2357
		} else if (preg_match('/^sp\.(?:[A-Z]|[1-9][0-9]*)$/', $epithete)) {
2405
			$ok = true;
2358
			$ok = true;
2406
		}
2359
		}
2407
		return $ok;
2360
		return $ok;
2408
	}
2361
	}
2409
	
2362
	
2410
	private function verifierEpitheteGenre(&$epithete) {
2363
	private function verifierEpitheteGenre(&$epithete) {
2411
		$ok = false;
2364
		$ok = false;
2412
		if (preg_match('/^[A-ZËÏ](?:[-a-zëï]+|[a-zëï]+-[A-ZËÏ][a-zëï]+)$/', $epithete)) {
2365
		if (preg_match('/^[A-ZËÏ](?:[-a-zëï]+|[a-zëï]+-[A-ZËÏ][a-zëï]+)$/', $epithete)) {
2413
			$ok = true;
2366
			$ok = true;
2414
		}
2367
		}
2415
		return $ok;
2368
		return $ok;
2416
	}
2369
	}
2417
	
2370
	
2418
	private function formaterStyleNomGenre(&$genre) {
2371
	private function formaterStyleNomGenre(&$genre) {
2419
		$genre_fmt = '';
2372
		$genre_fmt = '';
2420
		if (preg_match('/^\s*([x+])\s+(.+)$/i', $genre, $match)) {
2373
		if (preg_match('/^\s*([x+])\s+(.+)$/i', $genre, $match)) {
2421
			$genre_fmt = strtolower($match[1]).' '.ucfirst(strtolower($match[2]));
2374
			$genre_fmt = strtolower($match[1]).' '.ucfirst(strtolower($match[2]));
2422
		} else {
2375
		} else {
2423
			$genre_fmt = ucfirst(strtolower($genre));
2376
			$genre_fmt = ucfirst(strtolower($genre));
2424
		}
2377
		}
2425
		return $genre_fmt;
2378
		return $genre_fmt;
2426
	}
2379
	}
2427
	
2380
	
2428
	private function repererEspace($nom_sci) {
2381
	private function repererEspace($nom_sci) {
2429
		$nom_sci = str_replace(' ', '<span class="espace">&nbsp;</span>', $nom_sci);
2382
		$nom_sci = str_replace(' ', '<span class="espace">&nbsp;</span>', $nom_sci);
2430
		return $nom_sci;
2383
		return $nom_sci;
2431
	}
2384
	}
2432
	
2385
	
2433
	private function construireSuffixeNomPltCultivee(&$nom) {
2386
	private function construireSuffixeNomPltCultivee(&$nom) {
2434
		$suffixe = array();
2387
		$suffixe = array();
2435
		$suffixe[] = $this->construireNomCultivarGroupe($nom);
2388
		$suffixe[] = $this->construireNomCultivarGroupe($nom);
2436
		$suffixe[] = $this->construireNomCommercial($nom);
2389
		$suffixe[] = $this->construireNomCommercial($nom);
2437
		$suffixe[] = $this->construireNomCultivar($nom);
2390
		$suffixe[] = $this->construireNomCultivar($nom);
2438
		$suffixe = array_filter($suffixe);
2391
		$suffixe = array_filter($suffixe);
2439
		return implode(' ', $suffixe);
2392
		return implode(' ', $suffixe);
2440
	}
2393
	}
2441
	
2394
	
2442
	private function construireNomCultivarGroupe(&$nom) {
2395
	private function construireNomCultivarGroupe(&$nom) {
2443
		$nom_groupe_cultivar = '';
2396
		$nom_groupe_cultivar = '';
2444
		if ($nom['cultivar_groupe'] != '') {
2397
		if ($nom['cultivar_groupe'] != '') {
2445
			if (preg_match('/ gx$/', $nom['cultivar_groupe'])) {
2398
			if (preg_match('/ gx$/', $nom['cultivar_groupe'])) {
2446
				$nom_groupe_cultivar =  '('.$nom['cultivar_groupe'].')';
2399
				$nom_groupe_cultivar =  '('.$nom['cultivar_groupe'].')';
2447
			} else {
2400
			} else {
2448
				$nom_groupe_cultivar =  '('.$nom['cultivar_groupe'].' Gp)';
2401
				$nom_groupe_cultivar =  '('.$nom['cultivar_groupe'].' Gp)';
2449
			}
2402
			}
2450
		}
2403
		}
2451
		return $nom_groupe_cultivar;
2404
		return $nom_groupe_cultivar;
2452
	}
2405
	}
2453
	
2406
	
2454
	private function construireNomCommercial(&$nom) {
2407
	private function construireNomCommercial(&$nom) {
2455
		$nom_commercial = '';
2408
		$nom_commercial = '';
2456
		if ($nom['nom_commercial'] != '') {
2409
		if ($nom['nom_commercial'] != '') {
2457
			$nom_commercial =  strtoupper($nom['nom_commercial']);
2410
			$nom_commercial =  strtoupper($nom['nom_commercial']);
2458
		}
2411
		}
2459
		return $nom_commercial;
2412
		return $nom_commercial;
2460
	}
2413
	}
2461
	
2414
	
2462
	private function construireNomCultivar(&$nom) {
2415
	private function construireNomCultivar(&$nom) {
2463
		$nom_cultivar = '';
2416
		$nom_cultivar = '';
2464
		if ($nom['cultivar'] != '') {
2417
		if ($nom['cultivar'] != '') {
2465
			$nom_cultivar =  "'".$nom['cultivar']."'";
2418
			$nom_cultivar =  "'".$nom['cultivar']."'";
2466
		}
2419
		}
2467
		return $nom_cultivar;
2420
		return $nom_cultivar;
2468
	}
2421
	}
2469
	
2422
	
2470
	private function classerNomsParNomComplet() {
2423
	private function classerNomsParNomComplet() {
2471
		$noms_classes = array();
2424
		$noms_classes = array();
2472
		foreach ($this->noms as &$nom) {
2425
		foreach ($this->noms as &$nom) {
2473
			if (!isset($noms_classes[$nom['nom_sci']])) {
2426
			if (!isset($noms_classes[$nom['nom_sci']])) {
2474
				$noms_classes[$nom['nom_sci']] = 1;
2427
				$noms_classes[$nom['nom_sci']] = 1;
2475
			} else {
2428
			} else {
2476
				$noms_classes[$nom['nom_sci']]++;
2429
				$noms_classes[$nom['nom_sci']]++;
2477
			}
2430
			}
2478
		}
2431
		}
2479
		return $noms_classes;
2432
		return $noms_classes;
2480
	}
2433
	}
2481
 
2434
 
2482
	private function getInfosTest($numero) {
2435
	private function getInfosTest($numero) {
2483
		$info = $this->tests[$numero];
2436
		$info = $this->tests[$numero];
-
 
2437
		$info['methode'] = 'tester'.implode('', explode(' ', ucwords($info['abr'])));
2484
		$info['numero'] = $numero; 
2438
		$info['numero'] = $numero; 
2485
		$info['resultat'] = false;
2439
		$info['resultat'] = false;
2486
		return $info;
2440
		return $info;
2487
	}
2441
	}
2488
}
2442
}
2489
?>
2443
?>