Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 3334 → Rev 3335

/trunk/widget/modules/streets/squelettes/js/PlantesStreets.js
478,23 → 478,7
// Résumé obs et stockage en data de "#list-obs" pour envoi
this.afficherObs( obsData );
this.stockerObsData( obsData );
this.supprimerMiniatures();
$( '#taxon' ).val( '' );
$( '#taxon' ).removeData( 'value' )
.removeData( 'numNomSel' )
.removeData( 'nomRet' )
.removeData( 'numNomRet' )
.removeData( 'nt' )
.removeData( 'famille' );
$( '#taxon-liste' ).find( 'option' ).each( function() {
if ( $( this ).hasClass( 'choisir' ) ) {
$( this ).attr( 'selected', true );
} else {
$( this ).attr( 'selected', false );
}
});
$( '#taxon-input-groupe' ).addClass( 'hidden' );
$( '#taxon-autre' ).val( '' );
this.reinitialiserFormPlantes();
$( '#barre-progression-upload' ).attr( 'aria-valuemax', this.obsNbre );
$( '#barre-progression-upload .sr-only' ).text( '0/' + this.obsNbre + ' ' + this.utils.msgTraduction( 'observations-transmises' ) );
} else {
502,6 → 486,25
}
};
 
PlantesStreets.prototype.reinitialiserFormPlantes = function() {
this.supprimerMiniatures();
$( '#taxon,#taxon-autre,#commentaire' ).val( '' );
$( '#taxon' ).removeData( 'value' )
.removeData( 'numNomSel' )
.removeData( 'nomRet' )
.removeData( 'numNomRet' )
.removeData( 'nt' )
.removeData( 'famille' );
$( '#taxon-liste,#certitude' ).find( 'option' ).each( function() {
if ( $( this ).hasClass( 'choisir' ) ) {
$( this ).attr( 'selected', true );
} else {
$( this ).attr( 'selected', false );
}
});
$( '#taxon-input-groupe' ).addClass( 'hidden' );
};
 
/**
* Formatage des données du formulaire pour stockage et envoi
*/
/trunk/widget/modules/streets/squelettes/js/ReleveStreets.js
673,6 → 673,7
* Fonction handler de l'évenement location du module tb-geoloc
*/
ReleveStreets.prototype.locationHandler = function( location ) {
const lthis = this;
var locDatas = location.originalEvent.detail;
 
if ( this.utils.valOk( locDatas ) ) {
708,7 → 709,7
communeInsee = ( this.utils.valOk( locDatas.inseeData.code ) ) ? locDatas.inseeData.code : '';
} else if ( this.utils.valOk( locDatas.locality ) ) {
nomCommune = locDatas.locality;
} else if ( this.utils.valOk( locDatas.locality ) ) {
} else if ( this.utils.valOk( locDatas.osmCounty ) ) {
nomCommune = locDatas.osmCounty;
}
$( '#rue' ).val( rue );
719,16 → 720,22
$( '#altitude' ).val( altitude );
$( '#pays' ).val( pays );
if ( this.utils.valOk( $( '#rue' ).val() ) && this.utils.valOk( $( '#commune-nom' ).val() ) ) {
if( !this.utils.valOk( $( '#geoloc #error-drc' ) ) ) {
$( '#geoloc' ).closest( '.control-group' ).removeClass( 'error' );
}
$( '#geoloc-error' ).addClass( 'hidden' );
} else {
$( '#geoloc' ).closest( '.control-group' ).addClass( 'error' );
$( '#geoloc' ).addClass( 'hidden' );
$( '#rue,#commune-nom' ).prop( 'disabled', false );
$( '#geoloc-datas' ).removeClass( 'hidden' );
$( '#geoloc-datas' ).closest( '.control-group' ).addClass( 'error' );
$( '#geoloc-error' ).removeClass( 'hidden' );
$( '#releve-date' ).removeClass( 'erreur' ).closest( '.control-group' ).removeClass( 'error' ).find( '#error-drc' ).remove();
$( '#geoloc #error-drc' ).remove();
}
$( '#rue,#commune-nom' ).change( function() {
if ( lthis.utils.valOk( $( '#rue' ).val() ) && lthis.utils.valOk( $( '#commune-nom' ).val() ) ) {
$( '#geoloc-error' ).addClass( 'hidden' );
} else {
$( '#geoloc-error' ).removeClass( 'hidden' );
}
});
} else {
console.log( 'Error location' );
}
814,25 → 821,7
this.releveDatas = $.parseJSON( $( '#releve-data' ).val() );
this.releveDatas[this.obsNbre] = arbreData;
$( '#releve-data' ).val( JSON.stringify( this.releveDatas ) );
 
this.supprimerMiniatures();
$( '#taxon' ).val( '' );
$( '#taxon' ).data( 'numNomSel', '' )
.data( 'nomRet','' )
.data( 'numNomRet', '' )
.data( 'nt', '' )
.data( 'famille', '' );
if( this.isTaxonListe ) {
$( '#taxon-liste' ).find( 'option' ).each( function() {
if ( $( this ).hasClass( 'choisir' ) ) {
$( this ).attr( 'selected', true );
} else {
$( this ).attr( 'selected', false );
}
});
$( '#taxon-input-groupe' ).addClass( 'hidden' );
$('#taxon-autre').val('');
}
this.modeArbresBasculerActivation( false );
$( '#barre-progression-upload' ).attr( 'aria-valuemax', this.obsNbre );
$( '#barre-progression-upload .sr-only' ).text( '0/' + this.obsNbre + ' ' + this.utils.msgTraduction( 'observations-transmises' ) );
} else {
1232,7 → 1221,6
imgHtml = '';
 
$( '#arbre-nb').text( numArbre );
 
taxon.item = arbreDatas.taxon;
this.surAutocompletionTaxon( {}, taxon );
 
1274,7 → 1262,6
$( '#dejections-non' ).prop( 'checked', !arbreDatas.dejections );
}
}
 
this.modeArbresBasculerActivation( desactiverForm, numArbre );
};
 
1316,15 → 1303,9
$( this ).prop( 'selected', false );
}
});
$( '#taxon' ).data( 'numNomSel', '' )
.data( 'nomRet','' )
.data( 'numNomRet', '' )
.data( 'nt', '' )
.data( 'famille', '' );
this.supprimerMiniatures();
$( '#dejections' ).find( 'input' ).prop( 'checked', false );
$(
'#taxon,'+
'#circonference,'+
'#surface-pied,'+
'#com-arbres,'+
1335,9 → 1316,11
'#equipement-pied-arbre,'+
'#tassement'
).val( '' );
$( '#arbre-nb' ).text( numArbre );
$( '#arbre-info-lien-' + numArbre ).addClass( 'disabled' );
$( '.arbre-info' ).not( '#arbre-info-lien-' + numArbre ).removeClass( 'disabled' );
if( 0 < numArbre ) {
$( '#arbre-nb' ).text( numArbre );
$( '#arbre-info-lien-' + numArbre ).addClass( 'disabled' );
$( '.arbre-info' ).not( '#arbre-info-lien-' + numArbre ).removeClass( 'disabled' );
}
}
};
 
1400,7 → 1383,8
exId = 0,
indexObs = '',
exIndexObs = '',
arbreExId = 0;
arbreExId = 0,
arbreId = 0;
 
for ( var id = obsId; id <= ( this.obsNbre + 1 ); id++ ) {
exId = parseInt(id) + 1;
1743,7 → 1727,6
.closest( '.control-group' )
.removeClass( 'error' );
}
$( '#geoloc #error-drc' ).remove();
} else {
$( '#releve-date' )
.addClass( 'erreur' )
1753,9 → 1736,6
$( '#releve-date' ).after( errorDateRue );
}
$( '#geoloc' ).closest( '.control-group' ).addClass( 'error' );
if ( !this.utils.valOk( $( '#geoloc' ).find( '#error-drc' ) ) ) {
$( '#geoloc' ).prepend( errorDateRue );
}
}
if ( dateValid ) {
$( '#releve-date' ).closest( '.control-group span.error' ).not( '#error-drc' ).remove();