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

(-)a/C4/Reserves.pm (-3 / +8 lines)
Lines 493-499 sub CanItemBeReserved{ Link Here
493
    my $borrower = C4::Members::GetMember('borrowernumber'=>$borrowernumber);     
493
    my $borrower = C4::Members::GetMember('borrowernumber'=>$borrowernumber);     
494
    
494
    
495
    my $controlbranch = C4::Context->preference('ReservesControlBranch');
495
    my $controlbranch = C4::Context->preference('ReservesControlBranch');
496
    my $itemtypefield = C4::Context->preference('item-level_itypes') ? "itype" : "itemtype";
497
496
498
    # we retrieve user rights on this itemtype and branchcode
497
    # we retrieve user rights on this itemtype and branchcode
499
    my $sth = $dbh->prepare("SELECT categorycode, itemtype, branchcode, reservesallowed 
498
    my $sth = $dbh->prepare("SELECT categorycode, itemtype, branchcode, reservesallowed 
Lines 541-547 sub CanItemBeReserved{ Link Here
541
    
540
    
542
    $querycount .= "AND $branchfield = ?";
541
    $querycount .= "AND $branchfield = ?";
543
    
542
    
544
    $querycount .= " AND $itemtypefield = ?" if ($ruleitemtype ne "*");
543
    # If using item-level itypes, fall back to the record
544
    # level itemtype if the hold has no associated item
545
    $querycount .=
546
      C4::Context->preference('item-level_itypes')
547
      ? " AND COALESCE( itype, itemtype ) = ?"
548
      : " AND itemtype = ?"
549
      if ( $ruleitemtype ne "*" );
550
545
    my $sthcount = $dbh->prepare($querycount);
551
    my $sthcount = $dbh->prepare($querycount);
546
    
552
    
547
    if($ruleitemtype eq "*"){
553
    if($ruleitemtype eq "*"){
548
- 

Return to bug 12632