Lines 283-293
sub XSLTParse4Display {
Link Here
|
283 |
} |
283 |
} |
284 |
} |
284 |
} |
285 |
|
285 |
|
286 |
my $partsxml = ''; |
286 |
# possibly show analytics link in Detail views |
287 |
# possibly insert component records into Detail views |
|
|
288 |
if ($xslsyspref =~ m/Details/) { |
287 |
if ($xslsyspref =~ m/Details/) { |
289 |
$biblio //= Koha::Biblios->find( $biblionumber ); |
288 |
$biblio //= Koha::Biblios->find( $biblionumber ); |
290 |
my $components = $biblio->get_marc_analytics(300); |
289 |
my $components = $biblio->get_marc_analytics(); |
291 |
$variables->{show_analytics_link} = ( scalar @{$components} == 0 ) ? 0 : 1; |
290 |
$variables->{show_analytics_link} = ( scalar @{$components} == 0 ) ? 0 : 1; |
292 |
|
291 |
|
293 |
my $showcomp = C4::Context->preference('ShowComponentRecords'); |
292 |
my $showcomp = C4::Context->preference('ShowComponentRecords'); |
Lines 298-322
sub XSLTParse4Display {
Link Here
|
298 |
|| ( $showcomp eq 'opac' && $xslsyspref =~ m/OPAC/ ) ) |
297 |
|| ( $showcomp eq 'opac' && $xslsyspref =~ m/OPAC/ ) ) |
299 |
) |
298 |
) |
300 |
{ |
299 |
{ |
301 |
|
|
|
302 |
$variables->{show_analytics_link} = 0; |
300 |
$variables->{show_analytics_link} = 0; |
303 |
|
|
|
304 |
my $search_query = $biblio->get_analytics_query; |
305 |
$variables->{ComponentPartQuery} = $search_query; |
306 |
|
307 |
my @componentPartRecordXML = ('<componentPartRecords>'); |
308 |
for my $cb ( @{ $components } ) { |
309 |
if( ref $cb eq 'MARC::Record'){ |
310 |
$cb = $cb->as_xml_record(); |
311 |
} else { |
312 |
$cb = decode('utf8', $cb); |
313 |
} |
314 |
# Remove the xml header |
315 |
$cb =~ s/^<\?xml.*?\?>//; |
316 |
push @componentPartRecordXML,$cb; |
317 |
} |
318 |
push @componentPartRecordXML, '</componentPartRecords>'; |
319 |
$partsxml = join "\n", @componentPartRecordXML; |
320 |
} |
301 |
} |
321 |
} |
302 |
} |
322 |
|
303 |
|
Lines 327-333
sub XSLTParse4Display {
Link Here
|
327 |
$varxml .= "</variables>\n"; |
308 |
$varxml .= "</variables>\n"; |
328 |
|
309 |
|
329 |
my $sysxml = get_xslt_sysprefs(); |
310 |
my $sysxml = get_xslt_sysprefs(); |
330 |
$xmlrecord =~ s/\<\/record\>/$itemsxml$sysxml$varxml$partsxml\<\/record\>/; |
311 |
$xmlrecord =~ s/\<\/record\>/$itemsxml$sysxml$varxml\<\/record\>/; |
331 |
if ($fixamps) { # We need to correct the ampersand entities that Zebra outputs |
312 |
if ($fixamps) { # We need to correct the ampersand entities that Zebra outputs |
332 |
$xmlrecord =~ s/\&amp;/\&/g; |
313 |
$xmlrecord =~ s/\&amp;/\&/g; |
333 |
$xmlrecord =~ s/\&\;lt\;/\<\;/g; |
314 |
$xmlrecord =~ s/\&\;lt\;/\<\;/g; |