[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] koha/circ reserve.pl [dev_week]
From: |
Ryan Higgins |
Subject: |
[Koha-cvs] koha/circ reserve.pl [dev_week] |
Date: |
Fri, 15 Dec 2006 23:52:09 +0000 |
CVSROOT: /sources/koha
Module name: koha
Branch: dev_week
Changes by: Ryan Higgins <rych> 06/12/15 23:52:09
Modified files:
circ : reserve.pl
Log message:
add date filters to reservelist
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.1&r2=1.1.2.6.2.2
Patches:
Index: reserve.pl
===================================================================
RCS file: /sources/koha/koha/circ/reserve.pl,v
retrieving revision 1.1.2.6.2.1
retrieving revision 1.1.2.6.2.2
diff -u -b -r1.1.2.6.2.1 -r1.1.2.6.2.2
--- reserve.pl 11 Jul 2006 13:46:04 -0000 1.1.2.6.2.1
+++ reserve.pl 15 Dec 2006 23:52:09 -0000 1.1.2.6.2.2
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# $Id: reserve.pl,v 1.1.2.6.2.1 2006/07/11 13:46:04 kados Exp $
+# $Id: reserve.pl,v 1.1.2.6.2.2 2006/12/15 23:52:09 rych Exp $
# Copyright 2000-2002 Katipo Communications
#
@@ -30,6 +30,8 @@
my $input = new CGI;
my $type=$input->param('type');
my $order=$input->param('order');
+my $startdate=$input->param('from');
+my $enddate=$input->param('to');
my $theme = $input->param('theme'); # only used if allowthemeoverride is set
@@ -68,13 +70,29 @@
my $author;
my @datearr = localtime(time());
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) );
+$startdate = $twodaysago unless ($startdate);
+$enddate = $todaysdate unless ($enddate);
my $dbh = C4::Context->dbh;
-my $strsth="select reservedate,reserves.borrowernumber as bornum,
concat(firstname,' ',surname) as borrower, borrowers.phone,
borrowers.emailaddress,reserves.biblionumber, reserves.branchcode as branch,
items.holdingbranch, items.itemcallnumber, items.itemnumber, 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 order by reservedate, borrower ";
-$strsth="select reservedate,reserves.borrowernumber as
bornum,concat(firstname,' ',surname) as borrower, borrowers.phone,
borrowers.emailaddress,reserves.biblionumber, reserves.branchcode as branch,
items.holdingbranch, items.itemcallnumber, items.itemnumber, 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 order by borrower,reservedate " if
($order eq "borrower");
-$strsth="select reservedate,reserves.borrowernumber as
bornum,concat(firstname,' ',surname) as borrower, borrowers.phone,
borrowers.emailaddress,reserves.biblionumber, reserves.branchcode as branch,
items.holdingbranch, items.itemcallnumber, items.itemnumber, 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 order by biblio.title,
priority,reservedate " if ($order eq "biblio");
-my $sth=$dbh->prepare($strsth);
+my ($sqlorderby, $sqldatewhere) = ("","");
+
+$sqldatewhere .= " && reservedate >= " . $dbh->quote($startdate) if
($startdate) ;
+$sqldatewhere .= " && reservedate <= " . $dbh->quote($enddate) if ($enddate) ;
+
+if ($order eq "borrower") {
+ $sqlorderby = " order by borrower, reservedate";
+} elsif ($order eq "biblio") {
+ $sqlorderby = " order by biblio.title, priority,reservedate";
+} else {
+ $sqlorderby = " order by reservedate, borrower";
+}
+
+my $strsth="select reservedate,reserves.borrowernumber as bornum,
concat(firstname,' ',surname) as borrower, borrowers.phone,
borrowers.emailaddress,reserves.biblionumber, reserves.branchcode as branch,
items.holdingbranch, items.itemcallnumber, items.itemnumber, 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 " . $sqldatewhere . $sqlorderby ;
+
+#my $sth=$dbh->prepare($strsth);
warn "".$strsth;
+my $sth = $dbh->prepare($strsth) or die $dbh->errstr;
$sth->execute();
my @reservedata;
@@ -108,6 +126,8 @@
$sth->finish;
$template->param(todaysdate => format_date($todaysdate),
+ from => $startdate,
+ to => $enddate,
reserveloop => address@hidden,
intranetcolorstylesheet =>
C4::Context->preference("intranetcolorstylesheet"),
intranetstylesheet =>
C4::Context->preference("intranetstylesheet"),
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Koha-cvs] koha/circ reserve.pl [dev_week],
Ryan Higgins <=