Bug 33646 - "Cataloging search" missing important data for not for loan items
Summary: "Cataloging search" missing important data for not for loan items
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-02 01:20 UTC by David Cook
Modified: 2024-10-21 22:34 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 33646: Better organize availability in cataloging search (4.91 KB, patch)
2023-11-16 06:02 UTC, David Cook
Details | Diff | Splinter Review
Bug 33646: Better organize availability in cataloging search (4.96 KB, patch)
2023-11-24 21:58 UTC, David Nind
Details | Diff | Splinter Review
Bug 33646: Better organize availability in cataloging search (5.00 KB, patch)
2023-12-01 10:30 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 33646: Better organize availability in cataloging search (5.05 KB, patch)
2023-12-01 10:31 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description David Cook 2023-05-02 01:20:49 UTC
In the "Cataloging search" (ie /cgi-bin/koha/cataloguing/addbooks.pl), the branch name doesn't appear for "Not for loan" items, which makes the display nonsensical when there are many not for loan items for many branches.

It's also inconsistent with the "Search results" (ie /cgi-bin/koha/catalogue/search.pl).
Comment 1 Jonathan Druart 2023-05-10 08:44:40 UTC
Which display do you suggest?
Comment 2 David Cook 2023-05-10 23:52:13 UTC
(In reply to Jonathan Druart from comment #1)
> Which display do you suggest?

The "Search results" display is the better display for sure. 

It looks like ./koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt defines a BLOCK that could be re-used on ./koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt if it were refactored and moved into an include...

Although that's just in terms of the information provided. I'm not sure it would work stylistically...
Comment 3 Lucas Gass (lukeg) 2023-07-12 21:21:24 UTC
The same is true for checked out items. No location information is displayed. Only "Checked out (x)"
Comment 4 Julia Robbins 2023-07-12 21:36:37 UTC
It's showing up on ours as well! Makes no sense and ALL our materials are not for loan.
Comment 5 David Cook 2023-07-17 00:05:51 UTC
I've kept this issue open in my local tracker, but it's very low on my priority list :/
Comment 6 David Cook 2023-11-16 05:31:28 UTC
(In reply to Lucas Gass from comment #3)
> The same is true for checked out items. No location information is
> displayed. Only "Checked out (x)"

It looks like the data comes straight from searchResults and is displayed like this:

<span class="unavailable">
    [% IF ( resultsloo.onloancount ) %] <span>Checked out ([% resultsloo.onloancount | html %])</span>,<br /> [% END %]
    [% IF ( resultsloo.withdrawncount ) %] <span>Withdrawn ([% resultsloo.withdrawncount | html %])</span>,<br /> [% END %]
    [% IF ( resultsloo.itemlostcount ) %] <span>Lost ([% resultsloo.itemlostcount | html %])</span><br />[% END %]
    [% IF ( resultsloo.recalledcount ) %] <span>Waiting to fill recall ([% resultsloo.recalled | html %])</span>[% END %]
    [% IF ( resultsloo.onholdcount ) %] <span>Waiting on hold ([% resultsloo.onholdcount | html %])</span>[% END %]
</span>

Whereas for notforloan it's displayed a bit differently. That said, there is a "onloan_items_loop" which could be used to display the items...

<span class="notforloan">
    [% IF ( resultsloo.other_items_loop ) %]
        [% FOREACH items_loo IN resultsloo.other_items_loop %]
            [% IF ( items_loo.notforloan ) %][% items_loo.notforloan | html %] ([% items_loo.count | html %])<br />[% END %]
        [% END %]
    [% END %]
</span>

It's a bit of a mess...
Comment 7 David Cook 2023-11-16 06:02:09 UTC
Created attachment 159020 [details] [review]
Bug 33646: Better organize availability in cataloging search

This change adds "Available", "Unavailable", and "Not for loan"
categories in the availability cell of the "cataloging search"
found at /cgi-bin/koha/cataloguing/addbooks.pl

This change also adds missing location information for the
"Not for loan" items.

Test plan:
0. Apply the patch
1. Add available, checked out, and not for loan items for a test record
(like "Gairm" in koha-testing-docker)
2. Go to the cataloging search,
http://localhost:8081/cgi-bin/koha/cataloguing/addbooks.pl?q=test
3. Note that the items in the "Location" column now have labels
to differentiate which items are available, unavailable, and not for loan.
4. Note that the "Not for loan" data is similar to the "Available" data
Comment 8 David Cook 2023-11-16 06:02:44 UTC
While I think we should ultimately retire the "Cataloging search", this at least makes it a bit more usable.
Comment 9 David Nind 2023-11-24 21:58:53 UTC
Created attachment 159246 [details] [review]
Bug 33646: Better organize availability in cataloging search

This change adds "Available", "Unavailable", and "Not for loan"
categories in the availability cell of the "cataloging search"
found at /cgi-bin/koha/cataloguing/addbooks.pl

This change also adds missing location information for the
"Not for loan" items.

Test plan:
0. Apply the patch
1. Add available, checked out, and not for loan items for a test record
(like "Gairm" in koha-testing-docker)
2. Go to the cataloging search,
http://localhost:8081/cgi-bin/koha/cataloguing/addbooks.pl?q=test
3. Note that the items in the "Location" column now have labels
to differentiate which items are available, unavailable, and not for loan.
4. Note that the "Not for loan" data is similar to the "Available" data

Signed-off-by: David Nind <david@davidnind.com>
Comment 10 Marcel de Rooy 2023-12-01 10:30:24 UTC
(In reply to David Cook from comment #8)
> While I think we should ultimately retire the "Cataloging search", this at
> least makes it a bit more usable.

Agreed.
Comment 11 Marcel de Rooy 2023-12-01 10:30:59 UTC Comment hidden (obsolete)
Comment 12 Marcel de Rooy 2023-12-01 10:31:15 UTC
Created attachment 159438 [details] [review]
Bug 33646: Better organize availability in cataloging search

This change adds "Available", "Unavailable", and "Not for loan"
categories in the availability cell of the "cataloging search"
found at /cgi-bin/koha/cataloguing/addbooks.pl

This change also adds missing location information for the
"Not for loan" items.

Test plan:
0. Apply the patch
1. Add available, checked out, and not for loan items for a test record
(like "Gairm" in koha-testing-docker)
2. Go to the cataloging search,
http://localhost:8081/cgi-bin/koha/cataloguing/addbooks.pl?q=test
3. Note that the items in the "Location" column now have labels
to differentiate which items are available, unavailable, and not for loan.
4. Note that the "Not for loan" data is similar to the "Available" data

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 13 Marcel de Rooy 2023-12-01 10:31:51 UTC
Moved to enh
Comment 14 Katrin Fischer 2024-01-30 13:20:50 UTC
There are issues with this patch:

- With this patch applied we always have the "Available" sub-heading, even on records with no items. 
- When one item is "damaged" it will now show, but the "nor for loan" sub-heading will still show. And it's falsely formatted in italic. Possibly inherited?

You check for the loop size, but then only items with notforloan are displayed - I haven't tested/checked what other items might be in the loop, but damaged seems to be:

+                                                [% IF ( resultsloo.other_items_loop.size ) %]
+                                                    <div class="results_unavailable">Not for loan:</div>
                                                     [% FOREACH items_loo IN resultsloo.other_items_loop %]
-                                                        [% IF ( items_loo.notforloan ) %][% items_loo.notforloan | html %] ([% items_loo.count | html %])<br />[% END %]
+                                                        [% IF ( items_loo.notforloan ) %]


Please fix!
Comment 15 Martin Renvoize (ashimema) 2024-07-04 08:46:27 UTC
Still intending to come back here David?
Comment 16 David Cook 2024-07-05 00:26:41 UTC
(In reply to Martin Renvoize from comment #15)
> Still intending to come back here David?

Probably not. Something needs to happen here, but I see it as high effort low reward.
Comment 17 Marie-Luce Laflamme 2024-10-21 15:11:43 UTC
Any chance this could be fixed? Thanks.
Comment 18 David Cook 2024-10-21 22:34:12 UTC
(In reply to Marie-Luce Laflamme from comment #17)
> Any chance this could be fixed? Thanks.

I'm happy for someone to takeover my patch, as it's unlikely I'll work on it again.

Resetting assignee to default...