Bugzilla – Attachment 55515 Details for
Bug 16949
Batch record deletion says success when no records have been passed in
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16949: Simplify the checkbox checked condition
Bug-16949-Simplify-the-checkbox-checked-condition.patch (text/plain), 1.60 KB, created by
Jonathan Druart
on 2016-09-13 08:12:50 UTC
(
hide
)
Description:
Bug 16949: Simplify the checkbox checked condition
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-09-13 08:12:50 UTC
Size:
1.60 KB
patch
obsolete
>From fd1da1dc3ea7de2aa56e08b1dda286c155b4dc64 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 13 Sep 2016 09:06:12 +0100 >Subject: [PATCH] Bug 16949: Simplify the checkbox checked condition > >It's easier to use jQuery selector to know if checkboxes are checked. > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > .../prog/en/modules/tools/batch_delete_records.tt | 16 ++-------------- > 1 file changed, 2 insertions(+), 14 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt >index ceb5bd4..7962a9f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt >@@ -61,21 +61,9 @@ $(document).ready(function() { > "bPaginate": false > })); > >- function Checkbox(){ >- var form = document.getElementById('selectrecords'); >- var inputs = form.getElementsByTagName('input'); >- var checked = false; >- for (var i=0; i<inputs.length; i++) { >- if (inputs[i].type == 'checkbox' && inputs[i].name == 'record_id') { >- checked = inputs[i].checked; >- if (checked) return true; >- } >- } >- return false; >- } >- > $("#selectrecords").on("submit",function(){ >- if (Checkbox() == false){ >+ var nb_checked = $("#selectrecords").find("input[type='checkbox'][name='record_id']:checked").size(); >+ if (nb_checked == 0){ > alert(_("No records have been selected.")); > return false; > } >-- >2.8.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 16949
:
53540
|
53792
|
53870
|
54127
|
54901
|
55438
|
55514
| 55515