Bugzilla – Attachment 24230 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), 4.23 KB, created by
Biblibre Sandboxes
on 2014-01-13 17:54:11 UTC
(
hide
)
Description:
Bug 8231 Systematic warning at check in if borrower is restricted
Filename:
MIME Type:
Creator:
Biblibre Sandboxes
Created:
2014-01-13 17:54:11 UTC
Size:
4.23 KB
patch
obsolete
>From 48cc086c43607a696fd0a90bf9a107e54e5f0dad Mon Sep 17 00:00:00 2001 >From: Lyon3 Team <koha@univ-lyon3.fr> >Date: Mon, 13 Jan 2014 12:09:01 +0100 >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 > >Signed-off-by: JMBroust <jean-manuel.broust@univ-lyon2.fr> >--- > C4/Circulation.pm | 24 +++++++++++++++---- > circ/returns.pl | 3 ++ > .../intranet-tmpl/prog/en/modules/circ/returns.tt | 3 ++ > 3 files changed, 25 insertions(+), 5 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index f8b204a..35a4ccb 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -1875,10 +1875,21 @@ sub AddReturn { > defined($fix) or warn "_FixOverduesOnReturn($borrowernumber, $item->{itemnumber}...) failed!"; # zero is OK, check defined > > 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); >+ # fix fine days >+ my ($debardate,$reminder) = _debar_user_on_return( $borrower, $item, $issue->{date_due}, $today ); >+ if ($reminder){ >+ $messages->{'PrevDebarred'} = $debardate; >+ } else { >+ $messages->{'Debarred'} = $debardate if $debardate; >+ } >+ # there's no overdue on the item but borrower had been previously debarred >+ } 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'}; >+ } > } > } > >@@ -2070,7 +2081,10 @@ sub _debar_user_on_return { > expiration => $new_debar_dt->ymd(), > type => 'SUSPENSION', > }); >- >+ # if borrower was already debarred but does not get an extra debarment >+ if ( $borrower->{debarred} eq Koha::Borrower::Debarments::IsDebarred($borrower->{borrowernumber}) ) { >+ return ($borrower->{debarred},1); >+ } > return $new_debar_dt->ymd(); > } > } >diff --git a/circ/returns.pl b/circ/returns.pl >index 93f36f2..0deebda 100755 >--- a/circ/returns.pl >+++ b/circ/returns.pl >@@ -467,6 +467,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 aee0a5e..ce03bb6 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.2.5
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