Bug 13308: The output format should be 'iso2709' instead of 'marc'
In the template of the export tools, the value 'marc' is set for the 'format' variable. It should be 'iso2709'. There was a mess in the tools/export.pl script. 2 variables did the same thing: $format and $output_format This patch fixes that replacing $format with $output_format Test plan: Try to export biblio in iso2709 and csv using the export tools and from the checkout list. Signed-off-by: Owen Leonard <oleonard@myacpl.org> Before applying the patch, attemping an MARC export from tools/export.pl resulted in an error. After the patch the export works correctly. Exports from the checkouts page also work correctly. Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Passes tests and QA script. Also tested authority export. Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This commit is contained in:
parent
463d52ce15
commit
9c71bf4227
|
|
@ -128,7 +128,7 @@ $(document).ready(function() {
|
|||
<ol><li>
|
||||
<label for="output_format">File format: </label>
|
||||
<select id="output_format" name="output_format">
|
||||
<option value="marc">marc</option>
|
||||
<option value="iso2709">marc</option>
|
||||
<option value="xml">xml</option>
|
||||
</select>
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ use C4::Record;
|
|||
my $query = new CGI;
|
||||
|
||||
my $clean;
|
||||
my $output_format;
|
||||
my $dont_export_items;
|
||||
my $deleted_barcodes;
|
||||
my $timestamp;
|
||||
|
|
@ -44,7 +43,7 @@ my $op = $query->param("op") || '';
|
|||
my $filename = $query->param("filename") || 'koha.mrc';
|
||||
my $dbh = C4::Context->dbh;
|
||||
my $marcflavour = C4::Context->preference("marcflavour");
|
||||
my $format = $query->param("format") || $query->param("output_format") || 'iso2709';
|
||||
my $output_format = $query->param("format") || $query->param("output_format") || 'iso2709';
|
||||
|
||||
# Checks if the script is called from commandline
|
||||
my $commandline = not defined $ENV{GATEWAY_INTERFACE};
|
||||
|
|
@ -94,7 +93,6 @@ _USAGE_
|
|||
}
|
||||
|
||||
# Default parameters values :
|
||||
$output_format ||= 'marc';
|
||||
$timestamp ||= '';
|
||||
$dont_export_items ||= 0;
|
||||
$deleted_barcodes ||= 0;
|
||||
|
|
@ -114,6 +112,11 @@ else {
|
|||
|
||||
}
|
||||
|
||||
# Default value for output_format is 'iso2709'
|
||||
$output_format ||= 'iso2709';
|
||||
# Retrocompatibility for the format parameter
|
||||
$output_format = 'iso2709' if $output_format eq 'marc';
|
||||
|
||||
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
|
||||
{
|
||||
template_name => "tools/export.tt",
|
||||
|
|
@ -142,7 +145,7 @@ if ( C4::Context->preference("IndependentBranches")
|
|||
my $backupdir = C4::Context->config('backupdir');
|
||||
|
||||
if ( $op eq "export" ) {
|
||||
if ( $format eq "iso2709" or $format eq "xml" ) {
|
||||
if ( $output_format eq "iso2709" or $output_format eq "xml" ) {
|
||||
my $charset = 'utf-8';
|
||||
my $mimetype = 'application/octet-stream';
|
||||
binmode STDOUT, ':encoding(UTF-8)';
|
||||
|
|
@ -163,8 +166,6 @@ if ( $op eq "export" ) {
|
|||
) unless ($commandline);
|
||||
|
||||
$record_type = $query->param("record_type") unless ($commandline);
|
||||
$output_format = $query->param("output_format") || 'marc'
|
||||
unless ($commandline);
|
||||
my $export_remove_fields = $query->param("export_remove_fields");
|
||||
my @biblionumbers = $query->param("biblionumbers");
|
||||
my @itemnumbers = $query->param("itemnumbers");
|
||||
|
|
@ -433,7 +434,7 @@ if ( $op eq "export" ) {
|
|||
|
||||
exit;
|
||||
}
|
||||
elsif ( $format eq "csv" ) {
|
||||
elsif ( $output_format eq "csv" ) {
|
||||
my @biblionumbers = uniq $query->param("biblionumbers");
|
||||
my @itemnumbers = $query->param("itemnumbers");
|
||||
my $output =
|
||||
|
|
|
|||
Loading…
Reference in New Issue