Bugzilla – Attachment 169523 Details for
Bug 37351
Checkboxes on waiting holds report are not kept when switching to another page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37351: Rework checkbox JS to work with paginating dataTable
Bug-37351-Rework-checkbox-JS-to-work-with-paginati.patch (text/plain), 6.19 KB, created by
Lucas Gass (lukeg)
on 2024-07-24 22:48:08 UTC
(
hide
)
Description:
Bug 37351: Rework checkbox JS to work with paginating dataTable
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2024-07-24 22:48:08 UTC
Size:
6.19 KB
patch
obsolete
>From d911697ce7c07d063fad9c55982f6cd9af9222d1 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Wed, 24 Jul 2024 22:44:05 +0000 >Subject: [PATCH] Bug 37351: Rework checkbox JS to work with paginating > dataTable > >To Test: > >1. Log in to staff client >2. Place items on items for borrowers > 2-1 Place enough holds as noted above > 2-2 Trap holds for borrowers >3. Open Circulation->Holds Awaiting Pickup (circ/waitingreserves.pl) >4. Click a checkbox for one or mroe holds > Note->The 'Cancel selected (0)' button changes to 'Cancel > selected (1)', etc. >5. Cancel selected Holds using the (Cancel selected (#) button) >6. Confirm Cancellation >7. Wait for background processes to complete, then verify holds are cancelled. >8. Return to Open Circulation->Holds Awaiting Pickup (circ/waitingreserves.pl) >9. Ensure button shows "Cancel selected (0)" >10. Click "Next >" to navigate to page 2 of holds >11. Click a checkbox for one or more holds > Note->The 'Cancel selected (0)' button DOES NOT increase as boxes > are selected. >12. Cancel selected Holds using the (Cancel selected (#) button) >13. Confirm Cancellation >14. Wait for background processes to complete, then verify holds are cancelled. > Note-> Holds were not cancelled > >15. APPLY PATCH >16. Try step 9-14 again. This time the 'Cancel selected (0)' button should update even when you paginate. >17. Make sure you try all the tables, Holds waiting, Holds waiting over X, Holds with cancellation requests. >--- > .../prog/en/modules/circ/waitingreserves.tt | 56 ++++++++++--------- > 1 file changed, 29 insertions(+), 27 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt >index 3af7bf9861..317950074a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt >@@ -265,39 +265,41 @@ > }); > > $('.holds_table').each(function() { >- var table = $(this); >- var parent = table.parents('.tab-pane'); >- >- $('.holds_table .select_hold_all', parent).each(function() { >- var count = $('.select_hold:not(:checked)', table).length; >- $('.select_hold_all', table).prop('checked', !count); >- }); >- >- $('.cancel_selected_holds', parent).html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked', parent).length)); >- >- $('.holds_table .select_hold_all', parent).click(function() { >- var count = $('.select_hold:checked', table).length; >- $('.select_hold', table).prop('checked', !count); >- $(this).prop('checked', !count); >- $('.cancel_selected_holds', parent).data('ids', $('.holds_table .select_hold:checked', parent).toArray().map(el => $(el).data('id'))).html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked', parent).length)); >- localStorage.selectedWaitingHolds = JSON.stringify($('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id'))); >- }); >- >- $('.holds_table .select_hold', parent).click(function() { >- var count = $('.select_hold:not(:checked)', table).length; >- $('.select_hold_all', table).prop('checked', !count); >- $('.cancel_selected_holds', parent).data('ids', $('.holds_table .select_hold:checked', parent).toArray().map(el => $(el).data('id'))).html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked', parent).length)); >- localStorage.selectedWaitingHolds = JSON.stringify($('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id'))); >- }); >- >- $('.cancel_selected_holds', parent).click(function(e) { >+ var table = $(this); >+ var parent = table.parents('.tab-pane'); >+ var this_dt = $(this).closest('.holds_table').dataTable(); >+ parent.find('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format(this_dt.$(".select_hold:checked", {"page": "all"}).length)); >+ parent.find('.cancel_selected_holds').click(function(e) { > e.preventDefault(); > if($('.select_hold:checked', table).length) { > cancel_link = $(this); > $('#cancelModal').modal(); > } > return false; >- }); >+ }); >+ }); >+ >+ $('.holds_table').on('click', '.select_hold_all', function() { >+ var table = $(this); >+ var parent = table.parents('.tab-pane'); >+ var this_dt = $(this).closest('.holds_table').dataTable(); >+ var all_pages = this_dt.fnGetNodes(); >+ >+ var all_checked = this_dt.find('.select_hold_all').prop('checked'); >+ this_dt.find('.select_hold' , all_pages).prop('checked', all_checked); >+ >+ var count = this_dt.$(".select_hold:checked", {"page": "all"}).length; >+ parent.find('.cancel_selected_holds').data('ids', this_dt.$(".select_hold:checked", {"page": "all"}).toArray().map(el => $(el).data('id'))).html(MSG_CANCEL_SELECTED.format(count)); >+ localStorage.selectedWaitingHolds = JSON.stringify(this_dt.$(".select_hold:checked", {"page": "all"}).toArray().map(el => $(el).data('id'))); >+ }); >+ >+ $('.holds_table').on('click', '.select_hold', function() { >+ var table = $(this); >+ var parent = table.parents('.tab-pane'); >+ var this_dt = $(this).closest('.holds_table').dataTable(); >+ var count = this_dt.$(".select_hold:checked", {"page": "all"}).length; >+ parent.find('.cancel_selected_holds').data('ids', this_dt.$(".select_hold:checked", {"page": "all"}).toArray().map(el => $(el).data('id'))).html(MSG_CANCEL_SELECTED.format(count)); >+ localStorage.selectedWaitingHolds = JSON.stringify(this_dt.$(".select_hold:checked", {"page": "all"}).toArray().map(el => $(el).data('id'))); > }); > > var activeTab = localStorage.getItem("waitingreserves_activetab"); >-- >2.39.2
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 37351
:
169523
|
169524
|
169597
|
169613
|
169614
|
169715