View | Details | Raw Unified | Return to bug 5675
Collapse All | Expand All

(-)a/C4/Reserves.pm (-8 / +22 lines)
Lines 760-776 sub CheckReserves { Link Here
760
    my ( $item, $barcode ) = @_;
760
    my ( $item, $barcode ) = @_;
761
    my $dbh = C4::Context->dbh;
761
    my $dbh = C4::Context->dbh;
762
    my $sth;
762
    my $sth;
763
    my $select = "
763
    my $select;
764
    SELECT items.biblionumber,
764
    if (C4::Context->preference('item-level_itypes')){
765
	$select = "
766
           SELECT items.biblionumber,
765
           items.biblioitemnumber,
767
           items.biblioitemnumber,
766
           itemtypes.notforloan,
768
           itemtypes.notforloan,
767
           items.notforloan AS itemnotforloan,
769
           items.notforloan AS itemnotforloan,
768
           items.itemnumber
770
           items.itemnumber
769
    FROM   items
771
           FROM   items
770
    LEFT JOIN biblioitems ON items.biblioitemnumber = biblioitems.biblioitemnumber
772
           LEFT JOIN biblioitems ON items.biblioitemnumber = biblioitems.biblioitemnumber
771
    LEFT JOIN itemtypes   ON biblioitems.itemtype   = itemtypes.itemtype
773
           LEFT JOIN itemtypes   ON items.itype   = itemtypes.itemtype
772
    ";
774
        ";
773
775
    }
776
    else {
777
	$select = "
778
           SELECT items.biblionumber,
779
           items.biblioitemnumber,
780
           itemtypes.notforloan,
781
           items.notforloan AS itemnotforloan,
782
           items.itemnumber
783
           FROM   items
784
           LEFT JOIN biblioitems ON items.biblioitemnumber = biblioitems.biblioitemnumber
785
           LEFT JOIN itemtypes   ON biblioitems.itemtype   = itemtypes.itemtype
786
        ";
787
    }
788
   
774
    if ($item) {
789
    if ($item) {
775
        $sth = $dbh->prepare("$select WHERE itemnumber = ?");
790
        $sth = $dbh->prepare("$select WHERE itemnumber = ?");
776
        $sth->execute($item);
791
        $sth->execute($item);
777
- 

Return to bug 5675