From acf862ba6261c8f64bd0e7c8e5a1762eecefd703 Mon Sep 17 00:00:00 2001 From: =?utf8?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=utf8 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 Signed-off-by: Martin Renvoize Signed-off-by: Brendan Gallagher --- .../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 b4a337f0c8..8fb30c16ec 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 02002a3bef..7ca64bdd37 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; -- 2.39.5