Bugzilla – Attachment 18043 Details for
Bug 6739
expired patrons not blocked from opac actions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 6739 - expired patrons not blocked from opac actions - Followup 2
SIGNED-OFF-Bug-6739---expired-patrons-not-blocked-.patch (text/plain), 11.37 KB, created by
Owen Leonard
on 2013-05-09 13:53:18 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 6739 - expired patrons not blocked from opac actions - Followup 2
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2013-05-09 13:53:18 UTC
Size:
11.37 KB
patch
obsolete
>From 77bda5e9dce3f657f5d2ea5e067c3f59894d34df Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 2 May 2013 14:16:51 -0400 >Subject: [PATCH] [SIGNED-OFF] Bug 6739 - expired patrons not blocked from > opac actions - Followup 2 >Content-Type: text/plain; charset="utf-8" > >* Hide renewal column, buttons and links >* Fixes minor bug where upper-right table links would show even if renewal impossible >* Cleans up some of the template formatting ( whitespace changes only ) > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt | 173 ++++++++++++++-------- > opac/opac-user.pl | 1 + > 2 files changed, 109 insertions(+), 65 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 7186407..ddbfa96 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt >@@ -8,49 +8,74 @@ > <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script> > <script type="text/JavaScript"> > //<![CDATA[ >-var MSG_CONFIRM_DELETE_HOLD = _("Are you sure you want to cancel this hold?"); >-var MSG_CONFIRM_SUSPEND_HOLDS = _("Are you sure you want to suspend all holds?"); >-var MSG_CONFIRM_RESUME_HOLDS = _("Are you sure you want to resume all suspended holds?"); >- >-$.tablesorter.addParser({ >- id: 'articles', >- is: function(s) {return false; }, >- format: function(s) { return s.toLowerCase().replace(/^(the|an|a) /,''); }, >- type: 'text' >-}); >- $(function() { >- $('#opac-user-views').tabs(); >- $.tablesorter.defaults.widgets = ['zebra']; >- [% IF ( dateformat == 'metric' ) %]$.tablesorter.defaults.dateFormat = ['uk'];[% END %] >- $("#holdst").tablesorter({ >- sortList: [[0,0]] >- }); >- $("#checkoutst").tablesorter({ >- [% IF ( JacketImages ) %]sortList: [[2,0]][% ELSE %]sortList: [[1,0]][% END %] >- }); >- $("#overduest").tablesorter(); >-[% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %] >- [% IF ( OpacRenewalAllowed && canrenew && !userdebarred ) %]$("#renewselected").submit(function(){ >- valid = false; >- $("input[type=checkbox]").each(function(){ >- if($(this).is(':checked')){ >- valid = true; >- } >- }); >- if(!valid){ >- alert(_("Nothing has been selected. Check the box for each item you want to renew")); >- } >- return valid; >- }); >- $("#renewselected_link").live('click',function(){ >- $("#renewselected").submit(); >+ var MSG_CONFIRM_DELETE_HOLD = _("Are you sure you want to cancel this hold?"); >+ var MSG_CONFIRM_SUSPEND_HOLDS = _("Are you sure you want to suspend all holds?"); >+ var MSG_CONFIRM_RESUME_HOLDS = _("Are you sure you want to resume all suspended holds?"); >+ >+ $.tablesorter.addParser({ >+ id: 'articles', >+ is: function(s) {return false; }, >+ format: function(s) { return s.toLowerCase().replace(/^(the|an|a) /,''); }, >+ type: 'text' >+ }); >+ >+ $(function() { >+ $('#opac-user-views').tabs(); >+ $.tablesorter.defaults.widgets = ['zebra']; >+ >+ [% IF ( dateformat == 'metric' ) %] >+ $.tablesorter.defaults.dateFormat = ['uk']; >+ [% END %] >+ >+ $("#holdst").tablesorter({ >+ sortList: [[0,0]] > }); >- $("#renewall_link").live('click',function(){ >- $("#renewall").submit(); >+ >+ $("#checkoutst").tablesorter({ >+ [% IF ( JacketImages ) %] >+ sortList: [[2,0]] >+ [% ELSE %] >+ sortList: [[1,0]] >+ [% END %] > }); >- $("#checkoutst caption").append("<div id=\"renewcontrols\"><a id=\"renewselected_link\" href=\"#\">"+_("Renew selected")+"</a> <a id=\"renewall_link\" href=\"#\">"+_("Renew all")+"</a></div>");[% END %] >- $( "#suspend_until" ).datepicker({ minDate: 1 }); // Require that "until date" be in the future >+ >+ $("#overduest").tablesorter(); >+ >+ [% IF ( GoogleJackets ) %] >+ KOHA.Google.GetCoverFromIsbn(); >+ [% END %] >+ >+ [% IF ( OpacRenewalAllowed && canrenew && !userdebarred ) %] >+ $("#renewselected").submit(function(){ >+ valid = false; >+ $("input[type=checkbox]").each(function(){ >+ if ( $(this).is(':checked') ){ >+ valid = true; >+ } >+ }); >+ >+ if (!valid) { >+ alert(_("Nothing has been selected. Check the box for each item you want to renew")); >+ } >+ >+ return valid; >+ }); >+ >+ $("#renewselected_link").live('click',function(){ >+ $("#renewselected").submit(); >+ }); >+ >+ $("#renewall_link").live('click',function(){ >+ $("#renewall").submit(); > }); >+ >+ [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) ) %] >+ $("#checkoutst caption").append("<div id=\"renewcontrols\"><a id=\"renewselected_link\" href=\"#\">"+_("Renew selected")+"</a> <a id=\"renewall_link\" href=\"#\">"+_("Renew all")+"</a></div>"); >+ [% END %] >+ [% END %] >+ >+ $( "#suspend_until" ).datepicker({ minDate: 1 }); // Require that "until date" be in the future >+ }); > //]]> > </script> > </head> >@@ -107,7 +132,7 @@ $.tablesorter.addParser({ > <string>Please note:</string> > <span> > Your account renewal failed because of the following: >- [% FOREACH error IN RENEW_ERROR.split('|') %] >+ [% FOREACH error IN RENEW_ERROR.split('\|') %] > [% IF error == 'card_expired' %] > Your account has expired. Please contact the library for more information. > [% ELSIF error == 'too_many' %] >@@ -155,27 +180,45 @@ $.tablesorter.addParser({ > > <div id="opac-user-checkouts">[% IF ( issues_count ) %] > <form id="renewselected" action="/cgi-bin/koha/opac-renew.pl" method="post"> >- <input type="hidden" name="borrowernumber" value="[% borrowernumber %]"> >- <input type="hidden" name="from" value="opac_user" /> >- <table id="checkoutst"> >- <caption>[% issues_count %] Item(s) checked out</caption> >- <thead><tr> >- [% IF ( JacketImages ) %]<th class="{sorter: false}"> </th>[% END %] >- <th class="{sorter:'articles'}">Title</th> >- <th>Due</th> >- [% UNLESS ( item_level_itypes ) %]<th>Item type</th> [% END %] >- [% IF ( show_barcode ) %]<th>Barcode</th>[% END %] >- <th>Call No.</th> >- [% IF ( OpacRenewalAllowed ) %] >- <th class="{sorter: false}">Renew</th> >- [% END %] >-[% IF ( OPACFinesTab ) %] >- <th>Fines</th> >-[% END %] >- [% IF ( OPACMySummaryHTML ) %] >- <th class="{sorter: false}">Links</th> >- [% END %] >- </tr></thead> >+ <input type="hidden" name="borrowernumber" value="[% borrowernumber %]"> >+ <input type="hidden" name="from" value="opac_user" /> >+ >+ <table id="checkoutst"> >+ <caption>[% issues_count %] Item(s) checked out</caption> >+ >+ <thead> >+ <tr> >+ [% IF ( JacketImages ) %] >+ <th class="{sorter: false}"> </th> >+ [% END %] >+ >+ <th class="{sorter:'articles'}">Title</th> >+ >+ <th>Due</th> >+ >+ [% UNLESS ( item_level_itypes ) %] >+ <th>Item type</th> >+ [% END %] >+ >+ [% IF ( show_barcode ) %] >+ <th>Barcode</th> >+ [% END %] >+ >+ <th>Call No.</th> >+ >+ [% IF OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) %] >+ <th class="{sorter: false}">Renew</th> >+ [% END %] >+ >+ [% IF ( OPACFinesTab ) %] >+ <th>Fines</th> >+ [% END %] >+ >+ [% IF ( OPACMySummaryHTML ) %] >+ <th class="{sorter: false}">Links</th> >+ [% END %] >+ </tr> >+ </thead> > <tbody> > <!-- FIXME: the styling for highlight overrides the overdue red background, > so currently we don't use this conditional as the first thing inside the LOOP: >@@ -214,7 +257,7 @@ $.tablesorter.addParser({ > [% UNLESS ( item_level_itypes ) %]<td class="itype">[% IF ( ISSUE.imageurl ) %]<img src="[% ISSUE.imageurl %]" title="[% ISSUE.description %]" alt="[% ISSUE.description %]" />[% END %] [% ISSUE.description %]</td>[% END %] > [% IF ( show_barcode ) %]<td class="barcode">[% ISSUE.barcode %]</td>[% END %] > <td class="call_no">[% ISSUE.itemcallnumber %]</td> >- [% IF ( OpacRenewalAllowed ) %] >+ [% IF OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) %] > <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&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 %] >@@ -229,11 +272,11 @@ $.tablesorter.addParser({ > </tr> > [% END %]</tbody> > </table> >- [% IF ( canrenew && !userdebarred && OpacRenewalAllowed ) %] >+ [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) ) %] > <input type="submit" value="Renew Selected" /> > [% END %] > </form> >- [% IF ( canrenew && !userdebarred && OpacRenewalAllowed ) %] >+ [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions )) %] > <form id="renewall" action="/cgi-bin/koha/opac-renew.pl" method="post"> > <input type="hidden" name="from" value="opac_user" /> > <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" /> >diff --git a/opac/opac-user.pl b/opac/opac-user.pl >index efa2525..85ab12a 100755 >--- a/opac/opac-user.pl >+++ b/opac/opac-user.pl >@@ -145,6 +145,7 @@ $template->param( BORROWER_INFO => \@bordat, > surname => $borr->{surname}, > showname => $borr->{showname}, > RENEW_ERROR => $renew_error, >+ borrower => $borr, > ); > > #get issued items .... >-- >1.7.9.5
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 6739
:
7814
|
9108
|
16061
|
16063
|
16064
|
16065
|
16069
|
16071
|
16072
|
17356
|
17357
|
17463
|
17464
|
17466
|
17517
|
17518
|
17907
|
17908
|
17909
|
18041
|
18042
|
18043
|
19553
|
19554
|
19555
|
19558
|
19559
|
19560
|
19678
|
19679
|
19993
|
19994
|
19995
|
19996
|
19997
|
20641
|
20642
|
20643
|
20644
|
20645
|
21312
|
21313
|
21314
|
21315
|
21316
|
21317
|
24385
|
24386
|
24387
|
24388
|
24389
|
24390
|
24391
|
24392
|
25158
|
25159
|
25160
|
25161
|
25162
|
25163
|
25164
|
25165
|
25231
|
25232
|
25233
|
26546
|
26547
|
26548
|
26549
|
26550
|
26551
|
26552
|
26553
|
26836
|
26837
|
26838
|
26839
|
26840
|
26841
|
26842
|
26843