Bug 12404: tools/export.pl allows CSV export
[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">
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 authtypeloo IN authtypeloop %]
176                 [% IF ( authtypeloo.selected ) %]
177                 <option value="[% authtypeloo.value %]" selected="selected">[% authtypeloo.description %]</option>
178 [% ELSE %]
179                 <option value="[% authtypeloo.value %]">[% authtypeloo.description %]</option>
180 [% END %]
181                 [% END %]
182             </select>
183         </li>
184         </ol>
185     </fieldset>
186     <fieldset class="rows">
187     <legend>
188         Use a file
189     </legend>
190         <ol>
191         <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>
192         <li><label for="id_list_file">File : </label> <input type="file" id="id_list_file" name="id_list_file" /></li>
193         </ol>
194     </fieldset>
195     <fieldset class="rows">
196     <legend>Options</legend>
197         <ol>
198         <li>
199             <label for="export_remove_fields">Don't export fields</label>
200             <input id="export_remove_fields" type="text" name="export_remove_fields" />
201             separate by a blank. (e.g., 100a 200 606)
202         </li></ol>
203     </fieldset>
204     <fieldset class="rows">
205     <legend>Output format</legend>
206         <ol><li>
207             <label for="output_format">File format: </label>
208             <select id="output_format" name="output_format">
209                 <option value="marc">marc</option>
210                 <option value="xml">xml</option>
211             </select>
212         </li>
213         <li>
214         <label for="filename">File name:</label><input id="filename" type="text" name="filename" value="koha.mrc" />
215         </li></ol>
216     </fieldset>
217     <input type="hidden" name="op" value="export" />
218     <input type="hidden" name="record_type" value="auths" />
219
220     <fieldset class="action"><input type="submit" value="Export authority records" class="button" /></fieldset>
221 </form>
222 </div>
223
224 [% IF ( allow_db_export ) %]
225 <div id="db">
226 <form method="post" action="/cgi-bin/koha/tools/export.pl">
227     <p><b>Note : This export file will be very large, and is generated nightly.</b></p>
228     <fieldset class="rows">
229     <legend> Choose a file </legend>
230     [% IF ( dbfiles && (dbfiles.size > 0) ) %]
231         <ul>
232         [% FOREACH dbfile IN dbfiles %]
233             <li><input type="radio" name="filename" value="[% dbfile %]">[% dbfile %]</input></li>
234         [% END %]
235         </ul>
236     [% ELSE %]
237         <p>Unfortunately, no backups are available.</p>
238     [% END %]
239     </fieldset>
240
241     [% IF ( dbfiles && (dbfiles.size > 0) ) %]
242         <input type="hidden" name="op" value="export" />
243         <input type="hidden" name="record_type" value="db" />
244         <fieldset class="action"><input type="submit" value="Download database" class="button" /></fieldset>
245     [% END %]
246 </form>
247 </div>
248 [% END %]
249
250 [% IF ( allow_conf_export ) %]
251 <div id="conf">
252 <form method="post" action="/cgi-bin/koha/tools/export.pl">
253     <p><b>Note : This export file will be very large, and is generated nightly.</b></p>
254     <fieldset class="rows">
255     <legend> Choose a file </legend>
256     [% IF ( conffiles && (conffiles.size > 0) ) %]
257         <ul>
258         [% FOREACH conffile IN conffiles %]
259             <li><input type="radio" name="filename" value="[% conffile %]">[% conffile %]</input></li>
260         [% END %]
261         </ul>
262     [% ELSE %]
263         <p>Unfortunately, no backups are available.</p>
264     [% END %]
265     </fieldset>
266
267     [% IF ( conffiles && (conffiles.size > 0) ) %]
268         <input type="hidden" name="op" value="export" />
269         <input type="hidden" name="record_type" value="conf" />
270         <fieldset class="action"><input type="submit" value="Download configuration" class="button" /></fieldset>
271     [% END %]
272 </form>
273 </div>
274 [% END %]
275
276 </div>
277
278 </div>
279 </div>
280 <div class="yui-b noprint">
281 [% INCLUDE 'tools-menu.inc' %]
282 </div>
283 </div>
284 [% INCLUDE 'intranet-bottom.inc' %]