From fa1204cb7a2669d1797c8fba5af19400d18d2b83 Mon Sep 17 00:00:00 2001 From: Caroline Cyr La Rose Date: Tue, 27 Sep 2022 11:30:16 -0400 Subject: [PATCH] Bug 31634: Add part_number and part_name in opac result browser This patch adds the part_number and part_name in the opac results browser. To test: 0. Apply patch 1. Download the sample records and import into Koha 1.1. Download the sample mrc file 1.2. In Koha staff interface, go to Tools > Stage MARC records for import 1.3. Click 'Browse' and choose the file 1.4. Click 'Upload file' 1.5. Click 'Stage for import' 1.6. Click 'Manage staged records' 1.7. Click 'Import this batch into the catalog' 2. Make sure OpacBrowseResults is enabled 2.1. In Koha staff interface, go to Administration > Global system preferences 2.2. Search for OpacBrowseResults 2.3. If necessary, change to 'enable' and click 'Save all OPAC preferences' 3. In OPAC, search for BFF and browse the results 3.1. In Koha OPAC, search for BFF 3.2. Click on one of the titles to access the opac-detail page 3.3. Click 'Browse results' --> The browser should show the main title, along with the number and volume title. Signed-off-by: David Nind --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 6 +++--- opac/opac-detail.pl | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index 816e930e70..319d584cd9 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -1045,7 +1045,7 @@ [% ELSE %]
  • [% END %] - [% loop.count + offset | html %] + [% loop.count + offset | html %]
  • [% END # /FOREACH listitem %] @@ -1056,12 +1056,12 @@ [% IF ( listitem.biblionumber == biblionumber ) %]
  • [% loop.count + offset | html %] - [% title | html %]
    [% IF ( author ) %]by [% author | html %][% END %] + [% title | html %] [% part_number | html %] [% part_name | html %]
    [% IF ( author ) %]by [% author | html %][% END %]
  • [% ELSE %]
  • [% loop.count + offset | html %] - [% listitem.title | html %]
    [% IF ( listitem.author ) %]by [% listitem.author | html %][% END %] + [% listitem.title | html %] [% listitem.part_number | html %] [% listitem.part_name | html %]
    [% IF ( listitem.author ) %]by [% listitem.author | html %][% END %]
  • [% END # /IF listitem.biblionumber %] [% END # /FOREACH listitem %] diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 5f08752a13..99c96002fb 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -480,7 +480,7 @@ if ($session->param('busc')) { 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); -- 2.30.2