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 265-275
sub XSLTParse4Display {
Link Here
|
265 |
$variables->{OpenURLResolverURL} = $biblio->get_openurl; |
266 |
$variables->{OpenURLResolverURL} = $biblio->get_openurl; |
266 |
} |
267 |
} |
267 |
} |
268 |
} |
268 |
my $varxml = "<variables>\n"; |
|
|
269 |
while (my ($key, $value) = each %$variables) { |
270 |
$varxml .= "<variable name=\"$key\">$value</variable>\n"; |
271 |
} |
272 |
$varxml .= "</variables>\n"; |
273 |
|
269 |
|
274 |
my $partsxml = ''; |
270 |
my $partsxml = ''; |
275 |
# possibly insert component records into Detail views |
271 |
# possibly insert component records into Detail views |
Lines 279-287
sub XSLTParse4Display {
Link Here
|
279 |
($showcomp eq 'staff' && $xslsyspref !~ m/OPAC/ ) || |
275 |
($showcomp eq 'staff' && $xslsyspref !~ m/OPAC/ ) || |
280 |
($showcomp eq 'opac' && $xslsyspref =~ m/OPAC/ ) ) { |
276 |
($showcomp eq 'opac' && $xslsyspref =~ m/OPAC/ ) ) { |
281 |
my $biblio = Koha::Biblios->find( $biblionumber ); |
277 |
my $biblio = Koha::Biblios->find( $biblionumber ); |
282 |
if ( $biblio->components() ) { |
278 |
my $max_results = 300; |
|
|
279 |
|
280 |
if ( $biblio->components($max_results) ) { |
281 |
my $search_query = Koha::Util::Search::get_component_part_query($biblionumber); |
282 |
$variables->{ComponentPartQuery} = $search_query; |
283 |
|
283 |
my @componentPartRecordXML = ('<componentPartRecords>'); |
284 |
my @componentPartRecordXML = ('<componentPartRecords>'); |
284 |
for my $cb ( @{ $biblio->components() } ) { |
285 |
for my $cb ( @{ $biblio->components($max_results) } ) { |
285 |
if( ref $cb eq 'MARC::Record'){ |
286 |
if( ref $cb eq 'MARC::Record'){ |
286 |
$cb = $cb->as_xml_record(); |
287 |
$cb = $cb->as_xml_record(); |
287 |
} else { |
288 |
} else { |
Lines 297-302
sub XSLTParse4Display {
Link Here
|
297 |
} |
298 |
} |
298 |
} |
299 |
} |
299 |
|
300 |
|
|
|
301 |
my $varxml = "<variables>\n"; |
302 |
while (my ($key, $value) = each %$variables) { |
303 |
$varxml .= "<variable name=\"$key\">$value</variable>\n"; |
304 |
} |
305 |
$varxml .= "</variables>\n"; |
306 |
|
300 |
$xmlrecord =~ s/\<\/record\>/$itemsxml$sysxml$varxml$partsxml\<\/record\>/; |
307 |
$xmlrecord =~ s/\<\/record\>/$itemsxml$sysxml$varxml$partsxml\<\/record\>/; |
301 |
if ($fixamps) { # We need to correct the ampersand entities that Zebra outputs |
308 |
if ($fixamps) { # We need to correct the ampersand entities that Zebra outputs |
302 |
$xmlrecord =~ s/\&amp;/\&/g; |
309 |
$xmlrecord =~ s/\&amp;/\&/g; |