koha-cvs
[Top][All Lists]
Advanced

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

[Koha-cvs] koha/circ reserve.pl [rel_3_0]


From: paul poulain
Subject: [Koha-cvs] koha/circ reserve.pl [rel_3_0]
Date: Thu, 25 Jan 2007 17:38:23 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         rel_3_0
Changes by:     paul poulain <tipaul>   07/01/25 17:38:23

Modified files:
        circ           : reserve.pl 

Log message:
        changing behaviour of this script : it now just show PENDING reserves 
(ie reserves that don't have an item attached to them)
        with it, the library can go to the shelves, pick the book & do a return 
on it to validate the reserve (& eventually do a transfer)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/circ/reserve.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.3.2.7&r2=1.3.2.8

Patches:
Index: reserve.pl
===================================================================
RCS file: /sources/koha/koha/circ/reserve.pl,v
retrieving revision 1.3.2.7
retrieving revision 1.3.2.8
diff -u -b -r1.3.2.7 -r1.3.2.8
--- reserve.pl  8 Jan 2007 15:17:59 -0000       1.3.2.7
+++ reserve.pl  25 Jan 2007 17:38:23 -0000      1.3.2.8
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-# $Id: reserve.pl,v 1.3.2.7 2007/01/08 15:17:59 toins Exp $
+# $Id: reserve.pl,v 1.3.2.8 2007/01/25 17:38:23 tipaul Exp $
 
 # Copyright 2000-2002 Katipo Communications
 #
@@ -98,44 +98,51 @@
         biblio.title,
         biblio.author
  FROM  reserves
- LEFT JOIN items ON items.itemnumber=reserves.itemnumber,
+ LEFT JOIN items ON items.biblionumber=reserves.biblionumber,
   borrowers,biblio
  WHERE isnull(cancellationdate)
   && reserves.borrowernumber=borrowers.borrowernumber 
   && reserves.biblionumber=biblio.biblionumber
+  && reserves.found is NULL
+  && items.holdingbranch=?
  ";
 
 $strsth .= $sqlorderby;
 
 my $sth = $dbh->prepare($strsth);
 
-$sth->execute();
+$sth->execute(C4::Context->userenv->{'branch'});
 
 my @reservedata;
+my $previous;
+my $this;
 while ( my $data = $sth->fetchrow_hashref ) {
+    $this=$data->{biblionumber}.":".$data->{borrowernumber};
+    my @itemlist;
     push(
         @reservedata,
         {
-            reservedate      => format_date( $data->{reservedate} ),
-            priority         => $data->{priority},
-            name             => $data->{borrower},
-            title            => $data->{title},
-            author           => $data->{author},
-            borrowernumber   => $data->{borrowernumber},
-            itemnum          => $data->{itemnumber},
-            phone            => $data->{phone},
-            email            => $data->{email},
-            biblionumber     => $data->{biblionumber},
+            reservedate      => $previous eq $this?"":format_date( 
$data->{reservedate} ),
+            priority         => $previous eq $this?"":$data->{priority},
+            name             => $previous eq $this?"":$data->{borrower},
+            title            => $previous eq $this?"":$data->{title},
+            author           => $previous eq $this?"":$data->{author},
+            borrowernumber   => $previous eq $this?"":$data->{borrowernumber},
+            itemnum          => $previous eq $this?"":$data->{itemnumber},
+            phone            => $previous eq $this?"":$data->{phone},
+            email            => $previous eq $this?"":$data->{email},
+            biblionumber     => $previous eq $this?"":$data->{biblionumber},
             statusw          => ( $data->{found} eq "w" ),
             statusf          => ( $data->{found} eq "f" ),
             holdingbranch    => $data->{holdingbranch},
-            branch           => $data->{branch},
+            branch           => $previous eq $this?"":$data->{branch},
             itemcallnumber   => $data->{itemcallnumber},
-            notes            => $data->{notes},
-            notificationdate => $data->{notificationdate},
-            reminderdate     => $data->{reminderdate}
+            notes            => $previous eq $this?"":$data->{notes},
+            notificationdate => $previous eq 
$this?"":$data->{notificationdate},
+            reminderdate     => $previous eq $this?"":$data->{reminderdate}
         }
     );
+    $previous=$this;
 }
 
 $sth->finish;




reply via email to

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