From 1a1750c7c019808506e394d087ff18dfbb221a7e Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 8 Jul 2014 10:01:31 +0200 Subject: [PATCH] [PASSED QA] Bug 11395: prevent processing no record If no record is selected, the modification should not be launched. Signed-off-by: Brendan Gallagher Signed-off-by: Kyle M Hall --- .../en/modules/tools/batch_record_modification.tt | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt index 9b53c5a..e02bfd8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt @@ -41,11 +41,15 @@ $(document).ready(function() { })); $("#mainformsubmit").click(function(){ - if ( $("#marc_modification_template_id").val() > 0 ) { - return submitBackgroundJob(document.getElementById("process")); + if ($("input[type=checkbox][name='record_id']:checked").length == 0 ) { + alert(_("Please select at least one record to process")); + return false; } - alert(_("Please select a modification template.")); - return false; + if ( $("#marc_modification_template_id").val() <= 0 ) { + alert(_("Please select a modification template.")); + return false; + } + return submitBackgroundJob(document.getElementById("process")); }); $("#marc_modification_template_id").change(function(){ -- 1.7.2.5