13,12 → 13,11 |
this.tagImg = proprietes.tagImg; |
this.tagObs = proprietes.tagObs; |
this.separationTagObs = proprietes.separationTagObs; |
this.tagObs = proprietes.tagObs; |
this.nomSciReferentiel = proprietes.nomSciReferentiel; |
this.referentielImpose = proprietes.referentielImpose; |
this.widgetProp = widgetProp; |
this.urlWidgets = widgetProp.urlWidgets; |
this.module = widgetProp.nomSquelette; |
this.projet = widgetProp.projet; |
} |
this.isTaxonListe = false; |
this.numArbre = 0; |
84,7 → 83,7 |
// Sur téléchargement image |
this.initEvtsFichier(); |
|
if ( 'tb_streets' !== this.module ) { |
if ( 'tb_streets' !== this.projet ) { |
// Gérer une option "aucune" sur plusieurs checkboxes |
$( '#face-ombre input' ).on( 'click', function () { |
if ( 'aucune' === $( this ).val() ) { |
157,6 → 156,7 |
}); |
|
if ( |
this.valOk( $( '#geometry-releve' ).val() ) && |
this.valOk( $( '#latitude-releve' ).val() ) && |
this.valOk( $( '#longitude-releve' ).val() ) && |
this.valOk( $( '#rue' ).val() ) && |
244,12 → 244,13 |
}, |
obsE : { |
rue : $( '#rue' ).val(), |
'geometry-releve' : $( '#geometry-releve' ).val(), |
'latitude-releve' : $( '#latitude-releve' ).val(), |
'longitude-releve' : $( '#longitude-releve' ).val(), |
'altitude-releve' : $( '#altitude-releve' ).val() |
} |
}; |
if ( 'tb_lichensgo' !== this.module ) { |
if ( 'tb_lichensgo' !== this.projet ) { |
releveDatasTmp.obsE['zone-pietonne'] = $( '#zone-pietonne input:checked' ).val(); |
releveDatasTmp.obsE['pres-lampadaires'] = $( '#pres-lampadaires input:checked' ).val(); |
} |
259,7 → 260,7 |
} else { |
this.releveDatas = $.parseJSON( $( '#releve-data' ).val() ); |
this.releveDatas[0].date = $( '#releve-date' ).val(); |
if ( 'tb_lichensgo' !== this.module ) { |
if ( 'tb_lichensgo' !== this.projet ) { |
this.releveDatas[0]['zone-pietonne'] = $( '#zone-pietonne input:checked' ).val(); |
this.releveDatas[0]['pres-lampadaires'] = $( '#pres-lampadaires input:checked' ).val(); |
} |
281,6 → 282,7 |
// layer = 'osm', |
// zoomInit = 18 |
var donnesResetCarto = { |
geometry : $( '#geometry-releve' ).val(), |
latitude : $( '#latitude-releve' ).val(), |
longitude : $( '#longitude-releve' ).val(), |
suffixe : 'arbres', |
364,12 → 366,13 |
var retour = [], |
champs = [ |
'rue', |
'geometry-releve', |
'latitude-releve', |
'longitude-releve', |
'altitude-releve' |
]; |
|
if ( 'tb_lichensgo' !== this.module ) { |
if ( 'tb_lichensgo' !== this.projet ) { |
champs.push( |
'zone-pietonne', |
'pres-lampadaires', |
388,12 → 391,12 |
var cleValeur = ''; |
|
$.each( champs, function( i , value ) { |
cleValeur = ( 4 > i ) || ( 6 > i && 'tb_lichensgo' !== lthis.module ) ? 'releve' : 'sujet'; |
cleValeur = ( 4 > i ) || ( 6 > i && 'tb_lichensgo' !== lthis.projet ) ? 'releve' : 'sujet'; |
if ( lthis.valOk( datasArbres[cleValeur][value] ) ) { |
retour.push({ cle : value, valeur : datasArbres[cleValeur][value] }); |
} |
}); |
if ( 'tb_streets' !== this.module ) { |
if ( 'tb_streets' !== this.projet ) { |
var faceOmbre = '', |
faceOmbreLength = datasArbres.sujet['face-ombre'].length; |
|
444,7 → 447,7 |
|
var selects = [ 'certitude' ]; |
|
if ( 'tb_lichensgo' !== this.module ) { |
if ( 'tb_lichensgo' !== this.projet ) { |
selects.push( 'equipement-pied-arbre', 'tassement' ); |
} |
$.each( selects, function( i, value ) { |
463,6 → 466,7 |
}); |
}); |
$( '#rue-arbres' ).val( arbreDatas['rue-arbres'] ); |
$( '#geometry-arbres' ).val( arbreDatas['geometry-arbres'] ); |
$( '#latitude-arbres' ).val( arbreDatas['latitude-arbres'] ); |
$( '#longitude-arbres' ).val( arbreDatas['longitude-arbres'] ); |
$( '#altitude-arbres' ).val( arbreDatas['altitude-arbres'] ); |
477,7 → 481,7 |
$( '#miniatures' ).append( imgHtml ); |
$( '#circonference' ).val( arbreDatas.circonference ); |
$( '#com-arbres' ).val( arbreDatas['com-arbres'] ); |
if ( 'tb_lichensgo' !== this.module ) { |
if ( 'tb_lichensgo' !== this.projet ) { |
$( '#surface-pied' ).val( arbreDatas['surface-pied'] ); |
if ( undefined != arbreDatas.dejections ) { |
$( '#dejections-oui' ).prop( 'checked', arbreDatas.dejections ); |
484,7 → 488,7 |
$( '#dejections-non' ).prop( 'checked', !arbreDatas.dejections ); |
} |
} |
if ( 'tb_streets' !== this.module ) { |
if ( 'tb_streets' !== this.projet ) { |
$( '#face-ombre input' ).each( function() { |
if ( -1 < arbreDatas['face-ombre'].indexOf( $( this ).val() ) ) { |
$( this ).prop( 'checked', true ); |
501,6 → 505,7 |
var selecteurs = |
'#taxon,'+ |
'#certitude,'+ |
'#geometry-arbres,'+ |
'#latitude-arbres,'+ |
'#longitude-arbres,'+ |
'#rue-arbres,'+ |
509,7 → 514,7 |
'#com-arbres,'+ |
'#ajouter-obs'; |
|
if ( 'tb_lichensgo' !== this.module ) { |
if ( 'tb_lichensgo' !== this.projet ) { |
selecteurs += |
',#equipement-pied-arbre,'+ |
'#tassement,'+ |
517,7 → 522,7 |
$( '#dejections' ).find( 'input' ).prop( 'disabled', desactiver ); |
} |
$( selecteurs ).prop( 'disabled', desactiver ); |
if ( 'tb_streets' !== this.module ) { |
if ( 'tb_streets' !== this.projet ) { |
$( '#face-ombre' ).find( 'input' ).prop( 'disabled', desactiver ); |
} |
if ( desactiver ) { |
532,21 → 537,22 |
// zoomInit = 18 |
var donnesResetCarto = { |
cartoRemplacee : $( '#tb-geolocation-arbres' ), |
latitude : $( '#latitude-releve' ).val(), |
longitude : $( '#longitude-releve' ).val(), |
suffixe : 'arbres', |
layer : 'google hybrid' |
geometry : $( '#geometry-releve' ).val(), |
latitude : $( '#latitude-releve' ).val(), |
longitude : $( '#longitude-releve' ).val(), |
suffixe : 'arbres', |
layer : 'google hybrid' |
}; |
this.transfererCarto( donnesResetCarto ); |
// retour aux valeurs par defaut |
selecteurs = '#certitude option'; |
if ( 'tb_lichensgo' !== this.module ) { |
if ( 'tb_lichensgo' !== this.projet ) { |
selecteurs += ',#equipement-pied-arbre option,#tassement option'; |
$( '#equipement-pied-arbre .other' ).text( 'Autre' ).val( 'other' ); |
$( '#collect-other-equipement-pied-arbre' ).closest( '.control-group' ).remove(); |
$( '#dejections' ).find( 'input' ).prop( 'checked', false ); |
} |
if ( 'tb_streets' !== this.module ) { |
if ( 'tb_streets' !== this.projet ) { |
$( '#face-ombre' ).find( 'input' ).prop( 'checked', false ); |
} |
$( selecteurs ).each( function() { |
561,10 → 567,11 |
'#circonference,'+ |
'#com-arbres,'+ |
'#rue-arbres,'+ |
'#geometry-arbres,'+ |
'#latitude-arbres,'+ |
'#longitude-arbres,'+ |
'#certitude'; |
if ( 'tb_lichensgo' !== this.module ) { |
if ( 'tb_lichensgo' !== this.projet ) { |
selecteurs += |
',#equipement-pied-arbre,'+ |
'#tassement,'+ |
604,6 → 611,7 |
var rue = ( this.valOk( locDatas.osmRoad ) ) ? locDatas.osmRoad : ''; |
var altitude = ( this.valOk( locDatas.elevation ) ) ? locDatas.elevation : ''; |
var pays = ( this.valOk( locDatas.osmCountryCode ) ) ? locDatas.osmCountryCode.toUpperCase() : 'FR'; |
var geometry = JSON.stringify( locDatas.geometry ); |
var latitude = ''; |
var longitude = ''; |
var nomCommune = ''; |
636,6 → 644,7 |
nomCommune = locDatas.osmCounty; |
} |
$( '#rue' ).val( rue ); |
$( '#geometry-releve' ).val( geometry ); |
$( '#latitude-releve' ).val( latitude ); |
$( '#longitude-releve' ).val( longitude ); |
$( '#commune-nom' ).val( nomCommune ); |
668,6 → 677,7 |
}); |
} else { |
$( '#rue-arbres' ).val( rue ); |
$( '#geometry-arbres' ).val( geometry ); |
$( '#latitude-arbres' ).val( latitude ); |
$( '#longitude-arbres' ).val( longitude ); |
$( '#altitude-arbres' ).val( altitude ); |
777,7 → 787,7 |
rules : { |
'zone-pietonne' : { |
required : function() { |
return( 'tb_lichensgo' !== this.module ); |
return( 'tb_lichensgo' !== this.projet ); |
}, |
minlength : 1 |
}, |
832,7 → 842,7 |
}, |
'surface-pied' : { |
required : function() { |
return( 'tb_lichensgo' !== this.module ); |
return( 'tb_lichensgo' !== this.projet ); |
}, |
minlength : 1, |
'minMaxOk' : true |
839,13 → 849,13 |
}, |
'equipement-pied-arbre' : { |
required : function() { |
return( 'tb_lichensgo' !== this.module ); |
return( 'tb_lichensgo' !== this.projet ); |
}, |
minlength : 1 |
}, |
'face-ombre' : { |
required : function() { |
return( 'tb_streets' !== this.module ); |
return( 'tb_streets' !== this.projet ); |
}, |
minlength : 1 |
} |
865,7 → 875,7 |
} |
} |
}); |
if ( 'tb_lichensgo' !== this.module ) { |
if ( 'tb_lichensgo' !== this.projet ) { |
$( '#equipement-pied-arbre' ).change( function() { |
if ( lthis.valOk( $( this ).val(), false, 'other' ) ) { |
$( this ) |
876,7 → 886,7 |
} |
}); |
} |
if ( 'tb_streets' !== this.module ) { |
if ( 'tb_streets' !== this.projet ) { |
$( '#face-ombre input' ).on( 'click', function() { |
var oneIsChecked = false; |
$( '#face-ombre input' ).each( function() { |
979,7 → 989,7 |
const taxon = this.valOk( $( '#taxon' ).val() ); |
var piedArbre = true; |
|
if ( 'tb_lichensgo' !== this.module ) { |
if ( 'tb_lichensgo' !== this.projet ) { |
piedArbre = this.valOk( $( '#equipement-pied-arbre' ).val(), false, 'other' ); |
if ( piedArbre ) { |
$( '#equipement-pied-arbre' ) |