Subversion Repositories eFlore/Applications.eflore-consultation

Compare Revisions

Ignore whitespace Rev 719 → Rev 720

/trunk/presentations/scripts/recherche.js
72,7 → 72,7
nom.label = val.nom_sci_complet;
nom.value = val.nom_sci;
nom.nn = val.nn;
nom.retenu = (val.retenu == 'false') ? false : true;
nom.retenu = (val.retenu == 'true') ? true : false;
suggestions.push(nom);
}
});
/trunk/i18n/fr.ini
40,6 → 40,8
info_nb_lettres = "Veuillez saisir au moins 3 lettres !"
info_sp_abs = "Aucune espèce trouvée avec cette orthographe. Vérifiez que vous n'avez pas saisi le nom d'auteur."
orthographe = "Vous cherchez peut-être : "
nom_ss_corresp = " est un nom sans correspondance. Pour plus d'information, veuillez consulter <br/>";
reftax = "le référentiel en cours d'actualisation"
 
[Recherche-form-taxon]
titre = "Consulter les plantes par genre/famille"
/trunk/modules/recherche/Recherche.php
39,6 → 39,12
$presence = $this->rechercherNom();
if ($presence == '') { // s'il n'y a pas de nom
$donnees['message']['attention'] = 'info_sp_abs';
} elseif ($presence == 'sans_correspondance') {
$res = Registre::get('resultats');
$id = array_keys($res['resultat']);
$donnees['message']['nom_ss_corresp']['id'] = $id[0];
$nom = array_shift($res['resultat']);
$donnees['message']['nom_ss_corresp']['nom'] = $nom['nom_sci'];
} elseif ($presence != 'ok') { // s'il y a des noms approchés
if (!Registre::get('resultats')) { // s'il n'y a aucun nom exact
$donnees['message']['attention'] = 'info_sp_abs';
65,9 → 71,7
if ($res == false || $res['entete']['total'] == 0) { // recherche nom approché
$approche = $this->rechercherNomApproche($noms);
} elseif ($res['entete']['total'] == 1 || $this->submit == $form['fiche']) { // renvoie à la fiche
$ids = array_keys($res['resultat']);
$url = $this->urls->obtenirUrlFiche($ids[0], $this->type_nom, $this->nom);
$this->redirigerVers($url);
$approche = $this->traiterAccesFiche($res);
} else { // affiche les résultats
$res['type'] = $this->type_nom;
Registre::set('resultats', $res);
79,6 → 83,25
return $approche;
}
private function traiterAccesFiche($res) {
$ids = array_keys($res['resultat']);
if ($this->type_nom == 'nom_vernaculaire') {
$id = explode(':',$res['resultat'][$ids[0]]['nom_retenu.code']);
$id = $id[1];
} else {
if ($res['resultat'][$ids[0]]['retenu'] == 'absent') { // dans le cas d'un nom sans correspondance
$res['type'] = $this->type_nom;
Registre::set('resultats', $res);
$approche = 'sans_correspondance';
return $approche;
} else {
$id = $ids[0];
}
}
$url = $this->urls->obtenirUrlFiche($id, $this->type_nom, $this->nom);
$this->redirigerVers($url);
}
private function rechercherNomApproche($noms) {
$approche = '';
$res = $noms->getRechercheFloue($this->nom);
94,8 → 117,8
private function capturerParametres() {
if (isset($_GET['nom'])) {
$this->nom = $_GET['nom'];
if (isset($_REQUEST['nom'])) {
$this->nom = $_REQUEST['nom'];
}
if (isset($_GET['type_nom'])) {
$this->type_nom = $_GET['type_nom'];
/trunk/modules/recherche_simple/squelettes/form_nom.tpl.html
41,11 → 41,14
<?php if (isset($message)) : ?>
<p class="<?= ($message['attention']) ? 'attention' : 'information'; ?>">
<?= ($message['attention']) ? $i18n[$message['attention']] : ''; ?>
<?= ($message['nom_ss_corresp']) ? $message['nom_ss_corresp']['nom'].$i18n['nom_ss_corresp'].
'<a href="http://referentiels.tela-botanica.org/referentiel/index.php?ref=bdtfx&module=FicheTaxon&num_nom='.$message['nom_ss_corresp']['id'].'">'.
$i18n['reftax'].'</a>' : ''; ?>
<?php if (isset($message['nom_approche'])) : ?>
<?=$i18n['orthographe'];?>
<?php foreach ($message['nom_approche'] as $key => $nom) :?>
<?php foreach ($message['nom_approche'] as $cle => $nom) :?>
<a href="<?=$nom['url_nom_approche']?>"><?=$nom['nom'];?></a>
<?= ($message['nom_approche'][$key+1]['nom'] != '') ? ' ou ' : ''; ?>
<?= ($message['nom_approche'][$cle+1]['nom'] != '') ? ' ou ' : ''; ?>
<?php endforeach; ?>
<?php endif; ?>
</p>