Bugzilla – Attachment 135689 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 POD for Koha::Template::Plugin::CirculationRules
Bug-30901-Add-POD-for-KohaTemplatePluginCirculatio.patch (text/plain), 2.39 KB, created by
Kyle M Hall (khall)
on 2022-06-03 17:47:56 UTC
(
hide
)
Description:
Bug 30901: Add POD for Koha::Template::Plugin::CirculationRules
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2022-06-03 17:47:56 UTC
Size:
2.39 KB
patch
obsolete
>From 3cc8d8b2bb35a344c976fa97022896551feaf83f Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 3 Jun 2022 13:34:53 -0400 >Subject: [PATCH] Bug 30901: Add POD for > Koha::Template::Plugin::CirculationRules > >--- > Koha/Template/Plugin/CirculationRules.pm | 44 ++++++++++++++++++++++++ > 1 file changed, 44 insertions(+) > >diff --git a/Koha/Template/Plugin/CirculationRules.pm b/Koha/Template/Plugin/CirculationRules.pm >index 2adfae8ce3..6e89b8615e 100644 >--- a/Koha/Template/Plugin/CirculationRules.pm >+++ b/Koha/Template/Plugin/CirculationRules.pm >@@ -24,6 +24,21 @@ use base qw( Template::Plugin ); > use Koha::CirculationRules; > use C4::Circulation qw( GetRenewCount ); > >+=head1 NAME >+ >+Koha::Template::Plugin::CirculationRules - A template plugin for dealing with things related to circulation >+ >+ >+=head2 Methods >+ >+=head3 Get >+ >+[% SET rule = CirculationRules.Get( branchcode, categorycode, itemtype, rule_name ) %] >+ >+Returns the effective rule value for the given tuple. >+ >+=cut >+ > sub Get { > my ( $self, $branchcode, $categorycode, $itemtype, $rule_name ) = @_; > >@@ -43,6 +58,18 @@ sub Get { > return $rule->rule_value if $rule; > } > >+=head3 Search >+ >+[% SET rule = CirculationRules.Search( branchcode, categorycode, itemtype, rule_name, { want_rule = 1 } ) %] >+ >+Returns the first rule that matches the given critea. >+It does not perform precedence sorting as CirculationRules.Get would. >+ >+By default, it returns only the rule value. Set want_rule to true to return >+the rule object. >+ >+=cut >+ > sub Search { > my ( $self, $branchcode, $categorycode, $itemtype, $rule_name, $params) = @_; > >@@ -63,6 +90,23 @@ sub Search { > return $rule->rule_value if $rule; > } > >+=head3 Renewals >+ >+[% SET renewals = CirculationRules.Renewals( borrowernumber, itemnumber ) %] >+[% renewals.remaining | html %] >+ >+Returns a hash of data about renewals for a checkout, by the given borrowernumber and itemnumber. >+ >+Hash keys include: >+count - The number of renewals already used >+allowed - The total number of renewals this checkout may have >+remaining - The total number of renewals that can still be made >+unseen_count - The number of unseen renewals already used >+unseen_allowed - The total number of unseen renewals this checkout may have >+unseen_remaining - The total number of unseen renewals that can still be made >+ >+=cut >+ > sub Renewals { > my ( $self, $borrowernumber, $itemnumber ); > >-- >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