Bug 41956: Display hold_group_id

Test plan:
1) Enable DisplayAddHoldGroups sys pref
2) Place two title-level holds for the same patron on two different biblios.
3) Group them via the patron's holds page. Note the hold_group_id shown in the table and the URL when you click through to the group page (e.g. hold_group_id=42).
4) Create a second hold group for the same patron with two more holds. Confirm the hold_group_id is shown instead of the previous visual_hold_group_id.
5) Go to Circulation > Holds to pull (/cgi-bin/koha/circ/pendingreserves.pl). Confirm each grouped hold shows 'Hold group 42' as a clickable link, not
   the old 'part of a hold group' text.
6) Go to Circulation > Holds queue (/cgi-bin/koha/circ/view_holdsqueue.pl). Confirm the same — 'Hold group 42' link visible beneath the title.
7) Log in to the OPAC as that patron, go to 'Your summary' > 'Holds' tab. Confirm the 'Hold group' column shows 42.
8) Cancel one hold from the group. Confirm the group still appears on the patron's 'Holds' tab (one hold remains).
9) Cancel the last hold in the group. Confirm the no holds of the group and the group no longer appear on the patron's 'Holds' tab. Check holds history on the Staff UI:
(/cgi-bin/koha/members/holdshistory.pl?borrowernumber=NNN) — both cancelled holds should still show 42 in the 'Hold group ID' column.

Run tests:
prove t/db_dependent/Reserves/HoldGroup.t
prove t/db_dependent/Koha/Hold.t
prove t/db_dependent/Koha/Patron.t
prove t/db_dependent/api/v1/patrons_hold_groups.t
prove t/db_dependent/api/v1/holds.t
prove t/db_dependent/api/v1/patrons_holds.t

Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Pedro Amorim 2026-04-23 10:39:56 +00:00 committed by Lucas Gass
parent 5d716d1e28
commit 209796ec0b
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
5 changed files with 9 additions and 10 deletions

View File

@ -110,7 +110,7 @@
[% 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>
<p>(<a class="hold-group" href="/cgi-bin/koha/reserve/hold-group.pl?hold_group_id=[% hold.hold_group_id | html %]">Hold group [% hold.hold_group_id | html %]</a>)</p>
[% END %]
</td>
[% ELSE %]

View File

@ -222,7 +222,7 @@
<p> [% INCLUDE 'biblio-title.inc' biblio=itemsloo.biblio link = 1 %] </p>
<div class="hq-biblionumber content_hidden">[% itemsloo.biblionumber | html %]</div>
[% IF ( itemsloo.hold_group_id ) %]
<p>(part of a <a class="hold-group" href="/cgi-bin/koha/reserve/hold-group.pl?hold_group_id=[% itemsloo.hold_group_id | html %]">hold group</a>)</p>
<p>(<a class="hold-group" href="/cgi-bin/koha/reserve/hold-group.pl?hold_group_id=[% itemsloo.hold_group_id | html %]">Hold group [% itemsloo.hold_group_id | html %]</a>)</p>
[% END %]
</td>
<td class="hq-author">[% itemsloo.biblio.author | html %]</td>

View File

@ -83,6 +83,9 @@
<thead>
<tr>
<th data-colname="title" class="anti-the">Title</th>
[% IF Koha.Preference('DisplayAddHoldGroups') %]
<th data-colname="hold_group_id">Hold group ID</th>
[% END %]
<th data-colname="author">Author</th>
<th data-colname="barcode">Barcode</th>
<th data-colname="itemcallnumber">Call number</th>

View File

@ -182,12 +182,12 @@ $(document).ready(function () {
{
data: function (oObj) {
title = "";
if (oObj.visual_hold_group_id) {
if (oObj.hold_group_id) {
var link =
'<a class="hold-group" href="/cgi-bin/koha/reserve/hold-group.pl?hold_group_id=' +
oObj.hold_group_id +
'">' +
oObj.visual_hold_group_id +
oObj.hold_group_id +
"</a>";
title =
@ -1629,7 +1629,7 @@ async function load_patron_holds_table(biblio_id, split_data) {
searchable: false,
render: function (data, type, row, meta) {
const group_hold_message = row.hold_group_id
? `<div>(${__("part of")} <a href="/cgi-bin/koha/reserve/hold-group.pl?hold_group_id=${row.hold_group_id}" class="hold-group">${__("hold group")}</a>)</div>`
? `<div>(<a href="/cgi-bin/koha/reserve/hold-group.pl?hold_group_id=${row.hold_group_id}" class="hold-group">${__("Hold group")} ${row.hold_group_id}</a>)</div>`
: "";
// Handle status cases

View File

@ -89,11 +89,7 @@
[% END %]
</td>
[% IF Koha.Preference('DisplayAddHoldGroups') %]
[% IF HOLD.hold_group %]
<td class="visual_hold_group_id"> [% HOLD.hold_group.visual_hold_group_id | html %] </td>
[% ELSE %]
<td class="visual_hold_group_id"></td>
[% END %]
<td class="hold_group_id">[% HOLD.hold_group_id | html %]</td>
[% END %]
<td class="reservedate" data-order="[% HOLD.reservedate | html %]"> [% HOLD.reservedate | $KohaDates %] </td>
<td class="expirationdate" data-order="[% !HOLD.found ? HOLD.expirationdate : '0000-00-00' | html %]">