Bugzilla – Attachment 134205 Details for
Bug 30628
Batch borrower modifications only affect the current page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30628: Fix patron selection in batch patron modification tool
Bug-30628-Fix-patron-selection-in-batch-patron-mod.patch (text/plain), 2.53 KB, created by
Jonathan Druart
on 2022-04-28 08:35:24 UTC
(
hide
)
Description:
Bug 30628: Fix patron selection in batch patron modification tool
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-04-28 08:35:24 UTC
Size:
2.53 KB
patch
obsolete
>From 6750069a4038f5cd455953305ad3bce44885fee9 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 28 Apr 2022 10:32:28 +0200 >Subject: [PATCH] Bug 30628: Fix patron selection in batch patron modification > tool > >bug 28014 added Datatables to this view, but the form is submitted with >only the checkboxes from the first page. > >Solution adapted from https://stackoverflow.com/questions/33240409/how-to-submit-checkboxes-from-all-pages-with-jquery-datatables > >Test plan: >Have more than 20 cardnumbers, use the batch patron modification tool >Select (not all) patrons from the first page and second page >Submit the form >Notice that the patrons you have selected appear on the confirmation >page. >--- > .../prog/en/modules/tools/modborrowers.tt | 19 ++++++++++++++++++- > 1 file changed, 18 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt >index be18b7899b5..427b5c1c3c6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt >@@ -402,7 +402,7 @@ > [% END %] > $(document).ready(function() { > [% IF borrowers %] >- KohaTable("borrowerst", { >+ let patron_table = KohaTable("borrowerst", { > "order": [[ 1, "asc" ]], > "autoWidth": false, > }, table_settings); >@@ -466,6 +466,23 @@ > $("#borrowernumberuploadfile, #cardnumberuploadfile, #borrowernumberlist, #cardnumberlist").val(""); > } > }); >+ >+ $('form[name="f"]').on("submit", function(){ >+ // Add the checkboxes to the DOM before we submit the form >+ var form = this; >+ var checkboxes = patron_table.$('input:checkbox:checked').serializeArray(); >+ $.each(checkboxes, function(){ >+ let borrowernumber = this.value; >+ if(!$(form).find('input[name="borrowernumber"][value="'+borrowernumber+'"]').length){ >+ $(form).append( >+ $('<input>') >+ .attr('type', 'hidden') >+ .attr('name', 'borrowernumber') >+ .val(borrowernumber) >+ ); >+ } >+ }); >+ }); > }); > > function updateAttrValues (select_attr) { >-- >2.25.1
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 30628
:
134205
|
134220
|
134286