Lines 263-269
sub XSLTParse4Display {
Link Here
|
263 |
if ( $xslsyspref eq "OPACXSLTDetailsDisplay" || $xslsyspref eq "XSLTDetailsDisplay" || $xslsyspref eq "XSLTResultsDisplay" ) { |
263 |
if ( $xslsyspref eq "OPACXSLTDetailsDisplay" || $xslsyspref eq "XSLTDetailsDisplay" || $xslsyspref eq "XSLTResultsDisplay" ) { |
264 |
$itemsxml = ""; #We don't use XSLT for items display on these pages |
264 |
$itemsxml = ""; #We don't use XSLT for items display on these pages |
265 |
} else { |
265 |
} else { |
266 |
$itemsxml = buildKohaItemsNamespace($biblionumber, $hidden_items, $items_rs); |
266 |
$itemsxml = buildKohaItemsNamespace($biblionumber, $hidden_items, $items_rs, $record); |
267 |
} |
267 |
} |
268 |
my $xmlrecord = $record->as_xml(C4::Context->preference('marcflavour')); |
268 |
my $xmlrecord = $record->as_xml(C4::Context->preference('marcflavour')); |
269 |
|
269 |
|
Lines 324-343
Is only used in this module currently.
Link Here
|
324 |
=cut |
324 |
=cut |
325 |
|
325 |
|
326 |
sub buildKohaItemsNamespace { |
326 |
sub buildKohaItemsNamespace { |
327 |
my ($biblionumber, $hidden_items, $items_rs) = @_; |
327 |
my ($biblionumber, $hidden_items, $items_rs, $record) = @_; |
328 |
|
328 |
|
329 |
$hidden_items ||= []; |
329 |
$hidden_items ||= []; |
330 |
|
330 |
|
331 |
my $query = {}; |
|
|
332 |
$query = { 'me.itemnumber' => { not_in => $hidden_items } } |
333 |
if $hidden_items; |
334 |
|
335 |
unless ( $items_rs && ref($items_rs) eq 'Koha::Items' ) { |
331 |
unless ( $items_rs && ref($items_rs) eq 'Koha::Items' ) { |
336 |
$query->{'me.biblionumber'} = $biblionumber; |
332 |
# adding linked items that belong to host records |
337 |
$items_rs = Koha::Items->new; |
333 |
my @linkeditemnumbers; |
|
|
334 |
if ( C4::Context->preference('EasyAnalyticalRecords') ) { |
335 |
my $analyticsfield = C4::Context->preference("marcflavour") eq 'UNIMARC' ? '461' : '773'; |
336 |
@linkeditemnumbers = map { $_->subfield('9') } $record->field($analyticsfield); |
337 |
} |
338 |
|
339 |
$items_rs = Koha::Items->search( |
340 |
[ |
341 |
'me.biblionumber' => $biblionumber, |
342 |
'me.itemnumber' => { in => \@linkeditemnumbers }, |
343 |
] |
344 |
); |
338 |
} |
345 |
} |
339 |
|
346 |
|
340 |
my $items = $items_rs->search( $query, { prefetch => [ 'branchtransfers', 'reserves' ] } ); |
347 |
my $items = $items_rs->search( |
|
|
348 |
{ 'me.itemnumber' => { not_in => $hidden_items } }, |
349 |
{ prefetch => [ 'branchtransfers', 'reserves' ] } |
350 |
); |
341 |
|
351 |
|
342 |
my $shelflocations = |
352 |
my $shelflocations = |
343 |
{ map { $_->{authorised_value} => $_->{opac_description} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => "", kohafield => 'items.location' } ) }; |
353 |
{ map { $_->{authorised_value} => $_->{opac_description} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => "", kohafield => 'items.location' } ) }; |
344 |
- |
|
|