Bugzilla – Attachment 112441 Details for
Bug 26768
Remove the use of jquery.checkboxes plugin from library transfer limits page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26768: Remove the use of jquery.checkboxes plugin from library transfer limits page
Bug-26768-Remove-the-use-of-jquerycheckboxes-plugi.patch (text/plain), 5.88 KB, created by
Nick Clemens (kidclamp)
on 2020-10-25 01:20:26 UTC
(
hide
)
Description:
Bug 26768: Remove the use of jquery.checkboxes plugin from library transfer limits page
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2020-10-25 01:20:26 UTC
Size:
5.88 KB
patch
obsolete
>From c7f20174a1a8c1b542b1563b6c8b0582ea18a13d Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Wed, 21 Oct 2020 17:25:47 +0000 >Subject: [PATCH] Bug 26768: Remove the use of jquery.checkboxes plugin from > library transfer limits page > >This patch modifies the library transfer limits page to eliminate the >use of the jquery.checkboxes plugin. > >To test, apply the patch and go to Administration -> Library transfer >limits. > >- Test the "For all collection codes" links, "Select all" and "Clear > all." Each should affect all checkboxes on all tabs. >- Click various tabs and confirm that the "select all" and "clear all" > links within that tab work correctly, affecting only the checkboxes in > that tab. > >Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > .../en/modules/admin/branch_transfer_limits.tt | 46 ++++++++++++++-------- > 1 file changed, 30 insertions(+), 16 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt >index 9dd039171b..2647ee28f8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt >@@ -41,7 +41,8 @@ > [% FOREACH codes_loo IN codes_loop %] > <div id="[% codes_loo.code | html %]set"> > <h4>Policy for [% codes_loo.limit_phrase | html %]: [% codes_loo.code | html %]</h4> >- <p><a id="CheckAll[% codes_loo.code | html %]table" class="checkall" href="#"><i class="fa fa-check"></i> Select all</a> | <a id="UncheckAll[% codes_loo.code | html %]table" class="uncheckall" href="#"><i class="fa fa-remove"></i> Clear all</a></p> >+ >+ <p><a id="CheckAll[% codes_loo.code | html %]table" data-cb="[% codes_loo.code | html %]" class="checkall" href="#"><i class="fa fa-check"></i> Select all</a> | <a id="UncheckAll[% codes_loo.code | html %]table" data-cb="[% codes_loo.code | html %]" class="uncheckall" href="#"><i class="fa fa-remove"></i> Clear all</a></p> > > <table id="[% codes_loo.code | html %]table" class="sorted"> > <thead> >@@ -57,9 +58,9 @@ > <td><label style="min-width:400px;" for="[% to_branch_loo.code | html %][% to_branch_loo.toBranch | html %]row">[% to_branch_loo.toBranch | html %] - [% Branches.GetName( to_branch_loo.toBranch ) | html %]</label></td> > <td> > [% IF ( to_branch_loo.isChecked ) %] >- <input type="checkbox" id="[% to_branch_loo.code | html %][% to_branch_loo.toBranch | html %]row" name="[% to_branch_loo.code | html %]_[% to_branch_loo.toBranch | html %]" checked="checked" /> >+ <input type="checkbox" class="cb cb[% codes_loo.code | html %]" id="[% to_branch_loo.code | html %][% to_branch_loo.toBranch | html %]row" name="[% to_branch_loo.code | html %]_[% to_branch_loo.toBranch | html %]" checked="checked" /> > [% ELSE %] >- <input type="checkbox" id="[% to_branch_loo.code | html %][% to_branch_loo.toBranch | html %]row" name="[% to_branch_loo.code | html %]_[% to_branch_loo.toBranch | html %]" /> >+ <input type="checkbox" class="cb cb[% codes_loo.code | html %]" id="[% to_branch_loo.code | html %][% to_branch_loo.toBranch | html %]row" name="[% to_branch_loo.code | html %]_[% to_branch_loo.toBranch | html %]" /> > [% END %] > </td> > </tr> >@@ -91,11 +92,21 @@ > [% MACRO jsinclude BLOCK %] > [% Asset.js("js/admin-menu.js") | $raw %] > [% INCLUDE 'datatables.inc' %] >- [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %] > <script> > $(document).ready(function(){ >- $("#CheckAll").click(function(){ $("#transferlimit_tabs").checkCheckboxes(); return false; }); >- $("#UncheckAll").click(function(){ $("#transferlimit_tabs").unCheckCheckboxes(); return false; }); >+ $("#CheckAll").on("click", function(e){ >+ e.preventDefault(); >+ $(".cb").each(function(){ >+ $(this).prop("checked", true); >+ }); >+ }); >+ >+ $("#UncheckAll").on("click", function(e){ >+ e.preventDefault(); >+ $(".cb").each(function(){ >+ $(this).prop("checked", false); >+ }); >+ }); > $('#transferlimit_tabs').tabs(); > > $('#branchselect').change(function() { >@@ -105,19 +116,22 @@ > var checkall = $(".checkall"); > var uncheckall = $(".uncheckall"); > >- $(checkall).click(function(){ >- var tid = $(this).attr("id"); >- tid = tid.replace("CheckAll",""); >- $("#"+tid).checkCheckboxes(); >- return false; >+ $(checkall).on("click", function(e){ >+ e.preventDefault(); >+ var tid = $(this).data("cb"); >+ $(".cb" + tid ).each(function(){ >+ $(this).prop("checked", true); >+ }) > }); > >- $(uncheckall).click(function(){ >- var tid = $(this).attr("id"); >- tid = tid.replace("UncheckAll",""); >- $("#"+tid).unCheckCheckboxes(); >- return false; >+ $(uncheckall).on("click", function(e){ >+ e.preventDefault(); >+ var tid = $(this).data("cb"); >+ $(".cb" + tid ).each(function(){ >+ $(this).prop("checked", false); >+ }) > }); >+ > $(".sorted").dataTable($.extend(true, {}, dataTablesDefaults, { > "aoColumnDefs": [ > { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, >-- >2.11.0
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 26768
:
112117
|
112400
| 112441