Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 1780 Rev 1784
Line 23... Line 23...
23
	private $url_service_taxon = null;
23
	private $url_service_taxon = null;
24
	private $url_service_chorologie = null;
24
	private $url_service_chorologie = null;
Line 25... Line 25...
25
	
25
	
26
	private $masque_recherche = null;
26
	private $masque_recherche = null;
27
	private $code_referentiel = 'bdtfx';
27
	private $code_referentiel = 'bdtfx';
-
 
28
 
-
 
29
	// initialisé à TRUE par rechercherInfosSurTexteCodeOuNumTax()
-
 
30
	// si l'espèce passée a le motif <ref>:(nt|nn):<num>, eg: isfan:nt:1591
-
 
31
	public $is_notation_spe = FALSE;
28
		
32
 
29
	public function RechercheInfosTaxonBeta($config, $code_referentiel = 'bdtfx') {
33
	public function RechercheInfosTaxonBeta($config, $code_referentiel = 'bdtfx') {
30
		parent::__construct($config);
34
		parent::__construct($config);
31
		$this->code_referentiel = $code_referentiel;
35
		$this->code_referentiel = $code_referentiel;
32
		$this->formaterUrlsServices($config);
36
		$this->formaterUrlsServices($config);
Line 164... Line 168...
164
			}
168
			}
165
		}
169
		}
166
		return $presence_taxon;
170
		return $presence_taxon;
167
	}
171
	}
Line 168... Line -...
168
	
-
 
169
	public function effectuerRequeteInfosComplementairesSurNumTax($numTax) {
-
 
170
		//TODO: retourner moins de champs grâce au paramètre retour.champs
-
 
171
		return @json_decode(file_get_contents($this->url_service_taxon."/nt:".$numTax));
-
 
172
	}
-
 
173
 
172
	
174
	/* texte libre, nom scientifique, 
173
	/* texte libre, nom scientifique, 
175
	   ou code nomenclatural (format BDNFFnn999999) 
174
	   ou code nomenclatural (format bdtfx:nn:999999) 
176
	   ou code taxonomique (format BDNFFnt999999)
175
	   ou code taxonomique (format bdtfx:nt:999999)
177
	   TODO: voir ce qu'on fait pour l'import de différent référentiels */
176
	   TODO: voir ce qu'on fait pour l'import de différent référentiels */
178
	function rechercherInfosSurTexteCodeOuNumTax($identifiant_espece) {
177
	function rechercherInfosSurTexteCodeOuNumTax($identifiant_espece) {
-
 
178
		preg_match('/(' . implode('|', Cel::$referentiels_valides) .'):(nn|nt):(\d+)/i', $identifiant_espece, $elements);
-
 
179
		if($elements) {
-
 
180
			$this->is_notation_spe = TRUE;
179
		preg_match('/BDNFFnn(\d+)/',$identifiant_espece, $elements);
181
			list(, $ref, $type, $num) = $elements;
180
		// Numero nomenclatural
182
			// Numero nomenclatural
181
		if (isset($elements[1]))
183
			if ($type == 'nn') {
182
			return $this->effectuerRequeteInfosComplementairesSurNumNom($elements[1]);
184
				$obj = $this->effectuerRequeteInfosComplementairesSurNumNom($num);
183
 
185
			}
-
 
186
			// Numero taxonomique
-
 
187
			else {
184
		//  Numero taxonomique ou nom scientifique
188
				//TODO: retourner moins de champs grâce au paramètre retour.champs
-
 
189
				$obj = @json_decode(file_get_contents($this->url_service_taxon."/nt:".$num));
185
		preg_match('/BDNFFnt(\d+)/', $identifiant_espece, $elements);
190
			}
186
		// Numero taxonomique
191
			$obj->ref = $ref;
187
		if (isset($elements[1]))
-
 
-
 
192
			return $obj;
Line 188... Line 193...
188
			return $this->effectuerRequeteInfosComplementairesSurNumTax($elements[1]);
193
		}
189
 
194
 
190
		// Nom scientifique
195
		// Nom scientifique