Bug 38087 - Ship a default print template for the welcome notice
Summary: Ship a default print template for the welcome notice
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Martin Renvoize (ashimema)
QA Contact: Baptiste Wojtkowski (bwoj)
URL:
Keywords:
Depends on: 35279
Blocks: 39410
  Show dependency treegraph
 
Reported: 2024-10-04 06:41 UTC by Martin Renvoize (ashimema)
Modified: 2025-03-21 16:51 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
25.05.00
Circulation function:


Attachments
Bug 38087: Add print template for WELCOME notice at install time (4.12 KB, patch)
2024-10-04 11:49 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 38087: Add print template for WELCOME notice at install time (4.18 KB, patch)
2024-10-04 13:37 UTC, Laura Escamilla
Details | Diff | Splinter Review
Bug 38087: Add print template for WELCOME notice at install time (4.19 KB, patch)
2025-02-25 14:11 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 38087: Add atomicupdate (2.87 KB, patch)
2025-02-25 14:11 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 38087: Add print template for WELCOME notice at install time (4.25 KB, patch)
2025-03-12 10:56 UTC, Baptiste Wojtkowski (bwoj)
Details | Diff | Splinter Review
Bug 38087: Add atomicupdate (2.93 KB, patch)
2025-03-12 10:56 UTC, Baptiste Wojtkowski (bwoj)
Details | Diff | Splinter Review
Screenshot of notice preview with classes as used here. (36.87 KB, image/png)
2025-03-21 12:22 UTC, Martin Renvoize (ashimema)
Details
Bug 38087: (follow-up) Add missing div to template (6.57 KB, patch)
2025-03-21 12:45 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize (ashimema) 2024-10-04 06:41:19 UTC
In bug 35279 we added code to allow falling back to print when an email address isn't found.

However, we neglected to clone the sample email template to print so one still has to define the print version of the notice.

We should ship with a default.
Comment 1 Martin Renvoize (ashimema) 2024-10-04 11:49:47 UTC
Created attachment 172386 [details] [review]
Bug 38087: Add print template for WELCOME notice at install time

This patch adds a default print template for the welcome notice. It will
be installed at install time but will not be added at upgrade time.

It will also be available as the default under the notice templates
tool.

Test plan
1) Apply the patch
2) Under 'Tools > Notices and Slips' select the 'WELCOME' notice to edit
3) Click 'View default' under the 'Print' message transport type
4) Note the new default template is shown
5) Use 'Copy to template' to apply it to the notice
6) Use a user (Henry perhaps under sandboxes) without an email address
   to test the template by
6a) Under 'more' click 'Send welcome notice'
7) Preview the pending print notice under the patrons notices tab by
   clicking the notice title.
8) Confirm the notice looks reasonable and sign off
Comment 2 Laura Escamilla 2024-10-04 13:37:47 UTC
Created attachment 172398 [details] [review]
Bug 38087: Add print template for WELCOME notice at install time

This patch adds a default print template for the welcome notice. It will
be installed at install time but will not be added at upgrade time.

It will also be available as the default under the notice templates
tool.

Test plan
1) Apply the patch
2) Under 'Tools > Notices and Slips' select the 'WELCOME' notice to edit
3) Click 'View default' under the 'Print' message transport type
4) Note the new default template is shown
5) Use 'Copy to template' to apply it to the notice
6) Use a user (Henry perhaps under sandboxes) without an email address
   to test the template by
6a) Under 'more' click 'Send welcome notice'
7) Preview the pending print notice under the patrons notices tab by
   clicking the notice title.
8) Confirm the notice looks reasonable and sign off

Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Comment 3 Martin Renvoize (ashimema) 2025-01-07 14:17:36 UTC
Thanks for the testing and signoff Laura
Comment 4 Marcel de Rooy 2025-02-21 10:27:57 UTC
This patch adds a default print template for the welcome notice. It will
be installed at install time but will not be added at upgrade time.

That is unusual. Please explain why.
Comment 5 Martin Renvoize (ashimema) 2025-02-25 14:11:14 UTC
Created attachment 178683 [details] [review]
Bug 38087: Add print template for WELCOME notice at install time

This patch adds a default print template for the welcome notice. It will
be installed at install time but will not be added at upgrade time.

It will also be available as the default under the notice templates
tool.

Test plan
1) Apply the patch
2) Under 'Tools > Notices and Slips' select the 'WELCOME' notice to edit
3) Click 'View default' under the 'Print' message transport type
4) Note the new default template is shown
5) Use 'Copy to template' to apply it to the notice
6) Use a user (Henry perhaps under sandboxes) without an email address
   to test the template by
6a) Under 'more' click 'Send welcome notice'
7) Preview the pending print notice under the patrons notices tab by
   clicking the notice title.
8) Confirm the notice looks reasonable and sign off

Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Comment 6 Martin Renvoize (ashimema) 2025-02-25 14:11:17 UTC
Created attachment 178684 [details] [review]
Bug 38087: Add atomicupdate
Comment 7 Baptiste Wojtkowski (bwoj) 2025-03-12 10:56:42 UTC
Created attachment 179199 [details] [review]
Bug 38087: Add print template for WELCOME notice at install time

This patch adds a default print template for the welcome notice. It will
be installed at install time but will not be added at upgrade time.

It will also be available as the default under the notice templates
tool.

Test plan
1) Apply the patch
2) Under 'Tools > Notices and Slips' select the 'WELCOME' notice to edit
3) Click 'View default' under the 'Print' message transport type
4) Note the new default template is shown
5) Use 'Copy to template' to apply it to the notice
6) Use a user (Henry perhaps under sandboxes) without an email address
   to test the template by
6a) Under 'more' click 'Send welcome notice'
7) Preview the pending print notice under the patrons notices tab by
   clicking the notice title.
8) Confirm the notice looks reasonable and sign off

Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Comment 8 Baptiste Wojtkowski (bwoj) 2025-03-12 10:56:45 UTC
Created attachment 179200 [details] [review]
Bug 38087: Add atomicupdate

Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Comment 9 Katrin Fischer 2025-03-19 10:45:24 UTC
I am pondering the same as Marcel, but in the other direction.
I am pondering to drop the second patch and be happy with the new installations + reset option. OK or am I missing something because it's the print one?
 
When updating Koha installations we try to have the "least surprise" and avoid behavior change. Now that we have the notice reset feature (which honestly is awesome) libraries can add a print notice any time from that and it will be also the translated version in their language.  We also discussed on another bug how to make the reset feature more prominent for creating notices from scratch.

But another question: I notice a lot of unusual CSS classes in the template, can you explain about these?

<div class=\"col-6\">
<div class=\"col-6 text-end\">
<div class=\"row mb-4\">

We don't have any of these in other notices and I believe there is no sample CSS to use them, so maybe we should remove from the sample or add some notes on how to make use of them for formatting?

Waiting for feedback - will get back to this asap then.
Comment 10 Martin Renvoize (ashimema) 2025-03-21 12:19:22 UTC
I wrote this long enough ago that I can't entirely remember the specifics of the classes.. it was written as a way to easy testing some of the CSS bugs and the staff client notices display and print pages bug... the classes are likely referring to those patches.. and as far as I can tell now they're all just standard bootstrap 5.
Comment 11 Katrin Fischer 2025-03-21 12:21:51 UTC
(In reply to Martin Renvoize (ashimema) from comment #10)
> I wrote this long enough ago that I can't entirely remember the specifics of
> the classes.. it was written as a way to easy testing some of the CSS bugs
> and the staff client notices display and print pages bug... the classes are
> likely referring to those patches.. and as far as I can tell now they're all
> just standard bootstrap 5.

I was wondering because it's for the print layout and I think then they probably won't be applied, but I am not sure. We can still simplify later, I won't change the template for now but leave off the database update.
Comment 12 Martin Renvoize (ashimema) 2025-03-21 12:22:43 UTC
Created attachment 179586 [details]
Screenshot of notice preview with classes as used here.
Comment 13 Martin Renvoize (ashimema) 2025-03-21 12:23:38 UTC
See screenshot.. that's how the notice looks for the Henry user in KTD with the classes in tact.. personally.. I think that's a reasonable display for a print style notice and would prefer not to remove them.
Comment 14 Martin Renvoize (ashimema) 2025-03-21 12:25:06 UTC
They are applied correctly in the preview.. I think that's actually what a lot of this we added to test in fact if memory serves
Comment 15 Martin Renvoize (ashimema) 2025-03-21 12:45:27 UTC
Created attachment 179587 [details] [review]
Bug 38087: (follow-up) Add missing div to template

We lost a closing div somewhere during the life of this patchset
Comment 16 Katrin Fischer 2025-03-21 13:30:25 UTC
I agree the display in the preview is quite nice, I was pretty sure it would work in Koha, just not sure it work with the gather_print_notices.pl - I need to do some testing there if I want to find out, but the classes won't hurt.
Comment 17 Katrin Fischer 2025-03-21 16:49:00 UTC
I've removed the database update, rest left as is.
Comment 18 Katrin Fischer 2025-03-21 16:51:13 UTC
Pushed for 25.05!

Well done everyone, thank you!