| Line 21... |
Line 21... |
| 21 |
private $tailleBloc = "190x178";
|
21 |
private $tailleBloc = "190x178";
|
| 22 |
private $serviceChorodep = null;
|
22 |
private $serviceChorodep = null;
|
| 23 |
private $cartes;
|
23 |
private $cartes;
|
| 24 |
private $meta;
|
24 |
private $meta;
|
| 25 |
private $appUrls;
|
25 |
private $appUrls;
|
| 26 |
|
26 |
|
| 27 |
public function __construct(Conteneur $conteneur) {
|
27 |
public function __construct(Conteneur $conteneur) {
|
| 28 |
$this->conteneur = $conteneur;
|
28 |
$this->conteneur = $conteneur;
|
| 29 |
$this->nomCourant = $this->conteneur->getNomCourant();
|
29 |
$this->nomCourant = $this->conteneur->getNomCourant();
|
| 30 |
$this->referentiel = $this->conteneur->getParametre('referentiel');
|
30 |
$this->referentiel = $this->conteneur->getParametre('referentiel');
|
| 31 |
$this->cartes = $this->conteneur->getApiCartes();
|
31 |
$this->cartes = $this->conteneur->getApiCartes();
|
| Line 46... |
Line 46... |
| 46 |
public function obtenirDonneesExport() {
|
46 |
public function obtenirDonneesExport() {
|
| 47 |
$this->getRepartition();
|
47 |
$this->getRepartition();
|
| 48 |
$donnees['chorodep'] = $this->donnees['repartition'];
|
48 |
$donnees['chorodep'] = $this->donnees['repartition'];
|
| 49 |
$this->getMoissonnageExport();
|
49 |
$this->getMoissonnageExport();
|
| 50 |
// TODO: renommer l'index "eflore" en moissonnage
|
50 |
// TODO: renommer l'index "eflore" en moissonnage
|
| 51 |
// et renommer dans pdf_export/squelettes/pdf_repartition.tpl.html
|
51 |
// et renommer dans pdf_export/squelettes/pdf_repartition.tpl.html
|
| 52 |
$donnees['eflore'] = $this->donnees['moissonnage'];
|
52 |
$donnees['eflore'] = $this->donnees['moissonnage'];
|
| 53 |
return $donnees;
|
53 |
return $donnees;
|
| 54 |
}
|
54 |
}
|
| 55 |
|
55 |
|
| 56 |
private function getRepartition() {
|
56 |
private function getRepartition() {
|
| 57 |
$projetRepartition = Config::get($this->referentiel.'.baseRepartition');
|
57 |
$projetRepartition = Config::get($this->referentiel.'.baseRepartition');
|
| 58 |
// eg: eflore ou chorodep
|
58 |
// eg: eflore ou chorodep
|
| 59 |
// cf: bdtfx.ini, bdtxa.ini
|
59 |
// cf: bdtfx.ini, bdtxa.ini
|
| 60 |
if ($projetRepartition != "") {
|
60 |
if ($projetRepartition != '') {
|
| 61 |
$this->cartes->setProjet($projetRepartition);
|
61 |
$this->cartes->setProjet($projetRepartition);
|
| 62 |
$this->cartes->setLargeur('630');
|
62 |
$this->cartes->setLargeur('630');
|
| 63 |
|
- |
|
| 64 |
//TODO: démochir ce code
|
- |
|
| 65 |
// Chargement des nn des synonymes pour obtenir une carte plus complète
|
- |
|
| 66 |
$noms = $this->conteneur->getApiNoms();
|
63 |
$nt = $this->conteneur->getNomCourant()->getNt();
|
| 67 |
$syns = $noms->getSynonymes($this->nomCourant->getNnr());
|
- |
|
| 68 |
$nns_syns = array_keys($syns['resultat']);
|
- |
|
| 69 |
$nns_syns[] = $this->nomCourant->getNnr();
|
64 |
$referentiel = $this->conteneur->getParametre('referentiel');
|
| 70 |
$id = 'nn:'.implode(',', $nns_syns);
|
- |
|
| 71 |
|
- |
|
| 72 |
$this->cartes->setId($id);
|
65 |
$this->cartes->setId("$referentiel.nn:$nt");
|
| 73 |
$repartition['svgUrl'] = $this->cartes->getUrlDataSvg();
|
66 |
$repartition['svgUrl'] = $this->cartes->getUrlDataSvg();
|
| 74 |
$repartition['pngUrl'] = $this->cartes->getUrlPng();
|
67 |
$repartition['pngUrl'] = $this->cartes->getUrlPng();
|
| 75 |
$repartition['legende'] = $this->cartes->getLegendeId();
|
68 |
$repartition['legende'] = $this->cartes->getLegendeId();
|
| 76 |
$this->meta->setProjet($projetRepartition);
|
69 |
$this->meta->setProjet($projetRepartition);
|
| 77 |
$meta = $this->meta->getMetaDonnees();
|
70 |
$meta = $this->meta->getMetaDonnees();
|
| 78 |
$repartition['meta'] = $meta[0];
|
71 |
$repartition['meta'] = $meta[0];
|
| 79 |
$repartition['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees($projetRepartition);
|
72 |
$repartition['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees($projetRepartition);
|
| 80 |
$this->donnees['repartition'] = $repartition;
|
73 |
$this->donnees['repartition'] = $repartition;
|
| 81 |
}
|
74 |
}
|
| 82 |
}
|
75 |
}
|
| 83 |
|
76 |
|
| 84 |
private function getMoissonnage() {
|
77 |
private function getMoissonnage() {
|
| 85 |
$projetMoissonnage = Config::get($this->referentiel.'.baseMoissonnage');
|
78 |
$projetMoissonnage = Config::get($this->referentiel.'.baseMoissonnage');
|
| 86 |
if (! $projetMoissonnage) return;
|
79 |
if (! $projetMoissonnage) return;
|
| 87 |
$this->cartes->setProjet('moissonnage');
|
80 |
$this->cartes->setProjet('moissonnage');
|
| 88 |
$this->cartes->setLargeur('600');
|
81 |
$this->cartes->setLargeur('600');
|
| Line 92... |
Line 85... |
| 92 |
$eflore['mapTelechargementUrls'] = array('png' => $this->cartes->getUrlTelechargementMapPng(),
|
85 |
$eflore['mapTelechargementUrls'] = array('png' => $this->cartes->getUrlTelechargementMapPng(),
|
| 93 |
'html' => $this->cartes->getUrlTelechargementMapHtml());
|
86 |
'html' => $this->cartes->getUrlTelechargementMapHtml());
|
| 94 |
$eflore['legende'] = $this->cartes->getLegende();
|
87 |
$eflore['legende'] = $this->cartes->getLegende();
|
| 95 |
$this->donnees['moissonnage'] = $eflore;
|
88 |
$this->donnees['moissonnage'] = $eflore;
|
| 96 |
}
|
89 |
}
|
| 97 |
|
90 |
|
| 98 |
private function getMoissonnageExport() {
|
91 |
private function getMoissonnageExport() {
|
| 99 |
$projetMoissonnage = Config::get($this->referentiel.'.baseMoissonnage');
|
92 |
$projetMoissonnage = Config::get($this->referentiel.'.baseMoissonnage');
|
| 100 |
if (! $projetMoissonnage) return;
|
93 |
if (! $projetMoissonnage) return;
|
| 101 |
$this->cartes->setProjet($projetMoissonnage);
|
94 |
$this->cartes->setProjet($projetMoissonnage);
|
| 102 |
$this->cartes->setLargeur('min');
|
95 |
$this->cartes->setLargeur('min');
|
| 103 |
$this->cartes->setInfoNom($this->nomCourant->getNomRetenu());
|
96 |
$this->cartes->setInfoNom($this->nomCourant->getNomRetenu());
|
| 104 |
$eflore['min'] = $this->cartes->getUrlEflorePng();
|
97 |
$eflore['min'] = $this->cartes->getUrlEflorePng();
|
| 105 |
$eflore['legende'] = $this->cartes->getLegende();
|
98 |
$eflore['legende'] = $this->cartes->getLegende();
|
| 106 |
$this->donnees['moissonnage'] = $eflore;
|
99 |
$this->donnees['moissonnage'] = $eflore;
|
| 107 |
}
|
100 |
}
|
| 108 |
|
101 |
|
| 109 |
private function getFloreProbable() {
|
102 |
private function getFloreProbable() {
|
| 110 |
$projetFloreProbable = Config::get($this->referentiel.'.baseFloreProbable');
|
103 |
$projetFloreProbable = Config::get($this->referentiel.'.baseFloreProbable');
|
| 111 |
if (! $projetFloreProbable) return;
|
104 |
if (! $projetFloreProbable) return;
|
| 112 |
$this->cartes->setProjet($projetFloreProbable);
|
105 |
$this->cartes->setProjet($projetFloreProbable);
|
| 113 |
$this->meta->setProjet($projetFloreProbable);
|
106 |
$this->meta->setProjet($projetFloreProbable);
|
| Line 138... |
Line 131... |
| 138 |
'190x178');
|
131 |
'190x178');
|
| 139 |
}
|
132 |
}
|
| Line 140... |
Line 133... |
| 140 |
|
133 |
|
| 141 |
return $donnees;
|
134 |
return $donnees;
|
| 142 |
}
|
135 |
}
|
| 143 |
|
136 |
|
| 144 |
private function getChorodepMiniature() {
|
137 |
private function getChorodepMiniature() {
|
| 145 |
$projetRepartition = Config::get($this->referentiel.'.baseRepartition');
|
138 |
$projetRepartition = Config::get($this->referentiel.'.baseRepartition');
|
| 146 |
$url = null;
|
139 |
$url = null;
|
| 147 |
if ($projetRepartition != "") {
|
140 |
if ($projetRepartition != "") {
|
| Line 158... |
Line 151... |
| 158 |
$this->cartes->setId($id);
|
151 |
$this->cartes->setId($id);
|
| 159 |
$url = $this->cartes->getUrlPng();
|
152 |
$url = $this->cartes->getUrlPng();
|
| 160 |
}
|
153 |
}
|
| 161 |
return $url;
|
154 |
return $url;
|
| 162 |
}
|
155 |
}
|
| 163 |
|
156 |
|
| 164 |
private function getMoissonnageMiniature() {
|
157 |
private function getMoissonnageMiniature() {
|
| 165 |
$projetMoissonnage = Config::get($this->referentiel.'.baseMoissonnage');
|
158 |
$projetMoissonnage = Config::get($this->referentiel.'.baseMoissonnage');
|
| 166 |
$url = null;
|
159 |
$url = null;
|
| 167 |
if ($projetMoissonnage != "") {
|
160 |
if ($projetMoissonnage != "") {
|
| 168 |
$this->cartes->setProjet('moissonnage');
|
161 |
$this->cartes->setProjet('moissonnage');
|