Update card.php

This commit is contained in:
Laurent Destailleur 2021-09-09 14:29:42 +02:00 committed by GitHub
parent 0d9280f945
commit 97f3296c73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -565,6 +565,7 @@ if ($action == 'create') {
print '<script>'; print '<script>';
print '$( document ).ready(function() {'; print '$( document ).ready(function() {';
print '$("#updateAmountWithLastSalary").on("click", function updateAmountWithLastSalary() { print '$("#updateAmountWithLastSalary").on("click", function updateAmountWithLastSalary() {
console.log("We click on link to autofill salary amount");
var fk_user = $("#fk_user").val() var fk_user = $("#fk_user").val()
var url = "'.DOL_URL_ROOT.'/salaries/ajax/ajaxsalaries.php?fk_user="+fk_user; var url = "'.DOL_URL_ROOT.'/salaries/ajax/ajaxsalaries.php?fk_user="+fk_user;
if (fk_user != -1) { if (fk_user != -1) {
@ -584,7 +585,6 @@ if ($action == 'create') {
} else { } else {
console.error("Error: Ajax url "+url+" has returned the wrong key."); console.error("Error: Ajax url "+url+" has returned the wrong key.");
} }
} else { } else {
console.error("Error: Ajax url "+url+" has returned an empty page."); console.error("Error: Ajax url "+url+" has returned an empty page.");
} }