| Line 443... |
Line 443... |
| 443 |
car ce tableau est passé à un PDO::preparedStatement() qui applique
|
443 |
car ce tableau est passé à un PDO::preparedStatement() qui applique
|
| 444 |
proprement les règle d'échappement.
|
444 |
proprement les règle d'échappement.
|
| 445 |
*/
|
445 |
*/
|
| 446 |
static function chargerLigne($ligne, $dernier_ordre, $cel) {
|
446 |
static function chargerLigne($ligne, $dernier_ordre, $cel) {
|
| 447 |
// en premier car le résultat est utile pour
|
447 |
// en premier car le résultat est utile pour
|
| - |
|
448 |
// * traiter espèce (traiterEspece())
|
| 448 |
// traiter longitude et latitude (traiterLonLat())
|
449 |
// * traiter longitude et latitude (traiterLonLat())
|
| 449 |
$referentiel = self::identReferentiel($ligne[C_NOM_REFERENTIEL]);
|
450 |
$referentiel = self::identReferentiel(trim(strtolower($ligne[C_NOM_REFERENTIEL])));
|
| Line 450... |
Line 451... |
| 450 |
|
451 |
|
| 451 |
// $espece est rempli de plusieurs informations
|
452 |
// $espece est rempli de plusieurs informations
|
| 452 |
$espece = Array(C_NOM_SEL => NULL, C_NOM_SEL_NN => NULL, C_NOM_RET => NULL,
|
453 |
$espece = Array(C_NOM_SEL => NULL, C_NOM_SEL_NN => NULL, C_NOM_RET => NULL,
|
| 453 |
C_NOM_RET_NN => NULL, C_NT => NULL, C_FAMILLE => NULL);
|
454 |
C_NOM_RET_NN => NULL, C_NT => NULL, C_FAMILLE => NULL);
|
| Line 454... |
Line 455... |
| 454 |
self::traiterEspece($ligne, $espece, $cel);
|
455 |
self::traiterEspece($ligne, $espece, $referentiel, $cel);
|
| 455 |
|
456 |
|
| 456 |
// $localisation est rempli à partir de plusieurs champs: C_ZONE_GEO et C_CE_ZONE_GEO
|
457 |
// $localisation est rempli à partir de plusieurs champs: C_ZONE_GEO et C_CE_ZONE_GEO
|
| Line 591... |
Line 592... |
| 591 |
}
|
592 |
}
|
| 592 |
}
|
593 |
}
|
| Line 593... |
Line 594... |
| 593 |
|
594 |
|
| 594 |
static function identReferentiel($referentiel) {
|
595 |
static function identReferentiel($referentiel) {
|
| 595 |
// SELECT DISTINCT nom_referentiel, COUNT(id_observation) AS count FROM cel_obs GROUP BY nom_referentiel ORDER BY count DESC;
|
596 |
// SELECT DISTINCT nom_referentiel, COUNT(id_observation) AS count FROM cel_obs GROUP BY nom_referentiel ORDER BY count DESC;
|
| 596 |
if(strpos(strtolower($referentiel), 'bdtfx') !== FALSE) return 'bdtfx:v1.01';
|
597 |
if(strpos($referentiel, 'bdtfx') !== FALSE) return 'bdtfx:v1.01';
|
| 597 |
if(strpos(strtolower($referentiel), 'bdtxa') !== FALSE) return 'bdtxa:v1.00';
|
598 |
if(strpos($referentiel, 'bdtxa') !== FALSE) return 'bdtxa:v1.00';
|
| 598 |
if(strpos(strtolower($referentiel), 'bdnff') !== FALSE) return 'bdnff:4.02';
|
599 |
if(strpos($referentiel, 'bdnff') !== FALSE) return 'bdnff:4.02';
|
| - |
|
600 |
if(strpos($referentiel, 'isfan') !== FALSE) return 'isfan:v1.00';
|
| Line 599... |
Line 601... |
| 599 |
if(strpos(strtolower($referentiel), 'isfan') !== FALSE) return 'isfan:v1.00';
|
601 |
if(strpos($referentiel, 'autre') !== FALSE) return 'autre';
|
| 600 |
|
602 |
|
| 601 |
if($referentiel) {
|
603 |
if($referentiel) {
|
| 602 |
trigger_error("ligne \"{$ligne[C_NOM_SEL]}\": Attention: référentiel inconnu", E_USER_NOTICE);
|
604 |
trigger_error("ligne \"{$ligne[C_NOM_SEL]}\": Attention: référentiel inconnu", E_USER_NOTICE);
|
| Line 645... |
Line 647... |
| 645 |
|
647 |
|
| 646 |
/*
|
648 |
/*
|
| 647 |
TODO: s'affranchir du webservice pour la détermination du nom scientifique en s'appuyant sur cel_references,
|
649 |
TODO: s'affranchir du webservice pour la détermination du nom scientifique en s'appuyant sur cel_references,
|
| 648 |
pour des questions de performances
|
650 |
pour des questions de performances
|
| 649 |
*/
|
651 |
*/
|
| 650 |
static function traiterEspece($ligne, Array &$espece, $cel) {
|
652 |
static function traiterEspece($ligne, Array &$espece, $referentiel, $cel) {
|
| Line 651... |
Line 653... |
| 651 |
if(!$ligne[C_NOM_SEL]) return;
|
653 |
if(!$ligne[C_NOM_SEL]) return;
|
| 652 |
|
654 |
|
| Line 653... |
Line 655... |
| 653 |
// nom_sel reste toujours celui de l'utilisateur
|
655 |
// nom_sel reste toujours celui de l'utilisateur
|
| Line 654... |
Line 656... |
| 654 |
$espece[C_NOM_SEL] = trim($ligne[C_NOM_SEL]);
|
656 |
$espece[C_NOM_SEL] = trim($ligne[C_NOM_SEL]);
|
| Line 655... |
Line 657... |
| 655 |
|
657 |
|
| 656 |
$taxon_info_webservice = new RechercheInfosTaxonBeta($cel->config);
|
658 |
$taxon_info_webservice = new RechercheInfosTaxonBeta($cel->config, $referentiel);
|