37,7 → 37,7 |
$.ajax({ |
dataType: "json", |
url: urlWebService + "CoelRecherche/Nombre/*/*/*/*/*/*/" + departement + "/*/*/", |
data: { formatRetour: "text/plain" }, |
data: { formatRetour: "text/plain", pays: pays }, |
async: false |
}).complete(function(msg) { |
if (! estStatutRequeteOK(msg.status)) { |
90,14 → 90,25 |
function chargerStructures() { |
if (requeteEnCours()) { |
window.setTimeout('chargerStructures()', 400); |
} else { |
return; |
} |
|
chargementEnCours = true; |
var url = urlWebService+"CoelRecherche/ParDefaut/*/*/*/*/*/*/"+departement+"/*/*/?limit="+nombreCollections; |
xmlHttpRequest = $.getJSON(url).complete(function() { |
traiterLocalisationsJSON(); |
$.ajax({ |
dataType: "json", |
url: urlWebService + "CoelRecherche/ParDefaut/*/*/*/*/*/*/" + departement + "/*/*/", |
data: { limit: nombreCollections, pays: pays }, |
async: true |
}).complete(function(msg) { |
if (!estStatutRequeteOK(msg.status)) { |
alert(msg.responseText); |
return; |
} |
collections = eval("(function(){return " + msg.responseText + ";})()"); |
ordonnerCollectionsParStructures(); |
chargerLocalisations(); |
}); |
} |
} |
|
function requeteEnCours() { |
return (xmlHttpRequest != null && xmlHttpRequest.readyState != 4); |
107,17 → 118,6 |
return (x_status == 200 || x_status == 304 || x_status == 0); |
} |
|
function traiterLocalisationsJSON() { |
var texte = xmlHttpRequest.responseText; |
if (!estStatutRequeteOK(xmlHttpRequest.status)) { |
alert(texte); |
} else { |
collections = eval("(function(){return " + texte + ";})()"); |
ordonnerCollectionsParStructures(); |
chargerLocalisations(); |
} |
} |
|
function ordonnerCollectionsParStructures() { |
for (var index = 0; index < collections.length; index ++) { |
var indexStructure = 0; |