From ffdf535fc82acafcfccf959c60e921cf76702b9d Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 31 Jul 2025 15:21:04 +0000 Subject: [PATCH] Bug 40567: Correct eslint errors in recalls.js This patch corrects a few minor errors in recalls.js. There should be no change to how the pages work. The following functions have been changed: - Cancel a recall from the recalls tab on a patron record - Expire a recall or revert the waiting status of a recall from the "Recalls awaiting pickup" page. - Cancel a recall which has been transferred from the "Recalls queue" page. - Mark a recall "Overdue" from the "Recalls queue" page. - Cancel selected recalls on the "Recalls queue" page. Sponsored-by: Athens County Public Libraries --- koha-tmpl/intranet-tmpl/prog/js/recalls.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/recalls.js b/koha-tmpl/intranet-tmpl/prog/js/recalls.js index 1da935810a9..bb543333ae2 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/recalls.js +++ b/koha-tmpl/intranet-tmpl/prog/js/recalls.js @@ -1,10 +1,12 @@ +/* global APIClient __ confirmDelete */ $(document).ready(function () { const client = APIClient.recall; - $(".cancel_recall").click(function (e) { + $(".cancel_recall").click(function () { if (confirmDelete(__("Are you sure you want to remove this recall?"))) { let td_node = $(this).parents("td"); let recall_id = $(this).data("id"); + let message; client.recalls.cancel(recall_id).then( success => { if (success.success == 0) { @@ -23,10 +25,11 @@ $(document).ready(function () { } }); - $(".expire_recall").click(function (e) { + $(".expire_recall").click(function () { if (confirmDelete(__("Are you sure you want to expire this recall?"))) { let td_node = $(this).parents("td"); let recall_id = $(this).data("id"); + let message; client.recalls.expire(recall_id).then( success => { if (success.success == 0) { @@ -45,7 +48,7 @@ $(document).ready(function () { } }); - $(".revert_recall").click(function (e) { + $(".revert_recall").click(function () { if ( confirmDelete( __( @@ -55,6 +58,7 @@ $(document).ready(function () { ) { let td_node = $(this).parents("td"); let recall_id = $(this).data("id"); + let message; client.recalls.revert(recall_id).then( success => { if (success.success == 0) { @@ -73,7 +77,7 @@ $(document).ready(function () { } }); - $(".overdue_recall").click(function (e) { + $(".overdue_recall").click(function () { if ( confirmDelete( __("Are you sure you want to mark this recall as overdue?") @@ -81,6 +85,7 @@ $(document).ready(function () { ) { let td_node = $(this).parents("td"); let recall_id = $(this).data("id"); + let message; client.recalls.overdue(recall_id).then( success => { if (success.success == 0) { @@ -99,7 +104,7 @@ $(document).ready(function () { } }); - $(".transit_recall").click(function (e) { + $(".transit_recall").click(function () { if ( confirmDelete( __( @@ -109,6 +114,7 @@ $(document).ready(function () { ) { let td_node = $(this).parents("td"); let recall_id = $(this).data("id"); + let message; client.recalls.transit(recall_id).then( success => { if (success.success == 0) { @@ -133,7 +139,7 @@ $(document).ready(function () { pagingType: "full_numbers", }); - $("#cancel_selected").click(function (e) { + $("#cancel_selected").click(function () { if ($("input[name='recall_ids']:checked").length > 0) { return confirmDelete( __("Are you sure you want to remove the selected recall(s)?") -- 2.39.5