From 8246b899a5d858b3d17b0f6fcd1fa470501831fc Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 13 Jun 2014 15:27:45 +0200 Subject: [PATCH] Bug 12419: Not for loan items are not listed On the cataloguing search (cataloguing/addbook.pl), if an item has a notforloan value > 0, the item is not listed in the Location column. It is quite confusing, the current behavior let patrons believe that there is not item for the biblio (or less than the real count). Test plan: 1/ Create 2 biblio records A and B 2/ Create some items for A 3/ Create 1+ item(s) for B with a notforloan status > 0 4/ Reindex both records 5/ Launch a search on the cataloguing module and verify that the notforloan items are not listed in the 'Location' column. 6/ Apply this patch and verify the not for loan items are listed ("Not for loan (XXX)"). --- C4/Search.pm | 4 ++++ koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/C4/Search.pm b/C4/Search.pm index d18c8ae..6ca0b61 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1842,6 +1842,7 @@ sub searchResults { my $item_in_transit_count = 0; my $can_place_holds = 0; my $item_onhold_count = 0; + my $notforloan_count = 0; my $items_count = scalar(@fields); my $maxitems_pref = C4::Context->preference('maxItemsinSearchResults'); my $maxitems = $maxitems_pref ? $maxitems_pref - 1 : 1; @@ -1912,6 +1913,8 @@ sub searchResults { # item is on order if ( $item->{notforloan} < 0 ) { $ordered_count++; + } elsif ( $item->{notforloan} > 0 ) { + $notforloan_count++; } # is item in transit? @@ -2051,6 +2054,7 @@ sub searchResults { $oldbiblio->{intransitcount} = $item_in_transit_count; $oldbiblio->{onholdcount} = $item_onhold_count; $oldbiblio->{orderedcount} = $ordered_count; + $oldbiblio->{notforloancount} = $notforloan_count; if (C4::Context->preference("AlternateHoldingsField") && $items_count == 0) { my $fieldspec = C4::Context->preference("AlternateHoldingsField"); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt index d2ab6a8..c1d278c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt @@ -144,7 +144,8 @@ [% IF ( resultsloo.onloancount ) %] Checked out ([% resultsloo.onloancount %]),
[% END %] [% IF ( resultsloo.withdrawncount ) %] Withdrawn ([% resultsloo.withdrawncount %]),
[% END %] [% IF ( resultsloo.itemlostcount ) %] Lost ([% resultsloo.itemlostcount %])
[% END %] - [% IF ( resultsloo.orderedcount ) %] On order ([% resultsloo.orderedcount %])[% END %] + [% IF ( resultsloo.orderedcount ) %] On order ([% resultsloo.orderedcount %])
[% END %] + [% IF ( resultsloo.notforloancount ) %] Not for loan ([% resultsloo.notforloancount %])[% END %] MARC | Card -- 2.0.0.rc2