Bugzilla – Attachment 103616 Details for
Bug 13952
Import and export of authority types
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13952: (follow-up) Removing XML options
Bug-13952-follow-up-Removing-XML-options.patch (text/plain), 8.16 KB, created by
Aleisha Amohia
on 2020-04-23 22:39:09 UTC
(
hide
)
Description:
Bug 13952: (follow-up) Removing XML options
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2020-04-23 22:39:09 UTC
Size:
8.16 KB
patch
obsolete
>From 8f74a7b6d010bdca81d86018447d25b28585c8e5 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Tue, 21 Apr 2020 07:22:28 +0000 >Subject: [PATCH] Bug 13952: (follow-up) Removing XML options > >--- > admin/import_export_authtype.pl | 6 +----- > koha-tmpl/intranet-tmpl/prog/en/modules/admin/authtypes.tt | 7 +++---- > koha-tmpl/intranet-tmpl/prog/js/authtype.js | 8 ++++---- > 3 files changed, 8 insertions(+), 13 deletions(-) > >diff --git a/admin/import_export_authtype.pl b/admin/import_export_authtype.pl >index 7af823b3480..db72c29308f 100755 >--- a/admin/import_export_authtype.pl >+++ b/admin/import_export_authtype.pl >@@ -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) { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authtypes.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authtypes.tt >index 4a7d8783e05..3ca5e208b81 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authtypes.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authtypes.tt >@@ -158,9 +158,9 @@ > <li><a href="/cgi-bin/koha/admin/authtypes.pl?op=add_form&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&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> >+ <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, .xml, .ods)"><i class="fa fa-download"></i> Import</a></li> >+ <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> > > <!-- Modal for export --> >@@ -176,7 +176,6 @@ > <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> >@@ -195,7 +194,7 @@ > <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"> >diff --git a/koha-tmpl/intranet-tmpl/prog/js/authtype.js b/koha-tmpl/intranet-tmpl/prog/js/authtype.js >index b4c95017cc0..0a7341a39a0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/authtype.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/authtype.js >@@ -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; >-- >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 13952
:
44770
|
47326
|
47360
|
47364
|
50046
|
53065
|
53066
|
54840
|
54899
|
54900
|
57873
|
59831
|
64421
|
67914
|
67915
|
68299
|
68300
|
68301
|
68502
|
68512
|
68513
|
68514
|
68515
|
68556
|
69940
|
69941
|
69942
|
69943
|
69944
|
76665
|
76666
|
76667
|
76668
|
80794
|
80795
|
80796
|
80797
|
81248
|
82853
|
82854
|
82855
|
82856
|
82895
|
83024
|
83025
|
83026
|
83027
|
83028
|
85073
|
86549
|
86550
|
86551
|
86552
|
86553
|
86554
|
86555
|
103610
|
103611
|
103612
|
103613
|
103614
|
103615
|
103616
|
114170
|
114171
|
114172
|
114173
|
114174
|
114175
|
114176
|
114177
|
115379
|
115381
|
115382
|
115383
|
115384
|
115385
|
115386
|
115387
|
115388
|
125383
|
125384
|
125385
|
125386
|
125387
|
125388
|
125389
|
125390
|
128316
|
128317
|
128318
|
128319
|
128320
|
128321
|
128322
|
128323
|
128324
|
128325
|
128326
|
128327
|
128328
|
128329
|
128330
|
128331
|
130587
|
130917
|
130918
|
130919
|
130920
|
130921
|
130922
|
130923
|
130924
|
130925