Bugzilla – Attachment 67102 Details for
Bug 14784
Missing checkin message for debarred patrons when issuing rules 'fine days = 0'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Attachment to Bug 14784 - Missing checkin message for debarred patrons when issuing rules 'fine days = 0'
Bug-14784---Fix-checkin-message-for-debarred-patro.patch (text/plain), 3.35 KB, created by
David Bourgault
on 2017-09-12 19:00:07 UTC
(
hide
)
Description:
Attachment to Bug 14784 - Missing checkin message for debarred patrons when issuing rules 'fine days = 0'
Filename:
MIME Type:
Creator:
David Bourgault
Created:
2017-09-12 19:00:07 UTC
Size:
3.35 KB
patch
obsolete
>From 7e9d62a96e4afbbfc886925f8801a81f5308801f Mon Sep 17 00:00:00 2001 >From: David Bourgault <dav.bour@gmail.com> >Date: Tue, 12 Sep 2017 14:39:49 -0400 >Subject: [PATCH] Bug 14784 - Fix checkin message for debarred patrons > >Tested and bug still exists, however previous patch did not apply and relied on obsolete code. > >Test plan: > >Before > >1) Select a user with active restrictions >2) Make sure finesday=0 for the user category >3) Checkout and return an item (not overdue) : a previous restriction reminder will appear >4) Checkout and return an overdue item : no previous restriction reminder will appear > >After applying patch: >Same steps, but a reminder should appear for step 4) > >I've also tested with finesday=1 with "no overdue", "grace period overdue" and "long overdue" test >cases. The appropriate nessage appeared for each test. > >P.S.: The "finesday" setting is called "Suspension days" in the web interface, if you're searching >for it like I did... >--- > C4/Circulation.pm | 27 ++++++++++++--------------- > 1 file changed, 12 insertions(+), 15 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index abb4c50..85c3631 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -2008,17 +2008,19 @@ sub AddReturn { > my $fix = _FixOverduesOnReturn($borrowernumber, $item->{itemnumber}, $exemptfine, $dropbox); > defined($fix) or warn "_FixOverduesOnReturn($borrowernumber, $item->{itemnumber}...) failed!"; # zero is OK, check defined > >+ my $new_debar = 0; > if ( $issue and $issue->is_overdue ) { >- # fix fine days >+ # fix fine days > $today = $dropboxdate if $dropbox; >- my ($debardate,$reminder) = _debar_user_on_return( $patron_unblessed, $item, dt_from_string($issue->date_due), $today ); >- if ($reminder){ >- $messages->{'PrevDebarred'} = $debardate; >- } else { >- $messages->{'Debarred'} = $debardate if $debardate; >+ my $debardate = _debar_user_on_return( $patron_unblessed, $item, dt_from_string($issue->date_due), $today ); >+ >+ if ( $debardate ) { >+ $messages->{'Debarred'} = $debardate; >+ $new_debar = 1; > } >+ } > # there's no overdue on the item but borrower had been previously debarred >- } elsif ( $issue->date_due and $patron->debarred ) { >+ if ( $new_debar == 0 and $patron->debarred ) { > if ( $patron->debarred eq "9999-12-31") { > $messages->{'ForeverDebarred'} = $patron->debarred; > } else { >@@ -2277,15 +2279,10 @@ sub _debar_user_on_return { > }); > # if borrower was already debarred but does not get an extra debarment > my $patron = Koha::Patrons->find( $borrower->{borrowernumber} ); >- my $new_debarment_str; >- if ( $borrower->{debarred} eq $patron->is_debarred ) { >- $is_a_reminder = 1; >- $new_debarment_str = $borrower->{debarred}; >- } else { >- $new_debarment_str = $new_debar_dt->ymd(); >+ if ( $borrower->{debarred} ne $patron->is_debarred ) { >+ # FIXME Should return a DateTime object >+ return $new_debar_dt->ymd(); > } >- # FIXME Should return a DateTime object >- return $new_debarment_str, $is_a_reminder; > } > } > return; >-- >2.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 14784
:
42354
|
49282
|
49283
|
49377
|
58227
|
67102
|
68132
|
69295
|
69296
|
77683
|
79826
|
106808
|
106809
|
107487
|
110485
|
110514
|
110763
|
110764
|
112724
|
112725
|
136040
|
136327
|
137727
|
137728
|
145320
|
145321