Bugzilla – Attachment 17570 Details for
Bug 10089
Prevent renewing for restricted patrons
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10089 - Prevent renewing for restricted patrons
0001-Bug-100089-Prevent-renewing-for-restricted-patrons.patch (text/plain), 6.22 KB, created by
David Cook
on 2013-04-22 03:36:52 UTC
(
hide
)
Description:
Bug 10089 - Prevent renewing for restricted patrons
Filename:
MIME Type:
Creator:
David Cook
Created:
2013-04-22 03:36:52 UTC
Size:
6.22 KB
patch
obsolete
>From 864117ba49408c17f80d955e0c9740953fa3c8c3 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Mon, 22 Apr 2013 13:24:16 +1000 >Subject: [PATCH] Bug 100089 - Prevent renewing for restricted patrons > >Currently, restricted patrons are not able to check out items, BUT they are able to renew checked out items. > >This isn't logical, since "renewing" an item is, essentially, equivalent to checking out the item again. > >In the OPAC patron screen, they are informed that their account is frozen, but...they are still able to renew books. > >I propose that we prevent restricted patrons from renewing items in the OPAC, and we prevent library staff from (accidentally) renewing books for restricted patrons in the staff client. > >-- > >Test Plan: > >Before applying patch... > >1) Choose a patron with some items checked out, or check out some items to a patron >2) Mark the patron as restricted (Edit a patron and go to the "Patron account flags" fieldset to find the restriction option) >3) Note that you can't check out any items (in the Check out tab), but you can renew items in the "Check out" and "Details" tabs. >4) Log in as this patron in the OPAC, you will see a message saying your account is frozen, but you will be able to renew the items still > >Apply the patch... > >1) Re-visit the "Check out" and "Details" tabs in the staff client, and try to renew the books. >2) Note that the check box will be replaced with a message saying "Not renewable: Patron restricted". >3) Re-visit the OPAC, the check box to renew should be replaced with a message saying "Account frozen". >--- > C4/Circulation.pm | 6 ++++++ > .../prog/en/modules/circ/circulation.tt | 6 ++++++ > .../prog/en/modules/members/moremember.tt | 3 +++ > koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt | 2 +- > opac/opac-user.pl | 1 + > 5 files changed, 17 insertions(+), 1 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 3fc124f..d33f7ef 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -2465,6 +2465,12 @@ sub CanBookBeRenewed { > $renewokay = 0; > $error = "on_reserve"; > } >+ >+ my ($memberblocked) = C4::Members::IsMemberBlocked($borrowernumber); >+ if ($memberblocked == 1) { >+ $renewokay = 0; >+ $error="member_blocked"; >+ } > > return ( $renewokay, $error ); > } >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >index b7f7c4c..8e9ab25 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -856,6 +856,9 @@ No patron matched <span class="ex">[% message %]</span> > [% IF ( todayissue.renew_error_too_many ) %] > Not renewable > [% END %] >+ [% IF ( todayissue.renew_error_member_blocked ) %] >+ Not renewable: Patron restricted >+ [% END %] > [% IF ( todayissue.can_confirm ) %] > </span> > [% END %] >@@ -938,6 +941,9 @@ No patron matched <span class="ex">[% message %]</span> > [% IF ( previssue.renew_error_too_many ) %] > Not renewable > [% END %] >+ [% IF ( previssue.renew_error_member_blocked ) %] >+ Not renewable: Patron restricted >+ [% END %] > [% IF ( previssue.can_confirm ) %] > </span> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >index b3eef3a..05f0c3f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -504,6 +504,9 @@ function validate1(date) { > [% IF ( issueloo.norenew_reason_too_many ) %] > Not renewable > [% END %] >+ [% IF ( issueloo.norenew_reason_member_blocked ) %] >+ Not renewable: Patron restricted >+ [% END %] > [% IF ( issueloo.can_confirm ) %] > </span> > [% END %] >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 96f6e8d..663ed8f 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt >@@ -195,7 +195,7 @@ $.tablesorter.addParser({ > [% 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&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 %] >+ Not renewable[% IF ( ISSUE.too_many ) %] <span class="renewals">([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining)</span>[% ELSIF ( ISSUE.member_blocked ) %]<span class="renewals">(Account frozen)</span>[% ELSE %][% IF ( ISSUE.on_reserve ) %] <span class="renewals">(On hold)</span>[% END %][% END %] > [% END %]</td> > [% END %] > [% IF ( OPACFinesTab ) %] >diff --git a/opac/opac-user.pl b/opac/opac-user.pl >index 750a9c3..c6a8350 100755 >--- a/opac/opac-user.pl >+++ b/opac/opac-user.pl >@@ -185,6 +185,7 @@ if ($issues){ > } > $issue->{'too_many'} = 1 if $renewerror and $renewerror eq 'too_many'; > $issue->{'on_reserve'} = 1 if $renewerror and $renewerror eq 'on_reserve'; >+ $issue->{'member_blocked'} = 1 if $renewerror and $renewerror eq 'member_blocked'; > > if ( $issue->{'overdue'} ) { > push @overdues, $issue; >-- >1.7.7.4 >
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 10089
: 17570