Bugzilla – Attachment 185459 Details for
Bug 15516
Allow to place a hold on first available item from a group of titles
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15516: Allow to reserve first available item from a group of titles
Bug-15516-Allow-to-reserve-first-available-item-fr.patch (text/plain), 25.58 KB, created by
Andrew Fuerste-Henry
on 2025-08-15 15:01:53 UTC
(
hide
)
Description:
Bug 15516: Allow to reserve first available item from a group of titles
Filename:
MIME Type:
Creator:
Andrew Fuerste-Henry
Created:
2025-08-15 15:01:53 UTC
Size:
25.58 KB
patch
obsolete
>From 9b327f6f6e8f01feb6d5db74231367787130d038 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Thu, 4 Aug 2022 15:20:59 +1200 >Subject: [PATCH] Bug 15516: Allow to reserve first available item from a group > of titles > >It can be useful, for instance, if a library has the same title from >different publishers (so 1 title but several biblio records) but the >user only wants a copy of the book, regardless of the publisher. > >Test plan: >0. Run updatedatabase.pl and misc/devel/update_dbix_class_files.pl >1. Go to intranet search, display some results, click on some checkboxes >and click on 'Place hold' button at the top of the results. >2. Search for a patron >3. Check the 'Treat as hold group' checkbox >4. Click on 'Place hold' >5. In the next screen you should see all the holds you placed with the >additional text '(part of a hold group)' in Details column. >6. Click on the "hold group" link. A modal window should appear with >the content of the hold group (a list of holds) >7. Check in an item of one of the reserved biblios and confirm the hold >8. The hold status is changed to Waiting, and all other holds are deleted. >The other holds will also be removed from the holds queue. >9. Confirm tests pass >- t/db_dependent/Koha/Holds.t >- t/db_dependent/Reserves/HoldGroup.t >Note: the "hold group" link is displayed in the following pages: >- reserve/request.pl >- circ/circulation.pl >- members/moremember.pl >- circ/pendingreserves.pl >- circ/view_holdsqueue.pl >Note: A hold group is counted as only one hold > >Sponsored-by: Catalyst IT > >Signed-off-by: Michal Denar <black23@gmail.com> >Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> > >Signed-off-by: Michal Denar <black23@gmail.com> >Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk> >Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> >--- > circ/circulation.pl | 2 +- > circ/view_holdsqueue.pl | 10 +++++ > .../prog/en/includes/hold-group-modal.inc | 14 +++++++ > .../prog/en/includes/holds_table.inc | 3 ++ > .../prog/en/modules/circ/circulation.tt | 3 ++ > .../prog/en/modules/circ/pendingreserves.tt | 6 +++ > .../prog/en/modules/circ/view_holdsqueue.tt | 6 +++ > .../prog/en/modules/members/moremember.tt | 2 + > .../prog/en/modules/reserve/hold-group.tt | 31 ++++++++++++++ > .../prog/en/modules/reserve/request.tt | 15 ++++++- > koha-tmpl/intranet-tmpl/prog/js/hold-group.js | 8 ++++ > koha-tmpl/intranet-tmpl/prog/js/holds.js | 11 +++++ > members/moremember.pl | 4 +- > opac/opac-reserve.pl | 2 +- > reserve/hold-group.pl | 42 +++++++++++++++++++ > reserve/placerequest.pl | 42 ++++++++++++------- > reserve/request.pl | 3 +- > svc/holds | 1 + > t/db_dependent/Koha/Holds.t | 2 +- > 19 files changed, 183 insertions(+), 24 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/hold-group-modal.inc > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/reserve/hold-group.tt > create mode 100644 koha-tmpl/intranet-tmpl/prog/js/hold-group.js > create mode 100755 reserve/hold-group.pl > >diff --git a/circ/circulation.pl b/circ/circulation.pl >index 0a9906028e9..c76154a9c1a 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -598,7 +598,7 @@ if ($patron) { > my $holds = Koha::Holds->search( { borrowernumber => $borrowernumber } ); # FIXME must be Koha::Patron->holds > my $waiting_holds = $holds->waiting; > $template->param( >- holds_count => $holds->count(), >+ holds_count => $holds->count_holds, > WaitingHolds => $waiting_holds, > ); > >diff --git a/circ/view_holdsqueue.pl b/circ/view_holdsqueue.pl >index 7bc73f6da60..4cb5b021ab8 100755 >--- a/circ/view_holdsqueue.pl >+++ b/circ/view_holdsqueue.pl >@@ -55,6 +55,16 @@ if ($run_report) { > locationslimit => $locationslimit > } > ); >+ for my $item (@$items) { >+ my $related_hold = Koha::Holds->search( >+ { >+ borrowernumber => $item->{borrowernumber}, reservedate => $item->{reservedate}, >+ biblionumber => $item->{biblionumber} >+ }, >+ { order_by => 'reservedate' } >+ )->next; >+ $item->{hold_group_id} = $related_hold ? $related_hold->hold_group_id : undef; >+ } > > $template->param( > branchlimit => $branchlimit, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/hold-group-modal.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/hold-group-modal.inc >new file mode 100644 >index 00000000000..8f0f9f7e507 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/hold-group-modal.inc >@@ -0,0 +1,14 @@ >+<div id="hold-group-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="hold-group-modal-label"> >+ <div class="modal-dialog" role="document"> >+ <div class="modal-content"> >+ <div class="modal-header"> >+ <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">Ã</button> >+ <h4 class="modal-title" id="hold-group-modal-label">Hold group</h4> >+ </div> >+ <div class="modal-body"> </div> >+ <div class="modal-footer"> >+ <button type="button" class="btn btn-default deny" data-dismiss="modal">Close</button> >+ </div> </div >+ ><!-- /.modal-content --> </div >+ ><!-- /.modal-dialog --> </div >+><!-- /.modal --> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >index 70ff63bf366..cb98efbccfc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >@@ -260,6 +260,9 @@ > [%- IF hold.non_priority -%] > <br /><i>Non priority hold</i> > [%- END -%] >+ [%- IF hold.hold_group_id -%] >+ <div>(part of a <a href="/cgi-bin/koha/reserve/hold-group.pl?hold_group_id=[% hold.hold_group_id | uri %]" class="hold-group">hold group</a>)</div> >+ [%- END -%] > </td> > [%- IF ( CAN_user_reserveforothers_modify_holds_priority ) -%] > [%- UNLESS hold.found -%] >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 1ca767f7295..3772a99e020 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -1078,6 +1078,8 @@ > [% END %] > [% INCLUDE modals/cancel_booking.inc %] > >+[% INCLUDE 'hold-group-modal.inc' %] >+ > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'datatables.inc' %] > [% INCLUDE 'select2.inc' %] >@@ -1117,6 +1119,7 @@ > [% Asset.js("js/cancel_booking_modal.js") | $raw %] > [% Asset.js("js/combobox.js") | $raw %] > [% INCLUDE 'js-biblio-format.inc' %] >+ [% Asset.js("js/hold-group.js") | $raw %] > <script> > table_settings_issues_table = [% TablesSettings.GetTableSettings( 'circ', 'circulation', 'issues-table', 'json' ) | $raw %] > table_settings_relatives_issues_table = [% TablesSettings.GetTableSettings( 'circ', 'circulation', 'relatives-issues-table', 'json' ) | $raw %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt >index af828b6ec63..9ee928f73f3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt >@@ -109,6 +109,9 @@ > [% ELSE %] > [% IF ( biblio.biblioitem.publicationyear ) %]<p>[% biblio.biblioitem.publicationyear | html %]</p>[% END %] > [% END %] >+ [% IF ( hold.hold_group_id ) %] >+ <p>(part of a <a class="hold-group" href="/cgi-bin/koha/reserve/hold-group.pl?hold_group_id=[% hold.hold_group_id | html %]">hold group</a>)</p> >+ [% END %] > </td> > [% ELSE %] > <td>"</td> >@@ -289,9 +292,12 @@ > </div> > <!-- /.main.container-fluid --> > >+[% INCLUDE 'hold-group-modal.inc' %] >+ > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'calendar.inc' %] > [% INCLUDE 'datatables.inc' %] >+ [% Asset.js("js/hold-group.js") | $raw %] > <script> > function get_options(column){ > let regex = /(<([^>]+)>)/ig; // Remove html tags >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 9eb6e71496b..1715cfbf952 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 >@@ -243,6 +243,9 @@ > > > <em>or any available</em> > [% END %] >+ [% IF itemsloo.hold_group_id %] >+ <div>(part of a <a href="/cgi-bin/koha/reserve/hold-group.pl?hold_group_id=[% itemsloo.hold_group_id | uri %]" class="hold-group">hold group</a>)</div> >+ [% END %] > </td> > <td class="hq-patron"> > <p> [% INCLUDE 'patron-title.inc' invert_name=1 patron=itemsloo.patron hide_patron_infos_if_needed=1 link_to="circulation_reserves" %] </p> >@@ -345,8 +348,11 @@ > </form> > [% END %] > >+[% INCLUDE 'hold-group-modal.inc' %] >+ > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'datatables.inc' %] >+ [% Asset.js("js/hold-group.js") | $raw %] > <script> > $(document).ready(function() { > var holdst; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >index cdb10f8e48b..8f0d7ef36ce 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -757,6 +757,7 @@ > [% END %] > > [% INCLUDE modals/cancel_booking.inc %] >+[% INCLUDE 'hold-group-modal.inc' %] > > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'datatables.inc' %] >@@ -796,6 +797,7 @@ > [% INCLUDE 'str/members-menu.inc' %] > [% Asset.js("js/members-menu.js") | $raw %] > [% Asset.js("js/recalls.js") | $raw %] >+ [% Asset.js("js/hold-group.js") | $raw %] > <script> > const LoadCheckoutsTableDelay = 0; > const AlwaysLoadCheckoutsTable = [% Koha.Preference('AlwaysLoadCheckoutsTable') | html %]; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/hold-group.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/hold-group.tt >new file mode 100644 >index 00000000000..029ef6d0292 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/hold-group.tt >@@ -0,0 +1,31 @@ >+[% INCLUDE 'doc-head-open.inc' %] >+<title>Holds group ([% hold_group.id | html %]) › Holds › Circulation › Koha</title> >+[% INCLUDE 'doc-head-close.inc' %] >+</head> >+<body id="hold-group"> >+<h1>Holds group ([% hold_group.id | html %])</h1> >+<div id="main"> >+ [% holds = hold_group.holds %] >+ [% IF holds.count %] >+ <table> >+ <thead> >+ <tr> >+ <th>Title</th> >+ <th>Priority</th> >+ <th>Notes</th> >+ </tr> >+ </thead> >+ <tbody> >+ [% FOREACH hold IN holds %] >+ [% biblio = hold.biblio %] >+ <tr> >+ <td><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblio.biblionumber | uri %]">[% biblio.title | html %]</a></td> >+ <td>[% hold.priority | html %]</td> >+ <td>[% hold.reservenotes | html %]</td> >+ </tr> >+ [% END %] >+ </tbody> >+ </table> >+ [% END %] >+ [% INCLUDE 'intranet-bottom.inc' %] >+</div> >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 f0e3e2c18c1..b8059b3e7dc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -611,6 +611,14 @@ > <input name="non_priority" id="non_priority" type="checkbox" /> > <span class="hint">A non priority hold doesn't prevent a current checkout from renewing</span> > </li> >+ >+ [% IF ( Koha.Preference('DisplayAddHoldGroups') && ( multi_hold ) ) %] >+ <li id="hold_group_list_item"> >+ <label for="hold_group">Treat as hold group: </label> >+ <input name="hold_group" id="hold_group" type="checkbox" /> >+ <span class="hint">Place a hold on the next available title from this group</span> >+ </li> >+ [% END %] > </ol> > </fieldset> > <fieldset class="rows any_specific"> >@@ -624,7 +632,7 @@ > [% ELSE %] > <input type="radio" id="requestany" name="request" checked="checked" value="Any" /> > [% END %] >- <label for="requestany" class="inline"> Hold next available item </label> >+ <label for="requestany" class="inline"> Hold next available item: </label> > </legend> > <input type="hidden" name="alreadyreserved" value="[% alreadyreserved | html %]" /> > <fieldset class="enable_request_any disable_request_group disable_request_specific"> >@@ -660,7 +668,7 @@ > [% END %] > [% UNLESS remaining_holds_for_record == 1 %] > <li> >- <label for="holds_to_place_count">Holds to place (count)</label> >+ <label for="holds_to_place_count">Holds to place (count): </label> > <input type="text" inputmode="numeric" pattern="[0-9]*" id="holds_to_place_count" name="holds_to_place_count" value="1" /> > </li> > [% ELSE %] >@@ -1420,11 +1428,14 @@ > <form id="hold-actions-form"> [% INCLUDE 'csrf-token.inc' %] </form> > </div> > >+[% INCLUDE 'hold-group-modal.inc' %] >+ > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'datatables.inc' %] > [% INCLUDE 'calendar.inc' %] > [% INCLUDE 'select2.inc' %] > [% Asset.js("js/holds.js") | $raw %] >+ [% Asset.js("js/hold-group.js") | $raw %] > > [% SET url_biblio_params = "biblionumber=" _ biblionumbers.join("&biblionumber=") %] > [% IF multi_hold %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/hold-group.js b/koha-tmpl/intranet-tmpl/prog/js/hold-group.js >new file mode 100644 >index 00000000000..cae322324ad >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/js/hold-group.js >@@ -0,0 +1,8 @@ >+$(document).ready(function () { >+ $("body").on("click", "a.hold-group", function () { >+ var href = $(this).attr("href"); >+ $("#hold-group-modal .modal-body").load(href + " #main"); >+ $("#hold-group-modal").modal("show"); >+ return false; >+ }); >+}); >diff --git a/koha-tmpl/intranet-tmpl/prog/js/holds.js b/koha-tmpl/intranet-tmpl/prog/js/holds.js >index 752e0f5b6ab..256d3fac13c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/holds.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/holds.js >@@ -208,6 +208,17 @@ $(document).ready(function () { > "</span>"; > } > >+ if (oObj.hold_group_id) { >+ title += "<br>"; >+ var link = >+ '<a class="hold-group" href="/cgi-bin/koha/reserve/hold-group.pl?hold_group_id=' + >+ oObj.hold_group_id + >+ '">' + >+ __("part of a hold group") + >+ "</a>"; >+ title += "<span>(" + link + ")</span>"; >+ } >+ > return title; > }, > }, >diff --git a/members/moremember.pl b/members/moremember.pl >index 4a8d789d1f2..bc23c204783 100755 >--- a/members/moremember.pl >+++ b/members/moremember.pl >@@ -210,7 +210,7 @@ if ( $patron->is_expired || $patron->is_going_to_expire ) { > my $holds = Koha::Holds->search( { borrowernumber => $borrowernumber } ); # FIXME must be Koha::Patron->holds > my $waiting_holds = $holds->waiting; > $template->param( >- holds_count => $holds->count(), >+ holds_count => $holds->count_holds, > WaitingHolds => $waiting_holds, > ); > >@@ -294,7 +294,7 @@ my $patron_lists_count = $patron->get_lists_with_patron->count(); > $template->param( > patron => $patron, > issuecount => $patron->checkouts->count, >- holds_count => $patron->holds->count, >+ holds_count => $patron->holds->count_holds, > fines => $patron->account->balance, > translated_language => $translated_language, > detailview => 1, >diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl >index 6db213f2985..316004c3cd0 100755 >--- a/opac/opac-reserve.pl >+++ b/opac/opac-reserve.pl >@@ -162,7 +162,7 @@ $template->param( branch => $branch ); > if ( $op eq 'cud-place_reserve' ) { > my $reserve_cnt = 0; > if ($maxreserves) { >- $reserve_cnt = $patron->holds->count; >+ $reserve_cnt = $patron->holds->count_holds; > } > > # List is composed of alternating biblio/item/branch >diff --git a/reserve/hold-group.pl b/reserve/hold-group.pl >new file mode 100755 >index 00000000000..55d62179f6c >--- /dev/null >+++ b/reserve/hold-group.pl >@@ -0,0 +1,42 @@ >+#!/usr/bin/perl >+ >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+use CGI qw( -utf8 ); >+ >+use C4::Auth qw( get_template_and_user ); >+use C4::Output qw( output_html_with_http_headers ); >+use Koha::HoldGroups; >+ >+my $cgi = CGI->new; >+my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( >+ { >+ template_name => "reserve/hold-group.tt", >+ query => $cgi, >+ type => "intranet", >+ flagsrequired => { circulate => 'circulate_remaining_permissions' }, >+ } >+); >+ >+my $reserve_group_id = $cgi->param('hold_group_id'); >+my $hold_group = Koha::HoldGroups->find($reserve_group_id); >+ >+$template->param( >+ hold_group => $hold_group, >+); >+ >+output_html_with_http_headers $cgi, $cookie, $template->output; >diff --git a/reserve/placerequest.pl b/reserve/placerequest.pl >index 11aa387672e..00e3e3a64b7 100755 >--- a/reserve/placerequest.pl >+++ b/reserve/placerequest.pl >@@ -29,27 +29,30 @@ use C4::Auth qw( checkauth ); > > use Koha::Items; > use Koha::Patrons; >+use Koha::HoldGroup; > > my $input = CGI->new(); > > checkauth( $input, 0, { reserveforothers => 'place_holds' }, 'intranet' ); > >-my @reqbib = $input->multi_param('reqbib'); >-my @biblionumbers = $input->multi_param('biblionumber'); >-my @holdable_bibs = $input->multi_param('holdable_bibs'); >-my $borrowernumber = $input->param('borrowernumber'); >-my $notes = $input->param('notes'); >-my $branch = $input->param('pickup'); >-my $startdate = $input->param('reserve_date') || ''; >-my @rank = $input->multi_param('rank-request'); >-my $title = $input->param('title'); >-my @checkitems = $input->multi_param('checkitem'); >-my $item_group_id = $input->param('item_group_id'); >-my $expirationdate = $input->param('expiration_date'); >-my $itemtype = $input->param('itemtype') || undef; >-my $non_priority = $input->param('non_priority'); >-my $op = $input->param('op') || q{}; >-my $multi_holds = $input->param('multi_holds'); >+my @reqbib = $input->multi_param('reqbib'); >+my @biblionumbers = $input->multi_param('biblionumber'); >+my @holdable_bibs = $input->multi_param('holdable_bibs'); >+my $borrowernumber = $input->param('borrowernumber'); >+my $notes = $input->param('notes'); >+my $branch = $input->param('pickup'); >+my $startdate = $input->param('reserve_date') || ''; >+my @rank = $input->multi_param('rank-request'); >+my $title = $input->param('title'); >+my @checkitems = $input->multi_param('checkitem'); >+my $item_group_id = $input->param('item_group_id'); >+my $expirationdate = $input->param('expiration_date'); >+my $itemtype = $input->param('itemtype') || undef; >+my $non_priority = $input->param('non_priority'); >+my $op = $input->param('op') || q{}; >+my $multi_holds = $input->param('multi_holds'); >+my $hold_group_param = $input->param('hold_group') || undef; >+my $hold_group; > > my $patron = Koha::Patrons->find($borrowernumber); > >@@ -66,6 +69,10 @@ foreach my $bibnum (@holdable_bibs) { > > if ( $op eq 'cud-placerequest' && $patron ) { > my %failed_holds; >+ if ($hold_group_param) { >+ $hold_group = Koha::HoldGroup->new->store; >+ } >+ > foreach my $biblionumber ( keys %bibinfos ) { > > my $can_override = C4::Context->preference('AllowHoldPolicyOverride'); >@@ -102,6 +109,7 @@ if ( $op eq 'cud-placerequest' && $patron ) { > found => undef, > itemtype => $itemtype, > non_priority => $non_priority, >+ hold_group_id => $hold_group ? $hold_group->id : undef, > } > ); > >@@ -130,6 +138,7 @@ if ( $op eq 'cud-placerequest' && $patron ) { > found => undef, > itemtype => $itemtype, > non_priority => $non_priority, >+ hold_group_id => $hold_group ? $hold_group->id : undef, > } > ); > } >@@ -153,6 +162,7 @@ if ( $op eq 'cud-placerequest' && $patron ) { > itemtype => $itemtype, > non_priority => $non_priority, > item_group_id => $item_group_id, >+ hold_group_id => $hold_group ? $hold_group->id : undef, > } > ); > } >diff --git a/reserve/request.pl b/reserve/request.pl >index 64b2809f205..a7cb09c114d 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -189,7 +189,7 @@ if ( $borrowernumber_hold && !$op ) { > # we check the reserves of the user, and if they can reserve a document > # FIXME At this time we have a simple count of reservs, but, later, we could improve the infos "title" ... > >- my $reserves_count = $patron->holds->count; >+ my $reserves_count = $patron->holds->count_holds; > > my $new_reserves_count = scalar(@biblionumbers); > >@@ -677,6 +677,7 @@ if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold ) > $reserve{branchcode} = $res->branchcode(); > $reserve{non_priority} = $res->non_priority(); > $reserve{object} = $res; >+ $reserve{hold_group_id} = $res->hold_group_id; > > if ( $holds_count_per_patron->{ $reserve{'borrowernumber'} } == 1 ) { > $reserve{'change_hold_type_allowed'} = 1; >diff --git a/svc/holds b/svc/holds >index aa00ab3f803..8dc9c75cd03 100755 >--- a/svc/holds >+++ b/svc/holds >@@ -113,6 +113,7 @@ while ( my $h = $holds_rs->next() ) { > priority => $h->priority(), > reservenotes => $h->reservenotes(), > itemtype_limit => $itemtype_limit, >+ hold_group_id => $h->hold_group_id, > reservedate_formatted => $h->reservedate() > ? output_pref( { dt => dt_from_string( $h->reservedate() ), dateonly => 1 } ) > : q{}, >diff --git a/t/db_dependent/Koha/Holds.t b/t/db_dependent/Koha/Holds.t >index 007d90656a4..abf62a314b7 100755 >--- a/t/db_dependent/Koha/Holds.t >+++ b/t/db_dependent/Koha/Holds.t >@@ -20,7 +20,7 @@ > use Modern::Perl; > > use Test::NoWarnings; >-use Test::More tests => 13; >+use Test::More tests => 14; > use Test::Warn; > > use C4::Circulation qw( AddIssue ); >-- >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 15516
:
46392
|
47498
|
47570
|
47961
|
47962
|
47963
|
48097
|
48098
|
48448
|
48449
|
50094
|
50095
|
50096
|
53742
|
53743
|
53744
|
53770
|
53771
|
53772
|
53774
|
53775
|
53776
|
54977
|
55300
|
55304
|
55305
|
55306
|
55307
|
55308
|
55768
|
55769
|
55770
|
55771
|
55772
|
58799
|
58800
|
58801
|
58802
|
58803
|
59314
|
59315
|
59316
|
59317
|
59318
|
69902
|
69903
|
69904
|
69905
|
69906
|
72485
|
72486
|
72487
|
72488
|
72489
|
72491
|
79077
|
79078
|
79080
|
79081
|
79082
|
79083
|
79213
|
79214
|
79215
|
79216
|
79217
|
79218
|
79219
|
79220
|
79221
|
79222
|
81453
|
81454
|
81455
|
81456
|
81457
|
81458
|
81459
|
81460
|
81461
|
81462
|
81463
|
84554
|
84555
|
84556
|
84557
|
84558
|
84559
|
84560
|
84561
|
84562
|
84563
|
84564
|
87828
|
87829
|
87830
|
87831
|
87832
|
87833
|
87834
|
87835
|
87836
|
87837
|
87838
|
88038
|
88039
|
88125
|
88173
|
88174
|
88175
|
88176
|
88177
|
88178
|
88179
|
88180
|
88181
|
88182
|
88183
|
88184
|
88185
|
88186
|
90289
|
90290
|
90291
|
90292
|
90293
|
90294
|
90295
|
90296
|
90297
|
90298
|
90299
|
90300
|
90301
|
90302
|
90303
|
90829
|
90830
|
90831
|
90832
|
90833
|
90834
|
90835
|
90836
|
90837
|
90838
|
90839
|
90840
|
90841
|
90842
|
90843
|
90844
|
92783
|
92784
|
92785
|
92786
|
92787
|
92788
|
92789
|
92790
|
92791
|
92792
|
92793
|
92794
|
92795
|
92796
|
92797
|
92798
|
114513
|
114514
|
114515
|
114516
|
114517
|
114518
|
114585
|
114586
|
114603
|
114624
|
114625
|
114626
|
114627
|
114628
|
114629
|
114630
|
114631
|
114632
|
114633
|
114634
|
114635
|
114636
|
114637
|
114638
|
114639
|
114640
|
114641
|
114642
|
114643
|
114644
|
114645
|
114647
|
114648
|
114649
|
114650
|
114651
|
114652
|
114653
|
114654
|
114655
|
114656
|
114657
|
114658
|
114659
|
117423
|
117424
|
117425
|
117426
|
118281
|
118282
|
118283
|
118284
|
118285
|
118286
|
118350
|
118351
|
118352
|
118353
|
118354
|
118355
|
120368
|
120369
|
120370
|
120371
|
120372
|
120373
|
120574
|
120643
|
120644
|
120645
|
120646
|
120647
|
120648
|
120649
|
120650
|
120651
|
121523
|
121623
|
122097
|
122102
|
122627
|
128189
|
128190
|
128191
|
128192
|
128193
|
128194
|
128195
|
128196
|
128197
|
128198
|
128199
|
128200
|
128201
|
128202
|
128255
|
128256
|
128257
|
128258
|
128259
|
128260
|
128261
|
128262
|
128263
|
128264
|
128265
|
128266
|
128267
|
128268
|
128269
|
128285
|
128286
|
128287
|
128288
|
128289
|
128290
|
128291
|
128292
|
128293
|
128294
|
128295
|
128296
|
128297
|
128298
|
128299
|
138576
|
138577
|
138578
|
138579
|
138580
|
138581
|
138582
|
138583
|
138584
|
138585
|
138586
|
138587
|
138588
|
138589
|
138593
|
138594
|
138595
|
138596
|
138597
|
138738
|
138739
|
138740
|
138741
|
138742
|
138772
|
138868
|
138869
|
162076
|
162077
|
162078
|
162079
|
162080
|
162081
|
162082
|
162083
|
162084
|
183876
|
183877
|
183878
|
183879
|
183880
|
183915
|
184047
|
184048
|
184050
|
184051
|
184052
|
184053
|
184054
|
184055
|
184056
|
184057
|
184058
|
184066
|
184530
|
184534
|
185135
|
185456
|
185457
|
185458
| 185459 |
185460
|
185461
|
185462
|
185463
|
185464
|
185465
|
185466
|
185492
|
185509