Bugzilla – Attachment 57793 Details for
Bug 17578
Replace GetMemberDetails with GetMember
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17578: GetMemberDetails - Remove BlockExpiredPatronOpacActions
Bug-17578-GetMemberDetails---Remove-BlockExpiredPa.patch (text/plain), 3.25 KB, created by
Jonathan Druart
on 2016-11-28 15:52:22 UTC
(
hide
)
Description:
Bug 17578: GetMemberDetails - Remove BlockExpiredPatronOpacActions
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-11-28 15:52:22 UTC
Size:
3.25 KB
patch
obsolete
>From 3a5fa2d6104b7db04da0f8a6a073fe16fecb686a Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 7 Nov 2016 15:53:25 +0000 >Subject: [PATCH] Bug 17578: GetMemberDetails - Remove > BlockExpiredPatronOpacActions > >The correct way to get the value of BlockExpiredPatronOpacActions from a >patron object is to get the patron category then call the >effective_BlockExpiredPatronOpacActions: > $patron->category->effective_BlockExpiredPatronOpacActions > >So this patch applies this change and remove this value from the >GetMemberDetails subroutine. >--- > C4/Members.pm | 7 ------- > opac/opac-renew.pl | 4 +++- > opac/opac-reserve.pl | 3 ++- > 3 files changed, 5 insertions(+), 9 deletions(-) > >diff --git a/C4/Members.pm b/C4/Members.pm >index 9b44b32..526a3d0 100644 >--- a/C4/Members.pm >+++ b/C4/Members.pm >@@ -168,7 +168,6 @@ sub GetMemberDetails { > SELECT borrowers.*, > category_type, > categories.description, >- categories.BlockExpiredPatronOpacActions, > reservefee, > enrolmentperiod > FROM borrowers >@@ -182,7 +181,6 @@ sub GetMemberDetails { > SELECT borrowers.*, > category_type, > categories.description, >- categories.BlockExpiredPatronOpacActions, > reservefee, > enrolmentperiod > FROM borrowers >@@ -212,11 +210,6 @@ sub GetMemberDetails { > $borrower->{'flags'} = $flags; > $borrower->{'authflags'} = $accessflagshash; > >- # Handle setting the true behavior for BlockExpiredPatronOpacActions >- $borrower->{'BlockExpiredPatronOpacActions'} = >- C4::Context->preference('BlockExpiredPatronOpacActions') >- if ( $borrower->{'BlockExpiredPatronOpacActions'} == -1 ); >- > $borrower->{'is_expired'} = 0; > $borrower->{'is_expired'} = 1 if > defined($borrower->{dateexpiry}) && >diff --git a/opac/opac-renew.pl b/opac/opac-renew.pl >index 9da82e5..b1dcf57 100755 >--- a/opac/opac-renew.pl >+++ b/opac/opac-renew.pl >@@ -30,6 +30,7 @@ use C4::Auth; > use C4::Context; > use C4::Items; > use C4::Members; >+use Koha::Patrons; > use Date::Calc qw( Today Date_to_Days ); > my $query = new CGI; > >@@ -49,9 +50,10 @@ my $opacrenew = C4::Context->preference("OpacRenewalAllowed"); > my $errorstring = q{}; > my $renewed = q{}; > >+my $patron = Koha::Patrons->find( $borrowernumber ); > my $member_details = GetMemberDetails($borrowernumber); > >-if ( $member_details->{'BlockExpiredPatronOpacActions'} >+if ( $patron->category->effective_BlockExpiredPatronOpacActions > && $member_details->{'is_expired'} ) > { > $errorstring = 'card_expired'; >diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl >index d02e96c..42ee598 100755 >--- a/opac/opac-reserve.pl >+++ b/opac/opac-reserve.pl >@@ -71,9 +71,10 @@ sub get_out { > > # get borrower information .... > my ( $borr ) = GetMemberDetails( $borrowernumber ); >+my $patron = Koha::Patrons->find( $borrowernumber ); > > # check if this user can place a reserve, -1 means use sys pref, 0 means dont block, 1 means block >-if ( $borr->{'BlockExpiredPatronOpacActions'} ) { >+if ( $patron->category->effective_BlockExpiredPatronOpacActions ) { > > if ( $borr->{'is_expired'} ) { > >-- >2.1.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 17578
:
57299
|
57300
|
57301
|
57302
|
57303
|
57304
|
57305
|
57306
|
57307
|
57308
|
57322
|
57323
|
57324
|
57325
|
57326
|
57793
|
57794
|
57795
|
57796
|
57797
|
57798
|
57799
|
57800
|
57801
|
57808
|
57817
|
57818
|
57819
|
57820
|
57821
|
57822
|
57823
|
57824
|
57825
|
57826
|
57972
|
57973
|
57974
|
57975
|
57976
|
57977
|
57978
|
57979
|
57980
|
57981
|
57982
|
57983
|
57984