"Feuille de staff mise à jour via Ajax"

This commit is contained in:
2018-03-06 16:07:47 +01:00
parent 4ff620e51a
commit 31fd1aba52
3 changed files with 31 additions and 26 deletions

View File

@@ -60,14 +60,18 @@ function save_turn() {
}
}
function update_sheet(turn, slot) {
document.location = '/staffsheet/update/'+turn+'/'+slot;
function update_sheet(obj, turn, slot) {
var url = '/staffsheet/update/'+turn+'/'+slot;
get_html_from_ajax(obj, url);
obj.onclick=function (){ return clear_sheet(obj, turn, slot);}
return true;
}
function clear_sheet(turn, slot) {
function clear_sheet(obj, turn, slot) {
if (confirm("Voulez-vous vraiment libérer ce créneau ? \n\n Confirmer ?")) {
document.location = '/staffsheet/clear/'+turn+'/'+slot;
var url = '/staffsheet/clear/'+turn+'/'+slot;
get_html_from_ajax(obj, url);
obj.onclick=function (){ return update_sheet(obj, turn, slot);}
}
return false;
}