|
Lines 195-232
SetUTF8Flag($record);
Link Here
|
| 195 |
my $marcflavour = C4::Context->preference("marcflavour"); |
195 |
my $marcflavour = C4::Context->preference("marcflavour"); |
| 196 |
my $ean = GetNormalizedEAN( $record, $marcflavour ); |
196 |
my $ean = GetNormalizedEAN( $record, $marcflavour ); |
| 197 |
|
197 |
|
| 198 |
{ |
|
|
| 199 |
my $variables = { |
| 200 |
anonymous_session => ($borrowernumber) ? 0 : 1, |
| 201 |
}; |
| 202 |
|
| 203 |
my $lang = C4::Languages::getlanguage(); |
| 204 |
my @plugin_responses = Koha::Plugins->call( |
| 205 |
'opac_detail_xslt_variables', |
| 206 |
{ |
| 207 |
biblio_id => $biblionumber, |
| 208 |
lang => $lang, |
| 209 |
patron_id => $borrowernumber |
| 210 |
|
| 211 |
} |
| 212 |
); |
| 213 |
for my $plugin_variables ( @plugin_responses ) { |
| 214 |
$variables = { %$variables, %$plugin_variables }; |
| 215 |
} |
| 216 |
|
| 217 |
$template->param( |
| 218 |
XSLTBloc => XSLTParse4Display( |
| 219 |
{ |
| 220 |
biblionumber => $biblionumber, |
| 221 |
record => $record, |
| 222 |
xsl_syspref => 'OPACXSLTDetailsDisplay', |
| 223 |
fix_amps => 1, |
| 224 |
xslt_variables => $variables |
| 225 |
} |
| 226 |
), |
| 227 |
); |
| 228 |
} |
| 229 |
|
| 230 |
my $OpacBrowseResults = C4::Context->preference("OpacBrowseResults"); |
198 |
my $OpacBrowseResults = C4::Context->preference("OpacBrowseResults"); |
| 231 |
|
199 |
|
| 232 |
# We look for the busc param to build the simple paging from the search |
200 |
# We look for the busc param to build the simple paging from the search |
|
Lines 659-674
my $max_items_to_display = C4::Context->preference('OpacMaxItemsToDisplay') // 5
Link Here
|
| 659 |
|
627 |
|
| 660 |
# Get component parts details |
628 |
# Get component parts details |
| 661 |
my $showcomp = C4::Context->preference('ShowComponentRecords'); |
629 |
my $showcomp = C4::Context->preference('ShowComponentRecords'); |
| 662 |
my $parts; |
630 |
my ( $parts, $show_analytics ); |
| 663 |
if ( $showcomp eq 'both' || $showcomp eq 'opac' ) { |
631 |
if ( $showcomp eq 'both' || $showcomp eq 'opac' ) { |
| 664 |
if ( my $components = $biblio->get_marc_components(C4::Context->preference('MaxComponentRecords')) ) { |
632 |
if ( my $components = $biblio->get_marc_components(C4::Context->preference('MaxComponentRecords')) ) { |
|
|
633 |
$show_analytics = 1; # just show link when having results |
| 665 |
for my $part ( @{$components} ) { |
634 |
for my $part ( @{$components} ) { |
| 666 |
$part = C4::Search::new_record_from_zebra( 'biblioserver', $part ); |
635 |
$part = C4::Search::new_record_from_zebra( 'biblioserver', $part ); |
|
|
636 |
my $id = Koha::SearchEngine::Search::extract_biblionumber( $part ); |
| 667 |
|
637 |
|
| 668 |
push @{$parts}, |
638 |
push @{$parts}, |
| 669 |
XSLTParse4Display( |
639 |
XSLTParse4Display( |
| 670 |
{ |
640 |
{ |
| 671 |
biblionumber => $biblionumber, |
641 |
biblionumber => $id, |
| 672 |
record => $part, |
642 |
record => $part, |
| 673 |
xsl_syspref => 'OPACXSLTResultsDisplay', |
643 |
xsl_syspref => 'OPACXSLTResultsDisplay', |
| 674 |
fix_amps => 1, |
644 |
fix_amps => 1, |
|
Lines 678-685
if ( $showcomp eq 'both' || $showcomp eq 'opac' ) {
Link Here
|
| 678 |
$template->param( ComponentParts => $parts ); |
648 |
$template->param( ComponentParts => $parts ); |
| 679 |
$template->param( ComponentPartsQuery => $biblio->get_components_query ); |
649 |
$template->param( ComponentPartsQuery => $biblio->get_components_query ); |
| 680 |
} |
650 |
} |
|
|
651 |
} else { # check if we should show analytics anyway |
| 652 |
$show_analytics = 1 if @{$biblio->get_marc_components(1)}; # count matters here, results does not |
| 681 |
} |
653 |
} |
| 682 |
|
654 |
|
|
|
655 |
# XSLT processing of some stuff |
| 656 |
my $variables = {}; |
| 657 |
my @plugin_responses = Koha::Plugins->call( |
| 658 |
'opac_detail_xslt_variables', |
| 659 |
{ |
| 660 |
biblio_id => $biblionumber, |
| 661 |
lang => C4::Languages::getlanguage(), |
| 662 |
patron_id => $borrowernumber, |
| 663 |
}, |
| 664 |
); |
| 665 |
for my $plugin_variables ( @plugin_responses ) { |
| 666 |
$variables = { %$variables, %$plugin_variables }; |
| 667 |
} |
| 668 |
$variables->{anonymous_session} = $borrowernumber ? 0 : 1; |
| 669 |
$variables->{show_analytics_link} = $show_analytics; |
| 670 |
$template->param( |
| 671 |
XSLTBloc => XSLTParse4Display({ |
| 672 |
biblionumber => $biblionumber, |
| 673 |
record => $record, |
| 674 |
xsl_syspref => 'OPACXSLTDetailsDisplay', |
| 675 |
fix_amps => 1, |
| 676 |
xslt_variables => $variables, |
| 677 |
}), |
| 678 |
); |
| 679 |
|
| 683 |
# Get items on order |
680 |
# Get items on order |
| 684 |
my ( @itemnumbers_on_order ); |
681 |
my ( @itemnumbers_on_order ); |
| 685 |
if ( C4::Context->preference('OPACAcquisitionDetails' ) ) { |
682 |
if ( C4::Context->preference('OPACAcquisitionDetails' ) ) { |
| 686 |
- |
|
|