Subversion Repositories eFlore/Applications.cel

Rev

Rev 3229 | Rev 3240 | 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>
4
		<title><?= $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" />
16
		<meta name="description" content="Gestion des widgets de saisie du carnet en ligne" />
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
 
3228 delphine 30
		<!-- Favicones -->
31
		<link rel="shortcut icon" type="image/x-icon" href="https://resources.tela-botanica.org/tb/img/16x16/favicon.ico" />
32
 
33
		<!-- CSS -->
34
		<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" />
35
		<!-- Bootstrap CSS -->
36
		<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous" />
37
		<link rel="stylesheet" type="text/css" href="<?= $url_base; ?>modules/saisie2/squelettes/css/bootstrap-4/css/bootstrap.min.css" />
38
		<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.1/css/all.css" integrity="sha384-O8whS3fhG2OnA5Kas0Y9l3cfpmYjapjI0E4theH4iuMD+pLhbf6JI0jIMfYcK3yZ" crossorigin="anonymous" />
39
		<link href="<?= $url_base; ?>modules/saisie2/squelettes/css/saisie.css" rel="stylesheet" type="text/css" media="screen" />
3120 delphine 40
 
3228 delphine 41
		<!-- carto -->
42
		<link href="<?= $url_base; ?>modules/saisie2/squelettes/js/tb-geoloc/styles.css" rel="stylesheet" type="text/css" media="screen" />
43
		<!--  Google Analytics -->
44
		<?php if( $prod ): ?>
45
			<?php include "analytics.html"; ?>
46
		<?php endif; ?>
47
		<link rel="icon" type="image/x-icon" href="favicon.ico" />
48
		<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
49
	</head>
3120 delphine 50
 
3228 delphine 51
	<body>
52
		<!-- <?php //var_dump($widget['especes']['url_ws_autocompletion_ns']); ?> -->
53
		<div id="zone-appli" class="container">
54
			<div class="layout-wrapper page">
55
				<div class="media">
56
					<img class="d-flex mr-3" src="<?= $widget['logo']; ?>" alt="logo<?= $widget['projet']; ?>" />
57
				<div class="media-body">
58
				<h1 class="mt-0"><?= $widget['titre']; ?></h1>
59
			</div>
60
		</div>
3120 delphine 61
 
3228 delphine 62
		<div class="row">
63
			<div class="col-md-6">
64
				<div id="description"><?= $widget['description']; ?></div>
65
			</div>
66
			<div class="col-md-6">
67
				<div id="aide" class="well well-lg hidden-sm-down">
68
					<h3><?= $aide['titre']; ?></h3>
69
					<div id="aide-txt" class="hiden-sm-down">
70
						<p><?= $aide['description']; ?></p>
71
					</div>
72
				</div>
73
			</div>
74
		</div>
3208 idir 75
 
3228 delphine 76
		<div id="formulaire" class="row mb-3 bloc-top">
77
			<form id="form-observateur" role="form" autocomplete="on">
78
				<h2><?= $observateur['titre']; ?></h2>
79
				<!--la partie tb-navigation vient du widget stats http://svn.tela-botanica.net/websvn/filedetails.php?repname=eFlore%2FApplications.cel&path=%2Ftrunk%2Fwidget%2Fmodules%2Fstats%2Fsquelettes%2Fstats_utilisateur.tpl.html
80
				la partie contenu-souce vient de http://svn.tela-botanica.net/websvn/filedetails.php?repname=Applications.reseau&path=%2Ftrunk%2Fwidget%2Fmodules%2Fnavigation%2Fsquelettes%2Fbootstrap3.tpl.php
81
				le javascript auth.js vient de http://svn.tela-botanica.net/websvn/filedetails.php?repname=Applications.reseau&path=%2Ftrunk%2Fresources%2Fjs%2Fnavigation.js
82
				de l'aide dans la partie Intégration dans l'interface (applications AJAX) de https://www.tela-botanica.org/wikini/DevInformatiques/wakka.php?wiki=MemoIntegrationSSO-->
83
				<!-- prod : -->
84
				<!-- <div id="tb-navigation" data-courant="widget-cel-saisie2" data-squelette="navigation" data-mode="prod"> -->
85
				<!-- beta (test) :-->
86
				<div id="tb-navigation" data-courant="widget-cel-saisie2" data-squelette="navigation" data-mode="test">
87
				<!-- dev (localhost) : -->
88
				<!-- <div id="tb-navigation" data-courant="widget-cel-saisie2" data-squelette="navigation" data-mode="local"> -->
89
					<div class="navbar-default mb-3" id="tb-navbar">
90
						<div class="nav navbar-nav navbar-right row">
91
							<div id="bouton-connexion" class="dropdown col-md-6 col-sm-8">
92
								<label for="bouton-connexion"><?= $observateur['compte']; ?></label>
93
								<a id="connexion" href="<?= $authTpl; ?>" class="btn btn-success  mr-1 mb-1" taget="_blank"><?= $observateur['connexion']; ?></a>
94
								<a id="bouton-inscription" href="https://beta.tela-botanica.org/test/inscription" class="btn btn-primary mr-1 mb-1" taget="_blank"><?= $observateur['inscription']; ?></a>
95
							</div>
96
							<div id="creation-compte" class="dropdown col-md-6 col-sm-8">
97
								<label for="creation-compte"><?= $observateur['noninscription']; ?></label>
3229 delphine 98
								<a id="bouton-anonyme" href="#" class="btn btn-info mr-1 mb-1"><?= $observateur['nonconnexion']; ?></a>
3228 delphine 99
							</div>
100
							<div id="utilisateur-connecte" class="dropdown hidden">
101
								<label for="utilisateur-connecte"><?= $observateur['bienvenue']; ?></label>
102
								<a href="#" class="list-tool btn btn-largee btn-primary dropdown-toggle" data-toggle="dropdown">
103
									<span id="nom-complet"></span>
104
								</a>
105
								<div class="dropdown-menu">
3229 delphine 106
									<div id="profil-utilisateur"><a href="https://beta.tela-botanica.org/test/inscription" taget="_blank"><?= $observateur['profil']; ?></a></div>
3228 delphine 107
									<div id="deconnexion"><a href="#"><?= $observateur['deconnexion']; ?></a></div>
108
								</div>
109
							</div>
110
						</div>
111
					</div>
112
				</div>
113
 
114
				<div id="anonyme" class="mb-3 hidden">
115
					<div id="zone-courriel" class="row">
116
						<div class="control-group col-md-6">
117
							<label for="courriel" class="col-sm-8 obligatoire" title="<?= $observateur['courriel-title']; ?>">
118
								<i class="fa fa-envelope" aria-hidden="true"></i>
119
								<?= $observateur['courriel']; ?>
120
							</label>
121
							<div class="col-sm-8 mb-3">
122
								<input id="courriel" name="courriel" class="form-control" type="email" title="<?= $observateur['courriel-title']; ?> ">
123
								<input id="id_utilisateur" name="id_utilisateur" type="hidden">
124
							</div>
125
						</div>
126
 
127
						<div id="zone-courriel-confirmation" class="control-group col-md-6 hidden">
128
							<label for="courriel_confirmation" class="col-sm-8 obligatoire" title="Veuillez confirmer le courriel.">
129
								<i class="fa fa-envelope" aria-hidden="true"></i>
130
								<?= $observateur['courriel-confirmation']; ?>
131
							</label>
132
							<div class="col-sm-8">
133
								<input id="courriel_confirmation" name="courriel_confirmation" class="form-control" type="email">
134
							</div>
135
						</div>
136
					</div>
137
 
138
					<div id="zone-prenom-nom" class="row hidden">
139
						<div class="control-group col-md-6">
140
							<label for="prenom" class="col-sm-8">
141
								<i class="fa fa-user" aria-hidden="true"></i>
142
								<?= $observateur['prenom']; ?>
143
							</label>
144
							<div class="input-group col-sm-8">
145
								<input id="prenom" name="prenom" class="form-control" type="text">
146
							</div>
147
						</div>
148
						<div class="control-group col-md-6">
149
							<label for="nom" class="col-sm-8">
150
								<i class="fa fa-user" aria-hidden="true"></i>
151
								<?= $observateur['nom']; ?>
152
							</label>
153
							<div class="input-group col-sm-8">
154
								<input id="nom" name="nom" class="form-control" type="text">
155
							</div>
156
						</div>
157
					</div>
158
				</div>
159
			</form>
3208 idir 160
 
3228 delphine 161
			<!-- Messages d'erreur du formulaire-->
162
			<div class="row">
163
				<div class="zone-alerte">
164
					<div id="dialogue-bloquer-copier-coller" class="alert alert-info alert-block hidden"">
165
						<a class="close">×</a>
166
						<h4 class="alert-heading"><?= $observateur['alertcc-title']; ?></h4>
167
						<p><?= $observateur['alertcc']; ?></p>
168
					</div>
169
					<div id="dialogue-utilisateur-non-identifie" class="alert alert-warning alert-block hidden">
170
						<a class="close">×</a>
171
						<h4 class="alert-heading"><?= $observateur['alertni-title']; ?></h4>
172
						<p><?= $observateur['alertni']; ?></p>
173
					</div>
174
				</div>
175
			</div>
3208 idir 176
 
3228 delphine 177
			<form id="form-observation" role="form" autocomplete="on" class="bloc-top">
178
				<h2><?= $observation['titre']; ?></h2>
179
				<div id="zone-observation" class="row">
180
					<div class="col-md-6">
181
						<div class="control-group">
182
							<label for="geolocalisation" class="col-sm-8 obligatoire" title="<?= $observateur['courriel-title']; ?>">
183
								<i class="fa fa-street-view" aria-hidden="true"></i>
184
								<?= $observation['geolocalisation']; ?>
185
							</label>
186
							<div class="col-sm-8 mb-3">
187
								<input id="geolocalisation" name="geolocalisation" type="hidden">
188
								<tb-geolocation-element id="tb-geolocation"></tb-geolocation-element>
189
							</div>
190
						</div>
191
						<div class="control-group">
192
							<label for="milieu" class="col-sm-8">
193
								<i class="fa fa-street-view" aria-hidden="true"></i>
194
								<?= $observation['milieu']; ?>
195
							</label>
196
							<div class="col-sm-8 mb-3">
197
								<?php if ( 0 < count( (array) $widget['milieux'] ) ) :?>
198
									<select id="milieu" class="form-control" >
199
										<?php foreach ( $widget['milieux'] as $milieu ) :?>
200
											<option value="<?= $milieu; ?>"><?= $milieu; ?></option>
201
										<?php endforeach; ?>
202
									</select>
203
								<?php else : ?>
204
									<input id="milieu" name="milieu" class="form-control" type="text" placeholder="<?= $observation['milieu-ph']; ?>">
205
								<?php endif; ?>
206
							</div>
207
						</div>
208
					</div>
209
 
210
					<div class="col-md-6">
211
						<div class="control-group">
212
							<label for="date_releve" class="col-sm-8 obligatoire" title="">
213
								<i class="fa fa-calendar" aria-hidden="true"></i>
214
								<?= $observation['date']; ?>
215
							</label>
216
							<div class="col-sm-8 mb-3" id="datetimepicker">
217
								<input type="text" id="date_releve" name="date_releve" class="form-control date" placeholder="jj/mm/aaaa"  pattern="(^(((0[1-9]|1[0-9]|2[0-8])[\/](0[1-9]|1[012]))|((29|30|31)[\/](0[13578]|1[02]))|((29|30)[\/](0[4,6,9]|11)))[\/](19|[2-9][0-9])\d\d$)|(^29[\/]02[\/](19|[2-9][0-9])(00|04|08|12|16|20|24|28|32|36|40|44|48|52|56|60|64|68|72|76|80|84|88|92|96)$)" title="jj/mm/aaaa">
218
							</div>
219
						</div>
3208 idir 220
 
3228 delphine 221
						<?php if(($widget['type_especes'] === 'referentiel' || $widget['type_especes'] == '') && $widget['referentiel'] == '' ) : ?>
222
							<div class="control-group">
223
								<label for="referentiel" class="col-sm-8 obligatoire" title="">
224
									<i class="fa fa-book" aria-hidden="true"></i>
225
									<?= $observation['referentiel']; ?>
226
								</label>
227
								<div class="col-sm-8 mb-3">
228
									<select id="referentiel" class="form-control" >
229
										<option value="bdtfxr" selected="selected" title="Trachéophytes de France métropolitaine">Métropole (index réduit)</option>
230
										<option value="bdtfx" title="Trachéophytes de France métropolitaine">Métropole (BDTFX)</option>
231
										<option value="bdtxa" title="Trachéophytes des Antilles">Antilles françaises (BDTXA)</option>
232
										<option value="bdtre" title="Trachéophytes de La Réunion">Réunion (BDTRE)</option>
233
										<option value="aublet" title="Guyane">Guyane (AUBLET2)</option>
234
										<option value="florical" title="Nouvelle-Calédonie">Nouvelle-Calédonie (FLORICAL)</option>
235
										<option value="isfan" title="Afrique du Nord">Afrique du Nord (ISFAN)</option>
236
										<option value="apd" title="Afrique de l'Ouest et du Centre">Afrique de l'Ouest et du Centre (APD)</option>
237
										<option value="lbf" title="Liban">Liban (LBF)</option>
238
										<option value="autre" title="Autre/Inconnu">Autre/Inconnu</option>
239
									</select>
240
								</div>
241
							</div>
3230 delphine 242
						<?php else : ?>
3228 delphine 243
							<input id="referentiel" name="referentiel" value="<?= $widget['referentiel']; ?>" type="hidden">
244
						<?php endif; ?>
3208 idir 245
 
3228 delphine 246
						<div class="control-group">
3230 delphine 247
							<label for="taxon" class="col-sm-8 obligatoire" title="">
248
								<i class="fa fa-leaf" aria-hidden="true"></i>
249
								<?= $observation['espece']; ?><?php if ($widget['referentiel'] !== '' && $widget['referentiel'] !== NULL) echo " (".$widget['referentiel'].")"; ?>
250
							</label>
251
							<div class="col-sm-8 mb-3">
252
								<input id="taxon" name="taxon" class="form-control" type="text">
253
							</div>
254
						</div>
3208 idir 255
 
3230 delphine 256
						<div class="control-group">
257
							<label for="certitude" class="col-sm-8 obligatoire" title="">
258
								<i class="fa fa-question" aria-hidden="true"></i>
259
								<?= $observation['certitude']; ?>
260
							</label>
261
							<div class="col-sm-8 mb-3">
262
								<select id="certitude" name="certitude" class="form-control">
263
									<option value="aDeterminer" ><?= $observation['certADet']; ?></option>
264
									<option value="douteuse" ><?= $observation['certDout']; ?></option>
265
									<option value="certaine" selected="selected" ><?= $observation['certCert']; ?></option>
266
								</select>
267
							</div>
268
						</div>
269
 
270
						<div class="control-group">
271
							<label for="notes" class="col-sm-8" title="">
272
								<i class="fa fa-pen" aria-hidden="true"></i>
273
								<?= $observation['notes']; ?>
274
							</label>
275
							<div class="col-sm-8 mb-3">
276
								<textarea id="notes" form="form-obs" class="form-control col-md-12" rows="7" name="notes"
277
									placeholder="<?= $observation['notes_ph']; ?>"></textarea>
278
 
279
							</div>
280
						</div>
3208 idir 281
 
3230 delphine 282
					</div>
283
				</div>
284
			</form>
3208 idir 285
 
3230 delphine 286
			<form id="form-upload" class="form-horizontal bloc-top" action="<?= $url_ws_upload ?>" method="post" enctype="multipart/form-data">
287
				<h2><?= $image['titre']; ?></h2>
288
				<p class="miniature-info" class="discretion help-inline">
289
					<?= $image['aide']; ?>
290
				</p>
291
				<div id ="photos-conteneur" class="control-group">
292
					<div>
293
						<label for="fichier" class="label-file btn btn-large btn-info mb-3">
294
							<span class="label-text"><i class="fas fa-download"></i> <?= $image['ajouter']; ?></span>
295
							<input type="file" id="fichier" name="fichier" class="input-file" accept="image/jpeg" multiple>
296
							<input type="hidden" name="MAX_FILE_SIZE" value="5242880">
297
						</label>
298
					</div>
3208 idir 299
 
3230 delphine 300
					<div id="miniatures"></div>
301
					<p class="miniature-msg" class="span12">&nbsp;</p>
302
				</div>
303
			</form>
3208 idir 304
 
3230 delphine 305
			<!-- Champs supplémentaires -->
306
			<?php if ( isset($widget['chpSupp'] ) && 0 < count( (array) $widget['chpSupp'] ) ) : ?>
307
				<form id="form-supp" role="form" autocomplete="on">
308
					<h2><?= $chpsupp['titre']; ?></h2>
309
						<div id="zone-supp" class="row">
310
							<div class="col-md-6">
3208 idir 311
 
3230 delphine 312
			                  <?php foreach( $widget['chpSupp']['sauvagessupp']['champs-supp'] as $champ ) :?>
313
			                    <?php
314
			                      $min         = ( $champ['fieldValues']['min'] )? ' min="' . $champ['fieldValues']['min'] . '"':'';
3208 idir 315
                      $max         = ( $champ['fieldValues']['max'] )? ' max="' . $champ['fieldValues']['max'] . '"':'';
316
                      $step        = ( $champ['fieldValues']['step'] )? ' step="' . $champ['fieldValues']['step'] . '"':'';
317
                      $default     = ( $champ['fieldValues']['default'] )? ' value="' . $champ['fieldValues']['default'] . '"':'';
318
                      $description = ( $champ['description'] )? ' title="' . $champ['description'] . '"':'';
319
                      $placeholder = ( $champ['fieldValues']['placeholder'] )? ' placeholder="' . $champ['fieldValues']['placeholder'] . '"':'';
320
                      $required    = '';
321
                      $mandatory   = '';
322
                      $datepicker  = '';
323
                      $pattern     = '';
324
                      $obs_radio   = '';
3217 idir 325
                      $help        = '';
326
                      $help_button = '';
3208 idir 327
 
3217 idir 328
                      if( /*true*/$champ['help'] ) {
329
                        $help = ' and-help';
330
                        // TODO récupérer un $champ['help_mime_type']
331
                        // $champ['help_mime_type'] = 'application/pdf';
332
                        $champ['help_mime_type'] = 'image.*';
333
                        $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_mime_type'] . '"><i class="fas fa-info-circle"></i></div>';
334
                      }
335
 
3208 idir 336
                      if( $champ['mandatory'] ) {
337
                        // Attr required
338
                        $required  = ' required';
339
                        // class="obligatoire"
340
                        $mandatory = ' obligatoire';
341
                      }
342
 
343
                      if( 'date' === $champ['element'] ) {
344
                        $datepicker = ' date';
345
                        $pattern    = ' pattern="(^(((0[1-9]|1[0-9]|2[0-8])[\/](0[1-9]|1[012]))|((29|30|31)[\/](0[13578]|1[02]))|((29|30)[\/](0[4,6,9]|11)))[\/](19|[2-9][0-9])\d\d$)|(^29[\/]02[\/](19|[2-9][0-9])(00|04|08|12|16|20|24|28|32|36|40|44|48|52|56|60|64|68|72|76|80|84|88|92|96)$)"';
346
                      }
347
 
348
                      switch( $champ['element'] ) {
349
                        case 'radio':
350
                        case 'checkbox': ?>
351
                          <div class="control-group <?= $champ['element']; ?> mb-3"<?php echo $description . $required; ?>>
3217 idir 352
                            <div class="col-sm-8 list-label<?php echo $help . $mandatory; ?>">
353
                              <?= $champ['name'] . $help_button; ?>
3208 idir 354
                            </div>
355
                            <div class="col-sm-8">
356
 
357
                              <?php foreach ( $champ['fieldValues']['listValue'] as $i => $list_value ) : ?>
358
 
359
                                  <?php
360
                                    $checked = '';
361
                                    if ( '#' === substr( $list_value, -1 ) ) :
362
                                      $checked = ' checked';
363
                                      $list_value = substr( $list_value, 0, -1 );
364
                                    endif;
365
                                  ?>
366
 
367
                                  <?php if( 'other' !== $list_value ) : ?>
368
                                    <label for="<?php echo $champ['fieldValues']['cleanListValue'][$i]; ?>" class="<?php echo $champ['fieldValues']['cleanListValue'][$i]; ?>">
369
                                      <input type="<?= $champ['element']; ?>" id="<?php echo $champ['fieldValues']['cleanListValue'][$i]; ?>" name="<?= $champ['key']; ?>" value="<?= $list_value; ?>"<?= $checked; ?> class="<?php echo $champ['fieldValues']['cleanListValue'][$i]; ?>" data-label="<?= $champ['name']; ?>">
370
                                      <?= $list_value; ?>
371
                                    </label>
372
                                  <?php else : ?>
373
                                    <label for="other-<?= $champ['key']; ?>">
3217 idir 374
                                      <input type="<?= $champ['element']; ?>" id="other-<?= $champ['key']; ?>" name="<?= $champ['key']; ?>" value="other" class="other" data-label="<?= $champ['name']; ?>" data-element="<?= $champ['element']; ?>">
3208 idir 375
                                      Autre
376
                                    </label>
377
                                  <?php endif; ?>
378
 
379
                              <?php endforeach; ?>
380
 
381
                            </div>
382
                          </div>
383
                        <?php break;
384
 
385
                        case 'list-checkbox': ?>
386
                          <div class="multiselect <?php echo $champ['element'] . $help; ?>">
3217 idir 387
                            <label class="col-sm-8<?= $mandatory; ?>"><?= $champ['name'] . $help_button; ?></label>
3208 idir 388
                            <div class="control-group col-sm-8 mb-3">
389
                              <div class="selectBox">
390
                                <select class="form-control" id="list-checkbox-<?= $champ['key']; ?>"<?php echo $description . $required; ?> class="form-control">
391
                                  <option>Plusieurs choix possibles</option>
392
                                </select>
393
                                <div class="overSelect"></div>
394
                              </div>
395
                              <div class="checkboxes hidden">
396
                                <?php foreach ( $champ['fieldValues']['listValue'] as $i => $list_value ) : ?>
397
 
398
                                  <?php
399
                                    $checked = '';
400
                                    if ( '#' === substr( $list_value, -1 ) ) :
401
                                      $checked = ' checked';
402
                                      $list_value = substr( $list_value, 0, -1 );
403
                                    endif;
404
                                  ?>
405
 
406
                                  <?php if( 'other' !== $list_value ) : ?>
407
                                    <label for="<?php echo $champ['fieldValues']['cleanListValue'][$i]; ?>">
408
                                      <input type="checkbox" id="<?php echo $champ['fieldValues']['cleanListValue'][$i]; ?>" name="<?= $champ['key']; ?>" value="<?= $list_value; ?>"<?= $checked; ?> class="<?php echo $champ['fieldValues']['cleanListValue'][$i]; ?>" data-label="<?= $champ['name']; ?>">
409
                                      <?= $list_value; ?>
410
                                    </label>
411
                                  <?php else : ?>
412
                                    <label for="other-<?= $champ['key']; ?>">
413
                                      <input type="checkbox" id="other-<?= $champ['key']; ?>" name="<?= $champ['key']; ?>" value="other" class="other" data-label="<?= $champ['name']; ?>" data-element="<?= $champ['element']; ?>">
414
                                      Autre
415
                                    </label>
416
                                  <?php endif; ?>
417
 
418
                                <?php endforeach; ?>
419
 
420
                              </div>
421
                            </div>
422
                          </div>
423
                        <?php break;
424
 
425
                        case 'select': ?>
3217 idir 426
                          <label for="<?= $champ['key']; ?>" class="col-sm-8<?= $mandatory; ?>"<?= $description; ?>><?= $champ['name'] . $help_button; ?></label>
3208 idir 427
                          <div class="champ col-sm-8 mb-3">
428
                            <div class="select-wrapper add-field-select <?php echo $champ['element'] . $help; ?>">
429
                              <select name="<?= $champ['key']; ?>" id="<?= $champ['key']; ?>" class="<?= $champ['key']; ?> form-control"<?= $required; ?> data-label="<?= $champ['name']; ?>">
430
 
431
                                <?php foreach ( $champ['fieldValues']['listValue'] as $list_value ) : ?>
432
 
433
                                  <?php
434
                                    $selected = '';
435
                                    if ( '#' === substr( $list_value, -1 ) ) :
436
                                      $selected = ' selected="selected"';
437
                                      $list_value = substr( $list_value, 0, -1 );
438
                                    endif;
439
                                  ?>
440
 
441
                                  <?php if( 'other' !== $list_value ) : ?>
442
                                    <option value="<?= $list_value; ?>"<?= $selected; ?>>
443
                                      <?php echo ucfirst( $list_value ); ?>
444
                                    </option>
445
                                  <?php else : ?>
446
                                    <option class="other form-control is-select" value="other" data-element="<?= $champ['element']; ?>">Autre</option>
447
                                  <?php endif; ?>
448
 
449
                                <?php endforeach; ?>
450
 
451
                              </select>
452
                            </div>
453
                          </div>
454
                        <?php break;
455
 
456
                        case 'file' : ?>
3217 idir 457
                          <div class="control-group col-sm-8 mb-3">
3208 idir 458
                            <div class="input-file-container<?= $help; ?>">
459
                              <input type="<?= $champ['element']; ?>" name="<?= $champ['key']; ?>" class="<?php echo $champ['key'] . ' input-file'; ?> form-control" <?php echo $description . $placeholder . $required; ?>  accept="application/pdf, image/*, video/*" data-label="<?= $champ['name']; ?>">
460
                              <label for="<?= $champ['key']; ?>" class="label-file<?= $mandatory; ?>" <?= $description; ?>><i class="fas fa-download" aria-hidden="true"></i> <?= $champ['name']; ?></label>
461
 
462
                              <?php if ( !$champ['mandatory'] ) : ?>
463
                                <div class="remove-file button" name="remove-file" title="Supprimer le fichier"><i class="fas fa-times" aria-hidden="true"></i></div>
464
                              <?php endif; ?>
465
 
466
                            </div>
467
                          </div>
468
                        <?php break;
469
 
470
                        case 'textarea': ?>
471
                          <div class="control-group">
3217 idir 472
                            <label for="<?= $champ['key']; ?>" class="col-sm-8<?php echo $help . $mandatory; ?>" <?= $description; ?>><?= $champ['name'] . $help_button; ?></label>
3208 idir 473
                            <div class="col-sm-8 mb-3">
474
                              <textarea type="<?= $champ['element']; ?>" id="<?= $champ['key']; ?>" name="<?= $champ['key']; ?>" class="<?= $champ['key'] . $help; ?> form-control" <?php echo $description . $placeholder . $required; ?> data-label="<?= $champ['name']; ?>"></textarea>
475
                            </div>
476
                          </div>
477
                        <?php break;
478
 
479
                        case 'range': ?>
480
                          <div class="control-group">
3217 idir 481
                            <label for="<?= $champ['key']; ?>" class="col-sm-8<?= $help . $mandatory; ?>" <?= $description; ?>><?= $champ['name'] . $help_button; ?></label>
3208 idir 482
                            <div class="col-sm-8 mb-3">
483
                              <input type="<?= $champ['element']; ?>" name="<?= $champ['key']; ?>" class="<?= $champ['key'] . $help; ?> form-control" <?php echo $description . $placeholder . $step . $default . $min . $max . $required; ?> data-label="<?= $champ['name']; ?>">
484
                            </div>
485
                          </div>
486
                          <?php break;
487
 
488
                        case 'number':
489
                        case 'date': ?>
490
                          <div class="control-group">
3217 idir 491
                            <label for="<?= $champ['key']; ?>" class="col-sm-8<?php echo $datepicker . $mandatory; ?>" <?= $description; ?>><?= $champ['name'] . $help_button; ?></label>
3208 idir 492
                            <div class="col-sm-8 mb-3">
493
                              <input type="<?= $champ['element']; ?>" name="<?= $champ['key']; ?>" class="<?= $champ['key'] . $help . $datepicker; ?> form-control"<?php echo  $pattern . $description . $placeholder . $step . $default . $min . $max . $required; ?> data-label="<?= $champ['name']; ?>">
494
                            </div>
495
                          </div>
496
                          <?php break;
497
 
498
                        case 'text' :
499
                        case 'email':
500
                        default: ?>
501
                          <div class="control-group">
3217 idir 502
                            <label for="<?= $champ['key']; ?>" class="col-sm-8<?= $mandatory; ?>" <?= $description; ?>><?= $champ['name'] . $help_button; ?></label>
3208 idir 503
                            <div class="col-sm-8 mb-3">
504
                              <input type="<?= $champ['element']; ?>" name="<?= $champ['key']; ?>" class="<?= $champ['key'] . $help; ?> form-control" <?php echo $description . $placeholder . $required; ?> data-label="<?= $champ['name']; ?>">
505
                            </div>
506
                          </div>
507
                        <?php break;
508
                      }
509
                    ?>
510
 
511
                  <?php endforeach; ?>
512
                </div>
513
              </div>
514
            </form>
515
          <?php endif; ?><!-- Fin champs supplémentaires -->
516
 
517
          <div id="image" class="row"></div>
518
        </div>
519
 
520
        <!-- Bouton cr&ation d'une obs -->
521
        <div class="row mb-3 bloc-bottom">
522
          <div class="centre" title="Une fois les champs remplis, vous pouvez cliquer sur ce bouton pour
523
              ajouter votre observation à la liste à transmettre.">
524
            <a id="ajouter-obs" class="btn btn-primary">
3230 delphine 525
              <i class="fas fa-check-square"></i><?= $resume['creer']; ?>
3208 idir 526
            </a>
527
          </div>
528
        </div>
529
 
530
        <!-- Messages d'erreur du formulaire-->
531
        <div class="row">
532
          <div class="zone-alerte">
533
            <div id="dialogue-bloquer-creer-obs" class="alert alert-warning alert-block hidden">
534
              <a class="close">×</a>
3230 delphine 535
              <h4 class="alert-heading"><?= $resume['alert10max']; ?></h4>
536
              <p><?= $resume['alert10max-desc']; ?></p>
3208 idir 537
            </div>
538
          </div>
539
          <div class="zone-alerte">
540
            <div id="dialogue-form-invalide" class="alert alert-warning alert-block hidden">
541
              <a class="close">×</a>
3230 delphine 542
              <h4 class="alert-heading"><?= $resume['alertchp']; ?></h4>
543
              <p><?= $resume['alertchp-desc']; ?></p>
3208 idir 544
            </div>
545
          </div>
546
        </div>
547
 
548
        <!-- Affiche le tableau récapitualif des observations ajoutées -->
549
        <div id="zone-liste-obs" class="hidden">
550
          <div class="alert alert-info">
3230 delphine 551
            <h2 class="transmission-title"><strong><?= $resume['titre']; ?> <span class="obs-nbre badge badge-info">0</span></strong></h2>
3208 idir 552
            <button id="transmettre-obs" class="btn btn-primary droite" disabled="disabled"
3230 delphine 553
              title="<?= $resume['trans-title']; ?>" type="button">
554
              <?= $resume['trans']; ?>
3208 idir 555
            </button>
556
          </div>
557
          <div id="liste-obs" ></div>
558
          <div class="row">
559
            <div class="zone-alerte">
560
              <div id="dialogue-zero-obs" class="alert alert-block hidden">
561
                <a class="close">×</a>
3230 delphine 562
                <h4 class="alert-heading"><?= $resume['alert0obs']; ?></h4>
563
                <p><?= $resume['alert0obs-desc']; ?></p>
3208 idir 564
              </div>
565
              <div id="dialogue-obs-transaction-ok" class="alert alert-success alert-block hidden">
566
                <a class="close">×</a>
3230 delphine 567
                <h4 class="alert-heading"><?= $resume['info-trans']; ?></h4>
3208 idir 568
                <div class="alert-txt"></div>
569
              </div>
570
              <div id="dialogue-obs-transaction-ko" class="alert alert-error alert-block hidden">
571
                <a class="close">×</a>
3230 delphine 572
                <h4 class="alert-heading"><?= $resume['alerttrans']; ?></h4>
3208 idir 573
                <div class="alert-txt"></div>
574
              </div>
575
            </div>
576
          </div>
577
        </div>
578
 
579
        <!-- Fenêtres modales -->
580
        <div id="chargement" class="modal-fenetre hidden">
581
          <div id="chargement-centrage" class="modal-contenu">
582
            <div class="progress progress-striped active">
583
              <div id="barre-progression-upload" class="bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="10" style="">
3230 delphine 584
                  <span class="sr-only">0/10 <?= $resume['nbobs']; ?></span>
3208 idir 585
                </div>
586
            </div>
587
            <p id="chargement-txt" style="color:white;font-size:1.5em;">
3230 delphine 588
              <?= $resume['transencours']; ?>
3208 idir 589
            </p>
590
          </div>
591
        </div>
592
 
593
        <!-- Templates HTML -->
594
        <div id="tpl-transmission-ok" class="hidden">
595
          <p class="msg">
3230 delphine 596
            <?= $resume['transok']; ?>
3208 idir 597
          </p>
598
        </div>
599
        <div id="tpl-transmission-ko" class="hidden">
600
          <p class="msg">
3230 delphine 601
            <?= $resume['transko']; ?>
3208 idir 602
          </p>
603
        </div>
604
      </div>
605
    </div>
3217 idir 606
    <div id="help-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="help-modal-label" style="display: none;" aria-hidden="true">
607
      <div class="modal-dialog modal-dialog-centered" role="document">
608
        <div class="modal-content">
609
          <div class="modal-header">
610
            <h5 class="modal-title" id="help-modal-label"></h5>
611
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
612
              <span aria-hidden="true">&times;</span>
613
            </button>
614
          </div>
615
          <div class="modal-body" id="print_content"></div>
616
          <div class="modal-footer">
617
            <button type="button" class="btn btn-secondary" data-dismiss="modal">Fermer</button>
618
          </div>
619
        </div>
620
      </div>
621
    </div>
3221 delphine 622
    <!-- carto -->
623
     <script type="text/javascript" src="<?= $url_base; ?>modules/saisie2/squelettes/js/tb-geoloc/tb-geoloc-custom-element.js"></script>
624
     <script>
625
	    var tbGeolocation = document.getElementById('tb-geolocation');
626
	    tbGeolocation.addEventListener("location", function(location) {
627
	  		console.log(location.detail);
628
	    });
629
	</script>
630
 
3208 idir 631
    <!-- Jquery -->
3217 idir 632
    <script type="text/javascript" src="https://resources.tela-botanica.org/jquery/1.11.1/jquery-1.11.1.min.js"></script>
3208 idir 633
 
634
    <!-- Jquery UI : nécessaire pour le minicalendrier et l'auto-complétion -->
635
    <script type="text/javascript" src="https://resources.tela-botanica.org/jquery/jquery-ui/1.11.0/js/jquery-ui.min.js"></script>
636
    <script type="text/javascript" src="https://resources.tela-botanica.org/jquery/jquery-ui/1.11.0/js/datepicker-fr.js"></script>
637
    <!-- Jquery Plugins -->
638
    <!-- Jquery Validate : nécessaire pour la validation des formulaires -->
639
    <script type="text/javascript" src="https://resources.tela-botanica.org/jquery/validate/1.11.1/jquery.validate.min.js"></script>
640
    <script type="text/javascript" src="https://resources.tela-botanica.org/jquery/validate/1.11.1/additional-methods.min.js"></script>
641
    <script type="text/javascript" src="https://resources.tela-botanica.org/jquery/validate/1.11.1/messages_fr.js"></script>
642
    <!-- Jquery Form :nécessaire pour l'upload des images -->
643
    <script type="text/javascript" src="https://resources.tela-botanica.org/jquery/form/3.51/jquery.form.min.js"></script>
644
    <!-- Bootstrap -->
3217 idir 645
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
3208 idir 646
    <!-- Authentification -->
647
    <script type="text/javascript" src="<?= $url_base; ?>modules/saisie2/squelettes/js/auth.js"></script>
648
    <!-- Connexion, bloc de prévisualisation, date -->
649
    <script type="text/javascript" src="<?= $url_base; ?>modules/saisie2/squelettes/js/WidgetSaisie.js"></script>
650
    <script type="text/javascript" src="<?= $url_base; ?>modules/saisie2/squelettes/js/champs-supp.js"></script>
651
    <script type="text/javascript">
652
      //<![CDATA[
653
        $( document ).ready( function() {
654
 
655
          // OMG un modèle objet !!
656
          var widget = new WidgetSaisie();
657
 
658
          //
659
          //
660
          //
661
          // La présence du parametre 'debug' dans l'URL enclenche le débogage
662
          widget.debug = <?= isset( $_GET['debug'] ) ? 'true' : 'false'; ?>;
663
          // La présence du parametre 'html5' dans l'URL enclenche les fonctions avancées HTML5
664
          widget.html5 = <?= isset($_GET['html5']) ? 'true' : 'false'; ?>;
665
          // Mot-clé du widget/projet
666
          widget.tagProjet = "WidgetSaisie";
667
          // Mots-clés à ajouter aux images
668
          widget.tagImg = "<?= isset($_GET['tag-img']) ? $_GET['tag-img'] : ''; ?>";
669
          widget.separationTagImg = "<?= isset($_GET['motcle']) && isset($_GET['tag-img']) ? ',' : ''; ?>";
670
          widget.tagImg = <?= isset($_GET['motcle']) ? "'".$_GET['motcle']."' + widget.separationTagImg + widget.tagImg" : 'widget.tagImg'; ?>;
671
          // Mots-clés à ajouter aux observations
672
          widget.tagObs = "<?= isset($_GET['tag-obs']) ? $_GET['tag-obs'] : ''; ?>";
673
          widget.separationTagObs = "<?= isset($_GET['projet']) && isset($_GET['tag-obs']) ? ',' : ''; ?>";
674
          widget.tagObs = <?= isset($_GET['projet']) ? "'".$_GET['projet']."' + widget.separationTagObs + widget.tagObs" : 'widget.tagObs'; ?>;
675
          // Précharger le formulaire avec les infos d'une observation
676
          widget.obsId = "<?=isset($_GET['id-obs']) ? $_GET['id-obs'] : ''?>";
677
          // URL du web service réalisant l'insertion des données dans la base du CEL.
678
          widget.serviceSaisieUrl = "<?=$url_ws_saisie?>";
679
          // URL du web service permettant de récupérer les infos d'une observation du CEL.
680
          widget.serviceObsUrl = "<?=$url_ws_obs?>";
681
          //
682
          //
683
          //
684
 
685
          // langue
686
          widget.langue = "<?= $widget['langue']; ?>";
687
          // Squelette d'URL du web service de l'annuaire.
688
          widget.serviceAnnuaireIdUrl = "<?= $url_ws_annuaire; ?>";
689
          // URL de l'icône du chargement en cours
690
          widget.chargementIconeUrl = "<?= $url_base?>modules/saisie/squelettes/defaut/img/icones/chargement.gif";
691
          // URL de l'icône du chargement en cours d'une image
692
          widget.chargementImageIconeUrl = "<?= $url_base?>modules/saisie/squelettes/defaut/img/icones/chargement-image.gif";
693
          // URL de l'icône du calendrier
694
          widget.calendrierIconeUrl = "<?= $url_base?>modules/saisie/squelettes/defaut/img/icones/calendrier.png";
695
          // URL de l'icône pour une photo manquante
696
          widget.pasDePhotoIconeUrl = "<?= $url_base?>modules/saisie/squelettes/defaut/img/icones/pasdephoto.png";
697
 
698
          // Code du référentiel utilisé pour les nom scientifiques.
699
          widget.nomSciReferentiel = "<?= strtolower( $widget['referentiel'] ); ?>";
700
          // Indication de la présence d'une espèce imposée
701
          widget.especeImposee = "<?= $espece_imposee; ?>";
702
          // Tableau d'informations sur l'espèce imposée
703
          widget.infosEspeceImposee = "<?= $infos_espece; ?>";
704
          // Nombre d'élément dans les listes d'auto-complétion
705
          widget.autocompletionElementsNbre = 20;
706
          // Indication de la présence d'un référentiel imposé
707
          widget.referentielImpose = "<?= $referentiel_impose; ?>";
708
 
709
          // URL du web service permettant l'auto-complétion des noms scientifiques
710
          widget.serviceAutocompletionNomSciUrl = "<?= $widget['especes']['url_ws_autocompletion_ns']; ?>?"+
711
            "masque={masque}&"+
712
            "recherche=etendue&"+
713
            "retour.champs=famille,nom_retenu,nom_retenu_complet,num_taxonomique,nom_retenu.id&"+
714
            "ns.structure=au&"+
715
            "navigation.limite=" + widget.autocompletionElementsNbre;
716
          // Squelette d'URL du web service permettant l'auto-complétion des noms scientifiques
717
          widget.serviceAutocompletionNomSciUrlTpl = "<?= $widget['especes']['url_ws_autocompletion_ns_tpl']; ?>?"+
718
            "masque={masque}&"+
719
            "recherche=etendue&"+
720
            "retour.champs=famille,nom_retenu,nom_retenu_complet,num_taxonomique,nom_retenu.id&"+
721
            "retour.tri=alpharet&"+ // tri "à la CeL"
722
            "ns.structure=au&"+
723
            "navigation.limite=" + widget.autocompletionElementsNbre;
724
          // Nombre d'observations max autorisé avant transmission
725
          widget.obsMaxNbre = 10;
726
          // Durée d'affichage en milliseconde des messages d'informations
727
          widget.dureeMessage = 30000;
728
          //
729
          //
730
          //
731
          // Squelette d'URL du web service d'eFlore fournissant les noms de communes.
732
          widget.serviceNomCommuneUrl = "https://api.tela-botanica.org/service:eflore:0.1/osm/nom-commune?lon={lon}&lat={lat}";
733
          // Squelette d'URL du web service d'eFlore fournissant les noms de communes hors de France (localisation approximative).
734
          widget.serviceNomCommuneUrlAlt = "https://api.tela-botanica.org/service:eflore:0.1/wikipedia/nom-commune?lon={lon}&lat={lat}&nbre=1";
735
          // URL du marqueur à utiliser dans la carte Google Map
736
          widget.googleMapMarqueurUrl = "<?=$url_base?>modules/saisie/squelettes/defaut/img/marqueurs/epingle.png";
737
          //
738
          //
739
          //
740
 
741
          // Initialisation du bousin
742
          widget.init();
743
        });
744
      //]]>
3230 delphine 745
		</script>
3208 idir 746
 
3230 delphine 747
		<!-- Barre de navigation -->
748
		<?php if ( $bar ): ?>
749
			<script src="<?= $url_script_navigation; ?>"></script>
750
		<?php endif; ?>
751
	</body>
3208 idir 752
</html>