</div>
[% END %]
[% IF op == 'form' %]
- <form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/tools/batch_delete_records.pl">
+ <form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/tools/batch_delete_records.pl" id="record_ids_selection">
<fieldset class="rows">
<legend>Record type</legend>
<ol>
<div id="batch_del_form" class="toptabs">
<ul>
- <li><a href="#uploadfile">Upload a file</a></li>
- [% IF lists.count %]<li id="show_list_option"><a href="#shelves">Select a list of records</a></li>[% END %]
- <li><a href="#enterlist">Enter a list of record numbers</a></li>
+ <li><a href="#uploadfile_tab">Upload a file</a></li>
+ [% IF lists.count %]<li id="show_list_option"><a href="#shelves_tab">Select a list of records</a></li>[% END %]
+ <li><a href="#enterlist_tab">Enter a list of record numbers</a></li>
</ul>
- <div id="uploadfile">
+ <div id="uploadfile_tab">
<fieldset class="rows">
<legend>Use a file</legend>
<ol>
</div>
- <div id="shelves">
- <fieldset class="rows">
- <legend>Or select a list of records</legend>
- <ol>
- <li>
- <label for="shelf_number">Use records from the following list: </label>
- <select name="shelf_number" id="shelf_number">
- <option value="">Select a list</option>
- [% FOREACH list IN lists %]
- <option value="[% list.shelfnumber %]">[% list.shelfname %]</option>
- [% END %]
- </option>
- </select>
- </li>
- </ol>
- </fieldset>
-
- </div>
+ [% IF lists.count %]
+ <div id="shelves_tab">
+ <fieldset class="rows">
+ <legend>Or select a list of records</legend>
+ <ol>
+ <li>
+ <label for="shelf_number">Use records from the following list: </label>
+ <select name="shelf_number" id="shelf_number">
+ <option value="">Select a list</option>
+ [% FOREACH list IN lists %]
+ <option value="[% list.shelfnumber %]">[% list.shelfname %]</option>
+ [% END %]
+ </option>
+ </select>
+ </li>
+ </ol>
+ </fieldset>
+
+ </div>
+ [% END %]
- <div id="enterlist">
+ <div id="enterlist_tab">
<fieldset class="rows">
<legend>Or enter a list of record numbers</legend>
<ol>
return false;
}
});
+
+ $("#record_ids_selection").on("submit", function(e){
+ var tab = $(this).find('.ui-tabs-active:first a').attr('href');
+ if ( tab == '#uploadfile_tab' ) {
+ $("#shelf_number").empty('');
+ $("#recordnumber_list").val('');
+ } else if ( tab == '#shelves_tab' ) {
+ $("#uploadfile").val('')
+ $("#recordnumber_list").val('');
+ } else { // enterlist
+ $("#uploadfile").val('')
+ $("#shelf_number").empty('');
+ }
+ });
+
});
</script>
[% END %]
[% END %]
[% IF view == 'form' %]
- <form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/tools/batch_record_modification.pl">
+ <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>
<div id="batch_mod_form" class="toptabs">
<ul>
- <li><a href="#uploadfile">Upload a file</a></li>
- [% IF lists.count %]<li id="show_list_option"><a href="#shelves">Select a list of records</a></li>[% END %]
- <li><a href="#enterlist">Enter a list of record numbers</a></li>
+ <li><a href="#uploadfile_tab">Upload a file</a></li>
+ [% IF lists.count %]<li id="show_list_option"><a href="#shelves_tab">Select a list of records</a></li>[% END %]
+ <li><a href="#enterlist_tab">Enter a list of record numbers</a></li>
</ul>
- <div id="uploadfile">
+ <div id="uploadfile_tab">
<fieldset class="rows">
<legend>Use a file</legend>
<ol>
</div>
- <div id="shelves">
- <fieldset class="rows">
- <legend>Or select a list of records</legend>
- <ol>
- <li>
- <label for="shelf_number">Use records from the following list: </label>
- <select name="shelf_number" id="shelf_number">
- <option value="">Select a list</option>
- [% FOREACH list IN lists %]
- <option value="[% list.shelfnumber %]">[% list.shelfname %]</option>
- [% END %]
- </option>
- </select>
- </li>
- </ol>
- </fieldset>
-
- </div>
+ [% IF lists.count %]
+ <div id="shelves_tab">
+ <fieldset class="rows">
+ <legend>Or select a list of records</legend>
+ <ol>
+ <li>
+ <label for="shelf_number">Use records from the following list: </label>
+ <select name="shelf_number" id="shelf_number">
+ <option value="">Select a list</option>
+ [% FOREACH list IN lists %]
+ <option value="[% list.shelfnumber %]">[% list.shelfname %]</option>
+ [% END %]
+ </option>
+ </select>
+ </li>
+ </ol>
+ </fieldset>
+
+ </div>
+ [% END %]
- <div id="enterlist">
+ <div id="enterlist_tab">
<fieldset class="rows">
<legend>Or enter a list of record numbers</legend>
<ol>
return submitBackgroundJob(document.getElementById("process"));
});
+ $("#record_ids_selection").on("submit", function(e){
+ var tab = $(this).find('.ui-tabs-active:first a').attr('href');
+ if ( tab == '#uploadfile_tab' ) {
+ $("#shelf_number").empty('');
+ $("#recordnumber_list").val('');
+ } else if ( tab == '#shelves_tab' ) {
+ $("#uploadfile").val('')
+ $("#recordnumber_list").val('');
+ } else { // enterlist
+ $("#uploadfile").val('')
+ $("#shelf_number").empty('');
+ }
+ });
+
$("#marc_modification_template_id").change(function(){
var url = "/cgi-bin/koha/svc/records/preview?"
var mmtid = $(this).val();