Subversion Repositories eFlore/Applications.cel

Rev

Rev 2243 | Rev 2257 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2243 Rev 2256
Line 452... Line 452...
452
	$("#prenom, #nom, #courriel_confirmation").val('');
452
	$("#prenom, #nom, #courriel_confirmation").val('');
453
	$("#prenom, #nom, #courriel_confirmation").removeAttr('disabled');
453
	$("#prenom, #nom, #courriel_confirmation").removeAttr('disabled');
454
	afficherPanneau("#dialogue-courriel-introuvable");
454
	afficherPanneau("#dialogue-courriel-introuvable");
455
}
455
}
456
//+---------------------------------------------------------------------------------------------------------+
456
//+---------------------------------------------------------------------------------------------------------+
457
//FORMULAIRE VALIDATION
457
//FORMULAIRE
458
$(document).ready(function() {
458
$(document).ready(function() {
-
 
459
	if (OBS_ID != '') {
-
 
460
		chargerInfoObs();
-
 
461
	}
-
 
462
});
-
 
463
 
-
 
464
function chargerInfoObs() {
-
 
465
	var urlObs = SERVICE_OBS_URL + '/' + OBS_ID;
-
 
466
	$.ajax({
-
 
467
		url: urlObs,
-
 
468
		type: 'GET',
-
 
469
		success: function(data, textStatus, jqXHR) {
-
 
470
			if (data != undefined && data != "") {
-
 
471
				prechargerForm(data);
-
 
472
			} 
-
 
473
			// TODO: voir s'il est pertinent d'indiquer quelque chose en cas d'erreur ou d'obs
-
 
474
			// inexistante 
-
 
475
		},
-
 
476
		error: function(jqXHR, textStatus, errorThrown) {
-
 
477
			// TODO: cf TODO ci-dessus
-
 
478
		}
-
 
479
	});
-
 
480
}
-
 
481
 
-
 
482
function prechargerForm(data) {	
Line -... Line 483...
-
 
483
	
Line -... Line 484...
-
 
484
	$("#milieu").val(data.milieu);
-
 
485
	
-
 
486
	$("#carte-recherche").val(data.zoneGeo);
-
 
487
	$("#commune-nom").text(data.zoneGeo);
-
 
488
	// TODO: trouver un moyen qui fonctionne lorsqu'on aura d'autres référentiels que INSEE
459
	
489
	$("#commune-code-insee").text(data.codeZoneGeo.replace('INSEE-C:', ''));
460
	
490
	
-
 
491
	
-
 
492
	if(data.hasOwnProperty("latitude") && data.hasOwnProperty("longitude")) {
-
 
493
		var latLng = new google.maps.LatLng(data.latitude, data.longitude);
-
 
494
		mettreAJourMarkerPosition(latLng);
461
});
495
		marker.setPosition(latLng);
-
 
496
		 map.setCenter(latLng); 
-
 
497
	    map.setZoom(16); 
-
 
498
	}
462
//+---------------------------------------------------------------------------------------------------------+
499
}
Line 463... Line 500...
463
// FORMULAIRE
500
 
464
var obsNbre = 0;
501
var obsNbre = 0;