Bug 11529: Clean up subtitle usage
authorEre Maijala <ere.maijala@helsinki.fi>
Mon, 19 Nov 2018 08:37:08 +0000 (10:37 +0200)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 5 Aug 2019 14:03:18 +0000 (15:03 +0100)
Unify and clean up subtitle usage so that it's always used as a simple array and not the old hash structure.

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

47 files changed:
C4/Biblio.pm
C4/ShelfBrowser.pm
acqui/neworderbiblio.pl
circ/reserveratios.pl
circ/transferstoreceive.pl
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderbiblio.tt
koha-tmpl/intranet-tmpl/prog/en/modules/authorities/merge.tt
koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/imageviewer.tt
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/stockrotation.tt
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/merge.tt
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt
koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt
koha-tmpl/intranet-tmpl/prog/en/modules/circ/transferstoreceive.tt
koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt
koha-tmpl/intranet-tmpl/prog/en/modules/tags/list.tt
koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt
koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelf.tt
koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt
koha-tmpl/intranet-tmpl/prog/js/checkouts.js
koha-tmpl/intranet-tmpl/prog/js/holds.js
koha-tmpl/opac-tmpl/bootstrap/en/includes/shelfbrowser.inc
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-opensearch.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results-grouped.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendshelf.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-showreviews-rss.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-showreviews.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt
opac/opac-reserve.pl
opac/opac-tags.pl
opac/opac-user.pl
reserve/request.pl
svc/checkouts
svc/holds
t/Biblio2.t
tags/list.pl
tools/batch_delete_records.pl

index e039fe7..eae7cd5 100644 (file)
@@ -67,7 +67,7 @@ BEGIN {
         TransformHtmlToMarc
         TransformHtmlToXml
         prepare_host_field
-        SplitSubtitle
+        SplitKohaField
     );
 
     # Internal functions
@@ -3453,20 +3453,23 @@ sub RemoveAllNsb {
     return $record;
 }
 
-=head2 SplitSubtitle
+=head2 SplitKohaField
 
-    $subtitles = SplitSubtitle($subtitle);
+    $subtitles = SplitKohaField($biblio->subtitle());
 
-Splits a subtitle field to an array of hashes like the one GetRecordValue returns
+Splits a Koha field with multiple values to an array. Multiple matches for a
+Koha field (according to the bibliographic framework) are concatenated with
+' | ', but in many cases it's not optimal for display and an array is
+preferred.
 
 =cut
 
-sub SplitSubtitle {
-    my $subtitle = shift;
+sub SplitKohaField {
+    my $field = shift;
 
-    my @subtitles = map( { 'subfield' => $_ }, split(/ \| /, $subtitle // '' ) );
+    my @parts = split(/ \| /, $field // '' );
 
-    return \@subtitles;
+    return \@parts;
 }
 
 1;
index b5d1979..05669fb 100644 (file)
@@ -223,7 +223,7 @@ sub GetShelfInfo {
         my $this_biblio = GetBibData($item->{biblionumber});
         next unless defined $this_biblio;
         $item->{'title'} = $this_biblio->{'title'};
-        $item->{'subtitle'} = C4::Biblio::SplitSubtitle($this_biblio->{'subtitle'}),
+        $item->{'subtitle'} = C4::Biblio::SplitKohaField($this_biblio->{'subtitle'}),
         $item->{'medium'} = $this_biblio->{'medium'};
         $item->{'part_number'} = $this_biblio->{'part_number'};
         $item->{'part_name'} = $this_biblio->{'part_name'};
index 8333b47..d1662c5 100755 (executable)
@@ -130,7 +130,7 @@ foreach my $result ( @{$marcresults} ) {
     my $marcrecord = C4::Search::new_record_from_zebra( 'biblioserver', $result );
     my $biblio = TransformMarcToKoha( $marcrecord, '' );
 
-    $biblio->{subtitles} = C4::Biblio::SplitSubtitle($biblio->{'subtitle'});
+    $biblio->{subtitles} = C4::Biblio::SplitKohaField($biblio->{'subtitle'});
     $biblio->{booksellerid} = $booksellerid;
     push @results, $biblio;
 
index 15e6895..66eebd3 100755 (executable)
@@ -164,7 +164,7 @@ while ( my $data = $sth->fetchrow_hashref ) {
             priority           => $data->{priority},
             name               => $data->{borrower},
             title              => $data->{title},
-            subtitle           => C4::Biblio::SplitSubtitle($data->{'subtitle'});
+            subtitle           => C4::Biblio::SplitKohaField($data->{'subtitle'}),
             author             => $data->{author},
             itemnum            => $data->{itemnumber},
             biblionumber       => $data->{biblionumber},
index f1c09ef..3734b3c 100755 (executable)
@@ -99,7 +99,7 @@ while ( my $library = $libraries->next ) {
             %getransf = (
                 %getransf,
                 title          => $biblio->title,
-                subtitle       => C4::Biblio::SplitSubtitle($biblio->{'subtitle'}),
+                subtitle       => C4::Biblio::SplitKohaField($biblio->{'subtitle'}),
                 medium         => $biblio->medium,
                 part_number    => $biblio->part_number,
                 part_name      => $biblio->part_name,
index 482185b..8abc2a8 100644 (file)
@@ -50,7 +50,7 @@
         <tr>
             <td>
                 <p><span class="title"><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.biblionumber | uri %]">[% biblio.title | html %]</a></span>
-                [% FOREACH subtitle IN biblio.subtitles %] <span class="subtitle">[% subtitle.subfield | html %]</span>[% END %]
+                [% FOREACH subtitle IN biblio.subtitles %] <span class="subtitle">[% subtitle | html %]</span>[% END %]
                 [% IF ( biblio.author ) %]  by <span class="author">[% biblio.author | html %]</span>,[% END %]</p>
                 <p>[% IF ( biblio.isbn ) %] [% biblio.isbn | html %][% END %]
                 [% IF ( biblio.pages ) %] - [% biblio.pages | html %][% END %]
index 9b926b4..7274b0c 100644 (file)
@@ -56,8 +56,8 @@ div#result { margin-top: 1em; }
     <fieldset class="rows">
     <legend>Merge reference</legend>
     <ol>
-    <li class="radio"><input type="radio" value="[% recordid1 | uri %]" checked="checked" id="mergereference1" name="mergereference" onclick="changeFramework('[% frameworkcode1 | html %]')" /><label for="mergereference1">[% title1 | html %] [% FOREACH subtitl1 IN subtitle1 %] [% subtitl1.subfield | html %][% END %] (<a href="/cgi-bin/koha/authorities/detail.pl?authid=[% recordid1 | uri %]" title="MARC" class="preview-merge-reference" target="_blank">[% recordid1 | html %][% IF frameworklabel1 %] &mdash; [% frameworklabel1 | html %][% END %]</a>)</label></li>
-    <li class="radio"><input type="radio" value="[% recordid2 | uri %]" id="mergereference2" name="mergereference" onclick="changeFramework('[% frameworkcode2 | html %]')" /><label for="mergereference2">[% title2 | html %] [% FOREACH subtitl2 IN subtitle2 %] [% subtitl2.subfield | html %][% END %] (<a href="/cgi-bin/koha/authorities/detail.pl?authid=[% recordid2 | uri %]" title="MARC" class="preview-merge-reference" target="_blank">[% recordid2 | html %][% IF frameworklabel2 %] &mdash; [% frameworklabel2 | html %][% END %]</a>)</label></li>
+    <li class="radio"><input type="radio" value="[% recordid1 | uri %]" checked="checked" id="mergereference1" name="mergereference" onclick="changeFramework('[% frameworkcode1 | html %]')" /><label for="mergereference1">[% title1 | html %] [% FOREACH subtitl1 IN subtitle1 %] [% subtitl1 | html %][% END %] (<a href="/cgi-bin/koha/authorities/detail.pl?authid=[% recordid1 | uri %]" title="MARC" class="preview-merge-reference" target="_blank">[% recordid1 | html %][% IF frameworklabel1 %] &mdash; [% frameworklabel1 | html %][% END %]</a>)</label></li>
+    <li class="radio"><input type="radio" value="[% recordid2 | uri %]" id="mergereference2" name="mergereference" onclick="changeFramework('[% frameworkcode2 | html %]')" /><label for="mergereference2">[% title2 | html %] [% FOREACH subtitl2 IN subtitle2 %] [% subtitl2 | html %][% END %] (<a href="/cgi-bin/koha/authorities/detail.pl?authid=[% recordid2 | uri %]" title="MARC" class="preview-merge-reference" target="_blank">[% recordid2 | html %][% IF frameworklabel2 %] &mdash; [% frameworklabel2 | html %][% END %]</a>)</label></li>
 
     [% IF frameworkselect %]
           <li><label for="frameworkcode">Using framework:</label>
index d984665..de1788c 100644 (file)
@@ -71,7 +71,7 @@
                                 <h3>
                                     <input type="checkbox" class="select_record noprint" value="[% BIBLIO_RESULT.biblionumber | html %]" name="bib[% BIBLIO_RESULT.biblionumber | html %]" id="bib[% BIBLIO_RESULT.biblionumber | html %]" />
                                     [% BIBLIO_RESULT.title |html %]
-                                    [% FOREACH subtitl IN BIBLIO_RESULT.subtitle %] [% subtitl.subfield | html %][% END %]
+                                    [% FOREACH subtitl IN BIBLIO_RESULT.subtitle %] [% subtitl | html %][% END %]
                                     [% IF ( BIBLIO_RESULT.author ) %] [% BIBLIO_RESULT.author | html %][% END %]
                                 </h3>
                                 <!-- COinS / Openurl -->
                                             <a href="[% BIBLIO_RESULT.dest | url %]?biblionumber=[% BIBLIO_RESULT.biblionumber | uri %]" class="open_title">
                                                 [% BIBLIO_RESULT.title |html %]
                                                 [% FOREACH subtitl IN BIBLIO_RESULT.subtitle %]
-                                                    [% subtitl.subfield | html %]
+                                                    [% subtitl | html %]
                                                 [% END %]
                                             </a>
                                             [% BIBLIO_RESULT.author | html %]
index a963b84..fead33d 100644 (file)
@@ -34,7 +34,7 @@
   [% IF ( unknownbiblionumber ) %]
     Unknown record
   [% ELSE %]
-    Details for [% title | html %] [% FOREACH subtitl IN subtitle %] [% subtitl.subfield | html %][% END %]
+    Details for [% title | html %] [% FOREACH subtitl IN subtitle %] [% subtitl | html %][% END %]
   [% END %]
 </title>
 [% INCLUDE 'doc-head-close.inc' %]
@@ -49,7 +49,7 @@
   [% IF ( unknownbiblionumber ) %]
     Unknown record
   [% ELSE %]
-    Details for <i>[% title | html %]  [% FOREACH subtitl IN subtitle %] [% subtitl.subfield | html %][% END %]</i>
+    Details for <i>[% title | html %]  [% FOREACH subtitl IN subtitle %] [% subtitl | html %][% END %]</i>
   [% END %]
 </div>
 
index b5d95e7..cd4d35e 100644 (file)
@@ -2,7 +2,7 @@
 [% USE Asset %]
 [% SET footerjs = 1 %]
 [% INCLUDE 'doc-head-open.inc' %]
-<title>Koha &rsaquo; Catalog &rsaquo; [% biblio.title | html %] [% FOREACH subtitl IN subtitle %] [% subtitl.subfield | html %][% END %] &rsaquo; Images</title>
+<title>Koha &rsaquo; Catalog &rsaquo; [% biblio.title | html %] [% FOREACH subtitl IN subtitle %] [% subtitl | html %][% END %] &rsaquo; Images</title>
 [% INCLUDE 'doc-head-close.inc' %]
 <style>
 #largeCover {
@@ -27,7 +27,7 @@
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'cat-search.inc' %]
 
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>  &rsaquo; <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]"><i>[% biblio.title | html %]  [% FOREACH subtitl IN subtitle %] [% subtitl.subfield | html %][% END %]</i></a> &rsaquo; Images</div>
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>  &rsaquo; <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]"><i>[% biblio.title | html %]  [% FOREACH subtitl IN subtitle %] [% subtitl | html %][% END %]</i></a> &rsaquo; Images</div>
 
 <div class="main container-fluid">
     <div class="row">
index 28066ce..283d925 100644 (file)
@@ -6,7 +6,7 @@
 [% USE Price %]
 [% SET footerjs = 1 %]
 [% INCLUDE 'doc-head-open.inc' %]
-<title>Koha &rsaquo; Catalog &rsaquo; Item details for [% title | html %] [% FOREACH subtitl IN subtitle %] [% subtitl.subfield | html %][% END %]</title>
+<title>Koha &rsaquo; Catalog &rsaquo; Item details for [% title | html %] [% FOREACH subtitl IN subtitle %] [% subtitl | html %][% END %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
 <style>h3{padding-top: 1em; border-top: 2px solid #CCCCCC;}#exportLabelexportModal_{border-top: 0px;}</style>
 </head>
@@ -15,7 +15,7 @@
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'cat-search.inc' %]
 
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>  &rsaquo; Item details for <i>[% title | html %] [% FOREACH subtitl IN subtitle %] [% subtitl.subfield | html %][% END %]</i></div>
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>  &rsaquo; Item details for <i>[% title | html %] [% FOREACH subtitl IN subtitle %] [% subtitl | html %][% END %]</i></div>
 
 <div class="main container-fluid">
     <div class="row">
@@ -27,7 +27,7 @@
 <div id="catalogue_detail_biblio">
 
     <h2>[% title | html %]</h2>
-    [% IF ( subtitle ) %]<h4>[% FOREACH subtitl IN subtitle %] [% subtitl.subfield | html %][% END %]</h4>[% END %]
+    [% IF ( subtitle ) %]<h4>[% FOREACH subtitl IN subtitle %] [% subtitl | html %][% END %]</h4>[% END %]
     [% IF ( author ) %]<h4>by [% author | html %]</h4>[% END %]
     <div class="rows">
     <ol class="bibliodetails">
index b96de1a..8ac0439 100644 (file)
@@ -12,7 +12,7 @@
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'cat-search.inc' %]
 
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>  &rsaquo; Stock rotation details for <i>[% biblio.title | html %][% FOREACH subtitle IN biblio.subtitles %][% subtitle.subfield | html %][% END %]</i></div>
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>  &rsaquo; Stock rotation details for <i>[% biblio.title | html %][% FOREACH subtitle IN biblio.subtitles %][% subtitle | html %][% END %]</i></div>
 
 <div class="main container-fluid">
     <div class="row">
index 4615738..16a447c 100644 (file)
@@ -76,7 +76,7 @@
             <td>
                 <p>
                     <a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% resultsloo.biblionumber | uri %]">[% resultsloo.title | html %]</a>
-                [% FOREACH subtitl IN resultsloo.subtitle %][% subtitl.subfield | html %] [% END %]</p>
+                [% FOREACH subtitl IN resultsloo.subtitle %][% subtitl | html %][% END %]</p>
                 [% IF ( resultsloo.summary ) %]
                     <p>[% resultsloo.summary | html %]</p>
                 [% ELSE %]
index c21baca..cfb813a 100644 (file)
@@ -101,7 +101,7 @@ div#result { margin-top: 1em; }
                 <label for="ref_biblionumber[% record.biblionumber | html %]">
                     [% record.data.title | html %]
                     [% FOREACH subtitle IN record.subtitles %]
-                        [% subtitle.subfield | html %]
+                        [% subtitle | html %]
                     [% END %]
                     ([% record.biblionumber | uri %]) <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% record.biblionumber | uri %]" class="previewData">View MARC</a>
                 </label>
index 7539633..9d2e9f2 100644 (file)
             [% END %]
             <td>[% checkout_info.barcode | html %]</td>
             <td>
-              <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% checkout_info.biblio.biblionumber | uri %]&amp;type=intra"><strong>[% checkout_info.biblio.title | html %][% FOREACH subtitle IN checkout_info.biblio.subtitles %] [% subtitle.subfield | html %][% END %]</strong></a>[% IF checkout_info.biblio.author %], by [% checkout_info.biblio.author | html %][% END %][% IF ( checkout_info.item.itemnotes ) %]- <span class="circ-hlt">[% checkout_info.item.itemnotes | $raw %]</span>[% END %] <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% checkout_info.biblio.biblionumber | html %]&amp;itemnumber=[% checkout_info.item.itemnumber | html %]#item[% checkout_info.item.itemnumber | html %]">[% checkout_info.item.barcode | html %]</a>
+              <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% checkout_info.biblio.biblionumber | uri %]&amp;type=intra"><strong>[% checkout_info.biblio.title | html %][% FOREACH subtitle IN checkout_info.biblio.subtitles %] [% subtitle | html %][% END %]</strong></a>[% IF checkout_info.biblio.author %], by [% checkout_info.biblio.author | html %][% END %][% IF ( checkout_info.item.itemnotes ) %]- <span class="circ-hlt">[% checkout_info.item.itemnotes | $raw %]</span>[% END %] <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% checkout_info.biblio.biblionumber | html %]&amp;itemnumber=[% checkout_info.item.itemnumber | html %]#item[% checkout_info.item.itemnumber | html %]">[% checkout_info.item.barcode | html %]</a>
             </td>
             <td>
               [% IF checkout_info.NEEDSCONFIRMATION %]
index 5888016..eac912a 100644 (file)
@@ -57,7 +57,7 @@
             <td><p>[% reserveloo.reservecount | html %]</p></td>
             <td><p>[% reserveloo.itemcount | html %]</p></td>
             <td><a href="#" class="ratiolimit">[% reserveloo.thisratio | html %]</a></td>
-            <td> [% INCLUDE 'biblio-default-view.inc' biblionumber = reserveloo.biblionumber %][% reserveloo.title | html %] [% IF ( reserveloo.subtitle ) %][% FOREACH subtitl IN reserveloo.subtitle %][% subtitl.subfield | html %][% END %][% END %]</a>[% IF ( reserveloo.author ) %] by [% reserveloo.author | html %][% END %]
+            <td> [% INCLUDE 'biblio-default-view.inc' biblionumber = reserveloo.biblionumber %][% reserveloo.title | html %] [% IF ( reserveloo.subtitle ) %][% FOREACH subtitl IN reserveloo.subtitle %][% subtitl | html %][% END %][% END %]</a>[% IF ( reserveloo.author ) %] by [% reserveloo.author | html %][% END %]
             </td>
             <td>
                   <ul>
index 8563488..9705432 100644 (file)
@@ -52,7 +52,7 @@
                 [% END %]
                     <td><p><span title="[% reser.datetransfer | html %]">[% reser.datetransfer | $KohaDates %]</span></p> [% IF ( reser.messcompa ) %]<span class="error">Transfer is [% reser.diff | html %] days late</span>[% END %]</td>
                     <td>
-                        [% INCLUDE 'biblio-default-view.inc' biblionumber = reser.biblionumber %][% reser.title | html %] [% IF ( reser.subtitle ) %] [% FOREACH subtitl IN reser.subtitle %][% subtitl.subfield | html %][% END %][% END %]</a> [% IF ( reser.author ) %]by [% reser.author | html %][% END %]
+                        [% INCLUDE 'biblio-default-view.inc' biblionumber = reser.biblionumber %][% reser.title | html %] [% IF ( reser.subtitle ) %] [% FOREACH subtitl IN reser.subtitle %][% subtitl | html %][% END %][% END %]</a> [% IF ( reser.author ) %]by [% reser.author | html %][% END %]
                             [% IF ( reser.itemtype ) %] (<b>[% reser.itemtype | html %]</b>)[% END %]
                             <br />Barcode: [% reser.barcode | html %]
                     </td>
index 5a96a1f..d63cc32 100644 (file)
@@ -58,7 +58,7 @@
   [% END %]
 
   [% UNLESS ( multi_hold ) %]
-    <h1>Place a hold on [% INCLUDE 'biblio-default-view.inc' %][% title | html %]</a></h1>
+    <h1>Place a hold on [% INCLUDE 'biblio-default-view.inc' %][% title | html %]</a> [% subtitle | html %] [% part_number | html %] [% part_name | html %]</h1>
   [% ELSE %]
     <h1>Confirm holds</h1>
   [% END %]
index 6405c85..1d0e55b 100644 (file)
@@ -31,7 +31,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
 
         [% FOREACH title IN titles %]
             <tr>
-            <td>[% INCLUDE 'biblio-default-view.inc' biblionumber = title.biblionumber %][% title.title | html %][% FOREACH subtitl IN title.subtitle %] [% subtitl.subfield | html %][% END %]</a>
+            <td>[% INCLUDE 'biblio-default-view.inc' biblionumber = title.biblionumber %][% title.title | html %][% FOREACH subtitl IN title.subtitle %] [% subtitl | html %][% END %]</a>
             [% title.author | html %]
             <p>[% IF ( title.publishercode ) %]- [% title.publishercode | html %]
             [% IF ( title.place ) %] [% title.place | html %][% END %][% END %]
index 5004055..d2d2372 100644 (file)
                 <tr>
                   <td><input type="checkbox" name="record_id" id="record_id_[% biblio.biblionumber | html %]" value="[% biblio.biblionumber | html %]" data-items="[% biblio.itemnumbers.size | html %]" data-issues="[% biblio.issues_count | html %]" data-reserves="[% biblio.holds_count | html %]" /></td>
                   <td><label for="record_id_[% biblio.biblionumber | html %]">[% biblio.biblionumber | html %]</label></td>
-                  <td>[% INCLUDE 'biblio-default-view.inc' biblionumber=biblio.biblionumber %][% biblio.title | html %][% IF ( biblio.subtitle ) %][% FOREACH subtitle IN biblio.subtitle %] [% subtitle.subfield | html %][% END %][% END %]</a></td>
+                  <td>[% INCLUDE 'biblio-default-view.inc' biblionumber=biblio.biblionumber %][% biblio.title | html %][% IF ( biblio.subtitle ) %][% FOREACH subtitle IN biblio.subtitle %] [% subtitle | html %][% END %][% END %]</a></td>
                   <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% biblio.biblionumber | uri %]">[% biblio.itemnumbers.size | html %]</a></td>
                   <td><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblio.biblionumber | uri %]">[% biblio.holds_count | html %]</a></td>
                   <td><a href="/cgi-bin/koha/catalogue/issuehistory.pl?biblionumber=[% biblio.biblionumber | uri %]">[% biblio.issues_count | html %]</a></td>
index 39ae699..fa56105 100644 (file)
@@ -33,7 +33,7 @@ Your list: [% shelfname | $raw %]
                 [% BIBLIO_RESULT.title | $raw %]
                 [% IF ( BIBLIO_RESULT.subtitle.size ) %]
                   [% FOREACH subtitle IN BIBLIO_RESULT.subtitle %]
-                    [% subtitle.subfield | $raw %]
+                    [% subtitle | $raw %]
                   [% END %]
                 [% END %]
             </span>
index 023922a..9d553cc 100644 (file)
                     [% itemsloo.XSLTBloc | $raw %]
                 [% ELSE %]
                     [% INCLUDE 'biblio-default-view.inc' biblionumber = itemsloo.biblionumber %]
-                    [% itemsloo.title | html %][% FOREACH subtitl IN itemsloo.subtitle %] [% subtitl.subfield | html %][% END %]</a>
+                    [% itemsloo.title | html %][% FOREACH subtitl IN itemsloo.subtitle %] [% subtitl | html %][% END %]</a>
                 [% END %]
                     <p class="hold">
                         [% IF ( itemsloo.notforloan ) %]
index 66c5f8b..da69276 100644 (file)
@@ -290,9 +290,11 @@ $(document).ready(function() {
                               + oObj.title.escapeHtml();
 
                         $.each(oObj.subtitle, function( index, value ) {
-                                  title += " " + value.subfield.escapeHtml();
+                                  title += " " + value.escapeHtml();
                         });
 
+                        title += " " + oObj.part_number + " " + oObj.part_name;
+
                         if ( oObj.enumchron ) {
                             title += " (" + oObj.enumchron.escapeHtml() + ")";
                         }
@@ -652,9 +654,11 @@ $(document).ready(function() {
                                   + oObj.title.escapeHtml();
 
                             $.each(oObj.subtitle, function( index, value ) {
-                                      title += " " + value.subfield.escapeHtml();
+                                      title += " " + value.escapeHtml();
                             });
 
+                            title += " " + oObj.part_number + " " + oObj.part_name;
+
                             if ( oObj.enumchron ) {
                                 title += " (" + oObj.enumchron.escapeHtml() + ")";
                             }
index 9700257..3c0d77d 100644 (file)
@@ -25,9 +25,11 @@ $(document).ready(function() {
                                   + oObj.title.escapeHtml();
 
                             $.each(oObj.subtitle, function( index, value ) {
-                                      title += " " + value.subfield.escapeHtml();
+                                      title += " " + value.escapeHtml();
                             });
 
+                            title += " " + oObj.part_number + " " + oObj.part_name;
+
                             title += "</a>";
 
                             if ( oObj.author ) {
index 276c0d2..2808e25 100644 (file)
@@ -81,7 +81,7 @@
                                 [% item.title | html %]
                                 [% FOREACH subtitl IN item.subtitle %]
                                     [% IF Koha.Preference('marcflavour')=='UNIMARC' %],[% END %]
-                                    [% subtitl.subfield | html %]
+                                    [% subtitl | html %]
                                 [% END %]
                             </a>
                         </td>
index 6462889..292282e 100644 (file)
@@ -68,7 +68,7 @@
                                     <h3>
                                                 <input type="checkbox" class="cb" value="[% BIBLIO_RESULT.biblionumber | html %]" name="bib[% BIBLIO_RESULT.biblionumber | html %]" id="bib[% BIBLIO_RESULT.biblionumber | html %]">
                                                 [% BIBLIO_RESULT.title | html %]
-                                                [% IF ( BIBLIO_RESULT.subtitle ) %] [% FOREACH subtitl IN BIBLIO_RESULT.subtitle %] [% subtitl.subfield | html %] [% END %][% END %]
+                                                [% IF ( BIBLIO_RESULT.subtitle ) %] [% FOREACH subtitl IN BIBLIO_RESULT.subtitle %] [% subtitl | html %] [% END %][% END %]
                                                 [% IF ( BIBLIO_RESULT.author ) %] [% BIBLIO_RESULT.author | html %][% END %]
                                     </h3>
                                     <!-- COinS / Openurl -->
                                                 <input type="checkbox" class="cb" value="[% BIBLIO_RESULT.biblionumber | html %]" name="bib[% BIBLIO_RESULT.biblionumber | html %]" id="bib[% BIBLIO_RESULT.biblionumber | html %]">
                                                 </td>
                                             <td>
-                                                <a href="#" onclick="openBiblio('[% BIBLIO_RESULT.dest | html %]',[% BIBLIO_RESULT.biblionumber | html %])">[% BIBLIO_RESULT.title | html %][% IF ( BIBLIO_RESULT.subtitle ) %] [% FOREACH subtitl IN BIBLIO_RESULT.subtitle %][% subtitl.subfield | html %][% END %][% END %]</a>
+                                                <a href="#" onclick="openBiblio('[% BIBLIO_RESULT.dest | html %]',[% BIBLIO_RESULT.biblionumber | html %])">[% BIBLIO_RESULT.title | html %][% IF ( BIBLIO_RESULT.subtitle ) %] [% FOREACH subtitl IN BIBLIO_RESULT.subtitle %][% subtitl | html %][% END %][% END %]</a>
                                                 <!-- COinS / Openurl -->
                                                 <span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.au=[% BIBLIO_RESULT.author | html %]&amp;rft.btitle=[% BIBLIO_RESULT.title |url %]&amp;rft.date=[% BIBLIO_RESULT.publicationyear | html %]&amp;rft.tpages=[% BIBLIO_RESULT.item('size') | html %]&amp;rft.isbn=[% BIBLIO_RESULT.isbn |url %]&amp;rft.aucorp=&amp;rft.place=[% BIBLIO_RESULT.place | html %]&amp;rft.pub=[% BIBLIO_RESULT.publisher |url %]&amp;rft.edition=[% BIBLIO_RESULT.edition | html %]&amp;rft.series=[% BIBLIO_RESULT.series | html %]&amp;rft.genre="></span>
                                                 [% IF ( TagsInputEnabled && loggedinusername ) %]
index e6bccdf..d148b2b 100644 (file)
@@ -30,7 +30,7 @@
 [% END %]
 
 [% INCLUDE 'doc-head-open.inc' %]
-<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog &rsaquo; Details for: [% title | html %][% FOREACH subtitl IN subtitle %][% IF Koha.Preference('marcflavour')=='UNIMARC' %],[% END %] [% subtitl.subfield | html %][% END %]</title>
+<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog &rsaquo; Details for: [% title | html %][% FOREACH subtitl IN subtitle %][% IF Koha.Preference('marcflavour')=='UNIMARC' %],[% END %] [% subtitl | html %][% END %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
     [% Asset.css("lib/emoji-picker/css/emoji.css") | $raw %]
 </head>
@@ -41,7 +41,7 @@
 <div class="main">
     <ul class="breadcrumb">
         <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
-        <li><a href="#"><span>Details for: </span>[% title | html %][% FOREACH subtitl IN subtitle %][% IF Koha.Preference('marcflavour')=='UNIMARC' %],[% END %] [% subtitl.subfield | html %][% END %]</a></li>
+        <li><a href="#"><span>Details for: </span>[% title | html %][% FOREACH subtitl IN subtitle %][% IF Koha.Preference('marcflavour')=='UNIMARC' %],[% END %] [% subtitl | html %][% END %]</a></li>
     </ul>
 
     <div class="container-fluid">
                     [% IF ( OPACXSLTDetailsDisplay ) %]
                         [% XSLTBloc | $raw %]
                     [% ELSE %]
-                        <h1 class="title">[% title | html %][% IF ( subtitle ) %] <span class="subtitle">[% FOREACH subtitl IN subtitle %][% subtitl.subfield | html %] [% END %]</span>[% END %]</h1>
+                        <h1 class="title">[% title | html %][% IF ( subtitle ) %] <span class="subtitle">[% FOREACH subtitl IN subtitle %][% subtitl | html %] [% END %]</span>[% END %]</h1>
                         [% IF ( author ) %]<h5 class="author">by <a href="/cgi-bin/koha/opac-search.pl?q=au:[% author |url %]">[% author | html %]</a></h5>[% END %]
 
                         <span class="results_summary">[% UNLESS ( item_level_itypes ) %]
index b91b6b7..eac730a 100644 (file)
@@ -37,7 +37,7 @@
      <atom:link rel="search" type="application/opensearchdescription+xml" href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-search.pl?[% SEARCH_RESULT.query_cgi | $raw %][% SEARCH_RESULT.limit_cgi | url %]&amp;sort_by=[% SEARCH_RESULT.sort_by |uri %]&amp;format=opensearchdescription"/>
      <opensearch:Query role="request" searchTerms="[% SEARCH_RESULT.query_desc |uri %][% SEARCH_RESULT.limit_desc |uri %]" startPage="[% SEARCH_RESULT.page | html %]" />
      <item>
-       <title>[% SEARCH_RESULT.title | html %] [% FOREACH subtitl IN SEARCH_RESULT.subtitle %], [% subtitl.subfield | html %][% END %]</title>
+       <title>[% SEARCH_RESULT.title | html %] [% FOREACH subtitl IN SEARCH_RESULT.subtitle %], [% subtitl | html %][% END %]</title>
        <dc:identifier>ISBN [% SEARCH_RESULT.isbn | html %]</dc:identifier>
        <link>[% IF ( SEARCH_RESULT.BiblioDefaultViewmarc ) %][% OPACBaseURL | html %]/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | html %][% ELSE %][% IF ( SEARCH_RESULT.BiblioDefaultViewisbd ) %][% OPACBaseURL | html %]/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | html %][% ELSE %][% OPACBaseURL | html %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | html %][% END %][% END %]</link>
        <description><![CDATA[
index 5a880b2..05714c5 100644 (file)
                                                 </td>
                                                 <td>
                                                 [% IF  issue.BiblioDefaultViewmarc %]
-                                                     <a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% issue.biblionumber |url %]">[% issue.title | html %] [% IF  issue.subtitle  %][% FOREACH subtitl IN issue.subtitle %][% subtitl.subfield | html %][% END %][% END %]</a>
+                                                     <a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% issue.biblionumber |url %]">[% issue.title | html %] [% IF  issue.subtitle  %][% FOREACH subtitl IN issue.subtitle %][% subtitl | html %][% END %][% END %]</a>
                                                 [% ELSIF issue.BiblioDefaultViewisbd %]
-                                                     <a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% issue.biblionumber |url %]">[% issue.title | html %] [% IF issue.subtitle %][% FOREACH subtitl IN issue.subtitle %][% subtitl.subfield | html %][% END %][% END %]</a>
+                                                     <a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% issue.biblionumber |url %]">[% issue.title | html %] [% IF issue.subtitle %][% FOREACH subtitl IN issue.subtitle %][% subtitl | html %][% END %][% END %]</a>
                                                 [% ELSE %]
-                                                     <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% issue.biblionumber |url %]">[% issue.title | html %] [% IF issue.subtitle %][% FOREACH subtitl IN issue.subtitle %][% subtitl.subfield | html %][% END %][% END %]</a>
+                                                     <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% issue.biblionumber |url %]">[% issue.title | html %] [% IF issue.subtitle %][% FOREACH subtitl IN issue.subtitle %][% subtitl | html %][% END %][% END %]</a>
                                                 [% END %]
                                                 <p class="results-summary item-details">[% issue.author | html %]</p>
 
index 171409e..68a08bd 100644 (file)
                                         [% bibitemloo.title | html %]
                                         [% IF ( bibitemloo.subtitle ) %]
                                             [% FOREACH subtitl IN bibitemloo.subtitle %]
-                                                [% subtitl.subfield | html %]
+                                                [% subtitl | html %]
                                             [% END %]
                                         [% END %]
                                     </a>
index 31194b9..e727ba3 100644 (file)
                                                     </td>
                                                     <td>
                                                         [% FOREACH subtitl IN SEARCH_RESULT.subtitle %]
-                                                            [% subtitl.subfield | html %]
+                                                            [% subtitl | html %]
                                                         [% END %]
                                                     </td>
                                                 </tr>
                                                                     <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% GROUP_RESULT.biblionumber |url %]" title="View details for this title">[% GROUP_RESULT.title | html %]
                                                                 [% END %]
                                                                 [% FOREACH subtitl IN GROUP_RESULT.subtitle %]
-                                                                    [% subtitl.subfield | html %]
+                                                                    [% subtitl | html %]
                                                                 [% END %]
                                                                 </a>
                                                             [% END # / IF GROUP_RESULT.BiblioDefaultViewmarc %]
index 2a56c23..918b5f5 100644 (file)
                                                     [% END %]
 
                                                     [% FOREACH subtitl IN SEARCH_RESULT.subtitle %]
-                                                        , [% subtitl.subfield | html %]
+                                                        , [% subtitl | html %]
                                                     [% END %]</a>
 
                                                     [% IF ( SEARCH_RESULT.author ) %]
index 97b2946..eac41dd 100644 (file)
@@ -34,7 +34,7 @@ Your list : [% shelfname | $raw %]
                 [% BIBLIO_RESULT.title | $raw %]
                 [% IF ( BIBLIO_RESULT.subtitle.size ) %]
                   [% FOREACH subtitle IN BIBLIO_RESULT.subtitle %]
-                    [% subtitle.subfield | $raw %]
+                    [% subtitle | $raw %]
                   [% END %]
                 [% END %]
             </span>
index 54f507f..cc05446 100644 (file)
                                                         [% END %]
 
                                                         [% FOREACH subtitl IN itemsloo.subtitle %]
-                                                            [% subtitl.subfield | html %]
+                                                            [% subtitl | html %]
                                                         [% END %]
                                                         </a>
 
index 5d199c4..12e3253 100644 (file)
@@ -10,7 +10,7 @@
      [% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %]
         [% FOREACH review IN reviews %]
      <item>
-       <title>New comment on [% review.title | html %] [% FOREACH subtitl IN review.subtitle %], [% subtitl.subfield | html %][% END %]</title>
+       <title>New comment on [% review.title | html %] [% FOREACH subtitl IN review.subtitle %], [% subtitl | html %][% END %]</title>
        <link>[% OPACBaseURL | html %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% review.biblionumber | html %]#comments</link>
        <description><![CDATA[
 [% IF ( AdlibrisEnabled && review.normalized_isbn ) %]
index d705bc4..d2f426c 100644 (file)
@@ -47,7 +47,7 @@
                                                 [% END %]
                                             [% END %]
                                             [% IF ( review.title ) %][% review.title | html %][% ELSE %]No title[% END %]
-                                            [% FOREACH subtitl IN review.subtitle %] [% subtitl.subfield | html %][% END %]
+                                            [% FOREACH subtitl IN review.subtitle %] [% subtitl | html %][% END %]
                                             </a>
                                             [% IF ( review.author ) %]
                                                 by <a href="/cgi-bin/koha/opac-search.pl?q=au:[% review.author |url %]" title="Search for works by this author" class="author">[% review.author | html %]</a>
index 08b5528..49b4862 100644 (file)
                                                         [% MY_TAG.title | html %]
                                                         [% IF ( MY_TAG.subtitle ) %]
                                                             [% FOREACH subtitle IN MY_TAG.subtitle %]
-                                                                [% subtitle.subfield | html %]
+                                                                [% subtitle | html %]
                                                             [% END %]
                                                         [% END %]
                                                     </a>
index 03847ac..fe27fb6 100644 (file)
                                                 </td>[% END # / IF JacketImages %]
 
                                                 <td class="title">
-                                                    <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% ISSUE.biblionumber | html %]">[% ISSUE.title | html %] [% FOREACH subtitl IN ISSUE.subtitle %] [% subtitl.subfield | html %][% END %]</a>
+                                                    <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% ISSUE.biblionumber | html %]">[% ISSUE.title | html %] [% FOREACH subtitl IN ISSUE.subtitle %] [% subtitl | html %][% END %]</a>
                                                     [% IF ( ISSUE.enumchron ) %] [% ISSUE.enumchron | html %][% END %]
                                                 </td>
 
                                                 [% END # /IF jacketcell %]
 
                                                 <td>
-                                                    <a class="title" href="/cgi-bin/koha/opac-detail.pl?bib=[% OVERDUE.biblionumber | html %]">[% OVERDUE.title | html %] [% FOREACH subtitl IN OVERDUE.subtitle %] [% subtitl.subfield | html %][% END %]
+                                                    <a class="title" href="/cgi-bin/koha/opac-detail.pl?bib=[% OVERDUE.biblionumber | html %]">[% OVERDUE.title | html %] [% FOREACH subtitl IN OVERDUE.subtitle %] [% subtitl | html %][% END %]
                                                     </a>
                                                     <span class="item-details">[% OVERDUE.author | html %]</span></td>
 
index a7631d3..47962d8 100755 (executable)
@@ -419,7 +419,7 @@ foreach my $biblioNum (@biblionumbers) {
     my $frameworkcode = GetFrameworkCode( $biblioData->{biblionumber} );
     $biblioLoopIter{biblionumber} = $biblioData->{biblionumber};
     $biblioLoopIter{title} = $biblioData->{title};
-    $biblioLoopIter{subtitle} = C4::Biblio::SplitSubtitle($biblioData->{'subtitle'});
+    $biblioLoopIter{subtitle} = C4::Biblio::SplitKohaField($biblioData->{'subtitle'});
     $biblioLoopIter{medium} = $biblioData->{medium};
     $biblioLoopIter{part_number} = $biblioData->{part_number};
     $biblioLoopIter{part_name} = $biblioData->{part_name};
index 2d7dfae..6174840 100755 (executable)
@@ -257,7 +257,7 @@ if ($loggedinuser) {
         }
         next if ( $should_hide && scalar @all_items == scalar @hidden_itemnumbers );
         $tag->{title} = $biblio->title;
-        $tag->{subtitle} = C4::Biblio::SplitSubtitle($biblio->subtitle);
+        $tag->{subtitle} = C4::Biblio::SplitKohaField($biblio->subtitle);
         $tag->{medium} = $biblio->medium;
         $tag->{part_number} = $biblio->part_number;
         $tag->{part_name} = $biblio->part_name;
index 56ae5ad..3d8208f 100755 (executable)
@@ -201,7 +201,7 @@ if ( $pending_checkouts->count ) { # Useless test
         );
         $issue->{rentalfines} = $rental_fines->total_outstanding;
 
-        $issue->{'subtitle'} = C4::Biblio::SplitSubtitle($issue->{'subtitle'});
+        $issue->{'subtitle'} = C4::Biblio::SplitKohaField($issue->{'subtitle'});
 
         # check if item is renewable
         my ($status,$renewerror) = CanBookBeRenewed( $borrowernumber, $issue->{'itemnumber'} );
index 8936808..fea0a49 100755 (executable)
@@ -631,6 +631,9 @@ foreach my $biblionumber (@biblionumbers) {
                      biblionumber      => $biblionumber,
                      findborrower      => $findborrower,
                      title             => $biblio->title,
+                     subtitle          => $biblio->subtitle,
+                     part_number       => $biblio->part_number,
+                     part_name         => $biblio->part_name,
                      author            => $biblio->author,
                      holdsview => 1,
                      C4::Search::enabled_staff_search_views,
index 8aecac1..7eb2f87 100755 (executable)
@@ -23,7 +23,7 @@ use CGI;
 use JSON qw(to_json);
 
 use C4::Auth qw(check_cookie_auth haspermission get_session);
-use C4::Biblio qw(SplitSubtitle);
+use C4::Biblio qw(SplitKohaField);
 use C4::Circulation qw(GetIssuingCharges CanBookBeRenewed GetRenewCount GetSoonestRenewDate);
 use C4::Overdues qw(GetFine);
 use C4::Context;
@@ -178,7 +178,7 @@ while ( my $c = $sth->fetchrow_hashref() ) {
     my $checkout = {
         DT_RowId             => $c->{itemnumber} . '-' . $c->{borrowernumber},
         title                => $c->{title},
-        subtitle             => C4::Biblio::SplitSubtitle($c->{'subtitle'}),
+        subtitle             => C4::Biblio::SplitKohaField($c->{'subtitle'}),
         medium               => $c->{medium} // '',
         part_number          => $c->{part_number} // '',
         part_name            => $c->{part_name} // '',
index 8b9a27b..2368a51 100755 (executable)
--- a/svc/holds
+++ b/svc/holds
@@ -23,7 +23,7 @@ use CGI;
 use JSON qw(to_json);
 
 use C4::Auth qw(check_cookie_auth);
-use C4::Biblio qw(SplitSubtitle);
+use C4::Biblio qw(SplitKohaField);
 use C4::Charset;
 use C4::Circulation qw(GetTransfers);
 use C4::Context;
@@ -90,7 +90,7 @@ while ( my $h = $holds_rs->next() ) {
         DT_RowId       => $h->reserve_id(),
         biblionumber   => $biblionumber,
         title          => $biblio->title(),
-        subtitle       => $biblio->subtitle() // '',
+        subtitle       => C4::Biblio::SplitKohaField($biblio->subtitle()),
         medium         => $biblio->medium() // '',
         part_number    => $biblio->part_number() // '',
         part_name      => $biblio->part_name() // '',
index 21354eb..bf78de9 100644 (file)
@@ -52,20 +52,20 @@ sub _koha_marc_update_bib_ids_control {
     is($r->field('004')->data(), 20, 'Biblioitemnumber to control field');
 }
 
-subtest 'SplitSubtitle' => sub {
+subtest 'SplitKohaField' => sub {
     plan tests => 4;
 
-    my $res = C4::Biblio::SplitSubtitle(undef);
+    my $res = C4::Biblio::SplitKohaField(undef);
     is_deeply($res, [], 'undef returned as an array');
 
-    $res = C4::Biblio::SplitSubtitle('');
+    $res = C4::Biblio::SplitKohaField('');
     is_deeply($res, [], 'Empty string returned as an array');
 
-    $res = C4::Biblio::SplitSubtitle('Single');
-    is_deeply($res, [{'subfield' => 'Single'}], 'Single subtitle returns an array');
+    $res = C4::Biblio::SplitKohaField('Single');
+    is_deeply($res, ['Single'], 'Single subtitle returned as an array');
 
-    $res = C4::Biblio::SplitSubtitle('First | Second');
-    is_deeply($res, [{'subfield' => 'First'}, {'subfield' => 'Second'}], 'Two subtitles returns an array');
+    $res = C4::Biblio::SplitKohaField('First | Second');
+    is_deeply($res, ['First', 'Second'], 'Two subtitles returned as an array');
 };
 
 done_testing();
index 6f39da5..9a7369c 100755 (executable)
@@ -61,7 +61,7 @@ else {
         my $taglist = get_tag_rows( { term => $tag } );
         for ( @{$taglist} ) {
             my $dat    = &GetBiblioData( $_->{biblionumber} );
-            $dat->{'subtitle'} = C4::Biblio::SplitSubtitles($dat->{'subtitle'}),
+            $dat->{'subtitle'} = C4::Biblio::SplitKohaFields($dat->{'subtitle'}),
             my @items = GetItemsInfo( $_->{biblionumber} );
             $dat->{biblionumber} = $_->{biblionumber};
             $dat->{tag_id}       = $_->{tag_id};
index 9eba735..bcb70fb 100755 (executable)
@@ -94,7 +94,7 @@ if ( $op eq 'form' ) {
             my $holds_count = $biblio->holds->count;
             $biblio = $biblio->unblessed;
             my $record = &GetMarcBiblio({ biblionumber => $record_id });
-            $biblio->{subtitle} = C4::Biblio::SplitSubtitle( $biblio->{subtitle} );
+            $biblio->{subtitle} = C4::Biblio::SplitKohaField( $biblio->{subtitle} );
             $biblio->{itemnumbers} = [Koha::Items->search({ biblionumber => $record_id })->get_column('itemnumber')];
             $biblio->{holds_count} = $holds_count;
             $biblio->{issues_count} = C4::Biblio::CountItemsIssued( $record_id );