Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 1078 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1078 Rev 1462
1
<!-- DEBUT FORM_NOM -->
1
<!-- DEBUT FORM_NOM -->
2
	<script type="text/javascript">
2
	<script type="text/javascript">
3
	<!--
3
	<!--
4
		var AUTOCOMPLETION_ELEMENTS_NBRE = 50;
4
		var AUTOCOMPLETION_ELEMENTS_NBRE = 50;
5
		var URL_SERVICE_AUTOCOMPLETION_NOM_SCI_TPL = "<?= $efloreRechercheSciUrlTpl; ?>";
5
		var URL_SERVICE_AUTOCOMPLETION_NOM_SCI_TPL = "<?= $efloreRechercheSciUrlTpl; ?>";
6
		var URL_SERVICE_AUTOCOMPLETION_NOM_VERNA_TPL = "<?= $efloreRechercheVernaUrlTpl; ?>";
6
		var URL_SERVICE_AUTOCOMPLETION_NOM_VERNA_TPL = "<?= $efloreRechercheVernaUrlTpl; ?>";
7
		var URL_BASE_FICHE_TAXON_TPL = "<?= $ficheTaxonUrlTpl; ?>";
7
		var URL_BASE_FICHE_TAXON_TPL = "<?= $ficheTaxonUrlTpl; ?>";
8
		var VALEUR_DEFAUT_NOM_SCI = "Saisir un nom scientifique (sans auteur)";
8
		var VALEUR_DEFAUT_NOM_SCI = "Saisir un nom scientifique (sans auteur)";
9
		var VALEUR_DEFAUT_NOM_VERNA = "Saisir un nom commun";
9
		var VALEUR_DEFAUT_NOM_VERNA = "Saisir un nom commun";
10
		var VALEUR_DEFAUT_AU = "";
10
		var VALEUR_DEFAUT_AU = "";
11
		var VALEUR_DEFAUT_BIB = "";
11
		var VALEUR_DEFAUT_BIB = "";
12
		var VALEUR_DEFAUT_DATE = "";
12
		var VALEUR_DEFAUT_DATE = "";
13
		var URL_BASE_FICHE_TAXON = "<?= $ficheTaxonUrlTplDefaut; ?>";
13
		var URL_BASE_FICHE_TAXON = "<?= $ficheTaxonUrlTplDefaut; ?>";
14
		<?php $refs_urls = json_encode($referentielsConsultationUrls); ?>
14
		<?php $refs_urls = json_encode($referentielsConsultationUrls); ?>
15
		var REFERENTIELS_CONSULTATION_URLS = <?= $refs_urls; ?>;
15
		var REFERENTIELS_CONSULTATION_URLS = <?= $refs_urls; ?>;
16
		<?php $refs_verna = json_encode($referentielsVernasDispos); ?>
16
		<?php $refs_verna = json_encode($referentielsVernasDispos); ?>
17
		var REFERENTIELS_VERNA_DISPOS = <?=  $refs_verna; ?>;
17
		var REFERENTIELS_VERNA_DISPOS = <?=  $refs_verna; ?>;
18
		var URL_SERVICE_AUTOCOMPLETION_NOM_SCI = "<?= $efloreRechercheSciUrlDefaut; ?>";
18
		var URL_SERVICE_AUTOCOMPLETION_NOM_SCI = "<?= $efloreRechercheSciUrlDefaut; ?>";
19
		var URL_SERVICE_AUTOCOMPLETION_NOM_VERNA = "<?= $efloreRechercheVernaUrlDefaut; ?>";
19
		var URL_SERVICE_AUTOCOMPLETION_NOM_VERNA = "<?= $efloreRechercheVernaUrlDefaut; ?>";
20
		
20
		
21
		function gererVisibiliteSelecteurNom() {
21
		function gererVisibiliteSelecteurNom() {
22
			ref_sci = $(".selection-referentiel[disabled=disabled]").attr("name");
22
			ref_sci = $(".selection-referentiel[disabled=disabled]").attr("name");
23
			$("#eflore_nomenclature_referentiel").val(ref_sci);
23
			$("#eflore_nomenclature_referentiel").val(ref_sci);
24
			URL_SERVICE_AUTOCOMPLETION_NOM_SCI = URL_SERVICE_AUTOCOMPLETION_NOM_SCI_TPL.replace("{referentiel}", ref_sci);
24
			URL_SERVICE_AUTOCOMPLETION_NOM_SCI = URL_SERVICE_AUTOCOMPLETION_NOM_SCI_TPL.replace("{referentiel}", ref_sci);
-
 
25
			var ref_sci_bis = ref_sci;
-
 
26
			if (ref_sci == "bdtfxr") { ref_sci_bis = "bdtfx"; }
25
			URL_BASE_FICHE_TAXON = REFERENTIELS_CONSULTATION_URLS[ref_sci]+URL_BASE_FICHE_TAXON_TPL.replace("{referentiel}", ref_sci);
27
			URL_BASE_FICHE_TAXON = REFERENTIELS_CONSULTATION_URLS[ref_sci]+URL_BASE_FICHE_TAXON_TPL.replace("{referentiel}", ref_sci_bis);
26
			console.log(URL_BASE_FICHE_TAXON);
28
			console.log(URL_BASE_FICHE_TAXON);
27
			if(REFERENTIELS_VERNA_DISPOS[ref_sci] != undefined) {
29
			if(REFERENTIELS_VERNA_DISPOS[ref_sci] != undefined) {
28
				URL_SERVICE_AUTOCOMPLETION_NOM_VERNA = URL_SERVICE_AUTOCOMPLETION_NOM_VERNA_TPL.replace("{referentiel}", REFERENTIELS_VERNA_DISPOS[ref_sci]);
30
				URL_SERVICE_AUTOCOMPLETION_NOM_VERNA = URL_SERVICE_AUTOCOMPLETION_NOM_VERNA_TPL.replace("{referentiel}", REFERENTIELS_VERNA_DISPOS[ref_sci]);
29
				$("#type_nom_vernaculaire").parent().css("visibility","visible");
31
				$("#type_nom_vernaculaire").parent().css("visibility","visible");
30
			} else {
32
			} else {
31
				$("#type_nom_vernaculaire").parent().css("visibility","hidden");
33
				$("#type_nom_vernaculaire").parent().css("visibility","hidden");
32
				$("#type_nom_scientifique").attr('checked', 'checked');
34
				$("#type_nom_scientifique").attr('checked', 'checked');
33
				$('#nom').val();
35
				$('#nom').val();
34
				$('#nom').attr("placeholder", "");
36
				$('#nom').attr("placeholder", "");
35
			}
37
			}
36
			$('#ef-form-nomenclature').attr("action", REFERENTIELS_CONSULTATION_URLS[ref_sci]);
38
			$('#ef-form-nomenclature').attr("action", REFERENTIELS_CONSULTATION_URLS[ref_sci]);
37
		}
39
		}
38
		
40
		
39
		function mettreEnValeurReferentielSelectionne(bouton) {
41
		function mettreEnValeurReferentielSelectionne(bouton) {
40
			$(".selection-referentiel").removeAttr("disabled");
42
			$(".selection-referentiel").removeAttr("disabled");
41
			$(".selection-referentiel").removeClass("referentiel-selectionne");
43
			$(".selection-referentiel").removeClass("referentiel-selectionne");
42
			bouton.attr("disabled","disabled");
44
			bouton.attr("disabled","disabled");
43
			bouton.addClass("referentiel-selectionne");
45
			bouton.addClass("referentiel-selectionne");
44
			gererVisibiliteSelecteurNom();
46
			gererVisibiliteSelecteurNom();
45
		}
47
		}
46
				
48
				
47
		function initialiser() {
49
		function initialiser() {
48
            $.getScript("<?= $efloreScriptUrl; ?>").done(function(script, textStatus) {
50
            $.getScript("<?= $efloreScriptUrl; ?>").done(function(script, textStatus) {
49
    			// la fonction initialiserMoteur est la fonction d'initialisation du script de recherche tiré d'eflore
51
    			// la fonction initialiserMoteur est la fonction d'initialisation du script de recherche tiré d'eflore
50
    			// elle utilise les variable définies ci dessus, et elle est donc chargée après.
52
    			// elle utilise les variable définies ci dessus, et elle est donc chargée après.
51
    			initialiserMoteur();
53
    			initialiserMoteur();
52
    			$(".selection-referentiel").click(function () {
54
    			$(".selection-referentiel").click(function () {
53
    				mettreEnValeurReferentielSelectionne($(this));
55
    				mettreEnValeurReferentielSelectionne($(this));
54
    			});
56
    			});
55
    			mettreEnValeurReferentielSelectionne($($(".selection-referentiel")[0]));
57
    			mettreEnValeurReferentielSelectionne($($(".selection-referentiel")[0]));
56
			});
58
			});
57
		}
59
		}
58
 
60
 
59
	// -->
61
	// -->
60
	</script>
62
	</script>
61
<div class="importance1" id="conteneur-recherche"> 
63
<div class="importance1" id="conteneur-recherche"> 
62
<h1 class="titre-widget">Cherchez une plante de <span class="zone-choix-referentiel">
64
<h1 class="titre-widget">Cherchez une plante de <br /><span class="zone-choix-referentiel">
63
				<?php $premier_ref = true; ?>	
65
				<?php $premier_ref = true; ?>	
64
				<?php foreach($referentielsSciDispos as $code => $intitule) : ?>
66
				<?php foreach($referentielsSciDispos as $code => $intitule) : ?>
65
				<span class="referentiel">
67
				<span class="referentiel">
66
					<input type="button" class="selection-referentiel" id="referentiel_<?= $code ?>" name="<?= $code; ?>" value="<?= $intitule; ?>" <?= $premier_ref ? 'disabled="disabled"' : ""; ?> />						
68
					<input type="button" class="selection-referentiel" id="referentiel_<?= $code ?>" name="<?= $code; ?>" value="<?= $intitule; ?>" <?= $premier_ref ? 'disabled="disabled"' : ""; ?> />						
67
				</span> 
69
				</span> 
68
				<?php $premier_ref = false; ?>							
70
				<?php $premier_ref = false; ?>							
69
				<?php endforeach; ?>					
71
				<?php endforeach; ?>					
70
			</span>		</h1>
72
			</span>		</h1>
71
	<form id="ef-form-nomenclature" name="ef-form-nomenclature" action="<?= $efloreConsultationUrl; ?>" method="get">
73
	<form id="ef-form-nomenclature" name="ef-form-nomenclature" action="<?= $efloreConsultationUrl; ?>" method="get">
72
		<fieldset class="ef-groupe-champs"> 		
74
		<fieldset class="ef-groupe-champs"> 		
73
			<span class="zone-choix-type-nom">
75
			<span class="zone-choix-type-nom">
74
				<span class="type-nom">
76
				<span class="type-nom">
75
					<input type="radio" id="type_nom_scientifique" name="type_nom" value="nom_scientifique" checked="checked" /> 							
77
					<input type="radio" id="type_nom_scientifique" name="type_nom" value="nom_scientifique" checked="checked" /> 							
76
					<label for="type_nom_scientifique">Nom scientifique</label> 						
78
					<label for="type_nom_scientifique">Nom scientifique</label> 						
77
				</span> 						
79
				</span> 						
78
				<span class="type-nom"> 							
80
				<span class="type-nom"> 							
79
						<input type="radio" id="type_nom_vernaculaire" name="type_nom" value="nom_vernaculaire" /> 							
81
						<input type="radio" id="type_nom_vernaculaire" name="type_nom" value="nom_vernaculaire" /> 							
80
						<label for="type_nom_vernaculaire" title="(en français, allemand, anglais, catalan, espagnol, italien ou néerlandais)">Nom commun</label> 						
82
						<label for="type_nom_vernaculaire" title="(en français, allemand, anglais, catalan, espagnol, italien ou néerlandais)">Nom commun</label> 						
81
				</span> 					
83
				</span> 					
82
			</span> 					
84
			</span> 					
83
			<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" /> 					
85
			<input type="text" aria-haspopup="true" aria-autocomplete="list" role="textbox" autocomplete="off" id="nom" name="nom" class="champ ui-autocomplete-input" size="25" maxlength="255" /> 					
84
			<span id="zone-liens-recherche"> 												
86
			<span id="zone-liens-recherche"> 												
85
				<input type="hidden" id="eflore_nomenclature_niveau" name="niveau" value="2" /> 						
87
				<input type="hidden" id="eflore_nomenclature_niveau" name="niveau" value="2" /> 						
86
				<input type="hidden" id="eflore_nomenclature_module" name="module" value="recherche" /> 	
88
				<input type="hidden" id="eflore_nomenclature_module" name="module" value="recherche" /> 	
87
				<input type="hidden" id="eflore_nomenclature_referentiel" name="referentiel" value="<?= array_shift(array_keys($referentielsSciDispos)); ?>" /> 					
89
				<input type="hidden" id="eflore_nomenclature_referentiel" name="referentiel" value="<?= array_shift(array_keys($referentielsSciDispos)); ?>" /> 					
88
				<input type="hidden" id="eflore_nomenclature_action" name="action" value="rechercheSimple" /> 						
90
				<input type="hidden" id="eflore_nomenclature_action" name="action" value="rechercheSimple" /> 						
89
				<input type="submit" id="eflore_nomenclature_submit" name="submit" value="OK" class="ok" /> 						
91
				<input type="submit" id="eflore_nomenclature_submit" name="submit" value="OK" class="ok" /> 						
90
				<input type="submit" id="eflore_nomenclature_fiche" name="acces_fiche" value="Accès fiche" /> 					
92
				<input type="submit" id="eflore_nomenclature_fiche" name="acces_fiche" value="Accès fiche" /> 					
91
			</span> 				
93
			</span> 				
92
		</fieldset>
94
		</fieldset>
93
	</form>
95
	</form>
94
</div>
96
</div>
95
<!-- FIN FORM_NOM -->
-
 
96
97
<!-- FIN FORM_NOM -->
-
 
98