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