Bugzilla – Attachment 135690 Details for
Bug 30901
Add template method to be able to look up renewal data in Koha slips and notices
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30901: Add Renewals method to CirculationRules template plugin
Bug-30901-Add-Renewals-method-to-CirculationRules-.patch (text/plain), 1.79 KB, created by
Kyle M Hall (khall)
on 2022-06-03 18:10:54 UTC
(
hide
)
Description:
Bug 30901: Add Renewals method to CirculationRules template plugin
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2022-06-03 18:10:54 UTC
Size:
1.79 KB
patch
obsolete
>From 03ab8bd98cd01226332630497f1879ef11137a06 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 3 Jun 2022 13:14:06 -0400 >Subject: [PATCH] Bug 30901: Add Renewals method to CirculationRules template > plugin > >It would be useful to be able to report renewals used/remaining in some notices and slips. > >Test Plan: >1) Apply this patch >2) Add the following to the RENEWAL notices: >-- >[% USE CirculationRules %] >[% SET renewals = CirculationRules.Renewals( borrower.id, item.id ) %] >You have used [% renewals.count %] of [% renewals.allowed %], you have [% renewals.remaining %] renewals left. >-- >3) Trigger a renewal notice >4) Verify the text is correct! >--- > Koha/Template/Plugin/CirculationRules.pm | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > >diff --git a/Koha/Template/Plugin/CirculationRules.pm b/Koha/Template/Plugin/CirculationRules.pm >index 7956bc8d80..0d6f40bb8b 100644 >--- a/Koha/Template/Plugin/CirculationRules.pm >+++ b/Koha/Template/Plugin/CirculationRules.pm >@@ -22,6 +22,7 @@ use Modern::Perl; > use base qw( Template::Plugin ); > > use Koha::CirculationRules; >+use C4::Circulation qw( GetRenewCount ); > > sub Get { > my ( $self, $branchcode, $categorycode, $itemtype, $rule_name ) = @_; >@@ -62,4 +63,19 @@ sub Search { > return $rule->rule_value if $rule; > } > >+sub Renewals { >+ my ( $self, $borrowernumber, $itemnumber ) = @_; >+ >+ my ( $count, $allowed, $remaining, $unseen_count, $unseen_allowed, $unseen_remaining ) = GetRenewCount( $borrowernumber, $itemnumber ); >+ >+ return { >+ count => $count, >+ allowed => $allowed, >+ remaining => $remaining, >+ unseen_count => $unseen_count, >+ unseen_allowed => $unseen_allowed, >+ unseen_remaining => $unseen_remaining, >+ }; >+} >+ > 1; >-- >2.30.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 30901
:
135687
|
135688
|
135689
|
135690
|
135691
|
135692
|
135693
|
136748
|
139086
|
139087
|
139088