From 081ee504b35aa4517325451b4915bc20e5c67bbe Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Tue, 30 Sep 2025 12:41:48 +0000 Subject: [PATCH] Bug 40908: Remove JS confirmation, fix link, fix modal To test: 1. Without the patch: -Clicking delete from the Actions button -> delete pops up both a JS alert and a BS confirmation modal. The deletion works. -Clicking the "Delete item" button that appears when you hover over any cell pops up both a JS alert and a BS confirmation modal. The deletion does NOT work. -The "Cancel" button in the delete-item-modal does nothing. 2. APPLY THE PATCH: -Clicking delete from the Actions button -> 1 modal for confirmation. The deletion works. -Clicking the "Delete item" button that appears when you hover over any cell pops up only a modal confirmation. The deletion works. -The "Cancel" button in the delete-item-modal properly closes the modal. Signed-off-by: Jason Signed-off-by: Brendan Lawlor --- .../modals/delete_item_confirmation.inc | 2 +- .../prog/js/cataloging_additem.js | 20 +++++++++---------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/modals/delete_item_confirmation.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/modals/delete_item_confirmation.inc index 4dbcc64e24..d54b9873a7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/modals/delete_item_confirmation.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/modals/delete_item_confirmation.inc @@ -23,7 +23,7 @@ diff --git a/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js b/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js index 507bfa9b4e..1de2bda6e1 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js +++ b/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js @@ -35,7 +35,7 @@ $(document).ready(function () { ); $(edit_link).text(LABEL_EDIT_ITEM); var delete_link = $( - '' ); @@ -153,18 +153,16 @@ $(document).ready(function () { $(document).on("click", ".delete", function (e) { e.preventDefault(); - if (confirmDelete(MSG_CONFIRM_DELETE_ITEM)) { - var itemnumber = $(this).data("itemnumber"); - var hasSerialItem = $(this).data("has-serial-item"); + var itemnumber = $(this).data("itemnumber"); + var hasSerialItem = $(this).data("has-serial-item"); - $("#delete-item-itemnumber").val(itemnumber); - $("#delete_associated_serial_issues").attr("checked", false); - $("#delete-item-modal-btn-submit").data("item", itemnumber); - if (!hasSerialItem) { - $(".form-group").hide(); - } - $("#delete-item-modal").modal("show"); + $("#delete-item-itemnumber").val(itemnumber); + $("#delete_associated_serial_issues").attr("checked", false); + $("#delete-item-modal-btn-submit").data("item", itemnumber); + if (!hasSerialItem) { + $(".form-group").hide(); } + $("#delete-item-modal").modal("show"); }); $(document).on("click", "#delete-item-modal-btn-submit", function (e) { e.preventDefault(); -- 2.39.5