next unless ($arrBiblios[$j]);
$dataBiblioPaging = Koha::Biblios->find( $arrBiblios[$j] ) if ($arrBiblios[$j] != $biblionumber);
next unless $dataBiblioPaging;
- push @listResults, {index => $j + 1 + $offset, biblionumber => $arrBiblios[$j], title => ($arrBiblios[$j] == $biblionumber)?'':$dataBiblioPaging->title, author => ($arrBiblios[$j] != $biblionumber && $dataBiblioPaging->author)?$dataBiblioPaging->author:'', url => ($arrBiblios[$j] == $biblionumber)?'':'opac-detail.pl?biblionumber=' . $arrBiblios[$j]};
+ push @listResults, {index => $j + 1 + $offset, biblionumber => $arrBiblios[$j], title => ($arrBiblios[$j] == $biblionumber)?'':$dataBiblioPaging->title, author => ($arrBiblios[$j] != $biblionumber && $dataBiblioPaging->author)?$dataBiblioPaging->author:'', part_number => ($arrBiblios[$j] == $biblionumber)?'':$dataBiblioPaging->part_number, part_name => ($arrBiblios[$j] == $biblionumber)?'':$dataBiblioPaging->part_name, url => ($arrBiblios[$j] == $biblionumber)?'':'opac-detail.pl?biblionumber=' . $arrBiblios[$j]};
}
$template->param('listResults' => \@listResults) if (@listResults);
$template->param('indexPag' => 1 + $offset, 'totalPag' => $arrParamsBusc{'total'}, 'indexPagEnd' => scalar(@arrBiblios) + $offset);
}
}
-$template->param(
- OPACShowCheckoutName => C4::Context->preference("OPACShowCheckoutName"),
-);
-
$items = Koha::Items->search_ordered(
[
'me.biblionumber' => $biblionumber,
);
}
$template->param( ComponentParts => $parts );
- my ( $comp_query, $comp_sort ) = $biblio->get_components_query;
- my $cpq = $comp_query . "&sort_by=" . $comp_sort;
+ my ( $comp_query, $comp_query_str, $comp_sort ) = $biblio->get_components_query;
+ my $cpq = $comp_query_str . "&sort_by=" . $comp_sort;
$template->param( ComponentPartsQuery => $cpq );
}
} else { # check if we should show analytics anyway
# XSLT processing of some stuff
my $variables = {};
+my $lang = C4::Languages::getlanguage();
my @plugin_responses = Koha::Plugins->call(
'opac_detail_xslt_variables',
{
biblio_id => $biblionumber,
- lang => C4::Languages::getlanguage(),
+ lang => $lang,
patron_id => $borrowernumber,
},
);
);
# Get items on order
-my ( @itemnumbers_on_order );
if ( C4::Context->preference('OPACAcquisitionDetails' ) ) {
- my $orders = C4::Acquisition::SearchOrders({
- biblionumber => $biblionumber,
- ordered => 1,
- });
+ my $orders = $biblio->orders->filter_by_active;
my $total_quantity = 0;
- for my $order ( @$orders ) {
- my $order = Koha::Acquisition::Orders->find( $order->{ordernumber} );
- my $basket = $order->basket;
- if ( $basket->effective_create_items eq 'ordering' ) {
- @itemnumbers_on_order = $order->items->get_column('itemnumber');
- }
+ while ( my $order = $orders->next ) {
$total_quantity += $order->quantity;
}
$template->{VARS}->{acquisition_details} = {
);
}
else {
+ my $library_info;
while ( my $item = $items->next ) {
my $item_info = $item->unblessed;
$item_info->{holds_count} = $item_reserves{ $item->itemnumber };
$item_info->{priority} = $priority{ $item->itemnumber };
+ # Get opac_info from Additional contents for home and holding library
+ my ( $opac_info_home, $opac_info_holding );
+ $opac_info_holding = $library_info->{ $item->holdingbranch } // $item->holding_branch->opac_info({ lang => $lang });
+ $library_info->{ $item->holdingbranch } = $opac_info_holding;
+ $opac_info_home = $library_info->{ $item->homebranch } // $item->home_branch->opac_info({ lang => $lang });
+ $library_info->{ $item->homebranch } = $opac_info_home;
+ $item_info->{holding_library_info} = $opac_info_holding->content if $opac_info_holding;
+ $item_info->{home_library_info} = $opac_info_home->content if $opac_info_home;
+
$allow_onshelf_holds = Koha::CirculationRules->get_onshelfholds_policy(
{ item => $item, patron => $patron } )
unless $allow_onshelf_holds;
$item_info->{checkout} = $item->checkout;
$item_info->{object} = $item;
- if ( C4::Context->preference('OPACAcquisitionDetails') ) {
- $item_info->{on_order} = 1
- if grep { $_ eq $item->itemnumber } @itemnumbers_on_order;
- }
if ( C4::Context->preference("OPACLocalCoverImages") == 1 ) {
$item_info->{cover_images} = $item->cover_images;
}
- if ( $item->in_bundle ) {
- $item_info->{bundle_host} = $item->bundle_host;
- }
-
if ( C4::Context->preference('UseCourseReserves') ) {
$item_info->{course_reserves} = GetItemCourseReservesInfo( itemnumber => $item->itemnumber );
}
);
# in which tab shelf browser should open ?
- if (grep { $starting_itemnumber == $_->itemnumber } @itemloop) {
+ if (grep { $starting_itemnumber == $_->{itemnumber} } @itemloop) {
$template->param(shelfbrowser_tab => 'holdings');
} else {
$template->param(shelfbrowser_tab => 'otherholdings');