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 [% WRAPPER 'header.inc' %]
17 [% INCLUDE 'cat-search.inc' %]
20 [% WRAPPER 'sub-header.inc' %]
21 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
24 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
27 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
30 <a href="#" aria-current="page">
38 <div class="main container-fluid">
40 <div class="col-sm-10 col-sm-push-2">
45 [% FOR m IN messages %]
46 <div class="dialog [% m.type | html %]">
48 [% CASE 'invalid_mimetype' %]<span>The file used does not have a valid format. Only csv and txt are allowed.</span>
49 [% CASE %][% m.code | html %]
54 <div id="exporttype" class="toptabs">
55 <ul class="nav nav-tabs" role="tablist">
56 <li role="presentation" class="active">
57 <a href="#bibs" aria-controls="bibs" role="tab" data-toggle="tab">Export bibliographic records</a>
59 <li role="presentation">
60 <a href="#auths" aria-controls="auths" role="tab" data-toggle="tab">Export authority records</a>
62 [% IF ( allow_db_export ) %]
63 <li role="presentation">
64 <a href="#db" aria-controls="db" role="tab" data-toggle="tab">Export database</a>
67 [% IF ( allow_conf_export ) %]
68 <li role="presentation">
69 <a href="#conf" aria-controls="conf" role="tab" data-toggle="tab">Export configuration</a>
73 <div class="tab-content">
74 <div id="bibs" role="tabpanel" class="tab-pane active">
76 <strong>Note : The items are exported by this tool unless specified.</strong>
79 <form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/tools/export.pl">
80 <fieldset class="rows">
81 <legend> Select records to export </legend>
84 <label for="start">From biblionumber: </label>
85 <input id="start" type="text" name="StartingBiblionumber" size="5" />
88 <label for="end">To biblionumber: </label>
89 <input id="end" type="text" name="EndingBiblionumber" size="5" />
93 <label for="itemtype">Item type: </label>
94 <select name="itemtype" id="itemtype" multiple>
95 <option value="">-- All --</option>
96 [% FOREACH itemtype IN itemtypes %]
97 <option value="[% itemtype.itemtype | html %]">[% itemtype.translated_description | html %]</option>
103 <label>With items owned by the following libraries: </label>
104 [% INCLUDE 'branch-selector.inc' branches = libraries %]
108 <fieldset class="rows">
109 <legend>Call number range</legend>
112 <label for="startcn">From item call number: </label>
113 <input id="startcn" type="text" name="start_callnumber" size="15" />
116 <label for="endcn">To item call number: </label>
117 <input id="endcn" type="text" name="end_callnumber" size="15" />
122 <fieldset class="rows">
123 <legend>Accession date (inclusive)</legend>
126 <label for="from">Start date:</label>
127 <input type="text" size="10" id="from" name="start_accession" value="[% from | html %]" class="flatpickr" data-date_to="to" />
130 <label for="to">End date:</label>
131 <input size="10" id="to" name="end_accession" value="[% end_accession | html %]" type="text" class="flatpickr" />
137 <fieldset class="rows">
142 <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>
143 <li><label for="id_list_file">File: </label> <input type="file" id="id_list_file" name="id_list_file" /></li>
146 <fieldset class="rows">
147 <legend> Options</legend>
149 <label for="dont_export_item">Don't export items:</label>
150 <input id="dont_export_item" type="checkbox" name="dont_export_item" />
153 <label for="strip_items_not_from_libraries">Remove items not owned by selected libraries:</label>
154 <input id="strip_items_not_from_libraries" type="checkbox" name="strip_items_not_from_libraries" />
157 <label for="export_remove_fields">Don't export fields:</label>
158 <input id="export_remove_fields" type="text" name="export_remove_fields" value="[% export_remove_fields | html %]" />
159 separate by a blank. (e.g., 100a 200 606)
162 <fieldset class="rows">
167 <label for="output_format">File format: </label>
168 <select id="output_format" name="output_format">
169 <option value="iso2709">MARC</option>
170 <option value="xml">XML</option>
171 [% IF csv_profiles %]
172 <option value="csv">CSV</option>
174 <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>
178 <li class="csv_profiles">
179 <label for="bibs_csv_profile">CSV profile: </label>
180 <select id="bibs_csv_profile" name="csv_profile_id">
181 [% FOR csv_profile IN csv_profiles %]
182 <option value="[% csv_profile.export_format_id | html %]">[% csv_profile.profile | html %]</option>
187 <label for="filename">File name:</label><input id="filename" type="text" name="filename" value="koha.mrc" />
190 <input type="hidden" name="op" value="export" />
191 <input type="hidden" name="record_type" value="bibs" />
193 <fieldset class="action"><input type="submit" value="Export bibliographic records" class="button" /></fieldset>
197 <div id="auths" role="tabpanel" class="tab-pane">
198 <form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/tools/export.pl">
199 <fieldset class="rows">
200 <legend> Select records to export </legend>
202 <label for="start">From authid: </label>
203 <input id="start" type="text" name="starting_authid" size="6" />
206 <label for="end">To authid: </label>
207 <input id="end" type="text" name="ending_authid" size="6" />
210 <label for="authtype">Authority type: </label>
211 <select name="authtype" id="authtype">
212 <option value="">-- All --</option>
213 [% FOREACH authority_type IN authority_types %]
214 <option value="[% authority_type.authtypecode | html %]">[% authority_type.authtypetext | html %]</option>
220 <fieldset class="rows">
225 <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>
226 <li><label for="id_list_file">File:</label> <input type="file" id="id_list_file" name="id_list_file" /></li>
229 <fieldset class="rows">
230 <legend>Options</legend>
233 <label for="export_remove_fields">Don't export fields:</label>
234 <input id="export_remove_fields" type="text" name="export_remove_fields" />
235 separate by a blank. (e.g., 100a 200 606)
238 <fieldset class="rows">
239 <legend>Output format</legend>
241 <label for="output_format">File format: </label>
242 <select id="output_format_auth" name="output_format">
243 <option value="marc">MARC</option>
244 <option value="xml">XML</option>
248 <label for="filename_auth">File name:</label><input id="filename_auth" type="text" name="filename_auth" value="koha.mrc" />
251 <input type="hidden" name="op" value="export" />
252 <input type="hidden" name="record_type" value="auths" />
254 <fieldset class="action"><input type="submit" value="Export authority records" class="button" /></fieldset>
258 [% IF ( allow_db_export ) %]
259 <div id="db" role="tabpanel" class="tab-pane">
260 <form method="post" action="/cgi-bin/koha/tools/export.pl">
261 <p><strong>Note : This export file will be very large, and is generated nightly.</strong></p>
262 <fieldset class="rows">
263 <legend> Choose a file </legend>
264 [% IF ( dbfiles && (dbfiles.size > 0) ) %]
266 [% FOREACH dbfile IN dbfiles %]
267 <li><input type="radio" name="filename" value="[% dbfile | html %]">[% dbfile | html %]</input></li>
271 <p>Unfortunately, no backups are available.</p>
275 [% IF ( dbfiles && (dbfiles.size > 0) ) %]
276 <input type="hidden" name="op" value="export" />
277 <input type="hidden" name="record_type" value="db" />
278 <fieldset class="action"><input type="submit" value="Download database" class="button" /></fieldset>
284 [% IF ( allow_conf_export ) %]
285 <div id="conf" role="tabpanel" class="tab-pane">
286 <form method="post" action="/cgi-bin/koha/tools/export.pl">
287 <p><strong>Note : This export file will be very large, and is generated nightly.</strong></p>
288 <fieldset class="rows">
289 <legend> Choose a file </legend>
290 [% IF ( conffiles && (conffiles.size > 0) ) %]
292 [% FOREACH conffile IN conffiles %]
293 <li><input type="radio" name="filename" value="[% conffile | html %]">[% conffile | html %]</input></li>
297 <p>Unfortunately, no backups are available.</p>
301 [% IF ( conffiles && (conffiles.size > 0) ) %]
302 <input type="hidden" name="op" value="export" />
303 <input type="hidden" name="record_type" value="conf" />
304 <fieldset class="action"><input type="submit" value="Download configuration" class="button" /></fieldset>
309 </div> <!-- /.tab-content -->
313 </div> <!-- /.col-sm-10.col-sm-push-2 -->
315 <div class="col-sm-2 col-sm-pull-10">
317 [% INCLUDE 'cat-menu.inc' %]
319 </div> <!-- .col-sm-2.col-sm-pull-10 -->
320 </div> <!-- /.row -->
322 [% MACRO jsinclude BLOCK %]
323 [% INCLUDE 'calendar.inc' %]
325 $(document).ready(function() {
327 $("li.csv_profiles").hide();
329 $("#bibs select[name='output_format']").on('change', function(){
330 var format = $(this).val();
331 if ( format == 'csv' ) {
332 $("#bibs li.csv_profiles").show();
334 $("#bibs li.csv_profiles").hide();
337 $("#checkall").on("click",function(e){
339 $(".branch_select").prop("checked",1);
341 $("#checknone").on("click",function(e){
343 $(".branch_select").prop("checked",0);
346 $('#output_format').change(function(){
347 var filename = $('#filename').val();
348 var file_name = filename.split(".");
349 var extension = $(this).val();
350 if (extension == "iso2709") {
353 $('#filename').val(file_name[0] + "." + extension);
355 $('#output_format_auth').change(function(){
356 var filename_auth = $('#filename_auth').val();
357 var file_name_auth = filename_auth.split(".");
358 var extension = $(this).val();
359 if (extension == "marc") {
362 $('#filename_auth').val(file_name_auth[0] + "." + extension);
368 [% INCLUDE 'intranet-bottom.inc' %]