Rev 3249 | Rev 3257 | 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.1.1/css/all.css" integrity="sha384-O8whS3fhG2OnA5Kas0Y9l3cfpmYjapjI0E4theH4iuMD+pLhbf6JI0jIMfYcK3yZ" crossorigin="anonymous" />
<!-- Carto -->
<link href="<?php echo $url_base; ?>modules/saisie2/squelettes/js/tb-geoloc/styles.css" rel="stylesheet" type="text/css" media="screen" />
<!-- STYLE SAISIE -->
<link href="<?php echo $url_base; ?>modules/saisie2/squelettes/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>
<?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>': '';
?>
<!-- <?php //var_dump($widget['especes']['url_ws_autocompletion_ns']); ?> -->
<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="media mb-3">
<img class="d-flex mr-3" src="<?php echo htmlspecialchars( $widget['chemin_fichiers'] . 'logo.' . preg_replace( '/(?:imag)?e\/?/','', $widget['logo'] ) ); ?>" alt="logo <?php echo $widget['projet']; ?>" width="15%" />
<div class="media-body">
<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">
<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>
<!--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
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
le javascript auth.js vient de http://svn.tela-botanica.net/websvn/filedetails.php?repname=Applications.reseau&path=%2Ftrunk%2Fresources%2Fjs%2Fnavigation.js
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-->
<!-- prod : -->
<!-- <div id="tb-navigation" data-courant="widget-cel-saisie2" data-squelette="navigation" data-mode="prod"> -->
<!-- beta (test) :-->
<div id="tb-navigation" data-courant="widget-cel-saisie2" data-squelette="navigation" data-mode="test">
<!-- dev (localhost) : -->
<!-- <div id="tb-navigation" data-courant="widget-cel-saisie2" data-squelette="navigation" data-mode="local"> -->
<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="Veuillez confirmer le courriel.">
<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 id="dialogue-geoloc-ko" class="alert alert-warning alert-block hidden">
<a class="close">×</a>
<h4 class="alert-heading"><?php echo $observateur['alertgk-title']; ?></h4>
<p><?php echo $observateur['alertgk']; ?></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="">
<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 class="col-sm-8 mb-3">
<input id="geolocalisation" name="geolocalisation" type="hidden">
<!-- retirer "ok" après test -->
<input type="hidden" id="geoloc" name="geoloc" value="ok" style="display:none">
<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">
<tb-geolocation-element id="tb-geolocation"></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" >
<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 class="control-group">
<label for="taxon" 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">
<input id="taxon" name="taxon" class="form-control" type="text">
</div>
</div>
<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">
<option value="aDeterminer" ><?php echo $observation['certADet']; ?></option>
<option value="douteuse" ><?php echo $observation['certDout']; ?></option>
<option 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" >
<?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>
<!-- 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'] . '"':'';
$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; ?>>
<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]; ?>" data-label="<?php echo $champ['name']; ?>">
<?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" data-label="<?php echo $champ['name']; ?>" data-element="<?php echo $champ['element']; ?>">
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" id="list-checkbox-<?php echo $champ['key']; ?>"<?php echo $description . $required; ?> class="form-control">
<option><?php echo $chpsupp['select-checkboxes-texte'];?></option>
</select>
<div class="overSelect"></div>
</div>
<div class="checkboxes hidden">
<?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]; ?>" data-label="<?php echo $champ['name']; ?>">
<?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" data-label="<?php echo $champ['name']; ?>" data-element="<?php echo $champ['element']; ?>">
Autre
</label>
<?php endif; ?>
<?php endforeach; ?>
</div>
</div>
</div>
<?php break;
case 'select': ?>
<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 $champ['element'] . $help; ?>">
<select name="<?php echo $champ['key']; ?>" id="<?php echo $champ['key']; ?>" class="<?php echo $champ['key']; ?> form-control"<?php echo $required; ?> data-label="<?php echo $champ['name']; ?>">
<?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; ?>>
<?php echo ucfirst( $list_value ); ?>
</option>
<?php else : ?>
<option class="other form-control is-select" value="other" data-element="<?php echo $champ['element']; ?>">Autre</option>
<?php endif; ?>
<?php endforeach; ?>
</select>
</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 .= '"></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>
<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-primary"><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-primary droite" disabled="disabled"
title="<?php echo $resume['trans-title']; ?>" type="button">
<?php echo $resume['trans']; ?>
</button>
</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>
<!-- Fenêtres modales -->
<div id="chargement" class="modal-fenetre hidden">
<div id="chargement-centrage" class="modal-contenu">
<div class="progress progress-striped active">
<div id="barre-progression-upload" class="bar" 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" style="color:white;font-size:1.5em;">
<?php echo $resume['transencours']; ?>
</p>
</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>
<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 -->
<?php if( $widget["type_localisation"] === 'point' ): ?>
<script type="text/javascript" src="<?php echo $url_base; ?>modules/saisie2/squelettes/js/tb-geoloc/tb-geoloc-lib-app.js"></script>
<script type="text/javascript" src="<?php echo $url_base; ?>modules/saisie2/squelettes/js/tb-geoloc/tb-geoloc-lib-app_inputs.js"></script>
<?php elseif ( $widget["type_localisation"] === 'rue' ) : ?>
<script type="text/javascript" src="<?php echo $url_base; ?>modules/saisie2/squelettes/js/tb-geoloc/tb-geoloc-custom-element.js"></script>
<?php endif; ?>
<script type="text/javascript">
var tbGeolocation = document.getElementById( 'tb-geolocation' );
tbGeolocation.addEventListener( 'location', function( location ) {
console.log( location.detail );
var locationDatas = location.detail;
var latitude = '';
var longitude = '';
if ( undefined !== locationDatas.geometry.features ) {// rue
latitude = ( locationDatas.geometry.features[0].geometry.coordinates[0][1] + locationDatas.geometry.features[0].geometry.coordinates[1][1]) / 2;
longitude = ( locationDatas.geometry.features[0].geometry.coordinates[0][0] + locationDatas.geometry.features[0].geometry.coordinates[1][0]) / 2;
} else if ( undefined !== locationDatas.geometry.coordinates ) {// point
latitude = locationDatas.geometry.coordinates[1];
longitude = locationDatas.geometry.coordinates[0];
}
document.getElementById('pays').value = locationDatas.osmCountry;
document.getElementById('commune-nom').value = locationDatas.locality;
// À modifier quand on recevra les codes insee
document.getElementById('commune-insee').value = locationDatas.osmPostcode;
document.getElementById('latitude').value = latitude;
document.getElementById('longitude').value = longitude;
document.getElementById('altitude').value = locationDatas.elevation;
document.getElementById('geoloc').value = 'ok';
});
</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; ?>modules/saisie2/squelettes/js/auth.js"></script>
<!-- Connexion, bloc de prévisualisation, date -->
<script type="text/javascript" src="<?php echo $url_base; ?>modules/saisie2/squelettes/js/WidgetSaisie.js"></script>
<script type="text/javascript" src="<?php echo $url_base; ?>modules/saisie2/squelettes/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; ?>modules/saisie/squelettes/defaut/img/icones/chargement.gif";
// URL de l'icône du chargement en cours d'une image
widget.chargementImageIconeUrl = "<?php echo $url_base; ?>modules/saisie/squelettes/defaut/img/icones/chargement-image.gif";
// URL de l'icône du calendrier
widget.calendrierIconeUrl = "<?php echo $url_base; ?>modules/saisie/squelettes/defaut/img/icones/calendrier.png";
// URL de l'icône pour une photo manquante
widget.pasDePhotoIconeUrl = "<?php echo $url_base; ?>modules/saisie/squelettes/defaut/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 $espece_imposee; ?>";
// Tableau d'informations sur l'espèce imposée
widget.infosEspeceImposee = "<?php echo $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 $referentiel_impose; ?>";
// 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 = 30000;
//
//
//
// 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?>modules/saisie/squelettes/defaut/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>