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; } /**