Bugzilla – Attachment 60522 Details for
Bug 18111
Import default framework is broken
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18111: Fix import of default framework
Bug-18111-Fix-import-of-default-framework.patch (text/plain), 4.45 KB, created by
Tomás Cohen Arazi (tcohen)
on 2017-02-21 14:40:16 UTC
(
hide
)
Description:
Bug 18111: Fix import of default framework
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2017-02-21 14:40:16 UTC
Size:
4.45 KB
patch
obsolete
>From 2969872b68bcea27283f85d1b1b6855f6a9ad488 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 14 Feb 2017 16:21:45 +0000 >Subject: [PATCH] Bug 18111: Fix import of default framework >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Caused by bug 16035. > >Recreate the issue: >Go to Home ⺠Administration ⺠MARC frameworks >For the default framework: Actions > import >It will not work > >Test plan: >Confirm test plans from bug 16035 and bug 17389 still pass >Confirm that the import for the default framework now works > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > admin/import_export_framework.pl | 19 ++++++++----------- > .../prog/en/modules/admin/biblio_framework.tt | 2 +- > 2 files changed, 9 insertions(+), 12 deletions(-) > >diff --git a/admin/import_export_framework.pl b/admin/import_export_framework.pl >index 5a38a85955..60dcf7fe58 100755 >--- a/admin/import_export_framework.pl >+++ b/admin/import_export_framework.pl >@@ -46,41 +46,38 @@ unless ($authenticated) { > exit 0; > } > >-my $frameworkcode = $input->param('frameworkcode') || 'default'; >+my $frameworkcode = $input->param('frameworkcode') || ''; >+my $framework_name = $frameworkcode || 'default'; > my $action = $input->param('action') || 'export'; > > ## Exporting > if ($action eq 'export' && $input->request_method() eq 'GET') { > my $strXml = ''; >- my $format = $input->param('type_export_' . $frameworkcode); >- if ($frameworkcode eq 'default') { >- ExportFramework('', \$strXml, $format); >- } else { >- ExportFramework($frameworkcode, \$strXml, $format); >- } >+ my $format = $input->param('type_export_' . $framework_name); >+ ExportFramework($frameworkcode, \$strXml, $format); > > if ($format eq 'csv') { > # CSV file > > # Correctly set the encoding to output plain text in UTF-8 > binmode(STDOUT,':encoding(UTF-8)'); >- print $input->header(-type => 'application/vnd.ms-excel', -attachment => 'export_' . $frameworkcode . '.csv'); >+ 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_' . $frameworkcode . '.xml'); >+ print $input->header(-type => 'application/excel', -attachment => 'export_' . $framework_name . '.xml'); > print $strXml; > } else { > # ODS file > my $strODS = ''; > createODS($strXml, 'en', \$strODS); >- print $input->header(-type => 'application/vnd.oasis.opendocument.spreadsheet', -attachment => 'export_' . $frameworkcode . '.ods'); >+ print $input->header(-type => 'application/vnd.oasis.opendocument.spreadsheet', -attachment => 'export_' . $framework_name . '.ods'); > print $strODS; > } > ## Importing > } elsif ($input->request_method() eq 'POST') { > my $ok = -1; >- my $fieldname = 'file_import_' . $frameworkcode; >+ my $fieldname = 'file_import_' . $framework_name; > my $filename = $input->param($fieldname); > # upload the input file > if ($filename && $filename =~ /\.(csv|ods|xml)$/i) { >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 4edc86188f..20efbc1bb4 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 >@@ -189,7 +189,7 @@ > </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"> >- <input type="hidden" name="frameworkcode" value="default" /> >+ <input type="hidden" name="frameworkcode" value="" /> > <input type="hidden" name="action" value="import" /> > <p><label for="file_import_default">Upload file:</label> <input type="file" name="file_import_default" id="file_import_default" class="input_import" /></p> > <div id="importing_default" style="display:none" class="importing"><img src="[% interface %]/[% theme %]/img/spinner-small.gif" alt="" /><span class="importing_msg"></span></div> >-- >2.11.1
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 18111
:
60216
|
60239
|
60436
|
60437
|
60438
| 60522 |
60523
|
61099