Bugzilla – Attachment 179291 Details for
Bug 31698
Add ability to move a hold to a new bibliographic record/item
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31698: Deal with priority
Bug-31698-Deal-with-priority.patch (text/plain), 3.55 KB, created by
Lucas Gass (lukeg)
on 2025-03-13 22:27:13 UTC
(
hide
)
Description:
Bug 31698: Deal with priority
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2025-03-13 22:27:13 UTC
Size:
3.55 KB
patch
obsolete
>From ce39ac2aaada0be9945d386833ebace08fc7baac Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Thu, 13 Mar 2025 22:26:12 +0000 >Subject: [PATCH] Bug 31698: Deal with priority > >--- > Koha/Hold.pm | 13 ++++++++++++- > .../prog/en/modules/reserve/request.tt | 4 +++- > 2 files changed, 15 insertions(+), 2 deletions(-) > >diff --git a/Koha/Hold.pm b/Koha/Hold.pm >index 2368e0b53e4..f1db5b27a1a 100644 >--- a/Koha/Hold.pm >+++ b/Koha/Hold.pm >@@ -201,10 +201,21 @@ sub move_hold_item { > C4::Reserves::CanItemBeReserved( $patron, $new_item, $self->branchcode, { ignore_hold_counts => 1 } ); > > if ( $canReserve->{status} eq 'OK' ) { >+ >+ # Find the lowest priority among holds on this biblio >+ my $lowest_priority = Koha::Holds->search( >+ { biblionumber => $new_biblionumber }, >+ { order_by => { -desc => 'priority' }, rows => 1 } >+ )->next; >+ >+ # Set priority to the lowest + 1, or 1 if there are no others >+ my $new_priority = $lowest_priority ? $lowest_priority->priority + 1 : 1; >+ > $self->update( > { > itemnumber => $new_item->itemnumber, >- biblionumber => $new_item->biblionumber >+ biblionumber => $new_item->biblionumber, >+ priority => $new_priority, > } > ); > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >index d00b7b18fa8..afc5d935288 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -1497,6 +1497,7 @@ > <tr> > <th>Hold ID</th> > <th>Original hold</th> >+ <th>Problem</th> > </tr> > </thead> > <tbody> </tbody> >@@ -2027,8 +2028,9 @@ > let reserve_biblionumber = $(this).data('biblionumber'); > let reserve_itemnumber = $(this).data('itemnumber'); > let item_level_hold = $(this).data('item_level_hold'); >+ let error_message = $(this).data('item_level_hold') ? "" : _("Cannot move a waiting or record level hold"); > let found_status = $(this).data('found'); >- $('#move_hold_item_selection table').append(`<tr><td>${reserve_id}</td><td>Biblionumber: <a target="_blank" href="/cgi-bin/koha/reserve/request.pl?biblionumber=${reserve_biblionumber}">${reserve_biblionumber}</a> Itemnumber: <a target="_blank" href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=${reserve_biblionumber}#item${reserve_itemnumber}">${reserve_itemnumber}</a></td></tr>`) >+ $('#move_hold_item_selection table').append(`<tr><td>${reserve_id}</td><td>Biblionumber: <a target="_blank" href="/cgi-bin/koha/reserve/request.pl?biblionumber=${reserve_biblionumber}">${reserve_biblionumber}</a> Itemnumber: <a target="_blank" href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=${reserve_biblionumber}#item${reserve_itemnumber}">${reserve_itemnumber}</a></td><td>${error_message}</td></tr>`) > if ( item_level_hold ) { > $('#move_hold_item_form').append(`<input type="hidden" name="hold_id" value="${reserve_id}">`); > } >-- >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 31698
:
179226
|
179235
|
179236
|
179279
|
179287
|
179290
|
179291
|
179292
|
179295
|
179704
|
179711
|
179713
|
181222
|
181223
|
181224
|
181225
|
181226
|
181228
|
181229
|
181230
|
181231
|
181232
|
181233
|
181234
|
181929
|
181930
|
181944
|
181945
|
181946
|
181947
|
181948
|
181951
|
181952
|
181953
|
181954
|
181955
|
181956
|
181957
|
181958
|
181959
|
181960
|
181961
|
181962
|
182639
|
182640
|
182641