Bug 13952: (follow-up) Removing XML options

Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com>

Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Aleisha Amohia 2020-04-21 07:22:28 +00:00 committed by Fridolin Somers
parent 3880159360
commit 30a572c4d2
3 changed files with 10 additions and 15 deletions

View file

@ -61,10 +61,6 @@ if ($action eq 'export' && $input->request_method() eq 'GET') {
binmode(STDOUT,':encoding(UTF-8)');
print $input->header(-type => 'application/vnd.ms-excel', -attachment => 'export_' . $authtypecode . '.csv');
print $strXml;
} elsif ($format eq 'excel') {
# Excel-xml file
print $input->header(-type => 'application/excel', -attachment => 'export_' . $authtypecode . '.xml');
print $strXml;
} else {
# ODS file
my $strODS = '';
@ -81,7 +77,7 @@ if ($action eq 'export' && $input->request_method() eq 'GET') {
}
my $filename = $input->param($fieldname);
# upload the input file
if ($filename && $filename =~ /\.(csv|ods|xml)$/i) {
if ($filename && $filename =~ /\.(csv|ods)$/i) {
my $extension = $1;
my $uploadFd = $input->upload($fieldname);
if ($uploadFd && !$input->cgi_error) {

View file

@ -191,10 +191,10 @@ Authority types &rsaquo; Administration &rsaquo; Koha
<li><a href="auth_tag_structure.pl?authtypecode=[% authority_type.authtypecode | uri %]" class="button parameters"><i class="fa fa-eye"></i> MARC structure</a></li>
<li><a href="/cgi-bin/koha/admin/authtypes.pl?op=add_form&amp;authtypecode=[% authority_type.authtypecode | uri %]"><i class="fa fa-pencil"></i> Edit</a></li>
[% IF authority_type.authtypecode %]<li><a href="/cgi-bin/koha/admin/authtypes.pl?op=delete_confirm&amp;authtypecode=[% authority_type.authtypecode | uri %]"><i class="fa fa-trash"></i> Delete</a></li>[% END %]
<!-- Button to trigger modal -->
<li><a href="#" data-toggle="modal" data-target="#exportModal_[% authority_type.authtypecode | html %][% loop.count | html %]" title="Export authority type (fields, subfields) to a spreadsheet file (.csv, .xml, .ods)"><i class="fa fa-upload"></i> Export</a></li>
<!-- Button to trigger modal -->
<li><a href="#" data-toggle="modal" data-target="#importModal_[% authority_type.authtypecode | html %][% loop.count | html %]" title="Import authority type (fields, subfields) from a spreadsheet file (.csv, .xml, .ods)"><i class="fa fa-download"></i> Import</a></li>
<!-- Button to trigger modal -->
<li><a href="#" data-toggle="modal" data-target="#exportModal_[% authority_type.authtypecode | html %][% loop.count | html %]" title="Export authority type (fields, subfields) to a spreadsheet file (.csv, .ods)"><i class="fa fa-upload"></i> Export</a></li>
<!-- Button to trigger modal -->
<li><a href="#" data-toggle="modal" data-target="#importModal_[% authority_type.authtypecode | html %][% loop.count | html %]" title="Import authority type (fields, subfields) from a spreadsheet file (.csv, .ods)"><i class="fa fa-download"></i> Import</a></li>
</ul>
</div>
@ -211,7 +211,6 @@ Authority types &rsaquo; Administration &rsaquo; Koha
<fieldset>
<input type="hidden" name="authtypecode" value="[% authority_type.authtypecode | html %]" />
<p><label for="csv_type_export_[% authority_type.authtypecode | html %][% loop.count | html %]"><input type="radio" name="type_export_[% authority_type.authtypecode | html %]" value="csv" id="csv_type_export_[% authority_type.authtypecode | html %][% loop.count | html %]" checked="checked" /> Export to CSV spreadsheet</label></p>
<p><label for="xml_type_export_[% authority_type.authtypecode | html %][% loop.count | html %]"><input type="radio" name="type_export_[% authority_type.authtypecode | html %]" value="excel" id="xml_type_export_[% authority_type.authtypecode | html %][% loop.count | html %]" /> Export to Excel with XML format, compatible with OpenOffice/LibreOffice as well</label></p>
<p><label for="ods_type_export_[% authority_type.authtypecode | html %][% loop.count | html %]"><input type="radio" name="type_export_[% authority_type.authtypecode | html %]" value="ods" id="ods_type_export_[% authority_type.authtypecode | html %][% loop.count | html %]" /> Export to OpenDocument spreadsheet format</label></p>
</fieldset>
</div>
@ -230,7 +229,7 @@ Authority types &rsaquo; Administration &rsaquo; Koha
<div class="modal-content">
<div class="modal-header">
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="importLabelexportModal_[% authority_type.authtypecode | html %][% loop.count | html %]">Import [% authority_type.authtypecode | html %] authority type (fields and subfields) from a spreadsheet file (.csv, .xml, .ods)</h3>
<h3 id="importLabelexportModal_[% authority_type.authtypecode | html %][% loop.count | html %]">Import [% authority_type.authtypecode | html %] authority type (fields and subfields) from a spreadsheet file (.csv, .ods)</h3>
</div>
<form action="/cgi-bin/koha/admin/import_export_authtype.pl" name="form_i_[% authority_type.authtypecode | html %]" id="form_i_[% authority_type.authtypecode | html %]" method="post" enctype="multipart/form-data" class="form_import">
<div class="modal-body">

View file

@ -39,9 +39,9 @@ $(document).ready(function() {
$('input.input_import').change( function() {
var filename = $(this).val();
if ( ! /(?:\.csv|\.ods|\.xml)$/.test(filename)) {
if ( ! /(?:\.csv|\.ods)$/.test(filename)) {
$(this).css("background-color","yellow");
alert(_("Please select a CSV (.csv), ODS (.ods) or XML (.xml) spreadsheet file."));
alert(_("Please select a CSV (.csv) or ODS (.ods) spreadsheet file."));
$(this).val("");
$(this).css("background-color","white");
}
@ -55,7 +55,7 @@ $(document).ready(function() {
$('form.form_import').submit(function() {
var id = $(this).attr('id');
var obj = $('#' + id + ' input:file');
if (/(?:\.csv|\.ods|\.xml)$/.test(obj.val())) {
if (/(?:\.csv|\.ods)$/.test(obj.val())) {
if (confirm(_("Do you really want to import the authority type fields and subfields? This will overwrite the current configuration. For safety reasons please use the export option to make a backup"))) {
var authtypecode = $('#' + id + ' input:hidden[name=authtypecode]').val();
$('#importing_' + authtypecode).find("span").html(_("Importing to authority type: %s. Importing from file: %s").format("<strong>" + authtypecode + "</strong>", "<i>" + obj.val().replace(new RegExp("^.+[/\\\\]"),"") + "</i>"));
@ -73,7 +73,7 @@ $(document).ready(function() {
}
}
obj.css("background-color","yellow");
alert(_("Please select a CSV (.csv), ODS (.ods) or XML (.xml) spreadsheet file."));
alert(_("Please select a CSV (.csv) or ODS (.ods) spreadsheet file."));
obj.val("");
bj.css("background-color","white");
return false;