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