From 98559a63b4d4d939d1c8494eae7694520e830caa 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 Content-Type: text/plain; charset=utf-8 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 --- .../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.7.6