Bug 23126: Display multi-line entries in subscrpitions correctly
authorKatrin Fischer <katrin.fischer.83@web.de>
Tue, 18 Jun 2019 06:06:10 +0000 (08:06 +0200)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 25 Jun 2019 16:18:00 +0000 (17:18 +0100)
There are several notes and other fields in a subscription that
can be entered as multi-line input with breaks. We should display
them as they were entered with keeping the line breaks intact.

To test:
- Add a subscription
  - Add comments including line breaks in internal and OPAC note
  - Check the manual history checkbox
- Go to the subscription detail page, tab 'Planning'
- Use the 'Edit history' link to edit the history
- Enter content with line breaks in all the input fields where
  it's possible
- Go to the OPAC detail page for your subscription record
- Go to tab 'Subscriptions' > More details > Brief history
- Verify the line breaks show there as <br>
- Apply patch
- Relaod page, verify all information displays correctly now
- Go back to the detail page, subscription tab - verify same there
- Go back to the subscription detail page in staff
  - Check editing the history works as expected
  - Verify information on all tabs displays correctly
  - Receive a serial issue - verify note on top displays right
  - Go to the serial collection page of the subscription - same there

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nadine Pierre <nadine.pierre@inLibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

C4/Serials.pm
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt
koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-serial-issues.tt
opac/opac-serial-issues.pl

index 44c3cb9..6bdbd8c 100644 (file)
@@ -429,9 +429,6 @@ sub GetSubscriptionsFromBiblionumber {
             $subs->{histenddate} = "";
         }
         $subs->{opacnote}     //= "";
-        $subs->{opacnote}     =~ s/\n/\<br\/\>/g;
-        $subs->{missinglist}  =~ s/\n/\<br\/\>/g;
-        $subs->{recievedlist} =~ s/\n/\<br\/\>/g;
         $subs->{ "periodicity" . $subs->{periodicity} }     = 1;
         $subs->{ "numberpattern" . $subs->{numberpattern} } = 1;
         $subs->{ "status" . $subs->{'status'} }             = 1;
index 454a726..7d4310d 100644 (file)
@@ -53,7 +53,7 @@
         <td>[% subscription.numberpattern.label | html %]</td>
         <td>[% IF subscription.branchcode %][% Branches.GetName( subscription.branchcode ) | html %][% END %]</td>
         <td> [% subscription.callnumber | html %]</td>
-        <td> [% subscription.notes | html %]
+        <td> [% subscription.notes | html | html_line_break %]
             [% UNLESS subscription.closed %]
                 [% IF ( subscription.subscriptionexpired ) %]
                     <br /><span class="problem"> Subscription expired</span>
index 37ccf50..7d95e05 100644 (file)
@@ -95,7 +95,7 @@ $(document).ready(function() {
 <h1>Serial edition <i>[% bibliotitle | html %]</i>
     [% IF location %] ([% AuthorisedValues.GetByCode('LOC', location) | html %])[% END %]
     [% IF ( callnumber ) %] callnumber: [% callnumber | html %][% END %]</h1>
-[% IF internalnotes %]<p>Nonpublic note: [% internalnotes | html %]</p>[% END %]
+[% IF internalnotes %]<p>Nonpublic note: [% internalnotes | html | html_line_break %]</p>[% END %]
 <form method="post" name="f" class="noEnterSubmit" action="serials-edit.pl" id="serials_edit">
 
 [% IF ( Errors ) %]
index d7f7cfd..983a7a8 100644 (file)
             <li><span class="label">End date:</span> [% enddate | html %]</li>
             <li><span class="label">History start date:</span> [% histstartdate | html %] </li>
             <li><span class="label">History end date:</span> [% histenddate | html %]</li>
-            <li><span class="label">Received issues:</span>[% recievedlist | html %]</li>
-            <li><span class="label">Missing issues:</span>[% missinglist | html %]</li>
+            <li><span class="label">Received issues:</span>[% recievedlist | html | html_line_break %]</li>
+            <li><span class="label">Missing issues:</span>[% missinglist | html | html_line_break %]</li>
             <li><span class="label">Nonpublic note:</span>[% internalnotes | html | html_line_break %]</li>
             <li><span class="label">Public note:</span>[% notes | html | html_line_break %]</li>
             <li><span class="label">History staff note:</span>[% librariannote | html | html_line_break %]</li>
index d3e95f0..3f04b4e 100644 (file)
                                     [% END %]
                                 </span>[% END %]
                                 [% IF ( subscription.missinglist ) %]
-                                    <p class="subscription_missing">Missing issues: [% subscription.missinglist | html %] </p>
+                                    <p class="subscription_missing">Missing issues: [% subscription.missinglist | html | html_line_break %] </p>
                                 [% END %]
                                 [% IF ( subscription.opacnote ) %]
                                     <p class="subscription_opacnote">[% subscription.opacnote | html | html_line_break %]</p>
index c416dab..6f6e879 100644 (file)
 
                                     [% IF ( subscription_LOO.recievedlist ) %]
                                         <h5>Available issues</h5>
-                                            <p>[% subscription_LOO.recievedlist | html %]</p>
+                                            <p>[% subscription_LOO.recievedlist | html | html_line_break %]</p>
                                     [% END %]
 
                                     [% IF ( subscription_LOO.missinglist ) %]
                                         <h5>Unavailable issues</h5>
-                                        <p>[% subscription_LOO.missinglist | html %]</p>
+                                        <p>[% subscription_LOO.missinglist | html | html_line_break %]</p>
                                     [% END %]
 
                                     [% IF ( subscription_LOO.opacnote ) %]
index b94935f..88f8664 100755 (executable)
@@ -71,9 +71,6 @@ if ( $selectview eq "full" ) {
     my $yearmin = $subscriptions->[0]->{year};
     my $yearmax = $subscriptions->[ -1 ]->{year};
 
-    # replace CR by <br> in librarian note
-    # $subscription->{opacnote} =~ s/\n/\<br\/\>/g;
-
     $template->param(
         biblionumber   => scalar $query->param('biblionumber'),
         years          => $subscriptioninformation,
@@ -106,9 +103,6 @@ else {
         }
     }
 
-    # replace CR by <br> in librarian note
-    # $subscription->{opacnote} =~ s/\n/\<br\/\>/g;
-
     my $title   = $subscriptions->[0]->{bibliotitle};
 
     $template->param(