Bug 15682 - Merging records from cataloguing search only allows to merge 2 records
To test: 1 - Perform a cataloging search 2 - Attempt to merge 0 results - should fail 3 - Attempt to merge 1 resutls - should fail 4 - Attempt to merge 2 results - should succeed 5 - Attempt to merge 3 results - should succeed 6 - Test any other amount of records and if more than 1 it should succeed **Note: On shelves.pl you can merge a single record. I think that is incorrect so made this only work for 2. Will add a followup to fix shelves.pl Signed-off-by: Chris Cormack <chrisc@catalyst.net.z> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Brendan Gallagher <bredan@bywatersolutions.com>
This commit is contained in:
parent
1931ff4653
commit
8f1e5ad95f
1 changed files with 8 additions and 4 deletions
|
@ -64,11 +64,15 @@
|
|||
*/
|
||||
function MergeItems() {
|
||||
var checkboxes = $("input:checkbox:checked");
|
||||
var nbCheckbox = checkboxes.length;
|
||||
if (nbCheckbox != 2) {
|
||||
alert(_("Two records must be selected for merging."));
|
||||
if (checkboxes.length < 2) {
|
||||
alert(_("At least two records must be selected for merging."));
|
||||
} else {
|
||||
location.href='/cgi-bin/koha/cataloguing/merge.pl?biblionumber=' + checkboxes[0].value + '&biblionumber=' + checkboxes[1].value;
|
||||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue