From be9ace05d3c5946f8c9e6fd0a49a10ca2f21c008 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Holger=20Mei=C3=9Fner?= Date: Fri, 14 Feb 2014 09:11:19 +0100 Subject: [PATCH] Bug 7413: OPAC bootstrap theme changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch makes opac-user.pl and the bootstrap version of opac-user.tt handle the new renewal error "too_soon". To test: 1) Set global syspref "opacthemes" to bootstrap. 2) Set global syspref "OpacRenewalAllowed" to Allow. 3) Test the same things as in previous patch, this time for the OPAC summary page. Sponsored-by: Hochschule für Gesundheit (hsg), Germany --- .../opac-tmpl/bootstrap/en/modules/opac-user.tt | 26 +++++++++----------- opac/opac-user.pl | 17 +++++++++++-- 2 files changed, 27 insertions(+), 16 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 edd569c..cce86f2 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -200,21 +200,19 @@ [% IF ( OpacRenewalAllowed ) %] - [% IF ( ISSUE.status ) %] - [% IF ( canrenew ) %] - Renew - [% END %] - ([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining) - [% ELSE %] - Not renewable - [% IF ( ISSUE.too_many ) %] - ([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining) - [% ELSE %] - [% IF ( ISSUE.on_reserve ) %] - (On hold) - [% END %] - [% END %] + [% IF ( ISSUE.status ) %] + [% IF ( canrenew ) %] + Renew [% END %] + ([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining) + [% ELSIF ( ISSUE.too_many ) %] + Not renewable + [% ELSIF ( ISSUE.too_soon ) %] + No renewal before [% ISSUE.soonestrenewdate %] + ([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining) + [% ELSIF ( ISSUE.on_reserve ) %] + (On hold) + [% END %] [% END %] [% IF ( OPACFinesTab ) %] diff --git a/opac/opac-user.pl b/opac/opac-user.pl index 02002a3..7ca64bd 100755 --- a/opac/opac-user.pl +++ b/opac/opac-user.pl @@ -182,8 +182,21 @@ 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->{'on_reserve'} = 1 if $renewerror eq 'on_reserve'; + + if ( $renewerror eq 'too_soon' ) { + $issue->{'too_soon'} = 1; + $issue->{'soonestrenewdate'} = output_pref( + C4::Circulation::GetSoonestRenewDate( + $issue->{borrowernumber}, + $issue->{itemnumber} + ) + ); + } + } if ( $issue->{'overdue'} ) { push @overdues, $issue; -- 1.7.10.4