From 5ca8af3083558d8a492581a485d4726cae4e3388 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Holger=20Mei=C3=9Fner?= Date: Fri, 24 Jan 2014 11:32:29 +0100 Subject: [PATCH 4/5] Bug 7413: Allow OPAC renewal x days before due date MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch makes the bootstrap version of opac-user.tt handle the new renewal error "too_soon". To test: 1) Set global syspref "opacthemes" to bootstrap. 2) Test the sames things as in previous patch, only for opac-user.tt. 3) Confirm that additionally to "Not renewable yet", the number of remaining renewals is displayed. Sponsored-by: Hochschule für Gesundheit (hsg), Germany --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt | 9 +++++++-- opac/opac-user.pl | 8 ++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt index a16dc47..5409171 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -206,14 +206,19 @@ [% END %] ([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining) [% ELSE %] - Not renewable - [% IF ( ISSUE.too_many ) %] + [% IF ( ISSUE.too_many ) %] + Not renewable + ([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining) + [% ELSE %] + [% IF ( ISSUE.too_soon ) %] + Not renewable yet ([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining) [% ELSE %] [% IF ( ISSUE.on_reserve ) %] (On hold) [% END %] [% END %] + [% END %] [% END %] [% END %] diff --git a/opac/opac-user.pl b/opac/opac-user.pl index 02002a3..e34c488 100755 --- a/opac/opac-user.pl +++ b/opac/opac-user.pl @@ -182,8 +182,12 @@ if ($issues){ if($status && C4::Context->preference("OpacRenewalAllowed")){ $issue->{'status'} = $status; } - $issue->{'too_many'} = 1 if $renewerror and $renewerror eq 'too_many'; - $issue->{'on_reserve'} = 1 if $renewerror and $renewerror eq 'on_reserve'; + + if ( $renewerror ) { + $issue->{'too_many'} = 1 if $renewerror eq 'too_many'; + $issue->{'too_soon'} = 1 if $renewerror eq 'too_soon'; + $issue->{'on_reserve'} = 1 if $renewerror eq 'on_reserve'; + } if ( $issue->{'overdue'} ) { push @overdues, $issue; -- 1.7.10.4