Bugzilla – Attachment 184867 Details for
Bug 40552
Allow selecting all holds from a group
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40552: Allow selecting all holds from a group
Bug-40552-Allow-selecting-all-holds-from-a-group.patch (text/plain), 3.70 KB, created by
Pedro Amorim
on 2025-07-30 11:56:11 UTC
(
hide
)
Description:
Bug 40552: Allow selecting all holds from a group
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2025-07-30 11:56:11 UTC
Size:
3.70 KB
patch
obsolete
>From f3e627115961101358962dc1c636c2477f2e2261 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@openfifth.co.uk> >Date: Wed, 30 Jul 2025 11:32:58 +0000 >Subject: [PATCH] Bug 40552: Allow selecting all holds from a group > >Test plan, k-t-d, patches applied: >1) Search for 'music': >http://localhost:8081/cgi-bin/koha/catalogue/search.pl?q=music >2) Click the 'Select all' link on the left of the search toolbar >3) Click the 'Place hold' button on the same toolbar >4) On the patron input, add 'koha' >5) You need to pick the 'Pickup location' specifically for each hold. Click 'Place holds' >6) Now visit the patron details page: >http://localhost:8081/cgi-bin/koha/members/moremember.pl?borrowernumber=51 >7) Click the 'Holds' tab. >8) Test that selecting the hold group number opens the hold group modal and a new 'select group holds' buttons exist. >9) Click that button, ensure it selects the group holds. Test with more holds, more groups, unselecting all beforehand, selecting all beforehand, etc. >--- > .../prog/en/modules/reserve/hold-group.tt | 2 +- > koha-tmpl/intranet-tmpl/prog/js/hold-group.js | 32 +++++++++++++++++++ > 2 files changed, 33 insertions(+), 1 deletion(-) > >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 >index 09d7b4a32d3..d0739a9b7ae 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/hold-group.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/hold-group.tt >@@ -20,7 +20,7 @@ > [% biblio = hold.biblio %] > <tr> > <td> >- <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblio.biblionumber | uri %]"> [% biblio.title | html %] </a> >+ <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblio.biblionumber | uri %]" data-hold-id="[% hold.reserve_id | uri %]" class="hold-group-entry"> [% biblio.title | html %] </a> > [% IF (hold.is_hold_group_target) %] > <br /><span class="fw-bold fst-italic">(target of hold group)</span> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/hold-group.js b/koha-tmpl/intranet-tmpl/prog/js/hold-group.js >index cae322324ad..60320ae22ab 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/hold-group.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/hold-group.js >@@ -3,6 +3,38 @@ $(document).ready(function () { > var href = $(this).attr("href"); > $("#hold-group-modal .modal-body").load(href + " #main"); > $("#hold-group-modal").modal("show"); >+ if (holds_table_patron_page()) { >+ append_select_group_holds_button(); >+ } > return false; > }); >+ $("body").on("click", "button#select-group-holds", function () { >+ let group_hold_ids = $(".hold-group-entry") >+ .map(function () { >+ return $(this).data("hold-id"); >+ }) >+ .get(); >+ >+ $(".select_hold").each(function () { >+ var $this = $(this); >+ if ( >+ group_hold_ids.includes($this.data("id")) !== >+ $this.prop("checked") >+ ) { >+ $this.click(); >+ } >+ }); >+ }); >+ >+ function append_select_group_holds_button() { >+ var button = document.createElement("button"); >+ button.type = "button"; >+ button.className = "btn btn-primary"; >+ button.id = "select-group-holds"; >+ button.dataset.bsDismiss = "modal"; >+ button.innerHTML = _("Select group holds"); >+ if (!$("#select-group-holds").length) { >+ $("#hold-group-modal .modal-footer").prepend(button); >+ } >+ } > }); >-- >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 40552
:
184866
| 184867