Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 1598 Rev 1659
Line 301... Line 301...
301
		$code_referentiel = 'bdtfx';
301
		$code_referentiel = 'bdtfx';
302
		if(!isset($parametres['nom_referentiel'])) {
302
		if(!isset($parametres['nom_referentiel'])) {
303
			$parametres['nom_referentiel'] = 'bdtfx:v1.01';
303
			$parametres['nom_referentiel'] = 'bdtfx:v1.01';
304
		}
304
		}
305
		$code_referentiel = substr($parametres['nom_referentiel'], 0, 5);
305
		$code_referentiel = substr($parametres['nom_referentiel'], 0, 5);
-
 
306
		
-
 
307
		if($this->estUnNomRetenuSansSaisi($parametres)) {
-
 
308
			echo $this->estUnNomRetenuSansSaisi($parametres, 'nom_ret_nn');exit;
-
 
309
			$parametres['nom_ret']= "";
-
 
310
			$parametres['nom_ret_nn']= "";
-
 
311
			$parametres['nt']= "";
-
 
312
			$parametres['famille']= "";
-
 
313
		}
-
 
314
		
306
		if ($this->estUnNomSolitaire($parametres)) {
315
		if ($this->estUnNomSolitaire($parametres)) {
Line 307... Line 316...
307
			
316
			
308
			$chercheur_infos_complementaires = new RechercheInfosTaxonBeta($this->config, $code_referentiel);
317
			$chercheur_infos_complementaires = new RechercheInfosTaxonBeta($this->config, $code_referentiel);
309
			// Utilisation d'un nom sans numéro nomenclatural, recherche d'une correspondance sur le nom
318
			// Utilisation d'un nom sans numéro nomenclatural, recherche d'une correspondance sur le nom
Line 361... Line 370...
361
        	if(count(explode("/",$parametres['date_observation'])) >= 3) {
370
        	if(count(explode("/",$parametres['date_observation'])) >= 3) {
362
        		list($jour,$mois,$annee)=explode("/",$parametres['date_observation']);
371
        		list($jour,$mois,$annee)=explode("/",$parametres['date_observation']);
363
        		$parametres['date_observation']=$annee."-".$mois."-".$jour." 0:0:0";
372
        		$parametres['date_observation']=$annee."-".$mois."-".$jour." 0:0:0";
364
        	}
373
        	}
365
        }
374
        }
-
 
375
 
366
        return $parametres;
376
        return $parametres;
367
	}
377
	}
Line -... Line 378...
-
 
378
	
-
 
379
	
-
 
380
	private function estUnNomRetenuSansSaisi($parametres) {
-
 
381
		return $this->parametreNumNomPasPresent($parametres) &&
-
 
382
		$this->parametreNomSelPasPresent($parametres) &&
-
 
383
		$this->parametreEstPresentEtValide($parametres, 'nom_ret_nn');
-
 
384
	}
-
 
385
		
-
 
386
	private function parametreEstPresentEtValide($parametres, $index) {
-
 
387
		return (isset($parametres[$index]) &&
-
 
388
		$parametres[$index] != null &&
-
 
389
		$parametres[$index] != '' &&
-
 
390
		$parametres[$index] != 0);
-
 
391
	}
368
	
392
	
369
	private function estUnNomSolitaire($parametres) {
393
	private function estUnNomSolitaire($parametres) {
370
		return $this->parametreNumNomPasPresent($parametres) && $parametres['nom_sel'] != '';
394
		return $this->parametreNumNomPasPresent($parametres) && isset($parametres['nom_sel']) && $parametres['nom_sel'] != '';
Line 371... Line 395...
371
	}
395
	}
372
	
396
	
373
	private function parametreNumNomEstPresent($parametres) {
397
	private function parametreNumNomEstPresent($parametres) {
Line 379... Line 403...
379
				$parametres['nom_sel_nn'] == null ||
403
				$parametres['nom_sel_nn'] == null ||
380
				$parametres['nom_sel_nn'] == '' || 
404
				$parametres['nom_sel_nn'] == '' || 
381
				$parametres['nom_sel_nn'] == 0);
405
				$parametres['nom_sel_nn'] == 0);
382
	}
406
	}
Line -... Line 407...
-
 
407
	
-
 
408
	private function parametreNomSelPasPresent($parametres) {
-
 
409
		return (!isset($parametres['nom_sel']) ||
-
 
410
		$parametres['nom_sel'] == null ||
-
 
411
		$parametres['nom_sel'] == '' ||
-
 
412
		$parametres['nom_sel'] == 0);
-
 
413
	}
383
	
414
	
384
	/**
415
	/**
385
	* Assemble une sous requete pour un ajout, tout en formatant les paramètres et en recherchant
416
	* Assemble une sous requete pour un ajout, tout en formatant les paramètres et en recherchant
386
	* les infos complémentaires
417
	* les infos complémentaires
387
	* 
418
	*