From d745df109832c6fdd297b2baf6c3a32b3480ea2a Mon Sep 17 00:00:00 2001 From: Jacob O'Mara Date: Mon, 30 Jun 2025 13:36:01 +0100 Subject: [PATCH] Bug 4858: Add OPAC interface updates for print notice charging - Enhanced opac-messaging.pl to provide print notice charging context - Added warnings in OPAC messaging preferences for patrons without email - Implemented helpful information section about avoiding print charges - Updated OPAC account page with explanatory information about print charges Sponsored-by: OpenFifth Signed-off-by: Jackie Usher --- .../prog/en/modules/members/memberentrygen.tt | 5 +-- .../bootstrap/en/modules/opac-account.tt | 14 +++++++ .../bootstrap/en/modules/opac-messaging.tt | 37 +++++++++++++++++++ opac/opac-messaging.pl | 9 +++++ 4 files changed, 62 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt index cbcfcd58fe0..2d15a32f9ee 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -1535,9 +1535,8 @@ [% IF print_notice_charging && !patron_has_email %]
- Notice: This patron has no email address. - Print notices will incur a charge of [% print_notice_charge_amount | $Price %] each. - Consider encouraging the patron to provide an email address to avoid these charges. + Notice: This patron has no email address. Print notices will incur a charge of [% print_notice_charge_amount | $Price %] each. Consider encouraging the patron to provide an email + address to avoid these charges.
[% END %]
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt index 75dd67bac33..9fda19883a6 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt @@ -69,6 +69,20 @@ [% END %] [% PROCESS 'account-table.inc' ACCOUNT_LINES = ACCOUNT_LINES, ENABLE_OPAC_PAYMENTS = ENABLE_OPAC_PAYMENTS, plugins = plugins %] + + [% IF logged_in_user.category.print_notice_charge > 0 %] +
+
About Print Notice Charges
+

Print notice charges of [% logged_in_user.category.print_notice_charge | $Price %] + each help cover postage and processing costs when notices are sent by mail.

+

To avoid future print notice charges:

+ +
+ [% END %]
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 7e22a3421ff..bb6c2c6224f 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt @@ -1,5 +1,6 @@ [% USE raw %] [% USE Koha %] +[% USE Price %] [% USE AdditionalContents %] [% PROCESS 'i18n.inc' %] [% PROCESS 'html_helpers.inc' %] @@ -43,6 +44,20 @@ >

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
  • +
+
+ [% END %] +
[% INCLUDE 'csrf-token.inc' %] @@ -276,6 +291,28 @@ [% 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 any print options for your notice preferences above
  • +
  • Ask library staff to disable print notices for your account
  • +
+ [% 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') ) %]
    diff --git a/opac/opac-messaging.pl b/opac/opac-messaging.pl index 754901efa30..79bd5f93489 100755 --- a/opac/opac-messaging.pl +++ b/opac/opac-messaging.pl @@ -87,6 +87,15 @@ $template->param( enforce_expiry_notice => $patron->category->enforce_expiry_notice, ); +# Print notice charging context - category-based +if ($patron && $patron->category && $patron->category->print_notice_charge > 0) { + $template->param( + print_notice_charging => 1, + print_notice_charge_amount => $patron->category->print_notice_charge, + patron_has_email => $patron->notice_email_address, + ); +} + if ( $opac_messaging && C4::Context->preference("SMSSendDriver") eq 'Email' ) { my @providers = Koha::SMS::Providers->search( {}, { order_by => 'name' } )->as_list; $template->param( -- 2.53.0