Bugzilla – Attachment 7204 Details for
Bug 6598
OPACFineNoRenewals syspreference does not stop user renewing in opac
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Revised fix
0001-Bug-6598-REVISED-OPACFineNoRenewals-syspreference-do.patch (text/plain), 7.15 KB, created by
Owen Leonard
on 2012-01-17 21:09:51 UTC
(
hide
)
Description:
Revised fix
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2012-01-17 21:09:51 UTC
Size:
7.15 KB
patch
obsolete
>From 5fe026a503e7af12f1ca3885efd2b1f9d59a8034 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Tue, 11 Oct 2011 14:52:19 -0400 >Subject: [PATCH] Bug 6598 [REVISED] OPACFineNoRenewals syspreference does not stop user renewing in opac >Content-Type: text/plain; charset="utf-8" > >This patch standardizes the condition under which renewal controls >are displayed at the page (as opposed to item) level. In some >places "canrenew" was used, in others "patron_flagged" was used. >Now "canrenew" controls renew controls and "patron_flagged" only >triggers the display of user warnings. > >This patch also allows for renewal information to be displayed >for each item in situations where OPAC renewals are allowed but >disabled for whatever reason. This gives the patron information >about used/available renew counts but hides renew controls. >--- > koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt | 21 +++++++++------------ > opac/opac-user.pl | 6 +++--- > 2 files changed, 12 insertions(+), 15 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt >index b78fc03..ffcd293 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt >@@ -58,7 +58,6 @@ $.tablesorter.addParser({ > <div id="yui-main"> > <div class="yui-b"><div class="yui-g"> > <div id="userdetails" class="container"> >- > [% IF ( bor_messages ) %] > <div class="dialog message"> > <h3>Messages For You</h3> >@@ -89,7 +88,7 @@ $.tablesorter.addParser({ > </div> > [% END %] > >- [% IF ( BORROWER_INF.flagged ) %] >+ [% IF ( patron_flagged ) %] > <div class="dialog alert"> > <ul> > [% IF ( userdebarred ) %] >@@ -196,7 +195,7 @@ $.tablesorter.addParser({ > [% IF ( show_barcode ) %]<th>Barcode</th>[% END %] > <th>Call No.</th> > [% IF ( OpacRenewalAllowed ) %] >- [% UNLESS patron_flagged %]<th class="{sorter: false}">Renew</th>[% END %] >+ <th class="{sorter: false}">Renew</th> > [% END %] > [% IF ( OPACFinesTab ) %] > <th>Fines</th> >@@ -244,12 +243,10 @@ $.tablesorter.addParser({ > [% IF ( show_barcode ) %]<td>[% ISSUE.barcode %]</td>[% END %] > <td>[% ISSUE.itemcallnumber %]</td> > [% IF ( OpacRenewalAllowed ) %] >- [% UNLESS patron_flagged %] >- <td>[% IF ( ISSUE.status ) %]<input type="checkbox" name="item" value="[% ISSUE.itemnumber %]"/> <a href="/cgi-bin/koha/opac-renew.pl?from=opac_user&item=[% ISSUE.itemnumber %]&borrowernumber=[% ISSUE.borrowernumber %]">Renew</a> <span class="renewals">([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining)</span> >+ <td>[% IF ( ISSUE.status ) %][% IF ( canrenew ) %]<input type="checkbox" name="item" value="[% ISSUE.itemnumber %]"/> <a href="/cgi-bin/koha/opac-renew.pl?from=opac_user&item=[% ISSUE.itemnumber %]&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 %] > [% END %]</td> >- [% END %] > [% END %] > [% IF ( OPACFinesTab ) %] > <td>[% IF ( ISSUE.charges ) %]Yes[% ELSE %]No[% END %]</td> >@@ -271,7 +268,7 @@ $.tablesorter.addParser({ > [% FOREACH ISSUE IN ISSUES %] > <input type="hidden" name="item" value="[% ISSUE.itemnumber %]" /> > [% END %] >- [% UNLESS patron_flagged %]<input type="submit" value="Renew All" />[% END %] >+ <input type="submit" value="Renew All" /> > </form> > [% END %] > [% ELSE %] >@@ -293,7 +290,8 @@ $.tablesorter.addParser({ > <th>Call No.</th> > <th>Due</th> > [% IF ( OpacRenewalAllowed ) %] >- [% UNLESS patron_flagged %]<th class="{sorter: false}">Renew</th>[% END %][% END %] >+ <th class="{sorter: false}">Renew</th> >+[% END %] > [% IF ( OPACFinesTab ) %] > <th>Fines</th> > [% END %] >@@ -325,15 +323,14 @@ $.tablesorter.addParser({ > <td>[% OVERDUE.itemcallnumber %]</td> > <td>[% OVERDUE.date_due %]</td> > [% IF ( OpacRenewalAllowed ) %] >- [% UNLESS patron_flagged %] > <td> > [% IF ( OVERDUE.debarred ) %]Account Frozen > [% ELSIF ( OVERDUE.status ) %] >-<a href="/cgi-bin/koha/opac-renew.pl?from=opac_user&item=[% OVERDUE.itemnumber %]&bornum=[% OVERDUE.borrowernumber %]">Renew</a> <span class="renewals">([% OVERDUE.renewsleft %] of [% OVERDUE.renewsallowed %] renewals remaining)</span> >-[% ELSIF ( OVERDUE.onreserve ) %]On Reserve >+[% IF ( canrenew ) %]<a href="/cgi-bin/koha/opac-renew.pl?from=opac_user&item=[% OVERDUE.itemnumber %]&bornum=[% OVERDUE.borrowernumber %]">Renew</a>[% END %] <span class="renewals">([% OVERDUE.renewsleft %] of [% OVERDUE.renewsallowed %] renewals remaining)</span> >+[% ELSIF ( OVERDUE.onreserve ) %]On hold > [% ELSE %]No renewals left > [% END %] >-</td>[% END %][% END %] >+</td>[% END %] > [% IF ( OPACFinesTab ) %] > <td>[% IF ( OVERDUE.charges ) %]Yes[% ELSE %]No[% END %]</td> > [% END %] >diff --git a/opac/opac-user.pl b/opac/opac-user.pl >index f6ed484..ff1fecf 100755 >--- a/opac/opac-user.pl >+++ b/opac/opac-user.pl >@@ -67,6 +67,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 ); >@@ -92,6 +93,7 @@ if ($debar) { > > if ( $userdebarred || $borr->{'gonenoaddress'} || $borr->{'lost'} ) { > $borr->{'flagged'} = 1; >+ $canrenew = 0; > } > > if ( $borr->{'amountoutstanding'} > 5 ) { >@@ -105,6 +107,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 ), > ); >@@ -144,13 +147,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 >@@ -181,7 +182,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'; >-- >1.7.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 6598
:
4657
|
5842
|
6179
| 7204 |
7619
|
7620