@@ -, +, @@ --- koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt | 27 ++++++++++----------- opac/opac-user.pl | 6 ++-- 2 files changed, 16 insertions(+), 17 deletions(-) --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt +++ a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt @@ -58,7 +58,6 @@ $.tablesorter.addParser({
- [% IF ( bor_messages ) %]

Messages For You

@@ -80,7 +79,7 @@ $.tablesorter.addParser({ [% IF ( patronupdate ) %]

Thank you!

Your corrections have been submitted to the library, and a staff member will update your record as soon as possible.

[% END %] - [% IF ( BORROWER_INF.flagged ) %] + [% IF ( patron_flagged ) %]
    [% IF ( BORROWER_INF.debarred ) %] @@ -187,7 +186,7 @@ $.tablesorter.addParser({ [% IF ( show_barcode ) %]Barcode[% END %] Call No. [% IF ( OpacRenewalAllowed ) %] - [% UNLESS patron_flagged %]Renew[% END %] + Renew [% END %] [% IF ( OPACFinesTab ) %] Fines @@ -235,12 +234,10 @@ $.tablesorter.addParser({ [% IF ( show_barcode ) %][% ISSUE.barcode %][% END %] [% ISSUE.itemcallnumber %] [% IF ( OpacRenewalAllowed ) %] - [% UNLESS patron_flagged %] - [% IF ( ISSUE.status ) %] Renew ([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining) + [% 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 %] [% END %] - [% END %] [% END %] [% IF ( OPACFinesTab ) %] [% IF ( ISSUE.charges ) %]Yes[% ELSE %]No[% END %] @@ -253,8 +250,10 @@ $.tablesorter.addParser({ [% IF ( canrenew ) %] [% IF ( OpacRenewalAllowed ) %] - - [% END %] + [% IF ( canrenew ) %] + + [% END %] + [% END %] [% END %] [% IF ( OpacRenewalAllowed ) %] @@ -265,7 +264,7 @@ $.tablesorter.addParser({ [% FOREACH ISSUE IN ISSUES %] [% END %] - [% UNLESS patron_flagged %][% END %] + [% END %] [% END %] @@ -288,7 +287,8 @@ $.tablesorter.addParser({ Call No. Due [% IF ( OpacRenewalAllowed ) %] - [% UNLESS patron_flagged %]Renew[% END %][% END %] + Renew +[% END %] [% IF ( OPACFinesTab ) %] Fines [% END %] @@ -320,15 +320,14 @@ $.tablesorter.addParser({ [% OVERDUE.itemcallnumber %] [% OVERDUE.date_due %] [% IF ( OpacRenewalAllowed ) %] - [% UNLESS patron_flagged %] [% IF ( OVERDUE.debarred ) %]Account Frozen [% ELSIF ( OVERDUE.status ) %] -Renew ([% OVERDUE.renewsleft %] of [% OVERDUE.renewsallowed %] renewals remaining) -[% ELSIF ( OVERDUE.onreserve ) %]On Reserve +[% IF ( canrenew ) %]Renew[% END %] ([% OVERDUE.renewsleft %] of [% OVERDUE.renewsallowed %] renewals remaining) +[% ELSIF ( OVERDUE.onreserve ) %]On hold [% ELSE %]No renewals left [% END %] -[% END %][% END %] +[% END %] [% IF ( OPACFinesTab ) %] [% IF ( OVERDUE.charges ) %]Yes[% ELSE %]No[% END %] [% END %] --- a/opac/opac-user.pl +++ a/opac/opac-user.pl @@ -60,6 +60,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( my $OPACDisplayRequestPriority = (C4::Context->preference("OPACDisplayRequestPriority")) ? 1 : 0; my $patronupdate = $query->param('patronupdate'); +my $canrenew = 1; # get borrower information .... my ( $borr ) = GetMemberDetails( $borrowernumber ); @@ -71,6 +72,7 @@ $borr->{'ethnicity'} = fixEthnicity( $borr->{'ethnicity'} ); if ( $borr->{'debarred'} || $borr->{'gonenoaddress'} || $borr->{'lost'} ) { $borr->{'flagged'} = 1; + $canrenew = 0; } if ( $borr->{'amountoutstanding'} > 5 ) { @@ -84,6 +86,7 @@ $no_renewal_amt ||= 0; if ( $borr->{amountoutstanding} > $no_renewal_amt ) { $borr->{'flagged'} = 1; + $canrenew = 0; $template->param( renewal_blocked_fines => sprintf( '%.02f', $no_renewal_amt ), ); @@ -108,13 +111,11 @@ $template->param( BORROWER_INFO => \@bordat, #get issued items .... my $count = 0; -my $toggle = 0; my $overdues_count = 0; my @overdues; my @issuedat; my $itemtypes = GetItemTypes(); my ($issues) = GetPendingIssues($borrowernumber); -my $canrenew = 0; if ($issues){ foreach my $issue ( sort { $b->{'date_due'} cmp $a->{'date_due'} } @$issues ) { # check for reserves @@ -145,7 +146,6 @@ if ($issues){ ($issue->{'renewcount'},$issue->{'renewsallowed'},$issue->{'renewsleft'}) = GetRenewCount($borrowernumber, $issue->{'itemnumber'}); if($status && C4::Context->preference("OpacRenewalAllowed")){ $issue->{'status'} = $status; - $canrenew = 1; } $issue->{'too_many'} = 1 if $renewerror and $renewerror eq 'too_many'; $issue->{'on_reserve'} = 1 if $renewerror and $renewerror eq 'on_reserve'; --