Lines 510-516
sub CanItemBeReserved{
Link Here
|
510 |
return 'ageRestricted' if $daysToAgeRestriction && $daysToAgeRestriction > 0; |
510 |
return 'ageRestricted' if $daysToAgeRestriction && $daysToAgeRestriction > 0; |
511 |
|
511 |
|
512 |
my $controlbranch = C4::Context->preference('ReservesControlBranch'); |
512 |
my $controlbranch = C4::Context->preference('ReservesControlBranch'); |
513 |
my $itemtypefield = C4::Context->preference('item-level_itypes') ? "itype" : "itemtype"; |
|
|
514 |
|
513 |
|
515 |
# we retrieve user rights on this itemtype and branchcode |
514 |
# we retrieve user rights on this itemtype and branchcode |
516 |
my $sth = $dbh->prepare("SELECT categorycode, itemtype, branchcode, reservesallowed |
515 |
my $sth = $dbh->prepare("SELECT categorycode, itemtype, branchcode, reservesallowed |
Lines 558-564
sub CanItemBeReserved{
Link Here
|
558 |
|
557 |
|
559 |
$querycount .= "AND $branchfield = ?"; |
558 |
$querycount .= "AND $branchfield = ?"; |
560 |
|
559 |
|
561 |
$querycount .= " AND $itemtypefield = ?" if ($ruleitemtype ne "*"); |
560 |
# If using item-level itypes, fall back to the record |
|
|
561 |
# level itemtype if the hold has no associated item |
562 |
$querycount .= |
563 |
C4::Context->preference('item-level_itypes') |
564 |
? " AND COALESCE( itype, itemtype ) = ?" |
565 |
: " AND itemtype = ?" |
566 |
if ( $ruleitemtype ne "*" ); |
567 |
|
562 |
my $sthcount = $dbh->prepare($querycount); |
568 |
my $sthcount = $dbh->prepare($querycount); |
563 |
|
569 |
|
564 |
if($ruleitemtype eq "*"){ |
570 |
if($ruleitemtype eq "*"){ |
565 |
- |
|
|