Bug 26154: Remove the use of jquery.checkboxes plugin from batch item deletion and modification

This patch removes the use of the jquery.checkboxes plugin from the
batch item modification and batch item deletion pages.

To test, apply the patch and go to Tools -> Batch item
modification.

 - Submit a batch of barcodes.
 - On the results page, test the "Select all" and "Clear all" controls
   at the top of the page. These should work correctly on the checkboxes
   in the table of results.
 - Test that the "Clear on loan" control still works to uncheck
   checkboxes corresponding to items which are checked out.
 - Test the "Show all columns" and "Hide all columns" checkboxes in the
   "Show/hide columns" section. These should work correctly on the
   checkboxes for showing and hiding columns in the table.
 - Go to Tools -> Batch item deletion.
 - Submit a batch of barcodes.
 - Repeat the same testing steps above (except the "Clear on loan"
   step).

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Owen Leonard 2020-08-05 18:53:46 +00:00 committed by Jonathan Druart
parent bd2087e1cd
commit 30fcb92d62
3 changed files with 16 additions and 10 deletions

View File

@ -298,7 +298,6 @@
[% Asset.js("js/tools-menu.js") | $raw %]
[% INCLUDE 'datatables.inc' %]
[% Asset.js("js/pages/batchMod.js") | $raw %]
[% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
[% Asset.js("js/browser.js") | $raw %]
<script type="text/javascript">
// Prepare array of all column headers, incrementing each index by

View File

@ -8,7 +8,6 @@
[% Asset.js("js/background-job-progressbar.js") | $raw %]
[% Asset.js("js/cataloging.js") | $raw %]
[% INCLUDE 'datatables.inc' %]
[% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
[% Asset.js("js/pages/batchMod.js") | $raw %]
<script type="text/javascript">
//<![CDATA[

View File

@ -80,14 +80,18 @@ function showColumn(num){
}
}
function showAllColumns(){
$("#selections").checkCheckboxes();
$("#selections input:checkbox").each(function(){
$(this).prop("checked", true);
});
$("#selections span").addClass("selected");
$("#itemst td:nth-child(3),#itemst tr th:nth-child(3)").nextAll().show();
$.removeCookie("showColumns", { path: '/' });
$("#hideall").prop("checked", false).parent().removeClass("selected");
}
function hideAllColumns(){
$("#selections").unCheckCheckboxes();
$("#selections input:checkbox").each(function(){
$(this).prop("checked", false);
});
$("#selections span").removeClass("selected");
$("#itemst td:nth-child(3),#itemst th:nth-child(3)").nextAll().hide();
$("#hideall").prop("checked", true).parent().addClass("selected");
@ -105,13 +109,17 @@ function hideAllColumns(){
],
"bPaginate": false,
}));
$("#selectallbutton").click(function(){
$("#itemst").checkCheckboxes();
return false;
$("#selectallbutton").click(function(e){
e.preventDefault();
$("#itemst input:checkbox").each(function(){
$(this).prop("checked", true);
});
});
$("#clearallbutton").click(function(){
$("#itemst").unCheckCheckboxes();
return false;
$("#clearallbutton").click(function(e){
e.preventDefault();
$("#itemst input:checkbox").each(function(){
$(this).prop("checked", false);
});
});
$("#clearonloanbutton").click(function(){
$("#itemst input[name='itemnumber'][data-is-onloan='1']").each(function(){