X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=tools%2Fexport.pl;h=1fb1dae67a4e8981ef57595ad3374dc1721f8442;hb=a62811200ae422df7e19e00f374eb6de184dcbee;hp=c540c6483da3adb028ac97b9dbd07939df236fb3;hpb=a481fad4b7e84e1571fb2750ee99d1edf234b796;p=koha_gimpoz diff --git a/tools/export.pl b/tools/export.pl index c540c6483d..1fb1dae67a 100755 --- a/tools/export.pl +++ b/tools/export.pl @@ -16,12 +16,10 @@ # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, # Suite 330, Boston, MA 02111-1307 USA -# $Id$ use strict; require Exporter; use C4::Auth; -use C4::Interface::CGI::Output; use C4::Output; # contains gettemplate use C4::Biblio; # GetMarcBiblio GetXmlBiblio use CGI; @@ -30,12 +28,13 @@ use C4::Branch; # GetBranches my $query = new CGI; my $op=$query->param("op"); +my $filename=$query->param("filename"); my $dbh=C4::Context->dbh; my $marcflavour = C4::Context->preference("marcflavour"); if ($op eq "export") { - - print $query->header('Content-Type: text/marc'); + print $query->header( -type => 'application/octet-stream', + -attachment=>$filename); my $StartingBiblionumber = $query->param("StartingBiblionumber"); my $EndingBiblionumber = $query->param("EndingBiblionumber"); @@ -89,7 +88,7 @@ if ($op eq "export") { if ( $dont_export_items ) { # now, find where the itemnumber is stored & extract only the item my ( $itemnumberfield, $itemnumbersubfield ) = - GetMarcFromKohaField( $dbh, 'items.itemnumber', '' ); + GetMarcFromKohaField( 'items.itemnumber', '' ); # and delete it. foreach ($record->field($itemnumberfield)){ @@ -115,7 +114,7 @@ if ($op eq "export") { print $record->as_xml_record($marcflavour); } else { - print $record->as_formatted; + print $record->as_usmarc(); } } exit;