5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Export data › Tools › Koha</title>
7 [% INCLUDE 'doc-head-close.inc' %]
9 fieldset.rows fieldset.rows {
15 <body id="tools_export" class="tools">
16 [% INCLUDE 'header.inc' %]
17 [% INCLUDE 'cat-search.inc' %]
19 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
22 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
25 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
28 <a href="#" aria-current="page">
35 <div class="main container-fluid">
37 <div class="col-sm-10 col-sm-push-2">
40 [% FOR m IN messages %]
41 <div class="dialog [% m.type | html %]">
43 [% CASE 'invalid_mimetype' %]<span>The file used does not have a valid format. Only csv and txt are allowed.</span>
44 [% CASE %][% m.code | html %]
49 <div id="exporttype" class="toptabs">
51 <li><a href="#bibs">Export bibliographic records</a></li>
52 <li><a href="#auths">Export authority records</a></li>
53 [% IF ( allow_db_export ) %]
54 <li><a href="#db">Export database</a></li>
56 [% IF ( allow_conf_export ) %]
57 <li><a href="#conf">Export configuration</a></li>
62 <strong>Note : The items are exported by this tool unless specified.</strong>
65 <form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/tools/export.pl">
66 <fieldset class="rows">
67 <legend> Select records to export </legend>
70 <label for="start">From biblionumber: </label>
71 <input id="start" type="text" name="StartingBiblionumber" size="5" />
74 <label for="end">To biblionumber: </label>
75 <input id="end" type="text" name="EndingBiblionumber" size="5" />
79 <label for="itemtype">Item type: </label>
80 <select name="itemtype" id="itemtype">
81 <option value="">-- All --</option>
82 [% FOREACH itemtype IN itemtypes %]
83 <option value="[% itemtype.itemtype | html %]">[% itemtype.translated_description | html %]</option>
89 <label>With items owned by the following libraries: </label>
90 [% INCLUDE 'branch-selector.inc' branches = libraries %]
94 <fieldset class="rows">
95 <legend>Call number range</legend>
98 <label for="startcn">From item call number: </label>
99 <input id="startcn" type="text" name="start_callnumber" size="15" />
102 <label for="endcn">To item call number: </label>
103 <input id="endcn" type="text" name="end_callnumber" size="15" />
108 <fieldset class="rows">
109 <legend>Accession date (inclusive)</legend>
112 <label for="from">Start date:</label>
113 <input type="text" size="10" id="from" name="start_accession" value="[% from | html %]" class="flatpickr" data-date_to="to" />
116 <label for="to">End date:</label>
117 <input size="10" id="to" name="end_accession" value="[% end_accession | html %]" type="text" class="flatpickr" />
123 <fieldset class="rows">
128 <li>File containing a list of biblionumbers with one biblionumber per line. This list works as a filter: it is compatible with other parameters. (File types accepted: .csv and .txt)</li>
129 <li><label for="id_list_file">File: </label> <input type="file" id="id_list_file" name="id_list_file" /></li>
132 <fieldset class="rows">
133 <legend> Options</legend>
135 <label for="dont_export_item">Don't export items:</label>
136 <input id="dont_export_item" type="checkbox" name="dont_export_item" />
139 <label for="strip_items_not_from_libraries">Remove items not owned by selected libraries:</label>
140 <input id="strip_items_not_from_libraries" type="checkbox" name="strip_items_not_from_libraries" />
143 <label for="export_remove_fields">Don't export fields:</label>
144 <input id="export_remove_fields" type="text" name="export_remove_fields" value="[% export_remove_fields | html %]" />
145 separate by a blank. (e.g., 100a 200 606)
148 <fieldset class="rows">
153 <label for="output_format">File format: </label>
154 <select id="output_format" name="output_format">
155 <option value="iso2709">MARC</option>
156 <option value="xml">XML</option>
157 [% IF csv_profiles %]
158 <option value="csv">CSV</option>
160 <option value="csv" disabled data-toggle="tooltip" data-placement="left" title="You must create a CSV profile for MARC exports to use this option.">CSV</option>
164 <li class="csv_profiles">
165 <label for="bibs_csv_profile">CSV profile: </label>
166 <select id="bibs_csv_profile" name="csv_profile_id">
167 [% FOR csv_profile IN csv_profiles %]
168 <option value="[% csv_profile.export_format_id | html %]">[% csv_profile.profile | html %]</option>
173 <label for="filename">File name:</label><input id="filename" type="text" name="filename" value="koha.mrc" />
176 <input type="hidden" name="op" value="export" />
177 <input type="hidden" name="record_type" value="bibs" />
179 <fieldset class="action"><input type="submit" value="Export bibliographic records" class="button" /></fieldset>
184 <form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/tools/export.pl">
185 <fieldset class="rows">
186 <legend> Select records to export </legend>
188 <label for="start">From authid: </label>
189 <input id="start" type="text" name="starting_authid" size="6" />
192 <label for="end">To authid: </label>
193 <input id="end" type="text" name="ending_authid" size="6" />
196 <label for="authtype">Authority type: </label>
197 <select name="authtype" id="authtype">
198 <option value="">-- All --</option>
199 [% FOREACH authority_type IN authority_types %]
200 <option value="[% authority_type.authtypecode | html %]">[% authority_type.authtypetext | html %]</option>
206 <fieldset class="rows">
211 <li>File containing a list of authids with one authid per line. This list works as a filter: it is compatible with other parameters. (File types accepted: .csv and .txt)</li>
212 <li><label for="id_list_file">File:</label> <input type="file" id="id_list_file" name="id_list_file" /></li>
215 <fieldset class="rows">
216 <legend>Options</legend>
219 <label for="export_remove_fields">Don't export fields:</label>
220 <input id="export_remove_fields" type="text" name="export_remove_fields" />
221 separate by a blank. (e.g., 100a 200 606)
224 <fieldset class="rows">
225 <legend>Output format</legend>
227 <label for="output_format">File format: </label>
228 <select id="output_format_auth" name="output_format">
229 <option value="marc">MARC</option>
230 <option value="xml">XML</option>
234 <label for="filename_auth">File name:</label><input id="filename_auth" type="text" name="filename_auth" value="koha.mrc" />
237 <input type="hidden" name="op" value="export" />
238 <input type="hidden" name="record_type" value="auths" />
240 <fieldset class="action"><input type="submit" value="Export authority records" class="button" /></fieldset>
244 [% IF ( allow_db_export ) %]
246 <form method="post" action="/cgi-bin/koha/tools/export.pl">
247 <p><strong>Note : This export file will be very large, and is generated nightly.</strong></p>
248 <fieldset class="rows">
249 <legend> Choose a file </legend>
250 [% IF ( dbfiles && (dbfiles.size > 0) ) %]
252 [% FOREACH dbfile IN dbfiles %]
253 <li><input type="radio" name="filename" value="[% dbfile | html %]">[% dbfile | html %]</input></li>
257 <p>Unfortunately, no backups are available.</p>
261 [% IF ( dbfiles && (dbfiles.size > 0) ) %]
262 <input type="hidden" name="op" value="export" />
263 <input type="hidden" name="record_type" value="db" />
264 <fieldset class="action"><input type="submit" value="Download database" class="button" /></fieldset>
270 [% IF ( allow_conf_export ) %]
272 <form method="post" action="/cgi-bin/koha/tools/export.pl">
273 <p><strong>Note : This export file will be very large, and is generated nightly.</strong></p>
274 <fieldset class="rows">
275 <legend> Choose a file </legend>
276 [% IF ( conffiles && (conffiles.size > 0) ) %]
278 [% FOREACH conffile IN conffiles %]
279 <li><input type="radio" name="filename" value="[% conffile | html %]">[% conffile | html %]</input></li>
283 <p>Unfortunately, no backups are available.</p>
287 [% IF ( conffiles && (conffiles.size > 0) ) %]
288 <input type="hidden" name="op" value="export" />
289 <input type="hidden" name="record_type" value="conf" />
290 <fieldset class="action"><input type="submit" value="Download configuration" class="button" /></fieldset>
299 </div> <!-- /.col-sm-10.col-sm-push-2 -->
301 <div class="col-sm-2 col-sm-pull-10">
303 [% INCLUDE 'tools-menu.inc' %]
305 </div> <!-- .col-sm-2.col-sm-pull-10 -->
306 </div> <!-- /.row -->
308 [% MACRO jsinclude BLOCK %]
309 [% Asset.js("js/tools-menu.js") | $raw %]
310 [% INCLUDE 'calendar.inc' %]
312 $(document).ready(function() {
313 $('#exporttype').tabs();
315 $("li.csv_profiles").hide();
317 $("#bibs select[name='output_format']").on('change', function(){
318 var format = $(this).val();
319 if ( format == 'csv' ) {
320 $("#bibs li.csv_profiles").show();
322 $("#bibs li.csv_profiles").hide();
325 $("#checkall").on("click",function(e){
327 $(".branch_select").prop("checked",1);
329 $("#checknone").on("click",function(e){
331 $(".branch_select").prop("checked",0);
334 $('#output_format').change(function(){
335 var filename = $('#filename').val();
336 var file_name = filename.split(".");
337 var extension = $(this).val();
338 if (extension == "iso2709") {
341 $('#filename').val(file_name[0] + "." + extension);
343 $('#output_format_auth').change(function(){
344 var filename_auth = $('#filename_auth').val();
345 var file_name_auth = filename_auth.split(".");
346 var extension = $(this).val();
347 if (extension == "marc") {
350 $('#filename_auth').val(file_name_auth[0] + "." + extension);
356 [% INCLUDE 'intranet-bottom.inc' %]