Bug 7413: OPAC bootstrap theme changes

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 <martin.renvoize@ptfs-europe.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
This commit is contained in:
Holger Meißner 2014-02-14 09:11:19 +01:00 committed by Galen Charlton
parent 065926d224
commit acf862ba62
2 changed files with 27 additions and 16 deletions

View File

@ -200,21 +200,19 @@
</td>
[% IF ( OpacRenewalAllowed ) %]
<td class="renew">
[% IF ( ISSUE.status ) %]
[% IF ( canrenew ) %]
<input type="checkbox" name="item" value="[% ISSUE.itemnumber %]"/> <a href="/cgi-bin/koha/opac-renew.pl?from=opac_user&amp;item=[% ISSUE.itemnumber %]&amp;borrowernumber=[% ISSUE.borrowernumber %]">Renew</a>
[% END %]
<span class="renewals">([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining)</span>
[% ELSE %]
Not renewable
[% IF ( ISSUE.too_many ) %]
<span class="renewals">([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining)</span>
[% ELSE %]
[% IF ( ISSUE.on_reserve ) %]
<span class="renewals">(On hold)</span>
[% END %]
[% END %]
[% IF ( ISSUE.status ) %]
[% IF ( canrenew ) %]
<input type="checkbox" name="item" value="[% ISSUE.itemnumber %]"/> <a href="/cgi-bin/koha/opac-renew.pl?from=opac_user&amp;item=[% ISSUE.itemnumber %]&amp;borrowernumber=[% ISSUE.borrowernumber %]">Renew</a>
[% END %]
<span class="renewals">([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining)</span>
[% ELSIF ( ISSUE.too_many ) %]
Not renewable
[% ELSIF ( ISSUE.too_soon ) %]
No renewal before [% ISSUE.soonestrenewdate %]
<span class="renewals">([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining)</span>
[% ELSIF ( ISSUE.on_reserve ) %]
<span class="renewals">(On hold)</span>
[% END %]
</td>
[% END %]
[% IF ( OPACFinesTab ) %]

View File

@ -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;