Bug 23414: Use effective_itemtype

We should use effective_itemtype instead of itype to take
the item-level_itypes pref into account.
Note that we should not need to test for the existence of the key as we
now assume that item types are correctly set to a valid item type.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Jonathan Druart 2019-11-04 16:34:35 +01:00 committed by Martin Renvoize
parent 89cd2c4400
commit 032343b98d
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 4 additions and 1 deletions

View File

@ -334,7 +334,10 @@ sub buildKohaItemsNamespace {
elsif ($item->onloan) {
$status = "Checked out";
}
elsif ( $item->notforloan && $item->notforloan > 0 || $item->itype && $itemtypes->{ $item->itype }->{notforloan} && $itemtypes->{ $item->itype }->{notforloan} == 1 ) {
elsif ( $item->notforloan && $item->notforloan > 0
|| exists $itemtypes->{ $item->effective_itemtype }
&& $itemtypes->{ $item->effective_itemtype }->{notforloan} == 1 )
{
$status = "reference";
}
elsif ( $item->notforloan < 0) {