Bugzilla – Attachment 168733 Details for
Bug 28924
Allow checkout fine limit to be determined by patron category
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28924: Add a template method and update template usages
Bug-28924-Add-a-template-method-and-update-templat.patch (text/plain), 3.94 KB, created by
Nick Clemens (kidclamp)
on 2024-07-10 13:32:16 UTC
(
hide
)
Description:
Bug 28924: Add a template method and update template usages
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2024-07-10 13:32:16 UTC
Size:
3.94 KB
patch
obsolete
>From 920dbe4d2a85d8a51097fa50250780ccb02e977c Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Mon, 22 Jan 2024 15:55:57 +0000 >Subject: [PATCH] Bug 28924: Add a template method and update template usages > >This patch adds a method to be used in the template where currently the Koha.Preference('noissuescharge') method is used. This currently does not take into account the new patron category level limits and so needs to be updated to its own method to handle these. > >Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/> >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > Koha/Template/Plugin/Categories.pm | 6 ++++++ > .../intranet-tmpl/prog/en/includes/blocked-fines.inc | 9 +++++---- > .../intranet-tmpl/prog/en/includes/patron_messages.inc | 2 +- > .../prog/en/modules/circ/circulation_batch_checkouts.tt | 2 +- > 4 files changed, 13 insertions(+), 6 deletions(-) > >diff --git a/Koha/Template/Plugin/Categories.pm b/Koha/Template/Plugin/Categories.pm >index 4d425d6f9ec..4b7c9c6e5dc 100644 >--- a/Koha/Template/Plugin/Categories.pm >+++ b/Koha/Template/Plugin/Categories.pm >@@ -45,6 +45,12 @@ sub can_any_reset_password { > : 0; > } > >+sub GetPatronCharges { >+ my ( $self, $params ) = @_; >+ my $charges = Koha::Patron->is_patron_inside_charge_limits({ borrowernumber => $params }); >+ return $charges->{noissuescharge}; >+} >+ > 1; > > =head1 NAME >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/blocked-fines.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/blocked-fines.inc >index b53f98d2f65..3e103ff7709 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/blocked-fines.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/blocked-fines.inc >@@ -1,10 +1,11 @@ > [% USE Price %] >-[% SET NoIssuesCharge = Koha.Preference('noissuescharge') %] >-[% IF fines and fines > 0 %] >+[% USE Categories %] >+[% SET NoIssuesCharge = Categories.GetPatronCharges(borrowernumber) %] >+[% IF NoIssuesCharge.charge and NoIssuesCharge.charge > 0 %] > <li> > <span class="circ-hlt">Charges:</span> >- <span>Patron has outstanding charges of [% fines | $Price %].</span> >- [% IF !Koha.Preference('AllowFineOverride') && NoIssuesCharge && fines > NoIssuesCharge %] >+ <span>Patron has outstanding charges of [% NoIssuesCharge.charge | $Price %].</span> >+ [% IF !Koha.Preference('AllowFineOverride') && NoIssuesCharge.limit && NoIssuesCharge.overlimit %] > <span class="circ-hlt">Checkouts are BLOCKED because fine balance is OVER THE LIMIT.</span> > [% END %] > [% IF CAN_user_updatecharges_remaining_permissions %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc >index 666d07ad0f5..38a0fb7c5c4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc >@@ -119,7 +119,7 @@ > [% END %] > > [% IF ( charges ) %] >- [% INCLUDE 'blocked-fines.inc' fines = chargesamount %] >+ [% INCLUDE 'blocked-fines.inc' borrowernumber = patron.borrowernumber %] > [% END %] > > [% IF ( charges_guarantors_guarantees ) %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt >index 83f91ae8bdc..3beb6d14aff 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt >@@ -63,7 +63,7 @@ > <div class="dialog alert"> > Cannot check out! > [% IF ( charges ) %] >- [% INCLUDE 'blocked-fines.inc' fines = chargesamount %] >+ [% INCLUDE 'blocked-fines.inc' borrowernumber = patron.borrowernumber %] > [% END %] > [% IF ( charges_guarantors_guarantees ) %] > <li> >-- >2.39.2
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 28924
:
165870
|
165871
|
165872
|
165873
|
165874
|
165875
|
165876
|
166042
|
166043
|
166044
|
166045
|
166046
|
166047
|
166048
|
166171
|
166172
|
166173
|
166174
|
166175
|
166176
|
166177
|
167719
|
167720
|
167721
|
167722
|
167723
|
167724
|
167725
|
167726
|
167727
|
167728
|
167729
|
167730
|
167731
|
167732
|
167733
|
167734
|
167735
|
167736
|
167737
|
167738
|
167739
|
167740
|
168728
|
168729
|
168730
|
168731
|
168732
|
168733
|
168734
|
168735
|
168736
|
168737
|
168738
|
168984
|
168985
|
168986
|
168987
|
168988
|
168989
|
168990
|
168991
|
168992
|
168993
|
168994
|
168995
|
169177
|
169428