Commit 7622c835 authored by lucas64500's avatar lucas64500

Messages d'erreur de chargement

parent d8da0448
......@@ -160,7 +160,7 @@ function logout() {
error: function (xhr, ajaxOptions, thrownError) {
//what to do on failure
finCharge();
afficherBd("Un problème est survenu","OK");
afficherBd("Un problème est survenu","Fermer");
}
});
}
......@@ -182,7 +182,7 @@ function deleteAccount() {
error: function (xhr, ajaxOptions, thrownError) {
finCharge();
//what to do on failure
afficherBd("Un problème est survenu","OK");
afficherBd("Un problème est survenu","Fermer");
}
});
......
......@@ -42,7 +42,10 @@ function createHive() {
goToAddLogger(); // add if needed a logger to the hive
},
error: function (xhr, ajaxOptions, thrownError) {
console.log(xhr.responseText);
console.log(xhr.responseText);
finCharge();
afficherBd("Une erreur est survenue","Fermer");
}
});
console.log("fin ajout");
......@@ -132,8 +135,11 @@ function deleteHive(id,action) {
//data: 'idclient=1&idruche=25&nomruche=NomDeMaRuche',
success: function(data) {action();},
error: function (xhr, ajaxOptions, thrownError) {
console.log(xhr.responseText);
console.log(xhr.responseText);
finCharge();
afficherBd("Une erreur est survenue","Fermer");
}
});
}
......@@ -145,6 +151,7 @@ function deleteHive(id,action) {
* @int idHive : identifiant de la ruche à laquelle l'affecter
*/
function changeLogger(idLogger, serialNumber, idHive) {
charge();
$.ajax({
type: 'PATCH',
url: url+'psbox/'+ idLogger +'/update',
......@@ -158,6 +165,9 @@ function changeLogger(idLogger, serialNumber, idHive) {
//what else to do on success
},
error: function (xhr, ajaxOptions, thrownError) {
console.log(xhr.responseText);
finCharge();
afficherBd("Une erreur est survenue","Fermer");
}
});
}
......@@ -38,6 +38,8 @@ function createHiveGroup(action) {
},
error: function (xhr, ajaxOptions, thrownError) {
console.log(xhr.responseText);
finCharge();
afficherBd("Une erreur est survenue","Fermer");
}
});
console.log("fin ajout");
......
......@@ -16,7 +16,10 @@ function addCustomNote(data) {
addNoteSuccess();
},
error: function (xhr, ajaxOptions, thrownError) {
console.log(xhr.responseText);
console.log(xhr.responseText);
finCharge();
afficherBd("Une erreur est survenue","Fermer");
}
});
}
......@@ -51,7 +54,9 @@ function addCustomNoteToHive(idCustomNote) {
addCustomNoteToHiveSuccess();
},
error: function (xhr, ajaxOptions, thrownError) {
console.log(xhr.responseText);
console.log(xhr.responseText);
finCharge();
afficherBd("Une erreur est survenue","Fermer");
}
});
}
......@@ -83,7 +88,9 @@ function getCustomNotes(action,fDefault) {
action(data,fDefault,-1);
},
error: function (xhr, ajaxOptions, thrownError) {
console.log(xhr.responseText);
console.log(xhr.responseText);
finCharge();
afficherBd("Une erreur est survenue","Fermer");
}
});
}
......@@ -110,7 +117,9 @@ function getCustomNotesForHive(action, id) {
action();
},
error: function (xhr, ajaxOptions, thrownError) {
console.log(xhr.responseText);
console.log(xhr.responseText);
finCharge();
afficherBd("Une erreur est survenue","Fermer");
}
});
}
......@@ -136,9 +145,9 @@ function deleteCustomNoteForHive(idCustomNote,idx) {
deleteCustomNoteToHiveSuccess();
},
error: function (xhr, ajaxOptions, thrownError) {
console.log(xhr.responseText);
console.log(ajaxOptions);
console.log(thrownError);
console.log(xhr.responseText);
finCharge();
afficherBd("Une erreur est survenue","Fermer");
}
});
}
......
......@@ -16,7 +16,9 @@ function addDefaultNoteToHive(idDefaultNote) {
addDefaultNoteToHiveSuccess();
},
error: function (xhr, ajaxOptions, thrownError) {
console.log(xhr.responseText);
console.log(xhr.responseText);
finCharge();
afficherBd("Une erreur est survenue","Fermer");
}
});
}
......@@ -48,7 +50,9 @@ function getDefaultNotes(action) {
action(data);
},
error: function (xhr, ajaxOptions, thrownError) {
console.log(xhr.responseText);
console.log(xhr.responseText);
finCharge();
afficherBd("Une erreur est survenue","Fermer");
}
});
}
......@@ -74,7 +78,9 @@ function getDefaultNotesForHive(action, id) {
action(data, id);
},
error: function (xhr, ajaxOptions, thrownError) {
console.log(xhr.responseText);
console.log(xhr.responseText);
finCharge();
afficherBd("Une erreur est survenue","Fermer");
}
});
}
......@@ -94,9 +100,10 @@ function deleteDefaultNoteForHive(id,idx) {
deleteDefaultNoteToHiveSuccess();
},
error: function (xhr, ajaxOptions, thrownError) {
console.log(xhr.responseText);
console.log(ajaxOptions);
console.log(thrownError);
console.log(xhr.responseText);
finCharge();
afficherBd("Une erreur est survenue","Fermer");
}
});
}
......
......@@ -13,6 +13,7 @@ function inscription() {
//console.log("inscription confirmée");
var donnees = $(this).serialize();
console.log(donnees);
charge();
$.ajax({
type: 'POST',
url: url+'pscustomer/create',
......@@ -23,11 +24,14 @@ function inscription() {
success: function(data) {
console.log(data);
customer = data;
finCharge();
inscription_success(data);
},
error: function (xhr, ajaxOptions, thrownError) {
console.log(xhr.responseText);
$("#result").html(xhr.responseText);
console.log(xhr.responseText);
finCharge();
afficherBd("Une erreur est survenue","Fermer");
}
});
});
......@@ -68,7 +72,9 @@ function customer_inscription_success(donnees) {
client_inscription_success(data);
},
error: function (xhr, ajaxOptions, thrownError) {
console.log(xhr.responseText);
console.log(xhr.responseText);
finCharge();
afficherBd("Une erreur est survenue","Fermer");
}
});
}
......
......@@ -59,7 +59,9 @@ function goToGeneralParameters() {
getListHives(goToListHives);
},
error: function (xhr, ajaxOptions, thrownError) {
//console.log(xhr.responseText);
console.log(xhr.responseText);
finCharge();
afficherBd("Une erreur est survenue","Fermer");
}
});
//console.log("fin modif");
......@@ -142,7 +144,7 @@ function goToHiveGroupParameters() {
//console.log("fin modif");
},
error: function (xhr, ajaxOptions, thrownError) {
//console.log(xhr.responseText);
console.log(xhr.responseText);
finCharge();
afficherBd("Un erreur est survenue","Fermer");
}
......@@ -224,7 +226,9 @@ function goToHiveParameters() {
//console.log("fin modif");
},
error: function (xhr, ajaxOptions, thrownError) {
//console.log(xhr.responseText);
console.log(xhr.responseText);
finCharge();
afficherBd("Une erreur est survenue","Fermer");
}
});
});
......@@ -234,37 +238,6 @@ function goToHiveParameters() {
//console.log('goToHiveParameters : end');
}
function submitParamsHive(){
//console.log("début modif");
var donnees = $("#form-params-hive").serialize();
//console.log(donnees);
console.log(donneesRuches.hivegroups[idHiveGroup].hives[idHive]);
//charge();
/*$.ajax({
type: 'PATCH',
url: url+'pshive/'+donneesRuches.hivegroups[idHiveGroup].hives[idHive].id_hive + '/update',
xhrFields: {
withCredentials: true
},
data: donnees + '&apibundle_pshive%5BidHiveGroup%5D=' + donneesRuches.hivegroups[idHiveGroup].id_hive_group,
success: function(data) {
console.log(data);
//customer = data;
updateLocalHive(data);
console.log(donneesRuches.hivegroups[idHiveGroup].hives[idHive]);
/* go back to details */
/*finCharge();
goToDataHive(true);
//console.log("fin modif");
},
error: function (xhr, ajaxOptions, thrownError) {
//console.log(xhr.responseText);
}
});*/
}
/**
* display the parameters for the floor and ceiling value (launching the notifications)
*/
......@@ -317,9 +290,10 @@ function goToHiveSeuils() {
//console.log("fin modif");
},
error: function (xhr, ajaxOptions, thrownError) {
//console.log(xhr.responseText);
finCharge();
afficherBd("Une erreur est survenue","OK");
console.log(xhr.responseText);
finCharge();
afficherBd("Une erreur est survenue","Fermer");
}
});
});
......@@ -362,7 +336,10 @@ function changeHiveGroup(idHive, idHiveGroup, action) {
//console.log("fin modif");
},
error: function (xhr, ajaxOptions, thrownError) {
//console.log(xhr.responseText);
console.log(xhr.responseText);
finCharge();
afficherBd("Une erreur est survenue","Fermer");
}
});
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment