followup to holds policies - fix itype
authorGalen Charlton <galen.charlton@liblime.com>
Thu, 15 Jan 2009 21:26:18 +0000 (15:26 -0600)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Tue, 26 May 2009 19:14:55 +0000 (21:14 +0200)
Overriding items.itype from biblioitems.itemtype
is needed only with item-level_itypes is OFF.

[LL bug 321]

Signed-off-by: Daniel Sweeney <daniel.sweeney@liblime.com>
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Henri-Damien LAURENT <henridamien.laurent@biblibre.com>
reserve/request.pl

index 874b8b2..e5db2f2 100755 (executable)
@@ -256,10 +256,13 @@ foreach my $biblioitemnumber (@biblioitemnumbers) {
       my $itemnumber ( @{ $itemnumbers_of_biblioitem{$biblioitemnumber} } )
     {
         my $item = $iteminfos_of->{$itemnumber};
-    $item->{itypename} = $itemtypes->{ $item->{itype} }{description};
-    $item->{imageurl} = getitemtypeimagelocation( 'intranet', $itemtypes->{ $item->{itype} }{imageurl} );
-        $item->{homebranchname} =
-          $branches->{ $item->{homebranch} }{branchname};
+        unless (C4::Context->preference('item-level_itypes')) {
+            $item->{itype} = $biblioitem->{itemtype};
+        }
+
+        $item->{itypename} = $itemtypes->{ $item->{itype} }{description};
+        $item->{imageurl} = getitemtypeimagelocation( 'intranet', $itemtypes->{ $item->{itype} }{imageurl} );
+        $item->{homebranchname} = $branches->{ $item->{homebranch} }{branchname};
 
         # if the holdingbranch is different than the homebranch, we show the
         # holdingbranch of the document too