Lines 28-33
use C4::Koha qw( xml_escape );
Link Here
|
28 |
use C4::Biblio qw( GetAuthorisedValueDesc GetFrameworkCode GetMarcStructure ); |
28 |
use C4::Biblio qw( GetAuthorisedValueDesc GetFrameworkCode GetMarcStructure ); |
29 |
use Koha::AuthorisedValues; |
29 |
use Koha::AuthorisedValues; |
30 |
use Koha::ItemTypes; |
30 |
use Koha::ItemTypes; |
|
|
31 |
use Koha::Util::Search; |
31 |
use Koha::XSLT::Base; |
32 |
use Koha::XSLT::Base; |
32 |
use Koha::Libraries; |
33 |
use Koha::Libraries; |
33 |
|
34 |
|
Lines 279-289
sub XSLTParse4Display {
Link Here
|
279 |
$variables->{OpenURLResolverURL} = $biblio->get_openurl; |
280 |
$variables->{OpenURLResolverURL} = $biblio->get_openurl; |
280 |
} |
281 |
} |
281 |
} |
282 |
} |
282 |
my $varxml = "<variables>\n"; |
|
|
283 |
while (my ($key, $value) = each %$variables) { |
284 |
$varxml .= "<variable name=\"$key\">$value</variable>\n"; |
285 |
} |
286 |
$varxml .= "</variables>\n"; |
287 |
|
283 |
|
288 |
my $partsxml = ''; |
284 |
my $partsxml = ''; |
289 |
# possibly insert component records into Detail views |
285 |
# possibly insert component records into Detail views |
Lines 293-301
sub XSLTParse4Display {
Link Here
|
293 |
($showcomp eq 'staff' && $xslsyspref !~ m/OPAC/ ) || |
289 |
($showcomp eq 'staff' && $xslsyspref !~ m/OPAC/ ) || |
294 |
($showcomp eq 'opac' && $xslsyspref =~ m/OPAC/ ) ) { |
290 |
($showcomp eq 'opac' && $xslsyspref =~ m/OPAC/ ) ) { |
295 |
my $biblio = Koha::Biblios->find( $biblionumber ); |
291 |
my $biblio = Koha::Biblios->find( $biblionumber ); |
296 |
if ( $biblio->components() ) { |
292 |
my $max_results = 300; |
|
|
293 |
|
294 |
if ( $biblio->components($max_results) ) { |
295 |
my $search_query = Koha::Util::Search::get_component_part_query($biblionumber); |
296 |
$variables->{ComponentPartQuery} = $search_query; |
297 |
|
297 |
my @componentPartRecordXML = ('<componentPartRecords>'); |
298 |
my @componentPartRecordXML = ('<componentPartRecords>'); |
298 |
for my $cb ( @{ $biblio->components() } ) { |
299 |
for my $cb ( @{ $biblio->components($max_results) } ) { |
299 |
if( ref $cb eq 'MARC::Record'){ |
300 |
if( ref $cb eq 'MARC::Record'){ |
300 |
$cb = $cb->as_xml_record(); |
301 |
$cb = $cb->as_xml_record(); |
301 |
} else { |
302 |
} else { |
Lines 311-316
sub XSLTParse4Display {
Link Here
|
311 |
} |
312 |
} |
312 |
} |
313 |
} |
313 |
|
314 |
|
|
|
315 |
my $varxml = "<variables>\n"; |
316 |
while (my ($key, $value) = each %$variables) { |
317 |
$varxml .= "<variable name=\"$key\">$value</variable>\n"; |
318 |
} |
319 |
$varxml .= "</variables>\n"; |
320 |
|
314 |
my $sysxml = get_xslt_sysprefs(); |
321 |
my $sysxml = get_xslt_sysprefs(); |
315 |
$xmlrecord =~ s/\<\/record\>/$itemsxml$sysxml$varxml$partsxml\<\/record\>/; |
322 |
$xmlrecord =~ s/\<\/record\>/$itemsxml$sysxml$varxml$partsxml\<\/record\>/; |
316 |
if ($fixamps) { # We need to correct the ampersand entities that Zebra outputs |
323 |
if ($fixamps) { # We need to correct the ampersand entities that Zebra outputs |