Bugzilla – Attachment 175804 Details for
Bug 34596
Items in transit should not show up in the holds queue
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34596: Do not build holds queue when checkin reserve found but do if hold ignored
Bug-34596-Do-not-build-holds-queue-when-checkin-re.patch (text/plain), 5.87 KB, created by
Brendan Lawlor
on 2024-12-19 19:41:46 UTC
(
hide
)
Description:
Bug 34596: Do not build holds queue when checkin reserve found but do if hold ignored
Filename:
MIME Type:
Creator:
Brendan Lawlor
Created:
2024-12-19 19:41:46 UTC
Size:
5.87 KB
patch
obsolete
>From 9d7c56a0e3e189a1c21a970c2824f01ecf366735 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 19 Nov 2024 19:57:54 +0000 >Subject: [PATCH] Bug 34596: Do not build holds queue when checkin reserve > found but do if hold ignored > >This patch does two things: >1: >It prevents rebulding the real time holds queue during a checkin if a reserve was found. >The reserve will either: >a - be set to waiting if at correct location and no confirmation - this is fine because we will rebuild the queue when > filling the hold >b - trigger a popup whihc will rebuild the queue when confirming the transfer, or be ignored > >2: >It adds a form to ignoring a hold so that we can rebuild the holds queue if we decided not to use the current item >to fill the found hold > >To test: >0 - Enable RealTimeHoldsQueue >1 - Place several holds for different libraries on a title >2 - Checkout a copy to a patron at current library (ignore current holds) >3 - Clean up DB so we can see outcomes from next steps: > delete from branchtransfers; delete from background_jobs; update reserves SET found=NULL where found='T'; >4 - Check in item, confirm hold >5 - Check background jobs, note two rebuilds of the holds queue >6 - Check item out to previous patron, repeat 3 >7 - Check in item, ignore the hold >8 - Check background jobs, note only one rebuild >9 - Apply patch, restart all >10 - Checkout item, repeat 3 >11 - Checkin item, confirm hold >12 - Check background jobs, onlt one rebuild of holds queue >13 - Checkout item, repeat 3 >14 - Checkin item, ignore hold >15 - Check background jobs, only one rebuild of holds queue > >Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> >--- > C4/Circulation.pm | 9 ++++----- > circ/returns.pl | 8 ++++++++ > .../prog/en/modules/circ/returns.tt | 17 ++++++++++++++--- > 3 files changed, 26 insertions(+), 8 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index b9b66974be..2b0d259f33 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -2588,11 +2588,10 @@ sub AddReturn { > } > }); > >- Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue->new->enqueue( >- { >- biblio_ids => [ $item->biblionumber ] >- } >- ) if C4::Context->preference('RealTimeHoldsQueue'); >+ Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue->new->enqueue( { biblio_ids => [ $item->biblionumber ] } ) >+ if C4::Context->preference('RealTimeHoldsQueue') >+ && !defined $messages->{ResFound} >+ && C4::Context->interface eq 'intranet'; > } > > return ( $doreturn, $messages, $issue, ( $patron ? $patron->unblessed : {} )); >diff --git a/circ/returns.pl b/circ/returns.pl >index 9f2e52dab1..5f87980d0c 100755 >--- a/circ/returns.pl >+++ b/circ/returns.pl >@@ -265,6 +265,14 @@ if ( $op eq 'cud-dotransfer'){ > $transfer->transit; > } > >+if ( $op eq 'cud-ignore_reserve' ) { >+ my $ignored_item = $query->param('ignoreitem'); >+ my $item = Koha::Items->find($ignored_item); >+ Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue->new->enqueue( { biblio_ids => [ $item->biblionumber ] } ) >+ if C4::Context->preference('RealTimeHoldsQueue'); >+ >+} >+ > if ($transit && $op eq 'cud-transfer') { > my $transfer = Koha::Item::Transfers->find($transit); > if ( $canceltransfer ) { >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 98a1ea119b..be20caed52 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >@@ -927,9 +927,20 @@ > </button> > [% END %] > >- <button type="button" data-bs-dismiss="modal" class="btn btn-default deny" accesskey="i"> >- <i class="fa fa-times"></i> Ignore (I) >- </button> >+ <form method="post" action="returns.pl" class="confirm"> >+ <input type="hidden" name="op" value="cud-ignore_reserve" /> >+ <input type="hidden" name="ignoreitem" value="[% itemnumber | html %]" /> >+ [% INCLUDE 'csrf-token.inc' %] >+ [% FOREACH inputloo IN inputloop %] >+ <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" /> >+ <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" /> >+ <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" /> >+ <input type="hidden" name="nr-[% inputloo.counter | html %]" value="[% inputloo.not_returned | html %]" /> >+ [% END %] >+ <button type="submit" data-bs-dismiss="modal" class="btn btn-default deny" accesskey="i"> >+ <i class="fa fa-times"></i> Ignore (I) >+ </button> >+ </form> > </div> <!-- /.modal-footer --> > </form> <!-- /.confirm --> > </div> <!-- /.modal-content --> >-- >2.39.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 34596
:
174811
| 175804