33,9 → 33,18 |
|
public function obtenirDonnees() { |
$this->donnees['nt'] = $this->nomCourant->getNt(); |
$this->donnees['nnr'] = $this->nomCourant->getNnr(); |
$this->donnees['nomSciRetenu'] = $this->nomCourant->getNomRetenu()->get('nom_sci_html'); |
$infosNomRetenu = $this->nomCourant->getNomRetenu()->getInfos(); |
$this->donnees['nomComplet'] = $infosNomRetenu['nom_complet']; |
$this->getPhotos(); |
$this->getDessin(); |
$this->getPhotosOrganes(); |
$this->getPhotosCaracteresIdentification(); |
$pso = $this->getPhotosSixOrganes(); |
$this->setCheminSquelette('modules/fiche/squelettes/'); // @FIXME le chemin devrait déjà être défini correctement !? |
$this->donnees['illustrationsOrganes'] = $this->getVue('fiche_illustrations_organes', |
array('organes' => $pso, 'nnr' => $this->donnees['nnr'], 'nomComplet' => $this->donnees['nomComplet'])); |
return $this->donnees; |
} |
|
126,12 → 135,75 |
} |
} |
|
public function getPhotosSixOrganes() { |
$organes = array( |
'fleur' => array(), |
'feuille' => array(), |
'fruit' => array(), |
'ecorce' => array(), |
'port' => array(), |
'rameau' => array()); |
$nnr = $this->nomCourant->getNnr(); |
$infosOrganes = $this->images->getInfosMeilleuresImagesParTag($nnr, array_keys($organes), Eflore::PROTOCOLE_CAPITALISATION, 6, 'CRX2S'); |
$vide = true; |
foreach ($infosOrganes as $tag => $organe) { |
$organes[$tag] = $organe; |
$nbImages = count($organe); |
if ($nbImages != 0) { |
$vide = false; |
for ($i = 6; $i > $nbImages; $i--) { |
$organes[$tag][] = null; |
} |
} |
} |
if ($vide) { |
$organes = array(); |
} |
return $organes; |
} |
|
public function getPhotosOrganes() { |
$organes = array( |
'fleur' => array(), |
'feuille' => array(), |
'fruit' => array(), |
'ecorce' => array(), |
'port' => array(), |
'rameau' => array()); |
$nnr = $this->nomCourant->getNnr(); |
$infosOrganes = $this->images->getInfosMeilleuresImagesParTag($nnr, array_keys($organes), Eflore::PROTOCOLE_CAPITALISATION, 1); |
$vide = true; |
foreach ($infosOrganes as $tag => $organe) { |
$nbImages = count($organe); |
// une image par organe seulement |
$organes[$tag] = array_pop($organe); |
if ($nbImages != 0) { |
$vide = false; |
} |
} |
if ($vide) { |
$organes = array(); |
} |
$this->donnees['organes'] = $organes; |
} |
|
public function getPhotosCaracteresIdentification() { |
$caracteres = array(); |
$nnr = $this->nomCourant->getNnr(); |
$infosCaracteres = $this->images->getInfosMeilleuresImagesParTag($nnr, array_keys($organes), Eflore::PROTOCOLE_CARACTERES, 3); |
if (! empty($infosCaracteres) && ! empty($infosCaracteres[''])) { // le tag est vide, ici |
$caracteres = $infosCaracteres['']; |
} |
$this->donnees['caracteres'] = $caracteres; |
} |
|
// XXX: webservice: |
// /service:eflore:0.1/cel/images?masque.nn=XXX&referentiel=bdtfx&retour.format=CS&navigation.limite=801 |
private function initialiserPhotos($projet) { |
$this->images->setProjet($projet); |
$nnr = $this->nomCourant->getNnr(); |
return $this->images->getInfosImagesParIdsNoms(array($nnr)); |
$ret = $this->images->getInfosImagesParIdsNoms(array($nnr)); |
return $ret; |
} |
|
private function formaterListePhotos($projet, $images) { |