Bug 36920

Summary: Greater/less than search option on item search page to Barcode-drop-down menu
Product: Koha Reporter: Tuomas Kunttu <tuomas.kunttu>
Component: SearchingAssignee: Emmi Takkinen <emmi.takkinen>
Status: Signed Off --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: emmi.takkinen, katariina.pohto, kyle, lucas
Version: MainKeywords: release-notes-needed
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This enhancement adds greater than and less than search options on item search page field drop-down menu. With them staff can search e.g. items which have release year starting from specific year.
Version(s) released in:
Circulation function:
Attachments: Barcode search section on item search page
Bug 36920: Greater/less than search option for item search page field drop-down menu
Bug 36920: Greater/less than search option for item search page field drop-down menu
Bug 36920: Greater/less than search option for item search page field drop-down menu
Bug 36920: Tidy file
Bug 36920: Greater/less than search option for item search page field drop-down menu
Bug 36920: Tidy file

Description Tuomas Kunttu 2024-05-22 09:59:46 UTC
Created attachment 167017 [details]
Barcode search section on item search page

In the search section on the item search page, where the drop-down menu has a barcode search by default (see attachment image), it would be useful to have the option to do greater/less than searches as well. Now there are only is/is not options.

When searching publication year in this menu, this functionality would be useful. This way you could search for works that have been published before/after a certain year. In addition, custom search fields can be added to the menu. These can be, for example, acquisition date or lastseen date. Also with these fields greater/less than searches would be useful.

In fields containing letters, greater/less than searches are not necessarily very useful, but not harmful either.
Comment 1 Katariina Pohto 2024-05-23 11:59:18 UTC
Created attachment 167105 [details] [review]
Bug 36920: Greater/less than search option for item search page field drop-down menu

This patch adds '>' and '<' operators to the search.

1. Go to item search page and navigate to the field drop-down menu (default value Barcode).
2. Note that the operator choices for this search menu are 'is' and 'is not'.
3. Apply patch and refresh cache.
4. Navigate back to the menu and note that the operator menu now includes '<' and '>'.
5. Select one of the new values and refresh page to see that the selection stays.
6. Test a field or several with the new operators to see that the new operators are working as intended.
Comment 2 David Nind 2024-05-30 23:09:53 UTC
Created attachment 167296 [details] [review]
Bug 36920: Greater/less than search option for item search page field drop-down menu

The field drop-down menu (including custom fields) can currently only use operators 'is' (LIKE)
and 'is not' (NOT LIKE). Greater and less than operators would be useful especially for date fields.
This patch adds '>' and '<' operators to the search.

1. Go to item search page and navigate to the field drop-down menu (default value Barcode).
2. Note that the operator choices for this search menu are 'is' and 'is not'.
3. Apply patch and refresh cache.
4. Navigate back to the menu and note that the operator menu now includes '<' and '>'.
5. Choose one of the new values and refresh page to see that the selection remains.
6. Test a field or several with the new operators to see that the new operators are working as intended.

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Emmi Takkinen 2025-05-15 07:27:52 UTC
Created attachment 182475 [details] [review]
Bug 36920: Greater/less than search option for item search page field drop-down menu

The field drop-down menu (including custom fields) can currently only use operators 'is' (LIKE)
and 'is not' (NOT LIKE). Greater and less than operators would be useful especially for date fields.
This patch adds '>' and '<' operators to the search.

1. Go to item search page and navigate to the field drop-down menu (default value Barcode).
2. Note that the operator choices for this search menu are 'is' and 'is not'.
3. Apply patch and refresh cache.
4. Navigate back to the menu and note that the operator menu now includes '<' and '>'.
5. Choose one of the new values and refresh page to see that the selection remains.
6. Test a field or several with the new operators to see that the new operators are working as intended.

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 Lucas Gass (lukeg) 2025-11-05 14:32:55 UTC
This patch is not tidy.
Comment 5 Emmi Takkinen 2025-11-07 06:18:46 UTC
Created attachment 189250 [details] [review]
Bug 36920: Tidy file
Comment 6 Emmi Takkinen 2025-11-07 06:19:01 UTC
Tidied file.
Comment 7 Owen Leonard 2025-11-07 12:43:21 UTC
Created attachment 189303 [details] [review]
Bug 36920: Greater/less than search option for item search page field drop-down menu

The field drop-down menu (including custom fields) can currently only
use operators 'is' (LIKE) and 'is not' (NOT LIKE). Greater and less than
operators would be useful especially for date fields. This patch adds
'>' and '<' operators to the search.

1. Go to item search page and navigate to the field drop-down menu
   (default value Barcode).
2. Note that the operator choices for this search menu are 'is' and 'is
   not'.
3. Apply patch and refresh cache.
4. Navigate back to the menu and note that the operator menu now
   includes '<' and '>'.
5. Choose one of the new values and refresh page to see that the
   selection remains.
6. Test a field or several with the new operators to see that the new
   operators are working as intended.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 8 Owen Leonard 2025-11-07 12:43:24 UTC
Created attachment 189304 [details] [review]
Bug 36920: Tidy file

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 9 Emmi Takkinen 2025-12-04 10:48:46 UTC
Added release notes.