/trunk/widget/modules/saisie/configurations/florileges_taxons.tsv |
---|
File deleted |
\ No newline at end of file |
/trunk/widget/modules/saisie/configurations/florileges.ini |
---|
File deleted |
\ No newline at end of file |
/trunk/widget/modules/saisie/configurations/sauvages_taxons.tsv |
---|
469,20 → 469,10 |
Lolium perenne L. 39692 Lolium perenne L. 39692 6983 Poaceae Lolium perenne L. Graminées |
Rostraria cristata (L.) Tzvelev 57834 Rostraria cristata (L.) Tzvelev 57834 7117 Poaceae Rostraria cristata (L.) Tzvelev Graminées |
Setaria verticillata (L.) P.Beauv. 63668 Setaria verticillata (L.) P.Beauv. 63668 7137 Poaceae Setaria verticillata (L.) P.Beauv. Graminées |
Phyllitis scolopendrium L. 49132 Asplenium scolopendrium L. 74981 29973 Aspleniaceae Scolopendre officinale |
Scolopendre officinale 49132 Asplenium scolopendrium L. 74981 29973 Aspleniaceae Scolopendre officinale |
Dryopteris filix-mas (L.) Schott 23262 Dryopteris filix-mas (L.) Schott 23262 7379 Dryopteridaceae Fougère mâle |
Fougère mâle 23262 Dryopteris filix-mas (L.) Schott 23262 7379 Dryopteridaceae Fougère mâle |
Geranium pusillum L. 30036 Geranium pusillum L. 30036 3432 Geraniaceae Géranium fluet |
Géranium fluet 30036 Geranium pusillum L. 30036 3432 Geraniaceae Géranium fluet |
Lepidium ruderale L. 38554 Lepidium ruderale L. 38554 1740 Brassicaceae Passerage des décombres |
Passerage des décombres 38554 Lepidium ruderale L. 38554 1740 Brassicaceae Passerage des décombres |
Lepidium squamatum Forssk. 38565 Lepidium squamatum Forssk. 38565 1625 Brassicaceae Corne-de-cerf écailleuse |
Corne-de-cerf écailleuse 38565 Lepidium squamatum Forssk. 38565 1625 Brassicaceae Corne-de-cerf écailleuse |
Coquelicot 75277 Papaver rhoeas L. 75277 30269 Papaveraceae Coquelicot plantes à fleurs rouges |
Coquelicot 75277 Papaver rhoeas L. 75277 30269 Papaveraceae Coquelicot plantes à fleurs rouges |
Plante de type pissenlit (capitules jaunes non déterminée) 100897 Asteracea 100897 36470 Asteraceae Plante de type pissenlit (capitules jaunes non déterminée) plantes à capitules jaunes |
Plante de type carotte (ombelle blanche ou jaune non déterminée) 100948 Apiaceae 100948 36521 Apiaceae Plante de type carotte (ombelle blanche ou jaune non déterminée) |
Graminée non déterminée 100898 Poaceae 100898 36471 Poaceae Graminée non déterminée Graminées |
Autre(s) espèce(s) (écrire le/les nom(s) dans les notes) 87491 Tracheophytes 87491 36446 Autre(s) espèce(s) (écrire le/les nom(s) dans les notes) |
Crucifère non déterminée (4 pétales jaunes ou blancs, disposés en croix) 100902 Brassicaceae 100902 36475 Brassicaceae Crucifère non déterminée (4 pétales jaunes ou blancs, disposés en croix) |
Colza 10308 Brassica napus L. 10308 1556 Brassicaceae Colza plantes à fleurs jaunes |
Autre(s) espèce(s) (écrire le/les nom(s) dans les notes) 87491 Tracheophytes 87491 36446 Autre(s) espèce(s) (écrire le/les nom(s) dans les notes) |
Colza 10308 Brassica napus L. 10308 1556 Brassicaceae Colza plantes à fleurs jaunes |
/trunk/widget/modules/saisie/squelettes/florileges/css/florileges.css |
---|
File deleted |
\ No newline at end of file |
/trunk/widget/modules/saisie/squelettes/florileges/css/fonts/caflisch_scriptw_web.ttf |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/widget/modules/saisie/squelettes/florileges/css/fonts/caflisch_scriptw_web.woff |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/widget/modules/saisie/squelettes/florileges/florileges.tpl.html |
---|
File deleted |
\ No newline at end of file |
/trunk/widget/modules/saisie/squelettes/florileges/img/favicon.ico |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/widget/modules/saisie/squelettes/florileges/img/background/noise.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
/trunk/widget/modules/saisie/squelettes/florileges/img/icones/epingle.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
/trunk/widget/modules/saisie/squelettes/florileges/img/icones/pas_de_photo.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
/trunk/widget/modules/saisie/squelettes/florileges/img/icones/calendrier.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
/trunk/widget/modules/saisie/squelettes/florileges/img/icones/selecteur.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
/trunk/widget/modules/saisie/squelettes/florileges/img/icones/chargement-image.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/widget/modules/saisie/squelettes/florileges/img/icones/chargement.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/widget/modules/saisie/squelettes/florileges/js/florileges.js |
---|
File deleted |
\ No newline at end of file |
/trunk/widget/modules/saisie/squelettes/defaut/defaut.tpl.html |
---|
51,12 → 51,10 |
var TAG_PROJET = "WidgetSaisie"; |
// Mots-clés à ajouter aux images |
var TAG_IMG = "<?=isset($_GET['tag-img']) ? $_GET['tag-img'] : ''?>"; |
var SEPARATION_TAG_IMG = '<?= isset($_GET['motcle']) && isset($_GET['tag-img']) ? ',' : '' ?>'; |
TAG_IMG = <?=isset($_GET['motcle']) ? "'".$_GET['motcle']."'+SEPARATION_TAG_IMG+TAG_IMG" : 'TAG_IMG' ?>; |
TAG_IMG = <?=isset($_GET['motcle']) ? "'".$_GET['motcle']."'" : 'TAG_IMG' ?>; |
// Mots-clés à ajouter aux observations |
var TAG_OBS = "<?=isset($_GET['tag-obs']) ? $_GET['tag-obs'] : ''?>"; |
var SEPARATION_TAG_OBS = '<?= isset($_GET['projet']) && isset($_GET['tag-obs']) ? ',' : '' ?>'; |
TAG_OBS = <?=isset($_GET['projet']) ? "'".$_GET['projet']."'+SEPARATION_TAG_OBS+TAG_OBS" : 'TAG_OBS' ?>; |
TAG_OBS = <?=isset($_GET['projet']) ? "'".$_GET['projet']."'" : 'TAG_OBS' ?>; |
// URL du web service réalisant l'insertion des données dans la base du CEL. |
var SERVICE_SAISIE_URL = "<?=$url_ws_saisie?>"; |
// Code du référentiel utilisé pour les nom scientifiques (de la forme nom:code). |
349,7 → 347,7 |
</div> |
<div class="span6"> |
<form id="form-obs" action="#" autocomplete="on"> |
<h2>Observation</h2> |
<h2>Observations</h2> |
<?php if(!$referentiel_impose) : ?> |
<div class="row-fluid"> |
<div rel="tooltip" |
408,15 → 406,16 |
</form> |
<form id="form-upload" class="form-horizontal" action="<?=$url_base?>saisie?projet=sauvages&service=upload-image" |
method="post" enctype="multipart/form-data"> |
<h2>Image(s) de cette plante</h2> |
<strong>Ajouter une image</strong> |
<p class="miniature-info" class="discretion help-inline">Les photos doivent être au format JPEG et ne doivent pas excéder 5Mo chacunes.</p> |
<div id ="photos-conteneur"> |
<div rel="tooltip" |
title="Ajouter une photo de votre observation. Elle doit être au |
format JPEG et ne doit pas excéder 5Mo."> |
<label>Photo</label> |
<input type="file" id="fichier" name="fichier" accept="image/jpeg" /> |
<input type="hidden" name="MAX_FILE_SIZE" value="5242880"/> |
<div id="miniatures"> |
</div> |
<p class="miniature-msg" class="span12"> </p> |
<p id="miniature-info" class="discretion help-inline">La photo doit être au format JPEG et ne doit pas excéder 5Mo.</p> |
<div id="miniature"></div> |
<button id="effacer-miniature" type="button" style="display:none;">Effacer</button> |
<p id="miniature-msg" class="span12"> </p> |
</div> |
</form> |
</div> |
/trunk/widget/modules/saisie/squelettes/defaut/img/icones/plus.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
/trunk/widget/modules/saisie/squelettes/defaut/img/icones/icone-photo.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
/trunk/widget/modules/saisie/squelettes/defaut/img/icones/icone-photo-hover.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
/trunk/widget/modules/saisie/squelettes/defaut/js/defaut.js |
---|
44,26 → 44,31 |
//UPLOAD PHOTO : Traitement de l'image |
$(document).ready(function() { |
$(".effacer-miniature").click(function () { |
supprimerMiniatures($(this)); |
$("#effacer-miniature").click(function () { |
supprimerMiniature(); |
}); |
$("#fichier").bind('change', function (e) { |
arreter(e); |
var options = { |
success: afficherMiniature, // post-submit callback |
dataType: 'xml', // 'xml', 'script', or 'json' (expected server response type) |
resetForm: true // reset the form after successful submit |
}; |
$("#miniature").append('<img id="miniature-chargement" class="miniature" alt="chargement" src="'+CHARGEMENT_IMAGE_URL+'"/>'); |
$("#ajouter-obs").attr('disabled', 'disabled'); |
if(verifierFormat($("#fichier").val())) { |
if (HTML5 && window.File && window.FileReader && isCanvasSupported()) { |
if (DEBUG) { |
console.log("Support OK pour : API File et Canvas."); |
} |
$('#fichier').bind('change', function(e) { |
afficherMiniatureHtml5(e); |
}); |
} else { |
$("#fichier").bind('change', function (e) { |
arreter(e); |
var options = { |
success: afficherMiniature, // post-submit callback |
dataType: 'xml', // 'xml', 'script', or 'json' (expected server response type) |
resetForm: true // reset the form after successful submit |
}; |
$("#miniature").append('<img id="miniature-chargement" class="miniature" alt="chargement" src="'+CHARGEMENT_IMAGE_URL+'"/>'); |
$("#ajouter-obs").attr('disabled', 'disabled'); |
$("#form-upload").ajaxSubmit(options); |
} else { |
window.alert("Le format de fichier n'est pas supporté, les formats acceptés sont "+ $("#fichier").attr("accept")); |
} |
return false; |
}); |
return false; |
}); |
} |
if(ESPECE_IMPOSEE) { |
$("#taxon").attr("disabled", "disabled"); |
81,19 → 86,98 |
infosAssociee.retenu = (INFOS_ESPECE_IMPOSEE.retenu == 'false') ? false : true; |
$("#taxon").data(infosAssociee); |
} |
$('.effacer-miniature').live('click', function() { |
$(this).parent().remove(); |
}); |
}); |
function verifierFormat(nom) { |
var parts = nom.split('.'); |
extension = parts[parts.length - 1]; |
return (extension.toLowerCase() == 'jpeg' || extension.toLowerCase() == 'jpg'); |
function isCanvasSupported(){ |
var elem = document.createElement('canvas'); |
return !!(elem.getContext && elem.getContext('2d')); |
} |
function afficherMiniatureHtml5(evt) { |
supprimerMiniature(); |
var selectedfiles = evt.target.files; |
var f = selectedfiles[0];// Nous récupérons seulement le premier fichier. |
if (f.type != 'image/jpeg') { |
var message = "Seule les images JPEG sont supportées."; |
$("#miniature-msg").append(message); |
} else if (f.size > 5242880) { |
var message = "Votre image à un poids supérieur à 5Mo."; |
$("#miniature-msg").append(message); |
} else { |
var reader = new FileReader(); |
// Lit le fichier image commune url de données |
reader.readAsDataURL(f); |
var imgNom = f.name; |
// Closure pour capturer les infos du fichier |
reader.onload = (function(theFile) { |
return function(e) { |
// Rendre la miniature |
var imageBase64 = e.target.result; |
//$("#miniature").append('<img id="miniature-img" class="miniature b64" src="'+imageBase64+'" alt="'+imgNom+'"/>'); |
// HTML5 Canvas |
var img = new Image(); |
img.src = imageBase64; |
img.alt = imgNom; |
img.onload = function() { |
transformerImgEnCanvas(this, 100, 100, false, 'white'); |
}; |
}; |
})(f); |
} |
$("#effacer-miniature").show(); |
} |
function transformerImgEnCanvas(img, thumbwidth, thumbheight, crop, background) { |
var canvas = document.createElement('canvas'); |
canvas.width = thumbwidth; |
canvas.height = thumbheight; |
var dimensions = calculerDimenssions(img.width, img.height, thumbwidth, thumbheight); |
if (crop) { |
canvas.width = dimensions.w; |
canvas.height = dimensions.h; |
dimensions.x = 0; |
dimensions.y = 0; |
} |
cx = canvas.getContext('2d'); |
if (background !== 'transparent') { |
cx.fillStyle = background; |
cx.fillRect(0, 0, thumbwidth, thumbheight); |
} |
cx.drawImage(img, dimensions.x, dimensions.y, dimensions.w, dimensions.h); |
afficherMiniatureCanvas(img, canvas); |
} |
function calculerDimenssions(imagewidth, imageheight, thumbwidth, thumbheight) { |
var w = 0, h = 0, x = 0, y = 0, |
widthratio = imagewidth / thumbwidth, |
heightratio = imageheight / thumbheight, |
maxratio = Math.max(widthratio, heightratio); |
if (maxratio > 1) { |
w = imagewidth / maxratio; |
h = imageheight / maxratio; |
} else { |
w = imagewidth; |
h = imageheight; |
} |
x = (thumbwidth - w) / 2; |
y = (thumbheight - h) / 2; |
return {w:w, h:h, x:x, y:y}; |
} |
function afficherMiniatureCanvas(imgB64, canvas) { |
var url = canvas.toDataURL('image/jpeg' , 0.8); |
var alt = imgB64.alt; |
var title = Math.round(url.length / 1000 * 100) / 100 + ' KB'; |
var miniature = '<img id="miniature-img" class="miniature b64-canvas" src="'+url+'" alt="'+alt+'" title="'+title+'" />'; |
$("#miniature").append(miniature); |
$("#miniature-img").data('b64', imgB64.src); |
} |
function afficherMiniature(reponse) { |
supprimerMiniature(); |
if (DEBUG) { |
var debogage = $("debogage", reponse).text(); |
console.log("Débogage upload : "+debogage); |
102,25 → 186,18 |
if (message != '') { |
$("#miniature-msg").append(message); |
} else { |
$("#miniatures").append(creerWidgetMiniature(reponse)); |
var miniatureUrl = $("miniature-url", reponse).text(); |
var imgNom = $("image-nom", reponse).text(); |
$("#miniature").append('<img id="miniature-img" class="miniature" alt="'+imgNom+'" src="'+miniatureUrl+'"/>'); |
} |
$('#ajouter-obs').removeAttr('disabled'); |
$('#ajouter-obs').removeAttr('disabled'); |
$("#effacer-miniature").show(); |
} |
function creerWidgetMiniature(reponse) { |
var miniatureUrl = $("miniature-url", reponse).text(); |
var imgNom = $("image-nom", reponse).text(); |
var html = |
'<div class="miniature">'+ |
'<img class="miniature-img" class="miniature" alt="'+imgNom+'" src="'+miniatureUrl+'"/>'+ |
'<button class="effacer-miniature" type="button">Effacer</button>'+ |
'</div>' |
return html; |
} |
function supprimerMiniatures() { |
$("#miniatures").empty(); |
function supprimerMiniature() { |
$("#miniature").empty(); |
$("#miniature-msg").empty(); |
$("#effacer-miniature").hide(); |
} |
//+----------------------------------------------------------------------------------------------------------+ |
140,13 → 217,6 |
$("#carte-recherche").on('mouseup', function(event) {// Pour Safari... |
event.preventDefault(); |
}); |
$("#carte-recherche").keypress(function(e) { |
if (e.which == 13) { |
e.preventDefault(); |
} |
}); |
$("#carte-recherche").autocomplete({ |
//Cette partie utilise geocoder pour extraire des valeurs d'adresse |
source: function(request, response) { |
295,6 → 365,11 |
$(function() { |
var url_service = SERVICE_NOM_COMMUNE_URL; |
/*if(NOM_SCI_PROJET != "bdtfx") { |
// Dans le cas d'autres référentiels comme les Antilles, on utilise |
// une localisation mondiale mais approximative (c'est mieux que rien) |
url_service = SERVICE_NOM_COMMUNE_URL_ALT |
}*/ |
var urlNomCommuneFormatee = url_service.replace('{lat}', pos.lat()).replace('{lon}', pos.lng()); |
$.ajax({ |
448,16 → 523,6 |
$("#transmettre-obs").on('click', transmettreObs); |
$("#referentiel").on('change', surChangementReferentiel); |
$("body").on('click', ".defilement-miniatures-gauche", function(event) { |
event.preventDefault(); |
defilerMiniatures($(this)); |
}); |
$("body").on('click', ".defilement-miniatures-droite", function(event) { |
event.preventDefault(); |
defilerMiniatures($(this)); |
}); |
}); |
function configurerFormValidator() { |
605,9 → 670,7 |
$(".obs-nbre").triggerHandler('changement'); |
afficherObs(); |
stockerObsData(); |
supprimerMiniatures(); |
$("#taxon").val(""); |
$("#taxon").data("numNomSel",undefined); |
supprimerMiniature(); |
} else { |
afficherPanneau('#dialogue-form-invalide'); |
} |
678,8 → 741,8 |
'milieu' : $("#milieu").val(), |
//Ajout des champs images |
'image_nom' : getNomsImgsOriginales(), |
'image_b64' : getB64ImgsOriginales() |
'image_nom' : $("#miniature-img").attr('alt'), |
'image_b64' : getB64ImgOriginal() |
}); |
} |
704,7 → 767,6 |
function transmettreObs() { |
var observations = $("#liste-obs").data(); |
console.log(observations); |
if (observations == undefined || jQuery.isEmptyObject(observations)) { |
afficherPanneau("#dialogue-zero-obs"); |
741,7 → 803,7 |
}, |
success : function(data, textStatus, jqXHR) { |
$('#dialogue-obs-transaction-ok .alert-txt').append($("#tpl-transmission-ok").clone().html()); |
supprimerMiniatures(); |
supprimerMiniature(); |
}, |
statusCode : { |
500 : function(jqXHR, textStatus, errorThrown) { |
798,24 → 860,13 |
return ($observateur == true && $station == true && $obs == true) ? true : false; |
} |
function getNomsImgsOriginales() { |
var noms = new Array(); |
$(".miniature-img").each(function() { |
noms.push($(this).attr('alt')); |
}); |
return noms; |
} |
function getB64ImgsOriginales() { |
var b64 = new Array(); |
$(".miniature-img").each(function() { |
if ($(this).hasClass('b64')) { |
b64.push($(this).attr('src')); |
} else if ($(this).hasClass('b64-canvas')) { |
b64.push($(this).data('b64')); |
} |
}); |
function getB64ImgOriginal() { |
var b64 = ''; |
if ($("#miniature-img").hasClass('b64')) { |
b64 = $("#miniature-img").attr('src'); |
} else if ($("#miniature-img").hasClass('b64-canvas')) { |
b64 = $("#miniature-img").data('b64'); |
} |
return b64; |
} |
843,57 → 894,18 |
} |
function ajouterImgMiniatureAuTransfert() { |
var html = ''; |
var miniatures = ''; |
var premiere = true; |
if ($("#miniatures img").length >= 1) { |
$("#miniatures img").each(function() { |
var visible = premiere ? 'miniature-selectionnee' : 'miniature-cachee'; |
premiere = false; |
var css = $(this).hasClass('b64') ? 'miniature b64' : 'miniature'; |
var src = $(this).attr("src"); |
var alt = $(this).attr("alt"); |
miniature = '<img class="'+css+' '+visible+'" alt="'+alt+'"src="'+src+'" />'; |
miniatures += miniature; |
}); |
visible = ($("#miniatures img").length > 1) ? '' : 'defilement-miniatures-cache'; |
var html = |
'<div class="defilement-miniatures">'+ |
'<a href="#" class="defilement-miniatures-gauche '+visible+'"><</a>'+ |
miniatures+ |
'<a href="#" class="defilement-miniatures-droite '+visible+'">></a>'+ |
'</div>'; |
var miniature = ''; |
if ($("#miniature img").length == 1) { |
var css = $("#miniature-img").hasClass('b64') ? 'miniature b64' : 'miniature'; |
var src = $("#miniature-img").attr("src"); |
var alt = $("#miniature-img").attr("alt"); |
miniature = '<img class="'+css+' " alt="'+alt+'"src="'+src+'" />'; |
} else { |
html = '<img class="miniature" alt="Aucune photo"src="'+PAS_DE_PHOTO_ICONE_URL+'" />'; |
miniature = '<img class="miniature" alt="Aucune photo"src="'+PAS_DE_PHOTO_ICONE_URL+'" />'; |
} |
return html; |
return miniature; |
} |
function defilerMiniatures(element) { |
var miniatureSelectionne = element.siblings("img.miniature-selectionnee"); |
miniatureSelectionne.removeClass('miniature-selectionnee'); |
miniatureSelectionne.addClass('miniature-cachee'); |
var miniatureAffichee = miniatureSelectionne; |
if(element.hasClass('defilement-miniatures-gauche')) { |
if(miniatureSelectionne.prev('.miniature').length != 0) { |
miniatureAffichee = miniatureSelectionne.prev('.miniature'); |
} else { |
miniatureAffichee = miniatureSelectionne.siblings(".miniature").last(); |
} |
} else { |
if(miniatureSelectionne.next('.miniature').length != 0) { |
miniatureAffichee = miniatureSelectionne.next('.miniature'); |
} else { |
miniatureAffichee = miniatureSelectionne.siblings(".miniature").first(); |
} |
} |
console.log(miniatureAffichee); |
miniatureAffichee.addClass('miniature-selectionnee'); |
miniatureAffichee.removeClass('miniature-cachee'); |
} |
function ajouterNumNomSel() { |
var nn = ''; |
if ($("#taxon").data("numNomSel") == undefined) { |
/trunk/widget/modules/saisie/squelettes/defaut/css/defaut.css |
---|
67,58 → 67,14 |
.obs-action{ |
opacity:1; |
} |
#miniatures { |
padding-top: 5px; |
} |
.miniature{ |
float: left; |
height: 130px; |
padding-left: 15px; |
padding-right: 15px; |
max-width:100px; |
} |
.miniature-img { |
height: 100px; |
} |
.miniature img { |
display: block; |
} |
.miniature-chargement { |
height:100px; |
width: 100px; |
} |
.defilement-miniatures-gauche, .defilement-miniatures-droite { |
float: left; |
font-size: 1.2em; |
font-weight: bold; |
height: 62px; |
margin: 5px; |
padding-top: 30px; |
width: 12px; |
} |
.defilement-miniatures { |
width: 210px; |
} |
.defilement-miniatures-cache { |
visibility: hidden; |
} |
.miniature-cachee { |
display: none; |
} |
.miniature-selectionnee { |
display: block; |
width: 90px; |
} |
.referentiel-obs { |
color:#3B9D3B; |
} |
130,36 → 86,6 |
position: relative; |
top: -8px; |
} |
#photos-conteneur { |
height: 120px; |
} |
#photo-placeholder { |
background: url("../img/icones/icone-photo.png"); |
background-size: 89px; |
cursor: pointer; |
margin-bottom: 15px; |
margin-right: 15px; |
float:left; |
border: 5px dashed #CCCCCC; |
border-radius: 8px 8px 8px 8px; |
height: 100px; |
margin: 2px 0 2px 2px; |
text-align: center; |
width: 98px; |
box-sizing:border-box; |
-moz-box-sizing:border-box; |
-webkit-box-sizing:border-box; |
} |
#photo-placeholder:hover { |
background: url("../img/icones/icone-photo-hover.png"); |
background-size: 89px; |
border: 5px dashed #111; |
border-radius: 8px; |
} |
/*+--------------------------------------------------------------------------------------------------------+*/ |
/* Correction style CSS Bootstrap */ |
.well { |
/trunk/widget/modules/saisie/squelettes/sauvages/js/sauvages.js |
---|
563,8 → 563,6 |
'image_nom' : $("#miniature-img").attr('alt'), |
'image_b64' : getB64ImgOriginal() |
}); |
// retour à une sélection vide pour le taxon |
$('#taxon option[value=""]').attr("selected", "selected"); |
} |
}); |
/trunk/widget/modules/saisie/Saisie.php |
---|
75,7 → 75,7 |
private function chargerConfigProjet() { |
$fichier_config = dirname(__FILE__).self::DS.'configurations'.self::DS.$this->projet.'.ini'; |
if (file_exists($fichier_config)) { |
if (!$this->configProjet = parse_ini_file($fichier_config)) { |
if (!$this->configProjet = parse_ini_file($fichier_config)) { |
$this->messages[] = "Le fichier ini '$fichier_config' du projet n'a pu être chargé."; |
} |
} else { |
82,13 → 82,11 |
$this->debug[] = "Le fichier ini '$fichier_config' du projet n'existe pas."; |
} |
} |
private function chargerProjetsVersion() { |
if (isset($this->configProjet)) { |
foreach ($this->configProjet as $config => $valeur) { |
if(strstr($config,'.version')) { |
$this->projetsVersions[str_replace('.version', '', $config)] = $valeur; |
} |
foreach ($this->configProjet as $config => $valeur) { |
if(strstr($config,'.version')) { |
$this->projetsVersions[str_replace('.version', '', $config)] = $valeur; |
} |
} |
} |
95,25 → 93,23 |
public function executerWidget() { |
$referentiel_impose = false; |
if (isset($_GET['referentiel']) && $_GET['referentiel'] != '') { |
if(isset($_GET['referentiel']) && $_GET['referentiel'] != '') { |
$this->NS_PROJET = isset($_GET['referentiel']) && $_GET['referentiel'] != '' ? $_GET['referentiel'] : $this->NS_PROJET; |
$this->NS_PROJET_VERSION = $this->projetsVersions[$this->NS_PROJET]; |
$referentiel_impose = true; |
} |
$widget['squelette'] = $this->projet; |
$widget['donnees'] = array(); |
$widget['donnees']['url_base'] = sprintf($this->config['chemins']['baseURLAbsoluDyn'], ''); |
$widget['donnees']['url_ws_saisie'] = sprintf($this->config['chemins']['baseURLServicesCelTpl'], self::WS_SAISIE); |
$widget['donnees']['url_ws_annuaire'] = sprintf($this->config['chemins']['baseURLServicesAnnuaireTpl'], 'utilisateur/identite-par-courriel/'); |
$widget['donnees']['logo'] = isset($_GET['logo']) ? $_GET['logo'] : 'defaut'; |
$widget['donnees']['titre'] = isset($_GET['titre']) ? $_GET['titre'] : 'defaut'; |
$widget['donnees']['titre'] = ($widget['donnees']['titre'] == '0') ? '' : $widget['donnees']['titre']; |
// cas du projet par défaut ou bien d'un projet n'ayant pas de squelette spécifique |
if ($this->projet == 'defaut' || $this->projet == 'florileges' || !$this->projetASquelette()) { |
if ($this->projet == 'defaut' || !$this->projetASquelette()) { |
$urlWsNsTpl = $this->config['chemins']['baseURLServicesEfloreTpl']; |
$urlWsNs = sprintf($urlWsNsTpl, self::EFLORE_API_VERSION, $this->NS_PROJET, self::WS_NOM); |
$urlWsNsSansRef = sprintf($urlWsNsTpl, self::EFLORE_API_VERSION, '{referentiel}', self::WS_NOM); |
124,28 → 120,27 |
$widget['donnees']['ns_version'] = $this->NS_PROJET_VERSION; |
$widget['donnees']['referentiel_impose'] = $referentiel_impose; |
$widget['donnees']['projets_versions'] = $this->projetsVersions; |
$widget['donnees']['espece_imposee'] = false; |
$widget['donnees']['nn_espece_defaut'] = ''; |
$widget['donnees']['nom_sci_espece_defaut'] = ''; |
$widget['donnees']['infos_espece'] = '{}'; |
if ($this->especeEstImposee()) { |
$nom = $this->executerChargementInfosTaxon($_GET['num_nom']); |
if(self::especeEstImposee()) { |
$nom = self::executerChargementInfosTaxon($_GET['num_nom']); |
$widget['donnees']['espece_imposee'] = true; |
$widget['donnees']['nn_espece_defaut'] = $_GET['num_nom']; |
$widget['donnees']['nom_sci_espece_defaut'] = $nom['nom_sci']; |
$widget['donnees']['infos_espece'] = $this->array2js($nom, true); |
} else { |
$widget['donnees']['espece_imposee'] = false; |
$widget['donnees']['nn_espece_defaut'] = ''; |
$widget['donnees']['nom_sci_espece_defaut'] = ''; |
$widget['donnees']['infos_espece'] = array(); |
} |
} |
if ($this->projet != 'defaut' || $this->projetASquelette()) { |
} else { |
$widget['donnees']['taxons'] = $this->recupererListeTaxon(); |
$widget['donnees']['milieux'] = $this->parserMilieux(); |
} |
return $widget; |
} |
private function projetASquelette() { |
// fonction très simple qui ne teste que si le dossier du projet courant |
// fonction très simple qui ne teste que si le dossier du projet courant |
// existe, mais elle suffit pour le moment. |
return file_exists(dirname(__FILE__).self::DS.'squelettes'.self::DS.$this->projet); |
} |
168,7 → 163,7 |
$fichier_tsv = dirname(__FILE__).self::DS.'configurations'.self::DS.$this->projet.'_taxons.tsv'; |
if (file_exists($fichier_tsv) && is_readable($fichier_tsv)) { |
$taxons = $this->decomposerFichierTsv($fichier_tsv); |
$taxons = self::trierTableauMd($taxons, array('nom_fr' => SORT_ASC)); |
$taxons = self::trierTableauMd($taxons, array('nom_fr' => SORT_ASC)); |
} else { |
$this->debug[] = "Impossible d'ouvrir le fichier '$fichier_tsv'."; |
} |
176,7 → 171,7 |
} |
private function decomposerFichierTsv($fichier, $delimiter = "\t"){ |
$header = null; |
$header = NULL; |
$data = array(); |
if (($handle = fopen($fichier, 'r')) !== FALSE) { |
while (($row = fgetcsv($handle, 1000, $delimiter)) !== FALSE) { |
193,30 → 188,28 |
private function parserMilieux() { |
$infosMilieux = array(); |
if (isset($this->configProjet['milieux'])) { |
$milieux = explode('|', $this->configProjet['milieux']); |
foreach ($milieux as $milieu) { |
$details = explode(';', $milieu); |
if (isset($details[1])) { |
$infosMilieux[$details[0]] = $details[1]; |
} else { |
$infosMilieux[$details[0]] = ''; |
} |
$milieux = explode('|', $this->configProjet['milieux']); |
foreach ($milieux as $milieu) { |
$details = explode(';', $milieu); |
if (isset($details[1])) { |
$infosMilieux[$details[0]] = $details[1]; |
} else { |
$infosMilieux[$details[0]] = ''; |
} |
ksort($infosMilieux); |
} |
ksort($infosMilieux); |
return $infosMilieux; |
} |
private function especeEstImposee() { |
return (isset($_GET['num_nom']) && $_GET['num_nom'] != ''); |
return isset($_GET['num_nom']) && $_GET['num_nom'] != ''; |
} |
private function executerChargementInfosTaxon($num_nom) { |
$url_service_infos = sprintf($this->config['chemins']['infosTaxonUrl'], $this->NS_PROJET, $num_nom); |
$infos = json_decode(file_get_contents($url_service_infos)); |
$resultat = array(); |
if (isset($infos) && !empty($infos)) { |
if(isset($infos) && !empty($infos)) { |
$infos = (array)$infos; |
$resultat = (isset($infos['nom_sci']) && $infos['nom_sci'] != '') ? $infos : array(); |
} |
303,45 → 296,36 |
$retour['donnees']['debogage'] = $debogage; |
return $retour; |
} |
// Il ne faut pas utiliser l'index type du tableau files pour tester |
// Il ne faut pas utiliser l'index type du tableau files pour tester |
// si une image est en jpeg car le type renvoyé par les navigateurs |
// peut varier (ex. sous ie qui renvoie image/pjpeg |
// peut varier (ex. sous ie qui renvoie image/pjpeg |
private function verifierFormatJpeg($chemin) { |
// get imagesize renvoie un résultat consistant par contre |
$infos = getimagesize($chemin, $infos); |
return (isset($infos['mime']) && $infos['mime'] == 'image/jpeg'); |
return (isset($infos["mime"]) && $infos["mime"] == "image/jpeg"); |
} |
private function array2js($array,$show_keys) { |
$tableauJs = '{}'; |
if (!empty($array)) { |
$total = count($array) - 1; |
$i = 0; |
$dimensions = array(); |
foreach ($array as $key => $value) { |
if (is_array($value)) { |
$dimensions[$i] = array2js($value,$show_keys); |
if ($show_keys) { |
$dimensions[$i] = '"'.$key.'":'.$dimensions[$i]; |
} |
} else { |
$dimensions[$i] = '"'.addslashes($value).'"'; |
if ($show_keys) { |
$dimensions[$i] = '"'.$key.'":'.$dimensions[$i]; |
} |
} |
if ($i == 0) { |
$dimensions[$i] = '{'.$dimensions[$i]; |
} |
if ($i == $total) { |
$dimensions[$i].= '}'; |
} |
$i++; |
} |
$tableauJs = implode(',', $dimensions); |
} |
return $tableauJs; |
} |
private function array2js($array,$show_keys) |
{ |
$dimensions = array(); |
$valeurs = array(); |
$total = count ($array)-1; |
$i=0; |
foreach($array as $key=>$value){ |
if (is_array($value)) { |
$dimensions[$i] = array2js($value,$show_keys); |
if ($show_keys) $dimensions[$i] = '"'.$key.'":'.$dimensions[$i]; |
} else { |
$dimensions[$i] = '"'.addslashes($value).'"'; |
if ($show_keys) $dimensions[$i] = '"'.$key.'":'.$dimensions[$i]; |
} |
if ($i==0) $dimensions[$i] = '{'.$dimensions[$i]; |
if ($i==$total) $dimensions[$i].= '}'; |
$i++; |
} |
return implode(',',$dimensions); |
} |
} |
?> |