Bugzilla – Attachment 57979 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 is_expired
Bug-17578-GetMemberDetails---Remove-isexpired.patch (text/plain), 3.20 KB, created by
Nick Clemens (kidclamp)
on 2016-12-05 16:43:16 UTC
(
hide
)
Description:
Bug 17578: GetMemberDetails - Remove is_expired
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2016-12-05 16:43:16 UTC
Size:
3.20 KB
patch
obsolete
>From 5f660e3091b75afa70a3a7c987e0a26fddb23db7 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 7 Nov 2016 18:14:49 +0100 >Subject: [PATCH] Bug 17578: GetMemberDetails - Remove is_expired > >The is_expired value is used in 2 places, let's use >Koha::Patron->is_expired instead. > >Test plan: >Depending on the different value of BlockExpiredPatronOpacActions for >the patron category, a patron must be blocked if he has expired. >Confirm that behavior from opac-renew and opac-reserve scripts > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > C4/Members.pm | 7 ------- > opac/opac-renew.pl | 3 +-- > opac/opac-reserve.pl | 2 +- > t/db_dependent/Members.t | 5 ----- > 4 files changed, 2 insertions(+), 15 deletions(-) > >diff --git a/C4/Members.pm b/C4/Members.pm >index adbba2f..af2fa9d 100644 >--- a/C4/Members.pm >+++ b/C4/Members.pm >@@ -177,13 +177,6 @@ sub GetMemberDetails { > my $borrower = $sth->fetchrow_hashref; > return unless $borrower; > >- $borrower->{'is_expired'} = 0; >- $borrower->{'is_expired'} = 1 if >- defined($borrower->{dateexpiry}) && >- $borrower->{'dateexpiry'} ne '0000-00-00' && >- Date_to_Days( Today() ) > >- Date_to_Days( split /-/, $borrower->{'dateexpiry'} ); >- > return ($borrower); > } > >diff --git a/opac/opac-renew.pl b/opac/opac-renew.pl >index b1dcf57..64e95aa 100755 >--- a/opac/opac-renew.pl >+++ b/opac/opac-renew.pl >@@ -51,10 +51,9 @@ my $errorstring = q{}; > my $renewed = q{}; > > my $patron = Koha::Patrons->find( $borrowernumber ); >-my $member_details = GetMemberDetails($borrowernumber); > > if ( $patron->category->effective_BlockExpiredPatronOpacActions >- && $member_details->{'is_expired'} ) >+ && $patron->is_expired ) > { > $errorstring = 'card_expired'; > } >diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl >index 85426ab..a725730 100755 >--- a/opac/opac-reserve.pl >+++ b/opac/opac-reserve.pl >@@ -76,7 +76,7 @@ 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 ( $patron->category->effective_BlockExpiredPatronOpacActions ) { > >- if ( $borr->{'is_expired'} ) { >+ if ( $patron->is_expired ) { > > # cannot reserve, their card has expired and the rules set mean this is not allowed > $template->param( message => 1, expired_patron => 1 ); >diff --git a/t/db_dependent/Members.t b/t/db_dependent/Members.t >index b5144c5..870a0e3 100755 >--- a/t/db_dependent/Members.t >+++ b/t/db_dependent/Members.t >@@ -149,11 +149,6 @@ C4::Context->clear_syspref_cache(); > $notice_email = GetNoticeEmailAddress($member->{'borrowernumber'}); > is ($notice_email, $EMAILPRO, "GetNoticeEmailAddress returns correct value when AutoEmailPrimaryAddress is emailpro"); > >-ok(!$member->{is_expired}, "GetMemberDetails() indicates that patron is not expired"); >-ModMember(borrowernumber => $member->{'borrowernumber'}, dateexpiry => '2001-01-1'); >-$member = GetMemberDetails($member->{'borrowernumber'}); >-ok($member->{is_expired}, "GetMemberDetails() indicates that patron is expired"); >- > # Check_Userid tests > %data = ( > cardnumber => "123456789", >-- >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