Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 1926 → Rev 1927

/trunk/jrest/services/ImportXLS.php
261,7 → 261,7
// à partir des (au plus) NB_LIRE_LIGNE_SIMUL lignes
 
// TODO: passer $this, ne sert que pour appeler des méthodes publiques qui pourraient être statiques
// notamment dans RechercheInfosTaxonBeta.php
$this->taxon_info_webservice = new RechercheInfosTaxonBeta($this->config, NULL);
list($enregistrements, $images, $mots_cle) =
self::chargerLignes($this, $donnees, $this->colonnes_statiques, $dernier_ordre);
if(! $enregistrements) break;
480,7 → 480,7
// $espece est rempli de plusieurs informations
$espece = Array(C_NOM_SEL => NULL, C_NOM_SEL_NN => NULL, C_NOM_RET => NULL,
C_NOM_RET_NN => NULL, C_NT => NULL, C_FAMILLE => NULL);
self::traiterEspece($ligne, $espece, $referentiel, $cel);
self::traiterEspece($ligne, $espece, $referentiel, $cel->taxon_info_webservice);
 
if(!$espece[C_NOM_SEL]) $referentiel = Cel::$fallback_referentiel;
if($espece[C_NOM_SEL] && !$espece[C_NOM_SEL_NN]) $referentiel = Cel::$fallback_referentiel;
690,7 → 690,7
TODO: s'affranchir du webservice pour la détermination du nom scientifique en s'appuyant sur cel_references,
pour des questions de performances
*/
static function traiterEspece($ligne, Array &$espece, &$referentiel, $cel) {
static function traiterEspece($ligne, Array &$espece, &$referentiel, $taxon_info_webservice) {
if(empty($ligne[C_NOM_SEL])) {
// TODO: nous ne déclarons pas "Numéro nomenclatural" comme colonne importable
// Nous ne pouvons donc pas tenter d'être sympa sur la détermination par num_nom
705,7 → 705,7
 
// XXX/attention, nous ne devrions pas accepter un référentiel absent !
if(!$referentiel) $referentiel = 'bdtfx';
$taxon_info_webservice = new RechercheInfosTaxonBeta($cel->config, $referentiel);
$taxon_info_webservice->setReferentiel($referentiel);
$ascii = iconv('UTF-8', 'ASCII//TRANSLIT', $ligne[C_NOM_SEL]);
 
// TODO: si empty(C_NOM_SEL) et !empty(C_NOM_SEL_NN) : recherche info à partir de C_NOM_SEL_NN
/trunk/jrest/lib/RechercheInfosTaxonBeta.php
34,8 → 34,12
 
public function RechercheInfosTaxonBeta($config, $code_referentiel = 'bdtfx') {
parent::__construct($config);
$this->setReferentiel($code_referentiel);
}
 
public function setReferentiel($code_referentiel = 'bdtfx') {
$this->code_referentiel = $code_referentiel;
$this->formaterUrlsServices($config);
$this->formaterUrlsServices($this->config);
}
private function formaterUrlsServices($config) {