Subversion Repositories eFlore/Applications.cel

Rev

Rev 3269 | Rev 3274 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
3120 delphine 1
<!DOCTYPE html>
3208 idir 2
<html xmlns="https://www.w3.org/1999/xhtml">
3228 delphine 3
	<head>
3248 idir 4
		<title><?php echo $widget['titre']; ?></title>
3208 idir 5
 
3228 delphine 6
		<meta charset="utf-8" />
7
		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
8
		<meta http-equiv="Content-style-type" content="text/css" />
9
		<meta http-equiv="Content-script-type" content="text/javascript" />
10
		<meta http-equiv="Content-language" content="fr" />
3208 idir 11
 
3228 delphine 12
		<meta name="revisit-after" content="15 days" />
13
		<meta name="robots" content="index,follow" />
14
		<meta name="author" content="Tela Botanica" />
15
		<meta name="keywords" content="Tela Botanica, CEL" />
3240 idir 16
		<meta name="description" content="Widgets de saisie du carnet en ligne" />
3228 delphine 17
		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, user-scalable=no" />
3120 delphine 18
 
3228 delphine 19
		<!-- OpenGraph pour Facebook, Pinterest, Google+ -->
20
		<meta property="og:type" content="website" />
21
		<meta property="og:title" content="Widgets de saisie du CeL" />
22
		<meta property="og:site_name" content="Tela Botanica" />
23
		<meta property="og:description" content="Widgets de saisie du Carnet en Ligne" />
24
		<meta property="og:image" content="https://resources.tela-botanica.org/tb/img/256x256/carre_englobant.png" />
25
		<meta property="og:image:type" content="image/png" />
26
		<meta property="og:image:width" content="256" />
27
		<meta property="og:image:height" content="256" />
28
		<meta property="og:locale" content="fr_FR" />
3120 delphine 29
 
3239 idir 30
		<!-- Favicone -->
3228 delphine 31
		<link rel="shortcut icon" type="image/x-icon" href="https://resources.tela-botanica.org/tb/img/16x16/favicon.ico" />
3239 idir 32
		<!-- Jquery-ui custom css-->
3228 delphine 33
		<link href="https://www.tela-botanica.org/commun/jquery/jquery-ui/1.8.18/css/smoothness/jquery-ui-1.8.18.custom.css" rel="stylesheet" type="text/css" media="screen" />
34
		<!-- Bootstrap CSS -->
35
		<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous" />
3239 idir 36
		<!-- Fontawesome -->
3260 idir 37
		<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.1/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous">
3239 idir 38
		<!-- Carto -->
3268 idir 39
		<link href="<?php echo $url_base; ?>js/tb-geoloc/styles.css" rel="stylesheet" type="text/css" media="screen" />
3239 idir 40
		<!-- STYLE SAISIE -->
3268 idir 41
		<link href="<?php echo $url_base; ?>css/saisie.css" rel="stylesheet" type="text/css" media="screen" />
3120 delphine 42
 
3228 delphine 43
		<!--  Google Analytics -->
44
		<?php if( $prod ): ?>
45
			<?php include "analytics.html"; ?>
46
		<?php endif; ?>
3240 idir 47
		<!-- <link rel="icon" type="image/x-icon" href="favicon.ico" /> -->
3228 delphine 48
		<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
49
	</head>
3120 delphine 50
 
3268 idir 51
	<body id="top" data-sq="<?php echo $url_base; ?>">
3239 idir 52
		<?php
3240 idir 53
			echo ( $widget['image_fond'] ) ? '<div id="image-fond" style="' . htmlspecialchars( 'background:url("' . $widget['chemin_fichiers'] . 'image_fond.' . preg_replace( '/(?:imag)?e\/?/','',$widget['image_fond']) . '") no-repeat center center;background-size:cover') . '"></div>': '';
3239 idir 54
		?>
3248 idir 55
		<div id="zone-appli" class="container" data-projet="<?php echo $widget['projet']; ?>" data-url-fichiers="<?php echo $widget['chemin_fichiers']; ?>">
3228 delphine 56
			<div class="layout-wrapper page">
3260 idir 57
				<div class="row mb-3">
58
					<div class="col-md-2 col-sm-10">
59
						<img id="logo" class="mr-3" src="<?php echo htmlspecialchars( $widget['chemin_fichiers'] . 'logo.' . preg_replace( '/(?:imag)?e\/?/','', $widget['logo'] ) ); ?>" alt="logo <?php echo $widget['projet']; ?>" />
60
					</div>
61
					<div class="col-md-10 col-sm-12">
3239 idir 62
						<h1 id="titre-projet" class="mt-0"><?php echo ( $widget['info'] ) ? $widget['titre'] . ' <div id="info-button" class="btn btn-outline-info btn-sm border-0" data-mime-info="' . $widget['info'] . '"><i class="fas fa-info-circle"></i></div>' : $widget['titre']; ?></h1>
3228 delphine 63
					</div>
64
				</div>
3208 idir 65
 
3260 idir 66
				<div class="row mb-3">
3239 idir 67
					<div class="col-md-6">
3248 idir 68
						<div id="description"><?php echo $widget['description']; ?></div>
3239 idir 69
					</div>
70
					<div class="col-md-6">
71
						<div id="aide" class="well well-lg hidden-sm-down">
3248 idir 72
							<h3><?php echo $aide['titre']; ?></h3>
3239 idir 73
							<div id="aide-txt" class="hiden-sm-down">
3248 idir 74
								<p><?php echo $aide['description']; ?></p>
3228 delphine 75
							</div>
76
						</div>
77
					</div>
78
				</div>
3239 idir 79
 
80
				<div id="formulaire" class="row mb-3 bloc-top">
81
					<form id="form-observateur" role="form" autocomplete="on">
3248 idir 82
						<h2><?php echo $observateur['titre']; ?></h2>
3260 idir 83
						<div id="tb-observateur" data-mode="<?php echo $conf_mode; ?>">
3239 idir 84
							<div class="navbar-default mb-3" id="tb-navbar">
85
								<div class="nav navbar-nav navbar-right row">
86
									<div id="bouton-connexion" class="volet col-md-6 col-sm-8">
3248 idir 87
										<label for="bouton-connexion"><?php echo $observateur['compte']; ?></label>
88
										<a id="connexion" href="<?php echo $authTpl; ?>" class="btn btn-success  mr-1 mb-1" taget="_blank"><?php echo $observateur['connexion']; ?></a>
89
										<a id="bouton-inscription" href="https://beta.tela-botanica.org/test/inscription" class="btn btn-primary mr-1 mb-1" taget="_blank"><?php echo $observateur['inscription']; ?></a>
3239 idir 90
									</div>
91
									<div id="creation-compte" class="volet col-md-6 col-sm-8">
3248 idir 92
										<label for="creation-compte"><?php echo $observateur['noninscription']; ?></label>
93
										<a id="bouton-anonyme" href="#" class="btn btn-info mr-1 mb-1"><?php echo $observateur['nonconnexion']; ?></a>
3239 idir 94
									</div>
95
									<div id="utilisateur-connecte" class="volet hidden">
3248 idir 96
										<label for="utilisateur-connecte"><?php echo $observateur['bienvenue']; ?></label>
3239 idir 97
										<a href="#" class="list-tool btn btn-large btn-primary volet-toggle" data-toggle="volet">
98
											<span id="nom-complet"></span> <!-- <i class="fas fa-caret-down"></i> -->
99
										</a>
100
										<div class="volet-menu hidden">
101
											<div id="profil-utilisateur">
3248 idir 102
												<a href="https://beta.tela-botanica.org/test/inscription" taget="_blank"><?php echo $observateur['profil']; ?></a>
3239 idir 103
											</div>
3248 idir 104
											<div id="deconnexion"><a href="#"><?php echo $observateur['deconnexion']; ?></a></div>
3239 idir 105
										</div>
106
									</div>
107
								</div>
3228 delphine 108
							</div>
109
						</div>
3239 idir 110
 
111
						<div id="anonyme" class="mb-3 hidden">
112
							<div id="zone-courriel" class="row">
113
								<div class="control-group col-md-6">
3248 idir 114
									<label for="courriel" class="col-sm-8 obligatoire" title="<?php echo $observateur['courriel-title']; ?>">
3239 idir 115
										<i class="fa fa-envelope" aria-hidden="true"></i>
3248 idir 116
										<?php echo $observateur['courriel']; ?>
3239 idir 117
									</label>
118
									<div class="col-sm-8 mb-3">
3248 idir 119
										<input id="courriel" name="courriel" class="form-control" type="email" title="<?php echo $observateur['courriel-title']; ?> ">
3239 idir 120
										<input id="id_utilisateur" name="id_utilisateur" type="hidden">
121
									</div>
122
								</div>
123
 
124
								<div id="zone-courriel-confirmation" class="control-group col-md-6 hidden">
3270 idir 125
									<label for="courriel_confirmation" class="col-sm-8 obligatoire" title="<?php echo $observateur['courriel-confirmation-title']; ?>">
3239 idir 126
										<i class="fa fa-envelope" aria-hidden="true"></i>
3248 idir 127
										<?php echo $observateur['courriel-confirmation']; ?>
3239 idir 128
									</label>
129
									<div class="col-sm-8">
130
										<input id="courriel_confirmation" name="courriel_confirmation" class="form-control" type="email">
131
									</div>
132
								</div>
3228 delphine 133
							</div>
3239 idir 134
 
135
							<div id="zone-prenom-nom" class="row hidden">
136
								<div class="control-group col-md-6">
137
									<label for="prenom" class="col-sm-8">
138
										<i class="fa fa-user" aria-hidden="true"></i>
3248 idir 139
										<?php echo $observateur['prenom']; ?>
3239 idir 140
									</label>
141
									<div class="input-group col-sm-8">
142
										<input id="prenom" name="prenom" class="form-control" type="text">
143
									</div>
144
								</div>
145
								<div class="control-group col-md-6">
146
									<label for="nom" class="col-sm-8">
147
										<i class="fa fa-user" aria-hidden="true"></i>
3248 idir 148
										<?php echo $observateur['nom']; ?>
3239 idir 149
									</label>
150
									<div class="input-group col-sm-8">
151
										<input id="nom" name="nom" class="form-control" type="text">
152
									</div>
153
								</div>
3228 delphine 154
							</div>
155
						</div>
3239 idir 156
					</form>
157
 
158
					<!-- Messages d'erreur du formulaire-->
3240 idir 159
					<div class="zone-alerte">
160
						<div id="dialogue-bloquer-copier-coller" class="alert alert-info alert-block hidden">
161
							<a class="close">×</a>
3248 idir 162
							<h4 class="alert-heading"><?php echo $observateur['alertcc-title']; ?></h4>
163
							<p><?php echo $observateur['alertcc']; ?></p>
3228 delphine 164
						</div>
3240 idir 165
						<div id="dialogue-utilisateur-non-identifie" class="alert alert-warning alert-block hidden">
166
							<a class="close">×</a>
3248 idir 167
							<h4 class="alert-heading"><?php echo $observateur['alertni-title']; ?></h4>
168
							<p><?php echo $observateur['alertni']; ?></p>
3240 idir 169
						</div>
3228 delphine 170
					</div>
3208 idir 171
 
3239 idir 172
					<form id="form-observation" role="form" autocomplete="on" class="bloc-top">
3248 idir 173
						<h2><?php echo $observation['titre']; ?></h2>
3239 idir 174
						<div id="zone-observation" class="row">
175
							<div class="col-md-6">
3208 idir 176
 
3268 idir 177
								<div class="mb-3">
3248 idir 178
									<label for="geolocalisation" class="col-sm-8 obligatoire" title="<?php echo $observateur['courriel-title']; ?>">
3239 idir 179
										<i class="fa fa-street-view" aria-hidden="true"></i>
3248 idir 180
										<?php echo $observation['geolocalisation']; ?>
3239 idir 181
									</label>
3260 idir 182
									<div id="geoloc-datas">
3240 idir 183
										<input type="hidden" id="pays" name="pays" value="" style="display:none">
184
										<input type="hidden" id="commune-nom" name="commune-nom" value="" style="display:none">
185
										<input type="hidden" id="latitude" name="latitude" value="0.00000" style="display:none">
186
										<input type="hidden" id="longitude" name="longitude" value="0.00000" style="display:none">
187
										<input type="hidden" id="commune-insee" name="commune-insee" value="" style="display:none">
188
										<input type="hidden" id="altitude" name="altitude" value="" style="display:none">
3239 idir 189
									</div>
3268 idir 190
									<div class="col-sm-8">
3260 idir 191
										<tb-geolocation-element
192
											id="tb-geolocation"
193
											layer='osm'
194
											zoom_init="4"
195
											lat_init="46.5"
196
											lng_init="2.9"
197
											marker="<?php echo ( $widget['type_localisation'] === 'point' ) ? 'true' : 'false' ;?>"
198
											polyline="<?php echo ( $widget['type_localisation'] === 'rue' ) ? 'true' : 'false' ;?>"
199
											polygon="false"
200
											show_lat_lng_elevation_inputs="<?php echo ( $widget['type_localisation'] === 'point' ) ? 'true' : 'false' ;?>"
201
											osm_class_filter=""
202
											elevation_provider="mapquest"
203
											map_quest_api_key="mG6oU5clZHRHrOSnAV0QboFI7ahnGg34"
204
										>
205
										</tb-geolocation-element>
206
									</div>
3239 idir 207
								</div>
208
 
3243 idir 209
								<div class="control-group">
210
									<label for="lieudit" class="col-sm-8" title="">
211
										<i class="fa fa-map-signs" aria-hidden="true"></i>
3248 idir 212
										<?php echo $observation['lieudit']; ?>
3239 idir 213
									</label>
214
									<div class="col-sm-8 mb-3">
3243 idir 215
										<input type="text" id="lieudit" name="lieudit" class="form-control">
3239 idir 216
									</div>
217
								</div>
3243 idir 218
								<div class="control-group">
219
									<label for="station" class="col-sm-8" title="">
220
										<i class="fa fa-map-marker" aria-hidden="true"></i>
3248 idir 221
										<?php echo $observation['station']; ?>
3243 idir 222
									</label>
223
									<div class="col-sm-8 mb-3">
224
										<input type="text" id="station" name="station" class="form-control">
225
									</div>
226
								</div>
3239 idir 227
 
3228 delphine 228
							</div>
3239 idir 229
 
230
							<div class="col-md-6">
231
 
232
								<div class="control-group">
233
									<label for="date_releve" class="col-sm-8 obligatoire" title="">
234
										<i class="fa fa-calendar" aria-hidden="true"></i>
3248 idir 235
										<?php echo $observation['date']; ?>
3239 idir 236
									</label>
3240 idir 237
									<div class="col-sm-8 mb-3">
3248 idir 238
										<input type="date" id="date_releve" name="date_releve" class="form-control" max="<?php echo date('Y-m-d', time()); ?>" placeholder="jj/mm/aaaa" title="jj/mm/aaaa" required>
3239 idir 239
									</div>
240
								</div>
241
 
3248 idir 242
								<?php if( ( $widget['type_especes'] === 'referentiel' || empty( $widget['type_especes'] ) ) && empty( $widget['referentiel'] ) ) : ?>
3239 idir 243
									<div class="control-group">
244
										<label for="referentiel" class="col-sm-8 obligatoire" title="">
245
											<i class="fa fa-book" aria-hidden="true"></i>
3248 idir 246
											<?php echo $observation['referentiel']; ?>
3239 idir 247
										</label>
248
										<div class="col-sm-8 mb-3">
3260 idir 249
											<select id="referentiel" class="form-control custom-select" >
250
												<option class="choisir" value="" selected hidden><?php echo $general['choisir']; ?></option>
3239 idir 251
												<option value="bdtfxr" selected="selected" title="Trachéophytes de France métropolitaine">Métropole (index réduit)</option>
252
												<option value="bdtfx" title="Trachéophytes de France métropolitaine">Métropole (BDTFX)</option>
253
												<option value="bdtxa" title="Trachéophytes des Antilles">Antilles françaises (BDTXA)</option>
254
												<option value="bdtre" title="Trachéophytes de La Réunion">Réunion (BDTRE)</option>
255
												<option value="aublet" title="Guyane">Guyane (AUBLET2)</option>
256
												<option value="florical" title="Nouvelle-Calédonie">Nouvelle-Calédonie (FLORICAL)</option>
257
												<option value="isfan" title="Afrique du Nord">Afrique du Nord (ISFAN)</option>
258
												<option value="apd" title="Afrique de l'Ouest et du Centre">Afrique de l'Ouest et du Centre (APD)</option>
259
												<option value="lbf" title="Liban">Liban (LBF)</option>
260
												<option value="autre" title="Autre/Inconnu">Autre/Inconnu</option>
261
											</select>
262
										</div>
263
									</div>
3228 delphine 264
								<?php else : ?>
3248 idir 265
									<input id="referentiel" name="referentiel" value="<?php echo $widget['referentiel']; ?>" type="hidden">
3228 delphine 266
								<?php endif; ?>
3208 idir 267
 
3270 idir 268
								<div id="bloc-taxon" class="control-group">
3260 idir 269
									<?php $isTaxonListe = ( isset( $widget['especes']['taxons'] ) && count( (array) $widget['especes']['taxons'] ) > 0 ) ;?>
270
									<label for="<?php echo ( !$isTaxonListe ) ? 'taxon' : 'taxon-liste';?>" class="col-sm-8" title="">
3239 idir 271
										<i class="fa fa-leaf" aria-hidden="true"></i>
3256 idir 272
										<?php echo $observation['espece']; ?><?php if ( !empty( $widget['referentiel'] ) ) echo " (" . $widget['referentiel'] . ")"; ?>
3239 idir 273
									</label>
274
									<div class="col-sm-8 mb-3">
3260 idir 275
										<?php if ( $widget['type_especes'] === 'fixe' || $widget['especes']['espece_imposee'] ) : ?>
3270 idir 276
													<input id="taxon" name="taxon" type="text" class="form-control taxon-validation" title"" value="<?php echo $widget['especes']['nom_sci_espece_defaut']; ?>"/>
3260 idir 277
												</div>
278
											</div>
3208 idir 279
 
3260 idir 280
										<?php elseif ( isset( $widget['especes']['taxons'] ) && count( (array) $widget['especes']['taxons'] ) > 0 ) : ?>
281
											<?php ksort( $widget['especes']['taxons'] ); ?>
3270 idir 282
													<select id="taxon-liste" name="taxon-liste" class="form-control custom-select taxon-validation" title="<?php echo $observation['taxon-title'];?>">
3260 idir 283
														<option class="choisir"  value="inconnue" selected hidden><?php echo $general['choisir']; ?></option>
284
														<?php foreach ($widget['especes']['taxons'] as $taxon)  : ?>
285
															<option
286
																class="nom-sci"
287
																value="<?php echo $taxon['nom_sel'];?>"
288
																title="<?php echo $taxon['nom_fr'];?>"
289
																data-num-nom-sel="<?php echo $taxon['num_nom_sel'];?>"
290
																data-nom-ret="<?php echo $taxon['nom_ret'];?>"
291
																data-num-nom-ret="<?php echo $taxon['num_nom_ret'];?>"
292
																data-nt="<?php echo $taxon['num_taxon'];?>"
293
																data-famille="<?php echo $taxon['famille'];?>"
294
															><?php echo $taxon['nom_sel'];?></option>
295
														<?php endforeach; ?>
296
														<option value="autre"><?php echo $observation['autre-espece']; ?></option>
297
													</select>
3270 idir 298
													<span for="taxon-liste" class="error" style="display: none;"><?php echo $observation['taxon-title'];?></span>
299
													<input id="taxon" name="taxon" class="form-control" type="hidden" />
3260 idir 300
												</div>
301
											</div>
302
											<div id="taxon-input-groupe" class="control-group hidden">
303
												<label for="taxon-autre" class="col-sm-8" title="">
304
													<i class="fab fa-pagelines" aria-hidden="true"></i>
305
													<?php echo $observation['autre-espece']; ?>
306
												</label>
307
												<div class="col-sm-8 mb-3">
308
													<input id="taxon-autre" name="taxon-autre" class="form-control" type="text">
309
												</div>
310
											</div>
311
										<?php else : ?>
3270 idir 312
													<input id="taxon" name="taxon" class="form-control taxon-validation" type="text" title="<?php echo $observation['taxon-title'];?>">
313
													<span for="taxon" class="error" style="display: none;"><?php echo $observation['taxon-title'];?></span>
3260 idir 314
												</div>
315
											</div>
316
										<?php endif; ?>
317
 
3239 idir 318
								<div class="control-group">
319
									<label for="certitude" class="col-sm-8 obligatoire" title="">
320
										<i class="fa fa-question" aria-hidden="true"></i>
3248 idir 321
										<?php echo $observation['certitude']; ?>
3239 idir 322
									</label>
323
									<div class="col-sm-8 mb-3">
3260 idir 324
										<select id="certitude" name="certitude" class="form-control custom-select">
3263 idir 325
											<option class="aDeterminer" value="à determiner" ><?php echo $observation['certADet']; ?></option>
3260 idir 326
											<option class="douteuse" value="douteuse" ><?php echo $observation['certDout']; ?></option>
327
											<option class="certaine" value="certaine" selected="selected" ><?php echo $observation['certCert']; ?></option>
3239 idir 328
										</select>
329
									</div>
330
								</div>
3240 idir 331
								<div class="">
3243 idir 332
									<label for="milieu" class="col-sm-8">
333
										<i class="fa fa-street-view" aria-hidden="true"></i>
3248 idir 334
										<?php echo $observation['milieu']; ?>
3243 idir 335
									</label>
336
									<div class="col-sm-8 mb-3">
337
										<?php if ( 0 < count( (array) $widget['milieux'] ) ) :?>
3260 idir 338
											<select id="milieu" class="form-control custom-select" >
339
												<option class="choisir" value="" selected hidden><?php echo $general['choisir']; ?></option>
3243 idir 340
												<?php foreach ( $widget['milieux'] as $milieu ) :?>
3248 idir 341
													<option value="<?php echo $milieu; ?>"><?php echo $milieu; ?></option>
3243 idir 342
												<?php endforeach; ?>
343
											</select>
344
										<?php else : ?>
3248 idir 345
											<input id="milieu" name="milieu" class="form-control" type="text" placeholder="<?php echo $observation['milieu-ph']; ?>">
3243 idir 346
										<?php endif; ?>
347
									</div>
348
								</div>
349
								<div class="">
3260 idir 350
									<label for="notes" class="col-sm-8" title="">
351
										<i class="fa fa-pen" aria-hidden="true"></i>
352
										<?php echo $observation['notes']; ?>
353
									</label>
354
									<div class="col-sm-8 mb-3">
355
										<textarea id="notes" form="form-observation" class="col-md-12" rows="7" name="notes" placeholder="<?php echo $observation['notes_ph']; ?>"></textarea>
356
									</div>
357
								</div>
3208 idir 358
 
3230 delphine 359
							</div>
360
						</div>
3239 idir 361
					</form>
3208 idir 362
 
3260 idir 363
					<!-- Messages d'erreur du formulaire-->
364
					<div class="zone-alerte">
365
						<div id="dialogue-geoloc-ko" class="alert alert-warning alert-block hidden">
366
							<a class="close">×</a>
367
							<h4 class="alert-heading"><?php echo $observation['alertgk-title']; ?></h4>
368
							<p><?php echo $observation['alertgk']; ?></p>
369
						</div>
370
						<div id="dialogue-taxon-or-image" class="alert alert-warning alert-block hidden">
371
							<a class="close">×</a>
372
							<h4 class="alert-heading"><?php echo $observation['alert-img-tax-title']; ?></h4>
373
							<p><?php echo $observation['alert-img-tax']; ?></p>
374
						</div>
375
					</div>
376
 
3239 idir 377
					<!-- Champs supplémentaires -->
378
					<?php if ( isset($widget['chpSupp'] ) && 0 < count( (array) $widget['chpSupp'] ) ) : ?>
379
						<form id="form-supp"  class="bloc-top" role="form" autocomplete="on">
3248 idir 380
							<h2><?php echo $chpsupp['titre']; ?></h2>
3239 idir 381
							<div id="zone-supp" class="row">
382
								<div class="col-md-6">
3208 idir 383
 
3239 idir 384
									<?php foreach( $widget['chpSupp'][ $widget['projet'] ]['champs-supp'] as $champ ) : ?>
385
										<?php
3249 idir 386
											$min         = ( isset( $champ['fieldValues']['min'] ) )? ' min="' . $champ['fieldValues']['min'] . '"':'';
387
											$max         = ( isset( $champ['fieldValues']['max'] ) )? ' max="' . $champ['fieldValues']['max'] . '"':'';
388
											$step        = ( isset( $champ['fieldValues']['step'] ) )? ' step="' . $champ['fieldValues']['step'] . '"':'';
3260 idir 389
											$default     = ( isset( $champ['fieldValues']['default'] ) )? ' value="' . $champ['fieldValues']['default'] . '" data-default="' . $champ['fieldValues']['default'] . '"' :'';
3249 idir 390
											$description = ( isset( $champ['description'] ) )? ' title="' . $champ['description'] . '"':'';
391
											$placeholder = ( isset( $champ['fieldValues']['placeholder'] ) )? ' placeholder="' . $champ['fieldValues']['placeholder'] . '"':'';
3239 idir 392
											$required    = '';
393
											$mandatory   = '';
394
											$pattern     = '';
395
											$obs_radio   = '';
396
											$help        = '';
397
											$help_button = '';
3208 idir 398
 
3239 idir 399
											if( $champ['help'] ) {
400
												$help = ' and-help';
401
												$help_button = ' <div class="help-button help-' . $champ['key'] . ' btn btn-outline-info btn-sm border-0" data-key="' . $champ['key'] . '" data-name="' . $champ['name'] . '" data-mime-type="' . $champ['help'] . '"><i class="fas fa-info-circle"></i></div>';
402
											}
3208 idir 403
 
3239 idir 404
											if( $champ['mandatory'] ) {
405
												// Attr required
406
												$required  = ' required';
407
												// class="obligatoire"
408
												$mandatory = ' obligatoire';
409
											}
3208 idir 410
 
3239 idir 411
											switch( $champ['element'] ) {
412
												case 'radio':
413
												case 'checkbox': ?>
3260 idir 414
													<div class="control-group <?php echo $champ['element']; ?> mb-3"<?php echo $description . $required; ?> data-name="<?php echo $champ['key']; ?>[]">
3239 idir 415
														<div class="col-sm-8 list-label<?php echo $help . $mandatory; ?>">
3248 idir 416
															<?php echo $champ['name'] . $help_button; ?>
3239 idir 417
														</div>
418
														<div class="col-sm-8">
3217 idir 419
 
3239 idir 420
															<?php foreach ( $champ['fieldValues']['listValue'] as $i => $list_value ) : ?>
3208 idir 421
 
3239 idir 422
																	<?php
423
																		$checked = '';
424
																		if ( '#' === substr( $list_value, -1 ) ) :
425
																			$checked = ' checked';
426
																			$list_value = substr( $list_value, 0, -1 );
427
																		endif;
428
																	?>
3208 idir 429
 
3239 idir 430
																	<?php if( 'other' !== $list_value ) : ?>
431
																		<label for="<?php echo $champ['fieldValues']['cleanListValue'][$i]; ?>" class="<?php echo $champ['fieldValues']['cleanListValue'][$i]; ?>">
3260 idir 432
																			<input type="<?php echo $champ['element']; ?>" id="<?php echo $champ['fieldValues']['cleanListValue'][$i]; ?>" name="<?php echo $champ['key']; ?>[]" value="<?php echo $list_value; ?>"<?php echo $checked; ?> class="<?php echo $champ['fieldValues']['cleanListValue'][$i] . ' ' . $champ['key']; ?>" data-label="<?php echo $champ['name']; ?>" data-name="<?php echo $champ['key']; ?>">
3248 idir 433
																			<?php echo $list_value; ?>
3239 idir 434
																		</label>
435
																	<?php else : ?>
3248 idir 436
																		<label for="other-<?php echo $champ['key']; ?>">
3260 idir 437
																			<input type="<?php echo $champ['element']; ?>" id="other-<?php echo $champ['key']; ?>" name="<?php echo $champ['key']; ?>[]" value="other" class="other <?php echo $champ['key']; ?>" data-label="<?php echo $champ['name']; ?>" data-element="<?php echo $champ['element']; ?>" data-name="<?php echo $champ['key']; ?>">
3239 idir 438
																			Autre
439
																		</label>
440
																	<?php endif; ?>
3208 idir 441
 
3239 idir 442
															<?php endforeach; ?>
3208 idir 443
 
3239 idir 444
														</div>
445
													</div>
446
												<?php break;
3208 idir 447
 
3239 idir 448
												case 'list-checkbox': ?>
449
													<div class="multiselect <?php echo $champ['element'] . $help; ?>">
3248 idir 450
														<label class="col-sm-8<?php echo $mandatory; ?>" title="<?php echo $chpsupp['select-checkboxes-texte'];?>"><?php echo $champ['name'] . $help_button; ?></label>
3239 idir 451
														<div class="control-group col-sm-8 mb-3">
452
															<div class="selectBox">
3260 idir 453
																<select class="form-control list-checkbox custom-select" id="list-checkbox-<?php echo $champ['key']; ?>"<?php echo $description; ?> class="form-control">
3248 idir 454
																	<option><?php echo $chpsupp['select-checkboxes-texte'];?></option>
3239 idir 455
																</select>
456
																<div class="overSelect"></div>
457
															</div>
3260 idir 458
															<div class="checkboxes hidden" <?php echo $required; ?> data-name="<?php echo $champ['key']; ?>[]">
3239 idir 459
																<?php foreach ( $champ['fieldValues']['listValue'] as $i => $list_value ) : ?>
3208 idir 460
 
3239 idir 461
																	<?php
462
																		$checked = '';
463
																		if ( '#' === substr( $list_value, -1 ) ) :
464
																			$checked = ' checked';
465
																			$list_value = substr( $list_value, 0, -1 );
466
																		endif;
467
																	?>
3208 idir 468
 
3239 idir 469
																	<?php if( 'other' !== $list_value ) : ?>
470
																		<label for="<?php echo $champ['fieldValues']['cleanListValue'][$i]; ?>">
3260 idir 471
																			<input type="checkbox" id="<?php echo $champ['fieldValues']['cleanListValue'][$i]; ?>" name="<?php echo $champ['key']; ?>[]" value="<?php echo $list_value; ?>"<?php echo $checked; ?> class="<?php echo $champ['fieldValues']['cleanListValue'][$i] . ' ' . $champ['key']; ?>" data-label="<?php echo $champ['name']; ?>" data-name="<?php echo $champ['key']; ?>">
3248 idir 472
																			<?php echo $list_value; ?>
3239 idir 473
																		</label>
474
																	<?php else : ?>
3248 idir 475
																		<label for="other-<?php echo $champ['key']; ?>">
3260 idir 476
																			<input type="checkbox" id="other-<?php echo $champ['key']; ?>" name="<?php echo $champ['key']; ?>[]" value="other" class="other <?php echo $champ['key']; ?>" data-label="<?php echo $champ['name']; ?>" data-element="checkboxes" data-name="<?php echo $champ['key']; ?>">
3239 idir 477
																			Autre
478
																		</label>
479
																	<?php endif; ?>
3208 idir 480
 
3239 idir 481
																<?php endforeach; ?>
3208 idir 482
 
3239 idir 483
															</div>
484
														</div>
485
													</div>
486
												<?php break;
3208 idir 487
 
3239 idir 488
												case 'select': ?>
3260 idir 489
													<div class="control-group mb-3">
490
														<label for="<?php echo $champ['key']; ?>" class="col-sm-8<?php echo $mandatory; ?>"<?php echo $description; ?>><?php echo $champ['name'] . $help_button; ?></label>
491
														<div class="champ col-sm-8 mb-3">
492
															<div class="select-wrapper add-field-select <?php echo $help; ?>">
493
																<select id="<?php echo $champ['key']; ?>" class="<?php echo $champ['key'] . ' ' . $champ['element']; ?> form-control  custom-select mb-2"<?php echo $required; ?> data-label="<?php echo $champ['name']; ?>"  data-name="<?php echo $champ['key']; ?>">
3208 idir 494
 
3260 idir 495
																	<?php foreach ( $champ['fieldValues']['listValue'] as $list_value ) : ?>
3208 idir 496
 
3260 idir 497
																		<?php
498
																			$selected = '';
499
																			if ( '#' === substr( $list_value, -1 ) ) :
500
																				$selected = ' selected="selected"';
501
																				$list_value = substr( $list_value, 0, -1 );
502
																			endif;
503
																		?>
3208 idir 504
 
3260 idir 505
																		<?php if( 'other' !== $list_value ) : ?>
506
																			<option value="<?php echo $list_value; ?>"<?php echo $selected; ?> data-name="<?php echo $champ['key']; ?>">
507
																				<?php echo ucfirst( $list_value ); ?>
508
																			</option>
509
																		<?php else : ?>
510
																			<option id="other-<?php echo $champ['key']; ?>" class="other form-control is-select" value="other" data-element="<?php echo $champ['element']; ?>" data-name="<?php echo $champ['key']; ?>">Autre</option>
511
																		<?php endif; ?>
3208 idir 512
 
3260 idir 513
																	<?php endforeach; ?>
3208 idir 514
 
3260 idir 515
																</select>
516
															</div>
3239 idir 517
														</div>
518
													</div>
519
												<?php break;
3208 idir 520
 
3239 idir 521
												case 'textarea': ?>
522
													<div class="control-group">
3248 idir 523
														<label for="<?php echo $champ['key']; ?>" class="col-sm-8<?php echo $help . $mandatory; ?>" <?php echo $description; ?>><?php echo $champ['name'] . $help_button; ?></label>
3239 idir 524
														<div class="col-sm-8 mb-3">
3248 idir 525
															<textarea type="<?php echo $champ['element']; ?>" id="<?php echo $champ['key']; ?>" name="<?php echo $champ['key']; ?>" class="<?php echo $champ['key'] . $help; ?> form-control" <?php echo $description . $placeholder . $required; ?> data-label="<?php echo $champ['name']; ?>"></textarea>
3239 idir 526
														</div>
527
													</div>
528
												<?php break;
3208 idir 529
 
3239 idir 530
												case 'range': ?>
531
													<div class="control-group">
3248 idir 532
														<label for="<?php echo $champ['key']; ?>" class="col-sm-8<?php echo $help . $mandatory; ?>" <?php echo $description; ?>><?php echo $champ['name'] . $help_button; ?></label>
3240 idir 533
														<div class="col-sm-8 mb-3 row">
3239 idir 534
															<?php
3240 idir 535
																$div_range_min_max = '';
3208 idir 536
 
3249 idir 537
																if ( isset( $champ['fieldValues']['min'] ) )  {
3240 idir 538
																	$div_range_min_max =
539
																		"<p class=\"col-sm-2 range-values text-center font-weight-bold\">".
540
																			"Min " . $champ['fieldValues']['min'] .
541
																		"</p>";
542
																}
3208 idir 543
 
3240 idir 544
																$div_range_min_max .= '<div class="range-live-value range-values text-center font-weight-bold col-sm-';
3208 idir 545
 
3249 idir 546
																if ( isset( $champ['fieldValues']['min'] ) && isset( $champ['fieldValues']['max'] ) ) {
3240 idir 547
																	$div_range_min_max .= '8';
3249 idir 548
																} elseif ( isset( $champ['fieldValues']['min'] ) || isset( $champ['fieldValues']['max'] ) ) {
3240 idir 549
																	$div_range_min_max .= '10';
550
																} else {
551
																	$div_range_min_max .= '12';
552
																}
3208 idir 553
 
3260 idir 554
																$div_range_min_max .= '" onload="this.innerText = document.getElementById(&apos;ajouter-obs&apos;).value"></div>';
3208 idir 555
 
3249 idir 556
																if( isset( $champ['fieldValues']['max'] ) ) {
3240 idir 557
																	$div_range_min_max .=
558
																		"<p class=\"col-sm-2 range-values text-center font-weight-bold\">".
559
																			"Max " . $champ['fieldValues']['max'] .
560
																		"</p>";
561
																}
3208 idir 562
 
3240 idir 563
																echo $div_range_min_max;
3239 idir 564
															?>
3248 idir 565
															<input type="<?php echo $champ['element']; ?>" name="<?php echo $champ['key']; ?>" class="pl-3 custom-range <?php echo $champ['key'] . $help; ?> form-control" <?php echo $description . $placeholder . $step . $default . $min . $max . $required; ?> data-label="<?php echo $champ['name']; ?>">
3239 idir 566
														</div>
567
													</div>
568
													<?php break;
3208 idir 569
 
3239 idir 570
												case 'number':
571
												case 'date': ?>
572
													<div class="control-group">
3248 idir 573
														<label for="<?php echo $champ['key']; ?>" class="col-sm-8<?php echo $mandatory; ?>" <?php echo $description; ?>><?php echo $champ['name'] . $help_button; ?></label>
3239 idir 574
														<div class="col-sm-8 mb-3">
3248 idir 575
															<input type="<?php echo $champ['element']; ?>" name="<?php echo $champ['key']; ?>" class="<?php echo $champ['key'] . $help; ?> form-control"<?php echo  $pattern . $description . $placeholder . $step . $default . $min . $max . $required; ?> data-label="<?php echo $champ['name']; ?>">
3239 idir 576
														</div>
577
													</div>
578
													<?php break;
3208 idir 579
 
3239 idir 580
												case 'text' :
581
												case 'email':
582
												default: ?>
583
													<div class="control-group">
3248 idir 584
														<label for="<?php echo $champ['key']; ?>" class="col-sm-8<?php echo $mandatory; ?>" <?php echo $description; ?>><?php echo $champ['name'] . $help_button; ?></label>
3239 idir 585
														<div class="col-sm-8 mb-3">
3248 idir 586
															<input type="<?php echo $champ['element']; ?>" name="<?php echo $champ['key']; ?>" class="<?php echo $champ['key'] . $help; ?> form-control" <?php echo $description . $placeholder . $required; ?> data-label="<?php echo $champ['name']; ?>">
3239 idir 587
														</div>
588
													</div>
589
												<?php break;
590
											}
591
										?>
3208 idir 592
 
3239 idir 593
									<?php endforeach; ?>
594
								</div>
595
							</div>
596
						</form>
597
					<?php endif; ?><!-- Fin champs supplémentaires -->
3208 idir 598
 
3248 idir 599
					<form id="form-upload" class="form-horizontal bloc-top" action="<?php echo $url_ws_upload ?>" method="post" enctype="multipart/form-data">
600
						<h2><?php echo $image['titre']; ?></h2>
3239 idir 601
						<p class="miniature-info" class="discretion help-inline">
3248 idir 602
							<?php echo $image['aide']; ?>
3239 idir 603
						</p>
604
						<div id ="photos-conteneur" class="control-group">
605
							<div>
606
								<label for="fichier" class="label-file btn btn-large btn-info mb-3">
3248 idir 607
									<span class="label-text"><i class="fas fa-download"></i> <?php echo $image['ajouter']; ?></span>
3239 idir 608
									<input type="file" id="fichier" name="fichier" class="input-file" accept="image/jpeg" multiple>
609
									<input type="hidden" name="MAX_FILE_SIZE" value="5242880">
610
								</label>
611
							</div>
3270 idir 612
							<span for="fichier" class="error" style="display: none;"><?php echo $observation['taxon-title'];?></span>
3208 idir 613
 
3239 idir 614
							<div id="miniatures"></div>
615
							<p class="miniature-msg" class="span12">&nbsp;</p>
616
						</div>
617
					</form>
3208 idir 618
 
3239 idir 619
					<div id="image" class="row"></div>
620
				</div>
3208 idir 621
 
3239 idir 622
				<!-- Bouton cr&ation d'une obs -->
3240 idir 623
				<div class="row mb-3">
3248 idir 624
					<div class="centre" title="<?php echo $resume['creer-title']; ?>">
3269 idir 625
						<button id="ajouter-obs" class="btn btn-success"><i class="fas fa-check-square"></i> <?php echo $resume['creer']; ?></button>
3239 idir 626
					</div>
627
				</div>
3208 idir 628
 
3239 idir 629
				<!-- Messages d'erreur du formulaire-->
630
				<div class="row">
631
					<div class="zone-alerte">
632
						<div id="dialogue-bloquer-creer-obs" class="alert alert-warning alert-block hidden">
633
							<a class="close">×</a>
3248 idir 634
							<h4 class="alert-heading"><?php echo $resume['alert10max']; ?></h4>
635
							<p><?php echo $resume['alert10max-desc']; ?></p>
3239 idir 636
						</div>
637
					</div>
638
					<div class="zone-alerte">
639
						<div id="dialogue-form-invalide" class="alert alert-warning alert-block hidden">
640
							<a class="close">×</a>
3248 idir 641
							<h4 class="alert-heading"><?php echo $resume['alertchp']; ?></h4>
642
							<p><?php echo $resume['alertchp-desc']; ?></p>
3239 idir 643
						</div>
644
					</div>
645
				</div>
3208 idir 646
 
3239 idir 647
				<!-- Affiche le tableau récapitualif des observations ajoutées -->
3240 idir 648
				<div id="zone-liste-obs" class="bloc-top hidden">
3239 idir 649
					<div class="alert alert-info">
3248 idir 650
						<h2 class="transmission-title"><strong><?php echo $resume['titre']; ?> <span class="obs-nbre badge badge-info">0</span></strong></h2>
3269 idir 651
						<button id="transmettre-obs" class="btn btn-success droite" disabled="disabled"
3248 idir 652
							title="<?php echo $resume['trans-title']; ?>" type="button">
653
							<?php echo $resume['trans']; ?>
3239 idir 654
						</button>
655
					</div>
3260 idir 656
					<!-- chargement -->
657
					<div id="chargement" class="modal-fenetre hidden">
658
						<div id="chargement-centrage" class="modal-contenu">
659
							<div class="progress active">
660
								<div id="barre-progression-upload" class="progress-bar progress-bar-striped" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="10" style="">
661
										<span class="sr-only">0/10 <?php echo $resume['nbobs']; ?></span>
662
									</div>
663
							</div>
664
							<p id="chargement-txt"><?php echo $resume['transencours']; ?></p>
665
						</div>
666
					</div>
3239 idir 667
					<div id="liste-obs" ></div>
668
					<div class="row">
669
						<div class="zone-alerte">
670
							<div id="dialogue-zero-obs" class="alert alert-block hidden">
671
								<a class="close">×</a>
3248 idir 672
								<h4 class="alert-heading"><?php echo $resume['alert0obs']; ?></h4>
673
								<p><?php echo $resume['alert0obs-desc']; ?></p>
3239 idir 674
							</div>
675
							<div id="dialogue-obs-transaction-ok" class="alert alert-success alert-block hidden">
676
								<a class="close">×</a>
3248 idir 677
								<h4 class="alert-heading"><?php echo $resume['info-trans']; ?></h4>
3239 idir 678
								<div class="alert-txt"></div>
679
							</div>
680
							<div id="dialogue-obs-transaction-ko" class="alert alert-error alert-block hidden">
681
								<a class="close">×</a>
3248 idir 682
								<h4 class="alert-heading"><?php echo $resume['alerttrans']; ?></h4>
3239 idir 683
								<div class="alert-txt"></div>
684
							</div>
685
						</div>
686
					</div>
687
				</div>
3208 idir 688
 
3239 idir 689
				<!-- Templates HTML -->
690
				<div id="tpl-transmission-ok" class="hidden">
3248 idir 691
					<p class="msg"><?php echo $resume['transok']; ?></p>
3239 idir 692
				</div>
693
				<div id="tpl-transmission-ko" class="hidden">
3248 idir 694
					<p class="msg"><?php echo $resume['transko']; ?></p>
3239 idir 695
				</div>
696
			</div>
697
		</div>
3260 idir 698
 
699
		<!-- Modales Aide -->
3239 idir 700
		<div id="help-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="help-modal-label" style="display: none;" aria-hidden="true">
701
			<div class="modal-dialog modal-dialog-centered" role="document">
702
				<div class="modal-content">
703
					<div class="modal-header">
704
						<h5 class="modal-title" id="help-modal-label"></h5>
705
						<button type="button" class="close" data-dismiss="modal" aria-label="Close">
706
							<span aria-hidden="true">&times;</span>
707
						</button>
708
					</div>
709
					<div class="modal-body" id="print_content"></div>
710
					<div class="modal-footer">
711
						<button type="button" class="btn btn-secondary" data-dismiss="modal">Fermer</button>
712
					</div>
713
				</div>
714
			</div>
715
		</div>
3260 idir 716
 
3239 idir 717
		<!-- carto -->
3268 idir 718
		<script type="text/javascript" src="<?php echo $url_base; ?>js/tb-geoloc/tb-geoloc-lib-app.js"></script>
3240 idir 719
		<script type="text/javascript">
720
			var tbGeolocation = document.getElementById( 'tb-geolocation' );
721
 
722
			tbGeolocation.addEventListener( 'location', function( location ) {
723
				console.log( location.detail );
3260 idir 724
 
725
				var secVal = location.detail.geometry.coordinates[1],
726
					firstVal = location.detail.geometry.coordinates[0],
727
					latitude = '',
728
					longitude = '';
729
 
730
				if ( 'object' === typeof secVal && 'object' === typeof firstVal ) {// rue
731
					latitude =  ( ( firstVal[1] + secVal[1] ) / 2 ).toFixed( 6 );
732
					longitude = ( ( firstVal[0] + secVal[0] ) / 2 ).toFixed( 6 );
733
				} else  if ( 'number' === typeof secVal && 'number' === typeof firstVal ) {// point
734
					latitude = secVal;
735
					longitude = firstVal;
3240 idir 736
				}
3260 idir 737
				document.getElementById( 'latitude' ).value = latitude;
738
				document.getElementById( 'longitude' ).value = longitude;
739
				document.getElementById( 'pays' ).value = location.detail.osmCountry;
740
				document.getElementById( 'commune-nom' ).value = location.detail.inseeData.nom;
741
				document.getElementById( 'commune-insee' ).value = location.detail.inseeData.code;
742
				document.getElementById( 'altitude' ).value = location.detail.elevation;
3239 idir 743
			});
744
		</script>
3208 idir 745
 
3239 idir 746
		<!-- Jquery -->
747
		<script type="text/javascript" src="https://resources.tela-botanica.org/jquery/1.11.1/jquery-1.11.1.min.js"></script>
3208 idir 748
 
3239 idir 749
		<!-- Jquery UI : nécessaire pour le minicalendrier et l'auto-complétion -->
750
		<script type="text/javascript" src="https://resources.tela-botanica.org/jquery/jquery-ui/1.11.0/js/jquery-ui.min.js"></script>
3240 idir 751
		<!-- <script type="text/javascript" src="https://resources.tela-botanica.org/jquery/jquery-ui/1.11.0/js/datepicker-fr.js"></script> -->
3239 idir 752
		<!-- Jquery Plugins -->
753
		<!-- Jquery Validate : nécessaire pour la validation des formulaires -->
754
		<script type="text/javascript" src="https://resources.tela-botanica.org/jquery/validate/1.11.1/jquery.validate.min.js"></script>
755
		<script type="text/javascript" src="https://resources.tela-botanica.org/jquery/validate/1.11.1/additional-methods.min.js"></script>
756
		<script type="text/javascript" src="https://resources.tela-botanica.org/jquery/validate/1.11.1/messages_fr.js"></script>
757
		<!-- Jquery Form :nécessaire pour l'upload des images -->
758
		<script type="text/javascript" src="https://resources.tela-botanica.org/jquery/form/3.51/jquery.form.min.js"></script>
759
		<!-- Bootstrap -->
760
		<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
761
		<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
762
		<!-- Authentification -->
3268 idir 763
		<script type="text/javascript" src="<?php echo $url_base; ?>js/auth.js"></script>
3239 idir 764
		<!-- Connexion, bloc de prévisualisation, date -->
3268 idir 765
		<script type="text/javascript" src="<?php echo $url_base; ?>js/WidgetSaisie.js"></script>
766
		<script type="text/javascript" src="<?php echo $url_base; ?>js/champs-supp.js"></script>
3239 idir 767
		<script type="text/javascript">
768
			//<![CDATA[
769
				$( document ).ready( function() {
3208 idir 770
 
3239 idir 771
					// OMG un modèle objet !!
772
					var widget = new WidgetSaisie();
3208 idir 773
 
3239 idir 774
					//
775
					//
776
					//
777
					// La présence du parametre 'debug' dans l'URL enclenche le débogage
3248 idir 778
					widget.debug = <?php echo isset( $_GET['debug'] ) ? 'true' : 'false'; ?>;
3239 idir 779
					// La présence du parametre 'html5' dans l'URL enclenche les fonctions avancées HTML5
3248 idir 780
					widget.html5 = <?php echo isset($_GET['html5']) ? 'true' : 'false'; ?>;
3239 idir 781
					// Mot-clé du widget/projet
782
					widget.tagProjet = "WidgetSaisie";
783
					// Mots-clés à ajouter aux images
3248 idir 784
					widget.tagImg = "<?php echo isset($_GET['tag-img']) ? $_GET['tag-img'] : ''; ?>";
785
					widget.separationTagImg = "<?php echo isset($_GET['motcle']) && isset($_GET['tag-img']) ? ',' : ''; ?>";
786
					widget.tagImg = <?php echo isset($_GET['motcle']) ? "'".$_GET['motcle']."' + widget.separationTagImg + widget.tagImg" : 'widget.tagImg'; ?>;
3239 idir 787
					// Mots-clés à ajouter aux observations
3248 idir 788
					widget.tagObs = "<?php echo isset($_GET['tag-obs']) ? $_GET['tag-obs'] : ''; ?>";
789
					widget.separationTagObs = "<?php echo isset($_GET['projet']) && isset($_GET['tag-obs']) ? ',' : ''; ?>";
790
					widget.tagObs = <?php echo isset($_GET['projet']) ? "'".$_GET['projet']."' + widget.separationTagObs + widget.tagObs" : 'widget.tagObs'; ?>;
3239 idir 791
					// Précharger le formulaire avec les infos d'une observation
3248 idir 792
					widget.obsId = "<?php echo isset($_GET['id-obs']) ? $_GET['id-obs'] : ''; ?>";
3239 idir 793
					// URL du web service réalisant l'insertion des données dans la base du CEL.
3248 idir 794
					widget.serviceSaisieUrl = "<?php echo $url_ws_saisie; ?>";
3239 idir 795
					// URL du web service permettant de récupérer les infos d'une observation du CEL.
3248 idir 796
					widget.serviceObsUrl = "<?php echo $url_ws_obs; ?>";
3239 idir 797
					//
798
					//
799
					//
3208 idir 800
 
3239 idir 801
					// langue
3248 idir 802
					widget.langue = "<?php echo $widget['langue']; ?>";
3239 idir 803
					// Squelette d'URL du web service de l'annuaire.
3248 idir 804
					widget.serviceAnnuaireIdUrl = "<?php echo $url_ws_annuaire; ?>";
3239 idir 805
					// URL de l'icône du chargement en cours
3268 idir 806
					widget.chargementIconeUrl = "<?php echo $url_base; ?>img/icones/chargement.gif";
3239 idir 807
					// URL de l'icône du chargement en cours d'une image
3268 idir 808
					widget.chargementImageIconeUrl = "<?php echo $url_base; ?>img/icones/chargement-image.gif";
3239 idir 809
					// URL de l'icône du calendrier
3268 idir 810
					widget.calendrierIconeUrl = "<?php echo $url_base; ?>img/icones/calendrier.png";
3239 idir 811
					// URL de l'icône pour une photo manquante
3268 idir 812
					widget.pasDePhotoIconeUrl = "<?php echo $url_base; ?>img/icones/pasdephoto.png";
3239 idir 813
 
814
					// Code du référentiel utilisé pour les nom scientifiques.
3248 idir 815
					widget.nomSciReferentiel = "<?php echo ( !empty( $widget['referentiel'] ) ) ? strtolower( $widget['referentiel'] ) : 'bdtfxr'; ?>";
3239 idir 816
					// Indication de la présence d'une espèce imposée
3257 delphine 817
					widget.especeImposee = "<?php echo $widget['especes']['espece_imposee']; ?>";
3239 idir 818
					// Tableau d'informations sur l'espèce imposée
3257 delphine 819
					widget.infosEspeceImposee = "<?php echo $widget['especes']['infos_espece']; ?>";
3239 idir 820
					// Nombre d'élément dans les listes d'auto-complétion
821
					widget.autocompletionElementsNbre = 20;
822
					// Indication de la présence d'un référentiel imposé
3260 idir 823
					widget.referentielImpose = "<?php echo ( !empty( $widget['referentiel'] ) ) ? strtolower( $widget['referentiel'] ) : 'bdtfxr'; ?>";
824
					// #taxon est une liste
825
					widget.isTaxonListe = <?php echo ( isset( $widget['especes']['taxons'] ) && count( (array) $widget['especes']['taxons'] ) )? 'true' : 'false' ; ?>;
3239 idir 826
					// URL du web service permettant l'auto-complétion des noms scientifiques
3248 idir 827
					widget.serviceAutocompletionNomSciUrl = "<?php echo $widget['especes']['url_ws_autocompletion_ns']; ?>?"+
3239 idir 828
						"masque={masque}&"+
829
						"recherche=etendue&"+
830
						"retour.champs=famille,nom_retenu,nom_retenu_complet,num_taxonomique,nom_retenu.id&"+
831
						"ns.structure=au&"+
832
						"navigation.limite=" + widget.autocompletionElementsNbre;
833
					// Squelette d'URL du web service permettant l'auto-complétion des noms scientifiques
3248 idir 834
					widget.serviceAutocompletionNomSciUrlTpl = "<?php echo $widget['especes']['url_ws_autocompletion_ns_tpl']; ?>?"+
3239 idir 835
						"masque={masque}&"+
836
						"recherche=etendue&"+
837
						"retour.champs=famille,nom_retenu,nom_retenu_complet,num_taxonomique,nom_retenu.id&"+
838
						"retour.tri=alpharet&"+ // tri "à la CeL"
839
						"ns.structure=au&"+
840
						"navigation.limite=" + widget.autocompletionElementsNbre;
841
					// Nombre d'observations max autorisé avant transmission
842
					widget.obsMaxNbre = 10;
843
					// Durée d'affichage en milliseconde des messages d'informations
3260 idir 844
					widget.dureeMessage = 10000;
3239 idir 845
					//
846
					//
847
					//
848
					// Squelette d'URL du web service d'eFlore fournissant les noms de communes.
849
					widget.serviceNomCommuneUrl = "https://api.tela-botanica.org/service:eflore:0.1/osm/nom-commune?lon={lon}&lat={lat}";
850
					// Squelette d'URL du web service d'eFlore fournissant les noms de communes hors de France (localisation approximative).
851
					widget.serviceNomCommuneUrlAlt = "https://api.tela-botanica.org/service:eflore:0.1/wikipedia/nom-commune?lon={lon}&lat={lat}&nbre=1";
852
					// URL du marqueur à utiliser dans la carte Google Map
3268 idir 853
					widget.googleMapMarqueurUrl = "<?php echo $url_base; ?>img/marqueurs/epingle.png";
3239 idir 854
					//
855
					//
856
					//
857
 
858
					// Initialisation du bousin
859
					widget.init();
860
				});
861
			//]]>
3230 delphine 862
		</script>
863
		<!-- Barre de navigation -->
864
		<?php if ( $bar ): ?>
3248 idir 865
			<script src="<?php echo $url_script_navigation; ?>"></script>
3230 delphine 866
		<?php endif; ?>
867
	</body>
3208 idir 868
</html>