Bugzilla – Attachment 54802 Details for
Bug 17183
Koha News 'delete selected' function doesn't check if anything has been selected
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17183: Check if any checkboxes have been checked for 'Delete Selected' button in Koha News
Bug-17183-Check-if-any-checkboxes-have-been-checke.patch (text/plain), 2.26 KB, created by
Aleisha Amohia
on 2016-08-24 03:46:53 UTC
(
hide
)
Description:
Bug 17183: Check if any checkboxes have been checked for 'Delete Selected' button in Koha News
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2016-08-24 03:46:53 UTC
Size:
2.26 KB
patch
obsolete
>From d4d35378b7d72794d5bdda5967dbaf1936dc70ce Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Wed, 24 Aug 2016 03:43:22 +0000 >Subject: [PATCH] Bug 17183: Check if any checkboxes have been checked for > 'Delete Selected' button in Koha News > >To test: >1) Go to Tools -> Koha News >2) Click 'Delete selected' button without selecting anything >3) Notice you are asked to confirm if you would like to delete ... but >you didn't choose anything to delete >4) Apply patch and refresh page >5) Click 'Delete selected' button without selecting anything >6) Should see alert. >7) Select one or more news items to delete and click 'Delete selected' >button >8) Should be asked to confirm >9) Confirm that the delete works as expected > >Sponsored-by: Catalyst IT >--- > .../intranet-tmpl/prog/en/modules/tools/koha-news.tt | 20 +++++++++++++++++++- > 1 file changed, 19 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt >index 62dd962..c01758e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt >@@ -19,8 +19,26 @@ > $(".delete_news").on("click", function(){ > return confirmDelete( _("Are you sure you want to delete this news item? This cannot be undone.") ); > }); >+ >+ function Checkbox(){ >+ var form = document.getElementById('del_form'); >+ var inputs = form.getElementsByTagName('input'); >+ var checked = false; >+ for (var i=0; i<inputs.length; i++) { >+ if (inputs[i].type == 'checkbox' && inputs[i].name == 'ids') { >+ checked = inputs[i].checked; >+ if (checked) return true; >+ } >+ } >+ } >+ > $("#del_form").on("submit",function(){ >- return confirmDelete( _("Are you sure you want to delete the selected news?") ); >+ if ( Checkbox() ) { >+ return confirmDelete( _("Are you sure you want to delete the selected news?") ); >+ } else { >+ alert(_("Please select a news item to delete.")); >+ return false; >+ } > }); > }); > //]]> >-- >2.1.4
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 17183
:
54802
|
54811
|
54960