From 2c96178684cba0bf118388eafa2b737c6b0ae1b6 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 2 Mar 2026 09:07:49 +0000 Subject: [PATCH] Bug 4858: Refine OPAC print notice UX for patrons without an email address When a patron has no email address on file: - Print transport checkboxes are forced checked and disabled (print is the system fallback when no email exists); a hidden input ensures the print preference is submitted despite the checkbox being disabled. - Email transport checkboxes are disabled (there is no address to send to). Merge the two separate alert blocks (warning before the form, info after the table) into a single alert at the top of the page. Use alert-warning styling when the patron has no email address (charges will apply, no choice) and alert-info styling when they do have an email (charges are avoidable by selecting email delivery). Also move the has_print_transport calculation before the form so the unified alert can use it. Sponsored-by: OpenFifth Signed-off-by: Jackie Usher --- .../bootstrap/en/modules/opac-messaging.tt | 94 +++++++++++-------- 1 file changed, 57 insertions(+), 37 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt index 5bb3499c809..a3cbadfa746 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt @@ -44,17 +44,39 @@ >

Settings updated

[% END %] - [% IF print_notice_charging && !patron_has_email %] -
-

Print Notice Charges

-

Important: Print notices incur a charge of [% print_notice_charge_amount | $Price %] each to cover postage and processing costs.

-

To avoid these charges, please:

-
    -
  • Provide an email address in your account details
  • -
  • Select email delivery for your notice preferences below
  • -
  • Uncheck any print notice options if they are enabled
  • -
-
+ [% IF Koha.Preference( 'EnhancedMessagingPreferencesOPAC' ) %] + [% SET has_print_transport = 0 %] + [% FOREACH pref IN messaging_preferences %] + [% IF pref.transport_print %][% SET has_print_transport = 1 %][% LAST %][% END %] + [% END %] + [% END %] + + [% IF print_notice_charging && has_print_transport %] + [% IF patron_has_email %] +
+

Print notice charges may apply

+

Notices can be sent by post at a charge of [% print_notice_charge_amount | $Price %] each.

+

To avoid these charges, please:

+
    +
  • Ensure print delivery is not selected for any notice type below.
  • +
  • Select email or any other non-print transport all notices below.
  • +
+
+ [% ELSE %] +
+

Print notice charges will apply

+

To avoid these charges, please:

+

We do not have an email address on file for your account. Your notices will be sent by post at a charge of + [% IF print_notice_charge_amount %][% print_notice_charge_amount | $Price %][% ELSE %]0.00[% END %] each.

+

To avoid these charges, please:

+
    +
  • Add an email address to your account
  • Select email as your prefered delivery for each notice type
  • +
+
+ [% END %] [% END %]
@@ -62,10 +84,6 @@ [% IF Koha.Preference( 'EnhancedMessagingPreferencesOPAC' ) %] - [% SET has_print_transport = 0 %] - [% FOREACH pref IN messaging_preferences %] - [% IF pref.transport_print %][% SET has_print_transport = 1 %][% LAST %][% END %] - [% END %] @@ -242,7 +260,17 @@ [% IF ( messaging_preference.transport_email ) %]
Your messaging settings
- [% IF ( messaging_preference.transports_email ) %] + [% IF !patron_has_email %] + + [% ELSIF ( messaging_preference.transports_email ) %] - [% IF ( messaging_preference.transports_print ) %] + [% IF !patron_has_email %] + + + [% ELSIF ( messaging_preference.transports_print ) %] [% END %] - [% IF print_notice_charging %] -
-
About Print Notice Charges
-

Print notices incur a charge of [% IF print_notice_charge_amount %][% print_notice_charge_amount | $Price %][% ELSE %]0.00[% END %] each to cover postage and processing costs.

-

To avoid these charges:

-
    - [% IF !patron_has_email %] -
  • Add an email address to your account details
  • - [% END %] -
  • Select "Email" instead of "Print" for your notice preferences above
  • -
  • Uncheck any enabled print notice preferences above
  • -
- [% IF patron_has_email %] -

✓ You have an email address on file. Make sure to select email delivery for notices to avoid print charges.

- [% ELSE %] -

⚠ Important: You don't have an email address on file. Print notices may be automatically selected for your account.

- [% END %] -
- [% END %] - [% IF ( SMSSendDriver || Koha.Preference('TranslateNotices') ) %]
    -- 2.53.0