Bug 15493: Use the correct CSV profile when exporting records from the export tool
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / export.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Tools &rsaquo; MARC export</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 [% INCLUDE 'calendar.inc' %]
5 <script type="text/javascript">
6 //<![CDATA[
7 $(document).ready(function() {
8     $('#exporttype').tabs();
9
10     $("li.csv_profiles").hide();
11
12     $("#bibs select[name='output_format']").on('change', function(){
13         var format = $(this).val();
14         if ( format == 'csv' ) {
15             $("#bibs li.csv_profiles").show();
16         } else {
17             $("#bibs li.csv_profiles").hide();
18         }
19     });
20 });
21 //]]>
22 </script>
23 </head>
24 <body id="tools_export" class="tools">
25 [% INCLUDE 'header.inc' %]
26 [% INCLUDE 'cat-search.inc' %]
27
28 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; MARC export</div>
29
30 <div id="doc3" class="yui-t2">
31    
32    <div id="bd">
33         <div id="yui-main">
34         <div class="yui-b">
35
36 <div id="exporttype" class="toptabs">
37 <ul>
38 <li><a href="#bibs">Export bibliographic records</a></li>
39 <li><a href="#auths">Export authority records</a></li>
40 [% IF ( allow_db_export ) %]
41 <li><a href="#db">Export database</a></li>
42 [% END %]
43 [% IF ( allow_conf_export ) %]
44 <li><a href="#conf">Export configuration</a></li>
45 [% END %]
46 </ul>
47 <div id="bibs">
48 <p>
49     <b>Note : The items are exported by this tool unless specified.</b>
50 </p>
51
52 <form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/tools/export.pl">
53     <fieldset class="rows">
54     <legend> Select records to export </legend>
55         <ol><li>
56             <label for="start">From biblio number: </label>
57             <input id="start" type="text" name="StartingBiblionumber" size="5" />
58         </li>
59         <li>
60             <label for="end">To biblio number: </label>
61             <input id="end" type="text" name="EndingBiblionumber" size="5" />
62         </li>
63         
64         <li>
65             <label for="itemtype">Item type: </label>
66             <select name="itemtype" id="itemtype">
67                 <option value="">-- All --</option>
68                 [% FOREACH itemtypeloo IN itemtypeloop %]
69                                 [% IF ( itemtypeloo.selected ) %]
70                 <option value="[% itemtypeloo.value %]" selected="selected">[% itemtypeloo.description %]</option>
71 [% ELSE %]
72                 <option value="[% itemtypeloo.value %]">[% itemtypeloo.description %]</option>
73 [% END %]
74                 [% END %]
75             </select>
76         </li>
77         
78         <li>
79             <label>Library: </label>
80             [% INCLUDE 'branch-selector.inc'
81                 branches = branchloop %]
82         </li>
83         <li>
84             <label for="startcn">From item call number: </label>
85             <input id="startcn" type="text" name="start_callnumber" size="5" />
86         </li>
87         <li>
88             <label for="endcn">To item call number: </label>
89             <input id="endcn" type="text" name="end_callnumber" size="5" />
90         </li>
91         <li>Accession date (inclusive):
92                 <ul><li>
93         <label for="from">Start date:</label>
94         <input type="text" size="10" id="from" name="start_accession" value="[% from %]" class="datepickerfrom" />
95 </li>
96 <li><label for="to">
97     End date:
98 </label>
99 <input size="10" id="to" name="end_accession" value="[% end_accession %]" type="text" class="datepickerto" />
100 </li>
101 </ul></li></ol>
102     </fieldset>
103     <fieldset class="rows">
104     <legend>
105         Use a file
106     </legend>
107         <ol>
108         <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>
109         <li><label for="id_list_file">File : </label> <input type="file" id="id_list_file" name="id_list_file" /></li>
110         </ol>
111     </fieldset>
112     <fieldset class="rows">
113     <legend> Options</legend>
114 <ol>        <li>
115         <label for="dont_export_item">Don't export items</label>
116         <input id="dont_export_item" type="checkbox" name="dont_export_item" />
117         </li>
118         <li>
119         <label for="strip_nonlocal_items">Remove non-local items</label>
120         <input id="strip_nonlocal_items" type="checkbox" name="strip_nonlocal_items" />
121         </li>
122         <li>
123         <label for="export_remove_fields">Don't export fields</label>
124         <input id="export_remove_fields" type="text" name="export_remove_fields" value="[% export_remove_fields %]" />
125         separate by a blank. (e.g., 100a 200 606)
126         </li></ol>
127     </fieldset>
128     <fieldset class="rows">
129     <legend>
130         Output format
131     </legend>
132         <ol><li>
133             <label for="output_format">File format: </label>
134             <select id="output_format" name="output_format">
135                 <option value="iso2709">marc</option>
136                 <option value="xml">xml</option>
137                 <option value="csv">csv</option>
138             </select>
139         </li>
140         <li class="csv_profiles">
141             <label for="bibs_csv_profile">CSV profile: </label>
142             <select id="bibs_csv_profile" name="csv_profile_id">
143                 [% FOR csv_profile IN csv_profiles %]
144                     <option value="[% csv_profile.export_format_id %]">[% csv_profile.profile %]</option>
145                 [% END %]
146             </select>
147         </li>
148         <li>
149         <label for="filename">File name:</label><input id="filename" type="text" name="filename" value="koha.mrc" />
150         </li></ol>
151     </fieldset>
152     <input type="hidden" name="op" value="export" />
153     <input type="hidden" name="record_type" value="bibs" />
154
155     <fieldset class="action"><input type="submit" value="Export bibliographic records" class="button" /></fieldset>
156 </form>
157 </div>
158
159 <div id="auths">
160 <form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/tools/export.pl">
161     <fieldset class="rows">
162     <legend> Select records to export </legend>
163         <ol><li>
164             <label for="start">From authid: </label>
165             <input id="start" type="text" name="starting_authid" size="6" />
166         </li>
167         <li>
168             <label for="end">To authid: </label>
169             <input id="end" type="text" name="ending_authid" size="6" />
170         </li>
171         <li>
172             <label for="authtype">Authority type: </label>
173             <select name="authtype" id="authtype">
174                 <option value="">-- All --</option>
175                 [% FOREACH authority_type IN authority_types %]
176                     <option value="[% authtypeloo.value %]">[% authtypeloo.description %]</option>
177                 [% END %]
178             </select>
179         </li>
180         </ol>
181     </fieldset>
182     <fieldset class="rows">
183     <legend>
184         Use a file
185     </legend>
186         <ol>
187         <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>
188         <li><label for="id_list_file">File : </label> <input type="file" id="id_list_file" name="id_list_file" /></li>
189         </ol>
190     </fieldset>
191     <fieldset class="rows">
192     <legend>Options</legend>
193         <ol>
194         <li>
195             <label for="export_remove_fields">Don't export fields</label>
196             <input id="export_remove_fields" type="text" name="export_remove_fields" />
197             separate by a blank. (e.g., 100a 200 606)
198         </li></ol>
199     </fieldset>
200     <fieldset class="rows">
201     <legend>Output format</legend>
202         <ol><li>
203             <label for="output_format">File format: </label>
204             <select id="output_format" name="output_format">
205                 <option value="marc">marc</option>
206                 <option value="xml">xml</option>
207             </select>
208         </li>
209         <li>
210         <label for="filename">File name:</label><input id="filename" type="text" name="filename" value="koha.mrc" />
211         </li></ol>
212     </fieldset>
213     <input type="hidden" name="op" value="export" />
214     <input type="hidden" name="record_type" value="auths" />
215
216     <fieldset class="action"><input type="submit" value="Export authority records" class="button" /></fieldset>
217 </form>
218 </div>
219
220 [% IF ( allow_db_export ) %]
221 <div id="db">
222 <form method="post" action="/cgi-bin/koha/tools/export.pl">
223     <p><b>Note : This export file will be very large, and is generated nightly.</b></p>
224     <fieldset class="rows">
225     <legend> Choose a file </legend>
226     [% IF ( dbfiles && (dbfiles.size > 0) ) %]
227         <ul>
228         [% FOREACH dbfile IN dbfiles %]
229             <li><input type="radio" name="filename" value="[% dbfile %]">[% dbfile %]</input></li>
230         [% END %]
231         </ul>
232     [% ELSE %]
233         <p>Unfortunately, no backups are available.</p>
234     [% END %]
235     </fieldset>
236
237     [% IF ( dbfiles && (dbfiles.size > 0) ) %]
238         <input type="hidden" name="op" value="export" />
239         <input type="hidden" name="record_type" value="db" />
240         <fieldset class="action"><input type="submit" value="Download database" class="button" /></fieldset>
241     [% END %]
242 </form>
243 </div>
244 [% END %]
245
246 [% IF ( allow_conf_export ) %]
247 <div id="conf">
248 <form method="post" action="/cgi-bin/koha/tools/export.pl">
249     <p><b>Note : This export file will be very large, and is generated nightly.</b></p>
250     <fieldset class="rows">
251     <legend> Choose a file </legend>
252     [% IF ( conffiles && (conffiles.size > 0) ) %]
253         <ul>
254         [% FOREACH conffile IN conffiles %]
255             <li><input type="radio" name="filename" value="[% conffile %]">[% conffile %]</input></li>
256         [% END %]
257         </ul>
258     [% ELSE %]
259         <p>Unfortunately, no backups are available.</p>
260     [% END %]
261     </fieldset>
262
263     [% IF ( conffiles && (conffiles.size > 0) ) %]
264         <input type="hidden" name="op" value="export" />
265         <input type="hidden" name="record_type" value="conf" />
266         <fieldset class="action"><input type="submit" value="Download configuration" class="button" /></fieldset>
267     [% END %]
268 </form>
269 </div>
270 [% END %]
271
272 </div>
273
274 </div>
275 </div>
276 <div class="yui-b noprint">
277 [% INCLUDE 'tools-menu.inc' %]
278 </div>
279 </div>
280 [% INCLUDE 'intranet-bottom.inc' %]