392,6 → 392,8 |
if (this.marker != undefined) { |
this.marker.setPosition(latLng); |
this.map.setCenter(latLng); |
// @WARNING TEST |
this.mettreAJourMarkerPosition(latLng); |
} |
}; |
|
504,38 → 506,43 |
url : urlAnnuaire, |
type : "GET", |
success : function(data, textStatus, jqXHR) { |
//console.log('SUCCESS:'+textStatus); |
if (lthis.debug) { |
console.log('SUCCESS: '+textStatus); |
} |
if (data != undefined && data[courriel] != undefined) { |
var infos = data[courriel]; |
$("#id_utilisateur").val(infos.id); |
$("#prenom").val(infos.prenom); |
$("#nom").val(infos.nom); |
$("#courriel_confirmation").val(courriel); |
$("#prenom, #nom, #courriel_confirmation").attr('disabled', 'disabled'); |
lthis.focusChampFormulaire(); |
lthis.masquerPanneau("#dialogue-courriel-introuvable"); |
lthis.surSuccesCompletionCourriel(infos, courriel); |
} else { |
lthis.surErreurCompletionCourriel(); |
} |
}, |
error : function(jqXHR, textStatus, errorThrown) { |
//console.log('ERREUR :'+textStatus); |
if (lthis.debug) { |
console.log('ERREUR: '+textStatus); |
} |
lthis.surErreurCompletionCourriel(); |
}, |
complete : function(jqXHR, textStatus) { |
//console.log('COMPLETE :'+textStatus); |
if (lthis.debug) { |
console.log('COMPLETE: '+textStatus); |
} |
// @TODO harmoniser class="hidden" VS style="display:none;" |
$("#zone-prenom-nom").removeClass("hidden").show(); |
$("#zone-courriel-confirmation").removeClass("hidden").show(); |
|
} |
}); |
} |
}; |
|
WidgetSaisie.prototype.focusChampFormulaire = function() { |
$("#date").focus(); |
} |
WidgetSaisie.prototype.surSuccesCompletionCourriel = function(infos, courriel) { |
$("#id_utilisateur").val(infos.id); |
$("#prenom").val(infos.prenom); |
$("#nom").val(infos.nom); |
$("#courriel_confirmation").val(courriel); |
$("#prenom, #nom, #courriel_confirmation").attr('disabled', 'disabled'); |
this.focusChampFormulaire(); |
this.masquerPanneau("#dialogue-courriel-introuvable"); |
}; |
|
WidgetSaisie.prototype.surErreurCompletionCourriel = function() { |
$("#prenom, #nom, #courriel_confirmation").val(''); |
543,6 → 550,10 |
this.afficherPanneau("#dialogue-courriel-introuvable"); |
}; |
|
WidgetSaisie.prototype.focusChampFormulaire = function() { |
$("#date").focus(); |
}; |
|
WidgetSaisie.prototype.chargerInfoObs = function() { |
var urlObs = this.serviceObsUrl + '/' + this.obsId; |
var lthis = this; |
734,6 → 745,11 |
* Ajoute une observation saisie dans le formulaire à la liste des observations à transmettre |
*/ |
WidgetSaisie.prototype.ajouterObs = function() { |
// Fermeture automatique des dialogue de transmission de données |
// @WARNING TEST |
$('#dialogue-obs-transaction-ko').hide(); |
$('#dialogue-obs-transaction-ok').hide(); |
|
if (this.validerFormulaire() == true) { |
this.obsNbre = this.obsNbre + 1; |
$(".obs-nbre").text(this.obsNbre); |
803,7 → 819,7 |
var lthis = this; |
$("#liste-obs").data('obsId'+this.obsNbre, { |
'date' : $("#date").val(), |
'notes' : $("#notes").val(), |
'notes' : $("#notes").val().trim(), |
|
'nom_sel' : $("#taxon").val(), |
'num_nom_sel' : $("#taxon").data("numNomSel"), |
870,6 → 886,9 |
|
WidgetSaisie.prototype.transmettreObs = function() { |
var observations = $("#liste-obs").data(); |
if (this.debug) { |
console.log(observations); |
} |
if (observations == undefined || jQuery.isEmptyObject(observations)) { |
this.afficherPanneau("#dialogue-zero-obs"); |
} else { |