Bug 41254 - The filter for item status in item tables should be improved
Summary: The filter for item status in item tables should be improved
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 37334
Blocks:
  Show dependency treegraph
 
Reported: 2025-11-16 18:40 UTC by Mathieu Saby
Modified: 2025-12-10 21:39 UTC (History)
6 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This enhancement groups the values for the records detail page status column filter on the holdings table in the staff interface. This makes it easier to select the appropriate status value, as it can correspond to multiple authorised values, for example, Not for loan, Withdrawn, Lost and Damaged. Until now, only a single entry could be selected, and filtering applied to all values at once.
Version(s) released in:
Circulation function:


Attachments
Bug 41254: Allow filtering by all authorised values for multi-valued statuses (8.17 KB, patch)
2025-11-25 14:54 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 41254: Replace '*' with arrow (1.87 KB, patch)
2025-12-01 15:06 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 41254: Add '(all)' for top-level entries (1.76 KB, patch)
2025-12-01 15:10 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 41254: Allow filtering by all authorised values for multi-valued statuses (8.13 KB, patch)
2025-12-09 10:17 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 41254: Replace '*' with arrow (1.87 KB, patch)
2025-12-09 10:17 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 41254: Add '(all)' for top-level entries (1.76 KB, patch)
2025-12-09 10:17 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 41254: Allow filtering by all authorised values for multi-valued statuses (8.17 KB, patch)
2025-12-10 21:39 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 41254: Replace '*' with arrow (1.92 KB, patch)
2025-12-10 21:39 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 41254: Add '(all)' for top-level entries (1.81 KB, patch)
2025-12-10 21:39 UTC, Owen Leonard
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Mathieu Saby 2025-11-16 18:40:20 UTC
In the table of items under a record, the filter on status created by Bug 37334 does not meet all the needs of a library because it groups together many different scenarios (in processing, on order, etc.) under a single status, "Not for loan."

It is not possible to use this filter to isolate items on order, which is a frequent use case.

I don't know what would be the best way to improve this filter. Perhaps we could add the different specific statuses provided for each value of notforloan<>0, prefixing them with "Not for loan" so that they appear close together
- Excluded from loan (being processed)
- Excluded from loan (on order)
- Excluded from loan (non loanable itemtype)
etc.
And keep the global "Not for loan" renamed as "Not for loan (all reasons)".
Comment 1 Fridolin Somers 2025-11-19 13:55:22 UTC
Or create a new column for "not for loan" ?
Comment 2 Mathieu Saby 2025-11-20 15:56:31 UTC
Not sure...
The table is already very wide (and Koha handles this poorly in terms of UX, with screen overflow), and we've just added a new column for locations.
Comment 3 Jonathan Druart 2025-11-25 14:54:01 UTC
Created attachment 189928 [details] [review]
Bug 41254: Allow filtering by all authorised values for multi-valued statuses

Some item statuses can correspond to multiple authorised values: Not for loan, Withdrawn, Lost and Damaged.
Until now, only a single entry could be selected, and filtering applied to all values at once.

This change introduces finer-grained filtering by exposing each authorised value individually in the filter.

Test plan:
Assign multiple authorised values to items on a bibliographic record for the four affected attributes: Not for loan, Withdrawn, Lost and Damaged.
Use the "Status" filter and verify that each value behaves as expected.

Display note:
The current dropdown presentation is not ideal.
Suggestions for improvement are welcome, although avoiding optgroup would be preferable to keep the scope small.
Comment 4 Jonathan Druart 2025-11-25 14:56:12 UTC
https://snipboard.io/4lIdgx.jpg
Comment 5 Mathieu Saby 2025-11-26 10:24:23 UTC
Thank you!
I tested on a sandbox, it works fine.
Maybe "* " could be replaced with "> " ? Not sure what would be the best

"* Not for loan" (based on itemtype I guess?) in "Not for loan" category is weird, but it is Koha's terminology. Maybe we could rephrase it a bit, like  "Not for loan itemtype" ?

Of course the list is very long, but libraries can easily hide unwanted options in the list with CSS or JS (we did it, I don't remember how but it was not difficult)
Comment 6 Jonathan Druart 2025-12-01 10:22:06 UTC
(In reply to Mathieu Saby from comment #5)
> Thank you!
> I tested on a sandbox, it works fine.
> Maybe "* " could be replaced with "> " ? Not sure what would be the best

I think we should either wait for QA or for more feedback once it's pushed.

> "* Not for loan" (based on itemtype I guess?) in "Not for loan" category is
> weird, but it is Koha's terminology. Maybe we could rephrase it a bit, like 
> "Not for loan itemtype" ?

Or with '(all)' maybe?

Owen, any good ideas here?
Comment 7 Jonathan Druart 2025-12-01 15:06:42 UTC
Created attachment 190051 [details] [review]
Bug 41254: Replace '*' with arrow

Patch from commit 6e15e99
Comment 8 Jonathan Druart 2025-12-01 15:10:29 UTC
Created attachment 190052 [details] [review]
Bug 41254: Add '(all)' for top-level entries

Patch from commit 88a4aa8
Comment 9 Jonathan Druart 2025-12-01 15:10:34 UTC
(In reply to Jonathan Druart from comment #4)
> https://snipboard.io/4lIdgx.jpg

And with the last 2 patches: https://snipboard.io/4rDpCB.jpg
Comment 10 David Nind 2025-12-07 04:36:40 UTC
The patches no longer apply 8-(...

git bz apply 41254

Bug 41254 - The filter for item status in item tables should be improved

189928 - Bug 41254: Allow filtering by all authorised values for multi-valued statuses
190051 - Bug 41254: Replace '*' with arrow
190052 - Bug 41254: Add '(all)' for top-level entries

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 41254: Allow filtering by all authorised values for multi-valued statuses
Using index info to reconstruct a base tree...
M	Koha/Items.pm
M	koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc
M	t/db_dependent/Koha/Items.t
Falling back to patching base and 3-way merge...
Auto-merging t/db_dependent/Koha/Items.t
Auto-merging koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc
CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc
Auto-merging Koha/Items.pm
error: Failed to merge in the changes.
Patch failed at 0001 Bug 41254: Allow filtering by all authorised values for multi-valued statuses
Comment 11 Jonathan Druart 2025-12-09 10:17:38 UTC
Created attachment 190345 [details] [review]
Bug 41254: Allow filtering by all authorised values for multi-valued statuses

Some item statuses can correspond to multiple authorised values: Not for loan, Withdrawn, Lost and Damaged.
Until now, only a single entry could be selected, and filtering applied to all values at once.

This change introduces finer-grained filtering by exposing each authorised value individually in the filter.

Test plan:
Assign multiple authorised values to items on a bibliographic record for the four affected attributes: Not for loan, Withdrawn, Lost and Damaged.
Use the "Status" filter and verify that each value behaves as expected.

Display note:
The current dropdown presentation is not ideal.
Suggestions for improvement are welcome, although avoiding optgroup would be preferable to keep the scope small.
Comment 12 Jonathan Druart 2025-12-09 10:17:40 UTC
Created attachment 190346 [details] [review]
Bug 41254: Replace '*' with arrow

Patch from commit 29ba30f
Comment 13 Jonathan Druart 2025-12-09 10:17:41 UTC
Created attachment 190347 [details] [review]
Bug 41254: Add '(all)' for top-level entries

Patch from commit 0f0897f
Comment 14 Owen Leonard 2025-12-10 21:39:42 UTC
Created attachment 190427 [details] [review]
Bug 41254: Allow filtering by all authorised values for multi-valued statuses

Some item statuses can correspond to multiple authorised values: Not
for loan, Withdrawn, Lost and Damaged. Until now, only a single entry
could be selected, and filtering applied to all values at once.

This change introduces finer-grained filtering by exposing each
authorised value individually in the filter.

Test plan:
Assign multiple authorised values to items on a bibliographic record
for the four affected attributes: Not for loan, Withdrawn, Lost and
Damaged. Use the "Status" filter and verify that each value behaves as
expected.

Display note:
The current dropdown presentation is not ideal.
Suggestions for improvement are welcome, although avoiding optgroup
would be preferable to keep the scope small.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 15 Owen Leonard 2025-12-10 21:39:45 UTC
Created attachment 190428 [details] [review]
Bug 41254: Replace '*' with arrow

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 16 Owen Leonard 2025-12-10 21:39:48 UTC
Created attachment 190429 [details] [review]
Bug 41254: Add '(all)' for top-level entries

Signed-off-by: Owen Leonard <oleonard@myacpl.org>