Bugzilla – Attachment 192942 Details for
Bug 23269
Long hold queues are slowing the service
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23269: (follow-up) Add spinner and fix details column
Bug-23269-follow-up-Add-spinner-and-fix-details-co.patch (text/plain), 8.86 KB, created by
Nick Clemens (kidclamp)
on 2026-02-10 19:35:56 UTC
(
hide
)
Description:
Bug 23269: (follow-up) Add spinner and fix details column
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2026-02-10 19:35:56 UTC
Size:
8.86 KB
patch
obsolete
>From 80d014d843ea289f88783d7a94ce6f0cf15dd6f1 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Johanna=20R=C3=A4is=C3=A4?= <johanna.raisa@gmail.com> >Date: Tue, 10 Feb 2026 08:55:45 +0200 >Subject: [PATCH] Bug 23269: (follow-up) Add spinner and fix details column > >This patch adds a spinner to moving priorities and fixes the details column to show the correct information. > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > koha-tmpl/intranet-tmpl/prog/js/holds.js | 116 ++++++++--------------- > 1 file changed, 41 insertions(+), 75 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/holds.js b/koha-tmpl/intranet-tmpl/prog/js/holds.js >index 78ca8161191..ad17dd3a2e4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/holds.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/holds.js >@@ -791,14 +791,6 @@ $(document).ready(function () { > } > }); > >- // if (!patron_page) { >- // $(".holds_table .select_hold_all").each(function () { >- // var table = $(this).parents(".holds_table"); >- // var count = $(".select_hold:not(:checked)", table).length; >- // $(".select_hold_all", table).prop("checked", !count); >- // }); >- // } >- > function updateSelectedHoldsButtonCounters() { > $(".move_selected_holds").html( > MSG_MOVE_SELECTED.format( >@@ -1639,79 +1631,47 @@ async function load_patron_holds_table(biblio_id, split_data) { > orderable: false, > 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>` >+ : ""; >+ >+ // Handle status cases > if (row.status) { >- return ( >- '<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=' + >- row.biblio_id + >- "&itemnumber=" + >- row.item_id + >- '">' + >- row.item.external_id + >- "</a>" >- ); >- } else if (row.item_id && row.item_level) { >- let barcode = row.item.external_id >- ? row.item.external_id >- : __("No barcode"); >+ return `<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=${row.biblio_id}&itemnumber=${row.item_id}">${row.item.external_id}</a>${group_hold_message}`; >+ } >+ >+ // Handle item level holds >+ if (row.item_level_holds) { >+ const barcode = >+ row.item.external_id || __("No barcode"); >+ const itemLink = `<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=${row.biblio_id}&itemnumber=${row.item_id}">${barcode.escapeHtml ? barcode.escapeHtml() : barcode}</a>`; >+ > if (row.item_level_holds >= 2) { >- let link = >- '<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=' + >- row.biblio_id + >- "&itemnumber=" + >- row.item_id + >- '">' + >- (row.item.external_id >- ? row.item.external_id.escapeHtml() >- : __("No barcode")) + >- "</a>"; >- return __("Only item") + " " + link; >- } else { >- let select = >- '<select id="change_hold_type" class="change_hold_type ' + >- table_class + >- '" data-id="' + >- row.hold_id + >- '">'; >- select += >- '<option value="" selected>' + >- __("Only item") + >- " " + >- barcode + >- "</option>"; >- select += >- '<option value="">' + >- __("Next available") + >- "</option>"; >- select += "</select>"; >- return select; >+ return `${__("Only item")} ${itemLink}${group_hold_message}`; > } >- } else if (row.item_group_id) { >- return __( >- "Next available item from group <strong>%s</strong>" >- ).format(row.item_group.description); >- } else if (row.hold_group_id) { >+ >+ return `<select id="change_hold_type" class="change_hold_type ${table_class}" data-id="${row.hold_id}"> >+ <option value="" selected>${__("Only item")} ${barcode}</option> >+ <option value="">${__("Next available")}</option> >+ </select>${group_hold_message}`; >+ } >+ >+ // Handle item group >+ if (row.item_group_id) { > return ( >- "<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>" >+ __( >+ "Next available item from group <strong>%s</strong>" >+ ).format(row.item_group.description) + >+ group_hold_message > ); >- } else { >- if (row.non_priority) { >- return ( >- "<em>" + >- __("Next available") + >- "</em><br/><i>" + >- __("Non priority hold") + >- "</i>" >- ); >- } else { >- return "<em>" + __("Next available") + "</em>"; >- } > } >+ >+ // Default: Next available >+ let message = __("Next available"); >+ if (row.non_priority) { >+ message += `<br/><i>${__("Non priority hold")}</i>`; >+ } >+ return message + group_hold_message; > }, > }, > { >@@ -2297,6 +2257,9 @@ async function load_patron_holds_table(biblio_id, split_data) { > let priority = $(this).attr("data-priority"); > var res_id = $(this).attr("reserve_id"); > var moveTo; >+ const $spinner = $( >+ '<img class="rank-spinner" src="/intranet-tmpl/prog/img/spinner-small.gif" alt="Loading..." style="display:block;margin:0 auto;vertical-align:middle;">' >+ ); > if (toPosition == "up") { > moveTo = parseInt(priority) - 1; > } >@@ -2309,15 +2272,18 @@ async function load_patron_holds_table(biblio_id, split_data) { > if (toPosition == "bottom") { > moveTo = totalHolds; > } >+ $(this).parent().html($spinner); > $.ajax({ > method: "PUT", > url: > "/api/v1/holds/" + encodeURIComponent(res_id) + "/priority", > data: JSON.stringify(moveTo), > success: function (data) { >+ $spinner.remove(); > holdsQueueTable.api().ajax.reload(null, false); > }, > error: function (jqXHR, textStatus, errorThrown) { >+ $spinner.remove(); > alert( > "There was an error:" + textStatus + " " + errorThrown > ); >-- >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 23269
:
173770
|
176705
|
177151
|
181244
|
181247
|
182728
|
182729
|
182730
|
182754
|
182755
|
182756
|
182757
|
191638
|
191669
|
191670
|
192821
|
192849
|
192850
|
192851
|
192939
|
192940
|
192941
|
192942
|
192943
|
193100
|
193101
|
193102
|
193103
|
193104
|
193198
|
193199
|
193200
|
193201
|
193219
|
193336