|
Lines 476-482
sub CanItemBeReserved{
Link Here
|
| 476 |
my $borrower = C4::Members::GetMember('borrowernumber'=>$borrowernumber); |
476 |
my $borrower = C4::Members::GetMember('borrowernumber'=>$borrowernumber); |
| 477 |
|
477 |
|
| 478 |
my $controlbranch = C4::Context->preference('ReservesControlBranch'); |
478 |
my $controlbranch = C4::Context->preference('ReservesControlBranch'); |
| 479 |
my $itemtypefield = C4::Context->preference('item-level_itypes') ? "itype" : "itemtype"; |
|
|
| 480 |
|
479 |
|
| 481 |
# we retrieve user rights on this itemtype and branchcode |
480 |
# we retrieve user rights on this itemtype and branchcode |
| 482 |
my $sth = $dbh->prepare("SELECT categorycode, itemtype, branchcode, reservesallowed |
481 |
my $sth = $dbh->prepare("SELECT categorycode, itemtype, branchcode, reservesallowed |
|
Lines 524-530
sub CanItemBeReserved{
Link Here
|
| 524 |
|
523 |
|
| 525 |
$querycount .= "AND $branchfield = ?"; |
524 |
$querycount .= "AND $branchfield = ?"; |
| 526 |
|
525 |
|
| 527 |
$querycount .= " AND $itemtypefield = ?" if ($ruleitemtype ne "*"); |
526 |
# If using item-level itypes, fall back to the record |
|
|
527 |
# level itemtype if the hold has no associated item |
| 528 |
$querycount .= |
| 529 |
C4::Context->preference('item-level_itypes') |
| 530 |
? " AND COALESCE( itype, itemtype ) = ?" |
| 531 |
: " AND itemtype = ?" |
| 532 |
if ( $ruleitemtype ne "*" ); |
| 533 |
|
| 528 |
my $sthcount = $dbh->prepare($querycount); |
534 |
my $sthcount = $dbh->prepare($querycount); |
| 529 |
|
535 |
|
| 530 |
if($ruleitemtype eq "*"){ |
536 |
if($ruleitemtype eq "*"){ |
| 531 |
- |
|
|