Subversion Repositories eFlore/Applications.eflore-consultation

Compare Revisions

Ignore whitespace Rev 951 → Rev 952

/trunk/modules/fiche/formateurs/Nomenclature.php
18,10 → 18,13
private $nomCourant = null;
private $noms = null;
private $meta = null;
private $referentiel = 'bdtfx';
private $donnees = array();
 
public function __construct(Conteneur $conteneur) {
$this->conteneur = $conteneur;
$this->nomCourant = $this->conteneur->getNomCourant();
$this->referentiel = $this->conteneur->getParametre('referentiel');
$this->taxons = $this->conteneur->getApiTaxons();
$this->noms = $this->conteneur->getApiNoms();
$this->meta = $this->conteneur->getApiMetaDonnees();
32,38 → 35,36
}
 
public function obtenirDonnees() {
 
$donnees = array();
$donnees['baseUrlIco'] = $this->appUrls->obtenirUrlBaseDossier();
$donnees['referentiel'] = 'bdtfx';
$donnees['flores_synonymes'] = $this->getFlores();
$donnees['synonymes']['noms'] = $this->getSynonymes();
$donnees['date_maj'] = $this->nomCourant->getNomRetenu()->get('maj_modif');
$this->donnees['baseUrlIco'] = $this->appUrls->obtenirUrlBaseDossier();
$this->donnees['referentiel'] = $this->referentiel;
$this->getFlores();
$this->donnees['synonymes']['noms'] = $this->getSynonymes();
$this->donnees['date_maj'] = $this->nomCourant->getNomRetenu()->get('maj_modif');
$meta = $this->meta->getMetaDonnees();
$titreMeta = $meta[0]['titre'];
$donnees['synonymes']['meta']['titre'] = $titreMeta;
$donnees['synonymes']['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('bdtfx');
$donnees['num_type'] = $this->nomCourant->getNomSelectionne()->get('num_type');
$donnees['urls'] = $this->appUrls;
$donnees['nom_retenu_formate'] = $this->nomCourant->getNomRetenu()->get('nom_sci_html_complet');
$donnees['nom_retenu_nn'] = $this->nomCourant->getNomRetenu()->get('nom_retenu.id');
$donnees['basionyme_nom_retenu'] = $this->nomCourant->getNomRetenu()->get('basionyme_html_complet');
$donnees['basionyme_nom_retenu_nn'] = $this->nomCourant->getNomRetenu()->get('basionyme.id');
$donnees['nom_selectionne'] = $this->nomCourant->getNomSelectionne()->get('nom_sci_html');
$donnees['nom_retenu'] = $this->nomCourant->getNomRetenu()->get('nom_sci');
$donnees['wikini'] = $this->getWikini();
$donnees['hybride_parent_01'] = $this->nomCourant->getNomRetenu()->get('hybride.parent_01_html_complet');
$donnees['hybride_parent_02'] = $this->nomCourant->getNomRetenu()->get('hybride.parent_02_html_complet');
$donnees['hybride_parent_01_nn'] = $this->nomCourant->getNomRetenu()->get('hybride.parent_01.id');
$donnees['hybride_parent_02_nn'] = $this->nomCourant->getNomRetenu()->get('hybride.parent_02.id');
$this->donnees['synonymes']['meta']['titre'] = $titreMeta;
$this->donnees['synonymes']['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('bdtfx');
$this->donnees['num_type'] = $this->nomCourant->getNomSelectionne()->get('num_type');
$this->donnees['urls'] = $this->appUrls;
$this->donnees['nom_retenu_formate'] = $this->nomCourant->getNomRetenu()->get('nom_sci_html_complet');
$this->donnees['nom_retenu_nn'] = $this->nomCourant->getNomRetenu()->get('nom_retenu.id');
$this->donnees['basionyme_nom_retenu'] = $this->nomCourant->getNomRetenu()->get('basionyme_html_complet');
$this->donnees['basionyme_nom_retenu_nn'] = $this->nomCourant->getNomRetenu()->get('basionyme.id');
$this->donnees['nom_selectionne'] = $this->nomCourant->getNomSelectionne()->get('nom_sci_html');
$this->donnees['nom_retenu'] = $this->nomCourant->getNomRetenu()->get('nom_sci');
$this->donnees['wikini'] = $this->getWikini();
$this->donnees['hybride_parent_01'] = $this->nomCourant->getNomRetenu()->get('hybride.parent_01_html_complet');
$this->donnees['hybride_parent_02'] = $this->nomCourant->getNomRetenu()->get('hybride.parent_02_html_complet');
$this->donnees['hybride_parent_01_nn'] = $this->nomCourant->getNomRetenu()->get('hybride.parent_01.id');
$this->donnees['hybride_parent_02_nn'] = $this->nomCourant->getNomRetenu()->get('hybride.parent_02.id');
$donnees['taxons_sup'] = $this->nomCourant->taxons_sup;
$donnees['taxon_courant']['rang.libelle'] = $this->nomCourant->getNomRetenu()->get('rang.libelle');
$donnees['taxon_courant']['nom_sci'] = $this->nomCourant->getNomRetenu()->get('nom_sci');
$donnees['taxon_courant']['num_nom'] = $this->nomCourant->getNomRetenu()->get('id');
$donnees['taxons_inf'] = $this->getTaxonsInferieurs();
return $donnees;
$this->donnees['taxons_sup'] = $this->nomCourant->taxons_sup;
$this->donnees['taxon_courant']['rang.libelle'] = $this->nomCourant->getNomRetenu()->get('rang.libelle');
$this->donnees['taxon_courant']['nom_sci'] = $this->nomCourant->getNomRetenu()->get('nom_sci');
$this->donnees['taxon_courant']['num_nom'] = $this->nomCourant->getNomRetenu()->get('id');
$this->donnees['taxons_inf'] = $this->getTaxonsInferieurs();
return $this->donnees;
}
76,32 → 77,33
public function obtenirVersionDonnees() {
$meta = $this->meta->getMetaDonnees();
$donnees['version'] = $meta[0]['code'].' v.'.$meta[0]['version'];
return $donnees;
$this->donnees['version'] = $meta[0]['code'].' v.'.$meta[0]['version'];
return $this->donnees;
}
 
public function getBloc() {
$donnees['nom_selectionne'] = $this->nomCourant->getNomSelectionne()->get('nom_sci_html_complet');
$donnees['nom_retenu_formate'] = $this->nomCourant->getNomRetenu()->get('nom_sci_html_complet');
$donnees['basionyme_nom_retenu'] = $this->nomCourant->getNomRetenu()->get('basionyme_html_complet');
$this->donnees['nom_selectionne'] = $this->nomCourant->getNomSelectionne()->get('nom_sci_html_complet');
$this->donnees['nom_retenu_formate'] = $this->nomCourant->getNomRetenu()->get('nom_sci_html_complet');
$this->donnees['basionyme_nom_retenu'] = $this->nomCourant->getNomRetenu()->get('basionyme_html_complet');
$synonymes = $this->getSynonymes();
$donnees['synonymes'] = array_slice($synonymes, 0, 3);
$donnees['autresSynonymesNbre'] = count($synonymes) - 3;
$this->donnees['synonymes'] = array_slice($synonymes, 0, 3);
$this->donnees['autresSynonymesNbre'] = count($synonymes) - 3;
$donnees['taxons_sup'] = $this->nomCourant->taxons_sup;
$donnees['taxons_inf'] = $this->getTaxonsInferieurs();
$donnees['taxons_sup'] = is_array($donnees['taxons_sup']) ? array_slice($donnees['taxons_sup'], -3 , 3) : array();
$donnees['taxons_inf'] = is_array($donnees['taxons_inf']) ? array_slice($donnees['taxons_inf'], 0 , 3) : array();
$this->donnees['taxons_sup'] = $this->nomCourant->taxons_sup;
$this->donnees['taxons_inf'] = $this->getTaxonsInferieurs();
$this->donnees['taxons_sup'] = is_array($this->donnees['taxons_sup']) ? array_slice($this->donnees['taxons_sup'], -3 , 3) : array();
$this->donnees['taxons_inf'] = is_array($this->donnees['taxons_inf']) ? array_slice($this->donnees['taxons_inf'], 0 , 3) : array();
return $donnees;
return $this->donnees;
}
 
private function getFlores() {
$nnr = $this->nomCourant->getNnr();
$flores = $this->noms->getFlores($nnr);
$flores['resultat'] = (isset($flores['resultat']) && is_array($flores['resultat'])) ? $flores['resultat'] : array();
return $flores['resultat'];
if (Config::get($this->referentiel.'.baseFloresRef') != "") {
$nnr = $this->nomCourant->getNnr();
$flores = $this->noms->getFlores($nnr);
$this->donnees['flores_synonymes'] = (isset($flores['resultat']) && is_array($flores['resultat'])) ? $flores['resultat'] : array();
}
}
 
private function getSynonymes() {
121,9 → 123,8
private function getWikini() {
$wikini = array();
$wikini['titre'] = 'Wikini';
$referentiel = $this->conteneur->getParametre('referentiel');
$num_tax = $this->nomCourant->getNomSelectionne()->get('num_taxonomique');
$page_wiki = $this->wikini->getPageWikiPourRefEtNumTax($referentiel, $num_tax);
$page_wiki = $this->wikini->getPageWikiPourRefEtNumTax($this->referentiel, $num_tax);
$wikini['nomenclature'] = $this->wikini->getTexteFormate($page_wiki, 'nomenclature');
return $wikini;
}
/trunk/modules/fiche/formateurs/Repartition.php
16,6 → 16,8
 
private $conteneur = null;
private $nomCourant = null;
private $referentiel = 'bdtfx';
private $donnees = array();
private $tailleBloc = "190x178";
private $serviceChorodep = null;
private $cartes;
25,6 → 27,7
public function __construct(Conteneur $conteneur) {
$this->conteneur = $conteneur;
$this->nomCourant = $this->conteneur->getNomCourant();
$this->referentiel = $this->conteneur->getParametre('referentiel');
$this->cartes = $this->conteneur->getApiCartes();
$this->meta = $this->conteneur->getApiMetaDonnees();
$this->appUrls = $this->conteneur->getAppUrls();
31,45 → 34,51
}
 
public function obtenirDonnees() {
$donnees['chorodep'] = $this->getChorodep();
$donnees['eflore'] = $this->getEflore();
$donnees['widget']['nt'] = $this->nomCourant->getNt();
$donnees['widget']['nn'] = $this->nomCourant->getNnr();
return $donnees;
$this->getRepartition();
$this->getMoissonnage();
$this->donnees['widget']['nt'] = $this->nomCourant->getNt();
$this->donnees['widget']['nn'] = $this->nomCourant->getNnr();
return $this->donnees;
}
 
public function obtenirDonneesExport() {
$donnees['chorodep'] = $this->getChorodep();
$donnees['eflore'] = $this->getEfloreExport();
$donnees['chorodep'] = $this->getRepartition();
$donnees['eflore'] = $this->getMoissonnageExport();
return $donnees;
}
private function getChorodep() {
$this->cartes->setProjet('chorodep');
$this->cartes->setLargeur('630');
$id = 'nn:'.$this->nomCourant->getNnr();
$this->cartes->setId($id);
$chorodep['svgUrl'] = $this->cartes->getUrlDataSvg();
$chorodep['pngUrl'] = $this->cartes->getUrlPng();
$chorodep['legende'] = $this->cartes->getLegendeId();
$this->meta->setProjet('chorodep');
$meta = $this->meta->getMetaDonnees();
$citation = $meta[0]['citation'];
$chorodep['meta']['citation'] = $citation;
$chorodep['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('chorodep');
return $chorodep;
private function getRepartition() {
$projetRepartition = Config::get($this->referentiel.'.baseRepartition');
if ($projetRepartition != "") {
$this->cartes->setProjet($projetRepartition);
$this->cartes->setLargeur('630');
$id = 'nn:'.$this->nomCourant->getNnr();
$this->cartes->setId($id);
$repartition['svgUrl'] = $this->cartes->getUrlDataSvg();
$repartition['pngUrl'] = $this->cartes->getUrlPng();
$repartition['legende'] = $this->cartes->getLegendeId();
$this->meta->setProjet($projetRepartition);
$meta = $this->meta->getMetaDonnees();
$citation = $meta[0]['citation'];
$repartition['meta']['citation'] = $citation;
$repartition['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees($projetRepartition);
$this->donnees['repartition'] = $repartition;
}
}
private function getEflore() {
$this->cartes->setProjet('eflore');
$this->cartes->setLargeur('max');
$this->cartes->setInfoNom($this->nomCourant->getNomRetenu());
$eflore['mapUrl'] = $this->cartes->getUrlMap();
$eflore['legende'] = $this->cartes->getLegende();
return $eflore;
private function getMoissonnage() {
$projetMoissonnage = Config::get($this->referentiel.'.baseMoissonnage');
if ($projetMoissonnage != "") {
$this->cartes->setProjet('eflore');
$this->cartes->setLargeur('max');
$this->cartes->setInfoNom($this->nomCourant->getNomRetenu());
$eflore['mapUrl'] = $this->cartes->getUrlMap();
$eflore['legende'] = $this->cartes->getLegende();
$this->donnees['moissonnage'] = $eflore;
}
}
private function getEfloreExport() {
private function getMoissonnageExport() {
$this->cartes->setProjet('eflore');
$this->cartes->setLargeur('min');
$this->cartes->setInfoNom($this->nomCourant->getNomRetenu());