From 6b24c067a1145e8853ff19a39bdcc2fd2595d73c Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 23 Mar 2023 17:15:48 +0000 Subject: [PATCH] Bug 33322: Refine click handler for suggestion batch operations The handler for suggestion batch operations looks for clicks on "button[type='submit']" which is not very specific. With the new staff interface this ends up including the header search form. This patch modifies the markup of the batch operations section of the template and makes the click handler more specific so that only the right buttons are affected. To test, apply the patch and go to Suggestions. - In the header search form, perform a catalog search. You should be able to click the submit button to successfully initiate the search. - Without checking a checkbox associated with any open suggestion, test the batch operation buttons at the bottom: - Change status - Change item type - Update manager - Delete - Archive All should trigger a JS alert, "Please select at least one suggestion" - Test each batch operation with one or more suggestions selected and confirm that the operation completes successfully. Signed-off-by: Laura Escamilla Signed-off-by: Nick Clemens --- .../intranet-tmpl/prog/en/modules/suggestion/suggestion.tt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt index 1363134a66..2f2df3a5d6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt @@ -888,7 +888,7 @@

Change selected suggestions

-
+
@@ -1416,7 +1416,7 @@ $("#" + target).toggle(); }); - $("button[type='submit']").on("click", function(e) { + $("button[type='submit']", "#suggestions_batch_ops").on("click", function(e) { var submit_button = this; var form = $(submit_button).parents("form"); var action = $(submit_button).val(); -- 2.30.2