Bugzilla – Attachment 21080 Details for
Bug 8231
Warning on Check in if borrower is restricted
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8231 Systematic warning at check in if borrower is restricted
Bug-8231-Systematic-warning-at-check-in-if-borrowe.patch (text/plain), 5.13 KB, created by
Jonathan Druart
on 2013-09-13 11:49:53 UTC
(
hide
)
Description:
Bug 8231 Systematic warning at check in if borrower is restricted
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-09-13 11:49:53 UTC
Size:
5.13 KB
patch
obsolete
>From 927d96afb7d6fbda530559bf6c0a6dbbcb279e5e Mon Sep 17 00:00:00 2001 >From: Lyon3 Team <koha@univ-lyon3.fr> >Date: Tue, 23 Apr 2013 07:17:57 -0400 >Subject: [PATCH] Bug 8231 Systematic warning at check in if borrower is > restricted > >Display, at check in, a reminder of an already existing suspension date >even if the returned document is not late > >Test plan : >1) Apply the patch >2) Go to a borrower checkout page and checkout some documents with > different passed duedate using "Specify due date" function. Checkout > out one with the default duedate. >3) Check in the document with the bigger delay : > You will get the message : 'X is now restricted until ...' >4) Check in one of the document with a smaller delay : > You'll get a different message : 'Reminder : Patron was earlier > restricted until...' >5) Check in the document which is not late : > You'll get the same message as the previous one > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >It seems consistent to display the restriction alert even if the user is >already debarred. >--- > C4/Circulation.pm | 23 +++++++++++++++----- > circ/returns.pl | 3 +++ > .../intranet-tmpl/prog/en/modules/circ/returns.tt | 3 +++ > 3 files changed, 23 insertions(+), 6 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index df3245d..7abff8d 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -1873,11 +1873,21 @@ sub AddReturn { > my $fix = _FixOverduesOnReturn($borrowernumber, $item->{itemnumber}, $exemptfine, $dropbox); > defined($fix) or warn "_FixOverduesOnReturn($borrowernumber, $item->{itemnumber}...) failed!"; # zero is OK, check defined > >- if ( $issue->{overdue} && $issue->{date_due} ) { >+ if ( $issue->{overdue} && $issue->{date_due} ) { > # fix fine days >- my $debardate = >- _debar_user_on_return( $borrower, $item, $issue->{date_due}, $today ); >- $messages->{Debarred} = $debardate if ($debardate); >+ my ($debardate,$reminder) = _debar_user_on_return( $borrower, $item, $issue->{date_due}, $today ); >+ if ($reminder){ >+ $messages->{'PrevDebarred'} = $debardate; >+ } else { >+ $messages->{'Debarred'} = $debardate if $debardate; >+ } >+ } elsif ( $issue->{date_due} and $borrower->{'debarred'} ) { >+ my $borrower_debar_dt = dt_from_string( $borrower->{debarred} ); >+ $borrower_debar_dt->truncate(to => 'day'); >+ my $today_dt = $today->clone()->truncate(to => 'day'); >+ if ( DateTime->compare( $borrower_debar_dt, $today_dt ) != -1 ) { >+ $messages->{'PrevDebarred'} = $borrower->{'debarred'}; >+ } > } > } > >@@ -2054,12 +2064,13 @@ sub _debar_user_on_return { > $dt_today->clone()->add_duration( $deltadays * $finedays ); > if ( $borrower->{debarred} ) { > my $borrower_debar_dt = dt_from_string( $borrower->{debarred} ); >- >+ $borrower_debar_dt->truncate(to => 'day'); >+ $new_debar_dt->truncate(to=>'day'); > # Update patron only if new date > old > if ( DateTime->compare( $borrower_debar_dt, $new_debar_dt ) != > -1 ) > { >- return; >+ return ($borrower_debar_dt,1); > } > > } >diff --git a/circ/returns.pl b/circ/returns.pl >index 618190b..317dd2b 100755 >--- a/circ/returns.pl >+++ b/circ/returns.pl >@@ -457,6 +457,9 @@ foreach my $code ( keys %$messages ) { > $err{debarborrowernumber} = $borrower->{borrowernumber}; > $err{debarname} = "$borrower->{firstname} $borrower->{surname}"; > } >+ elsif ( $code eq 'PrevDebarred' ) { >+ $err{prevdebarred} = $messages->{'PrevDebarred'}; >+ } > else { > die "Unknown error code $code"; # note we need all the (empty) elsif's above, or we die. > # This forces the issue of staying in sync w/ Circulation.pm >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >index 775454f..8b1841c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >@@ -350,6 +350,9 @@ $(document).ready(function () { > [% IF ( errmsgloo.debarred ) %] > <p class="problem"><a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% errmsgloo.debarborrowernumber %]">[% errmsgloo.debarname %]([% errmsgloo.debarcardnumber %])</a> is now debarred until [% errmsgloo.debarred | $KohaDates %] </p> > [% END %] >+ [% IF ( errmsgloo.prevdebarred ) %] >+ <p class="problem"><b>Reminder: </b>Patron was earlier restricted until [% errmsgloo.prevdebarred | $KohaDates %]</p> >+ [% END %] > [% END %] > [% IF ( soundon ) %] > <audio src="[% interface %]/[% theme %]/sound/critical.ogg" autoplay="autoplay" autobuffer="autobuffer"></audio> >-- >1.7.10.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 8231
:
10206
|
10584
|
10585
|
10586
|
15332
|
16263
|
17273
|
18077
|
20581
|
21080
|
22883
|
24220
|
24230
|
24273