From 1783dce86d4f8ddfa859a67682c7e8acdb9d36da 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 --- .../prog/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 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(){ -- 2.1.0