Bugzilla – Attachment 117522 Details for
Bug 25690
SIP should not allow to check out an item in transfer because of a hold to another patron
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25690: Make CanBookBeIssued return In Processing state as needing confirmation
Bug-25690-Make-CanBookBeIssued-return-In-Processin.patch (text/plain), 12.07 KB, created by
Kyle M Hall (khall)
on 2021-03-02 14:34:21 UTC
(
hide
)
Description:
Bug 25690: Make CanBookBeIssued return In Processing state as needing confirmation
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2021-03-02 14:34:21 UTC
Size:
12.07 KB
patch
obsolete
>From b0cd6b413c0f92e48519218290dcfa79c3b8c2df Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Joonas=20Kylm=C3=A4l=C3=A4?= <joonas.kylmala@helsinki.fi> >Date: Wed, 17 Feb 2021 16:20:28 +0200 >Subject: [PATCH] Bug 25690: Make CanBookBeIssued return In Processing state as > needing confirmation > >This prevents checking out to a patron an item with hold to someone >else in the In Processing state via staff interface. > >Also the checkout error message via SIP is now a more clearer one: "Item is >on hold for another patron." Before it was "Item cannot be issued: >$confirmation". > >Also the branch transfer and batch checkout pages are adapted to this new >confirmation message as well. > >To test: > 1) Create bib level hold to an item for patron A > 2) Check-in that item via SIP2, now the hold state should be "In processing" > 3) Apply patch > 4) Try to checkout the item to patron B via staff interface and > notice we get now confirmation prompt do we really want to do it > because it is in processing. > > In order to not have to setup SIP2 server, alternatively steps 1) and > 2) can be done so that you check-in the item in staff interface and > make it Waiting, and then with SQL change it to "In processing": > > UPDATE reserves SET found = "P" WHERE reserve_id = XXX; > UPDATE reserves SET waitingdate = NULL WHERE reserve_id = XX > UPDATE reserves SET expirationdate = NULL WHERE reserve_id = XXX; > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > C4/Circulation.pm | 11 +++++++++++ > C4/SIP/ILS/Transaction/Checkout.pm | 4 +++- > circ/branchtransfers.pl | 12 ++++++------ > circ/circulation.pl | 2 +- > .../prog/en/modules/circ/branchtransfers.tt | 2 +- > .../prog/en/modules/circ/circulation.tt | 15 ++++++++++++++- > .../modules/circ/circulation_batch_checkouts.tt | 5 ++++- > 7 files changed, 40 insertions(+), 11 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index e33ac61998..9ed6ef3f88 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -1147,6 +1147,17 @@ sub CanBookBeIssued { > $needsconfirmation{'resreservedate'} = $res->{reservedate}; > $needsconfirmation{'reserve_id'} = $res->{reserve_id}; > } >+ elsif ( $restype eq "Processing" ) { >+ # The item is determined hold being processed for someone else. >+ $needsconfirmation{PROCESSED} = 1; >+ $needsconfirmation{'resfirstname'} = $patron->firstname; >+ $needsconfirmation{'ressurname'} = $patron->surname; >+ $needsconfirmation{'rescardnumber'} = $patron->cardnumber; >+ $needsconfirmation{'resborrowernumber'} = $patron->borrowernumber; >+ $needsconfirmation{'resbranchcode'} = $patron->branchcode; >+ $needsconfirmation{'resreservedate'} = $res->{reservedate}; >+ $needsconfirmation{'reserve_id'} = $res->{reserve_id}; >+ } > } > } > } >diff --git a/C4/SIP/ILS/Transaction/Checkout.pm b/C4/SIP/ILS/Transaction/Checkout.pm >index 1be4974fe7..fbd3816df8 100644 >--- a/C4/SIP/ILS/Transaction/Checkout.pm >+++ b/C4/SIP/ILS/Transaction/Checkout.pm >@@ -74,7 +74,9 @@ sub do_checkout { > $noerror = 0; > } elsif ($confirmation eq 'RESERVED' and C4::Context->preference("AllowItemsOnHoldCheckoutSIP")) { > next; >- } elsif ($confirmation eq 'RESERVE_WAITING' or $confirmation eq 'TRANSFERRED') { >+ } elsif ($confirmation eq 'RESERVE_WAITING' >+ or $confirmation eq 'TRANSFERRED' >+ or $confirmation eq 'PROCESSED') { > $debug and warn "Item is on hold for another patron."; > $self->screen_msg("Item is on hold for another patron."); > $noerror = 0; >diff --git a/circ/branchtransfers.pl b/circ/branchtransfers.pl >index a63d7453cf..c795236f69 100755 >--- a/circ/branchtransfers.pl >+++ b/circ/branchtransfers.pl >@@ -74,6 +74,7 @@ my $found; > my $reserved; > my $waiting; > my $hold_transferred; >+my $hold_processed; > my $reqmessage; > my $cancelled; > my $setwaiting; >@@ -176,13 +177,11 @@ if ($found) { > > if ( $res->{'ResFound'} eq "Waiting" ) { > $waiting = 1; >- } >- >- if ( $res->{'ResFound'} eq "Transferred" ) { >+ } elsif ( $res->{'ResFound'} eq "Transferred" ) { > $hold_transferred = 1; >- } >- >- elsif ( $res->{'ResFound'} eq "Reserved" ) { >+ } elsif ( $res->{'ResFound'} eq "Processing" ) { >+ $hold_processed = 1; >+ } elsif ( $res->{'ResFound'} eq "Reserved" ) { > $reserved = 1; > $biblionumber = $res->{'biblionumber'}; > } >@@ -225,6 +224,7 @@ $template->param( > reserved => $reserved, > waiting => $waiting, > transferred => $hold_transferred, >+ processed => $hold_processed, > borrowernumber => $borrowernumber, > itemnumber => $itemnumber, > barcode => $barcode, >diff --git a/circ/circulation.pl b/circ/circulation.pl >index 9923f42f74..eef2d2f1a1 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -422,7 +422,7 @@ if (@$barcodes) { > } > } > >- if ($question->{RESERVE_WAITING} or $question->{RESERVED} or $question->{TRANSFERRED}){ >+ if ($question->{RESERVE_WAITING} or $question->{RESERVED} or $question->{TRANSFERRED} or $question->{PROCESSING}){ > $template->param( > reserveborrowernumber => $question->{'resborrowernumber'}, > reserve_id => $question->{reserve_id}, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt >index 9b563c86b8..89a7f6d496 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt >@@ -50,7 +50,7 @@ > <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" /> > <input type="hidden" name="borrowernumber" value="[% borrowernumber | html %]" /> > <input type="hidden" name="tobranchcd" value="[% tobranchcd | html %]" /> >- [% IF ( waiting or transferred ) %] >+ [% IF ( waiting or transferred or processed ) %] > <input type="hidden" name="barcode" value="[% barcode | html %]" /> > <input type="hidden" name="request" value="KillWaiting" /> > <input type="submit" value="Cancel" /> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >index f91ef45cf1..a71fb2873c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -126,6 +126,10 @@ > <li>Item <em>[% getTitleMessageIteminfo | html %]</em> ([% getBarcodeMessageIteminfo | html %]) is on hold for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% resborrowernumber | uri %]">[% resfirstname | html %] [% ressurname | html %]</a> ([% rescardnumber | html %]) and being transferred to [% Branches.GetName( resbranchcode ) | html %]</li> > [% END %] > >+ [% IF ( PROCESSED ) %] >+ <li>Item <em>[% getTitleMessageIteminfo | html %]</em> ([% getBarcodeMessageIteminfo | html %]) is being processed for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% resborrowernumber | uri %]">[% resfirstname | html %] [% ressurname | html %]</a> ([% rescardnumber | html %]) at [% Branches.GetName( resbranchcode ) | html %]</li> >+ [% END %] >+ > [% IF ( RESERVED ) %] > <li>Item <em>[% getTitleMessageIteminfo | html %]</em> ([% getBarcodeMessageIteminfo | html %]) has been on hold for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% resborrowernumber | uri %]">[% resfirstname | html %] [% ressurname | html %]</a> ([% rescardnumber | html %]) at [% Branches.GetName( resbranchcode ) | html %] since [% resreservedate | $KohaDates %]</li> > [% END %] >@@ -250,6 +254,15 @@ > </p> > [% END %] > >+ [% IF ( PROCESSED ) %] >+ <p> >+ <label for="cancelreserve">Cancel hold</label> >+ <input type="radio" value="cancel" name="cancelreserve" id="cancelreserve" /><br /> >+ <label for="revertreserve">Revert In Processing status</label> >+ <input type="radio" value="revert" name="cancelreserve" id="revertreserve" checked="checked"/> >+ </p> >+ [% END %] >+ > <input type="hidden" name="barcode" value="[% barcode | html %]" /> > <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" /> > <input type="hidden" name="issueconfirmed" value="1" /> >@@ -280,7 +293,7 @@ > </form> > [% END # /IF CAN_user_circulate_force_checkout or HIGHHOLDS %] > >- [% IF ( RESERVED or RESERVE_WAITING or TRANSFERRED ) %] >+ [% IF ( RESERVED or RESERVE_WAITING or TRANSFERRED or PROCESSING ) %] > <form method="get" action="/cgi-bin/koha/circ/circulation.pl"> > <input type="hidden" name="restoreduedatespec" /> > <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" /> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt >index c21b2e79ae..6afb301479 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt >@@ -150,6 +150,9 @@ > [% IF checkout_info.TRANSFERRED %] > <li><i class="fa fa-li fa-warning"></i>This item is on hold and being transferred to another patron.</li> > [% END %] >+ [% IF checkout_info.PROCESSED %] >+ <li><i class="fa fa-li fa-warning"></i>This item is on hold and being processed for another patron.</li> >+ [% END %] > [% IF checkout_info.ISSUED_TO_ANOTHER %] > <li><i class="fa fa-li fa-warning"></i>This item is checked out to another patron. > [% IF CAN_user_circulate_force_checkout %] >@@ -190,7 +193,7 @@ > </script> > [% END %] > >- [% IF NOT checkout_info.IMPOSSIBLE && ( CAN_user_circulate_force_checkout || checkout_info.HIGHHOLDS ) && ( checkout_info.RESERVED || checkout_info.RESERVE_WAITING || checkout_info.TRANSFERRED ) %] <!-- arbitrary choice, revert the reserve is not possible--> >+ [% IF NOT checkout_info.IMPOSSIBLE && ( CAN_user_circulate_force_checkout || checkout_info.HIGHHOLDS ) && ( checkout_info.RESERVED || checkout_info.RESERVE_WAITING || checkout_info.TRANSFERRED || checkout_info.PROCESSED ) %] <!-- arbitrary choice, revert the reserve is not possible--> > <li><i class="fa fa-li fa-warning"></i>This item is on hold for another patron. The hold will be overridden, but not cancelled.</li> > [% ELSIF checkout_info.RESERVED %] > <li><i class="fa fa-li fa-warning"></i>This item is on hold for another patron.</li> >-- >2.24.1 (Apple Git-126)
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 25690
:
116948
|
116949
|
116950
|
116951
|
117000
|
117001
|
117002
|
117003
|
117004
|
117062
|
117063
|
117064
|
117065
|
117066
|
117067
|
117374
|
117507
|
117508
|
117509
|
117510
|
117511
|
117512
|
117513
|
117519
|
117520
|
117521
| 117522 |
117523
|
117524
|
117525
|
117674