From ee3caa91637073d492f437ceb4f196f06d52222a Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Mon, 28 Mar 2016 20:09:01 +0000 Subject: [PATCH] Bug 15682 - Only allow merging of 2 or more records form lsits (for consistency) Test as above but on shelves.pl Signed-off-by: Chris Cormack Signed-off-by: Katrin Fischer Signed-off-by: Brendan Gallagher (cherry picked from commit 9550e37fc66402500adf8bca7a1c90ee0104cdd0) Signed-off-by: Julian Maurice (cherry picked from commit 9f1e23735f46a8b014d4a8983796f1b8b37cc9b4) Signed-off-by: Chris Cormack --- .../prog/en/modules/virtualshelves/shelves.tt | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt index e6fd5bde20..a4fb74bae4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt @@ -185,14 +185,18 @@ $(document).ready(function(){ * This function checks if the adequate number of records are checked for merging */ function MergeItems() { - var checkboxes = $("input:checkbox:checked"); - var nbCheckbox = checkboxes.length; - if (nbCheckbox != 2) { - alert(_("Two records must be selected for merging.")); - } else { - location.href='/cgi-bin/koha/cataloguing/merge.pl?biblionumber=' + checkboxes[0].value + '&biblionumber=' + checkboxes[1].value; - } - return false; + var checkboxes = $("input:checkbox:checked"); + if (checkboxes.length < 2) { + alert(_("At least two records must be selected for merging.")); + } else { + var params = []; + $(checkboxes).each(function() { + params.push('biblionumber=' + $(this).val()); + }); + var url = '/cgi-bin/koha/cataloguing/merge.pl?' + params.join('&'); + location.href = url; + } + return false; } /** -- 2.39.5