Bug 15493: Use the correct CSV profile when exporting records from the export tool
[srvgit] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / export.tt
index b5072da..83bc50a 100644 (file)
@@ -6,6 +6,17 @@
 //<![CDATA[
 $(document).ready(function() {
     $('#exporttype').tabs();
+
+    $("li.csv_profiles").hide();
+
+    $("#bibs select[name='output_format']").on('change', function(){
+        var format = $(this).val();
+        if ( format == 'csv' ) {
+            $("#bibs li.csv_profiles").show();
+        } else {
+            $("#bibs li.csv_profiles").hide();
+        }
+    });
 });
 //]]>
 </script>
@@ -38,7 +49,7 @@ $(document).ready(function() {
     <b>Note : The items are exported by this tool unless specified.</b>
 </p>
 
-<form method="post" action="/cgi-bin/koha/tools/export.pl">
+<form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/tools/export.pl">
     <fieldset class="rows">
     <legend> Select records to export </legend>
         <ol><li>
@@ -65,16 +76,9 @@ $(document).ready(function() {
         </li>
         
         <li>
-            <label for="branch">Library: </label>
-            <select id="branch" name="branch">
-            <option value="">-- All --</option>
-                [% FOREACH branchloo IN branchloop %]
-                    [% IF ( branchloo.selected ) %]<option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>
-                               [% ELSE %]
-                               <option value="[% branchloo.value %]">[% branchloo.branchname %]</option>
-                               [% END %]
-                    [% END %]
-                </select>
+            <label>Library: </label>
+            [% INCLUDE 'branch-selector.inc'
+                branches = branchloop %]
         </li>
         <li>
             <label for="startcn">From item call number: </label>
@@ -97,6 +101,15 @@ $(document).ready(function() {
 </ul></li></ol>
     </fieldset>
     <fieldset class="rows">
+    <legend>
+        Use a file
+    </legend>
+        <ol>
+        <li>File containing a list of biblio numbers with one biblio number per line. This list works as a filter: it is compatible with other parameters.</li>
+        <li><label for="id_list_file">File : </label> <input type="file" id="id_list_file" name="id_list_file" /></li>
+        </ol>
+    </fieldset>
+    <fieldset class="rows">
     <legend> Options</legend>
 <ol>        <li>
         <label for="dont_export_item">Don't export items</label>
@@ -119,10 +132,18 @@ $(document).ready(function() {
         <ol><li>
             <label for="output_format">File format: </label>
             <select id="output_format" name="output_format">
-                <option value="marc">marc</option>
+                <option value="iso2709">marc</option>
                 <option value="xml">xml</option>
+                <option value="csv">csv</option>
+            </select>
+        </li>
+        <li class="csv_profiles">
+            <label for="bibs_csv_profile">CSV profile: </label>
+            <select id="bibs_csv_profile" name="csv_profile_id">
+                [% FOR csv_profile IN csv_profiles %]
+                    <option value="[% csv_profile.export_format_id %]">[% csv_profile.profile %]</option>
+                [% END %]
             </select>
-            
         </li>
         <li>
         <label for="filename">File name:</label><input id="filename" type="text" name="filename" value="koha.mrc" />
@@ -136,7 +157,7 @@ $(document).ready(function() {
 </div>
 
 <div id="auths">
-<form method="post" action="/cgi-bin/koha/tools/export.pl">
+<form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/tools/export.pl">
     <fieldset class="rows">
     <legend> Select records to export </legend>
         <ol><li>
@@ -151,18 +172,23 @@ $(document).ready(function() {
             <label for="authtype">Authority type: </label>
             <select name="authtype" id="authtype">
                 <option value="">-- All --</option>
-                [% FOREACH authtypeloo IN authtypeloop %]
-                [% IF ( authtypeloo.selected ) %]
-                <option value="[% authtypeloo.value %]" selected="selected">[% authtypeloo.description %]</option>
-[% ELSE %]
-                <option value="[% authtypeloo.value %]">[% authtypeloo.description %]</option>
-[% END %]
+                [% FOREACH authority_type IN authority_types %]
+                    <option value="[% authtypeloo.value %]">[% authtypeloo.description %]</option>
                 [% END %]
             </select>
         </li>
         </ol>
     </fieldset>
     <fieldset class="rows">
+    <legend>
+        Use a file
+    </legend>
+        <ol>
+        <li>File containing a list of authids with one authid per line. This list works as a filter: it is compatible with other parameters.</li>
+        <li><label for="id_list_file">File : </label> <input type="file" id="id_list_file" name="id_list_file" /></li>
+        </ol>
+    </fieldset>
+    <fieldset class="rows">
     <legend>Options</legend>
         <ol>
         <li>