Rev 3269 | Rev 3273 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<!DOCTYPE html>
<html xmlns="https://www.w3.org/1999/xhtml">
<head>
<title><?php echo $widget['titre']; ?></title>
<meta charset="utf-8" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-style-type" content="text/css" />
<meta http-equiv="Content-script-type" content="text/javascript" />
<meta http-equiv="Content-language" content="fr" />
<meta name="revisit-after" content="15 days" />
<meta name="robots" content="index,follow" />
<meta name="author" content="Tela Botanica" />
<meta name="keywords" content="Tela Botanica, CEL" />
<meta name="description" content="Widgets de saisie du carnet en ligne" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, user-scalable=no" />
<!-- OpenGraph pour Facebook, Pinterest, Google+ -->
<meta property="og:type" content="website" />
<meta property="og:title" content="Widgets de saisie du CeL" />
<meta property="og:site_name" content="Tela Botanica" />
<meta property="og:description" content="Widgets de saisie du Carnet en Ligne" />
<meta property="og:image" content="https://resources.tela-botanica.org/tb/img/256x256/carre_englobant.png" />
<meta property="og:image:type" content="image/png" />
<meta property="og:image:width" content="256" />
<meta property="og:image:height" content="256" />
<meta property="og:locale" content="fr_FR" />
<!-- Favicone -->
<link rel="shortcut icon" type="image/x-icon" href="https://resources.tela-botanica.org/tb/img/16x16/favicon.ico" />
<!-- Jquery-ui custom css-->
<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" />
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous" />
<!-- Fontawesome -->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.1/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous">
<!-- Carto -->
<link href="<?php echo $url_base; ?>js/tb-geoloc/styles.css" rel="stylesheet" type="text/css" media="screen" />
<!-- STYLE SAISIE -->
<link href="<?php echo $url_base; ?>css/saisie.css" rel="stylesheet" type="text/css" media="screen" />
<!-- Google Analytics -->
<?php if( $prod ): ?>
<?php include "analytics.html"; ?>
<?php endif; ?>
<!-- <link rel="icon" type="image/x-icon" href="favicon.ico" /> -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
</head>
<body id="top" data-sq="<?php echo $url_base; ?>">
<?php
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>': '';
?>
<div id="zone-appli" class="container" data-projet="<?php echo $widget['projet']; ?>" data-url-fichiers="<?php echo $widget['chemin_fichiers']; ?>">
<div class="layout-wrapper page">
<div class="row mb-3">
<div class="col-md-2 col-sm-10">
<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']; ?>" />
</div>
<div class="col-md-10 col-sm-12">
<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>
</div>
</div>
<div class="row mb-3">
<div class="col-md-6">
<div id="description"><?php echo $widget['description']; ?></div>
</div>
<div class="col-md-6">
<div id="aide" class="well well-lg hidden-sm-down">
<h3><?php echo $aide['titre']; ?></h3>
<div id="aide-txt" class="hiden-sm-down">
<p><?php echo $aide['description']; ?></p>
</div>
</div>
</div>
</div>
<div id="formulaire" class="row mb-3 bloc-top">
<form id="form-observateur" role="form" autocomplete="on">
<h2><?php echo $observateur['titre']; ?></h2>
<div id="tb-observateur" data-mode="<?php echo $conf_mode; ?>">
<div class="navbar-default mb-3" id="tb-navbar">
<div class="nav navbar-nav navbar-right row">
<div id="bouton-connexion" class="volet col-md-6 col-sm-8">
<label for="bouton-connexion"><?php echo $observateur['compte']; ?></label>
<a id="connexion" href="<?php echo $authTpl; ?>" class="btn btn-success mr-1 mb-1" taget="_blank"><?php echo $observateur['connexion']; ?></a>
<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>
</div>
<div id="creation-compte" class="volet col-md-6 col-sm-8">
<label for="creation-compte"><?php echo $observateur['noninscription']; ?></label>
<a id="bouton-anonyme" href="#" class="btn btn-info mr-1 mb-1"><?php echo $observateur['nonconnexion']; ?></a>
</div>
<div id="utilisateur-connecte" class="volet hidden">
<label for="utilisateur-connecte"><?php echo $observateur['bienvenue']; ?></label>
<a href="#" class="list-tool btn btn-large btn-primary volet-toggle" data-toggle="volet">
<span id="nom-complet"></span> <!-- <i class="fas fa-caret-down"></i> -->
</a>
<div class="volet-menu hidden">
<div id="profil-utilisateur">
<a href="https://beta.tela-botanica.org/test/inscription" taget="_blank"><?php echo $observateur['profil']; ?></a>
</div>
<div id="deconnexion"><a href="#"><?php echo $observateur['deconnexion']; ?></a></div>
</div>
</div>
</div>
</div>
</div>
<div id="anonyme" class="mb-3 hidden">
<div id="zone-courriel" class="row">
<div class="control-group col-md-6">
<label for="courriel" class="col-sm-8 obligatoire" title="<?php echo $observateur['courriel-title']; ?>">
<i class="fa fa-envelope" aria-hidden="true"></i>
<?php echo $observateur['courriel']; ?>
</label>
<div class="col-sm-8 mb-3">
<input id="courriel" name="courriel" class="form-control" type="email" title="<?php echo $observateur['courriel-title']; ?> ">
<input id="id_utilisateur" name="id_utilisateur" type="hidden">
</div>
</div>
<div id="zone-courriel-confirmation" class="control-group col-md-6 hidden">
<label for="courriel_confirmation" class="col-sm-8 obligatoire" title="<?php echo $observateur['courriel-confirmation-title']; ?>">
<i class="fa fa-envelope" aria-hidden="true"></i>
<?php echo $observateur['courriel-confirmation']; ?>
</label>
<div class="col-sm-8">
<input id="courriel_confirmation" name="courriel_confirmation" class="form-control" type="email">
</div>
</div>
</div>
<div id="zone-prenom-nom" class="row hidden">
<div class="control-group col-md-6">
<label for="prenom" class="col-sm-8">
<i class="fa fa-user" aria-hidden="true"></i>
<?php echo $observateur['prenom']; ?>
</label>
<div class="input-group col-sm-8">
<input id="prenom" name="prenom" class="form-control" type="text">
</div>
</div>
<div class="control-group col-md-6">
<label for="nom" class="col-sm-8">
<i class="fa fa-user" aria-hidden="true"></i>
<?php echo $observateur['nom']; ?>
</label>
<div class="input-group col-sm-8">
<input id="nom" name="nom" class="form-control" type="text">
</div>
</div>
</div>
</div>
</form>
<!-- Messages d'erreur du formulaire-->
<div class="zone-alerte">
<div id="dialogue-bloquer-copier-coller" class="alert alert-info alert-block hidden">
<a class="close">×</a>
<h4 class="alert-heading"><?php echo $observateur['alertcc-title']; ?></h4>
<p><?php echo $observateur['alertcc']; ?></p>
</div>
<div id="dialogue-utilisateur-non-identifie" class="alert alert-warning alert-block hidden">
<a class="close">×</a>
<h4 class="alert-heading"><?php echo $observateur['alertni-title']; ?></h4>
<p><?php echo $observateur['alertni']; ?></p>
</div>
</div>
<form id="form-observation" role="form" autocomplete="on" class="bloc-top">
<h2><?php echo $observation['titre']; ?></h2>
<div id="zone-observation" class="row">
<div class="col-md-6">
<div class="mb-3">
<label for="geolocalisation" class="col-sm-8 obligatoire" title="<?php echo $observateur['courriel-title']; ?>">
<i class="fa fa-street-view" aria-hidden="true"></i>
<?php echo $observation['geolocalisation']; ?>
</label>
<div id="geoloc-datas">
<input type="hidden" id="pays" name="pays" value="" style="display:none">
<input type="hidden" id="commune-nom" name="commune-nom" value="" style="display:none">
<input type="hidden" id="latitude" name="latitude" value="0.00000" style="display:none">
<input type="hidden" id="longitude" name="longitude" value="0.00000" style="display:none">
<input type="hidden" id="commune-insee" name="commune-insee" value="" style="display:none">
<input type="hidden" id="altitude" name="altitude" value="" style="display:none">
</div>
<div class="col-sm-8">
<tb-geolocation-element
id="tb-geolocation"
layer='osm'
zoom_init="4"
lat_init="46.5"
lng_init="2.9"
marker="<?php echo ( $widget['type_localisation'] === 'point' ) ? 'true' : 'false' ;?>"
polyline="<?php echo ( $widget['type_localisation'] === 'rue' ) ? 'true' : 'false' ;?>"
polygon="false"
show_lat_lng_elevation_inputs="<?php echo ( $widget['type_localisation'] === 'point' ) ? 'true' : 'false' ;?>"
osm_class_filter=""
elevation_provider="mapquest"
map_quest_api_key="mG6oU5clZHRHrOSnAV0QboFI7ahnGg34"
>
</tb-geolocation-element>
</div>
</div>
<div class="control-group">
<label for="lieudit" class="col-sm-8" title="">
<i class="fa fa-map-signs" aria-hidden="true"></i>
<?php echo $observation['lieudit']; ?>
</label>
<div class="col-sm-8 mb-3">
<input type="text" id="lieudit" name="lieudit" class="form-control">
</div>
</div>
<div class="control-group">
<label for="station" class="col-sm-8" title="">
<i class="fa fa-map-marker" aria-hidden="true"></i>
<?php echo $observation['station']; ?>
</label>
<div class="col-sm-8 mb-3">
<input type="text" id="station" name="station" class="form-control">
</div>
</div>
</div>
<div class="col-md-6">
<div class="control-group">
<label for="date_releve" class="col-sm-8 obligatoire" title="">
<i class="fa fa-calendar" aria-hidden="true"></i>
<?php echo $observation['date']; ?>
</label>
<div class="col-sm-8 mb-3">
<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>
</div>
</div>
<?php if( ( $widget['type_especes'] === 'referentiel' || empty( $widget['type_especes'] ) ) && empty( $widget['referentiel'] ) ) : ?>
<div class="control-group">
<label for="referentiel" class="col-sm-8 obligatoire" title="">
<i class="fa fa-book" aria-hidden="true"></i>
<?php echo $observation['referentiel']; ?>
</label>
<div class="col-sm-8 mb-3">
<select id="referentiel" class="form-control custom-select" >
<option class="choisir" value="" selected hidden><?php echo $general['choisir']; ?></option>
<option value="bdtfxr" selected="selected" title="Trachéophytes de France métropolitaine">Métropole (index réduit)</option>
<option value="bdtfx" title="Trachéophytes de France métropolitaine">Métropole (BDTFX)</option>
<option value="bdtxa" title="Trachéophytes des Antilles">Antilles françaises (BDTXA)</option>
<option value="bdtre" title="Trachéophytes de La Réunion">Réunion (BDTRE)</option>
<option value="aublet" title="Guyane">Guyane (AUBLET2)</option>
<option value="florical" title="Nouvelle-Calédonie">Nouvelle-Calédonie (FLORICAL)</option>
<option value="isfan" title="Afrique du Nord">Afrique du Nord (ISFAN)</option>
<option value="apd" title="Afrique de l'Ouest et du Centre">Afrique de l'Ouest et du Centre (APD)</option>
<option value="lbf" title="Liban">Liban (LBF)</option>
<option value="autre" title="Autre/Inconnu">Autre/Inconnu</option>
</select>
</div>
</div>
<?php else : ?>
<input id="referentiel" name="referentiel" value="<?php echo $widget['referentiel']; ?>" type="hidden">
<?php endif; ?>
<div id="bloc-taxon" class="control-group">
<?php $isTaxonListe = ( isset( $widget['especes']['taxons'] ) && count( (array) $widget['especes']['taxons'] ) > 0 ) ;?>
<label for="<?php echo ( !$isTaxonListe ) ? 'taxon' : 'taxon-liste';?>" class="col-sm-8" title="">
<i class="fa fa-leaf" aria-hidden="true"></i>
<?php echo $observation['espece']; ?><?php if ( !empty( $widget['referentiel'] ) ) echo " (" . $widget['referentiel'] . ")"; ?>
</label>
<div class="col-sm-8 mb-3">
<?php if ( $widget['type_especes'] === 'fixe' || $widget['especes']['espece_imposee'] ) : ?>
<input id="taxon" name="taxon" type="text" class="form-control taxon-validation" title"" value="<?php echo $widget['especes']['nom_sci_espece_defaut']; ?>"/>
</div>
</div>
<?php elseif ( isset( $widget['especes']['taxons'] ) && count( (array) $widget['especes']['taxons'] ) > 0 ) : ?>
<?php ksort( $widget['especes']['taxons'] ); ?>
<select id="taxon-liste" name="taxon-liste" class="form-control custom-select taxon-validation" title="<?php echo $observation['taxon-title'];?>">
<option class="choisir" value="inconnue" selected hidden><?php echo $general['choisir']; ?></option>
<?php foreach ($widget['especes']['taxons'] as $taxon) : ?>
<option
class="nom-sci"
value="<?php echo $taxon['nom_sel'];?>"
title="<?php echo $taxon['nom_fr'];?>"
data-num-nom-sel="<?php echo $taxon['num_nom_sel'];?>"
data-nom-ret="<?php echo $taxon['nom_ret'];?>"
data-num-nom-ret="<?php echo $taxon['num_nom_ret'];?>"
data-nt="<?php echo $taxon['num_taxon'];?>"
data-famille="<?php echo $taxon['famille'];?>"
><?php echo $taxon['nom_sel'];?></option>
<?php endforeach; ?>
<option value="autre"><?php echo $observation['autre-espece']; ?></option>
</select>
<span for="taxon-liste" class="error" style="display: none;"><?php echo $observation['taxon-title'];?></span>
<input id="taxon" name="taxon" class="form-control" type="hidden" />
</div>
</div>
<div id="taxon-input-groupe" class="control-group hidden">
<label for="taxon-autre" class="col-sm-8" title="">
<i class="fab fa-pagelines" aria-hidden="true"></i>
<?php echo $observation['autre-espece']; ?>
</label>
<div class="col-sm-8 mb-3">
<input id="taxon-autre" name="taxon-autre" class="form-control" type="text">
</div>
</div>
<?php else : ?>
<input id="taxon" name="taxon" class="form-control taxon-validation" type="text" title="<?php echo $observation['taxon-title'];?>">
<span for="taxon" class="error" style="display: none;"><?php echo $observation['taxon-title'];?></span>
</div>
</div>
<?php endif; ?>
<div class="control-group">
<label for="certitude" class="col-sm-8 obligatoire" title="">
<i class="fa fa-question" aria-hidden="true"></i>
<?php echo $observation['certitude']; ?>
</label>
<div class="col-sm-8 mb-3">
<select id="certitude" name="certitude" class="form-control custom-select">
<option class="aDeterminer" value="à determiner" ><?php echo $observation['certADet']; ?></option>
<option class="douteuse" value="douteuse" ><?php echo $observation['certDout']; ?></option>
<option class="certaine" value="certaine" selected="selected" ><?php echo $observation['certCert']; ?></option>
</select>
</div>
</div>
<div class="">
<label for="milieu" class="col-sm-8">
<i class="fa fa-street-view" aria-hidden="true"></i>
<?php echo $observation['milieu']; ?>
</label>
<div class="col-sm-8 mb-3">
<?php if ( 0 < count( (array) $widget['milieux'] ) ) :?>
<select id="milieu" class="form-control custom-select" >
<option class="choisir" value="" selected hidden><?php echo $general['choisir']; ?></option>
<?php foreach ( $widget['milieux'] as $milieu ) :?>
<option value="<?php echo $milieu; ?>"><?php echo $milieu; ?></option>
<?php endforeach; ?>
</select>
<?php else : ?>
<input id="milieu" name="milieu" class="form-control" type="text" placeholder="<?php echo $observation['milieu-ph']; ?>">
<?php endif; ?>
</div>
</div>
<div class="">
<label for="notes" class="col-sm-8" title="">
<i class="fa fa-pen" aria-hidden="true"></i>
<?php echo $observation['notes']; ?>
</label>
<div class="col-sm-8 mb-3">
<textarea id="notes" form="form-observation" class="col-md-12" rows="7" name="notes" placeholder="<?php echo $observation['notes_ph']; ?>"></textarea>
</div>
</div>
</div>
</div>
</form>
<!-- Messages d'erreur du formulaire-->
<div class="zone-alerte">
<div id="dialogue-geoloc-ko" class="alert alert-warning alert-block hidden">
<a class="close">×</a>
<h4 class="alert-heading"><?php echo $observation['alertgk-title']; ?></h4>
<p><?php echo $observation['alertgk']; ?></p>
</div>
<div id="dialogue-taxon-or-image" class="alert alert-warning alert-block hidden">
<a class="close">×</a>
<h4 class="alert-heading"><?php echo $observation['alert-img-tax-title']; ?></h4>
<p><?php echo $observation['alert-img-tax']; ?></p>
</div>
</div>
<!-- Champs supplémentaires -->
<?php if ( isset($widget['chpSupp'] ) && 0 < count( (array) $widget['chpSupp'] ) ) : ?>
<form id="form-supp" class="bloc-top" role="form" autocomplete="on">
<h2><?php echo $chpsupp['titre']; ?></h2>
<div id="zone-supp" class="row">
<div class="col-md-6">
<?php foreach( $widget['chpSupp'][ $widget['projet'] ]['champs-supp'] as $champ ) : ?>
<?php
$min = ( isset( $champ['fieldValues']['min'] ) )? ' min="' . $champ['fieldValues']['min'] . '"':'';
$max = ( isset( $champ['fieldValues']['max'] ) )? ' max="' . $champ['fieldValues']['max'] . '"':'';
$step = ( isset( $champ['fieldValues']['step'] ) )? ' step="' . $champ['fieldValues']['step'] . '"':'';
$default = ( isset( $champ['fieldValues']['default'] ) )? ' value="' . $champ['fieldValues']['default'] . '" data-default="' . $champ['fieldValues']['default'] . '"' :'';
$description = ( isset( $champ['description'] ) )? ' title="' . $champ['description'] . '"':'';
$placeholder = ( isset( $champ['fieldValues']['placeholder'] ) )? ' placeholder="' . $champ['fieldValues']['placeholder'] . '"':'';
$required = '';
$mandatory = '';
$pattern = '';
$obs_radio = '';
$help = '';
$help_button = '';
if( $champ['help'] ) {
$help = ' and-help';
$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>';
}
if( $champ['mandatory'] ) {
// Attr required
$required = ' required';
// class="obligatoire"
$mandatory = ' obligatoire';
}
switch( $champ['element'] ) {
case 'radio':
case 'checkbox': ?>
<div class="control-group <?php echo $champ['element']; ?> mb-3"<?php echo $description . $required; ?> data-name="<?php echo $champ['key']; ?>[]">
<div class="col-sm-8 list-label<?php echo $help . $mandatory; ?>">
<?php echo $champ['name'] . $help_button; ?>
</div>
<div class="col-sm-8">
<?php foreach ( $champ['fieldValues']['listValue'] as $i => $list_value ) : ?>
<?php
$checked = '';
if ( '#' === substr( $list_value, -1 ) ) :
$checked = ' checked';
$list_value = substr( $list_value, 0, -1 );
endif;
?>
<?php if( 'other' !== $list_value ) : ?>
<label for="<?php echo $champ['fieldValues']['cleanListValue'][$i]; ?>" class="<?php echo $champ['fieldValues']['cleanListValue'][$i]; ?>">
<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']; ?>">
<?php echo $list_value; ?>
</label>
<?php else : ?>
<label for="other-<?php echo $champ['key']; ?>">
<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']; ?>">
Autre
</label>
<?php endif; ?>
<?php endforeach; ?>
</div>
</div>
<?php break;
case 'list-checkbox': ?>
<div class="multiselect <?php echo $champ['element'] . $help; ?>">
<label class="col-sm-8<?php echo $mandatory; ?>" title="<?php echo $chpsupp['select-checkboxes-texte'];?>"><?php echo $champ['name'] . $help_button; ?></label>
<div class="control-group col-sm-8 mb-3">
<div class="selectBox">
<select class="form-control list-checkbox custom-select" id="list-checkbox-<?php echo $champ['key']; ?>"<?php echo $description; ?> class="form-control">
<option><?php echo $chpsupp['select-checkboxes-texte'];?></option>
</select>
<div class="overSelect"></div>
</div>
<div class="checkboxes hidden" <?php echo $required; ?> data-name="<?php echo $champ['key']; ?>[]">
<?php foreach ( $champ['fieldValues']['listValue'] as $i => $list_value ) : ?>
<?php
$checked = '';
if ( '#' === substr( $list_value, -1 ) ) :
$checked = ' checked';
$list_value = substr( $list_value, 0, -1 );
endif;
?>
<?php if( 'other' !== $list_value ) : ?>
<label for="<?php echo $champ['fieldValues']['cleanListValue'][$i]; ?>">
<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']; ?>">
<?php echo $list_value; ?>
</label>
<?php else : ?>
<label for="other-<?php echo $champ['key']; ?>">
<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']; ?>">
Autre
</label>
<?php endif; ?>
<?php endforeach; ?>
</div>
</div>
</div>
<?php break;
case 'select': ?>
<div class="control-group mb-3">
<label for="<?php echo $champ['key']; ?>" class="col-sm-8<?php echo $mandatory; ?>"<?php echo $description; ?>><?php echo $champ['name'] . $help_button; ?></label>
<div class="champ col-sm-8 mb-3">
<div class="select-wrapper add-field-select <?php echo $help; ?>">
<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']; ?>">
<?php foreach ( $champ['fieldValues']['listValue'] as $list_value ) : ?>
<?php
$selected = '';
if ( '#' === substr( $list_value, -1 ) ) :
$selected = ' selected="selected"';
$list_value = substr( $list_value, 0, -1 );
endif;
?>
<?php if( 'other' !== $list_value ) : ?>
<option value="<?php echo $list_value; ?>"<?php echo $selected; ?> data-name="<?php echo $champ['key']; ?>">
<?php echo ucfirst( $list_value ); ?>
</option>
<?php else : ?>
<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>
<?php endif; ?>
<?php endforeach; ?>
</select>
</div>
</div>
</div>
<?php break;
case 'textarea': ?>
<div class="control-group">
<label for="<?php echo $champ['key']; ?>" class="col-sm-8<?php echo $help . $mandatory; ?>" <?php echo $description; ?>><?php echo $champ['name'] . $help_button; ?></label>
<div class="col-sm-8 mb-3">
<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>
</div>
</div>
<?php break;
case 'range': ?>
<div class="control-group">
<label for="<?php echo $champ['key']; ?>" class="col-sm-8<?php echo $help . $mandatory; ?>" <?php echo $description; ?>><?php echo $champ['name'] . $help_button; ?></label>
<div class="col-sm-8 mb-3 row">
<?php
$div_range_min_max = '';
if ( isset( $champ['fieldValues']['min'] ) ) {
$div_range_min_max =
"<p class=\"col-sm-2 range-values text-center font-weight-bold\">".
"Min " . $champ['fieldValues']['min'] .
"</p>";
}
$div_range_min_max .= '<div class="range-live-value range-values text-center font-weight-bold col-sm-';
if ( isset( $champ['fieldValues']['min'] ) && isset( $champ['fieldValues']['max'] ) ) {
$div_range_min_max .= '8';
} elseif ( isset( $champ['fieldValues']['min'] ) || isset( $champ['fieldValues']['max'] ) ) {
$div_range_min_max .= '10';
} else {
$div_range_min_max .= '12';
}
$div_range_min_max .= '" onload="this.innerText = document.getElementById('ajouter-obs').value"></div>';
if( isset( $champ['fieldValues']['max'] ) ) {
$div_range_min_max .=
"<p class=\"col-sm-2 range-values text-center font-weight-bold\">".
"Max " . $champ['fieldValues']['max'] .
"</p>";
}
echo $div_range_min_max;
?>
<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']; ?>">
</div>
</div>
<?php break;
case 'number':
case 'date': ?>
<div class="control-group">
<label for="<?php echo $champ['key']; ?>" class="col-sm-8<?php echo $mandatory; ?>" <?php echo $description; ?>><?php echo $champ['name'] . $help_button; ?></label>
<div class="col-sm-8 mb-3">
<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']; ?>">
</div>
</div>
<?php break;
case 'text' :
case 'email':
default: ?>
<div class="control-group">
<label for="<?php echo $champ['key']; ?>" class="col-sm-8<?php echo $mandatory; ?>" <?php echo $description; ?>><?php echo $champ['name'] . $help_button; ?></label>
<div class="col-sm-8 mb-3">
<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']; ?>">
</div>
</div>
<?php break;
}
?>
<?php endforeach; ?>
</div>
</div>
</form>
<?php endif; ?><!-- Fin champs supplémentaires -->
<form id="form-upload" class="form-horizontal bloc-top" action="<?php echo $url_ws_upload ?>" method="post" enctype="multipart/form-data">
<h2><?php echo $image['titre']; ?></h2>
<p class="miniature-info" class="discretion help-inline">
<?php echo $image['aide']; ?>
</p>
<div id ="photos-conteneur" class="control-group">
<div>
<label for="fichier" class="label-file btn btn-large btn-info mb-3">
<span class="label-text"><i class="fas fa-download"></i> <?php echo $image['ajouter']; ?></span>
<input type="file" id="fichier" name="fichier" class="input-file" accept="image/jpeg" multiple>
<input type="hidden" name="MAX_FILE_SIZE" value="5242880">
</label>
</div>
<span for="fichier" class="error" style="display: none;"><?php echo $observation['taxon-title'];?></span>
<div id="miniatures"></div>
<p class="miniature-msg" class="span12"> </p>
</div>
</form>
<div id="image" class="row"></div>
</div>
<!-- Bouton cr&ation d'une obs -->
<div class="row mb-3">
<div class="centre" title="<?php echo $resume['creer-title']; ?>">
<button id="ajouter-obs" class="btn btn-success"><i class="fas fa-check-square"></i> <?php echo $resume['creer']; ?></button>
</div>
</div>
<!-- Messages d'erreur du formulaire-->
<div class="row">
<div class="zone-alerte">
<div id="dialogue-bloquer-creer-obs" class="alert alert-warning alert-block hidden">
<a class="close">×</a>
<h4 class="alert-heading"><?php echo $resume['alert10max']; ?></h4>
<p><?php echo $resume['alert10max-desc']; ?></p>
</div>
</div>
<div class="zone-alerte">
<div id="dialogue-form-invalide" class="alert alert-warning alert-block hidden">
<a class="close">×</a>
<h4 class="alert-heading"><?php echo $resume['alertchp']; ?></h4>
<p><?php echo $resume['alertchp-desc']; ?></p>
</div>
</div>
</div>
<!-- Affiche le tableau récapitualif des observations ajoutées -->
<div id="zone-liste-obs" class="bloc-top hidden">
<div class="alert alert-info">
<h2 class="transmission-title"><strong><?php echo $resume['titre']; ?> <span class="obs-nbre badge badge-info">0</span></strong></h2>
<button id="transmettre-obs" class="btn btn-success droite" disabled="disabled"
title="<?php echo $resume['trans-title']; ?>" type="button">
<?php echo $resume['trans']; ?>
</button>
</div>
<!-- chargement -->
<div id="chargement" class="modal-fenetre hidden">
<div id="chargement-centrage" class="modal-contenu">
<div class="progress active">
<div id="barre-progression-upload" class="progress-bar progress-bar-striped" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="10" style="">
<span class="sr-only">0/10 <?php echo $resume['nbobs']; ?></span>
</div>
</div>
<p id="chargement-txt"><?php echo $resume['transencours']; ?></p>
</div>
</div>
<div id="liste-obs" ></div>
<div class="row">
<div class="zone-alerte">
<div id="dialogue-zero-obs" class="alert alert-block hidden">
<a class="close">×</a>
<h4 class="alert-heading"><?php echo $resume['alert0obs']; ?></h4>
<p><?php echo $resume['alert0obs-desc']; ?></p>
</div>
<div id="dialogue-obs-transaction-ok" class="alert alert-success alert-block hidden">
<a class="close">×</a>
<h4 class="alert-heading"><?php echo $resume['info-trans']; ?></h4>
<div class="alert-txt"></div>
</div>
<div id="dialogue-obs-transaction-ko" class="alert alert-error alert-block hidden">
<a class="close">×</a>
<h4 class="alert-heading"><?php echo $resume['alerttrans']; ?></h4>
<div class="alert-txt"></div>
</div>
</div>
</div>
</div>
<!-- Templates HTML -->
<div id="tpl-transmission-ok" class="hidden">
<p class="msg"><?php echo $resume['transok']; ?></p>
</div>
<div id="tpl-transmission-ko" class="hidden">
<p class="msg"><?php echo $resume['transko']; ?></p>
</div>
</div>
</div>
<!-- Modales Aide -->
<div id="help-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="help-modal-label" style="display: none;" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="help-modal-label"></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body" id="print_content"></div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Fermer</button>
</div>
</div>
</div>
</div>
<!-- carto -->
<script type="text/javascript" src="<?php echo $url_base; ?>js/tb-geoloc/tb-geoloc-lib-app.js"></script>
<script type="text/javascript">
var tbGeolocation = document.getElementById( 'tb-geolocation' );
tbGeolocation.addEventListener( 'location', function( location ) {
console.log( location.detail );
var secVal = location.detail.geometry.coordinates[1],
firstVal = location.detail.geometry.coordinates[0],
latitude = '',
longitude = '';
if ( 'object' === typeof secVal && 'object' === typeof firstVal ) {// rue
latitude = ( ( firstVal[1] + secVal[1] ) / 2 ).toFixed( 6 );
longitude = ( ( firstVal[0] + secVal[0] ) / 2 ).toFixed( 6 );
} else if ( 'number' === typeof secVal && 'number' === typeof firstVal ) {// point
latitude = secVal;
longitude = firstVal;
}
document.getElementById( 'latitude' ).value = latitude;
document.getElementById( 'longitude' ).value = longitude;
document.getElementById( 'pays' ).value = location.detail.osmCountry;
document.getElementById( 'commune-nom' ).value = location.detail.inseeData.nom;
document.getElementById( 'commune-insee' ).value = location.detail.inseeData.code;
document.getElementById( 'altitude' ).value = location.detail.elevation;
});
</script>
<!-- Jquery -->
<script type="text/javascript" src="https://resources.tela-botanica.org/jquery/1.11.1/jquery-1.11.1.min.js"></script>
<!-- Jquery UI : nécessaire pour le minicalendrier et l'auto-complétion -->
<script type="text/javascript" src="https://resources.tela-botanica.org/jquery/jquery-ui/1.11.0/js/jquery-ui.min.js"></script>
<!-- <script type="text/javascript" src="https://resources.tela-botanica.org/jquery/jquery-ui/1.11.0/js/datepicker-fr.js"></script> -->
<!-- Jquery Plugins -->
<!-- Jquery Validate : nécessaire pour la validation des formulaires -->
<script type="text/javascript" src="https://resources.tela-botanica.org/jquery/validate/1.11.1/jquery.validate.min.js"></script>
<script type="text/javascript" src="https://resources.tela-botanica.org/jquery/validate/1.11.1/additional-methods.min.js"></script>
<script type="text/javascript" src="https://resources.tela-botanica.org/jquery/validate/1.11.1/messages_fr.js"></script>
<!-- Jquery Form :nécessaire pour l'upload des images -->
<script type="text/javascript" src="https://resources.tela-botanica.org/jquery/form/3.51/jquery.form.min.js"></script>
<!-- Bootstrap -->
<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>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
<!-- Authentification -->
<script type="text/javascript" src="<?php echo $url_base; ?>js/auth.js"></script>
<!-- Connexion, bloc de prévisualisation, date -->
<script type="text/javascript" src="<?php echo $url_base; ?>js/WidgetSaisie.js"></script>
<script type="text/javascript" src="<?php echo $url_base; ?>js/champs-supp.js"></script>
<script type="text/javascript">
//<![CDATA[
$( document ).ready( function() {
// OMG un modèle objet !!
var widget = new WidgetSaisie();
//
//
//
// La présence du parametre 'debug' dans l'URL enclenche le débogage
widget.debug = <?php echo isset( $_GET['debug'] ) ? 'true' : 'false'; ?>;
// La présence du parametre 'html5' dans l'URL enclenche les fonctions avancées HTML5
widget.html5 = <?php echo isset($_GET['html5']) ? 'true' : 'false'; ?>;
// Mot-clé du widget/projet
widget.tagProjet = "WidgetSaisie";
// Mots-clés à ajouter aux images
widget.tagImg = "<?php echo isset($_GET['tag-img']) ? $_GET['tag-img'] : ''; ?>";
widget.separationTagImg = "<?php echo isset($_GET['motcle']) && isset($_GET['tag-img']) ? ',' : ''; ?>";
widget.tagImg = <?php echo isset($_GET['motcle']) ? "'".$_GET['motcle']."' + widget.separationTagImg + widget.tagImg" : 'widget.tagImg'; ?>;
// Mots-clés à ajouter aux observations
widget.tagObs = "<?php echo isset($_GET['tag-obs']) ? $_GET['tag-obs'] : ''; ?>";
widget.separationTagObs = "<?php echo isset($_GET['projet']) && isset($_GET['tag-obs']) ? ',' : ''; ?>";
widget.tagObs = <?php echo isset($_GET['projet']) ? "'".$_GET['projet']."' + widget.separationTagObs + widget.tagObs" : 'widget.tagObs'; ?>;
// Précharger le formulaire avec les infos d'une observation
widget.obsId = "<?php echo isset($_GET['id-obs']) ? $_GET['id-obs'] : ''; ?>";
// URL du web service réalisant l'insertion des données dans la base du CEL.
widget.serviceSaisieUrl = "<?php echo $url_ws_saisie; ?>";
// URL du web service permettant de récupérer les infos d'une observation du CEL.
widget.serviceObsUrl = "<?php echo $url_ws_obs; ?>";
//
//
//
// langue
widget.langue = "<?php echo $widget['langue']; ?>";
// Squelette d'URL du web service de l'annuaire.
widget.serviceAnnuaireIdUrl = "<?php echo $url_ws_annuaire; ?>";
// URL de l'icône du chargement en cours
widget.chargementIconeUrl = "<?php echo $url_base; ?>img/icones/chargement.gif";
// URL de l'icône du chargement en cours d'une image
widget.chargementImageIconeUrl = "<?php echo $url_base; ?>img/icones/chargement-image.gif";
// URL de l'icône du calendrier
widget.calendrierIconeUrl = "<?php echo $url_base; ?>img/icones/calendrier.png";
// URL de l'icône pour une photo manquante
widget.pasDePhotoIconeUrl = "<?php echo $url_base; ?>img/icones/pasdephoto.png";
// Code du référentiel utilisé pour les nom scientifiques.
widget.nomSciReferentiel = "<?php echo ( !empty( $widget['referentiel'] ) ) ? strtolower( $widget['referentiel'] ) : 'bdtfxr'; ?>";
// Indication de la présence d'une espèce imposée
widget.especeImposee = "<?php echo $widget['especes']['espece_imposee']; ?>";
// Tableau d'informations sur l'espèce imposée
widget.infosEspeceImposee = "<?php echo $widget['especes']['infos_espece']; ?>";
// Nombre d'élément dans les listes d'auto-complétion
widget.autocompletionElementsNbre = 20;
// Indication de la présence d'un référentiel imposé
widget.referentielImpose = "<?php echo ( !empty( $widget['referentiel'] ) ) ? strtolower( $widget['referentiel'] ) : 'bdtfxr'; ?>";
// #taxon est une liste
widget.isTaxonListe = <?php echo ( isset( $widget['especes']['taxons'] ) && count( (array) $widget['especes']['taxons'] ) )? 'true' : 'false' ; ?>;
// URL du web service permettant l'auto-complétion des noms scientifiques
widget.serviceAutocompletionNomSciUrl = "<?php echo $widget['especes']['url_ws_autocompletion_ns']; ?>?"+
"masque={masque}&"+
"recherche=etendue&"+
"retour.champs=famille,nom_retenu,nom_retenu_complet,num_taxonomique,nom_retenu.id&"+
"ns.structure=au&"+
"navigation.limite=" + widget.autocompletionElementsNbre;
// Squelette d'URL du web service permettant l'auto-complétion des noms scientifiques
widget.serviceAutocompletionNomSciUrlTpl = "<?php echo $widget['especes']['url_ws_autocompletion_ns_tpl']; ?>?"+
"masque={masque}&"+
"recherche=etendue&"+
"retour.champs=famille,nom_retenu,nom_retenu_complet,num_taxonomique,nom_retenu.id&"+
"retour.tri=alpharet&"+ // tri "à la CeL"
"ns.structure=au&"+
"navigation.limite=" + widget.autocompletionElementsNbre;
// Nombre d'observations max autorisé avant transmission
widget.obsMaxNbre = 10;
// Durée d'affichage en milliseconde des messages d'informations
widget.dureeMessage = 10000;
//
//
//
// Squelette d'URL du web service d'eFlore fournissant les noms de communes.
widget.serviceNomCommuneUrl = "https://api.tela-botanica.org/service:eflore:0.1/osm/nom-commune?lon={lon}&lat={lat}";
// Squelette d'URL du web service d'eFlore fournissant les noms de communes hors de France (localisation approximative).
widget.serviceNomCommuneUrlAlt = "https://api.tela-botanica.org/service:eflore:0.1/wikipedia/nom-commune?lon={lon}&lat={lat}&nbre=1";
// URL du marqueur à utiliser dans la carte Google Map
widget.googleMapMarqueurUrl = "<?php echo $url_base; ?>img/marqueurs/epingle.png";
//
//
//
// Initialisation du bousin
widget.init();
});
//]]>
</script>
<!-- Barre de navigation -->
<?php if ( $bar ): ?>
<script src="<?php echo $url_script_navigation; ?>"></script>
<?php endif; ?>
</body>
</html>