Lines 84-90
function Check(f) {
Link Here
|
84 |
} |
84 |
} |
85 |
}); |
85 |
}); |
86 |
$('form.form_export').submit(function() { |
86 |
$('form.form_export').submit(function() { |
87 |
$('.import_export_options').hide(); |
87 |
$('.modal').modal("hide"); |
88 |
return true; |
88 |
return true; |
89 |
}); |
89 |
}); |
90 |
$('form.form_import').submit(function() { |
90 |
$('form.form_import').submit(function() { |
Lines 93-99
function Check(f) {
Link Here
|
93 |
if (/(?:\.csv|\.sql|\.ods|\.xml)$/.test(obj.val())) { |
93 |
if (/(?:\.csv|\.sql|\.ods|\.xml)$/.test(obj.val())) { |
94 |
if (confirm(_("Do you really want to import the framework fields and subfields? This will overwrite the current configuration. For safety reasons please use the export option to make a backup"))) { |
94 |
if (confirm(_("Do you really want to import the framework fields and subfields? This will overwrite the current configuration. For safety reasons please use the export option to make a backup"))) { |
95 |
var frameworkcode = $('#' + id + ' input:hidden[name=frameworkcode]').val(); |
95 |
var frameworkcode = $('#' + id + ' input:hidden[name=frameworkcode]').val(); |
96 |
$('#importing_' + frameworkcode).find("span").html(_("Importing to framework:")+"<strong>" + frameworkcode + "</strong><br />" +_("Importing from file:")+"<i>" + obj.val().replace(new RegExp("^.+[/\\\\]"),"") + "</i>"); |
96 |
$('#importing_' + frameworkcode).find("span").html(_("Importing to framework:")+"<strong>" + frameworkcode + "</strong>. " +_("Importing from file:")+"<i>" + obj.val().replace(new RegExp("^.+[/\\\\]"),"") + "</i>"); |
97 |
if (navigator.userAgent.toLowerCase().indexOf('msie') != -1) { |
97 |
if (navigator.userAgent.toLowerCase().indexOf('msie') != -1) { |
98 |
var timestamp = new Date().getTime(); |
98 |
var timestamp = new Date().getTime(); |
99 |
$('#importing_' + frameworkcode).find("img").attr('src', '[% interface %]/[% theme %]/img/loading-small.gif' + '?' +timestamp); |
99 |
$('#importing_' + frameworkcode).find("img").attr('src', '[% interface %]/[% theme %]/img/loading-small.gif' + '?' +timestamp); |
Lines 101-106
function Check(f) {
Link Here
|
101 |
$('#importing_' + frameworkcode).css('display', 'block'); |
101 |
$('#importing_' + frameworkcode).css('display', 'block'); |
102 |
if (navigator.userAgent.toLowerCase().indexOf('firefox') == -1) $("body").css("cursor", "progress"); |
102 |
if (navigator.userAgent.toLowerCase().indexOf('firefox') == -1) $("body").css("cursor", "progress"); |
103 |
importing = true; |
103 |
importing = true; |
|
|
104 |
$(".modal-footer,.closebtn").hide(); |
104 |
return true; |
105 |
return true; |
105 |
} else |
106 |
} else |
106 |
return false; |
107 |
return false; |
Lines 192-231
function Check(f) {
Link Here
|
192 |
<td><a href="marctagstructure.pl?frameworkcode=[% frameworkcode %]">MARC structure</a></td> |
193 |
<td><a href="marctagstructure.pl?frameworkcode=[% frameworkcode %]">MARC structure</a></td> |
193 |
<td> </td> |
194 |
<td> </td> |
194 |
<td> </td> |
195 |
<td> </td> |
195 |
<td><div class="import_export"><a class="import_export_fw" href="#" title="Export [% frameworkcode %] framework structure (fields, subfields) to a spreadsheet file (.csv, .xml, .ods) or SQL file">Export</a> |
196 |
<td> |
196 |
<div class="import_export_options"> |
197 |
|
|
|
198 |
<!-- Button to trigger modal --> |
199 |
<a href="#" data-toggle="modal" data-target="#exportModal_[% frameworkcode %]">Export</a> |
200 |
<!-- Modal --> |
201 |
<div class="modal hide" id="exportModal_[% frameworkcode %]" tabindex="-1" role="dialog" aria-labelledby="exportLabelexportModal_[% frameworkcode %]" aria-hidden="true"> |
202 |
<div class="modal-header"> |
203 |
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> |
204 |
<h3 id="exportLabelexportModal_[% frameworkcode %]">Export default framework</h3> |
205 |
</div> |
197 |
<form action="import_export_framework.pl" name="form_[% frameworkcode %]" method="get" target="_blank" class="form_export"> |
206 |
<form action="import_export_framework.pl" name="form_[% frameworkcode %]" method="get" target="_blank" class="form_export"> |
198 |
<fieldset class="rows"> |
207 |
<div class="modal-body"> |
199 |
<legend>Export framework</legend> |
208 |
<fieldset> |
200 |
<input type="hidden" name="frameworkcode" value="[% frameworkcode %]" /> |
209 |
<input type="hidden" name="frameworkcode" value="[% frameworkcode %]" /> |
201 |
<ol> |
210 |
<p><label for="csv_type_export_[% frameworkcode %]"><input type="radio" name="type_export_[% frameworkcode %]" value="csv" id="csv_type_export_[% frameworkcode %]" checked="checked" /> Export to CSV spreadsheet</label></p> |
202 |
<li><label for="csv_type_export_[% frameworkcode %]">Export to CSV spreadsheet</label><input type="radio" name="type_export_[% frameworkcode %]" value="csv" id="csv_type_export_[% frameworkcode %]" checked="checked" /></li> |
211 |
<p><label for="xml_type_export_[% frameworkcode %]"><input type="radio" name="type_export_[% frameworkcode %]" value="excel" id="xml_type_export_[% frameworkcode %]" /> Export to Excel with XML format, compatible with OpenOffice/LibreOffice as well</label></p> |
203 |
<li><label for="xml_type_export_[% frameworkcode %]">Export to Excel with XML format, compatible with OpenOffice/LibreOffice as well</label><input type="radio" name="type_export_[% frameworkcode %]" value="excel" id="xml_type_export_[% frameworkcode %]" /></li> |
212 |
<p><label for="ods_type_export_[% frameworkcode %]"><input type="radio" name="type_export_[% frameworkcode %]" value="ods" id="ods_type_export_[% frameworkcode %]" /> Export to OpenDocument spreadsheet format</label></p> |
204 |
<li><label for="ods_type_export_[% frameworkcode %]">Export to OpenDocument spreadsheet format</label><input type="radio" name="type_export_[% frameworkcode %]" value="ods" id="ods_type_export_[% frameworkcode %]" /></li> |
213 |
<p><label for="sql_type_export_[% frameworkcode %]"><input type="radio" name="type_export_[% frameworkcode %]" value="sql" id="sql_type_export_[% frameworkcode %]" /> Export to SQL</label></p> |
205 |
<li><label for="sql_type_export_[% frameworkcode %]">Export to SQL</label><input type="radio" name="type_export_[% frameworkcode %]" value="sql" id="sql_type_export_[% frameworkcode %]" /></li> |
214 |
|
206 |
</ol> |
215 |
</fieldset> |
207 |
</fieldset> |
216 |
</div> |
208 |
<fieldset class="action"><input type="submit" href="#" value="Export" title="Export to a spreadsheet" /> <a href="#" class="import_export_close cancel">Cancel</a> </fieldset> |
217 |
<div class="modal-footer"> |
|
|
218 |
<button type="submit" class="btn">Export</button> |
219 |
<button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button> |
220 |
</div> |
209 |
</form> |
221 |
</form> |
210 |
</div> |
222 |
</div> |
211 |
</div> |
223 |
|
212 |
</td> |
224 |
</td> |
213 |
<td><div class="import_export"><a href="#" class="import_export_fw" title="Import [% frameworkcode %] framework structure (fields, subfields) from a spreadsheet file (.csv, .xml, .ods) or SQL file">Import</a> |
225 |
<td> |
214 |
<div class="import_export_options"> |
226 |
|
|
|
227 |
<!-- Button to trigger modal --> |
228 |
<a href="#" data-toggle="modal" data-target="#importModal_[% frameworkcode %][% loop.count %]">Import</a> |
229 |
<!-- Modal --> |
230 |
<div class="modal hide" id="importModal_[% frameworkcode %][% loop.count %]" tabindex="-1" role="dialog" aria-labelledby="importLabelexportModal_[% frameworkcode %][% loop.count %]" aria-hidden="true"> |
231 |
<div class="modal-header"> |
232 |
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> |
233 |
<h3 id="importLabelexportModal_[% frameworkcode %][% loop.count %]">Import default framework structure (fields and subfields) from a spreadsheet file (.csv, .xml, .ods) or SQL file</h3> |
234 |
</div> |
215 |
<form action="/cgi-bin/koha/admin/import_export_framework.pl" name="form_i_[% frameworkcode %]" id="form_i_[% frameworkcode %]" method="post" enctype="multipart/form-data" class="form_import"> |
235 |
<form action="/cgi-bin/koha/admin/import_export_framework.pl" name="form_i_[% frameworkcode %]" id="form_i_[% frameworkcode %]" method="post" enctype="multipart/form-data" class="form_import"> |
216 |
<fieldset class="rows"> |
236 |
<div class="modal-body"> |
217 |
<legend>Import [% frameworkcode %] framework structure (fields and subfields) from a spreadsheet file (.csv, .xml, .ods) or SQL file</legend> |
237 |
<input type="hidden" name="frameworkcode" value="[% frameworkcode %]" /> |
218 |
<input type="hidden" name="frameworkcode" value="[% frameworkcode %]" /> |
238 |
<input type="hidden" name="action" value="import" /> |
219 |
<input type="hidden" name="action" value="import" /> |
239 |
<p><label for="file_import_[% frameworkcode %]">Upload file:</label> <input type="file" name="file_import_[% frameworkcode %]" id="file_import_[% frameworkcode %]" class="input_import" /></p> |
220 |
<ol> |
240 |
<div id="importing_[% frameworkcode %]" style="display:none" class="importing"><img src="[% interface %]/[% theme %]/img/loading-small.gif" alt="" /><span class="importing_msg"></span></div> |
221 |
<li><label for="d_file_import_[% frameworkcode %]">Upload file:</label><input type="file" name="file_import_[% frameworkcode %]" id="d_file_import_[% frameworkcode %]" class="input_import" value="" autocomplete="off" /></li> |
241 |
</div> |
222 |
<li><div id="importing_[% frameworkcode %]" style="display:none" class="importing"><img src="[% interface %]/[% theme %]/img/loading-small.gif" /><span class="importing_msg"></span></div></li> |
242 |
<div class="modal-footer"> |
223 |
</ol> |
243 |
<button type="submit" class="btn">Import</button> |
224 |
</fieldset> |
244 |
<button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Close</button> |
225 |
<fieldset class="action"><input type="submit" value="Import" /> <a href="#" class="import_export_close cancel">Cancel</a> </fieldset> |
245 |
</div> |
226 |
</form> |
246 |
</form> |
227 |
</div> |
247 |
</div> |
228 |
</div> |
248 |
|
229 |
</td> |
249 |
</td> |
230 |
</tr> |
250 |
</tr> |
231 |
<!-- note highlight assignment appears backwards because we already have a normal row for Default --> |
251 |
<!-- note highlight assignment appears backwards because we already have a normal row for Default --> |
Lines 239-277
function Check(f) {
Link Here
|
239 |
<td><a href="[% loo.script_name %]?op=add_form&frameworkcode=[% loo.frameworkcode |html %]">Edit</a></td> |
259 |
<td><a href="[% loo.script_name %]?op=add_form&frameworkcode=[% loo.frameworkcode |html %]">Edit</a></td> |
240 |
<td><a href="[% loo.script_name %]?op=delete_confirm&frameworkcode=[% loo.frameworkcode |html %]">Delete</a></td> |
260 |
<td><a href="[% loo.script_name %]?op=delete_confirm&frameworkcode=[% loo.frameworkcode |html %]">Delete</a></td> |
241 |
<td> |
261 |
<td> |
242 |
<div class="import_export"><a class="import_export_fw" href="#" title="Export [% loo.frameworkcode %] framework structure (fields and subfields) to a spreadsheet file (.csv, .xml, .ods) or SQL file">Export</a> |
262 |
|
243 |
<div class="import_export_options"> |
263 |
<!-- Button to trigger modal --> |
244 |
<form action="import_export_framework.pl" name="form_[% loo.frameworkcode %]" method="get" target="_blank" class="form_export"> |
264 |
<a href="#" data-toggle="modal" data-target="#exportModal_[% loo.frameworkcode %][% loop.count %]">Export</a> |
245 |
<fieldset class="rows"> |
265 |
<!-- Modal --> |
246 |
<legend>Export framework</legend> |
266 |
<div class="modal hide" id="exportModal_[% loo.frameworkcode %][% loop.count %]" tabindex="-1" role="dialog" aria-labelledby="exportLabelexportModal_[% loo.frameworkcode %][% loop.count %]" aria-hidden="true"> |
247 |
<input type="hidden" name="frameworkcode" value="[% loo.frameworkcode %]" /> |
267 |
<div class="modal-header"> |
248 |
<ol> |
268 |
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> |
249 |
<li><label for="csv_type_export_[% loo.frameworkcode %][% loop.count %]">Export to CSV spreadsheet</label><input type="radio" name="type_export_[% loo.frameworkcode %]" value="csv" id="csv_type_export_[% loo.frameworkcode %][% loop.count %]" checked="checked" /></li> |
269 |
<h3 id="exportLabelexportModal_[% loo.frameworkcode %][% loop.count %]">Export [% loo.frameworktext %] framework</h3> |
250 |
<li><label for="xml_type_export_[% loo.frameworkcode %][% loop.count %]">Export to Excel as XML format, compatible with OpenOffice/LibreOffice as well</label><input type="radio" name="type_export_[% loo.frameworkcode %]" value="excel" id="xml_type_export_[% loo.frameworkcode %][% loop.count %]" /></li> |
270 |
</div> |
251 |
<li><label for="ods_type_export_[% loo.frameworkcode %][% loop.count %]">Export to OpenDocument spreadsheet format</label><input type="radio" name="type_export_[% loo.frameworkcode %]" value="ods" id="ods_type_export_[% loo.frameworkcode %][% loop.count %]" /></li> |
271 |
<form action="import_export_framework.pl" name="form_[% loo.frameworkcode %]" method="get" target="_blank" class="form_export"> |
252 |
<li><label for="sql_type_export_[% loo.frameworkcode %][% loop.count %]">Export to SQL</label><input type="radio" name="type_export_[% loo.frameworkcode %]" value="sql" id="sql_type_export_[% loo.frameworkcode %][% loop.count %]" /></li> |
272 |
<div class="modal-body"> |
253 |
</ol> |
273 |
<fieldset> |
254 |
</fieldset> |
274 |
<input type="hidden" name="frameworkcode" value="[% loo.frameworkcode %]" /> |
255 |
<fieldset class="action"><input type="submit" href="#" value="Export" title="Export to a spreadsheet" /> <a href="#" class="cancel import_export_close">Cancel</a> </fieldset> |
275 |
<p><label for="csv_type_export_[% loo.frameworkcode %][% loop.count %]"><input type="radio" name="type_export_[% loo.frameworkcode %]" value="csv" id="csv_type_export_[% loo.frameworkcode %][% loop.count %]" checked="checked" /> Export to CSV spreadsheet</label></p> |
|
|
276 |
<p><label for="xml_type_export_[% loo.frameworkcode %][% loop.count %]"><input type="radio" name="type_export_[% loo.frameworkcode %]" value="excel" id="xml_type_export_[% loo.frameworkcode %][% loop.count %]" /> Export to Excel with XML format, compatible with OpenOffice/LibreOffice as well</label></p> |
277 |
<p><label for="ods_type_export_[% loo.frameworkcode %][% loop.count %]"><input type="radio" name="type_export_[% loo.frameworkcode %]" value="ods" id="ods_type_export_[% loo.frameworkcode %][% loop.count %]" /> Export to OpenDocument spreadsheet format</label></p> |
278 |
<p><label for="sql_type_export_[% loo.frameworkcode %][% loop.count %]"><input type="radio" name="type_export_[% loo.frameworkcode %]" value="sql" id="sql_type_export_[% loo.frameworkcode %][% loop.count %]" /> Export to SQL</label></p> |
279 |
|
280 |
</fieldset> |
281 |
</div> |
282 |
<div class="modal-footer"> |
283 |
<button type="submit" class="btn">Export</button> |
284 |
<button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button> |
285 |
</div> |
256 |
</form> |
286 |
</form> |
257 |
</div> |
287 |
</div> |
258 |
</div> |
|
|
259 |
</td> |
288 |
</td> |
260 |
<td><div class="import_export"><a class="import_export_fw" href="#" title="Import [% loo.frameworkcode %] framework structure (fields and subfields) from a spreadsheet file (.csv, .xml, .ods) or SQL file">Import</a> |
289 |
<td> |
261 |
<div class="import_export_options"> |
290 |
|
262 |
<form action="/cgi-bin/koha/admin/import_export_framework.pl" name="form_i_[% loo.frameworkcode %]" id="form_i_[% loo.frameworkcode %]" method="post" enctype="multipart/form-data" class="form_import"> |
291 |
<!-- Button to trigger modal --> |
263 |
<fieldset class="rows"> |
292 |
<a href="#" data-toggle="modal" data-target="#importModal_[% loo.frameworkcode %][% loop.count %]">Import</a> |
264 |
<legend>Import [% frameworkcode %] framework structure (fields and subfields) from a spreadsheet file (.csv, .xml, .ods) or SQL file</legend> |
293 |
<!-- Modal --> |
265 |
<input type="hidden" name="frameworkcode" value="[% loo.frameworkcode %]" /> |
294 |
<div class="modal hide" id="importModal_[% loo.frameworkcode %][% loop.count %]" tabindex="-1" role="dialog" aria-labelledby="importLabelexportModal_[% loo.frameworkcode %][% loop.count %]" aria-hidden="true"> |
266 |
<input type="hidden" name="action" value="import" /> |
295 |
<div class="modal-header"> |
267 |
<ol> |
296 |
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> |
268 |
<li><label for="file_import_[% loo.frameworkcode %]">Upload file:</label><input type="file" name="file_import_[% loo.frameworkcode %]" id="file_import_[% loo.frameworkcode %]" class="input_import" value="" autocomplete="off" /></li> |
297 |
<h3 id="importLabelexportModal_[% loo.frameworkcode %][% loop.count %]">Import [% loo.frameworkcode %] framework structure (fields and subfields) from a spreadsheet file (.csv, .xml, .ods) or SQL file</h3> |
269 |
</ol> |
298 |
</div> |
270 |
</fieldset> |
299 |
<form action="/cgi-bin/koha/admin/import_export_framework.pl" name="form_i_[% loo.frameworkcode %]" id="form_i_[% loo.frameworkcode %]" method="post" enctype="multipart/form-data" class="form_import"> |
271 |
<fieldset class="action"><input type="submit" value="Import" /><div id="importing_[% loo.frameworkcode %]" style="display:none" class="importing"><img src="[% interface %]/[% theme %]/img/loading-small.gif" /><span class="importing_msg"></span></div> <a href="#" class="cancel import_export_close">Cancel</a> </fieldset> |
300 |
<div class="modal-body"> |
272 |
</form> |
301 |
<input type="hidden" name="frameworkcode" value="[% loo.frameworkcode %]" /> |
273 |
</div> |
302 |
<input type="hidden" name="action" value="import" /> |
274 |
</div> |
303 |
<p><label for="file_import_[% loo.frameworkcode %]">Upload file:</label> <input type="file" name="file_import_[% loo.frameworkcode %]" id="file_import_[% loo.frameworkcode %]" class="input_import" /></p> |
|
|
304 |
<div id="importing_[% loo.frameworkcode %]" style="display:none" class="importing"><img src="[% interface %]/[% theme %]/img/loading-small.gif" alt="" /><span class="importing_msg"></span></div> |
305 |
</div> |
306 |
<div class="modal-footer"> |
307 |
<button type="submit" class="btn">Import</button> |
308 |
<button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Close</button> |
309 |
</div> |
310 |
</form> |
311 |
</div> |
275 |
</td> |
312 |
</td> |
276 |
</tr> |
313 |
</tr> |
277 |
[% END %] |
314 |
[% END %] |
278 |
- |
|
|