Bugzilla – Attachment 184645 Details for
Bug 40517
Allow grouping existing holds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40517: Patron page holds table buttons rearrangement
Bug-40517-Patron-page-holds-table-buttons-rearrang.patch (text/plain), 8.12 KB, created by
Pedro Amorim
on 2025-07-25 14:38:43 UTC
(
hide
)
Description:
Bug 40517: Patron page holds table buttons rearrangement
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2025-07-25 14:38:43 UTC
Size:
8.12 KB
patch
obsolete
>From 6fd181084df7bf362ac5df1f6d2c84c0abef85d5 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@openfifth.co.uk> >Date: Fri, 18 Jul 2025 16:09:52 +0000 >Subject: [PATCH] Bug 40517: Patron page holds table buttons rearrangement > >This table now has 4 total buttons, 3 of which relate to a selection of >holds. Rearranging the buttons is now necessary to present them nicely. >--- > .../prog/en/includes/patron-detail-tabs.inc | 34 +++++++-------- > .../prog/en/modules/reserve/request.tt | 2 +- > koha-tmpl/intranet-tmpl/prog/js/holds.js | 42 +++++++------------ > 3 files changed, 31 insertions(+), 47 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-detail-tabs.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-detail-tabs.inc >index 97f403594b9..8ed4dd2802e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-detail-tabs.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-detail-tabs.inc >@@ -168,36 +168,32 @@ > </tr> > </thead> > </table> >- >- <fieldset class="action"> >- <button class="btn btn-primary cancel_selected_holds" data-bulk="true"></button> >- </fieldset> > </form> > > [% PROCESS 'cancel-hold-modal' form_action = '/cgi-bin/koha/reserve/modrequest.pl' from_param = patronpage %] > [% PROCESS 'suspend-hold-modal' %] > [% PROCESS 'group-hold-modal' %] >- [% IF Koha.Preference('DisplayAddHoldGroups') %] >- <fieldset class="action"> >- <button class="btn btn-primary group_selected_holds" data-bulk="true"></button> >- </fieldset> >- [% END # IF DisplayAddHoldGroups %] >- >+ <fieldset class="action"> >+ <span class="me-2"><span class="badge text-bg-info selected_holds_count"></span> holds selected</span> >+ <button class="btn btn-default cancel_selected_holds" data-bulk="true"><i class="fa fa-trash"></i> Cancel selected</button> >+ [% IF Koha.Preference('SuspendHoldsIntranet') %] >+ <button class="btn btn-default suspend_selected_holds" data-bulk="true"><i class="fa fa-pause"></i> Suspend selected</button> >+ [% END # IF SuspendHoldsIntranet %] >+ [% IF Koha.Preference('DisplayAddHoldGroups') %] >+ <button class="btn btn-default group_selected_holds" data-bulk="true"><i class="fa fa-layer-group"></i> Group selected</button> >+ [% END # IF DisplayAddHoldGroups %] >+ </fieldset> > [% IF Koha.Preference('SuspendHoldsIntranet') %] > <fieldset class="action"> >- <button class="btn btn-primary suspend_selected_holds" data-bulk="true"></button> >- </fieldset> >- >- <form action="/cgi-bin/koha/reserve/modrequest_suspendall.pl" method="post"> >- [% INCLUDE 'csrf-token.inc' %] >- <fieldset class="action"> >+ <form action="/cgi-bin/koha/reserve/modrequest_suspendall.pl" method="post"> >+ [% INCLUDE 'csrf-token.inc' %] > <input type="hidden" name="op" value="cud-unsuspendall" /> > <input type="hidden" name="from" value="borrower" /> > <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" /> > <input type="hidden" name="suspend" value="0" /> >- <input type="submit" class="btn btn-primary" value="Resume all suspended holds" /> >- </fieldset> >- </form> >+ <button type="submit" class="btn btn-default"><i class="fa fa-play"></i> Resume all suspended holds</button> >+ </form> >+ </fieldset> > [% END # IF SuspendHoldsIntranet %] > [% ELSE %] > <p>Patron has nothing on hold.</p> >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 8975174eea0..25fa0a88ef4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -1237,7 +1237,7 @@ > <input type="submit" class="btn btn-primary" name="submit" value="Update hold(s)" /> > </div> > <div class="btn-group"> >- <button class="btn cancel_selected_holds" data-bulk="true"></button> >+ <button class="btn cancel_selected_holds" data-bulk="true"> Cancel selected (<span class="selected_holds_count"></span>)</button> > </div> > <fieldset id="cancellation-reason-fieldset" class="action" style="display:none"> > [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/holds.js b/koha-tmpl/intranet-tmpl/prog/js/holds.js >index 6f671d91916..24883d040e7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/holds.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/holds.js >@@ -699,13 +699,7 @@ $(document).ready(function () { > return toggle_suspend(this, inputs); > }); > >- var MSG_SUSPEND_SELECTED = _("Suspend selected (%s)"); > var MSG_SUSPEND_SELECTED_HOLDS = _("selected holds"); >- $(".suspend_selected_holds").html( >- MSG_SUSPEND_SELECTED.format( >- $(".holds_table .select_hold:checked").length >- ) >- ); > > $(".suspend_selected_holds").click(function (e) { > e.preventDefault(); >@@ -729,7 +723,6 @@ $(document).ready(function () { > return toggle_suspend(this, inputs); > }); > >- var MSG_CANCEL_SELECTED = _("Cancel selected (%s)"); > var MSG_CANCEL_ALERT = _( > "This action will cancel <span class='badge bg-danger'>%s</span> hold(s)." > ); >@@ -789,24 +782,23 @@ $(document).ready(function () { > }); > } > >- var MSG_GROUP_SELECTED = _("Group selected (%s)"); >- > function updateSelectedHoldsButtonCounters() { >- $(".cancel_selected_holds").html( >- MSG_CANCEL_SELECTED.format( >- $(".holds_table .select_hold:checked").length >- ) >- ); >- $(".suspend_selected_holds").html( >- MSG_SUSPEND_SELECTED.format( >- $(".holds_table .select_hold:checked").length >- ) >- ); >- $(".group_selected_holds").html( >- MSG_GROUP_SELECTED.format( >- $(".holds_table .select_hold:checked").length >- ) >+ $(".selected_holds_count").html( >+ $(".holds_table .select_hold:checked").length > ); >+ if (patron_page) { >+ if ($(".holds_table .select_hold:checked").length == 0) { >+ $(".cancel_selected_holds").prop("disabled", true); >+ $(".suspend_selected_holds").prop("disabled", true); >+ $(".group_selected_holds").prop("disabled", true); >+ } else { >+ if ($(".holds_table .select_hold:checked").length >= 2) { >+ $(".group_selected_holds").prop("disabled", false); >+ } >+ $(".suspend_selected_holds").prop("disabled", false); >+ $(".cancel_selected_holds").prop("disabled", false); >+ } >+ } > } > > updateSelectedHoldsButtonCounters(); >@@ -938,10 +930,6 @@ $(document).ready(function () { > ); > } > >- $(".group_selected_holds").html( >- MSG_GROUP_SELECTED.format($(".holds_table .select_hold:checked").length) >- ); >- > $(".group_selected_holds").click(function (e) { > if ($(".holds_table .select_hold:checked").length > 1) { > let selected_holds = get_selected_holds_data(); >-- >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 40517
:
184640
|
184641
|
184642
|
184643
|
184644
| 184645 |
184646