koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] koha/tools export.pl [rel_3_0]


From: Antoine Farnault
Subject: [Koha-cvs] koha/tools export.pl [rel_3_0]
Date: Thu, 21 Dec 2006 09:11:17 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         rel_3_0
Changes by:     Antoine Farnault <toins>        06/12/21 09:11:17

Modified files:
        tools          : export.pl 

Log message:
        fix 2 bugs.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/tools/export.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.1.2.6&r2=1.1.2.7

Patches:
Index: export.pl
===================================================================
RCS file: /sources/koha/koha/tools/export.pl,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -u -b -r1.1.2.6 -r1.1.2.7
--- export.pl   20 Dec 2006 11:14:59 -0000      1.1.2.6
+++ export.pl   21 Dec 2006 09:11:17 -0000      1.1.2.7
@@ -16,7 +16,7 @@
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-# $Id: export.pl,v 1.1.2.6 2006/12/20 11:14:59 toins Exp $
+# $Id: export.pl,v 1.1.2.7 2006/12/21 09:11:17 toins Exp $
 
 use strict;
 require Exporter;
@@ -31,6 +31,7 @@
 my $query = new CGI;
 my $op=$query->param("op");
 my $dbh=C4::Context->dbh;
+my $marcflavour = C4::Context->preference("marcflavour");
 
 if ($op eq "export") {
 
@@ -51,13 +52,13 @@
                   WHERE biblioitems.biblionumber=items.biblionumber ";
                   
     if ( $StartingBiblionumber ) {
-        $query .= " AND biblioitems.biblionumber <= ? ";
+        $query .= " AND biblioitems.biblionumber >= ? ";
         push @sql_params, $StartingBiblionumber;
     }
     
     if ( $EndingBiblionumber ) {
-        $query .= " AND biblioitems.biblionumber >= ? ";
-        push @sql_params, $StartingBiblionumber;    
+        $query .= " AND biblioitems.biblionumber <= ? ";
+        push @sql_params, $EndingBiblionumber;    
     }
     
     if ( $branch ) {
@@ -85,7 +86,7 @@
 
     while (my ($biblionumber) = $sth->fetchrow) {
         my $record = GetMarcBiblio($biblionumber);
-        if ( $dont_export_items) {
+        if ( $dont_export_items ) {
             # now, find where the itemnumber is stored & extract only the item
             my ( $itemnumberfield, $itemnumbersubfield ) =
                 MARCfind_marc_from_kohafield( $dbh, 'items.itemnumber', '' );
@@ -102,7 +103,7 @@
                 /^(\d*)(\w)?$/;
                 my $field = $1;
                 my $subfield = $2;
-                if($subfield){
+                if( $subfield ) {
                     $record->field($field)->delete_subfields($subfield);
                 }
                 else {
@@ -111,7 +112,7 @@
             }
         }
         if ( $output_format eq "xml" ) {
-            print $record->as_xml; # Need marc::record 2
+            print $record->as_xml_record($marcflavour);
         }
         else {
             print $record->as_formatted; 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]