|
Lines 137-144
BEGIN {
Link Here
|
| 137 |
|
137 |
|
| 138 |
CalculatePriority |
138 |
CalculatePriority |
| 139 |
|
139 |
|
| 140 |
IsItemOnHoldAndFound |
|
|
| 141 |
|
| 142 |
GetMaxPatronHoldsForRecord |
140 |
GetMaxPatronHoldsForRecord |
| 143 |
|
141 |
|
| 144 |
MergeHolds |
142 |
MergeHolds |
|
Lines 1421-1427
sub IsAvailableForItemLevelRequest {
Link Here
|
| 1421 |
return $any_available ? 0 : 1; |
1419 |
return $any_available ? 0 : 1; |
| 1422 |
|
1420 |
|
| 1423 |
} else { # on_shelf_holds == 0 "If any unavailable" (the description is rather cryptic and could still be improved) |
1421 |
} else { # on_shelf_holds == 0 "If any unavailable" (the description is rather cryptic and could still be improved) |
| 1424 |
return $item->notforloan < 0 || $item->onloan || IsItemOnHoldAndFound( $item->itemnumber ); |
1422 |
return $item->notforloan < 0 || $item->onloan || $item->holds->filter_by_found->count; |
| 1425 |
} |
1423 |
} |
| 1426 |
} |
1424 |
} |
| 1427 |
|
1425 |
|
|
Lines 1453-1459
sub ItemsAnyAvailableAndNotRestricted {
Link Here
|
| 1453 |
|| $i->notforloan # items with non-zero notforloan cannot be checked out |
1451 |
|| $i->notforloan # items with non-zero notforloan cannot be checked out |
| 1454 |
|| $i->withdrawn |
1452 |
|| $i->withdrawn |
| 1455 |
|| $i->onloan |
1453 |
|| $i->onloan |
| 1456 |
|| IsItemOnHoldAndFound( $i->id ) |
1454 |
|| $i->holds->filter_by_found->count |
| 1457 |
|| ( $i->damaged |
1455 |
|| ( $i->damaged |
| 1458 |
&& ! C4::Context->preference('AllowHoldsOnDamagedItems') ) |
1456 |
&& ! C4::Context->preference('AllowHoldsOnDamagedItems') ) |
| 1459 |
|| Koha::ItemTypes->find( $i->effective_itemtype() )->notforloan |
1457 |
|| Koha::ItemTypes->find( $i->effective_itemtype() )->notforloan |
|
Lines 2283-2312
sub CalculatePriority {
Link Here
|
| 2283 |
return @row ? $row[0]+1 : 1; |
2281 |
return @row ? $row[0]+1 : 1; |
| 2284 |
} |
2282 |
} |
| 2285 |
|
2283 |
|
| 2286 |
=head2 IsItemOnHoldAndFound |
|
|
| 2287 |
|
| 2288 |
my $bool = IsItemFoundHold( $itemnumber ); |
| 2289 |
|
| 2290 |
Returns true if the item is currently on hold |
| 2291 |
and that hold has a non-null found status ( W, T, etc. ) |
| 2292 |
|
| 2293 |
=cut |
| 2294 |
|
| 2295 |
sub IsItemOnHoldAndFound { |
| 2296 |
my ($itemnumber) = @_; |
| 2297 |
|
| 2298 |
my $rs = Koha::Database->new()->schema()->resultset('Reserve'); |
| 2299 |
|
| 2300 |
my $found = $rs->count( |
| 2301 |
{ |
| 2302 |
itemnumber => $itemnumber, |
| 2303 |
found => { '!=' => undef } |
| 2304 |
} |
| 2305 |
); |
| 2306 |
|
| 2307 |
return $found; |
| 2308 |
} |
| 2309 |
|
| 2310 |
=head2 GetMaxPatronHoldsForRecord |
2284 |
=head2 GetMaxPatronHoldsForRecord |
| 2311 |
|
2285 |
|
| 2312 |
my $holds_per_record = ReservesControlBranch( $borrowernumber, $biblionumber ); |
2286 |
my $holds_per_record = ReservesControlBranch( $borrowernumber, $biblionumber ); |
| 2313 |
- |
|
|