Bugzilla – Attachment 17463 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]
Bug 6739 - expired patrons not blocked from opac actions - Followup 2
Bug-6739---expired-patrons-not-blocked-from-opac-a.patch (text/plain), 4.59 KB, created by
Kyle M Hall (khall)
on 2013-04-15 16:26:20 UTC
(
hide
)
Description:
Bug 6739 - expired patrons not blocked from opac actions - Followup 2
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-04-15 16:26:20 UTC
Size:
4.59 KB
patch
obsolete
>From 26783ad1628b6587743d8871cca627c9a84aad0a Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 15 Apr 2013 12:26:00 -0400 >Subject: [PATCH] Bug 6739 - expired patrons not blocked from opac actions - Followup 2 > >--- > C4/Members.pm | 5 +++++ > opac/opac-renew.pl | 37 +++++++++++++++++++++---------------- > opac/opac-reserve.pl | 2 +- > 3 files changed, 27 insertions(+), 17 deletions(-) > >diff --git a/C4/Members.pm b/C4/Members.pm >index 481028a..c6f967d 100644 >--- a/C4/Members.pm >+++ b/C4/Members.pm >@@ -381,6 +381,11 @@ sub GetMemberDetails { > $borrower->{'showname'} = $borrower->{'firstname'}; > } > >+ # Handle setting the true behavior for BlockExpiredPatronOpacActions >+ $borrower->{'BlockExpiredPatronOpacActions'} = >+ C4::Context->preference('BlockExpiredPatronOpacActions') >+ if ( $borrower->{'BlockExpiredPatronOpacActions'} == -1 ); >+ > return ($borrower); #, $flags, $accessflagshash); > } > >diff --git a/opac/opac-renew.pl b/opac/opac-renew.pl >index 7d1a851..d579c0e 100755 >--- a/opac/opac-renew.pl >+++ b/opac/opac-renew.pl >@@ -27,6 +27,7 @@ use warnings; > use CGI; > use C4::Circulation; > use C4::Auth; >+use C4::Context; > use C4::Items; > use C4::Members; > use Date::Calc qw( Today Date_to_Days ); >@@ -48,38 +49,42 @@ my $opacrenew = C4::Context->preference("OpacRenewalAllowed"); > > my $errorstring=''; > my $member_details = GetMemberDetails($borrowernumber); >-# BlockExpiredPatronOpacActions syspref 0 is false, 1 is true. BlockExpiredPatronOpacActions for categories (from GetMemberDetails) -1 means use syspref, 0 is false, 1 is true (where false means dont block, true means block) >-if( ($member_details->{'BlockExpiredPatronOpacActions'} == -1 ? C4::Conext->preference('BlockExpiredPatronOpacActions') : $member_details->{'BlockExpiredPatronOpacActions'}) >- && Date_to_Days( Today() ) > Date_to_Days( split /-/, $member_details->{'dateexpiry'} ) ){ >- $errorstring = 'card_expired'; >-} else { >- for my $itemnumber ( @items ) { >- my ($status,$error) = CanBookBeRenewed( $borrowernumber, $itemnumber ); >+ >+if ( $member_details->{'BlockExpiredPatronOpacActions'} >+ && Date_to_Days( Today() ) > >+ Date_to_Days( split( /-/, $member_details->{'dateexpiry'} ) ) ) >+{ >+ $errorstring = 'card_expired'; >+} >+else { >+ for my $itemnumber (@items) { >+ my ( $status, $error ) = >+ CanBookBeRenewed( $borrowernumber, $itemnumber ); > if ( $status == 1 && $opacrenew == 1 ) { > my $renewalbranch = C4::Context->preference('OpacRenewalBranch'); > my $branchcode; >- if ($renewalbranch eq 'itemhomebranch'){ >+ if ( $renewalbranch eq 'itemhomebranch' ) { > my $item = GetItem($itemnumber); >- $branchcode=$item->{'homebranch'}; >+ $branchcode = $item->{'homebranch'}; > } >- elsif ($renewalbranch eq 'patronhomebranch'){ >+ elsif ( $renewalbranch eq 'patronhomebranch' ) { > my $borrower = GetMemberDetails($borrowernumber); > $branchcode = $borrower->{'branchcode'}; > } >- elsif ($renewalbranch eq 'checkoutbranch'){ >+ elsif ( $renewalbranch eq 'checkoutbranch' ) { > my $issue = GetOpenIssue($itemnumber); > $branchcode = $issue->{'branchcode'}; > } >- elsif ($renewalbranch eq 'NULL'){ >- $branchcode=''; >+ elsif ( $renewalbranch eq 'NULL' ) { >+ $branchcode = ''; > } > else { >- $branchcode='OPACRenew' >+ $branchcode = 'OPACRenew'; > } >- AddRenewal( $borrowernumber, $itemnumber, $branchcode); >+ AddRenewal( $borrowernumber, $itemnumber, $branchcode ); > } > else { >- $errorstring .= $error ."|"; >+ $errorstring .= $error . "|"; > } > } > } >diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl >index 42bebc2..fac27b5 100755 >--- a/opac/opac-reserve.pl >+++ b/opac/opac-reserve.pl >@@ -67,7 +67,7 @@ sub get_out { > my ( $borr ) = GetMemberDetails( $borrowernumber ); > > # check if this user can place a reserve, -1 means use sys pref, 0 means dont block, 1 means block >-if( $borr->{'BlockExpiredPatronOpacActions'} == -1 ? C4::Context->preference("BlockExpiredPatronOpacActions") : $borr->{'BlockExpiredPatronOpacActions'} ) { >+if( $borr->{'BlockExpiredPatronOpacActions'} ) { > > if( Date_to_Days( Today() ) > Date_to_Days( split /-/, $borr->{'dateexpiry'} ) ){ > # cannot reserve, their card has expired and the rules set mean this is not allowed >-- >1.7.2.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