|
Lines 335-340
sub buildKohaItemsNamespace {
Link Here
|
| 335 |
$items_rs = Koha::Items->new; |
335 |
$items_rs = Koha::Items->new; |
| 336 |
} |
336 |
} |
| 337 |
|
337 |
|
|
|
338 |
# adding linked items that belong to host records |
| 339 |
if ( C4::Context->preference('EasyAnalyticalRecords') ) { |
| 340 |
my $marcflavor = C4::Context->preference("marcflavour"); |
| 341 |
my $analyticsfield = '773'; |
| 342 |
if ( $marcflavor eq 'MARC21' ) { |
| 343 |
$analyticsfield = '773'; |
| 344 |
} elsif ( $marcflavor eq 'UNIMARC' ) { |
| 345 |
$analyticsfield = '461'; |
| 346 |
} |
| 347 |
my $marcrecord = Koha::Biblios->find($biblionumber)->metadata->record; |
| 348 |
my $query_linked = []; |
| 349 |
foreach my $hostfield ( $marcrecord->field($analyticsfield) ) { |
| 350 |
my $hostbiblionumber = $hostfield->subfield("0"); |
| 351 |
my $linkeditemnumber = $hostfield->subfield("9"); |
| 352 |
if ( $hostbiblionumber && $linkeditemnumber ) { |
| 353 |
push @$query_linked, |
| 354 |
{ |
| 355 |
'me.biblionumber' => $hostbiblionumber, |
| 356 |
'me.itemnumber' => { '=' => $linkeditemnumber, not_in => $hidden_items } |
| 357 |
}; |
| 358 |
} |
| 359 |
} |
| 360 |
if (@$query_linked) { |
| 361 |
unshift @$query_linked, $query; |
| 362 |
$query = { "-or" => $query_linked }; |
| 363 |
} |
| 364 |
} |
| 365 |
|
| 338 |
my $items = |
366 |
my $items = |
| 339 |
$items_rs->search( $query, { prefetch => [ 'current_branchtransfers', 'reserves', 'tmp_holdsqueue' ] } ); |
367 |
$items_rs->search( $query, { prefetch => [ 'current_branchtransfers', 'reserves', 'tmp_holdsqueue' ] } ); |
| 340 |
|
368 |
|
| 341 |
- |
|
|