Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 1487 Rev 1527
Line 22... Line 22...
22
	private $url_service_nom = null;
22
	private $url_service_nom = null;
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
	
28
		
28
	public function RechercheInfosTaxonBeta($config) {		
29
	public function RechercheInfosTaxonBeta($config, $code_referentiel = 'bdtfx') {
-
 
30
		parent::__construct($config);
-
 
31
		$this->code_referentiel = $code_referentiel;
-
 
32
		$this->formaterUrlsServices($config);
-
 
33
	}
-
 
34
	
29
		parent::__construct($config);
35
	private function formaterUrlsServices($config) {
30
		$this->url_service_nom = $config['eflore']['url_service_nom'];
36
		$this->url_service_nom = str_replace('{referentiel}', $this->code_referentiel ,$config['eflore']['url_service_nom']);
31
		$this->url_service_taxon = $config['eflore']['url_service_taxon'];
37
		$this->url_service_taxon = str_replace('{referentiel}', $this->code_referentiel ,$config['eflore']['url_service_taxon']);
32
		$this->url_service_chorologie_obs = $config['eflore']['url_service_chorologie_obs'];
38
		$this->url_service_chorologie_obs = $config['eflore']['url_service_chorologie_obs'];
Line 33... Line 39...
33
	}
39
	}
Line 174... Line 180...
174
	private function supprimerBiblio($nom) {
180
	private function supprimerBiblio($nom) {
175
		return preg_replace('/ \[.*\]/','',$nom);
181
		return preg_replace('/ \[.*\]/','',$nom);
176
	}
182
	}
Line 177... Line 183...
177
	
183
	
178
	public function rechercherNumTaxSurNumNom($num_nom) {
-
 
179
	
184
	public function rechercherNumTaxSurNumNom($num_nom) {
180
		$nt = null;
185
		$nt = null;
181
		$url = $this->url_service_nom."/".$num_nom.'?retour.champs=num_taxonomique';
186
		$url = $this->url_service_nom."/".$num_nom.'?retour.champs=num_taxonomique';
182
		$resultat = @file_get_contents($url);
187
		$resultat = @file_get_contents($url);
183
		if($resultat != '') {
188
		if($resultat != '') {
Line 220... Line 225...
220
		// ou code taxonomique (format BDNFFnt999999)
225
		// ou code taxonomique (format BDNFFnt999999)
221
		$identifiant_espece=trim($identifiant_espece);
226
		$identifiant_espece=trim($identifiant_espece);
222
		$identifiant_espece=utf8_encode($identifiant_espece);
227
		$identifiant_espece=utf8_encode($identifiant_espece);
Line 223... Line 228...
223
		
228
		
224
		$retour = array();
-
 
-
 
229
		$retour = array();
225
		
230
		//TODO: voir ce qu'on fait pour l'import de différent référentiels
226
		preg_match('/BDNFFnn([0-9][0-9]*)/',$identifiant_espece, $elements);
231
		preg_match('/BDNFFnn([0-9][0-9]*)/',$identifiant_espece, $elements);
227
		if (isset($elements[1])) {
232
		if (isset($elements[1])) {
228
			// Numero nomenclatural
233
			// Numero nomenclatural
229
			$infos_taxon = $this->rechercherInformationsComplementairesSurNumNom($elements[1]);
234
			$infos_taxon = $this->rechercherInformationsComplementairesSurNumNom($elements[1]);