Bug 12644 - Add subtitles to staff client cart
authorOwen Leonard <oleonard@myacpl.org>
Thu, 25 May 2017 12:40:43 +0000 (12:40 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 15 Aug 2017 15:17:45 +0000 (12:17 -0300)
This patch adds display of subtitles to the staff client cart.

To test you should have some values mapped to subtitle in Administration
-> Keyword to MARC Mapping.

1. Apply the patch.
2. Add some records to the staff client cart which have subtitles.
3. Open the cart and onfirm that subtitles display correctly in both the
   brief and "More details" view.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

basket/basket.pl
koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt

index 14f661f..ae65a8e 100755 (executable)
@@ -61,9 +61,12 @@ if (C4::Context->preference('TagsEnabled')) {
 foreach my $biblionumber ( @bibs ) {
     $template->param( biblionumber => $biblionumber );
 
+    my $fw = GetFrameworkCode($biblionumber);
+
     my $dat              = &GetBiblioData($biblionumber);
     next unless $dat;
     my $record           = &GetMarcBiblio($biblionumber);
+    $dat->{subtitle}     = GetRecordValue('subtitle', $record, $fw);
     my $marcnotesarray   = GetMarcNotes( $record, $marcflavour );
     my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
     my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
index c4f0e11..30f276c 100644 (file)
     <h3>
         [% IF ( print_basket ) %]
             [% BIBLIO_RESULT.title |html %]
-                [% IF ( BIBLIO_RESULT.subtitle ) %] [% BIBLIO_RESULT.subtitle %][% END %]
+                [% FOREACH subtitl IN BIBLIO_RESULT.subtitle %] [% subtitl.subfield | html %][% END %]
                 [% IF ( BIBLIO_RESULT.author ) %] [% BIBLIO_RESULT.author %][% END %]
         [% ELSE %]
                 <input type="checkbox" class="select_record" value="[% BIBLIO_RESULT.biblionumber %]" name="bib[% BIBLIO_RESULT.biblionumber %]" id="bib[% BIBLIO_RESULT.biblionumber %]" />
                 [% BIBLIO_RESULT.title |html %]
-                [% IF ( BIBLIO_RESULT.subtitle ) %] [% BIBLIO_RESULT.subtitle %][% END %]
+                [% FOREACH subtitl IN BIBLIO_RESULT.subtitle %] [% subtitl.subfield | html %][% END %]
                 [% IF ( BIBLIO_RESULT.author ) %] [% BIBLIO_RESULT.author %][% END %]
         [% END %]
     </h3>
 
                 </td> [% END %]
             <td><a href="[% BIBLIO_RESULT.dest %]?biblionumber=[% BIBLIO_RESULT.biblionumber %]" class="open_title">
-                        [% BIBLIO_RESULT.title |html %]
+                        [% BIBLIO_RESULT.title |html %] [% FOREACH subtitl IN BIBLIO_RESULT.subtitle %] [% subtitl.subfield | html %][% END %]
                     </a>
                         [% BIBLIO_RESULT.author %]
                         <p>[% IF ( BIBLIO_RESULT.publishercode ) %]- [% BIBLIO_RESULT.publishercode %]