From 34e13040b2f8616c74aa542813d40b11f68ec4be Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Tue, 18 Jun 2019 08:06:10 +0200 Subject: [PATCH] Bug 23126: Display multi-line entries in subscrpitions correctly 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
- 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 Signed-off-by: Nadine Pierre Signed-off-by: Jonathan Druart Signed-off-by: Martin Renvoize (cherry picked from commit 316eda1036fd08f9c78578b27e85fd79c6895237) Signed-off-by: Fridolin Somers --- C4/Serials.pm | 3 --- .../prog/en/modules/serials/serials-collection.tt | 2 +- .../intranet-tmpl/prog/en/modules/serials/serials-edit.tt | 2 +- .../prog/en/modules/serials/subscription-detail.tt | 4 ++-- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 2 +- .../opac-tmpl/bootstrap/en/modules/opac-serial-issues.tt | 4 ++-- opac/opac-serial-issues.pl | 6 ------ 7 files changed, 7 insertions(+), 16 deletions(-) diff --git a/C4/Serials.pm b/C4/Serials.pm index 44c3cb958e..6bdbd8cc4e 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -429,9 +429,6 @@ sub GetSubscriptionsFromBiblionumber { $subs->{histenddate} = ""; } $subs->{opacnote} //= ""; - $subs->{opacnote} =~ s/\n/\/g; - $subs->{missinglist} =~ s/\n/\/g; - $subs->{recievedlist} =~ s/\n/\/g; $subs->{ "periodicity" . $subs->{periodicity} } = 1; $subs->{ "numberpattern" . $subs->{numberpattern} } = 1; $subs->{ "status" . $subs->{'status'} } = 1; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt index 454a7262c7..7d4310d406 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt @@ -53,7 +53,7 @@ [% subscription.numberpattern.label | html %] [% IF subscription.branchcode %][% Branches.GetName( subscription.branchcode ) | html %][% END %] [% subscription.callnumber | html %] - [% subscription.notes | html %] + [% subscription.notes | html | html_line_break %] [% UNLESS subscription.closed %] [% IF ( subscription.subscriptionexpired ) %]
Subscription expired diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt index 37ccf50194..7d95e0564d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt @@ -95,7 +95,7 @@ $(document).ready(function() {

Serial edition [% bibliotitle | html %] [% IF location %] ([% AuthorisedValues.GetByCode('LOC', location) | html %])[% END %] [% IF ( callnumber ) %] callnumber: [% callnumber | html %][% END %]

-[% IF internalnotes %]

Nonpublic note: [% internalnotes | html %]

[% END %] +[% IF internalnotes %]

Nonpublic note: [% internalnotes | html | html_line_break %]

[% END %]
[% IF ( Errors ) %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt index a30270abf7..4cf1291bb7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt @@ -332,8 +332,8 @@
  • End date: [% enddate | html %]
  • History start date: [% histstartdate | html %]
  • History end date: [% histenddate | html %]
  • -
  • Received issues:[% recievedlist | html %]
  • -
  • Missing issues:[% missinglist | html %]
  • +
  • Received issues:[% recievedlist | html | html_line_break %]
  • +
  • Missing issues:[% missinglist | html | html_line_break %]
  • Nonpublic note:[% internalnotes | html | html_line_break %]
  • Public note:[% notes | html | html_line_break %]
  • History staff note:[% librariannote | html | html_line_break %]
  • 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 d3e95f0097..3f04b4e6f7 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -832,7 +832,7 @@ [% END %] [% END %] [% IF ( subscription.missinglist ) %] -

    Missing issues: [% subscription.missinglist | html %]

    +

    Missing issues: [% subscription.missinglist | html | html_line_break %]

    [% END %] [% IF ( subscription.opacnote ) %]

    [% subscription.opacnote | html | html_line_break %]

    diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-serial-issues.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-serial-issues.tt index c416dab05f..6f6e879ca6 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-serial-issues.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-serial-issues.tt @@ -120,12 +120,12 @@ [% IF ( subscription_LOO.recievedlist ) %]
    Available issues
    -

    [% subscription_LOO.recievedlist | html %]

    +

    [% subscription_LOO.recievedlist | html | html_line_break %]

    [% END %] [% IF ( subscription_LOO.missinglist ) %]
    Unavailable issues
    -

    [% subscription_LOO.missinglist | html %]

    +

    [% subscription_LOO.missinglist | html | html_line_break %]

    [% END %] [% IF ( subscription_LOO.opacnote ) %] diff --git a/opac/opac-serial-issues.pl b/opac/opac-serial-issues.pl index b94935feee..88f86646e1 100755 --- a/opac/opac-serial-issues.pl +++ b/opac/opac-serial-issues.pl @@ -71,9 +71,6 @@ if ( $selectview eq "full" ) { my $yearmin = $subscriptions->[0]->{year}; my $yearmax = $subscriptions->[ -1 ]->{year}; - # replace CR by
    in librarian note - # $subscription->{opacnote} =~ s/\n/\/g; - $template->param( biblionumber => scalar $query->param('biblionumber'), years => $subscriptioninformation, @@ -106,9 +103,6 @@ else { } } - # replace CR by
    in librarian note - # $subscription->{opacnote} =~ s/\n/\/g; - my $title = $subscriptions->[0]->{bibliotitle}; $template->param( -- 2.39.5