notforloan from items.ccode->itemtypes.notforloan instead of bi.itemtype
authorRyan Higgins <rch@liblime.com>
Wed, 7 Nov 2007 18:12:20 +0000 (12:12 -0600)
committerJoshua Ferraro <jmf@liblime.com>
Thu, 8 Nov 2007 23:12:01 +0000 (17:12 -0600)
(by syspref)

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/Biblio.pm

index 451e072..f0257fc 100644 (file)
@@ -257,8 +257,8 @@ sub AddItem {
     ( $item->{'biblioitemnumber'}, $itemtype ) = $sth->fetchrow;
     $sth =
       $dbh->prepare(
-        "SELECT notforloan FROM itemtypes WHERE itemtype='$itemtype'");
-    $sth->execute();
+        "SELECT notforloan FROM itemtypes WHERE itemtype=?");
+    $sth->execute( C4::Context->preference('item-level_itype') ? $item->{'ccode'} : $itemtype );
     my $notforloan = $sth->fetchrow;
     ##Change the notforloan field if $notforloan found
     if ( $notforloan > 0 ) {