Lines 229-235
my $all_holds = {
Link Here
|
229 |
map { $_->biblionumber => $_ } @{ Koha::Holds->search( |
229 |
map { $_->biblionumber => $_ } @{ Koha::Holds->search( |
230 |
{ reserve_id => [ values %$holds_biblios_map ]}, |
230 |
{ reserve_id => [ values %$holds_biblios_map ]}, |
231 |
{ |
231 |
{ |
232 |
prefetch => [ 'borrowernumber', 'itembib', 'biblio' ], |
232 |
prefetch => [ 'borrowernumber', 'itembib', 'biblio', 'item_group' ], |
233 |
} |
233 |
} |
234 |
)->as_list |
234 |
)->as_list |
235 |
} |
235 |
} |
Lines 265-270
foreach my $bibnum ( @biblionumbers ){
Link Here
|
265 |
} |
265 |
} |
266 |
$hold_info->{itemtypes} = \@res_itemtypes; |
266 |
$hold_info->{itemtypes} = \@res_itemtypes; |
267 |
|
267 |
|
|
|
268 |
my $res_info = $all_holds->{$bibnum}; |
269 |
|
268 |
# get available values for each biblio |
270 |
# get available values for each biblio |
269 |
my $fields = { |
271 |
my $fields = { |
270 |
locations => 'location', |
272 |
locations => 'location', |
Lines 282-287
foreach my $bibnum ( @biblionumbers ){
Link Here
|
282 |
[ uniq map { defined $_->$field ? $_->$field : () } @$items ]; |
284 |
[ uniq map { defined $_->$field ? $_->$field : () } @$items ]; |
283 |
} |
285 |
} |
284 |
|
286 |
|
|
|
287 |
if ( $res_info->item_group ) { |
288 |
$hold_info->{barcodes} = [ uniq map { defined $_->barcode && $_->item_group->id == $res_info->item_group_id ? $_->barcode : () } @$items ]; |
289 |
} |
290 |
|
285 |
# items available |
291 |
# items available |
286 |
$hold_info->{items_count} = $items_count; |
292 |
$hold_info->{items_count} = $items_count; |
287 |
|
293 |
|
Lines 292-302
foreach my $bibnum ( @biblionumbers ){
Link Here
|
292 |
$hold_info->{pull_count} = $pull_count; |
298 |
$hold_info->{pull_count} = $pull_count; |
293 |
|
299 |
|
294 |
# get other relevant information |
300 |
# get other relevant information |
295 |
my $res_info = $all_holds->{$bibnum}; |
|
|
296 |
$hold_info->{patron} = $res_info->patron; |
301 |
$hold_info->{patron} = $res_info->patron; |
297 |
$hold_info->{item} = $res_info->item; |
302 |
$hold_info->{item} = $res_info->item; |
298 |
$hold_info->{biblio} = $res_info->biblio; |
303 |
$hold_info->{biblio} = $res_info->biblio; |
299 |
$hold_info->{hold} = $res_info; |
304 |
$hold_info->{hold} = $res_info; |
|
|
305 |
$hold_info->{item_group} = $res_info->item_group; |
300 |
|
306 |
|
301 |
push @holds_info, $hold_info; |
307 |
push @holds_info, $hold_info; |
302 |
} |
308 |
} |