Bugzilla – Attachment 138228 Details for
Bug 24860
Add ability to place item group level holds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24860: Skip non-matching item group holds in HoldsQueue
Bug-24860-Skip-non-matching-item-group-holds-in-Ho.patch (text/plain), 8.03 KB, created by
Kyle M Hall (khall)
on 2022-07-28 18:21:42 UTC
(
hide
)
Description:
Bug 24860: Skip non-matching item group holds in HoldsQueue
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2022-07-28 18:21:42 UTC
Size:
8.03 KB
patch
obsolete
>From f87d1381118ef814eed0c013dbe2bf583522ebec Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 11 Mar 2020 06:00:27 -0400 >Subject: [PATCH] Bug 24860: Skip non-matching item group holds in HoldsQueue > >Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> > >Signed-off-by: Rebecca Coert <rcoert@arlingtonva.us> >--- > C4/HoldsQueue.pm | 43 +++++++++++++++++-- > .../prog/en/modules/circ/view_holdsqueue.tt | 2 + > 2 files changed, 42 insertions(+), 3 deletions(-) > >diff --git a/C4/HoldsQueue.pm b/C4/HoldsQueue.pm >index f2eb1ee4b8f..f9a00729d7e 100644 >--- a/C4/HoldsQueue.pm >+++ b/C4/HoldsQueue.pm >@@ -131,11 +131,13 @@ sub GetHoldsQueueItems { > biblio.copyrightdate, biblio.subtitle, biblio.medium, > biblio.part_number, biblio.part_name, > biblioitems.publicationyear, biblioitems.pages, biblioitems.size, >- biblioitems.isbn, biblioitems.editionstatement, items.copynumber >+ biblioitems.isbn, biblioitems.editionstatement, items.copynumber, >+ item_groups.item_group_id, item_groups.description AS item_group_description > FROM tmp_holdsqueue > JOIN biblio USING (biblionumber) > LEFT JOIN biblioitems USING (biblionumber) > LEFT JOIN items USING ( itemnumber) >+ LEFT JOIN item_groups ON ( item_group_items.item_group_id = item_groups.item_group_id ) > WHERE 1=1 > /; > if ($params->{branchlimit}) { >@@ -275,7 +277,7 @@ sub GetPendingHoldRequestsForBib { > my $dbh = C4::Context->dbh; > > my $request_query = "SELECT biblionumber, borrowernumber, itemnumber, priority, reserve_id, reserves.branchcode, >- reservedate, reservenotes, borrowers.branchcode AS borrowerbranch, itemtype, item_level_hold >+ reservedate, reservenotes, borrowers.branchcode AS borrowerbranch, itemtype, item_level_hold, item_group_id > FROM reserves > JOIN borrowers USING (borrowernumber) > WHERE biblionumber = ? >@@ -456,6 +458,8 @@ sub MapItemsToHoldRequests { > > next if $request->{itemnumber} && $request->{itemnumber} != $item->{itemnumber}; > >+ next if $request->{item_group_id} && $item->{_object}->item_group && $item->{_object}->item_group->id ne $request->{item_group_id}; >+ > next unless $item->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } ); > > my $local_holds_priority_item_branchcode = >@@ -510,7 +514,9 @@ sub MapItemsToHoldRequests { > and _checkHoldPolicy($items_by_itemnumber{ $request->{itemnumber} }, $request) # Don't fill item level holds that contravene the hold pickup policy at this time > and ( !$request->{itemtype} # If hold itemtype is set, item's itemtype must match > || $items_by_itemnumber{ $request->{itemnumber} }->{itype} eq $request->{itemtype} ) >- >+ and ( !$request->{item_group_id} # If hold item_group is set, item's item_group must match >+ || ( $items_by_itemnumber{ $request->{itemnumber} }->{_object}->item_group >+ && $items_by_itemnumber{ $request->{itemnumber} }->{_object}->item_group->id eq $request->{item_group_id} ) ) > and $items_by_itemnumber{ $request->{itemnumber} }->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } ) > > ) >@@ -567,6 +573,8 @@ sub MapItemsToHoldRequests { > && _checkHoldPolicy($item, $request) # Don't fill item level holds that contravene the hold pickup policy at this time > && ( !$request->{itemtype} # If hold itemtype is set, item's itemtype must match > || ( $request->{itemnumber} && ( $items_by_itemnumber{ $request->{itemnumber} }->{itype} eq $request->{itemtype} ) ) ) >+ && ( !$request->{item_group_id} # If hold item_group is set, item's item_group must match >+ || ( $item->{_object}->item_group && $item->{_object}->item_group->id eq $request->{item_group_id} ) ) > ) > { > $itemnumber = $item->{itemnumber}; >@@ -592,6 +600,13 @@ sub MapItemsToHoldRequests { > next unless ( !$request->{itemtype} > || $item->{itype} eq $request->{itemtype} ); > >+ # If hold item_group is set, item's item_group must match >+ next unless ( >+ !$request->{item_group_id} >+ || ( $item->{_object}->item_group >+ && $item->{_object}->item_group->id eq $request->{item_group_id} ) >+ ); >+ > $itemnumber = $item->{itemnumber}; > last; > } >@@ -629,6 +644,13 @@ sub MapItemsToHoldRequests { > next unless ( !$request->{itemtype} > || $item->{itype} eq $request->{itemtype} ); > >+ # If hold item_group is set, item's item_group must match >+ next unless ( >+ !$request->{item_group_id} >+ || ( $item->{_object}->item_group >+ && $item->{_object}->item_group->id eq $request->{item_group_id} ) >+ ); >+ > $itemnumber = $item->{itemnumber}; > $holdingbranch = $branch; > last PULL_BRANCHES; >@@ -646,6 +668,14 @@ sub MapItemsToHoldRequests { > > next unless $items_by_itemnumber{ $current_item->{itemnumber} }->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } ); > >+ # If hold item_group is set, item's item_group must match >+ next unless ( >+ !$request->{item_group_id} >+ || ( $current_item->{_object}->item_group >+ && $current_item->{_object}->item_group->id eq $request->{item_group_id} ) >+ ); >+ >+ > $itemnumber = $current_item->{itemnumber}; > last; # quit this loop as soon as we have a suitable item > } >@@ -666,6 +696,13 @@ sub MapItemsToHoldRequests { > next unless ( !$request->{itemtype} > || $item->{itype} eq $request->{itemtype} ); > >+ # If hold item_group is set, item's item_group must match >+ next unless ( >+ !$request->{item_group_id} >+ || ( $item->{_object}->item_group >+ && $item->{_object}->item_group->id eq $request->{item_group_id} ) >+ ); >+ > next unless $items_by_itemnumber{ $item->{itemnumber} }->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } ); > > $itemnumber = $item->{itemnumber}; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt >index 7d1032386c5..0f96caa48ae 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt >@@ -187,6 +187,8 @@ > <td class="hq-barcode"> > [% IF ( itemsloo.item_level_request ) %] > <em>Only item:</em> <strong>[% itemsloo.barcode | html %]</strong> >+ [% ELSIF itemsloo.item_group_id %] >+ <strong>[% itemsloo.barcode | html %]</strong> <em>or any item from item_group <strong>[% itemsloo.item_group_description | html %]</strong></em> > [% ELSE %] > <strong>[% itemsloo.barcode | html %]</strong> <em>or any available</em> > [% END %] >-- >2.30.2
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 24860
:
100644
|
100645
|
100646
|
100647
|
100648
|
100649
|
100650
|
100651
|
101744
|
101745
|
101746
|
101747
|
101748
|
101749
|
101750
|
101751
|
101827
|
101828
|
101829
|
101830
|
101831
|
101832
|
101833
|
101834
|
101835
|
102230
|
102231
|
102232
|
102233
|
102234
|
102235
|
102236
|
102237
|
102238
|
102239
|
102240
|
102241
|
102242
|
102243
|
102244
|
102245
|
102246
|
102247
|
106589
|
106590
|
106591
|
106592
|
106593
|
106594
|
106595
|
106596
|
106597
|
106682
|
106683
|
106684
|
106685
|
106686
|
106687
|
106688
|
106689
|
106690
|
106742
|
106743
|
106744
|
106745
|
106746
|
106747
|
106748
|
106749
|
106750
|
108458
|
108459
|
108460
|
108461
|
108462
|
108463
|
108464
|
108465
|
108466
|
109097
|
109098
|
109099
|
109100
|
109101
|
109102
|
109103
|
109104
|
109105
|
109171
|
109172
|
109173
|
109174
|
109175
|
109176
|
109177
|
109178
|
109179
|
113616
|
113617
|
113618
|
113619
|
113620
|
113621
|
113622
|
113623
|
113624
|
135922
|
135923
|
135924
|
135925
|
135926
|
135927
|
135928
|
135929
|
135930
|
138221
|
138222
|
138224
|
138225
|
138226
|
138227
|
138228
|
138229
|
138230
|
141214
|
141215
|
141735
|
141736
|
141737
|
141738
|
141739
|
141740
|
141741
|
141742
|
141743
|
141744
|
141745
|
141746
|
141747
|
141748
|
141749
|
141750
|
142413
|
142414
|
142415
|
142416
|
142417
|
142418
|
142419
|
142420
|
142421
|
142422
|
142423
|
142424
|
142425
|
142426
|
142427
|
142428
|
142429
|
142430
|
142827
|
142955
|
142956
|
142957
|
142958
|
142959
|
142960
|
142961
|
142962
|
142963
|
142964
|
142965
|
142966
|
142967
|
142968
|
142969
|
142970
|
142971
|
142972
|
142973
|
142974
|
142975
|
142992
|
142993
|
142994
|
142995
|
142996
|
142997
|
142998
|
142999
|
143000
|
143001
|
143002
|
143003
|
143004
|
143005
|
143006
|
143007
|
143008
|
143009
|
143010
|
143011