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 282-292
sub XSLTParse4Display {
Link Here
|
282 |
$variables->{OpenURLResolverURL} = $biblio->get_openurl; |
283 |
$variables->{OpenURLResolverURL} = $biblio->get_openurl; |
283 |
} |
284 |
} |
284 |
} |
285 |
} |
285 |
my $varxml = "<variables>\n"; |
|
|
286 |
while (my ($key, $value) = each %$variables) { |
287 |
$varxml .= "<variable name=\"$key\">$value</variable>\n"; |
288 |
} |
289 |
$varxml .= "</variables>\n"; |
290 |
|
286 |
|
291 |
my $partsxml = ''; |
287 |
my $partsxml = ''; |
292 |
# possibly insert component records into Detail views |
288 |
# possibly insert component records into Detail views |
Lines 296-304
sub XSLTParse4Display {
Link Here
|
296 |
($showcomp eq 'staff' && $xslsyspref !~ m/OPAC/ ) || |
292 |
($showcomp eq 'staff' && $xslsyspref !~ m/OPAC/ ) || |
297 |
($showcomp eq 'opac' && $xslsyspref =~ m/OPAC/ ) ) { |
293 |
($showcomp eq 'opac' && $xslsyspref =~ m/OPAC/ ) ) { |
298 |
my $biblio = Koha::Biblios->find( $biblionumber ); |
294 |
my $biblio = Koha::Biblios->find( $biblionumber ); |
299 |
if ( $biblio->components() ) { |
295 |
my $max_results = 300; |
|
|
296 |
|
297 |
if ( $biblio->components($max_results) ) { |
298 |
my $search_query = Koha::Util::Search::get_component_part_query($biblionumber); |
299 |
$variables->{ComponentPartQuery} = $search_query; |
300 |
|
300 |
my @componentPartRecordXML = ('<componentPartRecords>'); |
301 |
my @componentPartRecordXML = ('<componentPartRecords>'); |
301 |
for my $cb ( @{ $biblio->components() } ) { |
302 |
for my $cb ( @{ $biblio->components($max_results) } ) { |
302 |
if( ref $cb eq 'MARC::Record'){ |
303 |
if( ref $cb eq 'MARC::Record'){ |
303 |
$cb = $cb->as_xml_record(); |
304 |
$cb = $cb->as_xml_record(); |
304 |
} else { |
305 |
} else { |
Lines 314-319
sub XSLTParse4Display {
Link Here
|
314 |
} |
315 |
} |
315 |
} |
316 |
} |
316 |
|
317 |
|
|
|
318 |
my $varxml = "<variables>\n"; |
319 |
while (my ($key, $value) = each %$variables) { |
320 |
$varxml .= "<variable name=\"$key\">$value</variable>\n"; |
321 |
} |
322 |
$varxml .= "</variables>\n"; |
323 |
|
317 |
my $sysxml = get_xslt_sysprefs(); |
324 |
my $sysxml = get_xslt_sysprefs(); |
318 |
$xmlrecord =~ s/\<\/record\>/$itemsxml$sysxml$varxml$partsxml\<\/record\>/; |
325 |
$xmlrecord =~ s/\<\/record\>/$itemsxml$sysxml$varxml$partsxml\<\/record\>/; |
319 |
if ($fixamps) { # We need to correct the ampersand entities that Zebra outputs |
326 |
if ($fixamps) { # We need to correct the ampersand entities that Zebra outputs |