From c6ee16d93df234b85ea7e0fbc38960b8bc3ff882 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 8 Jul 2014 10:01:31 +0200 Subject: [PATCH] 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 Signed-off-by: Tomas Cohen Arazi Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi --- .../en/modules/tools/batch_record_modification.tt | 12 ++++++++---- 1 file 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 9b53c5adc0..e02bfd89d1 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(){ -- 2.39.5