Subversion Repositories Applications.referentiel

Rev

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

Rev 51 Rev 64
Line 22... Line 22...
22
	
22
	
23
	private $projet = null;
23
	private $projet = null;
Line 24... Line 24...
24
	private $traitement = null;
24
	private $traitement = null;
-
 
25
	
Line 25... Line 26...
25
	
26
	private $manuel = null;
26
	private $manuel = null;
27
	private $noms = null;
27
	
28
	
28
	private $resultatDao = null;
29
	private $resultatDao = null;
Line 73... Line 74...
73
		$donnees['tests'] = array();
74
		$donnees['tests'] = array();
Line 74... Line 75...
74
		
75
		
75
		// Récupération des données à tester
76
		// Récupération des données à tester
76
		$colonnes = $this->tableStructureDao->getColonnes($this->projet);
77
		$colonnes = $this->tableStructureDao->getColonnes($this->projet);
77
		$analyses = $this->tableStructureDao->getAnalyse($this->projet);
78
		$analyses = $this->tableStructureDao->getAnalyse($this->projet);
78
		$noms = $this->referentielDao->getTout($this->projet);
79
		$this->noms = $this->referentielDao->getTout($this->projet);
79
		Debug::printr('Nbre noms :'.count($noms));
-
 
80
		$noms = $this->classerNomsParNumNom($noms);
-
 
Line 81... Line 80...
81
		$noms_homonymie = $this->classerNomsParNomComplet($noms);
80
		Debug::printr('Nbre noms :'.count($this->noms));
-
 
81
		
82
		
82
		// Lancement des tests unitaires
83
		// Lancement des tests unitaires
83
		$resultats = array();
84
		$this->testerNombreDeChamps($colonnes);
84
		$resultats[] = $this->testerNombreDeChamps($colonnes);
-
 
85
		$resultats[] = $this->testerNomDesChamps($colonnes);
-
 
86
		$resultats[] = $this->testerTypeDesChamps($colonnes);
-
 
87
		$resultats[] = $this->testerNumNomClePrimaire($colonnes);
-
 
88
		
85
		$this->testerNomDesChamps($colonnes);
89
		// Si la structure est bonne nous lançons les autres tests
86
		$this->testerTypeDesChamps($colonnes);
90
		Debug::printr($resultats);
87
		$this->testerTailleDesChamps($colonnes, $analyses);
91
		if ($this->verifierResultats($resultats)) {
88
		$this->testerNumNomClePrimaire($colonnes);
92
			$this->testerTailleDesChamps($colonnes, $analyses);
89
		
93
			
90
		$this->testerNumNomSuperieurAZero($noms);
94
			$this->testerNumNomSuperieurAZero();
91
		
95
			
92
		$this->testerNumNomRetenuSuperieurAZero($noms);
96
			$this->testerNumNomRetenuSuperieurAZero();
93
		$this->testerNumTaxSupEgalZeroUnique($noms);
97
			$this->testerNumTaxSupEgalZeroUnique();
94
		$this->testerTaxSupPourTaxon($noms);
98
			$this->testerTaxSupPourTaxon();
95
		$this->testerExitenceTaxonSuperieur($noms);
99
			$this->testerExitenceTaxonSuperieur();
96
		$this->testerClassificationRang($noms);		
100
			$this->testerClassificationRang();		
97
		$this->testerClassification($noms);
101
			$this->testerClassification();
98
		
102
			
99
		$this->testerRang($noms);
103
			$this->testerRang();
100
		
104
			
101
		$this->testerNomCompletSupraGenerique($noms);
105
			$this->testerNomCompletSupraGenerique();
102
		$this->testerNomCompletGenre($noms);
106
			$this->testerNomCompletGenre();
103
		$this->testerNomCompletInfraGenre($noms);
107
			$this->testerNomCompletInfraGenre();
104
		$this->testerNomCompletEspece($noms);
108
			$this->testerNomCompletEspece();
105
		$this->testerNomCompletInfraSpecifique($noms);
109
			$this->testerNomCompletInfraSpecifique();
106
 
110
	
107
		$this->testerNomSupraGeneriqueEspaces($noms);
111
			$this->testerNomSupraGeneriqueEspaces();
108
		$this->testerNomSupraGeneriqueSyntaxe($noms);
112
			$this->testerNomSupraGeneriqueSyntaxe();
109
		$this->testerNomSupraGeneriqueRang($noms);
113
			$this->testerNomSupraGeneriqueRang();
110
		
114
			
111
		$this->testerGenreEspaces($noms);
115
			$this->testerGenreEspaces();
112
		$this->testerGenreSyntaxe($noms);
116
			$this->testerGenreSyntaxe();
113
		$this->testerGenreRang($noms);
117
			$this->testerGenreRang();
114
		
118
			
115
		$this->testerEpitheteInfraGeneriqueEspaces($noms);
119
			$this->testerEpitheteInfraGeneriqueEspaces();
116
		$this->testerEpitheteInfraGeneriqueSyntaxe($noms);
120
			$this->testerEpitheteInfraGeneriqueSyntaxe();
117
		$this->testerEpitheteInfraGeneriqueRang($noms);
121
			$this->testerEpitheteInfraGeneriqueRang();
118
		
122
			
119
		$this->testerEpitheteSpEspaces($noms);
123
			$this->testerEpitheteSpEspaces();
120
		$this->testerEpitheteSpSyntaxe($noms);
124
			$this->testerEpitheteSpSyntaxe();
121
		$this->testerEpitheteSpRang($noms);
125
			$this->testerEpitheteSpRang();
122
		
126
			
123
		$this->testerTypeEpitheteEspaces($noms);
127
			$this->testerTypeEpitheteEspaces();
124
		$this->testerTypeEpitheteSyntaxe($noms);
128
			$this->testerTypeEpitheteSyntaxe();
125
		$this->testerTypeEpitheteHybridite($noms);
129
			$this->testerTypeEpitheteHybridite();
126
		
130
			
127
		$this->testerEpitheteInfraSpEspaces($noms);
131
			$this->testerEpitheteInfraSpEspaces();
128
		$this->testerEpitheteInfraSpSyntaxe($noms);
132
			$this->testerEpitheteInfraSpSyntaxe();
129
		$this->testerEpitheteInfraSpRang($noms);
133
			$this->testerEpitheteInfraSpRang();
130
		
134
			
131
		$this->testerGroupeCultivarSyntaxe($noms);
135
			$this->testerGroupeCultivarSyntaxe();
132
		$this->testerGroupeCultivarRang($noms);		
136
			$this->testerGroupeCultivarRang();		
133
		
137
			
134
		$this->testerCultivarSyntaxe($noms);
138
			$this->testerCultivarSyntaxe();
135
		$this->testerCultivarRang($noms);
139
			$this->testerCultivarRang();
136
		
140
			
137
		$this->testerNomCommercialSyntaxe($noms);
141
			$this->testerNomCommercialSyntaxe();
138
		$this->testerNomCommercialPresenceCultivar($noms);
142
			$this->testerNomCommercialPresenceCultivar();
139
		
143
			
140
		$this->testerAuteurSyntaxe($noms);
144
			$this->testerAuteurSyntaxe();
141
		
145
			
142
		$this->testerAnneeSyntaxe($noms);
146
			$this->testerAnneeSyntaxe();
143
		
147
			
144
		$this->testerBiblioOrigineSyntaxe($noms);
148
			$this->testerBiblioOrigineSyntaxe();
145
		
149
			
146
		$this->testerHomonymieSyntaxe($noms);
150
			$this->testerHomonymieSyntaxe();
147
		$this->testerHomonymieExistence($noms, $noms_homonymie);
151
			$this->testerHomonymieExistence();
148
		
152
			
149
		$this->testerBasionymeSyntaxe($noms);
153
			$this->testerBasionymeSyntaxe();
150
		$this->testerBasionymeExistence($noms);
154
			$this->testerBasionymeExistence();
151
		
155
			
152
		$this->testerSynonymeProparteSyntaxe($noms);
156
			$this->testerSynonymeProparteSyntaxe();
153
		$this->testerSynonymeProparteExistence($noms);
157
			$this->testerSynonymeProparteExistence();
154
		
158
			
155
		$this->testerSynonymeDouteuxSyntaxe($noms);
159
			$this->testerSynonymeDouteuxSyntaxe();
156
		
160
			
157
		$this->testerSynonymeMalAppliqueSyntaxe($noms);
161
			$this->testerSynonymeMalAppliqueSyntaxe();
158
		
162
			
159
		$this->testerSynonymeOrthographiqueSyntaxe($noms);
163
			$this->testerSynonymeOrthographiqueSyntaxe();
160
		$this->testerSynonymeOrthographiqueExistence($noms);
164
			$this->testerSynonymeOrthographiqueExistence();
161
		
165
			
162
		$this->testerHybrideParent01Syntaxe($noms);
166
			$this->testerHybrideParent01Syntaxe();
163
		$this->testerHybrideParent01Existence($noms);
167
			$this->testerHybrideParent01Existence();
164
		$this->testerHybrideParent02Syntaxe($noms);
168
			$this->testerHybrideParent02Syntaxe();
165
		$this->testerHybrideParent02Existence($noms);
169
			$this->testerHybrideParent02Existence();
166
		
170
			
167
		$this->testerPresenceSyntaxe($noms);
171
			$this->testerPresenceSyntaxe();
168
		$this->testerStatutOrigineSyntaxe($noms);
172
			$this->testerStatutOrigineSyntaxe();
-
 
173
			$this->testerStatutIntroductionSyntaxe();
-
 
174
			$this->testerStatutCultureSyntaxe();
-
 
175
		}
-
 
176
	}
-
 
177
	private function verifierResultats($resultats) {
-
 
178
		$ok = true;
-
 
179
		foreach ($resultats as $resultat) {
-
 
180
			if ($resultat == '0') {
-
 
181
				$ok = false;
-
 
182
				break;
-
 
183
			}
169
		$this->testerStatutIntroductionSyntaxe($noms);
184
		}
Line 170... Line 185...
170
		$this->testerStatutCultureSyntaxe($noms);
185
		return $ok;
171
	}
186
	}
172
	
187
	
-
 
188
	//+--------------------------------------------------------------------------------------------------------------+//
173
	//+--------------------------------------------------------------------------------------------------------------+//
189
	// Enregistrement des résultats
174
	// Enregistrement des résultats
190
	private function traiterResultatTest($info) {
175
	private function traiterResultatTest($info) {
191
		Debug::printr($info['nom']);
176
		if (isset($info['message'])) {
192
		if (isset($info['message'])) {
177
			if (is_array($info['message'])) {
193
			if (is_array($info['message'])) {
178
				$info['message'] = $this->getVue('tests/squelettes/message_table', $info);
194
				$info['message'] = $this->getVue('tests/squelettes/message_table', $info);
179
			} else {
195
			} else {
180
				$info['message'] = $this->getVue('tests/squelettes/message_p', $info);
196
				$info['message'] = $this->getVue('tests/squelettes/message_p', $info);
-
 
197
			}
181
			}
198
		}
Line 182... Line 199...
182
		}
199
		$this->resultatDao->ajouter($this->traitement['id_traitement'], $info);
183
		$this->resultatDao->ajouter($this->traitement['id_traitement'], $info);
200
		$info = null;
Line 184... Line 201...
184
	}
201
	}
185
	
202
	
186
	//+--------------------------------------------------------------------------------------------------------------+//
203
	//+--------------------------------------------------------------------------------------------------------------+//
187
	// TESTS
204
	// TESTS
188
	
205
	
189
	private function testerStatutCultureSyntaxe($noms) {
206
	private function testerStatutCultureSyntaxe() {
190
		$info = array('nom' => 'statut_culture -> syntaxe',
207
		$info = array('nom' => 'statut_culture -> syntaxe',
191
			'description' => "Le champ statut_culture peut contenir :\n".
208
			'description' => "Le champ statut_culture peut contenir :\n".
Line 192... Line 209...
192
			" - le symbole tiret «-» une autre information non référencée...\n".
209
			" - le symbole tiret «-» une autre information non référencée...\n".
193
			" - une première lettre en majuscule indiquant le code standard attribué à ce taxon.\n".
210
			" - une première lettre en majuscule indiquant le code standard attribué à ce taxon.\n".
194
			" - Cette première lettre peut être suivie d'un tiret puis d'une deuxième lettre en majuscule indiquant ".
211
			" - Cette première lettre peut être suivie d'un tiret puis d'une deuxième lettre en majuscule indiquant ".
195
			"un code de présence spécifique au référentiel.",
212
			"un code de présence spécifique au référentiel.",
196
			'resultat' => false);
213
			'resultat' => false);
197
		
214
		
198
		// Réalisation du test
215
		// Réalisation du test
199
		$noms_erreur = array();
216
		$noms_erreur = array();
Line 210... Line 227...
210
			$info['message']['entete'] = array('num_nom', 'statut_culture erroné');
227
			$info['message']['entete'] = array('num_nom', 'statut_culture erroné');
211
			$info['message']['lignes'] = $noms_erreur;
228
			$info['message']['lignes'] = $noms_erreur;
212
		} else {
229
		} else {
213
			$info['resultat'] = true;
230
			$info['resultat'] = true;
214
		}
231
		}
-
 
232
		$noms_erreur = null;
Line 215... Line 233...
215
		
233
		
216
		$this->traiterResultatTest($info);
234
		$this->traiterResultatTest($info);
Line 217... Line 235...
217
	}
235
	}
218
	
236
	
219
	private function testerStatutIntroductionSyntaxe($noms) {
237
	private function testerStatutIntroductionSyntaxe() {
220
		$info = array('nom' => 'statut_introduction -> syntaxe',
238
		$info = array('nom' => 'statut_introduction -> syntaxe',
221
			'description' => "Le champ statut_introduction peut contenir :\n".
239
			'description' => "Le champ statut_introduction peut contenir :\n".
222
			" - le symbole tiret «-» une autre information non référencée...\n".
240
			" - le symbole tiret «-» une autre information non référencée...\n".
223
			" - une première lettre en majuscule indiquant le code standard attribué à ce taxon.\n".
241
			" - une première lettre en majuscule indiquant le code standard attribué à ce taxon.\n".
224
			" - Cette première lettre peut être suivie d'un tiret puis d'une deuxième lettre en majuscule indiquant ".
242
			" - Cette première lettre peut être suivie d'un tiret puis d'une deuxième lettre en majuscule indiquant ".
Line 225... Line 243...
225
			"un code de présence spécifique au référentiel.",
243
			"un code de présence spécifique au référentiel.",
226
			'resultat' => false);
244
			'resultat' => false);
227
		
245
		
228
		// Réalisation du test
246
		// Réalisation du test
229
		$noms_erreur = array();
247
		$noms_erreur = array();
230
		foreach ($noms as $nom) {
248
		foreach ($this->noms as &$nom) {
231
			if ($nom['statut_introduction'] != '') {
249
			if ($nom['statut_introduction'] != '') {
232
				if (!$this->verifierStatutIntroduction($nom['statut_introduction'])) {
250
				if (!$this->verifierStatutIntroduction($nom['statut_introduction'])) {
Line 240... Line 258...
240
			$info['message']['entete'] = array('num_nom', 'statut_introduction erroné');
258
			$info['message']['entete'] = array('num_nom', 'statut_introduction erroné');
241
			$info['message']['lignes'] = $noms_erreur;
259
			$info['message']['lignes'] = $noms_erreur;
242
		} else {
260
		} else {
243
			$info['resultat'] = true;
261
			$info['resultat'] = true;
244
		}
262
		}
-
 
263
		$noms_erreur = null;
Line 245... Line 264...
245
		
264
		
246
		$this->traiterResultatTest($info);
265
		$this->traiterResultatTest($info);
Line 247... Line 266...
247
	}
266
	}
248
	
267
	
249
	private function testerStatutOrigineSyntaxe($noms) {
268
	private function testerStatutOrigineSyntaxe() {
250
		$info = array('nom' => 'statut_origine -> syntaxe',
269
		$info = array('nom' => 'statut_origine -> syntaxe',
251
			'description' => "Le champ statut_origine peut contenir :\n".
270
			'description' => "Le champ statut_origine peut contenir :\n".
252
			" - le symbole tiret «-» une autre information non référencée...\n".
271
			" - le symbole tiret «-» une autre information non référencée...\n".
253
			" - une première lettre en majuscule indiquant le code standard attribué à ce taxon.\n".
272
			" - une première lettre en majuscule indiquant le code standard attribué à ce taxon.\n".
254
			" - Cette première lettre peut être suivie d'un tiret puis d'une deuxième lettre en majuscule indiquant ".
273
			" - Cette première lettre peut être suivie d'un tiret puis d'une deuxième lettre en majuscule indiquant ".
Line 255... Line 274...
255
			"un code de présence spécifique au référentiel.",
274
			"un code de présence spécifique au référentiel.",
256
			'resultat' => false);
275
			'resultat' => false);
257
		
276
		
258
		// Réalisation du test
277
		// Réalisation du test
259
		$noms_erreur = array();
278
		$noms_erreur = array();
260
		foreach ($noms as $nom) {
279
		foreach ($this->noms as &$nom) {
261
			if ($nom['statut_origine'] != '') {
280
			if ($nom['statut_origine'] != '') {
262
				if (!$this->verifierStatutOrigine($nom['statut_origine'])) {
281
				if (!$this->verifierStatutOrigine($nom['statut_origine'])) {
Line 270... Line 289...
270
			$info['message']['entete'] = array('num_nom', 'statut_origine erroné');
289
			$info['message']['entete'] = array('num_nom', 'statut_origine erroné');
271
			$info['message']['lignes'] = $noms_erreur;
290
			$info['message']['lignes'] = $noms_erreur;
272
		} else {
291
		} else {
273
			$info['resultat'] = true;
292
			$info['resultat'] = true;
274
		}
293
		}
-
 
294
		$noms_erreur = null;
Line 275... Line 295...
275
		
295
		
276
		$this->traiterResultatTest($info);
296
		$this->traiterResultatTest($info);
Line 277... Line 297...
277
	}
297
	}
278
	
298
	
279
	private function testerPresenceSyntaxe($noms) {
299
	private function testerPresenceSyntaxe() {
280
		$info = array('nom' => 'presence -> syntaxe',
300
		$info = array('nom' => 'presence -> syntaxe',
281
			'description' => "Le champ presence contient soit :\n".
301
			'description' => "Le champ presence contient soit :\n".
282
			" - le symbole tiret «-» une autre information non référencée...\n".
302
			" - le symbole tiret «-» une autre information non référencée...\n".
283
			" - une première lettre en majuscule indiquant le code standard attribué à ce taxon.\n".
303
			" - une première lettre en majuscule indiquant le code standard attribué à ce taxon.\n".
284
			" - Cette première lettre peut être suivie d'un tiret puis d'une deuxième lettre en majuscule indiquant ".
304
			" - Cette première lettre peut être suivie d'un tiret puis d'une deuxième lettre en majuscule indiquant ".
Line 285... Line 305...
285
			"un code de présence spécifique au référentiel.",
305
			"un code de présence spécifique au référentiel.",
286
			'resultat' => false);
306
			'resultat' => false);
287
		
307
		
288
		// Réalisation du test
308
		// Réalisation du test
289
		$noms_erreur = array();
309
		$noms_erreur = array();
290
		foreach ($noms as $nom) {
310
		foreach ($this->noms as &$nom) {
291
			if ($nom['presence'] != '') {
311
			if ($nom['presence'] != '') {
292
				if (!$this->verifierPresence($nom['presence'])) {
312
				if (!$this->verifierPresence($nom['presence'])) {
Line 300... Line 320...
300
			$info['message']['entete'] = array('num_nom', 'presence erroné');
320
			$info['message']['entete'] = array('num_nom', 'presence erroné');
301
			$info['message']['lignes'] = $noms_erreur;
321
			$info['message']['lignes'] = $noms_erreur;
302
		} else {
322
		} else {
303
			$info['resultat'] = true;
323
			$info['resultat'] = true;
304
		}
324
		}
-
 
325
		$noms_erreur = null;
Line 305... Line 326...
305
		
326
		
306
		$this->traiterResultatTest($info);
327
		$this->traiterResultatTest($info);
Line 307... Line 328...
307
	}
328
	}
308
	
329
	
309
	private function testerHybrideParent02Existence($noms) {
330
	private function testerHybrideParent02Existence() {
310
		$info = array('nom' => 'hybride_parent_02 -> existence',
331
		$info = array('nom' => 'hybride_parent_02 -> existence',
311
			'description' => "Si le champ hybride_parent_02 contient un nombre alors il doit correspondre à une valeur du champ ".
332
			'description' => "Si le champ hybride_parent_02 contient un nombre alors il doit correspondre à une valeur du champ ".
Line 312... Line 333...
312
			"num_nom.",
333
			"num_nom.",
313
			'resultat' => false);
334
			'resultat' => false);
314
		
335
		
315
		// Réalisation du test
336
		// Réalisation du test
316
		$noms_erreur = array();
337
		$noms_erreur = array();
317
		foreach ($noms as $nom) {
338
		foreach ($this->noms as &$nom) {
318
			if ($nom['hybride_parent_02'] != '') {
339
			if ($nom['hybride_parent_02'] != '') {
319
				if (!isset($noms[$nom['hybride_parent_02']]) && $nom['hybride_parent_02'] != '0') {
340
				if (!isset($this->noms[$nom['hybride_parent_02']]) && $nom['hybride_parent_02'] != '0') {
320
					$noms_erreur[] = array($nom['num_nom'], $this->repererEspace($nom['hybride_parent_02']));
341
					$noms_erreur[] = array($nom['num_nom'], $this->repererEspace($nom['hybride_parent_02']));
Line 327... Line 348...
327
			$info['message']['entete'] = array('num_nom', 'hybride_parent_02 introuvable');
348
			$info['message']['entete'] = array('num_nom', 'hybride_parent_02 introuvable');
328
			$info['message']['lignes'] = $noms_erreur;
349
			$info['message']['lignes'] = $noms_erreur;
329
		} else {
350
		} else {
330
			$info['resultat'] = true;
351
			$info['resultat'] = true;
331
		}
352
		}
-
 
353
		$noms_erreur = null;
Line 332... Line 354...
332
		
354
		
333
		$this->traiterResultatTest($info);
355
		$this->traiterResultatTest($info);
Line 334... Line 356...
334
	}
356
	}
335
	
357
	
336
	private function testerHybrideParent02Syntaxe($noms) {
358
	private function testerHybrideParent02Syntaxe() {
337
		$info = array('nom' => 'hybride_parent_02 -> syntaxe',
359
		$info = array('nom' => 'hybride_parent_02 -> syntaxe',
338
			'description' => "Le champ hybride_parent_02 contient soit :\n".
360
			'description' => "Le champ hybride_parent_02 contient soit :\n".
339
			" - une valeur vide.\n".
361
			" - une valeur vide.\n".
Line 340... Line 362...
340
			" - un nombre",
362
			" - un nombre",
341
			'resultat' => false);
363
			'resultat' => false);
342
		
364
		
343
		// Réalisation du test
365
		// Réalisation du test
344
		$noms_erreur = array();
366
		$noms_erreur = array();
345
		foreach ($noms as $nom) {
367
		foreach ($this->noms as &$nom) {
346
			if ($nom['hybride_parent_02'] != '') {
368
			if ($nom['hybride_parent_02'] != '') {
347
				if (!$this->verifierNombre($nom['hybride_parent_02'])) {
369
				if (!$this->verifierNombre($nom['hybride_parent_02'])) {
Line 355... Line 377...
355
			$info['message']['entete'] = array('num_nom', 'hybride_parent_02 erroné');
377
			$info['message']['entete'] = array('num_nom', 'hybride_parent_02 erroné');
356
			$info['message']['lignes'] = $noms_erreur;
378
			$info['message']['lignes'] = $noms_erreur;
357
		} else {
379
		} else {
358
			$info['resultat'] = true;
380
			$info['resultat'] = true;
359
		}
381
		}
-
 
382
		$noms_erreur = null;
Line 360... Line 383...
360
		
383
		
361
		$this->traiterResultatTest($info);
384
		$this->traiterResultatTest($info);
Line 362... Line 385...
362
	}
385
	}
363
	
386
	
364
	
387
	
365
	private function testerHybrideParent01Existence($noms) {
388
	private function testerHybrideParent01Existence() {
366
		$info = array('nom' => 'hybride_parent_01 -> existence',
389
		$info = array('nom' => 'hybride_parent_01 -> existence',
Line 367... Line 390...
367
			'description' => "Si le champ hybride_parent_01 contient un nombre alors il doit correspondre à une valeur du champ ".
390
			'description' => "Si le champ hybride_parent_01 contient un nombre alors il doit correspondre à une valeur du champ ".
368
			"num_nom.",
391
			"num_nom.",
369
			'resultat' => false);
392
			'resultat' => false);
370
		
393
		
371
		// Réalisation du test
394
		// Réalisation du test
372
		$noms_erreur = array();
395
		$noms_erreur = array();
373
		foreach ($noms as $nom) {
396
		foreach ($this->noms as &$nom) {
374
			if ($nom['hybride_parent_01'] != '' && $nom['hybride_parent_01'] != '0') {
397
			if ($nom['hybride_parent_01'] != '' && $nom['hybride_parent_01'] != '0') {
375
				if (!isset($noms[$nom['hybride_parent_01']])) {
398
				if (!isset($this->noms[$nom['hybride_parent_01']])) {
Line 383... Line 406...
383
			$info['message']['entete'] = array('num_nom', 'hybride_parent_01 introuvable');
406
			$info['message']['entete'] = array('num_nom', 'hybride_parent_01 introuvable');
384
			$info['message']['lignes'] = $noms_erreur;
407
			$info['message']['lignes'] = $noms_erreur;
385
		} else {
408
		} else {
386
			$info['resultat'] = true;
409
			$info['resultat'] = true;
387
		}
410
		}
-
 
411
		$noms_erreur = null;
Line 388... Line 412...
388
		
412
		
389
		$this->traiterResultatTest($info);
413
		$this->traiterResultatTest($info);
Line 390... Line 414...
390
	}
414
	}
391
	
415
	
392
	private function testerHybrideParent01Syntaxe($noms) {
416
	private function testerHybrideParent01Syntaxe() {
393
		$info = array('nom' => 'hybride_parent_01 -> syntaxe',
417
		$info = array('nom' => 'hybride_parent_01 -> syntaxe',
394
			'description' => "Le champ hybride_parent_01 contient soit :\n".
418
			'description' => "Le champ hybride_parent_01 contient soit :\n".
395
			" - une valeur vide.\n".
419
			" - une valeur vide.\n".
Line 396... Line 420...
396
			" - un nombre",
420
			" - un nombre",
397
			'resultat' => false);
421
			'resultat' => false);
398
		
422
		
399
		// Réalisation du test
423
		// Réalisation du test
400
		$noms_erreur = array();
424
		$noms_erreur = array();
401
		foreach ($noms as $nom) {
425
		foreach ($this->noms as &$nom) {
402
			if ($nom['hybride_parent_01'] != '') {
426
			if ($nom['hybride_parent_01'] != '') {
403
				if (!$this->verifierNombre($nom['hybride_parent_01'])) {
427
				if (!$this->verifierNombre($nom['hybride_parent_01'])) {
Line 411... Line 435...
411
			$info['message']['entete'] = array('num_nom', 'hybride_parent_01 erroné');
435
			$info['message']['entete'] = array('num_nom', 'hybride_parent_01 erroné');
412
			$info['message']['lignes'] = $noms_erreur;
436
			$info['message']['lignes'] = $noms_erreur;
413
		} else {
437
		} else {
414
			$info['resultat'] = true;
438
			$info['resultat'] = true;
415
		}
439
		}
-
 
440
		$noms_erreur = null;
Line 416... Line 441...
416
		
441
		
417
		$this->traiterResultatTest($info);
442
		$this->traiterResultatTest($info);
Line 418... Line 443...
418
	}
443
	}
419
	
444
	
420
	private function testerSynonymeOrthographiqueExistence($noms) {
445
	private function testerSynonymeOrthographiqueExistence() {
421
		$info = array('nom' => 'synonyme_orthographique -> existence',
446
		$info = array('nom' => 'synonyme_orthographique -> existence',
422
			'description' => "Si le champ synonyme_orthographique contient un nombre alors il doit correspondre à une valeur du champ ".
447
			'description' => "Si le champ synonyme_orthographique contient un nombre alors il doit correspondre à une valeur du champ ".
Line 423... Line 448...
423
			"num_nom.",
448
			"num_nom.",
424
			'resultat' => false);
449
			'resultat' => false);
425
		
450
		
426
		// Réalisation du test
451
		// Réalisation du test
427
		$noms_erreur = array();
452
		$noms_erreur = array();
428
		foreach ($noms as $nom) {
453
		foreach ($this->noms as &$nom) {
429
			if ($nom['synonyme_orthographique'] != '') {
454
			if ($nom['synonyme_orthographique'] != '') {
430
				if (!isset($noms[$nom['synonyme_orthographique']])) {
455
				if (!isset($this->noms[$nom['synonyme_orthographique']])) {
431
					$noms_erreur[] = array($nom['num_nom'], $nom['synonyme_orthographique']);
456
					$noms_erreur[] = array($nom['num_nom'], $nom['synonyme_orthographique']);
Line 438... Line 463...
438
			$info['message']['entete'] = array('num_nom', 'synonyme_orthographique introuvable');
463
			$info['message']['entete'] = array('num_nom', 'synonyme_orthographique introuvable');
439
			$info['message']['lignes'] = $noms_erreur;
464
			$info['message']['lignes'] = $noms_erreur;
440
		} else {
465
		} else {
441
			$info['resultat'] = true;
466
			$info['resultat'] = true;
442
		}
467
		}
-
 
468
		$noms_erreur = null;
Line 443... Line 469...
443
		
469
		
444
		$this->traiterResultatTest($info);
470
		$this->traiterResultatTest($info);
Line 445... Line 471...
445
	}
471
	}
446
	
472
	
447
	private function testerSynonymeOrthographiqueSyntaxe($noms) {
473
	private function testerSynonymeOrthographiqueSyntaxe() {
448
		$info = array('nom' => 'synonyme_orthographique -> syntaxe',
474
		$info = array('nom' => 'synonyme_orthographique -> syntaxe',
449
			'description' => "Le champ synonyme_orthographique contient soit :\n".
475
			'description' => "Le champ synonyme_orthographique contient soit :\n".
450
			" - une valeur vide.\n".
476
			" - une valeur vide.\n".
Line 451... Line 477...
451
			" - un nombre",
477
			" - un nombre",
452
			'resultat' => false);
478
			'resultat' => false);
453
		
479
		
454
		// Réalisation du test
480
		// Réalisation du test
455
		$noms_erreur = array();
481
		$noms_erreur = array();
456
		foreach ($noms as $nom) {
482
		foreach ($this->noms as $nom) {
457
			if ($nom['synonyme_orthographique'] != '') {
483
			if ($nom['synonyme_orthographique'] != '') {
458
				if (!$this->verifierNombre($nom['synonyme_orthographique'])) {
484
				if (!$this->verifierNombre($nom['synonyme_orthographique'])) {
Line 466... Line 492...
466
			$info['message']['entete'] = array('num_nom', 'synonyme_orthographique erroné');
492
			$info['message']['entete'] = array('num_nom', 'synonyme_orthographique erroné');
467
			$info['message']['lignes'] = $noms_erreur;
493
			$info['message']['lignes'] = $noms_erreur;
468
		} else {
494
		} else {
469
			$info['resultat'] = true;
495
			$info['resultat'] = true;
470
		}
496
		}
-
 
497
		$noms_erreur = null;
Line 471... Line 498...
471
		
498
		
472
		$this->traiterResultatTest($info);
499
		$this->traiterResultatTest($info);
Line 473... Line 500...
473
	}
500
	}
474
	
501
	
475
	private function testerSynonymeMalAppliqueSyntaxe($noms) {
502
	private function testerSynonymeMalAppliqueSyntaxe() {
476
		$info = array('nom' => 'synonyme_mal_applique -> syntaxe',
503
		$info = array('nom' => 'synonyme_mal_applique -> syntaxe',
477
			'description' => "Le champ synonyme_mal_applique contient soit :\n".
504
			'description' => "Le champ synonyme_mal_applique contient soit :\n".
478
			" - une valeur vide.\n".
505
			" - une valeur vide.\n".
Line 479... Line 506...
479
			" - le chiffre 1",
506
			" - le chiffre 1",
480
			'resultat' => false);
507
			'resultat' => false);
481
		
508
		
482
		// Réalisation du test
509
		// Réalisation du test
483
		$noms_erreur = array();
510
		$noms_erreur = array();
484
		foreach ($noms as $nom) {
511
		foreach ($this->noms as &$nom) {
485
			if ($nom['synonyme_mal_applique'] != '') {
512
			if ($nom['synonyme_mal_applique'] != '') {
486
				if (!$this->verifierBooleen($nom['synonyme_mal_applique'])) {
513
				if (!$this->verifierBooleen($nom['synonyme_mal_applique'])) {
Line 494... Line 521...
494
			$info['message']['entete'] = array('num_nom', 'synonyme_mal_applique erroné');
521
			$info['message']['entete'] = array('num_nom', 'synonyme_mal_applique erroné');
495
			$info['message']['lignes'] = $noms_erreur;
522
			$info['message']['lignes'] = $noms_erreur;
496
		} else {
523
		} else {
497
			$info['resultat'] = true;
524
			$info['resultat'] = true;
498
		}
525
		}
-
 
526
		$noms_erreur = null;
Line 499... Line 527...
499
		
527
		
500
		$this->traiterResultatTest($info);
528
		$this->traiterResultatTest($info);
Line 501... Line 529...
501
	}
529
	}
502
	
530
	
503
	private function testerSynonymeDouteuxSyntaxe($noms) {
531
	private function testerSynonymeDouteuxSyntaxe() {
504
		$info = array('nom' => 'synonyme_douteux -> syntaxe',
532
		$info = array('nom' => 'synonyme_douteux -> syntaxe',
505
			'description' => "Le champ synonyme_douteux contient soit :\n".
533
			'description' => "Le champ synonyme_douteux contient soit :\n".
506
			" - une valeur vide.\n".
534
			" - une valeur vide.\n".
Line 507... Line 535...
507
			" - le chiffre 1",
535
			" - le chiffre 1",
508
			'resultat' => false);
536
			'resultat' => false);
509
		
537
		
510
		// Réalisation du test
538
		// Réalisation du test
511
		$noms_erreur = array();
539
		$noms_erreur = array();
512
		foreach ($noms as $nom) {
540
		foreach ($this->noms as &$nom) {
513
			if ($nom['synonyme_douteux'] != '') {
541
			if ($nom['synonyme_douteux'] != '') {
514
				if (!$this->verifierBooleen($nom['synonyme_douteux'])) {
542
				if (!$this->verifierBooleen($nom['synonyme_douteux'])) {
Line 522... Line 550...
522
			$info['message']['entete'] = array('num_nom', 'synonyme_douteux erroné');
550
			$info['message']['entete'] = array('num_nom', 'synonyme_douteux erroné');
523
			$info['message']['lignes'] = $noms_erreur;
551
			$info['message']['lignes'] = $noms_erreur;
524
		} else {
552
		} else {
525
			$info['resultat'] = true;
553
			$info['resultat'] = true;
526
		}
554
		}
-
 
555
		$noms_erreur = null;
Line 527... Line 556...
527
		
556
		
528
		$this->traiterResultatTest($info);
557
		$this->traiterResultatTest($info);
Line 529... Line 558...
529
	}
558
	}
530
	
559
	
531
	private function testerSynonymeProparteExistence($noms) {
560
	private function testerSynonymeProparteExistence() {
532
		$info = array('nom' => 'synonyme_proparte -> existence',
561
		$info = array('nom' => 'synonyme_proparte -> existence',
533
			'description' => "Si le champ synonyme_proparte contient un ou plusieurs nombres alors chacun d'entre eux ".
562
			'description' => "Si le champ synonyme_proparte contient un ou plusieurs nombres alors chacun d'entre eux ".
Line 534... Line 563...
534
			"doit correspondre à une valeur du champ num_nom.",
563
			"doit correspondre à une valeur du champ num_nom.",
535
			'resultat' => false);
564
			'resultat' => false);
536
		
565
		
537
		// Réalisation du test
566
		// Réalisation du test
538
		$noms_erreur = array();
567
		$noms_erreur = array();
539
		foreach ($noms as $nom) {
568
		foreach ($this->noms as &$nom) {
540
			if ($nom['synonyme_proparte'] != '') {
569
			if ($nom['synonyme_proparte'] != '') {
541
				$num_nom_a_verifier = explode(',', $nom['synonyme_proparte']);
570
				$num_nom_a_verifier = explode(',', $nom['synonyme_proparte']);
542
				$num_nom_en_erreur = array();
571
				$num_nom_en_erreur = array();
543
				foreach ($num_nom_a_verifier as $num_nom) {
572
				foreach ($num_nom_a_verifier as $num_nom) {
544
					if (!isset($noms[$num_nom])) {
573
					if (!isset($this->noms[$num_nom])) {
545
						$num_nom_en_erreur[] = $num_nom;
574
						$num_nom_en_erreur[] = $num_nom;
546
					}
575
					}
Line 556... Line 585...
556
			$info['message']['entete'] = array('num_nom', 'synonyme_proparte introuvable');
585
			$info['message']['entete'] = array('num_nom', 'synonyme_proparte introuvable');
557
			$info['message']['lignes'] = $noms_erreur;
586
			$info['message']['lignes'] = $noms_erreur;
558
		} else {
587
		} else {
559
			$info['resultat'] = true;
588
			$info['resultat'] = true;
560
		}
589
		}
-
 
590
		$noms_erreur = null;
Line 561... Line 591...
561
		
591
		
562
		$this->traiterResultatTest($info);
592
		$this->traiterResultatTest($info);
Line 563... Line 593...
563
	}
593
	}
564
	
594
	
565
	private function testerSynonymeProparteSyntaxe($noms) {
595
	private function testerSynonymeProparteSyntaxe() {
566
		$info = array('nom' => 'synonyme_proparte -> syntaxe',
596
		$info = array('nom' => 'synonyme_proparte -> syntaxe',
567
			'description' => "Le champ synonyme_proparte contient soit :\n".
597
			'description' => "Le champ synonyme_proparte contient soit :\n".
568
			" - une valeur vide.\n".
598
			" - une valeur vide.\n".
569
			" - un nombre.\n".
599
			" - un nombre.\n".
Line 570... Line 600...
570
			" - une suite de nombre séparés par des virgules.",
600
			" - une suite de nombre séparés par des virgules.",
571
			'resultat' => false);
601
			'resultat' => false);
572
		
602
		
573
		// Réalisation du test
603
		// Réalisation du test
574
		$noms_erreur = array();
604
		$noms_erreur = array();
575
		foreach ($noms as $nom) {
605
		foreach ($this->noms as &$nom) {
576
			if ($nom['synonyme_proparte'] != '') {
606
			if ($nom['synonyme_proparte'] != '') {
577
				if (!$this->verifierNombreSuite($nom['synonyme_proparte'])) {
607
				if (!$this->verifierNombreSuite($nom['synonyme_proparte'])) {
Line 585... Line 615...
585
			$info['message']['entete'] = array('num_nom', 'synonyme_proparte erroné');
615
			$info['message']['entete'] = array('num_nom', 'synonyme_proparte erroné');
586
			$info['message']['lignes'] = $noms_erreur;
616
			$info['message']['lignes'] = $noms_erreur;
587
		} else {
617
		} else {
588
			$info['resultat'] = true;
618
			$info['resultat'] = true;
589
		}
619
		}
-
 
620
		$noms_erreur = null;
Line 590... Line 621...
590
		
621
		
591
		$this->traiterResultatTest($info);
622
		$this->traiterResultatTest($info);
Line 592... Line 623...
592
	}
623
	}
593
	
624
	
594
	private function testerBasionymeExistence($noms) {
625
	private function testerBasionymeExistence() {
595
		$info = array('nom' => 'basionyme -> existence',
626
		$info = array('nom' => 'basionyme -> existence',
596
			'description' => "Si le champ basionyme contient un nombre alors il doit correspondre à une valeur du champ ".
627
			'description' => "Si le champ basionyme contient un nombre alors il doit correspondre à une valeur du champ ".
Line 597... Line 628...
597
			"num_nom.",
628
			"num_nom.",
598
			'resultat' => false);
629
			'resultat' => false);
599
		
630
		
600
		// Réalisation du test
631
		// Réalisation du test
601
		$noms_erreur = array();
632
		$noms_erreur = array();
602
		foreach ($noms as $nom) {
633
		foreach ($this->noms as &$nom) {
603
			if ($nom['basionyme'] != '') {
634
			if ($nom['basionyme'] != '') {
604
				if (!isset($noms[$nom['basionyme']])) {
635
				if (!isset($this->noms[$nom['basionyme']])) {
605
					$noms_erreur[] = array($nom['num_nom'], $nom['basionyme']);
636
					$noms_erreur[] = array($nom['num_nom'], $nom['basionyme']);
Line 612... Line 643...
612
			$info['message']['entete'] = array('num_nom', 'basionyme introuvable');
643
			$info['message']['entete'] = array('num_nom', 'basionyme introuvable');
613
			$info['message']['lignes'] = $noms_erreur;
644
			$info['message']['lignes'] = $noms_erreur;
614
		} else {
645
		} else {
615
			$info['resultat'] = true;
646
			$info['resultat'] = true;
616
		}
647
		}
-
 
648
		$noms_erreur = null;
Line 617... Line 649...
617
		
649
		
618
		$this->traiterResultatTest($info);
650
		$this->traiterResultatTest($info);
Line 619... Line 651...
619
	}
651
	}
620
	
652
	
621
	private function testerBasionymeSyntaxe($noms) {
653
	private function testerBasionymeSyntaxe() {
622
		$info = array('nom' => 'basionyme -> syntaxe',
654
		$info = array('nom' => 'basionyme -> syntaxe',
623
			'description' => "Le champ basionyme contient :\n".
655
			'description' => "Le champ basionyme contient :\n".
Line 624... Line 656...
624
			" - un nombre ou une valeur vide.\n",
656
			" - un nombre ou une valeur vide.\n",
625
			'resultat' => false);
657
			'resultat' => false);
626
		
658
		
627
		// Réalisation du test
659
		// Réalisation du test
628
		$noms_erreur = array();
660
		$noms_erreur = array();
629
		foreach ($noms as $nom) {
661
		foreach ($this->noms as &$nom) {
630
			if ($nom['basionyme'] != '') {
662
			if ($nom['basionyme'] != '') {
631
				if (!$this->verifierNombre($nom['basionyme'])) {
663
				if (!$this->verifierNombre($nom['basionyme'])) {
Line 639... Line 671...
639
			$info['message']['entete'] = array('num_nom', 'basionyme erroné');
671
			$info['message']['entete'] = array('num_nom', 'basionyme erroné');
640
			$info['message']['lignes'] = $noms_erreur;
672
			$info['message']['lignes'] = $noms_erreur;
641
		} else {
673
		} else {
642
			$info['resultat'] = true;
674
			$info['resultat'] = true;
643
		}
675
		}
-
 
676
		$noms_erreur = null;
Line 644... Line 677...
644
		
677
		
645
		$this->traiterResultatTest($info);
678
		$this->traiterResultatTest($info);
Line 646... Line 679...
646
	}
679
	}
647
	
680
	
648
	private function testerHomonymieExistence($noms, $noms_homonymie) {
681
	private function testerHomonymieExistence() {
649
		$info = array('nom' => 'homonyme -> existence',
682
		$info = array('nom' => 'homonyme -> existence',
650
			'description' => "Si le champ homonyme contient «1» alors plusieurs noms doivent posséder la même valeur ".
683
			'description' => "Si le champ homonyme contient «1» alors plusieurs noms doivent posséder la même valeur ".
Line -... Line 684...
-
 
684
			"dans le champ nom_complet.",
-
 
685
			'resultat' => false);
651
			"dans le champ nom_complet.",
686
		
652
			'resultat' => false);
687
		$noms_homonymie = $this->classerNomsParNomComplet();
653
		
688
		
654
		// Réalisation du test
689
		// Réalisation du test
655
		$noms_erreur = array();
690
		$noms_erreur = array();
656
		foreach ($noms as $nom) {
691
		foreach ($this->noms as &$nom) {
657
			if ($nom['homonyme'] != '0' && $nom['homonyme'] != '') {
692
			if ($nom['homonyme'] != '0' && $nom['homonyme'] != '') {
658
				if ($noms_homonymie[$nom['nom_complet']] <= 1) {
693
				if ($noms_homonymie[$nom['nom_complet']] <= 1) {
659
					$noms_erreur[] = array($nom['num_nom'], $nom['nom_complet']);
694
					$noms_erreur[] = array($nom['num_nom'], $nom['nom_complet']);
-
 
695
				}
Line 660... Line 696...
660
				}
696
			}
661
			}
697
		}
662
		}
698
		$noms_homonymie = null;
663
		
699
		
664
		// Analyse des résultats
700
		// Analyse des résultats
665
		if (count($noms_erreur) > 0) {
701
		if (count($noms_erreur) > 0) {
666
			$info['message']['entete'] = array('num_nom', 'homonyme introuvable');
702
			$info['message']['entete'] = array('num_nom', 'homonyme introuvable');
-
 
703
			$info['message']['lignes'] = $noms_erreur;
Line 667... Line 704...
667
			$info['message']['lignes'] = $noms_erreur;
704
		} else {
668
		} else {
705
			$info['resultat'] = true;
Line 669... Line 706...
669
			$info['resultat'] = true;
706
		}
670
		}
707
		$noms_erreur = null;
671
		
708
		
672
		$this->traiterResultatTest($info);
709
		$this->traiterResultatTest($info);
673
	}
710
	}
Line 674... Line 711...
674
	
711
	
675
	private function testerHomonymieSyntaxe($noms) {
712
	private function testerHomonymieSyntaxe() {
676
		$info = array('nom' => 'homonyme -> syntaxe',
713
		$info = array('nom' => 'homonyme -> syntaxe',
677
			'description' => "Le champ homonyme contient :\n".
714
			'description' => "Le champ homonyme contient :\n".
678
			" - le chiffre 1 ou une valeur vide.\n",
715
			" - le chiffre 1 ou une valeur vide.\n",
679
			'resultat' => false);
716
			'resultat' => false);
680
		
717
		
681
		// Réalisation du test
718
		// Réalisation du test
Line 693... Line 730...
693
			$info['message']['entete'] = array('num_nom', 'homonyme erroné');
730
			$info['message']['entete'] = array('num_nom', 'homonyme erroné');
694
			$info['message']['lignes'] = $noms_erreur;
731
			$info['message']['lignes'] = $noms_erreur;
695
		} else {
732
		} else {
696
			$info['resultat'] = true;
733
			$info['resultat'] = true;
697
		}
734
		}
-
 
735
		$noms_erreur = null;
Line 698... Line 736...
698
		
736
		
699
		$this->traiterResultatTest($info);
737
		$this->traiterResultatTest($info);
Line 700... Line 738...
700
	}
738
	}
701
	
739
	
702
	private function testerBiblioOrigineSyntaxe($noms) {
740
	private function testerBiblioOrigineSyntaxe() {
703
		$info = array('nom' => 'biblio_origine -> syntaxe',
741
		$info = array('nom' => 'biblio_origine -> syntaxe',
704
			'description' => "Le champ biblio_origine se compose de plusieurs parties séparées par des caractères ".
742
			'description' => "Le champ biblio_origine se compose de plusieurs parties séparées par des caractères ".
705
			"précis qui sont dans l'ordre de gauche à droite :\n".
743
			"précis qui sont dans l'ordre de gauche à droite :\n".
Line 718... Line 756...
718
			"dans le document la position du nom. Le tiret « - » doit toujours servir à séparer un ensemble.",
756
			"dans le document la position du nom. Le tiret « - » doit toujours servir à séparer un ensemble.",
719
			'resultat' => false);
757
			'resultat' => false);
Line 720... Line 758...
720
		
758
		
721
		// Réalisation du test
759
		// Réalisation du test
722
		$noms_erreur = array();
760
		$noms_erreur = array();
723
		foreach ($noms as $nom) {
761
		foreach ($this->noms as &$nom) {
724
			if ($nom['biblio_origine'] != '') {
762
			if ($nom['biblio_origine'] != '') {
725
				if (!$this->verifierBiblioOrigine($nom['biblio_origine'])) {
763
				if (!$this->verifierBiblioOrigine($nom['biblio_origine'])) {
726
					$biblio_traite = $this->repererEspace($nom['biblio_origine']);
764
					$biblio_traite = $this->repererEspace($nom['biblio_origine']);
727
					$noms_erreur[] = array($nom['num_nom'], $biblio_traite);
765
					$noms_erreur[] = array($nom['num_nom'], $biblio_traite);
Line 734... Line 772...
734
			$info['message']['entete'] = array('num_nom', 'biblio_origine erroné');
772
			$info['message']['entete'] = array('num_nom', 'biblio_origine erroné');
735
			$info['message']['lignes'] = $noms_erreur;
773
			$info['message']['lignes'] = $noms_erreur;
736
		} else {
774
		} else {
737
			$info['resultat'] = true;
775
			$info['resultat'] = true;
738
		}
776
		}
-
 
777
		$noms_erreur = null;
Line 739... Line 778...
739
		
778
		
740
		$this->traiterResultatTest($info);
779
		$this->traiterResultatTest($info);
Line 741... Line 780...
741
	}
780
	}
742
	
781
	
743
	private function testerAnneeSyntaxe($noms) {
782
	private function testerAnneeSyntaxe() {
744
		$info = array('nom' => 'annee -> syntaxe',
783
		$info = array('nom' => 'annee -> syntaxe',
745
			'description' => "Le champ annee doit :\n".
784
			'description' => "Le champ annee doit :\n".
746
			" - contenir un nombre de 4 chiffre\n".
785
			" - contenir un nombre de 4 chiffre\n".
Line 747... Line 786...
747
			" - être supérieur ou égal à 1753 ",
786
			" - être supérieur ou égal à 1753 ",
748
			'resultat' => false);
787
			'resultat' => false);
749
		
788
		
750
		// Réalisation du test
789
		// Réalisation du test
751
		$noms_erreur = array();
790
		$noms_erreur = array();
752
		foreach ($noms as $nom) {
791
		foreach ($this->noms as &$nom) {
753
			if ($nom['annee'] != '') {
792
			if ($nom['annee'] != '') {
754
				if (!$this->verifierAnnee($nom['annee'])) {
793
				if (!$this->verifierAnnee($nom['annee'])) {
Line 762... Line 801...
762
			$info['message']['entete'] = array('num_nom', 'annee erroné');
801
			$info['message']['entete'] = array('num_nom', 'annee erroné');
763
			$info['message']['lignes'] = $noms_erreur;
802
			$info['message']['lignes'] = $noms_erreur;
764
		} else {
803
		} else {
765
			$info['resultat'] = true;
804
			$info['resultat'] = true;
766
		}
805
		}
-
 
806
		$noms_erreur = null;
Line 767... Line 807...
767
		
807
		
768
		$this->traiterResultatTest($info);
808
		$this->traiterResultatTest($info);
Line 769... Line 809...
769
	}
809
	}
770
	
810
	
771
	private function testerAuteurSyntaxe($noms) {
811
	private function testerAuteurSyntaxe() {
772
		$info = array('nom' => 'auteur -> syntaxe',
812
		$info = array('nom' => 'auteur -> syntaxe',
773
			'description' => "Le champ auteur doit :\n".
813
			'description' => "Le champ auteur doit :\n".
774
			" - contenir l'intitulé complet des noms de l'auteur ou des auteurs ayant publiés à l'origine la combinaison latine courante.\n".
814
			" - contenir l'intitulé complet des noms de l'auteur ou des auteurs ayant publiés à l'origine la combinaison latine courante.\n".
Line 782... Line 822...
782
			"elle devrait être limitée au nom du premier, suivi de « & al.».\n",
822
			"elle devrait être limitée au nom du premier, suivi de « & al.».\n",
783
			'resultat' => false);
823
			'resultat' => false);
Line 784... Line 824...
784
		
824
		
785
		// Réalisation du test
825
		// Réalisation du test
786
		$noms_erreur = array();
826
		$noms_erreur = array();
787
		foreach ($noms as $nom) {
827
		foreach ($this->noms as &$nom) {
788
			if ($nom['auteur'] != '') {
828
			if ($nom['auteur'] != '') {
789
				if (!$this->verifierAuteur($nom['auteur'])) {
829
				if (!$this->verifierAuteur($nom['auteur'])) {
790
					$intitule_traite = $this->repererEspace($nom['auteur']);
830
					$intitule_traite = $this->repererEspace($nom['auteur']);
791
					$noms_erreur[] = array($nom['num_nom'], $intitule_traite);
831
					$noms_erreur[] = array($nom['num_nom'], $intitule_traite);
Line 798... Line 838...
798
			$info['message']['entete'] = array('num_nom', 'auteur erroné');
838
			$info['message']['entete'] = array('num_nom', 'auteur erroné');
799
			$info['message']['lignes'] = $noms_erreur;
839
			$info['message']['lignes'] = $noms_erreur;
800
		} else {
840
		} else {
801
			$info['resultat'] = true;
841
			$info['resultat'] = true;
802
		}
842
		}
-
 
843
		$noms_erreur = null;
Line 803... Line 844...
803
		
844
		
804
		$this->traiterResultatTest($info);
845
		$this->traiterResultatTest($info);
Line 805... Line 846...
805
	}
846
	}
806
	
847
	
807
	private function testerNomCommercialSyntaxe($noms) {
848
	private function testerNomCommercialSyntaxe() {
808
		$info = array('nom' => 'nom_commercial -> syntaxe',
849
		$info = array('nom' => 'nom_commercial -> syntaxe',
809
			'description' => "Le champ nom_commercial doit contenir un nom commercial conforme aux règles du ".
850
			'description' => "Le champ nom_commercial doit contenir un nom commercial conforme aux règles du ".
810
				"Code Internationnal de Nomenclature des Plantes Cultivées (CINPC) ".
851
				"Code Internationnal de Nomenclature des Plantes Cultivées (CINPC) ".
Line 811... Line 852...
811
				"qui se compose de caractères majuscules (A-Z) incluant des signes diacritiques et des espaces.\n",
852
				"qui se compose de caractères majuscules (A-Z) incluant des signes diacritiques et des espaces.\n",
812
			'resultat' => false);
853
			'resultat' => false);
813
		
854
		
814
		// Réalisation du test
855
		// Réalisation du test
815
		$noms_erreur = array();
856
		$noms_erreur = array();
816
		foreach ($noms as $nom) {
857
		foreach ($this->noms as &$nom) {
817
			if ($nom['nom_commercial'] != '') {
858
			if ($nom['nom_commercial'] != '') {
818
				if (!$this->verifierNomCommercial($nom['nom_commercial'])) {
859
				if (!$this->verifierNomCommercial($nom['nom_commercial'])) {
Line 827... Line 868...
827
			$info['message']['entete'] = array('num_nom', 'cultivar erroné');
868
			$info['message']['entete'] = array('num_nom', 'cultivar erroné');
828
			$info['message']['lignes'] = $noms_erreur;
869
			$info['message']['lignes'] = $noms_erreur;
829
		} else {
870
		} else {
830
			$info['resultat'] = true;
871
			$info['resultat'] = true;
831
		}
872
		}
-
 
873
		$noms_erreur = null;
Line 832... Line 874...
832
		
874
		
833
		$this->traiterResultatTest($info);
875
		$this->traiterResultatTest($info);
Line 834... Line 876...
834
	}
876
	}
835
	
877
	
836
	private function testerNomCommercialPresenceCultivar($noms) {
878
	private function testerNomCommercialPresenceCultivar() {
837
		$info = array('nom' => 'nom_commercial -> groupe_cultivar OU cultivar non vide',
879
		$info = array('nom' => 'nom_commercial -> groupe_cultivar OU cultivar non vide',
838
			'description' => "Si le champ nom_commercial contier un nom commercial alors le champ cultivar OU ".
880
			'description' => "Si le champ nom_commercial contier un nom commercial alors le champ cultivar OU ".
Line 839... Line 881...
839
				"cultivar_groupe ne doit pas être vide.",
881
				"cultivar_groupe ne doit pas être vide.",
840
			'resultat' => false);
882
			'resultat' => false);
841
		
883
		
842
		// Réalisation du test
884
		// Réalisation du test
843
		$noms_erreur = array();
885
		$noms_erreur = array();
844
		foreach ($noms as $nom) {
886
		foreach ($this->noms as &$nom) {
845
			if ($nom['nom_commercial'] != '' && ($nom['cultivar'] == '' && $nom['cultivar_groupe'] == '')) {
887
			if ((isset($nom['nom_commercial']) && $nom['nom_commercial'] != '') && ($nom['cultivar'] == '' && $nom['cultivar_groupe'] == '')) {
Line 846... Line 888...
846
				$noms_erreur[] = array($nom['num_nom'], $nom['nom_complet']);
888
				$noms_erreur[] = array($nom['num_nom'], $nom['nom_complet']);
Line 852... Line 894...
852
			$info['message']['entete'] = array('num_nom', 'nom_commercial sans cultivar ou cultivar_groupe');
894
			$info['message']['entete'] = array('num_nom', 'nom_commercial sans cultivar ou cultivar_groupe');
853
			$info['message']['lignes'] = $noms_erreur;
895
			$info['message']['lignes'] = $noms_erreur;
854
		} else {
896
		} else {
855
			$info['resultat'] = true;
897
			$info['resultat'] = true;
856
		}
898
		}
-
 
899
		$noms_erreur = null;
Line 857... Line 900...
857
		
900
		
858
		$this->traiterResultatTest($info);
901
		$this->traiterResultatTest($info);
Line 859... Line 902...
859
	}
902
	}
860
	
903
	
861
	private function testerCultivarSyntaxe($noms) {
904
	private function testerCultivarSyntaxe() {
862
		$info = array('nom' => 'cultivar -> syntaxe',
905
		$info = array('nom' => 'cultivar -> syntaxe',
863
			'description' => "Le champ cultivar_groupe doit contenir :\n".
906
			'description' => "Le champ cultivar_groupe doit contenir :\n".
864
				" - un nom de cultivar conforme aux règles du Code Internationnal de Nomenclature des Plantes ".
907
				" - un nom de cultivar conforme aux règles du Code Internationnal de Nomenclature des Plantes ".
Line 872... Line 915...
872
				" - cv., convar. ou de guillemets simples (').\n",
915
				" - cv., convar. ou de guillemets simples (').\n",
873
			'resultat' => false);
916
			'resultat' => false);
Line 874... Line 917...
874
		
917
		
875
		// Réalisation du test
918
		// Réalisation du test
876
		$noms_erreur = array();
919
		$noms_erreur = array();
877
		foreach ($noms as $nom) {
920
		foreach ($this->noms as &$nom) {
878
			if ($nom['cultivar'] != '') {
921
			if ($nom['cultivar'] != '') {
879
				if (!$this->verifierEpitheteCultivar($nom['cultivar'])) {
922
				if (!$this->verifierEpitheteCultivar($nom['cultivar'])) {
880
					$epithete_traite = $this->repererEspace($nom['cultivar']);
923
					$epithete_traite = $this->repererEspace($nom['cultivar']);
881
					$noms_erreur[] = array($nom['num_nom'], $epithete_traite);
924
					$noms_erreur[] = array($nom['num_nom'], $epithete_traite);
Line 888... Line 931...
888
			$info['message']['entete'] = array('num_nom', 'cultivar erroné');
931
			$info['message']['entete'] = array('num_nom', 'cultivar erroné');
889
			$info['message']['lignes'] = $noms_erreur;
932
			$info['message']['lignes'] = $noms_erreur;
890
		} else {
933
		} else {
891
			$info['resultat'] = true;
934
			$info['resultat'] = true;
892
		}
935
		}
-
 
936
		$noms_erreur = null;
Line 893... Line 937...
893
		
937
		
894
		$this->traiterResultatTest($info);
938
		$this->traiterResultatTest($info);
Line 895... Line 939...
895
	}
939
	}
896
	
940
	
897
	private function testerCultivarRang($noms) {
941
	private function testerCultivarRang() {
898
		$info = array('nom' => "cultivar -> rang >= {$this->manuel['rang_genre']}",
942
		$info = array('nom' => "cultivar -> rang >= {$this->manuel['rang_genre']}",
Line 899... Line 943...
899
			'description' => "Si le champ cultivar n'est pas vide alors le rang du nom doit être supérieur ou égal à {$this->manuel['rang_genre']}.",
943
			'description' => "Si le champ cultivar n'est pas vide alors le rang du nom doit être supérieur ou égal à {$this->manuel['rang_genre']}.",
900
			'resultat' => false);
944
			'resultat' => false);
901
		
945
		
902
		// Réalisation du test
946
		// Réalisation du test
903
		$noms_erreur = array();
947
		$noms_erreur = array();
904
		foreach ($noms as $nom) {
948
		foreach ($this->noms as &$nom) {
905
			if ($nom['cultivar'] != '') {
949
			if ($nom['cultivar'] != '') {
906
				if ($nom['rang'] < $this->manuel['rang_genre']) {
950
				if ($nom['rang'] < $this->manuel['rang_genre']) {
Line 914... Line 958...
914
			$info['message']['entete'] = array('num_nom', 'nom_complet', 'rang erroné');
958
			$info['message']['entete'] = array('num_nom', 'nom_complet', 'rang erroné');
915
			$info['message']['lignes'] = $noms_erreur;
959
			$info['message']['lignes'] = $noms_erreur;
916
		} else {
960
		} else {
917
			$info['resultat'] = true;
961
			$info['resultat'] = true;
918
		}
962
		}
-
 
963
		$noms_erreur = null;
Line 919... Line 964...
919
		
964
		
920
		$this->traiterResultatTest($info);
965
		$this->traiterResultatTest($info);
Line 921... Line 966...
921
	}
966
	}
922
	
967
	
923
	private function testerGroupeCultivarSyntaxe($noms) {
968
	private function testerGroupeCultivarSyntaxe() {
924
		$info = array('nom' => 'cultivar_groupe -> syntaxe',
969
		$info = array('nom' => 'cultivar_groupe -> syntaxe',
925
			'description' => "Le champ cultivar_groupe doit contenir un nom de groupe de cultivar conforme aux règles ".
970
			'description' => "Le champ cultivar_groupe doit contenir un nom de groupe de cultivar conforme aux règles ".
926
				"du code des plantes cultivées qui se compose de caractères alphanumériques (A-Z,a-z et 0-9) incluant ".
971
				"du code des plantes cultivées qui se compose de caractères alphanumériques (A-Z,a-z et 0-9) incluant ".
927
				"signes diacritiques et marques de ponctuations.\n".
972
				"signes diacritiques et marques de ponctuations.\n".
928
				"Il ne doit pas contenir le mot Groupe, l'abbréviation «gp» ou des parenthèses.\n".
973
				"Il ne doit pas contenir le mot Groupe, l'abbréviation «gp» ou des parenthèses.\n".
Line 929... Line 974...
929
				"Il peut contir à la fin l'abréviation «gx» pour distinguer les groupes des grex.",
974
				"Il peut contir à la fin l'abréviation «gx» pour distinguer les groupes des grex.",
930
			'resultat' => false);
975
			'resultat' => false);
931
		
976
		
932
		// Réalisation du test
977
		// Réalisation du test
933
		$noms_erreur = array();
978
		$noms_erreur = array();
934
		foreach ($noms as $nom) {
979
		foreach ($this->noms as &$nom) {
935
			if ($nom['cultivar_groupe'] != '') {
980
			if ($nom['cultivar_groupe'] != '') {
936
				if (!$this->verifierEpitheteGroupeCultivar($nom['cultivar_groupe'])) {
981
				if (!$this->verifierEpitheteGroupeCultivar($nom['cultivar_groupe'])) {
Line 945... Line 990...
945
			$info['message']['entete'] = array('num_nom', 'cultivar_groupe erroné');
990
			$info['message']['entete'] = array('num_nom', 'cultivar_groupe erroné');
946
			$info['message']['lignes'] = $noms_erreur;
991
			$info['message']['lignes'] = $noms_erreur;
947
		} else {
992
		} else {
948
			$info['resultat'] = true;
993
			$info['resultat'] = true;
949
		}
994
		}
-
 
995
		$noms_erreur = null;
Line 950... Line 996...
950
		
996
		
951
		$this->traiterResultatTest($info);
997
		$this->traiterResultatTest($info);
Line 952... Line 998...
952
	}
998
	}
953
	
999
	
954
	private function testerGroupeCultivarRang($noms) {
1000
	private function testerGroupeCultivarRang() {
955
		$info = array('nom' => "cultivar_groupe -> rang >= {$this->manuel['rang_genre']}",
1001
		$info = array('nom' => "cultivar_groupe -> rang >= {$this->manuel['rang_genre']}",
Line 956... Line 1002...
956
			'description' => "Si le champ cultivar_groupe n'est pas vide alors le rang du nom doit être supérieur ou égal à {$this->manuel['rang_genre']}.",
1002
			'description' => "Si le champ cultivar_groupe n'est pas vide alors le rang du nom doit être supérieur ou égal à {$this->manuel['rang_genre']}.",
957
			'resultat' => false);
1003
			'resultat' => false);
958
		
1004
		
959
		// Réalisation du test
1005
		// Réalisation du test
960
		$noms_erreur = array();
1006
		$noms_erreur = array();
961
		foreach ($noms as $nom) {
1007
		foreach ($this->noms as &$nom) {
962
			if ($nom['cultivar_groupe'] != '') {
1008
			if ($nom['cultivar_groupe'] != '') {
963
				if ($nom['rang'] < $this->manuel['rang_genre']) {
1009
				if ($nom['rang'] < $this->manuel['rang_genre']) {
Line 971... Line 1017...
971
			$info['message']['entete'] = array('num_nom', 'nom_complet', 'rang erroné');
1017
			$info['message']['entete'] = array('num_nom', 'nom_complet', 'rang erroné');
972
			$info['message']['lignes'] = $noms_erreur;
1018
			$info['message']['lignes'] = $noms_erreur;
973
		} else {
1019
		} else {
974
			$info['resultat'] = true;
1020
			$info['resultat'] = true;
975
		}
1021
		}
-
 
1022
		$noms_erreur = null;
Line 976... Line 1023...
976
		
1023
		
977
		$this->traiterResultatTest($info);
1024
		$this->traiterResultatTest($info);
Line 978... Line 1025...
978
	}
1025
	}
979
	
1026
	
980
	private function testerEpitheteInfraSpEspaces($noms) {
1027
	private function testerEpitheteInfraSpEspaces() {
981
		$info = array('nom' => 'epithete_infra_sp -> espaces en trop',
1028
		$info = array('nom' => 'epithete_infra_sp -> espaces en trop',
982
			'description' => "Le champ epithete_infra_sp ne doit pas contenir d'espace avant ou aprés le nom.\n".
1029
			'description' => "Le champ epithete_infra_sp ne doit pas contenir d'espace avant ou aprés le nom.\n".
Line 983... Line 1030...
983
				"Si des espaces sont compris dans la valeur du champ, il ne doit pas y avoir plusieurs espaces consécutifs.",
1030
				"Si des espaces sont compris dans la valeur du champ, il ne doit pas y avoir plusieurs espaces consécutifs.",
984
			'resultat' => false);
1031
			'resultat' => false);
985
		
1032
		
986
		// Réalisation du test
1033
		// Réalisation du test
987
		$noms_erreur = array();
1034
		$noms_erreur = array();
988
		foreach ($noms as $nom) {
1035
		foreach ($this->noms as &$nom) {
989
			if ($nom['epithete_infra_sp'] != '') {
1036
			if ($nom['epithete_infra_sp'] != '') {
990
				if (preg_match('/(?:^\s+(?!:\s+)|(?!:\s+)\s{2,}(?!:\s+)|(?!:\s+)\s+$)/', $nom['epithete_infra_sp'])) {
1037
				if (preg_match('/(?:^\s+(?!:\s+)|(?!:\s+)\s{2,}(?!:\s+)|(?!:\s+)\s+$)/', $nom['epithete_infra_sp'])) {
Line 999... Line 1046...
999
			$info['message']['entete'] = array('num_nom', 'epithete_infra_sp erroné');
1046
			$info['message']['entete'] = array('num_nom', 'epithete_infra_sp erroné');
1000
			$info['message']['lignes'] = $noms_erreur;
1047
			$info['message']['lignes'] = $noms_erreur;
1001
		} else {
1048
		} else {
1002
			$info['resultat'] = true;
1049
			$info['resultat'] = true;
1003
		}
1050
		}
-
 
1051
		$noms_erreur = null;
Line 1004... Line 1052...
1004
		
1052
		
1005
		$this->traiterResultatTest($info);
1053
		$this->traiterResultatTest($info);
Line 1006... Line 1054...
1006
	}
1054
	}
1007
	
1055
	
1008
	private function testerEpitheteInfraSpSyntaxe($noms) {
1056
	private function testerEpitheteInfraSpSyntaxe() {
1009
		$info = array('nom' => 'epithete_infra_sp -> syntaxe',
1057
		$info = array('nom' => 'epithete_infra_sp -> syntaxe',
1010
			'description' => "Le champ epithete_infra_sp peut contenir :\n".
1058
			'description' => "Le champ epithete_infra_sp peut contenir :\n".
1011
			 	" - un mot unique composé de lettres minuscules avec ou sans tréma (¨) et de tirets (-). \n".
1059
			 	" - un mot unique composé de lettres minuscules avec ou sans tréma (¨) et de tirets (-). \n".
Line 1015... Line 1063...
1015
				"	par la lettre x entourée de caractères espaces.",
1063
				"	par la lettre x entourée de caractères espaces.",
1016
			'resultat' => false);
1064
			'resultat' => false);
Line 1017... Line 1065...
1017
		
1065
		
1018
		// Réalisation du test
1066
		// Réalisation du test
1019
		$noms_erreur = array();
1067
		$noms_erreur = array();
1020
		foreach ($noms as $nom) {
1068
		foreach ($this->noms as &$nom) {
1021
			if ($nom['epithete_infra_sp'] != '') {
1069
			if ($nom['epithete_infra_sp'] != '') {
1022
				$mots = explode(' ', $nom['epithete_infra_sp']);
1070
				$mots = explode(' ', $nom['epithete_infra_sp']);
1023
				foreach ($mots as $mot) {
1071
				foreach ($mots as $mot) {
1024
					if (!(preg_match('/^[+x]$/', $mot) || $this->verifierTypeEpithete($mot)|| $this->verifierEpitheteSp($mot))) {
1072
					if (!(preg_match('/^[+x]$/', $mot) || $this->verifierTypeEpithete($mot)|| $this->verifierEpitheteSp($mot))) {
Line 1034... Line 1082...
1034
			$info['message']['entete'] = array('num_nom', 'epithete_infra_sp erroné');
1082
			$info['message']['entete'] = array('num_nom', 'epithete_infra_sp erroné');
1035
			$info['message']['lignes'] = $noms_erreur;
1083
			$info['message']['lignes'] = $noms_erreur;
1036
		} else {
1084
		} else {
1037
			$info['resultat'] = true;
1085
			$info['resultat'] = true;
1038
		}
1086
		}
-
 
1087
		$noms_erreur = null;
Line 1039... Line 1088...
1039
		
1088
		
1040
		$this->traiterResultatTest($info);
1089
		$this->traiterResultatTest($info);
Line 1041... Line 1090...
1041
	}
1090
	}
1042
	
1091
	
1043
	private function testerEpitheteInfraSpRang($noms) {
1092
	private function testerEpitheteInfraSpRang() {
1044
		$info = array('nom' => "epithete_infra_sp -> rang > {$this->manuel['rang_sp']}",
1093
		$info = array('nom' => "epithete_infra_sp -> rang > {$this->manuel['rang_sp']}",
Line 1045... Line 1094...
1045
			'description' => "Si le champ epithete_infra_sp n'est pas vide alors le rang du nom doit être supérieur à {$this->manuel['rang_sp']}.",
1094
			'description' => "Si le champ epithete_infra_sp n'est pas vide alors le rang du nom doit être supérieur à {$this->manuel['rang_sp']}.",
1046
			'resultat' => false);
1095
			'resultat' => false);
1047
		
1096
		
1048
		// Réalisation du test
1097
		// Réalisation du test
1049
		$noms_erreur = array();
1098
		$noms_erreur = array();
1050
		foreach ($noms as $nom) {
1099
		foreach ($this->noms as &$nom) {
1051
			if ($nom['epithete_infra_sp'] != '') {
1100
			if ($nom['epithete_infra_sp'] != '') {
1052
				if ($nom['rang'] < $this->manuel['rang_sp']) {
1101
				if ($nom['rang'] < $this->manuel['rang_sp']) {
Line 1060... Line 1109...
1060
			$info['message']['entete'] = array('num_nom', 'nom_complet', 'rang erroné');
1109
			$info['message']['entete'] = array('num_nom', 'nom_complet', 'rang erroné');
1061
			$info['message']['lignes'] = $noms_erreur;
1110
			$info['message']['lignes'] = $noms_erreur;
1062
		} else {
1111
		} else {
1063
			$info['resultat'] = true;
1112
			$info['resultat'] = true;
1064
		}
1113
		}
-
 
1114
		$noms_erreur = null;
Line 1065... Line 1115...
1065
		
1115
		
1066
		$this->traiterResultatTest($info);
1116
		$this->traiterResultatTest($info);
Line 1067... Line 1117...
1067
	}
1117
	}
1068
	
1118
	
1069
	private function testerTypeEpitheteEspaces($noms) {
1119
	private function testerTypeEpitheteEspaces() {
1070
		$info = array('nom' => 'type_epithete -> espaces en trop',
1120
		$info = array('nom' => 'type_epithete -> espaces en trop',
Line 1071... Line 1121...
1071
			'description' => "Le champ type_epithete ne doit pas contenir d'espace.",
1121
			'description' => "Le champ type_epithete ne doit pas contenir d'espace.",
1072
			'resultat' => false);
1122
			'resultat' => false);
1073
		
1123
		
1074
		// Réalisation du test
1124
		// Réalisation du test
1075
		$noms_erreur = array();
1125
		$noms_erreur = array();
1076
		foreach ($noms as $nom) {
1126
		foreach ($this->noms as &$nom) {
1077
			if ($nom['type_epithete'] != '') {
1127
			if ($nom['type_epithete'] != '') {
1078
				if (preg_match('/\s+/', $nom['type_epithete'])) {
1128
				if (preg_match('/\s+/', $nom['type_epithete'])) {
Line 1091... Line 1141...
1091
		}
1141
		}
Line 1092... Line 1142...
1092
		
1142
		
1093
		$this->traiterResultatTest($info);
1143
		$this->traiterResultatTest($info);
Line 1094... Line 1144...
1094
	}
1144
	}
1095
	
1145
	
1096
	private function testerTypeEpitheteSyntaxe($noms) {
1146
	private function testerTypeEpitheteSyntaxe() {
1097
		$info = array('nom' => 'type_epithete -> syntaxe',
1147
		$info = array('nom' => 'type_epithete -> syntaxe',
1098
			'description' => "Le champ type_epithete doit contenir un mot unique composé de lettres minuscules sans ".
1148
			'description' => "Le champ type_epithete doit contenir un mot unique composé de lettres minuscules sans ".
Line 1099... Line 1149...
1099
				" accents et de tirets (-). Il commence par une lettre minuscule sans accent.",
1149
				" accents et de tirets (-). Il commence par une lettre minuscule sans accent.",
1100
			'resultat' => false);
1150
			'resultat' => false);
1101
		
1151
		
1102
		// Réalisation du test
1152
		// Réalisation du test
1103
		$noms_erreur = array();
1153
		$noms_erreur = array();
1104
		foreach ($noms as $nom) {
1154
		foreach ($this->noms as &$nom) {
1105
			if ($nom['type_epithete'] != '') {
1155
			if ($nom['type_epithete'] != '') {
1106
				if (!$this->verifierTypeEpithete($nom['type_epithete'])) {
1156
				if (!$this->verifierTypeEpithete($nom['type_epithete'])) {
Line 1118... Line 1168...
1118
		}
1168
		}
Line 1119... Line 1169...
1119
		
1169
		
1120
		$this->traiterResultatTest($info);
1170
		$this->traiterResultatTest($info);
Line 1121... Line 1171...
1121
	}
1171
	}
1122
	
1172
	
1123
	private function testerTypeEpitheteHybridite($noms) {
1173
	private function testerTypeEpitheteHybridite() {
1124
		$info = array('nom' => 'type_epithete -> hybridité',
1174
		$info = array('nom' => 'type_epithete -> hybridité',
1125
			'description' => "Le champ type_epithete ne doit pas contenir de préfixe indiquant l'hybridité comme : \n".
1175
			'description' => "Le champ type_epithete ne doit pas contenir de préfixe indiquant l'hybridité comme : \n".
1126
				" - «n-» \n".
1176
				" - «n-» \n".
Line 1127... Line 1177...
1127
				" - «notho-» \n",
1177
				" - «notho-» \n",
1128
			'resultat' => false);
1178
			'resultat' => false);
1129
		
1179
		
1130
		// Réalisation du test
1180
		// Réalisation du test
1131
		$noms_erreur = array();
1181
		$noms_erreur = array();
1132
		foreach ($noms as $nom) {
1182
		foreach ($this->noms as &$nom) {
1133
			if ($nom['type_epithete'] != '') {
1183
			if ($nom['type_epithete'] != '') {
1134
				if (preg_match('/^(?:n-|notho-)/', $nom['type_epithete'])) {
1184
				if (preg_match('/^(?:n-|notho-)/', $nom['type_epithete'])) {
Line 1157... Line 1207...
1157
		$info['message'] = $nbre_colonnes;
1207
		$info['message'] = $nbre_colonnes;
1158
		if ($nbre_colonnes >= 35) {
1208
		if ($nbre_colonnes >= 35) {
1159
			$info['resultat'] = true;
1209
			$info['resultat'] = true;
1160
		}
1210
		}
1161
		$this->traiterResultatTest($info);
1211
		$this->traiterResultatTest($info);
-
 
1212
		return ($info['resultat'] ? '1' : '0');
1162
	}
1213
	}
Line 1163... Line 1214...
1163
	
1214
	
1164
	private function testerNomDesChamps($colonnes) {
1215
	private function testerNomDesChamps($colonnes) {
1165
		$info = array('nom' => 'Structure -> noms des champs',
1216
		$info = array('nom' => 'Structure -> noms des champs',
Line 1184... Line 1235...
1184
		if (!$ok) {
1235
		if (!$ok) {
1185
			$info['message'] = 'Champs manquant : '.implode(', ', $champs_manquant).'.';
1236
			$info['message'] = 'Champs manquant : '.implode(', ', $champs_manquant).'.';
1186
		}
1237
		}
Line 1187... Line 1238...
1187
		
1238
		
-
 
1239
		$this->traiterResultatTest($info);
1188
		$this->traiterResultatTest($info);
1240
		return ($info['resultat'] ? '1' : '0');
Line 1189... Line 1241...
1189
	}
1241
	}
1190
	
1242
	
1191
	private function testerTypeDesChamps($colonnes) {
1243
	private function testerTypeDesChamps($colonnes) {
Line 1223... Line 1275...
1223
		} else {
1275
		} else {
1224
			$info['resultat'] = true;
1276
			$info['resultat'] = true;
1225
		}
1277
		}
Line 1226... Line 1278...
1226
		
1278
		
-
 
1279
		$this->traiterResultatTest($info);
1227
		$this->traiterResultatTest($info);
1280
		return ($info['resultat'] ? '1' : '0');
Line 1228... Line 1281...
1228
	}
1281
	}
1229
	
1282
	
1230
	private function testerTailleDesChamps($colonnes, $analyses) {
1283
	private function testerTailleDesChamps($colonnes, $analyses) {
Line 1279... Line 1332...
1279
				$info['resultat'] = true;
1332
				$info['resultat'] = true;
1280
			}
1333
			}
1281
		}
1334
		}
Line 1282... Line 1335...
1282
		
1335
		
-
 
1336
		$this->traiterResultatTest($info);
1283
		$this->traiterResultatTest($info);
1337
		return ($info['resultat'] ? '1' : '0');
Line 1284... Line 1338...
1284
	}
1338
	}
1285
	
1339
	
1286
	private function testerNumNomSuperieurAZero($noms) {
1340
	private function testerNumNomSuperieurAZero() {
1287
		$info = array('nom' => 'num_nom -> supérieur à 0',
1341
		$info = array('nom' => 'num_nom -> supérieur à 0',
Line 1288... Line 1342...
1288
			'description' => "Le champ num_nom doit contenir des nombres entiers supérieurs à 0.",
1342
			'description' => "Le champ num_nom doit contenir des nombres entiers supérieurs à 0.",
1289
			'resultat' => false);
1343
			'resultat' => false);
1290
		
1344
		
1291
		// Réalisation du test
1345
		// Réalisation du test
1292
		$noms_erreur = array();
1346
		$noms_erreur = array();
1293
		foreach ($noms as $nom) {
1347
		foreach ($this->noms as &$nom) {
1294
			if ($nom['num_nom'] <= 0) {
1348
			if ($nom['num_nom'] <= 0) {
Line 1304... Line 1358...
1304
		}
1358
		}
Line 1305... Line 1359...
1305
		
1359
		
1306
		$this->traiterResultatTest($info);
1360
		$this->traiterResultatTest($info);
Line 1307... Line 1361...
1307
	}
1361
	}
1308
	
1362
	
1309
	private function testerNumNomRetenuSuperieurAZero($noms) {
1363
	private function testerNumNomRetenuSuperieurAZero() {
1310
		$info = array('nom' => 'num_nom_retenu -> supérieur à 0',
1364
		$info = array('nom' => 'num_nom_retenu -> supérieur à 0',
Line 1311... Line 1365...
1311
			'description' => "Le champ num_nom_retenu doit contenir des nombres entiers supérieurs à 0 ou être vide.",
1365
			'description' => "Le champ num_nom_retenu doit contenir des nombres entiers supérieurs à 0 ou être vide.",
1312
			'resultat' => false);
1366
			'resultat' => false);
1313
		
1367
		
1314
		// Réalisation du test
1368
		// Réalisation du test
1315
		$noms_erreur = array();
1369
		$noms_erreur = array();
1316
		foreach ($noms as $nom) {
1370
		foreach ($this->noms as &$nom) {
1317
			if ($nom['num_nom_retenu'] != '' && $nom['num_nom_retenu'] <= 0) {
1371
			if ($nom['num_nom_retenu'] != '' && $nom['num_nom_retenu'] <= 0) {
Line 1327... Line 1381...
1327
		}
1381
		}
Line 1328... Line 1382...
1328
		
1382
		
1329
		$this->traiterResultatTest($info);
1383
		$this->traiterResultatTest($info);
Line 1330... Line 1384...
1330
	}
1384
	}
1331
	
1385
	
1332
	private function testerNumTaxSupEgalZeroUnique($noms) {
1386
	private function testerNumTaxSupEgalZeroUnique() {
1333
		$info = array('nom' => 'num_tax_sup -> égal à 0 unique',
1387
		$info = array('nom' => 'num_tax_sup -> égal à 0 unique',
Line 1334... Line 1388...
1334
			'description' => "Un seul enregistrement doit posséder la valeur 0 dans le champ num_tax_sup. Il correspond au premier taxon de la classification.",
1388
			'description' => "Un seul enregistrement doit posséder la valeur 0 dans le champ num_tax_sup. Il correspond au premier taxon de la classification.",
1335
			'resultat' => false);
1389
			'resultat' => false);
1336
		
1390
		
1337
		// Réalisation du test
1391
		// Réalisation du test
1338
		$noms_erreur = array();
1392
		$noms_erreur = array();
1339
		foreach ($noms as $nom) {
1393
		foreach ($this->noms as &$nom) {
1340
			if (preg_match('/^0$/', $nom['num_tax_sup'])) {
1394
			if (preg_match('/^0$/', $nom['num_tax_sup'])) {
Line 1350... Line 1404...
1350
		}
1404
		}
Line 1351... Line 1405...
1351
		
1405
		
1352
		$this->traiterResultatTest($info);
1406
		$this->traiterResultatTest($info);
Line 1353... Line 1407...
1353
	}
1407
	}
1354
	
1408
	
1355
	private function testerTaxSupPourTaxon($noms) {
1409
	private function testerTaxSupPourTaxon() {
1356
		$info = array('nom' => 'Classification -> uniquement pour les taxons',
1410
		$info = array('nom' => 'Classification -> uniquement pour les taxons',
1357
			'description' => "Seul les enregistrements représentant un taxon doivent posséder une valeur dans le champ num_tax_sup.\n".
1411
			'description' => "Seul les enregistrements représentant un taxon doivent posséder une valeur dans le champ num_tax_sup.\n".
Line 1358... Line 1412...
1358
				"Si num_nom_retenu est différent de num_nom (= nom synonyme) alors num_tax_sup doit être vide.",
1412
				"Si num_nom_retenu est différent de num_nom (= nom synonyme) alors num_tax_sup doit être vide.",
1359
			'resultat' => false);
1413
			'resultat' => false);
1360
		
1414
		
1361
		// Réalisation du test
1415
		// Réalisation du test
1362
		$noms_erreur = array();
1416
		$noms_erreur = array();
1363
		foreach ($noms as $nom) {
1417
		foreach ($this->noms as &$nom) {
1364
			if ($nom['num_nom_retenu'] != $nom['num_nom'] && $nom['num_tax_sup'] != '') {
1418
			if ($nom['num_nom_retenu'] != $nom['num_nom'] && $nom['num_tax_sup'] != '') {
Line 1374... Line 1428...
1374
		}
1428
		}
Line 1375... Line 1429...
1375
		
1429
		
1376
		$this->traiterResultatTest($info);
1430
		$this->traiterResultatTest($info);
Line 1377... Line 1431...
1377
	}
1431
	}
1378
	
1432
	
1379
	private function testerExitenceTaxonSuperieur($noms) {
1433
	private function testerExitenceTaxonSuperieur() {
1380
		$info = array('nom' => 'Classification -> existence du taxon supérieur',
1434
		$info = array('nom' => 'Classification -> existence du taxon supérieur',
Line 1381... Line 1435...
1381
			'description' => "Pour chaque enregistrement représentant un taxon doit posséder un taxon supérieur sauf la racine de la classification.",
1435
			'description' => "Pour chaque enregistrement représentant un taxon doit posséder un taxon supérieur sauf la racine de la classification.",
1382
			'resultat' => false);
1436
			'resultat' => false);
1383
		
1437
		
1384
		// Réalisation du test
1438
		// Réalisation du test
1385
		$noms_erreur = array();
1439
		$noms_erreur = array();
1386
		foreach ($noms as $nom) {
1440
		foreach ($this->noms as &$nom) {
1387
			if ($nom['num_nom_retenu'] == $nom['num_nom']) {
1441
			if ($nom['num_nom_retenu'] == $nom['num_nom']) {
1388
				if ($nom['num_tax_sup'] != 0 && !isset($noms[$nom['num_tax_sup']])) {
1442
				if ($nom['num_tax_sup'] != 0 && !isset($this->noms[$nom['num_tax_sup']])) {
1389
					$noms_erreur[] = $nom['num_nom'];
1443
					$noms_erreur[] = $nom['num_nom'];
Line 1399... Line 1453...
1399
		}
1453
		}
Line 1400... Line 1454...
1400
		
1454
		
1401
		$this->traiterResultatTest($info);
1455
		$this->traiterResultatTest($info);
Line 1402... Line 1456...
1402
	}
1456
	}
1403
	
1457
	
1404
	private function testerClassificationRang($noms) {
1458
	private function testerClassificationRang() {
1405
		$info = array('nom' => 'Classification -> taxon supérieur avec rang inférieur',
1459
		$info = array('nom' => 'Classification -> taxon supérieur avec rang inférieur',
Line 1406... Line 1460...
1406
			'description' => "Pour chaque enregistrement représentant un taxon, chaque taxon supérieur doit avoir un rang inférieur au taxon courant.",
1460
			'description' => "Pour chaque enregistrement représentant un taxon, chaque taxon supérieur doit avoir un rang inférieur au taxon courant.",
1407
			'resultat' => false);
1461
			'resultat' => false);
1408
		
1462
		
1409
		// Réalisation du test
1463
		// Réalisation du test
1410
		$noms_erreur = array();
1464
		$noms_erreur = array();
1411
		foreach ($noms as $nom) {
1465
		foreach ($this->noms as &$nom) {
1412
			if ($nom['num_nom_retenu'] == $nom['num_nom']) {
1466
			if ($nom['num_nom_retenu'] == $nom['num_nom']) {
1413
				if (isset($noms[$nom['num_tax_sup']])) {
1467
				if (isset($this->noms[$nom['num_tax_sup']])) {
1414
					$nom_sup = $noms[$nom['num_tax_sup']];
1468
					$nom_sup = $this->noms[$nom['num_tax_sup']];
1415
					if ($nom_sup['rang'] > $nom['rang']) {
1469
					if ($nom_sup['rang'] > $nom['rang']) {
1416
						$noms_erreur[] = $nom['num_nom'];
1470
						$noms_erreur[] = $nom['num_nom'];
Line 1427... Line 1481...
1427
		}
1481
		}
Line 1428... Line 1482...
1428
		
1482
		
1429
		$this->traiterResultatTest($info);
1483
		$this->traiterResultatTest($info);
Line 1430... Line 1484...
1430
	}
1484
	}
1431
	
1485
	
1432
	private function testerClassification($noms) {
1486
	private function testerClassification() {
1433
		$info = array('nom' => 'Classification -> racine liée à chaque noeud',
1487
		$info = array('nom' => 'Classification -> racine liée à chaque noeud',
Line 1434... Line 1488...
1434
			'description' => "Pour chaque enregistrement, la classification doit pouvoir être remonté jusqu'à un même nom unique possédant une valeur num_tax_sup de 0.",
1488
			'description' => "Pour chaque enregistrement, la classification doit pouvoir être remonté jusqu'à un même nom unique possédant une valeur num_tax_sup de 0.",
1435
			'resultat' => false);
1489
			'resultat' => false);
1436
		
1490
		
1437
		// Réalisation du test
1491
		// Réalisation du test
1438
		$noms_erreur = array();
1492
		$noms_erreur = array();
1439
		foreach ($noms as $nom) {
1493
		foreach ($this->noms as &$nom) {
1440
			if ($nom['num_nom_retenu'] == $nom['num_nom']) {
1494
			if ($nom['num_nom_retenu'] == $nom['num_nom']) {
1441
				$classif_ok = $this->remonterClassif($noms, $nom);
1495
				$classif_ok = $this->remonterClassif($nom);
1442
				if ($classif_ok === false) {
1496
				if ($classif_ok === false) {
1443
					$noms_erreur[] = $nom['num_nom'];
1497
					$noms_erreur[] = $nom['num_nom'];
Line 1453... Line 1507...
1453
		}
1507
		}
Line 1454... Line 1508...
1454
		
1508
		
1455
		$this->traiterResultatTest($info);
1509
		$this->traiterResultatTest($info);
Line 1456... Line 1510...
1456
	}
1510
	}
-
 
1511
	
1457
	
1512
	private function remonterClassif($nom) {
1458
	private function remonterClassif(&$noms, $nom) {
1513
		if (is_int($nom['num_tax_sup'])) {
1459
		if (!isset($noms[$nom['num_tax_sup']]) && $nom['num_tax_sup'] == '0') {
1514
			if (!isset($this->noms[$nom['num_tax_sup']]) && $nom['num_tax_sup'] == '0') {
1460
			return true;
1515
				return true;
-
 
1516
			} else if (!isset($this->noms[$nom['num_tax_sup']]) && $nom['num_tax_sup'] != '0') {
-
 
1517
				return false;
-
 
1518
			} else {
1461
		} else if (!isset($noms[$nom['num_tax_sup']]) && $nom['num_tax_sup'] != '0') {
1519
				return $this->remonterClassif($this->noms[$nom['num_tax_sup']]);
1462
			return false;
1520
			}
1463
		} else {
1521
		} else {
1464
			return $this->remonterClassif($noms, $noms[$nom['num_tax_sup']]);
1522
			return false;
Line 1465... Line 1523...
1465
		}
1523
		}
1466
	}
1524
	}
1467
	
1525
	
1468
	private function testerRang($noms) {
1526
	private function testerRang() {
Line 1469... Line 1527...
1469
		$info = array('nom' => 'rang',
1527
		$info = array('nom' => 'rang',
Line 1470... Line 1528...
1470
			'description' => "Le rang doit correspondre à un valeur numérique définit dans le manuel.",
1528
			'description' => "Le rang doit correspondre à un valeur numérique définit dans le manuel.",
1471
			'resultat' => false);
1529
			'resultat' => false);
1472
		
1530
		
1473
		$rangs = array_flip(explode(',', $this->manuel['rangs']));
1531
		$rangs = array_flip(explode(',', $this->manuel['rangs']));
1474
		
1532
		
1475
		// Réalisation du test
1533
		// Réalisation du test
1476
		$noms_erreur = array();
1534
		$noms_erreur = array();
Line 1488... Line 1546...
1488
		}
1546
		}
Line 1489... Line 1547...
1489
		
1547
		
1490
		$this->traiterResultatTest($info);
1548
		$this->traiterResultatTest($info);
Line 1491... Line 1549...
1491
	}
1549
	}
1492
	
1550
	
1493
	private function testerNomCompletSupraGenerique($noms) {
1551
	private function testerNomCompletSupraGenerique() {
1494
		$info = array('nom' => 'nom_complet -> noms supra-génériques',
1552
		$info = array('nom' => 'nom_complet -> noms supra-génériques',
1495
			'description' => "Si le rang est < à {$this->manuel['rang_genre']} le nom_complet doit correspondre à la valeur du champ nom_supra_generique. ".
1553
			'description' => "Si le rang est < à {$this->manuel['rang_genre']} le nom_complet doit correspondre à la valeur du champ nom_supra_generique. ".
Line 1496... Line 1554...
1496
				"Les valeurs des champs cultivar_groupe, cultivar et nom_commercial peuvent s'y ajouter.",
1554
				"Les valeurs des champs cultivar_groupe, cultivar et nom_commercial peuvent s'y ajouter.",
1497
			'resultat' => false);
1555
			'resultat' => false);
1498
		
1556
		
1499
		// Réalisation du test
1557
		// Réalisation du test
1500
		$noms_erreur = array();
1558
		$noms_erreur = array();
1501
		foreach ($noms as $nom) {
1559
		foreach ($this->noms as &$nom) {
1502
			if ($nom['rang'] < $this->manuel['rang_genre']) {
1560
			if ($nom['rang'] < $this->manuel['rang_genre']) {
1503
				$suffixe_plte_cultivee = $this->construireSuffixeNomPltCultivee($nom);
1561
				$suffixe_plte_cultivee = $this->construireSuffixeNomPltCultivee($nom);
Line 1519... Line 1577...
1519
		}
1577
		}
Line 1520... Line 1578...
1520
		
1578
		
1521
		$this->traiterResultatTest($info);
1579
		$this->traiterResultatTest($info);
Line 1522... Line 1580...
1522
	}
1580
	}
1523
	
1581
	
1524
	private function testerNomCompletGenre($noms) {
1582
	private function testerNomCompletGenre() {
1525
		$info = array('nom' => 'nom_complet -> noms de genres',
1583
		$info = array('nom' => 'nom_complet -> noms de genres',
1526
			'description' => "Si le rang est = à {$this->manuel['rang_genre']} le nom_complet doit correspondre à la valeur du champ genre. ".
1584
			'description' => "Si le rang est = à {$this->manuel['rang_genre']} le nom_complet doit correspondre à la valeur du champ genre. ".
Line 1527... Line 1585...
1527
				"Les valeurs des champs cultivar_groupe, cultivar et nom_commercial peuvent s'y ajouter.",
1585
				"Les valeurs des champs cultivar_groupe, cultivar et nom_commercial peuvent s'y ajouter.",
1528
			'resultat' => false);
1586
			'resultat' => false);
1529
		
1587
		
1530
		// Réalisation du test
1588
		// Réalisation du test
1531
		$noms_erreur = array();
1589
		$noms_erreur = array();
1532
		foreach ($noms as $nom) {
1590
		foreach ($this->noms as &$nom) {
1533
			if ($nom['rang'] == $this->manuel['rang_genre']) {
1591
			if ($nom['rang'] == $this->manuel['rang_genre']) {
1534
				$suffixe_plte_cultivee = $this->construireSuffixeNomPltCultivee($nom);
1592
				$suffixe_plte_cultivee = $this->construireSuffixeNomPltCultivee($nom);
Line 1550... Line 1608...
1550
		}
1608
		}
Line 1551... Line 1609...
1551
		
1609
		
1552
		$this->traiterResultatTest($info);
1610
		$this->traiterResultatTest($info);
Line 1553... Line 1611...
1553
	}
1611
	}
1554
	
1612
	
1555
	private function testerNomCompletInfraGenre($noms) {
1613
	private function testerNomCompletInfraGenre() {
1556
		$info = array('nom' => 'nom_complet -> noms infra-génériques',
1614
		$info = array('nom' => 'nom_complet -> noms infra-génériques',
1557
			'description' => "Si le rang est > à {$this->manuel['rang_genre']} et < à {$this->manuel['rang_sp']} le nom_complet doit correspondre à une des formules suivantes : \n".
1615
			'description' => "Si le rang est > à {$this->manuel['rang_genre']} et < à {$this->manuel['rang_sp']} le nom_complet doit correspondre à une des formules suivantes : \n".
1558
			" genre + ' ' + type_epithete + ' ' + epithete_infra_generique \n".
1616
			" genre + ' ' + type_epithete + ' ' + epithete_infra_generique \n".
1559
			" genre + ' ' + epithete_infra_generique + ' ' + type_epithete=agg. \n".
1617
			" genre + ' ' + epithete_infra_generique + ' ' + type_epithete=agg. \n".
Line 1560... Line 1618...
1560
			"Les valeurs des champs cultivar_groupe, cultivar et nom_commercial peuvent s'y ajouter.",
1618
			"Les valeurs des champs cultivar_groupe, cultivar et nom_commercial peuvent s'y ajouter.",
1561
			'resultat' => false);
1619
			'resultat' => false);
1562
		
1620
		
1563
		// Réalisation du test
1621
		// Réalisation du test
1564
		$noms_erreur = array();
1622
		$noms_erreur = array();
1565
		foreach ($noms as $nom) {
1623
		foreach ($this->noms as &$nom) {
1566
			if ($nom['rang'] > $this->manuel['rang_genre'] && $nom['rang'] < $this->manuel['rang_sp']) {
1624
			if ($nom['rang'] > $this->manuel['rang_genre'] && $nom['rang'] < $this->manuel['rang_sp']) {
1567
				$suffixe_plte_cultivee = $this->construireSuffixeNomPltCultivee($nom);
1625
				$suffixe_plte_cultivee = $this->construireSuffixeNomPltCultivee($nom);
Line 1588... Line 1646...
1588
			$info['message']['entete'] = array('num_nom', 'nom_complet', 'nom_complet corrigé');
1646
			$info['message']['entete'] = array('num_nom', 'nom_complet', 'nom_complet corrigé');
1589
			$info['message']['lignes'] = $noms_erreur;
1647
			$info['message']['lignes'] = $noms_erreur;
1590
		} else {
1648
		} else {
1591
			$info['resultat'] = true;
1649
			$info['resultat'] = true;
1592
		}
1650
		}
-
 
1651
		$noms_erreur = null;
Line 1593... Line 1652...
1593
		
1652
		
1594
		$this->traiterResultatTest($info);
1653
		$this->traiterResultatTest($info);
Line 1595... Line 1654...
1595
	}
1654
	}
1596
	
1655
	
1597
	private function testerNomCompletEspece($noms) {
1656
	private function testerNomCompletEspece() {
1598
		$info = array('nom' => "nom_complet -> noms d'espèce",
1657
		$info = array('nom' => "nom_complet -> noms d'espèce",
1599
			'description' => "Si le rang est = à {$this->manuel['rang_sp']} le nom_complet doit correspondre à la formule : \n".
1658
			'description' => "Si le rang est = à {$this->manuel['rang_sp']} le nom_complet doit correspondre à la formule : \n".
1600
				" genre + ' ' + epithete_sp \n".
1659
				" genre + ' ' + epithete_sp \n".
Line 1601... Line 1660...
1601
				"Les valeurs des champs cultivar_groupe, cultivar et nom_commercial peuvent s'y ajouter.",
1660
				"Les valeurs des champs cultivar_groupe, cultivar et nom_commercial peuvent s'y ajouter.",
1602
			'resultat' => false);
1661
			'resultat' => false);
1603
		
1662
		
1604
		// Réalisation du test
1663
		// Réalisation du test
1605
		$noms_erreur = array();
1664
		$noms_erreur = array();
1606
		foreach ($noms as $nom) {
1665
		foreach ($this->noms as &$nom) {
1607
			if ($nom['rang'] == $this->manuel['rang_sp']) {
1666
			if ($nom['rang'] == $this->manuel['rang_sp']) {
1608
				$suffixe_plte_cultivee = $this->construireSuffixeNomPltCultivee($nom);
1667
				$suffixe_plte_cultivee = $this->construireSuffixeNomPltCultivee($nom);
Line 1621... Line 1680...
1621
			$info['message']['entete'] = array('num_nom', 'nom_complet', 'nom_complet corrigé');
1680
			$info['message']['entete'] = array('num_nom', 'nom_complet', 'nom_complet corrigé');
1622
			$info['message']['lignes'] = $noms_erreur;
1681
			$info['message']['lignes'] = $noms_erreur;
1623
		} else {
1682
		} else {
1624
			$info['resultat'] = true;
1683
			$info['resultat'] = true;
1625
		}
1684
		}
-
 
1685
		$noms_erreur = null;
Line 1626... Line 1686...
1626
		
1686
		
1627
		$this->traiterResultatTest($info);
1687
		$this->traiterResultatTest($info);
Line 1628... Line 1688...
1628
	}
1688
	}
1629
	
1689
	
1630
	private function testerNomCompletInfraSpecifique($noms) {
1690
	private function testerNomCompletInfraSpecifique() {
1631
		$info = array('nom' => 'nom_complet -> noms infra-spécifiques',
1691
		$info = array('nom' => 'nom_complet -> noms infra-spécifiques',
1632
			'description' => "Si le rang est > à {$this->manuel['rang_sp']} le nom_complet doit correspondre à la formule : \n".
1692
			'description' => "Si le rang est > à {$this->manuel['rang_sp']} le nom_complet doit correspondre à la formule : \n".
1633
				" genre + ' ' + epithete_sp + ' ' + type_epithete + ' ' + epithete_infra_generique\n".	
1693
				" genre + ' ' + epithete_sp + ' ' + type_epithete + ' ' + epithete_infra_generique\n".	
Line 1634... Line 1694...
1634
				"Les valeurs des champs cultivar_groupe, cultivar et nom_commercial peuvent s'y ajouter.",
1694
				"Les valeurs des champs cultivar_groupe, cultivar et nom_commercial peuvent s'y ajouter.",
1635
			'resultat' => false);
1695
			'resultat' => false);
1636
		
1696
		
1637
		// Réalisation du test
1697
		// Réalisation du test
1638
		$noms_erreur = array();
1698
		$noms_erreur = array();
1639
		foreach ($noms as $nom) {
1699
		foreach ($this->noms as &$nom) {
1640
			if ($nom['rang'] > $this->manuel['rang_sp']) {
1700
			if ($nom['rang'] > $this->manuel['rang_sp']) {
1641
				$suffixe_plte_cultivee = $this->construireSuffixeNomPltCultivee($nom);
1701
				$suffixe_plte_cultivee = $this->construireSuffixeNomPltCultivee($nom);
Line 1656... Line 1716...
1656
			$info['message']['entete'] = array('num_nom', 'nom_complet', 'nom_complet corrigé');
1716
			$info['message']['entete'] = array('num_nom', 'nom_complet', 'nom_complet corrigé');
1657
			$info['message']['lignes'] = $noms_erreur;
1717
			$info['message']['lignes'] = $noms_erreur;
1658
		} else {
1718
		} else {
1659
			$info['resultat'] = true;
1719
			$info['resultat'] = true;
1660
		}
1720
		}
-
 
1721
		$noms_erreur = null;
Line 1661... Line 1722...
1661
		
1722
		
1662
		$this->traiterResultatTest($info);
1723
		$this->traiterResultatTest($info);
Line 1663... Line 1724...
1663
	}
1724
	}
1664
	
1725
	
1665
	private function testerNomSupraGeneriqueEspaces($noms) {
1726
	private function testerNomSupraGeneriqueEspaces() {
1666
		$info = array('nom' => 'nom_supra_generique -> espaces en trop',
1727
		$info = array('nom' => 'nom_supra_generique -> espaces en trop',
Line 1667... Line 1728...
1667
			'description' => "Le champ nom_supra_generique ne doit pas contenir d'espace avant ou aprés le nom.",
1728
			'description' => "Le champ nom_supra_generique ne doit pas contenir d'espace avant ou aprés le nom.",
1668
			'resultat' => false);
1729
			'resultat' => false);
1669
		
1730
		
1670
		// Réalisation du test
1731
		// Réalisation du test
1671
		$noms_erreur = array();
1732
		$noms_erreur = array();
1672
		foreach ($noms as $nom) {
1733
		foreach ($this->noms as &$nom) {
1673
			if ($nom['nom_supra_generique'] != '') {
1734
			if ($nom['nom_supra_generique'] != '') {
1674
				if (preg_match('/(?:^\s+(?!:\s+)|(?!:\s+)\s+$)/', $nom['nom_supra_generique'])) {
1735
				if (preg_match('/(?:^\s+(?!:\s+)|(?!:\s+)\s+$)/', $nom['nom_supra_generique'])) {
Line 1683... Line 1744...
1683
			$info['message']['entete'] = array('num_nom', 'nom_supra_generique erroné');
1744
			$info['message']['entete'] = array('num_nom', 'nom_supra_generique erroné');
1684
			$info['message']['lignes'] = $noms_erreur;
1745
			$info['message']['lignes'] = $noms_erreur;
1685
		} else {
1746
		} else {
1686
			$info['resultat'] = true;
1747
			$info['resultat'] = true;
1687
		}
1748
		}
-
 
1749
		$noms_erreur = null;
Line 1688... Line 1750...
1688
		
1750
		
1689
		$this->traiterResultatTest($info);
1751
		$this->traiterResultatTest($info);
Line 1690... Line 1752...
1690
	}
1752
	}
1691
	
1753
	
1692
	private function testerNomSupraGeneriqueSyntaxe($noms) {
1754
	private function testerNomSupraGeneriqueSyntaxe() {
1693
		$info = array('nom' => 'nom_supra_generique -> syntaxe',
1755
		$info = array('nom' => 'nom_supra_generique -> syntaxe',
1694
			'description' => "Le champ nom_supra_generique contient un mot composé de lettres minuscules avec ou sans tréma (¨) et de tirets (-). \n".
1756
			'description' => "Le champ nom_supra_generique contient un mot composé de lettres minuscules avec ou sans tréma (¨) et de tirets (-). \n".
Line 1695... Line 1757...
1695
				"La première lettre (avec ou sans tréma) du mot doit être en majuscule.",
1757
				"La première lettre (avec ou sans tréma) du mot doit être en majuscule.",
1696
			'resultat' => false);
1758
			'resultat' => false);
1697
		
1759
		
1698
		// Réalisation du test
1760
		// Réalisation du test
1699
		$noms_erreur = array();
1761
		$noms_erreur = array();
1700
		foreach ($noms as $nom) {
1762
		foreach ($this->noms as &$nom) {
1701
			if ($nom['nom_supra_generique'] != '') {
1763
			if ($nom['nom_supra_generique'] != '') {
1702
				if (!preg_match('/^[A-ZÄËḦÏÖÜẄẌŸ][-a-zäëḧïöẗüẅẍÿ]+$/', $nom['nom_supra_generique'])) {
1764
				if (!preg_match('/^[A-ZÄËḦÏÖÜẄẌŸ][-a-zäëḧïöẗüẅẍÿ]+$/', $nom['nom_supra_generique'])) {
Line 1711... Line 1773...
1711
			$info['message']['entete'] = array('num_nom', 'nom_supra_generique erroné');
1773
			$info['message']['entete'] = array('num_nom', 'nom_supra_generique erroné');
1712
			$info['message']['lignes'] = $noms_erreur;
1774
			$info['message']['lignes'] = $noms_erreur;
1713
		} else {
1775
		} else {
1714
			$info['resultat'] = true;
1776
			$info['resultat'] = true;
1715
		}
1777
		}
-
 
1778
		$noms_erreur = null;
Line 1716... Line 1779...
1716
		
1779
		
1717
		$this->traiterResultatTest($info);
1780
		$this->traiterResultatTest($info);
Line 1718... Line 1781...
1718
	}
1781
	}
1719
	
1782
	
1720
	private function testerNomSupraGeneriqueRang($noms) {
1783
	private function testerNomSupraGeneriqueRang() {
1721
		$info = array('nom' => "nom_supra_generique -> rang < {$this->manuel['rang_genre']}",
1784
		$info = array('nom' => "nom_supra_generique -> rang < {$this->manuel['rang_genre']}",
Line 1722... Line 1785...
1722
			'description' => "Si le champ nom_supra_generique n'est pas vide alors le rang du nom doit être inférieur à {$this->manuel['rang_genre']}.",
1785
			'description' => "Si le champ nom_supra_generique n'est pas vide alors le rang du nom doit être inférieur à {$this->manuel['rang_genre']}.",
1723
			'resultat' => false);
1786
			'resultat' => false);
1724
		
1787
		
1725
		// Réalisation du test
1788
		// Réalisation du test
1726
		$noms_erreur = array();
1789
		$noms_erreur = array();
1727
		foreach ($noms as $nom) {
1790
		foreach ($this->noms as &$nom) {
1728
			if ($nom['nom_supra_generique'] != '') {
1791
			if ($nom['nom_supra_generique'] != '') {
1729
				if ($nom['rang'] >= $this->manuel['rang_genre']) {
1792
				if ($nom['rang'] >= $this->manuel['rang_genre']) {
Line 1737... Line 1800...
1737
			$info['message']['entete'] = array('num_nom', 'nom_complet', 'rang erroné');
1800
			$info['message']['entete'] = array('num_nom', 'nom_complet', 'rang erroné');
1738
			$info['message']['lignes'] = $noms_erreur;
1801
			$info['message']['lignes'] = $noms_erreur;
1739
		} else {
1802
		} else {
1740
			$info['resultat'] = true;
1803
			$info['resultat'] = true;
1741
		}
1804
		}
-
 
1805
		$noms_erreur = null;
Line 1742... Line 1806...
1742
		
1806
		
1743
		$this->traiterResultatTest($info);
1807
		$this->traiterResultatTest($info);
Line 1744... Line 1808...
1744
	}
1808
	}
1745
	
1809
	
1746
	private function testerGenreEspaces($noms) {
1810
	private function testerGenreEspaces() {
1747
		$info = array('nom' => 'genre -> espaces en trop',
1811
		$info = array('nom' => 'genre -> espaces en trop',
1748
			'description' => "Le champ genre ne doit pas contenir d'espace avant ou aprés le nom.\n".
1812
			'description' => "Le champ genre ne doit pas contenir d'espace avant ou aprés le nom.\n".
Line 1749... Line 1813...
1749
				"Si des espaces sont compris dans la valeur du champ, il ne doit pas y avoir plusieurs espaces consécutifs.",
1813
				"Si des espaces sont compris dans la valeur du champ, il ne doit pas y avoir plusieurs espaces consécutifs.",
1750
			'resultat' => false);
1814
			'resultat' => false);
1751
		
1815
		
1752
		// Réalisation du test
1816
		// Réalisation du test
1753
		$noms_erreur = array();
1817
		$noms_erreur = array();
1754
		foreach ($noms as $nom) {
1818
		foreach ($this->noms as &$nom) {
1755
			if ($nom['genre'] != '') {
1819
			if ($nom['genre'] != '') {
1756
				if (preg_match('/(?:^\s+(?!:\s+)|(?!:\s+)\s{2,}(?!:\s+)|(?!:\s+)\s+$)/', $nom['genre'])) {
1820
				if (preg_match('/(?:^\s+(?!:\s+)|(?!:\s+)\s{2,}(?!:\s+)|(?!:\s+)\s+$)/', $nom['genre'])) {
Line 1765... Line 1829...
1765
			$info['message']['entete'] = array('num_nom', 'genre erroné');
1829
			$info['message']['entete'] = array('num_nom', 'genre erroné');
1766
			$info['message']['lignes'] = $noms_erreur;
1830
			$info['message']['lignes'] = $noms_erreur;
1767
		} else {
1831
		} else {
1768
			$info['resultat'] = true;
1832
			$info['resultat'] = true;
1769
		}
1833
		}
-
 
1834
		$noms_erreur = null;
Line 1770... Line 1835...
1770
		
1835
		
1771
		$this->traiterResultatTest($info);
1836
		$this->traiterResultatTest($info);
Line 1772... Line 1837...
1772
	}
1837
	}
1773
	
1838
	
1774
	private function testerGenreSyntaxe($noms) {
1839
	private function testerGenreSyntaxe() {
1775
		$info = array('nom' => 'genre -> syntaxe',
1840
		$info = array('nom' => 'genre -> syntaxe',
1776
			'description' => "Le champ genre peut contenir :\n".
1841
			'description' => "Le champ genre peut contenir :\n".
1777
			 	" - un mot unique composé de lettres minuscules avec ou sans tréma (¨) et de tirets (-). \n".
1842
			 	" - un mot unique composé de lettres minuscules avec ou sans tréma (¨) et de tirets (-). \n".
Line 1781... Line 1846...
1781
				"	par la lettre x entourée de caractères espaces.",
1846
				"	par la lettre x entourée de caractères espaces.",
1782
			'resultat' => false);
1847
			'resultat' => false);
Line 1783... Line 1848...
1783
		
1848
		
1784
		// Réalisation du test
1849
		// Réalisation du test
1785
		$noms_erreur = array();
1850
		$noms_erreur = array();
1786
		foreach ($noms as $nom) {
1851
		foreach ($this->noms as &$nom) {
1787
			if ($nom['genre'] != '') {
1852
			if ($nom['genre'] != '') {
1788
				$mots = explode(' ', $nom['genre']);
1853
				$mots = explode(' ', $nom['genre']);
1789
				foreach ($mots as $mot) {
1854
				foreach ($mots as $mot) {
1790
					if (!(preg_match('/^[+x]$/', $mot) || $this->verifierEpitheteGenre($mot))) {
1855
					if (!(preg_match('/^[+x]$/', $mot) || $this->verifierEpitheteGenre($mot))) {
Line 1800... Line 1865...
1800
			$info['message']['entete'] = array('num_nom', 'genre erroné');
1865
			$info['message']['entete'] = array('num_nom', 'genre erroné');
1801
			$info['message']['lignes'] = $noms_erreur;
1866
			$info['message']['lignes'] = $noms_erreur;
1802
		} else {
1867
		} else {
1803
			$info['resultat'] = true;
1868
			$info['resultat'] = true;
1804
		}
1869
		}
-
 
1870
		$noms_erreur = null;
Line 1805... Line 1871...
1805
		
1871
		
1806
		$this->traiterResultatTest($info);
1872
		$this->traiterResultatTest($info);
Line 1807... Line 1873...
1807
	}
1873
	}
1808
	
1874
	
1809
	private function testerGenreRang($noms) {
1875
	private function testerGenreRang() {
1810
		$info = array('nom' => "genre -> rang >= {$this->manuel['rang_genre']}",
1876
		$info = array('nom' => "genre -> rang >= {$this->manuel['rang_genre']}",
Line 1811... Line 1877...
1811
			'description' => "Si le champ genre n'est pas vide alors le rang du nom doit être supérieur ou égal à {$this->manuel['rang_genre']}.",
1877
			'description' => "Si le champ genre n'est pas vide alors le rang du nom doit être supérieur ou égal à {$this->manuel['rang_genre']}.",
1812
			'resultat' => false);
1878
			'resultat' => false);
1813
		
1879
		
1814
		// Réalisation du test
1880
		// Réalisation du test
1815
		$noms_erreur = array();
1881
		$noms_erreur = array();
1816
		foreach ($noms as $nom) {
1882
		foreach ($this->noms as &$nom) {
1817
			if ($nom['genre'] != '') {
1883
			if ($nom['genre'] != '') {
1818
				if ($nom['rang'] < $this->manuel['rang_genre']) {
1884
				if ($nom['rang'] < $this->manuel['rang_genre']) {
Line 1826... Line 1892...
1826
			$info['message']['entete'] = array('num_nom', 'nom_complet', 'rang erroné');
1892
			$info['message']['entete'] = array('num_nom', 'nom_complet', 'rang erroné');
1827
			$info['message']['lignes'] = $noms_erreur;
1893
			$info['message']['lignes'] = $noms_erreur;
1828
		} else {
1894
		} else {
1829
			$info['resultat'] = true;
1895
			$info['resultat'] = true;
1830
		}
1896
		}
-
 
1897
		$noms_erreur = null;
Line 1831... Line 1898...
1831
		
1898
		
1832
		$this->traiterResultatTest($info);
1899
		$this->traiterResultatTest($info);
Line 1833... Line 1900...
1833
	}
1900
	}
1834
		
1901
		
1835
	private function testerEpitheteInfraGeneriqueSyntaxe($noms) {
1902
	private function testerEpitheteInfraGeneriqueSyntaxe() {
1836
		$info = array('nom' => 'epithete_infra_generique -> syntaxe',
1903
		$info = array('nom' => 'epithete_infra_generique -> syntaxe',
1837
			'description' => "Le champ epithete_infra_generique est composé de lettres minuscules avec ou sans tréma (¨) et de tirets (-). \n".
1904
			'description' => "Le champ epithete_infra_generique est composé de lettres minuscules avec ou sans tréma (¨) et de tirets (-). \n".
Line 1838... Line 1905...
1838
				"La première lettre (avec ou sans tréma) doit être en majuscule.",
1905
				"La première lettre (avec ou sans tréma) doit être en majuscule.",
1839
			'resultat' => false);
1906
			'resultat' => false);
1840
		
1907
		
1841
		// Réalisation du test
1908
		// Réalisation du test
1842
		$noms_erreur = array();
1909
		$noms_erreur = array();
1843
		foreach ($noms as $nom) {
1910
		foreach ($this->noms as &$nom) {
1844
			if ($nom['epithete_infra_generique'] != '') {
1911
			if ($nom['epithete_infra_generique'] != '') {
1845
				if (!preg_match('/^[A-ZÄËḦÏÖÜẄẌŸ][-a-zäëḧïöẗüẅẍÿ]+/', $nom['epithete_infra_generique'])) {
1912
				if (!preg_match('/^[A-ZÄËḦÏÖÜẄẌŸ][-a-zäëḧïöẗüẅẍÿ]+/', $nom['epithete_infra_generique'])) {
Line 1854... Line 1921...
1854
			$info['message']['entete'] = array('num_nom', 'epithete_infra_generique erroné');
1921
			$info['message']['entete'] = array('num_nom', 'epithete_infra_generique erroné');
1855
			$info['message']['lignes'] = $noms_erreur;
1922
			$info['message']['lignes'] = $noms_erreur;
1856
		} else {
1923
		} else {
1857
			$info['resultat'] = true;
1924
			$info['resultat'] = true;
1858
		}
1925
		}
-
 
1926
		$noms_erreur = null;
Line 1859... Line 1927...
1859
		
1927
		
1860
		$this->traiterResultatTest($info);
1928
		$this->traiterResultatTest($info);
Line 1861... Line 1929...
1861
	}
1929
	}
1862
	
1930
	
1863
	private function testerEpitheteInfraGeneriqueRang($noms) {
1931
	private function testerEpitheteInfraGeneriqueRang() {
1864
		$info = array('nom' => "epithete_infra_generique -> {$this->manuel['rang_genre']} < rang < {$this->manuel['rang_sp']}",
1932
		$info = array('nom' => "epithete_infra_generique -> {$this->manuel['rang_genre']} < rang < {$this->manuel['rang_sp']}",
1865
			'description' => "Si le champ epithete_infra_generique n'est pas vide alors le rang du nom doit être compris \n".
1933
			'description' => "Si le champ epithete_infra_generique n'est pas vide alors le rang du nom doit être compris \n".
Line 1866... Line 1934...
1866
				"entre {$this->manuel['rang_genre']} et {$this->manuel['rang_sp']}.",
1934
				"entre {$this->manuel['rang_genre']} et {$this->manuel['rang_sp']}.",
1867
			'resultat' => false);
1935
			'resultat' => false);
1868
		
1936
		
1869
		// Réalisation du test
1937
		// Réalisation du test
1870
		$noms_erreur = array();
1938
		$noms_erreur = array();
1871
		foreach ($noms as $nom) {
1939
		foreach ($this->noms as &$nom) {
1872
			if ($nom['epithete_infra_generique'] != '') {
1940
			if ($nom['epithete_infra_generique'] != '') {
1873
				if ($nom['rang'] <= $this->manuel['rang_genre'] || $nom['rang'] >= $this->manuel['rang_sp']) {
1941
				if ($nom['rang'] <= $this->manuel['rang_genre'] || $nom['rang'] >= $this->manuel['rang_sp']) {
Line 1881... Line 1949...
1881
			$info['message']['entete'] = array('num_nom', 'nom_complet', 'rang erroné');
1949
			$info['message']['entete'] = array('num_nom', 'nom_complet', 'rang erroné');
1882
			$info['message']['lignes'] = $noms_erreur;
1950
			$info['message']['lignes'] = $noms_erreur;
1883
		} else {
1951
		} else {
1884
			$info['resultat'] = true;
1952
			$info['resultat'] = true;
1885
		}
1953
		}
-
 
1954
		$noms_erreur = null;
Line 1886... Line 1955...
1886
		
1955
		
1887
		$this->traiterResultatTest($info);
1956
		$this->traiterResultatTest($info);
Line 1888... Line 1957...
1888
	}
1957
	}
1889
	
1958
	
1890
	private function testerEpitheteInfraGeneriqueEspaces($noms) {
1959
	private function testerEpitheteInfraGeneriqueEspaces() {
1891
		$info = array('nom' => 'epithete_infra_generique -> espaces en trop',
1960
		$info = array('nom' => 'epithete_infra_generique -> espaces en trop',
Line 1892... Line 1961...
1892
			'description' => "Le champ epithete_infra_generique ne doit pas contenir d'espace avant ou aprés sa valeur.",
1961
			'description' => "Le champ epithete_infra_generique ne doit pas contenir d'espace avant ou aprés sa valeur.",
1893
			'resultat' => false);
1962
			'resultat' => false);
1894
		
1963
		
1895
		// Réalisation du test
1964
		// Réalisation du test
1896
		$noms_erreur = array();
1965
		$noms_erreur = array();
1897
		foreach ($noms as $nom) {
1966
		foreach ($this->noms as &$nom) {
1898
			if ($nom['epithete_infra_generique'] != '') {
1967
			if ($nom['epithete_infra_generique'] != '') {
1899
				if (preg_match('/(?:^\s+(?!:\s+)|(?!:\s+)\s{2,}(?!:\s+)|(?!:\s+)\s+$)/', $nom['epithete_infra_generique'])) {
1968
				if (preg_match('/(?:^\s+(?!:\s+)|(?!:\s+)\s{2,}(?!:\s+)|(?!:\s+)\s+$)/', $nom['epithete_infra_generique'])) {
Line 1908... Line 1977...
1908
			$info['message']['entete'] = array('num_nom', 'epithete_infra_generique erroné');
1977
			$info['message']['entete'] = array('num_nom', 'epithete_infra_generique erroné');
1909
			$info['message']['lignes'] = $noms_erreur;
1978
			$info['message']['lignes'] = $noms_erreur;
1910
		} else {
1979
		} else {
1911
			$info['resultat'] = true;
1980
			$info['resultat'] = true;
1912
		}
1981
		}
-
 
1982
		$noms_erreur = null;
Line 1913... Line 1983...
1913
		
1983
		
1914
		$this->traiterResultatTest($info);
1984
		$this->traiterResultatTest($info);
Line 1915... Line 1985...
1915
	}
1985
	}
1916
	
1986
	
1917
	private function testerEpitheteSpEspaces($noms) {
1987
	private function testerEpitheteSpEspaces() {
1918
		$info = array('nom' => 'epithete_sp -> espaces en trop',
1988
		$info = array('nom' => 'epithete_sp -> espaces en trop',
1919
			'description' => "Le champ epithete_sp ne doit pas contenir d'espace avant ou aprés le nom.\n".
1989
			'description' => "Le champ epithete_sp ne doit pas contenir d'espace avant ou aprés le nom.\n".
Line 1920... Line 1990...
1920
				"Si des espaces sont compris dans la valeur du champ, il ne doit pas y avoir plusieurs espaces consécutifs.",
1990
				"Si des espaces sont compris dans la valeur du champ, il ne doit pas y avoir plusieurs espaces consécutifs.",
1921
			'resultat' => false);
1991
			'resultat' => false);
1922
		
1992
		
1923
		// Réalisation du test
1993
		// Réalisation du test
1924
		$noms_erreur = array();
1994
		$noms_erreur = array();
1925
		foreach ($noms as $nom) {
1995
		foreach ($this->noms as &$nom) {
1926
			if ($nom['epithete_sp'] != '') {
1996
			if ($nom['epithete_sp'] != '') {
1927
				if (preg_match('/(?:^\s+(?!:\s+)|(?!:\s+)\s{2,}(?!:\s+)|(?!:\s+)\s+$)/', $nom['epithete_sp'])) {
1997
				if (preg_match('/(?:^\s+(?!:\s+)|(?!:\s+)\s{2,}(?!:\s+)|(?!:\s+)\s+$)/', $nom['epithete_sp'])) {
Line 1936... Line 2006...
1936
			$info['message']['entete'] = array('num_nom', 'epithete_sp erroné');
2006
			$info['message']['entete'] = array('num_nom', 'epithete_sp erroné');
1937
			$info['message']['lignes'] = $noms_erreur;
2007
			$info['message']['lignes'] = $noms_erreur;
1938
		} else {
2008
		} else {
1939
			$info['resultat'] = true;
2009
			$info['resultat'] = true;
1940
		}
2010
		}
-
 
2011
		$noms_erreur = null;
Line 1941... Line 2012...
1941
		
2012
		
1942
		$this->traiterResultatTest($info);
2013
		$this->traiterResultatTest($info);
Line 1943... Line 2014...
1943
	}
2014
	}
1944
	
2015
	
1945
	private function testerEpitheteSpSyntaxe($noms) {
2016
	private function testerEpitheteSpSyntaxe() {
1946
		$info = array('nom' => 'epithete_sp -> syntaxe',
2017
		$info = array('nom' => 'epithete_sp -> syntaxe',
1947
			'description' => "Le champ epithete_sp peut contenir :\n".
2018
			'description' => "Le champ epithete_sp peut contenir :\n".
1948
			 	" - un mot unique composé de lettres minuscules [a-z] incluant les caractères [ëï-]. \n".
2019
			 	" - un mot unique composé de lettres minuscules [a-z] incluant les caractères [ëï-]. \n".
Line 1953... Line 2024...
1953
				"	par la lettre x entourée de caractères espaces.",
2024
				"	par la lettre x entourée de caractères espaces.",
1954
			'resultat' => false);
2025
			'resultat' => false);
Line 1955... Line 2026...
1955
		
2026
		
1956
		// Réalisation du test
2027
		// Réalisation du test
1957
		$noms_erreur = array();
2028
		$noms_erreur = array();
1958
		foreach ($noms as $nom) {
2029
		foreach ($this->noms as &$nom) {
1959
			if ($nom['epithete_sp'] != '') {
2030
			if ($nom['epithete_sp'] != '') {
1960
				$mots = explode(' ', $nom['epithete_sp']);
2031
				$mots = explode(' ', $nom['epithete_sp']);
1961
				foreach ($mots as $mot) {
2032
				foreach ($mots as $mot) {
1962
					if (!(preg_match('/^[+x]$/', $mot) || $this->verifierEpitheteSp($mot))) {
2033
					if (!(preg_match('/^[+x]$/', $mot) || $this->verifierEpitheteSp($mot))) {
Line 1972... Line 2043...
1972
			$info['message']['entete'] = array('num_nom', 'epithete_sp erroné');
2043
			$info['message']['entete'] = array('num_nom', 'epithete_sp erroné');
1973
			$info['message']['lignes'] = $noms_erreur;
2044
			$info['message']['lignes'] = $noms_erreur;
1974
		} else {
2045
		} else {
1975
			$info['resultat'] = true;
2046
			$info['resultat'] = true;
1976
		}
2047
		}
-
 
2048
		$noms_erreur = null;
Line 1977... Line 2049...
1977
		
2049
		
1978
		$this->traiterResultatTest($info);
2050
		$this->traiterResultatTest($info);
Line 1979... Line 2051...
1979
	}
2051
	}
1980
	
2052
	
1981
	private function testerEpitheteSpRang($noms) {
2053
	private function testerEpitheteSpRang() {
1982
		$info = array('nom' => "epithete_sp -> rang >= {$this->manuel['rang_sp']}",
2054
		$info = array('nom' => "epithete_sp -> rang >= {$this->manuel['rang_sp']}",
Line 1983... Line 2055...
1983
			'description' => "Si le champ epithete_sp n'est pas vide alors le rang du nom doit être supérieur ou égal à {$this->manuel['rang_sp']}.",
2055
			'description' => "Si le champ epithete_sp n'est pas vide alors le rang du nom doit être supérieur ou égal à {$this->manuel['rang_sp']}.",
1984
			'resultat' => false);
2056
			'resultat' => false);
1985
		
2057
		
1986
		// Réalisation du test
2058
		// Réalisation du test
1987
		$noms_erreur = array();
2059
		$noms_erreur = array();
1988
		foreach ($noms as $nom) {
2060
		foreach ($this->noms as &$nom) {
1989
			if ($nom['epithete_sp'] != '') {
2061
			if ($nom['epithete_sp'] != '') {
1990
				if ($nom['rang'] < $this->manuel['rang_sp']) {
2062
				if ($nom['rang'] < $this->manuel['rang_sp']) {
Line 1998... Line 2070...
1998
			$info['message']['entete'] = array('num_nom', 'nom_complet', 'rang erroné');
2070
			$info['message']['entete'] = array('num_nom', 'nom_complet', 'rang erroné');
1999
			$info['message']['lignes'] = $noms_erreur;
2071
			$info['message']['lignes'] = $noms_erreur;
2000
		} else {
2072
		} else {
2001
			$info['resultat'] = true;
2073
			$info['resultat'] = true;
2002
		}
2074
		}
-
 
2075
		$noms_erreur = null;
Line 2003... Line 2076...
2003
		
2076
		
2004
		$this->traiterResultatTest($info);
2077
		$this->traiterResultatTest($info);
Line 2005... Line 2078...
2005
	}
2078
	}
2006
	
2079
	
Line 2007... Line 2080...
2007
	//+--------------------------------------------------------------------------------------------------------------+//
2080
	//+--------------------------------------------------------------------------------------------------------------+//
2008
	// MÉTHODES COMMUNES aux TESTS
2081
	// MÉTHODES COMMUNES aux TESTS
2009
	
2082
	
2010
	private function verifierPresence($valeur) {
2083
	private function verifierPresence(&$valeur) {
2011
		$codes = $this->manuel['codes_presence'];
2084
		$codes = $this->manuel['codes_presence'];
Line 2012... Line 2085...
2012
		$ok = $this->verifierStatuts($valeur, $codes);
2085
		$ok = $this->verifierStatuts($valeur, $codes);
2013
		return $ok;
2086
		return $ok;
2014
	}
2087
	}
2015
	
2088
	
2016
	private function verifierStatutOrigine($valeur) {
2089
	private function verifierStatutOrigine(&$valeur) {
Line 2017... Line 2090...
2017
		$codes = $this->manuel['codes_statuts_origine'];
2090
		$codes = $this->manuel['codes_statuts_origine'];
2018
		$ok = $this->verifierStatuts($valeur, $codes);
2091
		$ok = $this->verifierStatuts($valeur, $codes);
2019
		return $ok;
2092
		return $ok;
2020
	}
2093
	}
2021
	
2094
	
Line 2022... Line 2095...
2022
	private function verifierStatutIntroduction($valeur) {
2095
	private function verifierStatutIntroduction(&$valeur) {
2023
		$codes = $this->manuel['codes_statuts_introduction'];
2096
		$codes = $this->manuel['codes_statuts_introduction'];
2024
		$ok = $this->verifierStatuts($valeur, $codes);
2097
		$ok = $this->verifierStatuts($valeur, $codes);
2025
		return $ok;
2098
		return $ok;
2026
	}
2099
	}
Line 2027... Line 2100...
2027
	
2100
	
2028
	private function verifierStatutCulture($valeur) {
2101
	private function verifierStatutCulture(&$valeur) {
2029
		$codes = $this->manuel['codes_statuts_culture'];
2102
		$codes = $this->manuel['codes_statuts_culture'];
2030
		$ok = $this->verifierStatuts($valeur, $codes);
2103
		$ok = $this->verifierStatuts($valeur, $codes);
2031
		return $ok;
2104
		return $ok;
2032
	}
2105
	}
2033
	
2106
	
Line 2034... Line 2107...
2034
	private function verifierStatuts($valeur, $codes) {
2107
	private function verifierStatuts(&$valeur, &$codes) {
2035
		$ok = true;
2108
		$ok = true;
2036
		if (!preg_match("/^(?:|-|[$codes](?:-[A-Z])?)$/", $valeur)) {
2109
		if (!preg_match("/^(?:|-|[$codes](?:-[A-Z])?)$/", $valeur)) {
2037
			$ok = false;
2110
			$ok = false;
2038
		}
2111
		}
2039
		return $ok;
2112
		return $ok;
2040
	}
2113
	}
Line 2041... Line 2114...
2041
	
2114
	
2042
	private function verifierBooleen($valeur) {
2115
	private function verifierBooleen(&$valeur) {
2043
		$ok = true;
2116
		$ok = true;
2044
		if (!preg_match('/^1$/', $valeur)) {
2117
		if (!preg_match('/^1$/', $valeur)) {
2045
			$ok = false;
2118
			$ok = false;
2046
		}
2119
		}
2047
		return $ok;
2120
		return $ok;
Line 2048... Line 2121...
2048
	}
2121
	}
2049
	
2122
	
2050
	private function verifierNombre($valeur) {
2123
	private function verifierNombre(&$valeur) {
2051
		$ok = true;
2124
		$ok = true;
2052
		if (!preg_match('/^[0-9]+$/', $valeur)) {
2125
		if (!preg_match('/^[0-9]+$/', $valeur)) {
2053
			$ok = false;
2126
			$ok = false;
2054
		}
2127
		}
Line 2055... Line 2128...
2055
		return $ok;
2128
		return $ok;
2056
	}
2129
	}
2057
	
2130
	
2058
	private function verifierNombreSuite($valeur) {
2131
	private function verifierNombreSuite(&$valeur) {
2059
		$ok = true;
2132
		$ok = true;
2060
		if (!preg_match('/^(?:[0-9]+,)*[0-9]+$/', $valeur)) {
2133
		if (!preg_match('/^(?:[0-9]+,)*[0-9]+$/', $valeur)) {
2061
			$ok = false;
2134
			$ok = false;
2062
		}
2135
		}
2063
		return $ok;
2136
		return $ok;
2064
	}
2137
	}
Line 2065... Line 2138...
2065
	
2138
	
2066
	private function verifierTypeEpithete($type) {
2139
	private function verifierTypeEpithete(&$type) {
2067
		$ok = false;
2140
		$ok = false;
2068
		$rejetes = $this->manuel['type_epithete_rejetes'];
2141
		$rejetes = $this->manuel['type_epithete_rejetes'];
2069
		if (preg_replace("/^(?:$rejetes)$/", '', $type) == '') {
2142
		if (preg_replace("/^(?:$rejetes)$/", '', $type) == '') {
2070
			$ok = false;
2143
			$ok = false;
Line 2084... Line 2157...
2084
			$ok = false;// Contient une mauvaise suite de caractères
2157
			$ok = false;// Contient une mauvaise suite de caractères
2085
		}
2158
		}
2086
		return $ok;
2159
		return $ok;
2087
	}
2160
	}
Line 2088... Line 2161...
2088
	
2161
	
2089
	private function verifierAnnee($annee) {
2162
	private function verifierAnnee(&$annee) {
2090
		$ok = true;
2163
		$ok = true;
2091
		if (!preg_match('/^[0-9]{4}$/', $annee)) {
2164
		if (!preg_match('/^[0-9]{4}$/', $annee)) {
2092
			$ok = false;
2165
			$ok = false;
2093
		} else if ($annee < 1753) {
2166
		} else if ($annee < 1753) {
2094
			$ok = false;
2167
			$ok = false;
2095
		}
2168
		}
2096
		return $ok;
2169
		return $ok;
Line 2097... Line 2170...
2097
	}
2170
	}
2098
	
2171
	
2099
	private function verifierAuteur($intitule) {
2172
	private function verifierAuteur(&$intitule) {
2100
		$ok = true;
2173
		$ok = true;
2101
		$acceptes = $this->manuel['auteur_acceptes'];
2174
		$acceptes = $this->manuel['auteur_acceptes'];
2102
		if (!preg_match("/^(?:$acceptes)$/", $intitule)) {
2175
		if (!preg_match("/^(?:$acceptes)$/", $intitule)) {
Line 2117... Line 2190...
2117
			}
2190
			}
2118
		}
2191
		}
2119
		return $ok;
2192
		return $ok;
2120
	}
2193
	}
Line 2121... Line 2194...
2121
	
2194
	
2122
	private function verifierNomCommercial($epithete) {
2195
	private function verifierNomCommercial(&$epithete) {
2123
		$ok = false;
2196
		$ok = false;
2124
		if (preg_match("/^[[:upper:][:punct:][:digit:][:space:]]+$/", $epithete)) {
2197
		if (preg_match("/^[[:upper:][:punct:][:digit:][:space:]]+$/", $epithete)) {
2125
			$ok = true;
2198
			$ok = true;
2126
		}
2199
		}
2127
		return $ok;
2200
		return $ok;
Line 2128... Line 2201...
2128
	}
2201
	}
2129
	
2202
	
2130
	private function verifierEpitheteCultivar($epithete) {
2203
	private function verifierEpitheteCultivar(&$epithete) {
2131
		$ok = true;
2204
		$ok = true;
2132
		$acceptes = $this->manuel['cultivar_acceptes'];
2205
		$acceptes = $this->manuel['cultivar_acceptes'];
2133
		if (!preg_match("/^(?:$acceptes)$/", $epithete)) {
2206
		if (!preg_match("/^(?:$acceptes)$/", $epithete)) {
Line 2160... Line 2233...
2160
			}
2233
			}
2161
		}
2234
		}
2162
		return $ok;
2235
		return $ok;
2163
	}
2236
	}
Line 2164... Line 2237...
2164
	
2237
	
2165
	private function verifierEpitheteGroupeCultivar($epithete) {
2238
	private function verifierEpitheteGroupeCultivar(&$epithete) {
2166
		$ok = true;
2239
		$ok = true;
2167
		$acceptes = $this->manuel['cultivar_gp_acceptes'];
2240
		$acceptes = $this->manuel['cultivar_gp_acceptes'];
2168
		if (!preg_match("/^(?:$acceptes)$/", $epithete)) {
2241
		if (!preg_match("/^(?:$acceptes)$/", $epithete)) {
2169
			if (preg_match('/(?:^\s+|\s{2,}|\s+$)/', $epithete)) {
2242
			if (preg_match('/(?:^\s+|\s{2,}|\s+$)/', $epithete)) {
Line 2198... Line 2271...
2198
			}
2271
			}
2199
		}
2272
		}
2200
		return $ok;
2273
		return $ok;
2201
	}
2274
	}
Line 2202... Line 2275...
2202
	
2275
	
2203
	private function verifierEpitheteSp($epithete) {
2276
	private function verifierEpitheteSp(&$epithete) {
2204
		$ok = false;
2277
		$ok = false;
2205
		if (preg_match('/^[a-zëï][-a-zëï]+$/', $epithete)) {
2278
		if (preg_match('/^[a-zëï][-a-zëï]+$/', $epithete)) {
2206
			$ok = true;
2279
			$ok = true;
2207
		} else if (preg_match('/^sp\.(?:[A-Z]|[1-9][0-9]*)$/', $epithete)) {
2280
		} else if (preg_match('/^sp\.(?:[A-Z]|[1-9][0-9]*)$/', $epithete)) {
2208
			$ok = true;
2281
			$ok = true;
2209
		}
2282
		}
2210
		return $ok;
2283
		return $ok;
Line 2211... Line 2284...
2211
	}
2284
	}
2212
	
2285
	
2213
	private function verifierEpitheteGenre($epithete) {
2286
	private function verifierEpitheteGenre(&$epithete) {
2214
		$ok = false;
2287
		$ok = false;
2215
		if (preg_match('/^[A-ZËÏ](?:[-a-zëï]+|[a-zëï]+-[A-ZËÏ][a-zëï]+)$/', $epithete)) {
2288
		if (preg_match('/^[A-ZËÏ](?:[-a-zëï]+|[a-zëï]+-[A-ZËÏ][a-zëï]+)$/', $epithete)) {
2216
			$ok = true;
2289
			$ok = true;
2217
		}
2290
		}
Line 2218... Line 2291...
2218
		return $ok;
2291
		return $ok;
2219
	}
2292
	}
2220
	
2293
	
2221
	private function formaterStyleNomGenre($genre) {
2294
	private function formaterStyleNomGenre(&$genre) {
2222
		$genre_fmt = '';
2295
		$genre_fmt = '';
2223
		if (preg_match('/^\s*([x+])\s+(.+)$/i', $genre, $match)) {
2296
		if (preg_match('/^\s*([x+])\s+(.+)$/i', $genre, $match)) {
Line 2231... Line 2304...
2231
	private function repererEspace($nom_complet) {
2304
	private function repererEspace($nom_complet) {
2232
		$nom_complet = str_replace(' ', '<span class="espace">&nbsp;</span>', $nom_complet);
2305
		$nom_complet = str_replace(' ', '<span class="espace">&nbsp;</span>', $nom_complet);
2233
		return $nom_complet;
2306
		return $nom_complet;
2234
	}
2307
	}
Line 2235... Line 2308...
2235
	
2308
	
2236
	private function construireSuffixeNomPltCultivee($nom) {
2309
	private function construireSuffixeNomPltCultivee(&$nom) {
2237
		$suffixe = array();
2310
		$suffixe = array();
2238
		$suffixe[] = $this->construireNomCultivarGroupe($nom);
2311
		$suffixe[] = $this->construireNomCultivarGroupe($nom);
2239
		$suffixe[] = $this->construireNomCommercial($nom);
2312
		$suffixe[] = $this->construireNomCommercial($nom);
2240
		$suffixe[] = $this->construireNomCultivar($nom);
2313
		$suffixe[] = $this->construireNomCultivar($nom);
2241
		$suffixe = array_filter($suffixe);
2314
		$suffixe = array_filter($suffixe);
2242
		return implode(' ', $suffixe);
2315
		return implode(' ', $suffixe);
Line 2243... Line 2316...
2243
	}
2316
	}
2244
	
2317
	
2245
	private function construireNomCultivarGroupe($nom) {
2318
	private function construireNomCultivarGroupe(&$nom) {
2246
		$nom_groupe_cultivar = '';
2319
		$nom_groupe_cultivar = '';
2247
		if ($nom['cultivar_groupe'] != '') {
2320
		if ($nom['cultivar_groupe'] != '') {
2248
			if (preg_match('/ gx$/', $nom['cultivar_groupe'])) {
2321
			if (preg_match('/ gx$/', $nom['cultivar_groupe'])) {
Line 2252... Line 2325...
2252
			}
2325
			}
2253
		}
2326
		}
2254
		return $nom_groupe_cultivar;
2327
		return $nom_groupe_cultivar;
2255
	}
2328
	}
Line 2256... Line 2329...
2256
	
2329
	
2257
	private function construireNomCommercial($nom) {
2330
	private function construireNomCommercial(&$nom) {
2258
		$nom_commercial = '';
2331
		$nom_commercial = '';
2259
		if ($nom['nom_commercial'] != '') {
2332
		if ($nom['nom_commercial'] != '') {
2260
			$nom_commercial =  strtoupper($nom['nom_commercial']);
2333
			$nom_commercial =  strtoupper($nom['nom_commercial']);
2261
		}
2334
		}
2262
		return $nom_commercial;
2335
		return $nom_commercial;
Line 2263... Line 2336...
2263
	}
2336
	}
2264
	
2337
	
2265
	private function construireNomCultivar($nom) {
2338
	private function construireNomCultivar(&$nom) {
2266
		$nom_cultivar = '';
2339
		$nom_cultivar = '';
2267
		if ($nom['cultivar'] != '') {
2340
		if ($nom['cultivar'] != '') {
2268
			$nom_cultivar =  "'".$nom['cultivar']."'";
2341
			$nom_cultivar =  "'".$nom['cultivar']."'";
2269
		}
2342
		}
Line 2270... Line -...
2270
		return $nom_cultivar;
-
 
2271
	}
-
 
2272
	
-
 
2273
	private function classerNomsParNumNom($noms) {
-
 
2274
		$noms_classes = array();
-
 
2275
		foreach ($noms as $nom) {
-
 
2276
			$noms_classes[$nom['num_nom']] = $nom;
-
 
2277
		}
-
 
2278
		return $noms_classes;
2343
		return $nom_cultivar;
2279
	}
2344
	}
2280
	
2345
	
2281
	private function classerNomsParNomComplet($noms) {
2346
	private function classerNomsParNomComplet() {
2282
		$noms_classes = array();
2347
		$noms_classes = array();
2283
		foreach ($noms as $nom) {
2348
		foreach ($this->noms as &$nom) {
2284
			if (!isset($noms_classes[$nom['nom_complet']])) {
2349
			if (!isset($noms_classes[$nom['nom_complet']])) {
2285
				$noms_classes[$nom['nom_complet']] = 1;
2350
				$noms_classes[$nom['nom_complet']] = 1;