Line 646... |
Line 646... |
646 |
$taxon_info_webservice = new RechercheInfosTaxonBeta($cel->config);
|
646 |
$taxon_info_webservice = new RechercheInfosTaxonBeta($cel->config);
|
Line 647... |
Line 647... |
647 |
|
647 |
|
Line 648... |
Line 648... |
648 |
$ascii = iconv('UTF-8', 'ASCII//TRANSLIT', $ligne[C_NOM_SEL]);
|
648 |
$ascii = iconv('UTF-8', 'ASCII//TRANSLIT', $ligne[C_NOM_SEL]);
|
- |
|
649 |
|
- |
|
650 |
// TODO: si empty(C_NOM_SEL) et !empty(C_NOM_SEL_NN) : recherche info à partir de C_NOM_SEL_NN
|
- |
|
651 |
echo "rechercherInformationsComplementairesSurNom()\n";
|
- |
|
652 |
/*
|
- |
|
653 |
SELECT num_nom, nom_sci, num_nom_retenu ,auteur, annee, biblio_origine, nom_sci,auteur FROM bdtfx_v1_01 WHERE (nom_sci LIKE 'Heliotropium europaeum') ORDER BY nom_sci ASC LIMIT 0, 1
|
- |
|
654 |
#
|
- |
|
655 |
SELECT num_nom, nom_sci, num_nom_retenu ,auteur, annee, biblio_origine, nom_sci,auteur FROM bdtfx_v1_01 WHERE (nom_sci LIKE 'eliotropium euro') ORDER BY nom_sci ASC LIMIT 0, 1
|
- |
|
656 |
SELECT num_nom, nom_sci, num_nom_retenu ,auteur, annee, biblio_origine, nom_sci,auteur FROM bdtfx_v1_01 WHERE (nom_sci LIKE 'eliotropium') ORDER BY nom_sci ASC LIMIT 0, 1
|
- |
|
657 |
SELECT num_nom, nom_sci, num_nom_retenu ,auteur, annee, biblio_origine, nom_sci,auteur FROM bdtfx_v1_01 WHERE (nom_sci LIKE 'eliotropium% euro%') ORDER BY nom_sci ASC LIMIT 0, 1
|
- |
|
658 |
#
|
- |
|
659 |
|
649 |
|
660 |
SELECT nom_sci, num_nom_retenu, nom_sci_html, auteur, annee, biblio_origine FROM bdtfx_v1_01 WHERE num_nom = 31468
|
Line 650... |
Line 661... |
650 |
// TODO: si empty(C_NOM_SEL) et !empty(C_NOM_SEL_NN) : recherche info à partir de C_NOM_SEL_NN
|
661 |
*/
|
651 |
$resultat_recherche_espece = $taxon_info_webservice->rechercherInfosSurTexteCodeOuNumTax($ligne[C_NOM_SEL]);
|
662 |
$resultat_recherche_espece = $taxon_info_webservice->rechercherInformationsComplementairesSurNom($ligne[C_NOM_SEL]);
|
652 |
|
663 |
|
653 |
// on supprime les noms retenus et renvoi tel quel
|
664 |
// on supprime les noms retenus et renvoi tel quel
|
654 |
// on réutilise les define pour les noms d'indexes, tant qu'à faire
|
665 |
// on réutilise les define pour les noms d'indexes, tant qu'à faire
|
655 |
if (empty($resultat_recherche_espece['en_id_nom'])) {
|
666 |
if (! $resultat_recherche_espece) {
|
656 |
// XXX; tout à NULL sauf C_NOM_SEL ci-dessus ?
|
667 |
// XXX; tout à NULL sauf C_NOM_SEL ci-dessus ?
|
657 |
$espece[C_NOM_SEL_NN] = $ligne[C_NOM_SEL_NN];
|
668 |
$espece[C_NOM_SEL_NN] = $ligne[C_NOM_SEL_NN];
|
Line 662... |
Line 673... |
662 |
|
673 |
|
663 |
return;
|
674 |
return;
|
Line 664... |
Line 675... |
664 |
}
|
675 |
}
|
665 |
|
676 |
|
666 |
// succès de la détection = écrasement du numéro nomenclatural saisi...
|
677 |
// succès de la détection = écrasement du numéro nomenclatural saisi...
|
- |
|
678 |
$espece[C_NOM_SEL_NN] = $resultat_recherche_espece[0][0];
|
667 |
$espece[C_NOM_SEL_NN] = $resultat_recherche_espece['en_id_nom'];
|
679 |
// et des info complémentaires
|
- |
|
680 |
echo "rechercherInformationsComplementairesSurNumNom()\n";
|
- |
|
681 |
$complement = $taxon_info_webservice->rechercherInformationsComplementairesSurNumNom($resultat_recherche_espece[0][0]);
|
- |
|
682 |
/*
|
- |
|
683 |
// GET /service:eflore:0.1/bdtfx/noms/31468?retour.champs=nom_sci,auteur,id,nom_retenu_complet,nom_retenu.id,num_taxonomique,famille
|
- |
|
684 |
/home/raphael/eflore/projets/services/modules/0.1/bdtfx/Noms.php:280
|
- |
|
685 |
SELECT *, nom_sci FROM bdtfx_v1_01 WHERE num_nom = '31468'
|
- |
|
686 |
SELECT nom_sci, num_nom_retenu, nom_sci_html, auteur, annee, biblio_origine FROM bdtfx_v1_01 WHERE num_nom = 31468
|
668 |
// et des info complémentaires
|
687 |
SELECT nom_sci, num_nom_retenu, nom_sci_html, auteur, annee, biblio_origine FROM bdtfx_v1_01 WHERE num_nom = 86535
|
669 |
$complement = $taxon_info_webservice->rechercherInformationsComplementairesSurNumNom($resultat_recherche_espece['en_id_nom']);
|
688 |
*/
|
670 |
$espece[C_NOM_RET] = $complement['Nom_Retenu'];
|
689 |
$espece[C_NOM_RET] = $complement['Nom_Retenu'];
|
671 |
$espece[C_NOM_RET_NN] = $complement['Num_Nom_Retenu'];
|
690 |
$espece[C_NOM_RET_NN] = $complement['Num_Nom_Retenu'];
|
- |
|
691 |
$espece[C_NT] = $complement['Num_Taxon'];
|
672 |
$espece[C_NT] = $complement['Num_Taxon'];
|
692 |
$espece[C_FAMILLE] = $complement['Famille'];
|
Line -... |
Line 693... |
- |
|
693 |
var_dump("a", $espece);die;
|
- |
|
694 |
}
|
- |
|
695 |
|
- |
|
696 |
static function detectFromNom($nom, $cel) {
|
- |
|
697 |
$r = $cel->requeter(sprintf("SELECT num_nom, num_tax_sup FROM bdtfx_v1_01 WHERE (nom_sci LIKE '%s') ".
|
- |
|
698 |
"ORDER BY nom_sci ASC LIMIT 0, 1",
|
- |
|
699 |
$cel->proteger($nom)));
|
- |
|
700 |
if($r) return $r;
|
- |
|
701 |
|
- |
|
702 |
$cel->requeter(sprintf("SELECT num_nom, num_tax_sup FROM bdtfx_v1_01 WHERE (nom_sci LIKE '%s' OR nom LIKE '%s') ".
|
- |
|
703 |
"ORDER BY nom_sci ASC LIMIT 0, 1",
|
- |
|
704 |
$cel->proteger($nom),
|
Line 673... |
Line 705... |
673 |
$espece[C_FAMILLE] = $complement['Famille'];
|
705 |
$cel->proteger(str_replace(' ', '% ', $nom))));
|
674 |
}
|
706 |
return $r;
|
675 |
|
707 |
}
|
676 |
|
708 |
|