Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 1041 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1039 aurelien 1
<!-- DEBUT FORM_NOM -->
2
	<script type="text/javascript">
3
	<!--
4
		var AUTOCOMPLETION_ELEMENTS_NBRE = 50;
5
		var URL_SERVICE_AUTOCOMPLETION_NOM_SCI_TPL = "<?= $efloreRechercheSciUrlTpl; ?>";
6
		var URL_SERVICE_AUTOCOMPLETION_NOM_VERNA_TPL = "<?= $efloreRechercheVernaUrlTpl; ?>";
7
		var VALEUR_DEFAUT_NOM_SCI = "Saisir un nom scientifique (sans auteur)";
8
		var VALEUR_DEFAUT_NOM_VERNA = "Saisir un nom commun";
9
		var VALEUR_DEFAUT_AU = "";
10
		var VALEUR_DEFAUT_BIB = "";
11
		var VALEUR_DEFAUT_DATE = "";
12
		var URL_BASE_FICHE_TAXON = "<?= $ficheTaxonUrlTpl; ?>";
13
		<?php $js = json_encode($referentielsVernasDispos); ?>
14
		var REFERENTIELS_VERNA_DISPOS = <?=  $js ; ?>;
15
		var URL_SERVICE_AUTOCOMPLETION_NOM_SCI = "<?= $efloreRechercheSciUrlDefaut; ?>";
16
		var URL_SERVICE_AUTOCOMPLETION_NOM_VERNA = "<?= $efloreRechercheVernaUrlDefaut; ?>";
17
 
18
		function gererVisibiliteSelecteurNom() {
19
			ref_sci = $("input[name=referentiel]:checked").val();
20
			URL_SERVICE_AUTOCOMPLETION_NOM_SCI = URL_SERVICE_AUTOCOMPLETION_NOM_SCI_TPL.replace("{referentiel}", ref_sci);
21
			if(REFERENTIELS_VERNA_DISPOS[ref_sci] != undefined) {
22
				URL_SERVICE_AUTOCOMPLETION_NOM_VERNA = URL_SERVICE_AUTOCOMPLETION_NOM_VERNA_TPL.replace("{referentiel}", REFERENTIELS_VERNA_DISPOS[ref_sci]);
23
				$("#type_nom_vernaculaire").parent().css("visibility","visible");
24
			} else {
25
				$("#type_nom_vernaculaire").parent().css("visibility","hidden");
26
				$("#type_nom_scientifique").attr('checked', 'checked');
27
				$('#nom').val();
28
				$('#nom').attr("placeholder", "");
29
			}
30
		}
31
 
32
		function initialiser() {
33
            $.getScript("<?= $efloreScriptUrl; ?>").done(function(script, textStatus) {
34
    			// la fonction initialiserMoteur est la fonction d'initialisation du script de recherche tiré d'eflore
35
    			// elle utilise les variable définies ci dessus, et elle est donc chargée après.
36
    			initialiserMoteur();
37
    			$("input[name=referentiel]").change(function () {
38
    				gererVisibiliteSelecteurNom();
39
    			});
40
    			gererVisibiliteSelecteurNom();
41
			});
42
		}
43
 
44
	// -->
45
	</script>
46
<div class="importance1" id="conteneur-recherche">
47
<h1 class="titre-widget">Rechercher un nom</h1>
48
	<form id="ef-form-nomenclature" name="ef-form-nomenclature" action="<?= $efloreConsultationUrl; ?>" method="get">
49
		<fieldset>
50
			<div class="zone-choix-referentiel">
51
				<label class="label-referentiel">Référentiel :</label>
52
				<?php $premier_ref = true; ?>
53
				<?php foreach($referentielsSciDispos as $ref_sci) : ?>
54
				<span class="referentiel">
55
					<input type="radio" class="selection-referentiel" id="referentiel_<?= $ref_sci ?>" name="referentiel" value="<?= $ref_sci; ?>" <?= $premier_ref ? 'checked="checked"' : ""; ?> />
56
					<label for="referentiel_<?= $ref_sci; ?>"><?= $ref_sci; ?></label>
57
				</span>
58
				<?php $premier_ref = false; ?>
59
				<?php endforeach; ?>
60
			</div>
61
			<span class="zone-choix-type-nom">
62
				<span class="type-nom">
63
					<input type="radio" id="type_nom_scientifique" name="type_nom" value="nom_scientifique" checked="checked" />
64
					<label for="type_nom_scientifique">Nom scientifique</label>
65
				</span>
66
				<span class="type-nom">
67
						<input type="radio" id="type_nom_vernaculaire" name="type_nom" value="nom_vernaculaire" />
68
						<label for="type_nom_vernaculaire" title="(en français, allemand, anglais, catalan, espagnol, italien ou néerlandais)">Nom commun</label>
69
				</span>
70
			</span>
71
			<input type="text" aria-haspopup="true" aria-autocomplete="list" role="textbox" autocomplete="off" id="nom" name="nom" class="champ ui-autocomplete-input" size="30" maxlength="255" />
72
			<span id="zone-liens-recherche">
73
				<input type="hidden" id="eflore_nomenclature_niveau" name="niveau" value="2" />
74
				<input type="hidden" id="eflore_nomenclature_module" name="module" value="recherche" />
75
				<input type="hidden" id="eflore_nomenclature_action" name="action" value="rechercheSimple" />
76
				<input type="submit" id="eflore_nomenclature_submit" name="submit" value="OK" class="ok" />
77
				<input type="submit" id="eflore_nomenclature_fiche" name="acces_fiche" value="Accès fiche" />
78
			</span>
79
		</fieldset>
80
	</form>
81
</div>
82
<!-- FIN FORM_NOM -->