Lines 135-142
BEGIN {
Link Here
|
135 |
|
135 |
|
136 |
CalculatePriority |
136 |
CalculatePriority |
137 |
|
137 |
|
138 |
IsItemOnHoldAndFound |
|
|
139 |
|
140 |
GetMaxPatronHoldsForRecord |
138 |
GetMaxPatronHoldsForRecord |
141 |
|
139 |
|
142 |
MergeHolds |
140 |
MergeHolds |
Lines 1380-1386
sub IsAvailableForItemLevelRequest {
Link Here
|
1380 |
return $any_available ? 0 : 1; |
1378 |
return $any_available ? 0 : 1; |
1381 |
|
1379 |
|
1382 |
} else { # on_shelf_holds == 0 "If any unavailable" (the description is rather cryptic and could still be improved) |
1380 |
} else { # on_shelf_holds == 0 "If any unavailable" (the description is rather cryptic and could still be improved) |
1383 |
return $item->notforloan < 0 || $item->onloan || IsItemOnHoldAndFound( $item->itemnumber ); |
1381 |
return $item->notforloan < 0 || $item->onloan || $item->holds->filter_by_found->count; |
1384 |
} |
1382 |
} |
1385 |
} |
1383 |
} |
1386 |
|
1384 |
|
Lines 1412-1418
sub ItemsAnyAvailableAndNotRestricted {
Link Here
|
1412 |
|| $i->notforloan # items with non-zero notforloan cannot be checked out |
1410 |
|| $i->notforloan # items with non-zero notforloan cannot be checked out |
1413 |
|| $i->withdrawn |
1411 |
|| $i->withdrawn |
1414 |
|| $i->onloan |
1412 |
|| $i->onloan |
1415 |
|| IsItemOnHoldAndFound( $i->id ) |
1413 |
|| $i->holds->filter_by_found->count |
1416 |
|| ( $i->damaged |
1414 |
|| ( $i->damaged |
1417 |
&& ! C4::Context->preference('AllowHoldsOnDamagedItems') ) |
1415 |
&& ! C4::Context->preference('AllowHoldsOnDamagedItems') ) |
1418 |
|| Koha::ItemTypes->find( $i->effective_itemtype() )->notforloan |
1416 |
|| Koha::ItemTypes->find( $i->effective_itemtype() )->notforloan |
Lines 2243-2272
sub CalculatePriority {
Link Here
|
2243 |
return @row ? $row[0]+1 : 1; |
2241 |
return @row ? $row[0]+1 : 1; |
2244 |
} |
2242 |
} |
2245 |
|
2243 |
|
2246 |
=head2 IsItemOnHoldAndFound |
|
|
2247 |
|
2248 |
my $bool = IsItemFoundHold( $itemnumber ); |
2249 |
|
2250 |
Returns true if the item is currently on hold |
2251 |
and that hold has a non-null found status ( W, T, etc. ) |
2252 |
|
2253 |
=cut |
2254 |
|
2255 |
sub IsItemOnHoldAndFound { |
2256 |
my ($itemnumber) = @_; |
2257 |
|
2258 |
my $rs = Koha::Database->new()->schema()->resultset('Reserve'); |
2259 |
|
2260 |
my $found = $rs->count( |
2261 |
{ |
2262 |
itemnumber => $itemnumber, |
2263 |
found => { '!=' => undef } |
2264 |
} |
2265 |
); |
2266 |
|
2267 |
return $found; |
2268 |
} |
2269 |
|
2270 |
=head2 GetMaxPatronHoldsForRecord |
2244 |
=head2 GetMaxPatronHoldsForRecord |
2271 |
|
2245 |
|
2272 |
my $holds_per_record = ReservesControlBranch( $borrowernumber, $biblionumber ); |
2246 |
my $holds_per_record = ReservesControlBranch( $borrowernumber, $biblionumber ); |
2273 |
- |
|
|