924,7 → 924,7 |
function getMilieux() { |
var milieuxStr = '', |
milieux = []; |
$('input:checkbox[name="milieux[]"]:checked').each(function() { |
$('.cb-milieux:checked').each(function() { |
milieux.push($(this).val()); |
}); |
|
1015,34 → 1015,6 |
return nn; |
} |
|
function stockerObsData() { |
$('#liste-obs').data('obsId'+obsNbre, { |
'date' : $('#date').val(), |
'notes' : $('#notes').val(), |
|
'nom_sel' : $('#taxon').val(), |
'num_nom_sel' : $('#taxon').data('numNomSel'), |
'nom_ret' : $('#taxon').data('nomRet'), |
'num_nom_ret' : $('#taxon').data('numNomRet'), |
'num_taxon' : $('#taxon').data('nt'), |
'famille' : $('#taxon').data('famille'), |
'referentiel' : ($('#taxon').data('numNomSel') == undefined ? '' : NOM_SCI_REFERENTIEL), |
|
'latitude' : $('#latitude').val(), |
'longitude' : $('#longitude').val(), |
'commune_nom' : $('#commune-nom').text(), |
'commune_code_insee' : $('#commune-code-insee').text(), |
'lieudit' : $('#lieudit').val(), |
'station' : $('#station').val(), |
'milieu' : $('#milieu').val(), |
|
//Ajout des champs images |
'image_nom' : getNomsImgsOriginales(), |
'image_b64' : getB64ImgsOriginales() |
}); |
console.log($('#liste-obs').data('obsId'+obsNbre)); |
} |
|
function surChangementReferentiel() { |
NOM_SCI_PROJET = $('#referentiel').val(); |
NOM_SCI_REFERENTIEL = NOM_SCI_PROJET+':'+PROJETS_VERSIONS[NOM_SCI_PROJET]; |
1098,18 → 1070,76 |
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 stockerObsData() { |
var nomHorsListe = $('#taxon-liste').val() == '?' ? true : false; |
numNomSel = nomHorsListe ? $('#taxon').data('numNomSel') : $('#taxon-liste').val(), |
nomSel = nomHorsListe ? $('#taxon').val() : taxons[numNomSel]['nom_sel'], |
nomRet = nomHorsListe ? $('#taxon').data('nomRet') : taxons[numNomSel]['nom_ret'], |
numNomRet = nomHorsListe ? $('#taxon').data('numNomRet') : taxons[numNomSel]['num_nom_ret'], |
numTaxon = nomHorsListe ? $('#taxon').data('nt') : taxons[numNomSel]['num_taxon'], |
famille = nomHorsListe ? $('#taxon').data('famille') : taxons[numNomSel]['famille'], |
referentiel = (numNomSel == undefined) ? '' : NOM_SCI_REFERENTIEL; |
|
$('#liste-obs').data('obsId'+obsNbre, { |
'date': $('#date').val(), |
'notes': $('#notes').val(), |
|
'station': $('#station').val(), |
'latitude': $('#latitude').val(), |
'longitude': $('#longitude').val(), |
'commune_nom': $('#commune-nom').text(), |
'commune_code_insee': $('#commune-code-insee').text(), |
|
'nom_sel': nomSel, |
'num_nom_sel': numNomSel, |
'nom_ret': nomRet, |
'num_nom_ret': numNomRet, |
'num_taxon': numTaxon, |
'famille': famille, |
'referentiel': referentiel, |
|
'milieu': getMilieux(), |
|
// Ajout des champs images |
'image_nom': getNomsImgsOriginales(), |
|
// Ajout des champs étendus de l'obs |
'obs_etendue': getObsChpEtendus() |
}); |
console.log($('#liste-obs').data('obsId'+obsNbre)); |
} |
|
function getObsChpEtendus() { |
var champs = [], |
perceptionTechnicien = getPerceptionTechnicien(); |
if (perceptionTechnicien != undefined) { |
champs.push(perceptionTechnicien); |
} |
$('.obs-chp-etendu').each(function() { |
var valeur = $(this).val(), |
cle = $(this).attr('name'), |
label = $(this).data('label'); |
if (valeur != '') { |
var chpEtendu = {cle: cle, label: label, valeur: valeur}; |
champs.push(chpEtendu); |
} |
}); |
return b64; |
return champs; |
} |
|
function getPerceptionTechnicien() { |
var perceptionTechnicien = undefined, |
perceptions = []; |
$('.cb-perception-technicien:checked').each(function() { |
perceptions.push($(this).val()); |
}); |
if (perceptions.length > 0) { |
var valeur = Array.prototype.slice.call(perceptions).join(', '); |
perceptionTechnicien = {cle: 'perceptionTechnicien', label: "Perceptions par l'équipe", valeur: valeur}; |
} |
return perceptionTechnicien; |
} |
|
//+----------------------------------------------------------------------------------------------------------+ |
// TRANSFERER OBS : envoie des obs au CEL |
|