Subversion Repositories eFlore/Applications.cel

Rev

Rev 3320 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<form id="form-observation" role="form" autocomplete="on">
        <h2><?php echo $observation['titre-obs']; ?></h2>
        <div id="zone-observation" class="row">
                <div class="col-md-6">

                        <div class="mb-3">
                                <label class="col-sm-8 obligatoire has-tooltip" data-toggle="tooltip" title="<?php echo $observateur['geoloc-title']; ?>">
                                        <i class="fa fa-map" aria-hidden="true"></i>
                                        <?php echo $observation['lieu-releve']; ?>
                                </label>
                                <div class="control-group">
                                        <div id="geoloc" class="col-sm-8 geoloc">
                                                <span id="geoloc-error" class="error hidden"><?php echo $observation['geoloc-erreur']; ?></span>
                                                <tb-geolocation-element
                                                        id="tb-geolocation"
                                                        layer='osm'
                                                        zoom_init="4"
                                                        lat_init="46.5"
                                                        lng_init="2.9"
                                                        marker="true"
                                                        polyline="false"
                                                        polygon="false"
                                                        show_lat_lng_elevation_inputs="true"
                                                        osm_class_filter=""
                                                        elevation_provider="mapquest"
                                                        map_quest_api_key="mG6oU5clZHRHrOSnAV0QboFI7ahnGg34"
                                                >
                                                </tb-geolocation-element>
                                        </div>
                                        <div id="geoloc-datas" class="hidden">
                                                <div class="mt-3">
                                                        <label class="col-sm-8" for="rue"><?php echo $observation['rue']; ?></label>
                                                        <div class="col-sm-8">
                                                                <!-- <input type="text" class="form-control rue" disabled id="rue" name="rue" value="1 Place Georges Frêche"> -->
                                                                <input type="text" class="form-control rue" disabled id="rue" name="rue" value="">
                                                        </div>
                                                </div>
                                                <!-- <input type="hidden" class="form-control latitude" disabled id="latitude" name="latitude" value="43.5984" style="display:none">
                                                <input type="hidden" class="form-control longitude" disabled id="longitude" name="longitude" value="3.896799" style="display:none"> -->
                                                <input type="hidden" class="form-control latitude" disabled id="latitude" name="latitude" value="" style="display:none">
                                                <input type="hidden" class="form-control longitude" disabled id="longitude" name="longitude" value="" style="display:none">
                                                <div class="mt-3">
                                                        <label class="col-sm-8" for="commune-nom"><?php echo $observation['nom-commune']; ?></label>
                                                        <div class="col-sm-8">
                                                                <!-- <input type="text" class="form-control commune-nom" disabled id="commune-nom" name="commune-nom" value="Montpellier">
                                                                <input type="hidden" class="commune-insee" disabled id="commune-insee" name="commune-insee" value="34172"> -->
                                                                <input type="text" class="form-control commune-nom" disabled id="commune-nom" name="commune-nom" value="">
                                                                <input type="hidden" class="commune-insee" disabled id="commune-insee" name="commune-insee" value="">
                                                        </div>
                                                </div>
                                                <div class="row pl-3 pr-3 mt-3">
                                                        <div class="d-flex flex-column col-sm-4">
                                                                <label for="altitude"><?php echo $observation['altitude']; ?></label>
                                                                <div>
                                                                        <!-- <input type="text" class="form-control altitude" disabled id="altitude" name="altitude" value="23"> -->
                                                                        <input type="text" class="form-control altitude" disabled id="altitude" name="altitude" value="">
                                                                </div>
                                                        </div>
                                                        <div class="d-flex flex-column col-sm-4">
                                                                <label for="pays"><?php echo $observation['pays']; ?></label>
                                                                <div>
                                                                        <!-- <input type="text" class="form-control pays" disabled id="pays" name="pays" value="France"> -->
                                                                        <input type="text" class="form-control pays" disabled id="pays" name="pays" value="">
                                                                </div>
                                                        </div>
                                                </div>
                                        </div>
                                </div>
                        </div>
                </div>

                <div class="col-md-6">
                        <h3 class="mb-3"><?php echo $observation['titre-info-obs']; ?></h3>
                        <div id="obs-info" class="text-justify col-sm-8">
                                <?php echo $observation['obs-info']; ?>
                        </div>

                        <div class="control-group">
                                <label for="releve-date" 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 has-tooltip" data-toggle="tooltip" title="<?php echo $observation['date-title']; ?>">
                                        <input type="date" id="releve-date" name="releve-date" class="form-control" max="<?php echo date('Y-m-d', time()); ?>" placeholder="jj/mm/aaaa" required>
                                </div>
                        </div>

                        <div class="">
                                <label for="commentaires" class="col-sm-8">
                                        <i class="fa fa-pen" aria-hidden="true"></i>
                                        <?php echo $general['commentaires']; ?>
                                </label>
                                <div class="col-sm-8 mb-3">
                                        <textarea id="commentaires" class="col-md-12" rows="7" name="commentaires"></textarea>
                                </div>
                        </div>
                        <!-- Bouton création d'une obs -->
                        <div class="col-sm-8 mb-3">
                                <div title="<?php echo $resume['creer-title']; ?>">
                                        <a href="" id="soumettre-releve" class="charger-carto btn btn-primary"><?php echo $general['enregistrer']; ?></a href="">
                                </div>
                        </div>
                </div>
        </div>
</form><!-- fin zone relevé -->

<!-- Messages d'erreur du formulaire observateur -->
<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-date-rue-ko" class="alert alert-warning alert-block hidden">
                <a class="close">×</a>
                <h4 class="alert-heading"><?php echo $observation['alertdr-title']; ?></h4>
                <p><?php echo $observation['alertdr']; ?></p>
        </div>
</div>

<div id="zone-arbres" class="bloc-top hidden">
        <h2 class="mb-3"><?php echo $arbres['titre']; ?></h2>
        <div id="bouton-saisir-lichens" class="btn btn-info hidden m-3" data-load="lichens">
                <i class="far fa-snowflake"></i> <?php echo $resume['saisir-lichens']; ?>
        </div>
        <div class="row">
                <div id="bloc-arbres-gauche" class="col-md-6">
                        <div id="bloc-info-arbres"></div>
                        <div id="bloc-form-arbres" class="">
                                <div id="arbres-info" class="text-justify">
                                        <?php echo $arbres['arbres-info']; ?>
                                </div>
                                <form id="form-arbre" role="form" autocomplete="off">
                                        <h3 class="mb-3"><?php echo $general['arbre'];?>&nbsp;<span id="arbre-nb">1</span>&nbsp;:</h3>
                                        <input id="referentiel" name="referentiel" value="bdtfx" type="hidden">
                                        <div id="bloc-taxon" class="control-group">
                                                <label for="taxon" class="col-sm-8 obligatoire" title="">
                                                        <i class="fa fa-leaf" aria-hidden="true"></i>
                                                        <?php echo $general['espece']; ?> (bdtfx)
                                                </label>
                                                <div class="col-sm-8 mb-3">
                                                        <input id="taxon" name="taxon" class="form-control taxon-validation has-tooltip" type="text" data-toggle="tooltip" title="<?php echo $general['espece-title']; ?>" required autocomplete="off">
                                                </div>
                                        </div>

                                        <div class="control-group">
                                                <label for="certitude" class="col-sm-8 obligatoire">
                                                        <i class="fa fa-question" aria-hidden="true"></i>
                                                        <?php echo $general['certitude']; ?>
                                                </label>
                                                <div class="col-sm-8 mb-3">
                                                        <select id="certitude" name="certitude" class="form-control custom-select" required>
                                                                <option class="choisir" hidden value="" selected><?php echo $general['choisir']; ?></option>
                                                                <option class="aDeterminer" value="à determiner"><?php echo $general['certADet']; ?></option>
                                                                <option class="douteuse" value="douteuse"><?php echo $general['certDout']; ?></option>
                                                                <option class="certaine" value="certaine"><?php echo $general['certCert']; ?></option>
                                                        </select>
                                                </div>
                                        </div>
                                        <div class="">
                                                <label class="col-sm-8 obligatoire has-tooltip" data-toggle="tooltip" title="<?php echo $observateur['geoloc-title']; ?>">
                                                        <i class="fa fa-map-marked-alt " aria-hidden="true"></i>
                                                        <?php echo $arbres['localiser']; ?>
                                                </label>
                                                <div class="control-group">
                                                        <div id="geoloc-datas-arbres" class="hidden">
                                                                <div class="mt-3">
                                                                        <label class="col-sm-8" for="rue-arbres"><?php echo $observation['rue']; ?></label>
                                                                        <div class="col-sm-8">
                                                                                <input type="text" class="form-control rue-arbres" disabled id="rue-arbres" name="rue-arbres" value="">
                                                                        </div>
                                                                </div>
                                                                <div class="row pl-3 pr-3 mt-3">
                                                                        <div class="d-flex flex-column col-sm-4">
                                                                                <label class="" for="latitude-arbres"><?php echo $observation['latitude']; ?></label>
                                                                                <div class="">
                                                                                        <input type="text" class="form-control latitude-arbres" disabled id="latitude-arbres" name="latitude-arbres" value="">
                                                                                </div>
                                                                        </div>
                                                                        <div class="d-flex flex-column col-sm-4">
                                                                                <label class="" for="longitude-arbres"><?php echo $observation['longitude']; ?></label>
                                                                                <div class="">
                                                                                        <input type="text" class="form-control longitude-arbres" disabled id="longitude-arbres" name="longitude-arbres" value="">
                                                                                </div>
                                                                        </div>
                                                                </div>
                                                                <input type="hidden" id="altitude-arbres" name="altitude-arbres" class=""  value="" style="display:none">
                                                        </div>
                                                        <div id="geoloc-arbres" class="col-sm-8"></div>
                                                </div>
                                        </div>
                                </form>
                                <form id="form-upload" class="form-horizontal" action="<?php echo $url_ws_upload ?>" method="post" enctype="multipart/form-data">
                                        <div class="col-sm-8 mb-2 list-label and-help">
                                                <i class="fa fa-images" aria-hidden="true"></i>
                                                <?php echo $arbres['titre-photos']; ?>
                                        </div>
                                        <p id="miniature-arbres-info" class="col-sm-8">
                                                <?php echo $image['aide']; ?>
                                        </p>
                                        <div id ="photos-conteneur" class="control-group col-sm-8">
                                                <div id="bouton-fichier">
                                                        <label for="fichier" class="label-file btn btn-large btn-info mb-3" title="<?php echo $image['photos-title']; ?>">
                                                                <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">&nbsp;</p>
                                        </div>
                                </form>
                                <form id="form-arbre-fs" role="form" autocomplete="off">
                                        <div class="control-group">
                                                <label for="circonference" class="col-sm-8 obligatoire">
                                                        <i class="fa fa-circle-notch" aria-hidden="true"></i>
                                                        <?php echo $arbres['circonference'] ;?>
                                                </label>
                                                <div class="col-sm-8 mb-3">
                                                        <input id="circonference" type="number" name="circonference" class="form-control has-tooltip" data-toggle="tooltip" title="<?php echo $arbres['circonference-title'] ;?>" placeholder="<?php echo $arbres['circonference-ph'] ;?>" step="1" min="1" required>
                                                </div>
                                        </div>

                                        <div id="face-ombre" class="control-group">
                                                <div class="col-sm-8 mb-2 list-label obligatoire">
                                                        <i class="far fa-compass" aria-hidden="true"></i>
                                                        <?php echo $arbres['face-ombre']; ?>
                                                </div>
                                                <div class="col-sm-8 mb-3 has-tooltip list" data-toggle="tooltip" title="<?php echo $arbres['face-ombre-title']; ?>" required>
                                                        <div class="form-check form-check-inline">
                                                                <input type="checkbox" id="nord" name="face-ombre" class="nord form-check-input" value="nord">
                                                                <label for="nord" class="nord form-check-label"><?php echo $general['nord']; ?></label>
                                                        </div>
                                                        <div class="form-check form-check-inline">
                                                                <input type="checkbox" id="sud" name="face-ombre" class="sud form-check-input" value="sud">
                                                                <label for="sud" class="sud form-check-label"><?php echo $general['sud']; ?></label>
                                                        </div>
                                                        <div class="form-check form-check-inline">
                                                                <input type="checkbox" id="est" name="face-ombre" class="est form-check-input" value="est">
                                                                <label for="est" class="est form-check-label"><?php echo $general['est']; ?></label>
                                                        </div>
                                                        <div class="form-check form-check-inline">
                                                                <input type="checkbox" id="ouest" name="face-ombre" class="ouest form-check-input" value="ouest">
                                                                <label for="ouest" class="ouest form-check-label"><?php echo $general['ouest']; ?></label>
                                                        </div>
                                                        <div class="form-check form-check-inline">
                                                                <input type="checkbox" id="aucune" name="face-ombre" class="ouest form-check-input" value="aucune">
                                                                <label for="aucune" class="aucune form-check-label"><?php echo $general['aucune']; ?></label>
                                                        </div>
                                                </div>
                                        </div>

                                        <div class="">
                                                <label for="com-arbres" class="col-sm-8" title="">
                                                                <i class="fa fa-pen" aria-hidden="true"></i>
                                                                <?php echo $general['commentaires']; ?>
                                                </label>
                                                <div class="col-sm-8 mb-3">
                                                                <textarea id="com-arbres" class="col-md-12" rows="7" name="com-arbres"></textarea>
                                                </div>
                                        </div>
                                </form>

                                <!-- Bouton création d'une obs et retour à la saisie après visualisation d'un arbre-->
                                <div class="col-sm-8 mb-3">
                                        <button id="retour" class="btn btn-info has-tooltip hidden" data-toggle="tooltip" title="<?php echo $resume['retour-title']; ?>">
                                                <i class="fas fa-undo-alt"></i> <?php echo $general['retour']; ?>
                                        </button>
                                        <button id="ajouter-obs" class="btn btn-primary has-tooltip" data-toggle="tooltip" title="<?php echo $resume['creer-title']; ?>">
                                                <i class="fas fa-step-forward"></i> <?php echo $general['suivant']; ?>
                                        </button>
                                </div>
                        </div>
                </div><!-- fin formulaire arbres -->
                <!-- zone résumé obs arbres ( =zone de droite) -->
                <div id="boc-arbres-droite" class="col-md-6 mb-3">
                        <!-- 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="hidden">
                                <div id="bloc-controle-liste-obs" 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 has-tooltip" data-toggle="tooltip" disabled="disabled"
                                                title="<?php echo $resume['trans-title']; ?>" type="button">
                                                <?php echo $general['enregistrer']; ?>
                                        </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="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>

                        <!-- 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><!-- fin arbres zone résumé obs ( =zone de droite ) -->
        </div>
        <!-- Connexion, bloc de prévisualisation, date -->
        <script type="text/javascript">
                //<![CDATA[
                        $( document ).ready( function() {
                                lichens = null;
                                releve = null;
                                // OMG un modèle objet !!
                                releve = new ReleveLg();

                                // La présence du parametre 'debug' dans l'URL enclenche le débogage
                                releve.debug = <?php echo isset( $_GET['debug'] ) ? 'true' : 'false'; ?>;
                                // La présence du parametre 'html5' dans l'URL enclenche les fonctions avancées HTML5
                                releve.html5 = <?php echo isset($_GET['html5']) ? 'true' : 'false'; ?>;
                                // Mot-clé du widget/projet
                                releve.tagProjet = "WidgetLg";
                                // Mots-clés à ajouter aux images
                                releve.tagImg = "<?php echo isset($_GET['tag-img']) ? $_GET['tag-img'] : ''; ?>";
                                releve.separationTagImg = "<?php echo isset($_GET['motcle']) && isset($_GET['tag-img']) ? ',' : ''; ?>";
                                releve.tagImg = <?php echo isset($_GET['motcle']) ? "'".$_GET['motcle']."' + releve.separationTagImg + releve.tagImg" : 'releve.tagImg'; ?>;
                                // Mots-clés à ajouter aux observations
                                releve.tagObs = "<?php echo isset($_GET['tag-obs']) ? $_GET['tag-obs'] : ''; ?>";
                                releve.separationTagObs = "<?php echo isset($_GET['projet']) && isset($_GET['tag-obs']) ? ',' : ''; ?>";
                                releve.tagObs = <?php echo isset($_GET['projet']) ? "'".$_GET['projet']."' + releve.separationTagObs + releve.tagObs" : 'releve.tagObs'; ?>;
                                // Précharger le formulaire avec les infos d'une observation
                                releve.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.
                                releve.serviceSaisieUrl = "<?php echo $url_ws_lg; ?>";
                                // URL du web service permettant de récupérer les infos d'une observation du CEL.
                                releve.serviceObsUrl = "<?php echo $url_ws_obs; ?>";
                                // URL du web service permettant de récupérer les images d'une observation.
                                releve.serviceObsImgs = "<?php echo $url_ws_cel_imgs; ?>";
                                // URL du web service permettant de récupérer l'url d'une image (liée à une obs)'.
                                releve.serviceObsImgUrl = "<?php echo $url_ws_cel_img_url; ?>";

                                // langue
                                releve.langue = "<?php echo $widget['langue']; ?>";
                                // Squelette d'URL du web service de l'annuaire.
                                releve.serviceAnnuaireIdUrl = "<?php echo $url_ws_annuaire; ?>";
                                // mode : prod / beta / local
                                releve.mode = "<?php echo $conf_mode; ?>";
                                // URL de l'icône du chargement en cours d'une image
                                releve.chargementImageIconeUrl = "<?php echo $url_base; ?>img/icones/chargement-image.gif";
                                // URL de l'icône pour une photo manquante
                                releve.pasDePhotoIconeUrl = "<?php echo $url_base; ?>img/icones/pasdephoto.png";

                                // Code du référentiel utilisé pour les nom scientifiques.
                                releve.nomSciReferentiel = "<?php echo strtolower( $widget['referentiel'] ); ?>";
                                // Nombre d'élément dans les listes d'auto-complétion
                                releve.autocompletionElementsNbre = 20;
                                // Indication de la présence d'un référentiel imposé
                                releve.referentielImpose = "<?php echo $referentiel_impose; ?>";

                                // URL du web service permettant l'auto-complétion des noms scientifiques
                                releve.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=" + releve.autocompletionElementsNbre;
                                // Squelette d'URL du web service permettant l'auto-complétion des noms scientifiques
                                releve.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=" + releve.autocompletionElementsNbre;
                                // Nombre d'observations max autorisé avant transmission
                                releve.obsMaxNbre = 10;
                                // Durée d'affichage en milliseconde des messages d'informations
                                releve.dureeMessage = 10000;

                                // Squelette d'URL du web service d'eFlore fournissant les noms de communes.
                                releve.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).
                                releve.serviceNomCommuneUrlAlt = "https://api.tela-botanica.org/service:eflore:0.1/wikipedia/nom-commune?lon={lon}&lat={lat}&nbre=1";

                                // Initialisation du bousin
                                releve.init();
                        });
                //]]>
        </script>
</div>