Subversion Repositories Applications.referentiel

Rev

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

Rev 38 Rev 42
Line 16... Line 16...
16
*/
16
*/
17
// +-------------------------------------------------------------------------------------------------------------------+
17
// +-------------------------------------------------------------------------------------------------------------------+
18
// TODO : supprimer l'utilisation du paramêtres 'p' et chercher les infos depuis la bdd
18
// TODO : supprimer l'utilisation du paramêtres 'p' et chercher les infos depuis la bdd
19
class Tests extends ScriptCommande {
19
class Tests extends ScriptCommande {
Line -... Line 20...
-
 
20
	
-
 
21
	const SCRIPT_NOM = 'tests';
20
	
22
	
21
	private $projet = null;
23
	private $projet = null;
Line 22... Line 24...
22
	private $traitement = null;
24
	private $traitement = null;
Line 35... Line 37...
35
		
37
		
36
		$this->resultatDao = new ResultatDao();
38
		$this->resultatDao = new ResultatDao();
Line 37... Line 39...
37
		$this->traitementDao = new TraitementDao();
39
		$this->traitementDao = new TraitementDao();
38
		
40
		
39
		// Récupération du dernier traitement demandé
41
		// Récupération du dernier traitement demandé
40
		$this->traitement = $this->traitementDao->getDernierTraitement($this->projet);
42
		$this->traitement = $this->traitementDao->getDernierTraitement($this->projet, self::SCRIPT_NOM);
41
		if ($this->traitement != false) {
43
		if (isset($this->traitement)) {
42
			Debug::printr($this->traitement);
44
			Debug::printr($this->traitement);
Line 43... Line 45...
43
			// Écriture de la date de début du traitement
45
			// Écriture de la date de début du traitement
44
			Debug::printr('Debute:'.$this->traitementDao->debuterTraitement($this->traitement['id_traitement']));
46
			Debug::printr('Debute:'.$this->traitementDao->debuterTraitement($this->traitement['id_traitement']));
-
 
47
			
45
			
48
			// Nettoyage des traitements obsolètes
46
			// Nettoyage des traitements obsolètes
49
			$traitements_obsoletes = $this->traitementDao->getTraitementsObsoletes($this->projet, self::SCRIPT_NOM);
47
			$traitements_obsoletes = $this->traitementDao->getTraitementsObsoletes($this->projet);
-
 
Line 48... Line 50...
48
			Debug::printr('Supp. obsoletes:'.$this->traitementDao->supprimer($traitements_obsoletes));
50
			if (isset($traitements_obsoletes)) {
49
			
51
				Debug::printr('Supp. obsoletes:'.$this->traitementDao->supprimer($traitements_obsoletes));
50
			// TODO : Nettoyage des traitements (et de leurs résultats) avortés
52
			}
51
			
53
			
Line 313... Line 315...
313
		// Réalisation du test
315
		// Réalisation du test
314
		$noms_erreur = array();
316
		$noms_erreur = array();
315
		foreach ($noms as $nom) {
317
		foreach ($noms as $nom) {
316
			if ($nom['hybride_parent_02'] != '') {
318
			if ($nom['hybride_parent_02'] != '') {
317
				if (!isset($noms[$nom['hybride_parent_02']]) && $nom['hybride_parent_02'] != '0') {
319
				if (!isset($noms[$nom['hybride_parent_02']]) && $nom['hybride_parent_02'] != '0') {
318
					$noms_erreur[] = array($nom['num_nom'], $nom['hybride_parent_02']);
320
					$noms_erreur[] = array($nom['num_nom'], $this->repererEspace($nom['hybride_parent_02']));
319
				}
321
				}
320
			}
322
			}
321
		}
323
		}
Line 322... Line 324...
322
		
324
		
Line 341... Line 343...
341
		// Réalisation du test
343
		// Réalisation du test
342
		$noms_erreur = array();
344
		$noms_erreur = array();
343
		foreach ($noms as $nom) {
345
		foreach ($noms as $nom) {
344
			if ($nom['hybride_parent_02'] != '') {
346
			if ($nom['hybride_parent_02'] != '') {
345
				if (!$this->verifierNombre($nom['hybride_parent_02'])) {
347
				if (!$this->verifierNombre($nom['hybride_parent_02'])) {
346
					$noms_erreur[] = array($nom['num_nom'], $nom['hybride_parent_02']);
348
					$noms_erreur[] = array($nom['num_nom'], $this->repererEspace($nom['hybride_parent_02']));
347
				}
349
				}
348
			}
350
			}
349
		}
351
		}
Line 350... Line 352...
350
		
352
		
Line 369... Line 371...
369
		// Réalisation du test
371
		// Réalisation du test
370
		$noms_erreur = array();
372
		$noms_erreur = array();
371
		foreach ($noms as $nom) {
373
		foreach ($noms as $nom) {
372
			if ($nom['hybride_parent_01'] != '' && $nom['hybride_parent_01'] != '0') {
374
			if ($nom['hybride_parent_01'] != '' && $nom['hybride_parent_01'] != '0') {
373
				if (!isset($noms[$nom['hybride_parent_01']])) {
375
				if (!isset($noms[$nom['hybride_parent_01']])) {
374
					$noms_erreur[] = array($nom['num_nom'], $nom['hybride_parent_01']);
376
					$noms_erreur[] = array($nom['num_nom'], $this->repererEspace($nom['hybride_parent_01']));
375
				}
377
				}
376
			}
378
			}
377
		}
379
		}
Line 378... Line 380...
378
		
380
		
Line 397... Line 399...
397
		// Réalisation du test
399
		// Réalisation du test
398
		$noms_erreur = array();
400
		$noms_erreur = array();
399
		foreach ($noms as $nom) {
401
		foreach ($noms as $nom) {
400
			if ($nom['hybride_parent_01'] != '') {
402
			if ($nom['hybride_parent_01'] != '') {
401
				if (!$this->verifierNombre($nom['hybride_parent_01'])) {
403
				if (!$this->verifierNombre($nom['hybride_parent_01'])) {
402
					$noms_erreur[] = array($nom['num_nom'], $nom['hybride_parent_01']);
404
					$noms_erreur[] = array($nom['num_nom'], $this->repererEspace($nom['hybride_parent_01']));
403
				}
405
				}
404
			}
406
			}
405
		}
407
		}
Line 406... Line 408...
406
		
408
		
Line 1300... Line 1302...
1300
		$this->traiterResultatTest($info);
1302
		$this->traiterResultatTest($info);
1301
	}
1303
	}
Line 1302... Line 1304...
1302
	
1304
	
1303
	private function testerNumNomRetenuSuperieurAZero($noms) {
1305
	private function testerNumNomRetenuSuperieurAZero($noms) {
1304
		$info = array('nom' => 'num_nom_retenu -> supérieur à 0',
1306
		$info = array('nom' => 'num_nom_retenu -> supérieur à 0',
1305
			'description' => "Le champ num_nom_retenu doit contenir des nombres entiers supérieurs à 0.",
1307
			'description' => "Le champ num_nom_retenu doit contenir des nombres entiers supérieurs à 0 ou être vide.",
Line 1306... Line 1308...
1306
			'resultat' => false);
1308
			'resultat' => false);
1307
		
1309
		
1308
		// Réalisation du test
1310
		// Réalisation du test
1309
		$noms_erreur = array();
1311
		$noms_erreur = array();
1310
		foreach ($noms as $nom) {
1312
		foreach ($noms as $nom) {
1311
			if ($nom['num_nom_retenu'] <= 0) {
1313
			if ($nom['num_nom_retenu'] != '' && $nom['num_nom_retenu'] <= 0) {
1312
				$noms_erreur[] = $nom['num_nom'];
1314
				$noms_erreur[] = $nom['num_nom'];
Line 1313... Line 1315...
1313
			}
1315
			}