View | Details | Raw Unified | Return to bug 17578
Collapse All | Expand All

(-)a/C4/Members.pm (-7 lines)
Lines 176-188 sub GetMemberDetails { Link Here
176
    my $borrower = $sth->fetchrow_hashref;
176
    my $borrower = $sth->fetchrow_hashref;
177
    return unless $borrower;
177
    return unless $borrower;
178
178
179
    $borrower->{'is_expired'} = 0;
180
    $borrower->{'is_expired'} = 1 if
181
      defined($borrower->{dateexpiry}) &&
182
      $borrower->{'dateexpiry'} ne '0000-00-00' &&
183
      Date_to_Days( Today() ) >
184
      Date_to_Days( split /-/, $borrower->{'dateexpiry'} );
185
186
    return ($borrower);
179
    return ($borrower);
187
}
180
}
188
181
(-)a/opac/opac-renew.pl (-2 / +1 lines)
Lines 51-60 my $errorstring = q{}; Link Here
51
my $renewed     = q{};
51
my $renewed     = q{};
52
52
53
my $patron = Koha::Patrons->find( $borrowernumber );
53
my $patron = Koha::Patrons->find( $borrowernumber );
54
my $member_details = GetMemberDetails($borrowernumber);
55
54
56
if (   $patron->category->effective_BlockExpiredPatronOpacActions
55
if (   $patron->category->effective_BlockExpiredPatronOpacActions
57
    && $member_details->{'is_expired'} )
56
    && $patron->is_expired )
58
{
57
{
59
    $errorstring = 'card_expired';
58
    $errorstring = 'card_expired';
60
}
59
}
(-)a/opac/opac-reserve.pl (-1 / +1 lines)
Lines 76-82 my $patron = Koha::Patrons->find( $borrowernumber ); Link Here
76
# check if this user can place a reserve, -1 means use sys pref, 0 means dont block, 1 means block
76
# check if this user can place a reserve, -1 means use sys pref, 0 means dont block, 1 means block
77
if ( $patron->category->effective_BlockExpiredPatronOpacActions ) {
77
if ( $patron->category->effective_BlockExpiredPatronOpacActions ) {
78
78
79
    if ( $borr->{'is_expired'} ) {
79
    if ( $patron->is_expired ) {
80
80
81
        # cannot reserve, their card has expired and the rules set mean this is not allowed
81
        # cannot reserve, their card has expired and the rules set mean this is not allowed
82
        $template->param( message => 1, expired_patron => 1 );
82
        $template->param( message => 1, expired_patron => 1 );
(-)a/t/db_dependent/Members.t (-6 lines)
Lines 149-159 C4::Context->clear_syspref_cache(); Link Here
149
$notice_email = GetNoticeEmailAddress($member->{'borrowernumber'});
149
$notice_email = GetNoticeEmailAddress($member->{'borrowernumber'});
150
is ($notice_email, $EMAILPRO, "GetNoticeEmailAddress returns correct value when AutoEmailPrimaryAddress is emailpro");
150
is ($notice_email, $EMAILPRO, "GetNoticeEmailAddress returns correct value when AutoEmailPrimaryAddress is emailpro");
151
151
152
ok(!$member->{is_expired}, "GetMemberDetails() indicates that patron is not expired");
153
ModMember(borrowernumber => $member->{'borrowernumber'}, dateexpiry => '2001-01-1');
154
$member = GetMemberDetails($member->{'borrowernumber'});
155
ok($member->{is_expired}, "GetMemberDetails() indicates that patron is expired");
156
157
# Check_Userid tests
152
# Check_Userid tests
158
%data = (
153
%data = (
159
    cardnumber   => "123456789",
154
    cardnumber   => "123456789",
160
- 

Return to bug 17578