Bugzilla – Attachment 94687 Details for
Bug 23398
Exporting/Reimporting frameworks in XML format will give incomplete results
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23398: Disable the XML import/export format for biblio framework
Bug-23398-Disable-the-XML-importexport-format-for-.patch (text/plain), 10.20 KB, created by
Jonathan Druart
on 2019-10-24 16:26:16 UTC
(
hide
)
Description:
Bug 23398: Disable the XML import/export format for biblio framework
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-10-24 16:26:16 UTC
Size:
10.20 KB
patch
obsolete
>From c99ada8b555308fe47eeafe72918d0b9c0963e5a Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 24 Oct 2019 18:21:04 +0200 >Subject: [PATCH] Bug 23398: Disable the XML import/export format for biblio > framework > >It gives incomplete results and not sure it ever worked. >To prevent data loss it is better to remove this option. > >Note that the code in C4/ImportExportFramework.pm is too complex to >attach with this patch to deletion of the code related to the XML >import/export. Safer to keep it for a separate bug report. > >Test plan: >Import/export biblio frameworks and confirm that there is no more >reference to the xml format. >--- > admin/import_export_framework.pl | 6 +----- > .../prog/en/modules/admin/biblio_framework.tt | 16 +++++++--------- > 2 files changed, 8 insertions(+), 14 deletions(-) > >diff --git a/admin/import_export_framework.pl b/admin/import_export_framework.pl >index ad95804dba..a1a05f9eae 100755 >--- a/admin/import_export_framework.pl >+++ b/admin/import_export_framework.pl >@@ -62,10 +62,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_' . $framework_name . '.csv'); > print $strXml; >- } elsif ($format eq 'excel') { >- # Excel-xml file >- print $input->header(-type => 'application/excel', -attachment => 'export_' . $framework_name . '.xml'); >- print $strXml; > } else { > # ODS file > my $strODS = ''; >@@ -79,7 +75,7 @@ if ($action eq 'export' && $input->request_method() eq 'GET') { > my $fieldname = 'file_import_' . $framework_name; > 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) { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt >index c94398cdde..59ae3a6d07 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt >@@ -141,9 +141,9 @@ > <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="frameworkactions[% loo.frameworkcode | html %]"> > <li><a href="marctagstructure.pl?frameworkcode="><i class="fa fa-eye"></i> MARC structure</a></li> > <!-- Trigger modal --> >- <li><a href="#" data-toggle="modal" data-target="#exportModal_default" title="Export framework structure (fields, subfields) to a spreadsheet file (.csv, .xml, .ods)"><i class="fa fa-upload"></i> Export</a></li> >+ <li><a href="#" data-toggle="modal" data-target="#exportModal_default" title="Export framework structure (fields, subfields) to a spreadsheet file (.csv or .ods)"><i class="fa fa-upload"></i> Export</a></li> > <!-- Trigger modal --> >- <li><a href="#" data-toggle="modal" data-target="#importModal_[% framework.frameworkcode | html %][% frameworks.count | html %]" title="Import framework structure (fields, subfields) from a spreadsheet file (.csv, .xml, .ods)"><i class="fa fa-download"></i> Import</a></li> >+ <li><a href="#" data-toggle="modal" data-target="#importModal_[% framework.frameworkcode | html %][% frameworks.count | html %]" title="Import framework structure (fields, subfields) from a spreadsheet file (.csv or .ods)"><i class="fa fa-download"></i> Import</a></li> > </ul> > <!-- Modal to export default framework --> > <div class="modal" id="exportModal_default" tabindex="-1" role="dialog" aria-labelledby="exportLabelexportModal_default" aria-hidden="true"> >@@ -158,7 +158,6 @@ > <fieldset> > <input type="hidden" name="frameworkcode" value="" /> > <p><label for="csv_type_export_default"><input type="radio" name="type_export_default" value="csv" id="csv_type_export_default" checked="checked" /> Export to CSV spreadsheet</label></p> >- <p><label for="xml_type_export_default"><input type="radio" name="type_export_default" value="excel" id="xml_type_export_default" /> Export to Excel with XML format, compatible with OpenOffice/LibreOffice as well</label></p> > <p><label for="ods_type_export_default"><input type="radio" name="type_export_default" value="ods" id="ods_type_export_default" /> Export to OpenDocument spreadsheet format</label></p> > </fieldset> > </div> >@@ -177,7 +176,7 @@ > <div class="modal-content"> > <div class="modal-header"> > <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">Ã</button> >- <h3 id="importLabelexportModal_[% framework.frameworkcode | html %][% frameworks.count | html %]">Import default framework structure (fields and subfields) from a spreadsheet file (.csv, .xml, .ods)</h> >+ <h3 id="importLabelexportModal_[% framework.frameworkcode | html %][% frameworks.count | html %]">Import default framework structure (fields and subfields) from a spreadsheet file (.csv or .ods)</h> > </div> > <form action="/cgi-bin/koha/admin/import_export_framework.pl" name="form_i_default" id="form_i_default" method="post" enctype="multipart/form-data" class="form_import"> > <div class="modal-body"> >@@ -212,9 +211,9 @@ > <li><a href="/cgi-bin/koha/admin/biblio_framework.pl?op=add_form&frameworkcode=[% loo.frameworkcode | uri %]"><i class="fa fa-pencil"></i> Edit</a></li> > <li><a href="/cgi-bin/koha/admin/biblio_framework.pl?op=delete_confirm&frameworkcode=[% loo.frameworkcode | uri %]"><i class="fa fa-trash"></i> Delete</a></li> > <!-- Trigger modal --> >- <li><a href="#" data-toggle="modal" data-target="#exportModal_[% loo.frameworkcode | html %][% loop.count | html %]" title="Export framework structure (fields, subfields) to a spreadsheet file (.csv, .xml, .ods)"><i class="fa fa-upload"></i> Export</a></li> >+ <li><a href="#" data-toggle="modal" data-target="#exportModal_[% loo.frameworkcode | html %][% loop.count | html %]" title="Export framework structure (fields, subfields) to a spreadsheet file (.csv or .ods)"><i class="fa fa-upload"></i> Export</a></li> > <!-- Trigger modal --> >- <li><a href="#" data-toggle="modal" data-target="#importModal_[% loo.frameworkcode | html %][% loop.count | html %]" title="Import framework structure (fields, subfields) from a spreadsheet file (.csv, .xml, .ods)"><i class="fa fa-download"></i> Import</a></li> >+ <li><a href="#" data-toggle="modal" data-target="#importModal_[% loo.frameworkcode | html %][% loop.count | html %]" title="Import framework structure (fields, subfields) from a spreadsheet file (.csv or .ods)"><i class="fa fa-download"></i> Import</a></li> > </ul> > <!-- Modal to export other framework --> > <div class="modal" id="exportModal_[% loo.frameworkcode | html %][% loop.count | html %]" tabindex="-1" role="dialog" aria-labelledby="exportLabelexportModal_[% loo.frameworkcode | html %][% loop.count | html %]" aria-hidden="true"> >@@ -229,7 +228,6 @@ > <fieldset> > <input type="hidden" name="frameworkcode" value="[% loo.frameworkcode | html %]" /> > <p><label for="csv_type_export_[% loo.frameworkcode | html %][% loop.count | html %]"><input type="radio" name="type_export_[% loo.frameworkcode | html %]" value="csv" id="csv_type_export_[% loo.frameworkcode | html %][% loop.count | html %]" checked="checked" /> Export to CSV spreadsheet</label></p> >- <p><label for="xml_type_export_[% loo.frameworkcode | html %][% loop.count | html %]"><input type="radio" name="type_export_[% loo.frameworkcode | html %]" value="excel" id="xml_type_export_[% loo.frameworkcode | html %][% loop.count | html %]" /> Export to Excel with XML format, compatible with OpenOffice/LibreOffice as well</label></p> > <p><label for="ods_type_export_[% loo.frameworkcode | html %][% loop.count | html %]"><input type="radio" name="type_export_[% loo.frameworkcode | html %]" value="ods" id="ods_type_export_[% loo.frameworkcode | html %][% loop.count | html %]" /> Export to OpenDocument spreadsheet format</label></p> > </fieldset> > </div> >@@ -248,7 +246,7 @@ > <div class="modal-content"> > <div class="modal-header"> > <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">Ã</button> >- <h3 id="importLabelexportModal_[% loo.frameworkcode | html %][% loop.count | html %]">Import [% loo.frameworkcode | html %] framework structure (fields and subfields) from a spreadsheet file (.csv, .xml, .ods)</h3> >+ <h3 id="importLabelexportModal_[% loo.frameworkcode | html %][% loop.count | html %]">Import [% loo.frameworkcode | html %] framework structure (fields and subfields) from a spreadsheet file (.csv or .ods)</h3> > </div> > <form action="/cgi-bin/koha/admin/import_export_framework.pl" name="form_i_[% loo.frameworkcode | html %]" id="form_i_[% loo.frameworkcode | html %]" method="post" enctype="multipart/form-data" class="form_import"> > <div class="modal-body"> >@@ -290,7 +288,7 @@ > <script> > /* Set some variable needed in biblio_framework.js */ > var MSG_IMPORT_ERROR = _("Error importing the framework"); >- var MSG_SELECT_FILE_FORMAT = _("Please select a CSV (.csv), ODS (.ods) or XML (.xml) spreadsheet file."); >+ var MSG_SELECT_FILE_FORMAT = _("Please select a CSV (.csv) or ODS (.ods) spreadsheet file."); > var MSG_IMPORTING_TO_FRAMEWORK = _("Importing to framework: %s. Importing from file: %s."); > var template_path = "[% interface | html %]/[% theme | html %]"; > </script> >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 23398
:
94687
|
95161
|
95179