koha-cvs
[Top][All Lists]
Advanced

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

[Koha-cvs] koha/C4 Biblio.pm


From: Henri-Damien LAURENT
Subject: [Koha-cvs] koha/C4 Biblio.pm
Date: Thu, 19 Jul 2007 07:40:09 +0000

CVSROOT:        /cvsroot/koha
Module name:    koha
Changes by:     Henri-Damien LAURENT <hdl>      07/07/19 07:40:09

Modified files:
        C4             : Biblio.pm 

Log message:
        Adding selection by location for inventory

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Biblio.pm?cvsroot=koha&r1=1.217&r2=1.218

Patches:
Index: Biblio.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Biblio.pm,v
retrieving revision 1.217
retrieving revision 1.218
diff -u -b -r1.217 -r1.218
--- Biblio.pm   3 Jul 2007 13:47:44 -0000       1.217
+++ Biblio.pm   19 Jul 2007 07:40:08 -0000      1.218
@@ -33,7 +33,7 @@
 use vars qw($VERSION @ISA @EXPORT);
 
 # set the version for version checking
-$VERSION = do { my @v = '$Revision: 1.217 $' =~ /\d+/g; shift(@v).".".join( 
"_", map { sprintf "%03d", $_ } @v ); };
+$VERSION = do { my @v = '$Revision: 1.218 $' =~ /\d+/g; shift(@v).".".join( 
"_", map { sprintf "%03d", $_ } @v ); };
 
 @ISA = qw( Exporter );
 
@@ -1114,10 +1114,11 @@
 =cut
 
 sub GetItemsForInventory {
-    my ( $minlocation, $maxlocation, $datelastseen, $branch, $offset, $size ) 
= @_;
+    my ( $minlocation, $maxlocation,$location, $datelastseen, $branch, 
$offset, $size ) = @_;
     my $dbh = C4::Context->dbh;
     my $sth;
     if ($datelastseen) {
+        $datelastseen=format_date_in_iso($datelastseen);  
         my $query =
                 "SELECT 
itemnumber,barcode,itemcallnumber,title,author,datelastseen
                  FROM items
@@ -1125,6 +1126,7 @@
                  WHERE itemcallnumber>= ?
                    AND itemcallnumber <=?
                    AND (datelastseen< ? OR datelastseen IS NULL)";
+        $query.= " AND items.location=".$dbh->quote($location) if $location;
         $query.= " AND items.homebranch=".$dbh->quote($branch) if $branch;
         $query .= " ORDER BY itemcallnumber,title";
         $sth = $dbh->prepare($query);
@@ -1137,6 +1139,7 @@
                   LEFT JOIN biblio ON items.biblionumber=biblio.biblionumber 
                 WHERE itemcallnumber>= ?
                   AND itemcallnumber <=?";
+        $query.= " AND items.location=".$dbh->quote($location) if $location;
         $query.= " AND items.homebranch=".$dbh->quote($branch) if $branch;
         $query .= " ORDER BY itemcallnumber,title";
         $sth = $dbh->prepare($query);
@@ -1145,6 +1148,7 @@
     my @results;
     while ( my $row = $sth->fetchrow_hashref ) {
         $offset-- if ($offset);
+        $row->{datelastseen}=format_date($row->{datelastseen});
         if ( ( !$offset ) && $size ) {
             push @results, $row;
             $size--;
@@ -1550,8 +1554,10 @@
     $marcxml =~ s/\x1d//g;
     $marcxml =~ s/\x0f//g;
     $marcxml =~ s/\x0c//g;
+#   warn $marcxml;
     my $record = MARC::Record->new();
     $record = MARC::Record::new_from_xml( $marcxml, 
"utf8",C4::Context->preference('marcflavour')) if $marcxml;
+#      $record = MARC::Record::new_from_usmarc( $marc) if $marc;
     return $record;
 }
 
@@ -2022,9 +2028,9 @@
         @$values[$i] =~ s/>/&gt;/g;
         @$values[$i] =~ s/"/&quot;/g;
         @$values[$i] =~ s/'/&apos;/g;
-        if ( !utf8::is_utf8( @$values[$i] ) ) {
-            utf8::decode( @$values[$i] );
-        }
+#         if ( !utf8::is_utf8( @$values[$i] ) ) {
+#             utf8::decode( @$values[$i] );
+#         }
         if ( ( @$tags[$i] ne $prevtag ) ) {
             $j++ unless ( @$tags[$i] eq "" );
             if ( !$first ) {
@@ -3954,8 +3960,11 @@
 
 =cut
 
-# $Id: Biblio.pm,v 1.217 2007/07/03 13:47:44 tipaul Exp $
+# $Id: Biblio.pm,v 1.218 2007/07/19 07:40:08 hdl Exp $
 # $Log: Biblio.pm,v $
+# Revision 1.218  2007/07/19 07:40:08  hdl
+# Adding selection by location for inventory
+#
 # Revision 1.217  2007/07/03 13:47:44  tipaul
 # fixing some display bugs (itemtype not properly returned and a html table 
bug that makes items appear strangely
 #




reply via email to

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