From 295094dbf40f5b7d7d7bf978b59c129ac6f46a5d Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 15 Aug 2025 18:55:36 +0000 Subject: [PATCH] Bug 38438: Forget item selections on a new search This patch adds a new checkbox to the item search "Forget item selections from previous search" This way, selections are remembered when paginating, and can optionally be kept between searches, but defaults to clearing the storage on a enw search. To test: 1 - Do an item search for books, select two items 2 - Batch modify those items 3 - Do a new item search for music 4 - Select two items 5 - Batch delete them 6 - Note 4 items are going to be deleted 7 - Apply patch 8 - Start a new item search for books from centerville 9 - Note the form option to forget previous selections, leave it checked 10 - Do the search, select two items, batch modify, only 2! 11 - Start a new item search, uncheck the box, search 12 - Select two and batch modify, 4 items are sent! 13 - Popcorn! Signed-off-by: Ludovic Julien --- .../intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt index 81149316752..0a6e6cdecec 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt @@ -236,6 +236,10 @@ Go to advanced search +
+ + +
[% INCLUDE form_field_select name="homebranch" options = branches %] [% INCLUDE form_field_select name="holdingbranch" options = branches %] @@ -744,6 +748,9 @@ $('#itemsearchform').submit(function() { var searchform = $(this); + if( $("#forget_item_selections").is(':checked') ){ + localStorage.removeItem("item_search_selections"); + } var format = searchform.find('input[name="format"]:checked').val(); if (format == 'html') { submitForm(searchform); -- 2.43.0