Bug 35187: Make sure HTML notices use explicit line breaks

When a notices is marked as HTML, we need to use block elements
(p, div, li, etc.) or explicit line breaks.
This adds the line breaks where required.

Affects:

* ISSUEQSLIP
* ISSUESLIP
* TRANSFERSLIP
* CHECKINSLIP
* HOLD_SLIP
* WELCOME

The biggest change is the WELCOME notices. With this patch
it appears no longer on only one line, but properly formatted.

To test:

WELCOME
* Without patch
* Make sure your Koha can send email (set up SMTP server, KohaAdminLibraryAddress)
* Make sure your patron has an email set
* In patron account, use "More > Welcome email"
* Verify all text is on one line
* Apply patch
* reset_all to install new sample notice templates
* Repeat test, verify welcome notice is now nice

ISSUESLIP, ISSUEQSLIP
* Checkout at least 2 items
* Print > Print slip
* Print > Print quick slip
* Verify both look nice!

CHECKINSLIP
* Return both items
* Print checkin slip (button in list of checkouts)
* Verfiy... you know, that it looks nice!

TRANSFERSLIP
* Checkin an item from another library
* "Print transfer slip"
* Verify again.

HOLD_SLIP
* Place a hold on a record
* Return an item that can fill the hold
* "Print slip and confirm"
* Verify.
* Note: if you compare to before, this also removes a <> appearing instead
  of the city.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Katrin Fischer 2023-10-29 16:10:25 +00:00 committed by Tomas Cohen Arazi
parent 2430d59a00
commit 7ed41b65a4
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
1 changed files with 23 additions and 25 deletions

View File

@ -536,7 +536,6 @@ tables:
- "Chapters: <<article_requests.chapters>>"
- "Notes: <<article_requests.patron_notes>>"
- "Format: [% IF article_request.format == 'PHOTOCOPY' %]Copy[% ELSIF article_request.format == 'SCAN' %]Scan[% END %]"
- ""
- module: circulation
code: CHECKIN
@ -681,17 +680,17 @@ tables:
lang: default
content:
- "<h5>Date: <<today>></h5>"
- ""
- "<br>"
- "<h3> Transfer to/Hold in <<branches.branchname>></h3>"
- ""
- "<br>"
- "<h3><<borrowers.surname>>, <<borrowers.firstname>></h3>"
- ""
- "<br>"
- "<ul>"
- " <li><<borrowers.cardnumber>></li>"
- " <li><<borrowers.phone>></li>"
- " <li> <<borrowers.address>><br />"
- " <<borrowers.address2>><br />"
- " <<borrowers.city >> <<borrowers.zipcode>>"
- " <<borrowers.city>> <<borrowers.zipcode>>"
- " </li>"
- " <li><<borrowers.email>></li>"
- "</ul>"
@ -707,7 +706,6 @@ tables:
- "<p>Notes:"
- "<pre><<reserves.reservenotes>></pre>"
- "</p>"
- ""
- module: circulation
code: ISSUEQSLIP
@ -722,9 +720,9 @@ tables:
- "<h3><<branches.branchname>></h3>"
- "Checked out to <<borrowers.title>> <<borrowers.firstname>> <<borrowers.initials>> <<borrowers.surname>> <br />"
- "(<<borrowers.cardnumber>>) <br />"
- ""
- "<br>"
- "<<today>><br />"
- ""
- "<br>"
- "<h4>Checked out today</h4>"
- "<checkedout>"
- "<p>"
@ -746,9 +744,9 @@ tables:
- "<h3><<branches.branchname>></h3>"
- "Checked out to <<borrowers.title>> <<borrowers.firstname>> <<borrowers.initials>> <<borrowers.surname>> <br />"
- "(<<borrowers.cardnumber>>) <br />"
- ""
- "<br>"
- "<<today>><br />"
- ""
- "<br>"
- "<h4>Checked out</h4>"
- "<checkedout>"
- "<p>"
@ -757,7 +755,7 @@ tables:
- "Date due: <<issues.date_due>><br />"
- "</p>"
- "</checkedout>"
- ""
- "<br>"
- "<h4>Overdues</h4>"
- "<overdue>"
- "<p>"
@ -766,9 +764,9 @@ tables:
- "Date due: <<issues.date_due>><br />"
- "</p>"
- "</overdue>"
- ""
- "<br>"
- "<hr>"
- ""
- "<br>"
- "[% IF additional_contents.count %]"
- "<h4 style=\"text-align: center; font-style:italic;\">News</h4>"
- "[% FOREACH content IN additional_contents %]"
@ -937,9 +935,9 @@ tables:
lang: default
content:
- "<h5>Date: <<today>></h5>"
- ""
- "<br>"
- "<h3>Transfer to <<branches.branchname>></h3>"
- ""
- "<br>"
- "<h3>ITEM</h3>"
- "<h4><<biblio.title>></h4>"
- "<h5><<biblio.author>></h5>"
@ -1441,14 +1439,14 @@ tables:
lang: default
content:
- "[% USE Koha %]"
- "Hello [% borrower.title %] [% borrower.firstname %] [% borrower.surname %]."
- ""
- "Thank you for joining [% IF Koha.Preference('LibraryName') %][% Koha.Preference('LibraryName') %][% ELSE %]the library[% END %]"
- ""
- "You can search for all our materials in our <a href='[% Koha.Preference('OPACBaseURL') %]'>catalog</a>."
- ""
- "Your library card number is [% borrower.cardnumber %]"
- ""
- "Hello [% borrower.title %] [% borrower.firstname %] [% borrower.surname %].<br>"
- "<br>"
- "Thank you for joining [% IF Koha.Preference('LibraryName') %][% Koha.Preference('LibraryName') %][% ELSE %]the library[% END %]<br>"
- "<br>"
- "You can search for all our materials in our <a href='[% Koha.Preference('OPACBaseURL') %]'>catalog</a>.<br>"
- "<br>"
- "Your library card number is [% borrower.cardnumber %]<br>"
- "<br>"
- "If you have any problems or questions regarding your account, please contact the library."
- module: members
@ -2180,9 +2178,9 @@ tables:
- "<h3>[% branch.branchname %]</h3>"
- "Checked in items for [% borrower.title %] [% borrower.firstname %] [% borrower.initials %] [% borrower.surname %] <br />"
- "([% borrower.cardnumber %]) <br />"
- ""
- "<br>"
- "[% today | $KohaDates %]<br />"
- ""
- "<br>"
- "<h4>Checked in today</h4>"
- "[% FOREACH checkin IN old_checkouts %]"
- "[% SET item = checkin.item %]"