From 4629d70aead47077cce68beb4ce5d8f24f9ea683 Mon Sep 17 00:00:00 2001 From: Sam Lau Date: Thu, 13 Jun 2024 20:08:40 +0000 Subject: [PATCH] Bug 7782: Replace yes/no dropdown with checkboxes for cancelling holds This patch replaces the yes/no options for selecting which holds to cancel with checkboxes. Furthermore, a select all/none link was added to the column header for even easier selection. To test: 1) Request multiple holds (at least 3) on different bibs for the same patron. 2) Visit the patrons detail page. 3) Click on the holds table tab. 4) Notice in the "Delete?" column there is a "Yes/No" dropdown option for each hold. 5) Apply patch, restart_all 6) Notice now that there is a "Cancel?" column that has "select all | none" links along with a checkbox for each hold. 7) Click the select all link ensure it works as expect. Do the same for the select none link 8) Select one hold, then press the cancel marked holds button at the bottom. Open the table again and notice the hold was removed for the table. 9) Now press the 'select all' link and press cancel marked holds. Notice that the remaining holds are removed from the table. 10) Ensure that these holds were also correctly removed from the holds tab on that particular items page. Signed-off-by: Lucas Gass --- .../prog/en/includes/patron-detail-tabs.inc | 2 +- koha-tmpl/intranet-tmpl/prog/js/holds.js | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-detail-tabs.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-detail-tabs.inc index b220d7952a..a297101a64 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-detail-tabs.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-detail-tabs.inc @@ -168,7 +168,7 @@ Expiration Priority Notes - Delete? + Cancel?

select all | none

Suspend? Status diff --git a/koha-tmpl/intranet-tmpl/prog/js/holds.js b/koha-tmpl/intranet-tmpl/prog/js/holds.js index e7a4ffa829..e899fd4a8a 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/holds.js +++ b/koha-tmpl/intranet-tmpl/prog/js/holds.js @@ -241,10 +241,7 @@ $(document).ready(function() { { "orderable": false, "data": function( oObj ) { - return "" + return "" + "" + "" + ""; @@ -478,4 +475,14 @@ $(document).ready(function() { $("#hold-actions-form").submit(); return false; }); + + $("#CheckAllHolds").on("click",function(){ + $(".cancel_hold:visible").prop("checked", true); + return false; + }); + $("#UncheckAllHolds").on("click",function(){ + $(".cancel_hold:visible").prop("checked", false); + return false; + }); + }); -- 2.39.2