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());
/trunk/modules/fiche/squelettes/fiche_nomenclature.tpl.html
63,32 → 63,33
<h3 class="aucune_info"> Aucun synonyme référencé pour ce nom </h3>
<?php } ?>
<h2>Dénomination dans les flores usuelles</h2>
<?php if(is_array($flores_synonymes) && count($flores_synonymes) > 0) { ?>
<ul>
<?php foreach ($flores_synonymes as $num_nom_syn => $infos_flore) : ?>
<?php foreach ($infos_flore as $code => $flore) : ?>
<li class="item_nomenclature">
<div>
Dans la flore <em><?= $flore['nom_flore'] ?></em>,
ce taxon porte le nom de <em><?= $flore['nom_sci'] ?></em>
et le code <b><?= $flore['id'] ?></b><br />
</div>
</li>
<? if (isset($flores_synonymes)) : ?>
<h2>Dénomination dans les flores usuelles</h2>
<?php if(is_array($flores_synonymes) && count($flores_synonymes) > 0) { ?>
<ul>
<?php foreach ($flores_synonymes as $num_nom_syn => $infos_flore) : ?>
<?php foreach ($infos_flore as $code => $flore) : ?>
<li class="item_nomenclature">
<div>
Dans la flore <em><?= $flore['nom_flore'] ?></em>,
ce taxon porte le nom de <em><?= $flore['nom_sci'] ?></em>
et le code <b><?= $flore['id'] ?></b><br />
</div>
</li>
<?php endforeach; ?>
<?php endforeach; ?>
<?php endforeach; ?>
</ul><hr class="nettoyage" />
<?php } else { ?>
<h3 class="aucune_info"> Aucune information floristique référencée pour ce nom </h3>
<?php } ?>
<?php if($num_type != null) { ?>
<h3> Autres </h3>
<!-- On utilise une liste au cas où d'autres informations viendraient se greffer à cet endroit -->
<ul>
<li class="item_nomenclature"> Numéro du type : <?= $num_type ?></li>
</ul>
<?php } ?>
</ul><hr class="nettoyage" />
<?php } else { ?>
<h3 class="aucune_info"> Aucune information floristique référencée pour ce nom </h3>
<?php } ?>
<?php if($num_type != null) { ?>
<h3> Autres </h3>
<!-- On utilise une liste au cas où d'autres informations viendraient se greffer à cet endroit -->
<ul>
<li class="item_nomenclature"> Numéro du type : <?= $num_type ?></li>
</ul>
<?php } ?>
<? endif; ?>
<hr class="nettoyage" />
<div class="conteneur_lien_metadonnees">
<?= $synonymes['meta']['titre']?>
/trunk/modules/fiche/squelettes/fiche_repartition.tpl.html
1,11 → 1,12
<div id="repartition">
<div id="chorodep">
<? if (isset($repartition)) : ?>
<div id="repartition">
<h2>Chorologie départementale</h2>
<object class="chorodep_svg" type="image/svg+xml" data="<?=$chorodep['svgUrl']?>" class="svg" alt="<?=$chorodep['pngUrl']?>">
<object class="chorodep_svg" type="image/svg+xml" data="<?=$repartition['svgUrl']?>" class="svg" alt="<?=$repartition['pngUrl']?>">
</object>
<div id="legende" style="position:absolute; margin-top:-250px;margin-left:20px;">
<h3>Légende</h3><br />
<? foreach ($chorodep['legende'] as $id => $details) :?>
<? foreach ($repartition['legende'] as $id => $details) :?>
<div style="clear:left; ">
<div class="bloc_legende_repartition" style="background:<?=$details['couleur']?>"></div>
<div class="texte_legende_repartition"><b><?=$details['nom']?></b></div>
13,9 → 14,9
<? endforeach; ?>
</div>
<div class="conteneur_lien_metadonnees">
<?=$chorodep['meta']['citation']?>
<?=$repartition['meta']['citation']?>
<span class="conteneur_lien_metadonnees">
<a class="lien_metadonnees lien_popup" href="<?= $chorodep['meta']['url']; ?>">Voir toutes les metadonnées</a>
<a class="lien_metadonnees lien_popup" href="<?= $repartition['meta']['url']; ?>">Voir toutes les metadonnées</a>
</span>
</div>
<a href="http://www.tela-botanica.org/page:liste_projets?id_projet=9&amp;act=description"
22,14 → 23,16
title="Carte en cours d'élaboration. Participez au projet" onclick="window.open(this.href); return false;"
class="acceder-outil">Participez au projet</a>
</div>
<? endif; ?>
<hr class="nettoyage" />
<div id="eflore">
<? if (isset($moissonnage)) : ?>
<div id="moissonnage">
<h2>Observations</h2>
<object id="repartition_observations" type="text/html" data="<?=$eflore['mapUrl']?>" class="svg" alt="<?=$eflore['mapUrl']?>">
<object id="repartition_observations" type="text/html" data="<?=$moissonnage['mapUrl']?>" class="svg" alt="<?=$moissonnage['mapUrl']?>">
</object>
<div id="legende" style="padding:15px;margin-top:-25px;">
<? foreach ($eflore['legende'] as $id => $details) :?>
<? foreach ($moissonnage['legende'] as $id => $details) :?>
<div style="clear:left;">
<div class="bloc_legende_repartition" style="background:<?=$details['couleur']?>"></div>
<div ><b><?=$details['nom']?> : </b><?=$details['description']?></div>
36,7 → 39,10
</div>
<? endforeach; ?>
</div>
</div>
<?endif;?>
<div id="cel">
<h2>Observations du carnet en ligne</h2>
<iframe style="width:100%;height:500px" src="http://localhost/widget:cel:cartoPoint?num_taxon=<?=$widget['nt']?>"></iframe>
<a href="http://localhost/widget:cel:cartoPoint?num_taxon=<?=$widget['nt']?>">Consultez les données du carnet en ligne sur le widget carto</a>