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