Subversion Repositories eFlore/Applications.eflore-consultation

Compare Revisions

Ignore whitespace Rev 69 → Rev 70

/trunk/modules/recherche_simple/squelettes/form_nom.tpl.html
25,7 → 25,8
<input id="referentiel" name="referentiel" type="hidden" value="<?=Registre::get('parametres.referentiel')?>" />
<input id="module" name="module" type="hidden" value="recherche-simple" />
<input id="action" name="action" type="hidden" value="rechercheNom" />
<input id="eflore_nomenclature_submit" type="submit" value="<?=$i18n['recherche'];?>" />
<input id="eflore_nomenclature_submit" name="submit" type="submit" value="<?=$i18n['recherche'];?>" />
<input id="eflore_nomenclature_fiche" name="submit" type="submit" value="<?=$i18n['fiche'];?>" />
</td>
</tr>
</table>
/trunk/modules/recherche_simple/RechercheSimple.php
35,7 → 35,7
public function executerRechercheNom() {
$donnees['type_nom'] = $_GET['type_nom'];
$donnees['nom'] = $_GET['nom']; echo $donnees['nom'];
$donnees['nom'] = $_GET['nom'];
if (strlen($donnees['nom']) < 3) {
$donnees['information'] = 'Veuillez saisir un radical contenant au moins 3 caractères alphabétiques !';
} else {
47,8 → 47,7
$donnees['information'] = 'Nom inconnu';
} elseif ($presence != 'ok') {
$donnees['nom_approche'] = $presence;
Debug::printr(Registre::get('eflore.urlCourrante')->getUrl()); // revoir à partir de appcontroleur
//$donnees['url_nom_approche'] = str_replace($donnees['nom'], $donnees['nom_approche'], Registre::get('eflore.urlCourrante'));
$donnees['url_nom_approche'] = $this->obtenirUrlRechercheSimple($presence, $donnees['type_nom']);
}
}
60,15 → 59,18
private function rechercherNom($noms) {
$approche = '';
$res = $noms->getRechercheEtendue($_GET['nom']);
if ($res == false || $res['entete']['total'] == 0) {
$form = I18n::get('Recherche-form-nom');
if ($res == false || $res['entete']['total'] == 0) { // recherche nom approché
$res = $noms->getRechercheFloue($_GET['nom']);
if (!($res == false || $res['entete']['total'] == 0)) {
$nom_proche = array_shift($res['resultat']);
$nom_proche = array_shift($res['resultat']);
$approche = ($_GET['type_nom'] == 'nom_vernaculaire') ? $nom_proche['nom'] : $nom_proche['nom_sci'];
}
} elseif ($res['entete']['total'] == 1) {
$approche = 'ok'; // envoyer à la fiche
} else {
} elseif ($res['entete']['total'] == 1 || urldecode($_GET['submit']) == $form['fiche']) { // renvoie à la fiche
$ids = array_keys($res['resultat']);
$url = $this->obtenirUrlFiche($ids[0]);
$this->redirigerVers($url);
} else { // affiche les résultats
$approche = 'ok';
}
return $approche;