Bug 29602: Surround strings with span tag
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / export.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Branches %]
4 [% SET footerjs = 1 %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Export data &rsaquo; Tools &rsaquo; Koha</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 <style>
9     fieldset.rows fieldset.rows {
10         width: 90%;
11     }
12 </style>
13 </head>
14
15 <body id="tools_export" class="tools">
16 [% INCLUDE 'header.inc' %]
17 [% INCLUDE 'cat-search.inc' %]
18
19 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
20     <ol>
21         <li>
22             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
23         </li>
24         <li>
25             <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
26         </li>
27         <li>
28             <a href="#" aria-current="page">
29                 Export data
30             </a>
31         </li>
32     </ol>
33 </nav>
34
35 <div class="main container-fluid">
36     <div class="row">
37         <div class="col-sm-10 col-sm-push-2">
38             <main>
39
40 [% FOR m IN messages %]
41     <div class="dialog [% m.type | html %]">
42         [% SWITCH m.code %]
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 %]
45         [% END %]
46     </div>
47 [% END %]
48
49 <div id="exporttype" class="toptabs">
50 <ul>
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>
55 [% END %]
56 [% IF ( allow_conf_export ) %]
57 <li><a href="#conf">Export configuration</a></li>
58 [% END %]
59 </ul>
60 <div id="bibs">
61 <p>
62     <strong>Note : The items are exported by this tool unless specified.</strong>
63 </p>
64
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>
68         <ol>
69         <li>
70             <label for="start">From biblionumber: </label>
71             <input id="start" type="text" name="StartingBiblionumber" size="5" />
72         </li>
73         <li>
74             <label for="end">To biblionumber: </label>
75             <input id="end" type="text" name="EndingBiblionumber" size="5" />
76         </li>
77         
78         <li>
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>
84                 [% END %]
85             </select>
86         </li>
87         
88         <li>
89             <label>With items owned by the following libraries: </label>
90             [% INCLUDE 'branch-selector.inc' branches = libraries %]
91         </li>
92     </ol>
93
94     <fieldset class="rows">
95         <legend>Call number range</legend>
96         <ol>
97             <li>
98                 <label for="startcn">From item call number: </label>
99                 <input id="startcn" type="text" name="start_callnumber" size="15" />
100             </li>
101             <li>
102                 <label for="endcn">To item call number: </label>
103                 <input id="endcn" type="text" name="end_callnumber" size="15" />
104             </li>
105         </ol>
106     </fieldset>
107
108     <fieldset class="rows">
109         <legend>Accession date (inclusive)</legend>
110         <ol>
111             <li>
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" />
114             </li>
115             <li>
116                 <label for="to">End date:</label>
117                 <input size="10" id="to" name="end_accession" value="[% end_accession | html %]" type="text" class="flatpickr" />
118             </li>
119         </ol>
120     </fieldset>
121
122     </fieldset>
123     <fieldset class="rows">
124     <legend>
125         Use a file
126     </legend>
127         <ol>
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>
130         </ol>
131     </fieldset>
132     <fieldset class="rows">
133     <legend> Options</legend>
134 <ol>        <li>
135         <label for="dont_export_item">Don't export items:</label>
136         <input id="dont_export_item" type="checkbox" name="dont_export_item" />
137         </li>
138         <li>
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" />
141         </li>
142         <li>
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)
146         </li></ol>
147     </fieldset>
148     <fieldset class="rows">
149     <legend>
150         Output format
151     </legend>
152         <ol><li>
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>
159                 [% ELSE %]
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>
161                 [% END %]
162             </select>
163         </li>
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>
169                 [% END %]
170             </select>
171         </li>
172         <li>
173         <label for="filename">File name:</label><input id="filename" type="text" name="filename" value="koha.mrc" />
174         </li></ol>
175     </fieldset>
176     <input type="hidden" name="op" value="export" />
177     <input type="hidden" name="record_type" value="bibs" />
178
179     <fieldset class="action"><input type="submit" value="Export bibliographic records" class="button" /></fieldset>
180 </form>
181 </div>
182
183 <div id="auths">
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>
187         <ol><li>
188             <label for="start">From authid: </label>
189             <input id="start" type="text" name="starting_authid" size="6" />
190         </li>
191         <li>
192             <label for="end">To authid: </label>
193             <input id="end" type="text" name="ending_authid" size="6" />
194         </li>
195         <li>
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>
201                 [% END %]
202             </select>
203         </li>
204         </ol>
205     </fieldset>
206     <fieldset class="rows">
207     <legend>
208         Use a file
209     </legend>
210         <ol>
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>
213         </ol>
214     </fieldset>
215     <fieldset class="rows">
216     <legend>Options</legend>
217         <ol>
218         <li>
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)
222         </li></ol>
223     </fieldset>
224     <fieldset class="rows">
225     <legend>Output format</legend>
226         <ol><li>
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>
231             </select>
232         </li>
233         <li>
234         <label for="filename_auth">File name:</label><input id="filename_auth" type="text" name="filename_auth" value="koha.mrc" />
235         </li></ol>
236     </fieldset>
237     <input type="hidden" name="op" value="export" />
238     <input type="hidden" name="record_type" value="auths" />
239
240     <fieldset class="action"><input type="submit" value="Export authority records" class="button" /></fieldset>
241 </form>
242 </div>
243
244 [% IF ( allow_db_export ) %]
245 <div id="db">
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) ) %]
251         <ul>
252         [% FOREACH dbfile IN dbfiles %]
253             <li><input type="radio" name="filename" value="[% dbfile | html %]">[% dbfile | html %]</input></li>
254         [% END %]
255         </ul>
256     [% ELSE %]
257         <p>Unfortunately, no backups are available.</p>
258     [% END %]
259     </fieldset>
260
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>
265     [% END %]
266 </form>
267 </div>
268 [% END %]
269
270 [% IF ( allow_conf_export ) %]
271 <div id="conf">
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) ) %]
277         <ul>
278         [% FOREACH conffile IN conffiles %]
279             <li><input type="radio" name="filename" value="[% conffile | html %]">[% conffile | html %]</input></li>
280         [% END %]
281         </ul>
282     [% ELSE %]
283         <p>Unfortunately, no backups are available.</p>
284     [% END %]
285     </fieldset>
286
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>
291     [% END %]
292 </form>
293 </div>
294 [% END %]
295
296 </div>
297
298             </main>
299         </div> <!-- /.col-sm-10.col-sm-push-2 -->
300
301         <div class="col-sm-2 col-sm-pull-10">
302             <aside>
303                 [% INCLUDE 'tools-menu.inc' %]
304             </aside>
305         </div> <!-- .col-sm-2.col-sm-pull-10 -->
306      </div> <!-- /.row -->
307
308 [% MACRO jsinclude BLOCK %]
309     [% Asset.js("js/tools-menu.js") | $raw %]
310     [% INCLUDE 'calendar.inc' %]
311     <script>
312         $(document).ready(function() {
313             $('#exporttype').tabs();
314
315             $("li.csv_profiles").hide();
316
317             $("#bibs select[name='output_format']").on('change', function(){
318                 var format = $(this).val();
319                 if ( format == 'csv' ) {
320                     $("#bibs li.csv_profiles").show();
321                 } else {
322                     $("#bibs li.csv_profiles").hide();
323                 }
324             });
325             $("#checkall").on("click",function(e){
326                 e.preventDefault();
327                 $(".branch_select").prop("checked",1);
328             });
329             $("#checknone").on("click",function(e){
330                 e.preventDefault();
331                 $(".branch_select").prop("checked",0);
332             });
333
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") {
339                     extension = "mrc";
340                 }
341                 $('#filename').val(file_name[0] + "." + extension);
342             });
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") {
348                     extension = "mrc";
349                 }
350                 $('#filename_auth').val(file_name_auth[0] + "." + extension);
351             });
352         });
353     </script>
354 [% END %]
355
356 [% INCLUDE 'intranet-bottom.inc' %]