Lines 222-227
my $patrons_count = {
Link Here
|
222 |
} |
222 |
} |
223 |
}; |
223 |
}; |
224 |
|
224 |
|
|
|
225 |
my $all_holds = { |
226 |
map { $_->biblionumber => $_ } @{ Koha::Holds->search( |
227 |
{%where}, |
228 |
{ |
229 |
prefetch => [ 'borrowernumber', 'itembib', 'biblio' ], |
230 |
order_by => 'priority', |
231 |
alias => 'reserve', |
232 |
group_by => 'reserve.biblionumber', |
233 |
} |
234 |
)->as_list |
235 |
} |
236 |
}; |
237 |
|
238 |
|
225 |
# make final holds_info array and fill with info |
239 |
# make final holds_info array and fill with info |
226 |
my @holds_info; |
240 |
my @holds_info; |
227 |
foreach my $bibnum ( @biblionumbers ){ |
241 |
foreach my $bibnum ( @biblionumbers ){ |
Lines 275-287
foreach my $bibnum ( @biblionumbers ){
Link Here
|
275 |
$hold_info->{pull_count} = $pull_count; |
289 |
$hold_info->{pull_count} = $pull_count; |
276 |
|
290 |
|
277 |
# get other relevant information |
291 |
# get other relevant information |
278 |
my $res_info = Koha::Holds->search( |
292 |
my $res_info = $all_holds->{$bibnum}; |
279 |
{ 'reserve.biblionumber' => $bibnum, %where }, |
|
|
280 |
{ prefetch => [ 'borrowernumber', 'itembib', 'biblio' ], |
281 |
order_by => 'priority', |
282 |
alias => 'reserve' |
283 |
} |
284 |
)->next; # get first item in results |
285 |
$hold_info->{patron} = $res_info->patron; |
293 |
$hold_info->{patron} = $res_info->patron; |
286 |
$hold_info->{item} = $res_info->item; |
294 |
$hold_info->{item} = $res_info->item; |
287 |
$hold_info->{biblio} = $res_info->biblio; |
295 |
$hold_info->{biblio} = $res_info->biblio; |
288 |
- |
|
|