Bug 23409 - Show circulation note and OPAC note with line feeds
Summary: Show circulation note and OPAC note with line feeds
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Alex Arnaud
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-01 09:37 UTC by Alex Arnaud
Modified: 2019-08-15 21:19 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 23409 - show borrowernotes and opacnote's lines feeds (1.12 KB, patch)
2019-08-01 12:51 UTC, Alex Arnaud
Details | Diff | Splinter Review
Bug 23409 - show borrowernotes and opacnote's lines feeds (2.14 KB, patch)
2019-08-01 13:31 UTC, Alex Arnaud
Details | Diff | Splinter Review
Bug 23409 - show borrowernotes and opacnote's lines feeds (2.09 KB, patch)
2019-08-13 08:26 UTC, Alex Arnaud
Details | Diff | Splinter Review
Bug 23409: show borrowernotes and opacnote's lines feeds (2.09 KB, patch)
2019-08-13 08:29 UTC, Alex Arnaud
Details | Diff | Splinter Review
Bug 23409: show borrowernotes and opacnote's lines feeds (2.16 KB, patch)
2019-08-15 21:17 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 23409: (follow-up) Allow HTML in circulation note and add line breaks in OPAC user account (2.74 KB, patch)
2019-08-15 21:17 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Arnaud 2019-08-01 09:37:11 UTC
Currently, lines feeds typed in borrowernotes and opacnote are not visible in the interface. 
Patch is coming.
Comment 1 Alex Arnaud 2019-08-01 12:51:13 UTC Comment hidden (obsolete)
Comment 2 Katrin Fischer 2019-08-01 13:03:01 UTC
Hi Alex,

I think there is a nicer way to solve this using TT filters. I've seen them used in quite a few places already.

http://www.template-toolkit.org/docs/manual/Filters.html#section_html_line_break
Comment 3 Alex Arnaud 2019-08-01 13:31:05 UTC Comment hidden (obsolete)
Comment 4 Katrin Fischer 2019-08-01 13:37:19 UTC
Instead of:

+                                                [% FILTER html_line_break %]
+                                                    [% patron.opacnote | html %]
+                                                [% END %]

You can just do:

[% patron.opacnote | html | html_line_break %] 

(I think we first want to espace, then make br so the br are not esacped)
Comment 5 Fridolin SOMERS 2019-08-01 15:24:27 UTC
(In reply to Katrin Fischer from comment #4)
> Instead of:
> 
> +                                                [% FILTER html_line_break %]
> +                                                    [% patron.opacnote |
> html %]
> +                                                [% END %]
> 
> You can just do:
> 
> [% patron.opacnote | html | html_line_break %] 
> 
> (I think we first want to espace, then make br so the br are not esacped)

Indeed, its much better ;)
See existing :
[% subscription.notes | html | html_line_break %]
Comment 6 Fridolin SOMERS 2019-08-01 15:33:14 UTC
patron.opacnote exists in other places :
koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt
koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-note.inc

borrowernotes exists in a lot of other places.

BTW html filter should always be used, not $raw.
Comment 7 Katrin Fischer 2019-08-10 20:55:33 UTC
Hi Alex, will you have a chance to submit an updated patch?
Comment 8 Alex Arnaud 2019-08-13 08:26:59 UTC Comment hidden (obsolete)
Comment 9 Alex Arnaud 2019-08-13 08:29:13 UTC
Created attachment 92173 [details] [review]
Bug 23409: show borrowernotes and opacnote's lines feeds

Test plan:
  - Fill borrowernotes and opacnote with lines separated by lines
    endings,
  - save and check the content is displayed on a single line,
  - apply this patch,
  - check lines endings are displayed
Comment 10 Katrin Fischer 2019-08-15 21:17:09 UTC
Created attachment 92246 [details] [review]
Bug 23409: show borrowernotes and opacnote's lines feeds

Test plan:
  - Fill borrowernotes and opacnote with lines separated by lines
    endings,
  - save and check the content is displayed on a single line,
  - apply this patch,
  - check lines endings are displayed

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 11 Katrin Fischer 2019-08-15 21:17:13 UTC
Created attachment 92247 [details] [review]
Bug 23409: (follow-up) Allow HTML in circulation note and add line breaks in OPAC user account

This patch makes 2 changes:
- bug 22702 allowed adding HTML to the circulation note, so this patch
  restores that ability.
- display OPAC note and messages as multi-line in OPAC

To test:
- Add a circulation and an OPAC note with line breaks and HTML tags
  to the patron account
- Add a message with line breaks to the patron account
- Check line breaks don't show on
  - OPAC > patron account > my summary page
  - Staff > patron account > details
- Apply patches
- Repeat test
Comment 12 Katrin Fischer 2019-08-15 21:19:01 UTC
Added a follow-up - can you check Alex? 

Changes in OPAC are debatable on this bug report, but I think we really need to put back the $raw because of bug 22702.