Bugzilla – Attachment 145320 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]
Bug 14784: Fix checkin message for restricted patrons
Bug-14784-Fix-checkin-message-for-restricted-patro.patch (text/plain), 2.60 KB, created by
Kyle M Hall (khall)
on 2023-01-13 20:13:06 UTC
(
hide
)
Description:
Bug 14784: Fix checkin message for restricted patrons
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2023-01-13 20:13:06 UTC
Size:
2.60 KB
patch
obsolete
>From b568f4d525f2e6ada963ae66cdae6fed363f5b1c Mon Sep 17 00:00:00 2001 >From: Shi Yao Wang <shi-yao.wang@inlibro.com> >Date: Mon, 13 Jun 2022 14:05:53 -0400 >Subject: [PATCH] Bug 14784: Fix checkin message for restricted patrons > >Test plan: >Before > >1) Select a user with active indefinite or definite restrictions (manual restriction works) >2) Make sure finedays=0 for the user category. See [1] >3) Checkout and return an item (not overdue) > A previous restriction reminder will appear >4) Checkout and return an overdue item (change the date at checkout) > No previous restriction reminder will appear > >After applying patch: >Same steps, but a reminder should appear for step 4) > >[1] The "finedays" setting is called "Suspension in days" in the web interface, if you're searching for it like I did... > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > C4/Circulation.pm | 21 +++++++++++++++++---- > 1 file changed, 17 insertions(+), 4 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 336ce9490a..f2fc96c719 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -2301,10 +2301,23 @@ sub AddReturn { > if ( $issue and $issue->is_overdue($return_date) ) { > # fix fine days > my ($debardate,$reminder) = _debar_user_on_return( $patron_unblessed, $item->unblessed, dt_from_string($issue->date_due), $return_date ); >- if ($reminder){ >- $messages->{'PrevDebarred'} = $debardate; >- } else { >- $messages->{'Debarred'} = $debardate if $debardate; >+ if ($debardate and $debardate ne "9999-12-31") { >+ if ($reminder){ >+ $messages->{'PrevDebarred'} = $debardate; >+ } else { >+ $messages->{'Debarred'} = $debardate; >+ } >+ } elsif ($patron->debarred) { >+ if ( $patron->debarred eq "9999-12-31") { >+ $messages->{'ForeverDebarred'} = $patron->debarred; >+ } else { >+ my $borrower_debar_dt = dt_from_string( $patron->debarred ); >+ $borrower_debar_dt->truncate(to => 'day'); >+ my $today_dt = $return_date->clone()->truncate(to => 'day'); >+ if ( DateTime->compare( $borrower_debar_dt, $today_dt ) != -1 ) { >+ $messages->{'PrevDebarred'} = $patron->debarred; >+ } >+ } > } > # there's no overdue on the item but borrower had been previously debarred > } elsif ( $issue->date_due and $patron->debarred ) { >-- >2.30.2
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