@@ -, +, @@ plugin -- -- --- Koha/Template/Plugin/CirculationRules.pm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) --- a/Koha/Template/Plugin/CirculationRules.pm +++ a/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; --