koha-cvs
[Top][All Lists]
Advanced

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

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


From: Kyle Hall
Subject: [Koha-cvs] koha/circ reserve.pl [dev_week]
Date: Wed, 16 Apr 2008 17:33:05 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         dev_week
Changes by:     Kyle Hall <kylemhall>   08/04/16 17:33:05

Modified files:
        circ           : reserve.pl 

Log message:
        

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/circ/reserve.pl?cvsroot=koha&only_with_tag=dev_week&r1=1.1.2.6.2.4&r2=1.1.2.6.2.5

Patches:
Index: reserve.pl
===================================================================
RCS file: /sources/koha/koha/circ/Attic/reserve.pl,v
retrieving revision 1.1.2.6.2.4
retrieving revision 1.1.2.6.2.5
diff -u -b -r1.1.2.6.2.4 -r1.1.2.6.2.5
--- reserve.pl  11 Jan 2007 06:50:11 -0000      1.1.2.6.2.4
+++ reserve.pl  16 Apr 2008 17:33:05 -0000      1.1.2.6.2.5
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-# $Id: reserve.pl,v 1.1.2.6.2.4 2007/01/11 06:50:11 rych Exp $
+# $Id: reserve.pl,v 1.1.2.6.2.5 2008/04/16 17:33:05 kylemhall Exp $
 
 # Copyright 2000-2002 Katipo Communications
 #
@@ -27,6 +27,8 @@
 use HTML::Template;
 use C4::Auth;
 use C4::Date;
+use C4::Reserves2;
+use C4::Koha;
 
 my $input = new CGI;
 my $type=$input->param('type');
@@ -65,8 +67,17 @@
 my $todaysdate = (1900+$datearr[5]).'-'.sprintf ("%0.2d", 
($datearr[4]+1)).'-'.sprintf ("%0.2d", $datearr[3]);
 my $twodaysago =  (1900+$datearr[5]).'-'.sprintf ("%0.2d", 
($datearr[4]+1)).'-'.sprintf ("%0.2d", ($datearr[3] - 2) );
 
-# TODO : 
-#   Add branch selector
+## Set up the toBranch select options
+my $branches = getbranches();
+my $branch = getbranch($input, $branches);
+my @branchoptionloop;
+foreach my $br (keys %$branches) {
+  my %branch;
+  $branch{code}=$br;
+  $branch{name}=$branches->{$br}->{'branchname'};
+  $branch{selected} = $br eq $branch;
+  push (@branchoptionloop, \%branch);
+}
 
 my @reservedata;
 
@@ -133,10 +144,10 @@
        }
 }
 
-my $strsth="select reservedate,reserves.borrowernumber as bornum, 
firstname,surname , borrowers.phone,phoneday, borrowers.emailaddress, 
borrowers.streetaddress, borrowers.cardnumber, borrowers.city, 
borrowers.zipcode, reserves.biblionumber, reserves.branchcode as branch, 
items.holdingbranch, items.itemcallnumber, items.itemnumber, barcode, notes, 
notificationdate, reminderdate, priority, reserves.found, biblio.title, 
biblio.author from reserves left join items on 
items.itemnumber=reserves.itemnumber, borrowers,biblio where 
isnull(cancellationdate) && reserves.borrowernumber=borrowers.borrowernumber && 
reserves.biblionumber=biblio.biblionumber  " . $sqlwhowhere . $sqldatewhere . 
$sqlorderby ;
+my $strsth="select reservedate,reserves.borrowernumber as bornum, 
firstname,surname , borrowers.phone,phoneday, borrowers.emailaddress, 
borrowers.streetaddress, borrowers.cardnumber, borrowers.city, 
borrowers.zipcode, reserves.biblionumber, reserves.branchcode as branch, 
items.holdingbranch, items.itemcallnumber, items.itemnumber, barcode, notes, 
notificationdate, reminderdate, priority, reserves.found, biblio.title, 
biblio.author from reserves left join items on 
items.itemnumber=reserves.itemnumber, borrowers,biblio where 
isnull(cancellationdate) && reserves.borrowernumber=borrowers.borrowernumber && 
reserves.biblionumber=biblio.biblionumber && reserves.branchcode LIKE ? " . 
$sqlwhowhere . $sqldatewhere . $sqlorderby ;
 
 my $sth = $dbh->prepare($strsth); # or die $dbh->errstr;
-$sth->execute();
+$sth->execute( $branch );
 
 while (my $data=$sth->fetchrow_hashref) {
        push (@reservedata, 
@@ -183,6 +194,7 @@
                intranetcolorstylesheet => 
C4::Context->preference("intranetcolorstylesheet"),
                intranetstylesheet => 
C4::Context->preference("intranetstylesheet"),
                IntranetNav => C4::Context->preference("IntranetNav"),
+                branchoptionloop => address@hidden
                );
 
 print "Content-Type: text/html\n\n", $template->output;




reply via email to

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