Bug 17182: Allow Keyword to MARC mapping for acquisitions searches
authorNick Clemens <nick@bywatersolutions.com>
Wed, 19 Jul 2017 14:10:05 +0000 (14:10 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 11 Dec 2017 17:30:43 +0000 (14:30 -0300)
This patchset adds the 'subtitle' field to the results display on
acquistions search for adding an order form an existing item.

Any field mapped to 'subtitle' in 'Keyword to MARC mapping' will be
fetched and displayed in the results

To test:
1 - Perform an acquisitions search for existing record
2 - Note record subtitles are not displayed
3 - Map 245$b and 245$n to 'subtitle' in 'Keyword to MARC mapping'
4 - Note they are still not displayed ion acq results
5 - Apply patch
6 - subtitle fields should now display

Sponsored by: Round Rock Public Library
<https://www.roundrocktexas.gov/departments/library/>

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
acqui/neworderbiblio.pl
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderbiblio.tt

index 2e65569..beaa4da 100755 (executable)
@@ -127,6 +127,7 @@ my @results;
 foreach my $result ( @{$marcresults} ) {
     my $marcrecord = C4::Search::new_record_from_zebra( 'biblioserver', $result );
     my $biblio = TransformMarcToKoha( $marcrecord, '' );
+    $biblio->{subtitles} = GetRecordValue( 'subtitle', GetMarcBiblio( $biblio->{biblionumber} ),  GetFrameworkCode( $biblio->{biblionumber} ) );
 
     $biblio->{booksellerid} = $booksellerid;
     push @results, $biblio;
index 3796d18..bf2dd47 100644 (file)
@@ -75,6 +75,7 @@
         <tr>
             <td>
                 <p><span class="title"><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.biblionumber %]">[% biblio.title | html %]</a></span>
+                [% FOREACH subtitle IN biblio.subtitles %] <span class="subtitle">[% subtitle.subfield %]</span>[% END %]
                 [% IF ( biblio.author ) %]  by <span class="author">[% biblio.author %]</span>,[% END %]</p>
                 <p>[% IF ( biblio.isbn ) %] [% biblio.isbn %][% END %]
                 [% IF ( biblio.pages ) %] - [% biblio.pages %][% END %]