Lines 248-254
sub XSLTParse4Display {
Link Here
|
248 |
my $xslsyspref = $params->{xsl_syspref}; |
248 |
my $xslsyspref = $params->{xsl_syspref}; |
249 |
my $fixamps = $params->{fix_amps}; |
249 |
my $fixamps = $params->{fix_amps}; |
250 |
my $hidden_items = $params->{hidden_items} || []; |
250 |
my $hidden_items = $params->{hidden_items} || []; |
251 |
my $variables = $params->{xslt_variables}; |
251 |
my $variables = $params->{xslt_variables} // {}; |
252 |
my $items_rs = $params->{items_rs}; |
252 |
my $items_rs = $params->{items_rs}; |
253 |
|
253 |
|
254 |
my $xslfilename = get_xsl_filename( $xslsyspref); |
254 |
my $xslfilename = get_xsl_filename( $xslsyspref); |
Lines 263-286
sub XSLTParse4Display {
Link Here
|
263 |
} |
263 |
} |
264 |
my $xmlrecord = $record->as_xml(C4::Context->preference('marcflavour')); |
264 |
my $xmlrecord = $record->as_xml(C4::Context->preference('marcflavour')); |
265 |
|
265 |
|
266 |
$variables ||= {}; |
|
|
267 |
my $biblio; |
268 |
if (C4::Context->preference('OPACShowOpenURL')) { |
269 |
my @biblio_itemtypes; |
270 |
$biblio //= Koha::Biblios->find($biblionumber); |
271 |
if (C4::Context->preference('item-level_itypes')) { |
272 |
@biblio_itemtypes = $biblio->items->get_column("itype"); |
273 |
} else { |
274 |
push @biblio_itemtypes, $biblio->itemtype; |
275 |
} |
276 |
my @itypes = split( /\s/, C4::Context->preference('OPACOpenURLItemTypes') ); |
277 |
my %original = (); |
278 |
map { $original{$_} = 1 } @biblio_itemtypes; |
279 |
if ( grep { $original{$_} } @itypes ) { |
280 |
$variables->{OpenURLResolverURL} = $biblio->get_openurl; |
281 |
} |
282 |
} |
283 |
|
284 |
my $varxml = "<variables>\n"; |
266 |
my $varxml = "<variables>\n"; |
285 |
while (my ($key, $value) = each %$variables) { |
267 |
while (my ($key, $value) = each %$variables) { |
286 |
$varxml .= "<variable name=\"$key\">$value</variable>\n"; |
268 |
$varxml .= "<variable name=\"$key\">$value</variable>\n"; |