Bugzilla – Attachment 186494 Details for
Bug 4858
Ability to Charge for Print Notices
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 4858: Add staff messaging preferences interface for print notice charging
Bug-4858-Add-staff-messaging-preferences-interface.patch (text/plain), 8.45 KB, created by
Jacob O'Mara
on 2025-09-16 17:01:39 UTC
(
hide
)
Description:
Bug 4858: Add staff messaging preferences interface for print notice charging
Filename:
MIME Type:
Creator:
Jacob O'Mara
Created:
2025-09-16 17:01:39 UTC
Size:
8.45 KB
patch
obsolete
>From dc7c52a6c27223357295c418f87645ff4738b55a Mon Sep 17 00:00:00 2001 >From: Jacob O'Mara <jacob.omara@openfifth.co.uk> >Date: Mon, 30 Jun 2025 12:22:03 +0100 >Subject: [PATCH] Bug 4858: Add staff messaging preferences interface for print > notice charging > >- Update messaging-preference-form.inc to include print transport column >- Update memberentry.pl controller with print charging context >- Add print charge warning to memberentrygen.tt template >--- > .../en/includes/messaging-preference-form.inc | 65 +++++++++++++++++++ > .../prog/en/modules/members/memberentrygen.tt | 9 +++ > members/memberentry.pl | 10 +++ > 3 files changed, 84 insertions(+) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc >index cc56c1810c6..f2a715012a4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc >@@ -11,6 +11,18 @@ > [% IF Koha.Preference('SMSSendDriver') %]<th>SMS</th>[% END %] > [% IF Koha.Preference('TalkingTechItivaPhoneNotification') || Koha.Preference('PhoneNotification') %]<th>Phone</th>[% END %] > <th>Email</th> >+ [% SET has_print_transport = 0 %] >+ [% FOREACH pref IN messaging_preferences %] >+ [% IF pref.transport_print %][% SET has_print_transport = 1 %][% LAST %][% END %] >+ [% END %] >+ [% IF has_print_transport %] >+ <th> >+ Print >+ [% IF patron.category.print_notice_charge > 0 %] >+ ([% patron.category.print_notice_charge | $Price %] charge) >+ [% END %] >+ </th> >+ [% END %] > <th > >Digests only > <i id="info_digests" data-bs-toggle="tooltip" title="You can ask for a digest to reduce the number of messages. Messages will be saved and sent as a single message." data-bs-placement="right" class="fa fa-info-circle"></i >@@ -249,6 +261,59 @@ > <td>-</td> > [% END %] > >+ [% IF has_print_transport %] >+ [% IF ( messaging_preference.transport_print ) %] >+ <td> >+ [% IF ( messaging_form_inactive ) %] >+ [% IF ( messaging_preference.transports_print ) %] >+ <input >+ type="checkbox" >+ id="print[% messaging_preference.message_attribute_id | html %]" >+ name="[% messaging_preference.message_attribute_id | html %]" >+ value="print" >+ class="pmp_print" >+ checked="checked" >+ disabled="disabled" >+ /> >+ [% ELSE %] >+ <input type="checkbox" id="print[% messaging_preference.message_attribute_id | html %]" name="[% messaging_preference.message_attribute_id | html %]" value="print" class="pmp_print" disabled="disabled" /> >+ [% END %] >+ [% ELSE %] >+ [% IF patron.category.print_notice_charge > 0 %] >+ <div class="print-notice-warning"> >+ <small class="text-warning"> >+ <i class="fa fa-exclamation-triangle"></i> >+ [% patron.category.print_notice_charge | $Price %] charge per notice >+ </small> >+ </div> >+ [% END %] >+ [% IF ( messaging_preference.transports_print ) %] >+ <input >+ type="checkbox" >+ id="print[% messaging_preference.message_attribute_id | html %]" >+ name="[% messaging_preference.message_attribute_id | html %]" >+ value="print" >+ checked="checked" >+ class="pmp_print active_notify" >+ data-attr-id="[% messaging_preference.message_attribute_id | html %]" >+ /> >+ [% ELSE %] >+ <input >+ type="checkbox" >+ id="print[% messaging_preference.message_attribute_id | html %]" >+ name="[% messaging_preference.message_attribute_id | html %]" >+ value="print" >+ class="pmp_print active_notify" >+ data-attr-id="[% messaging_preference.message_attribute_id | html %]" >+ /> >+ [% END %] >+ [% END %] >+ </td> >+ [% ELSE %] >+ <td>-</td> >+ [% END %] >+ [% END %] >+ > [% IF ( messaging_preference.has_digest ) %] > <td> > [% IF ( messaging_form_inactive ) %] >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 a4cee866f38..7091d09b382 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -4,6 +4,7 @@ > [% USE Koha %] > [% USE KohaDates %] > [% USE Branches %] >+[% USE Price %] > [% PROCESS 'member-main-address-style.inc' %] > [% PROCESS 'member-alt-address-style.inc' %] > [% PROCESS 'member-alt-contact-style.inc' %] >@@ -1599,6 +1600,14 @@ > <i class="fa fa-caret-down" aria-hidden="true"></i> > Patron messaging preferences > </legend> >+ [% IF print_notice_charging && !patron_has_email %] >+ <div class="alert alert-warning"> >+ <i class="fa fa-exclamation-triangle"></i> >+ <strong>Notice:</strong> 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. >+ </div> >+ [% END %] > <div class="messaging_prefs"> > <div id="messaging_prefs_loading" class="form-message" style="display:none"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading new messaging defaults </div> > <input type="hidden" name="setting_messaging_prefs" value="1" /> >diff --git a/members/memberentry.pl b/members/memberentry.pl >index 5f15a105556..f8adb880e12 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -855,6 +855,16 @@ if ( C4::Context->preference('EnhancedMessagingPreferences') ) { > $template->param( SMSSendDriver => C4::Context->preference("SMSSendDriver") ); > $template->param( SMSnumber => $data{'smsalertnumber'} ); > $template->param( TalkingTechItivaPhone => C4::Context->preference("TalkingTechItivaPhoneNotification") ); >+ >+ # 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, >+ ); >+ } >+ > } > > $template->param( borrower_data => \%data ); >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 4858
:
186491
|
186492
|
186493
| 186494 |
186495
|
186496
|
186497
|
186498
|
186499
|
186500
|
186501
|
186502