Bug 32914: (follow-up) Improve handling of list tab visibility

This patch makes minor changes to the way this page handles switching
between authority and bibliographic record batch operation in order to
ensure that the list tab is correctly shown or hidden and that the list
tab selection isn't transmitted when an authority batch is submitted.

This patch also changes the labels on the "record type" fields to fix
the incorrect use of the abbreviated "biblios" in favor of
"Bibliographic."

To test, apply the patch and go to Cataloging -> Batch record
modification

- With the "Bibliographic records" selected, click the "Select a list
  of records" tab."
- Select the "Authority records" radio button.
- The "Select a list of records" tab should disappear, and the "Upload a
  file" tab should now be selected."
- Select the "Bibliographic records radio button.
- The "Select a list of records" tab should reappear, and the "Upload a
  file" tab should be selected.
- Test all combinations of form submissions to confirm that each works
  correctly:
  - Bibliographic records by upload, list, and biblionumber entry
  - Authory records by upload and authority record number entry

Signed-off-by: Philip Orr <philip.orr@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Owen Leonard 2023-04-25 15:07:29 +00:00 committed by Tomas Cohen Arazi
parent 3c2eb1da53
commit baa3f81b8d
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -73,9 +73,9 @@
<form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/tools/batch_record_modification.pl" id="record_ids_selection">
<fieldset class="rows">
<legend>Record type</legend>
<ol>
<li><label for="biblio_type">Biblios: </label><input type="radio" name="recordtype" value="biblio" id="biblio_type" checked="checked" /></li>
<li><label for="authority_type">Authorities: </label><input type="radio" name="recordtype" value="authority" id="authority_type" /></li>
<ol class="radio">
<li><label for="biblio_type"><input type="radio" name="recordtype" value="biblio" id="biblio_type" checked="checked" /> Bibliographic records</label></li>
<li><label for="authority_type"><input type="radio" name="recordtype" value="authority" id="authority_type" /> Authority records</label></li>
</ol>
</fieldset>
@ -290,8 +290,10 @@
$("input[type='radio']").click(function() {
if ($(this).attr('id') == 'authority_type') {
$("a[href='#shelves_tab_panel']").parent().hide();
$("a[href='#uploadfile_tab_panel']").tab("show");
} else if ($(this).attr('id') == 'biblio_type') {
$("a[href='#shelves_tab_panel']").parent().show();
$("a[href='#uploadfile_tab_panel']").tab("show");
}
});
@ -346,14 +348,11 @@
$("#record_ids_selection").on("submit", function(e) {
var tab = $(this).find('#batch_mod_form li.active:first a').attr('href');
if (tab == '#uploadfile_tab_panel') {
$("#shelf_number").empty('');
$("#recordnumber_list").val('');
$("#recordnumber_list, #shelf_number").val('');
} else if (tab == '#shelves_tab_panel') {
$("#uploadfile").val('')
$("#recordnumber_list").val('');
$("#recordnumber_list, #uploadfile").val('');
} else { // enterlist
$("#uploadfile").val('')
$("#shelf_number").empty('');
$("#uploadfile, #shelf_number").val('')
}
});