mirror of https://gitlab.crans.org/bde/nk20
Some lines of the base.js file mysteriously disappeared...
This commit is contained in:
parent
8751b3936e
commit
c8fe3435de
|
@ -335,39 +335,45 @@ function autoCompleteNote(field_id, note_list_id, notes, notes_display, alias_pr
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#validate_" + id).html("<i class='fa fa-spinner'></i>");
|
});// end getJSON alias
|
||||||
|
});
|
||||||
|
}// end function autocomplete
|
||||||
|
|
||||||
// Perform a PATCH request to the API in order to update the transaction
|
|
||||||
// If the user has insufficient rights, an error message will appear
|
|
||||||
$.ajax({
|
|
||||||
"url": "/api/note/transaction/transaction/" + id + "/",
|
|
||||||
type: "PATCH",
|
|
||||||
dataType: "json",
|
|
||||||
headers: {
|
|
||||||
"X-CSRFTOKEN": CSRF_TOKEN
|
|
||||||
},
|
|
||||||
data: {
|
|
||||||
"resourcetype": "RecurrentTransaction",
|
|
||||||
"valid": !validated,
|
|
||||||
"invalidity_reason": invalidity_reason,
|
|
||||||
},
|
|
||||||
success: function () {
|
|
||||||
// Refresh jQuery objects
|
|
||||||
$(".validate").click(de_validate);
|
|
||||||
|
|
||||||
refreshBalance();
|
// When a validate button is clicked, we switch the validation status
|
||||||
// error if this method doesn't exist. Please define it.
|
function de_validate(id, validated) {
|
||||||
refreshHistory();
|
let invalidity_reason = $("#invalidity_reason_" + id).val();
|
||||||
},
|
$("#validate_" + id).html("<strong style=\"font-size: 16pt;\">⟳ ...</strong>");
|
||||||
error: function (err) {
|
|
||||||
addMsg("Une erreur est survenue lors de la validation/dévalidation " +
|
|
||||||
"de cette transaction : " + err.responseText, "danger");
|
|
||||||
|
|
||||||
refreshBalance();
|
// Perform a PATCH request to the API in order to update the transaction
|
||||||
// error if this method doesn't exist. Please define it.
|
// If the user has insufficient rights, an error message will appear
|
||||||
refreshHistory();
|
$.ajax({
|
||||||
}
|
"url": "/api/note/transaction/transaction/" + id + "/",
|
||||||
});
|
type: "PATCH",
|
||||||
});
|
dataType: "json",
|
||||||
|
headers: {
|
||||||
|
"X-CSRFTOKEN": CSRF_TOKEN
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
"resourcetype": "RecurrentTransaction",
|
||||||
|
"valid": !validated,
|
||||||
|
"invalidity_reason": invalidity_reason,
|
||||||
|
},
|
||||||
|
success: function () {
|
||||||
|
// Refresh jQuery objects
|
||||||
|
$(".validate").click(de_validate);
|
||||||
|
|
||||||
|
refreshBalance();
|
||||||
|
// error if this method doesn't exist. Please define it.
|
||||||
|
refreshHistory();
|
||||||
|
},
|
||||||
|
error: function (err) {
|
||||||
|
addMsg("Une erreur est survenue lors de la validation/dévalidation " +
|
||||||
|
"de cette transaction : " + err.responseText, "danger");
|
||||||
|
|
||||||
|
refreshBalance();
|
||||||
|
// error if this method doesn't exist. Please define it.
|
||||||
|
refreshHistory();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue