Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 1787 Rev 1796
Line 177... Line 177...
177
	function rechercherInfosSurTexteCodeOuNumTax($identifiant_espece) {
177
	function rechercherInfosSurTexteCodeOuNumTax($identifiant_espece) {
178
		preg_match('/(' . implode('|', Cel::$referentiels_valides) .'):(nn|nt):(\d+)/i', $identifiant_espece, $elements);
178
		preg_match('/(' . implode('|', Cel::$referentiels_valides) .'):(nn|nt):(\d+)/i', $identifiant_espece, $elements);
179
		if($elements) {
179
		if($elements) {
180
			$this->is_notation_spe = TRUE;
180
			$this->is_notation_spe = TRUE;
181
			list(, $ref, $type, $num) = $elements;
181
			list(, $ref, $type, $num) = $elements;
-
 
182
 
-
 
183
			if($ref != $this->code_referentiel) {
-
 
184
				// TODO: ignorer la colonne référentiel, et utiliser le référentiel donné
-
 
185
				// mais il faut alors avertir le service (d'import/modif) d'utiliser le référentiel
-
 
186
				// passé au nom d'espèce
-
 
187
			}
182
			// Numero nomenclatural
188
			// Numero nomenclatural
183
			if ($type == 'nn') {
189
			if ($type == 'nn') {
184
				$obj = $this->effectuerRequeteInfosComplementairesSurNumNom($num);
190
				$obj = $this->effectuerRequeteInfosComplementairesSurNumNom($num);
185
			}
191
			}
186
			// Numero taxonomique
192
			// Numero taxonomique
187
			else {
193
			else {
188
				//TODO: retourner moins de champs grâce au paramètre retour.champs
194
				//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));
195
				$obj = @json_decode(file_get_contents($this->url_service_taxon."/nt:".$num));
190
			}
196
			}
191
			$obj->ref = $ref;
197
			if($obj) $obj->ref = $ref;
192
			return $obj;
198
			return $obj;
193
		}
199
		}
Line 194... Line 200...
194
 
200
 
195
		// Nom scientifique
201
		// Nom scientifique