[Koha-cvs] koha/reports reservereport.pl
Chris Cormack
chris at katipo.co.nz
Wed Jun 7 05:18:55 CEST 2006
CVSROOT: /sources/koha
Module name: koha
Changes by: Chris Cormack <rangi> 06/06/07 03:18:55
Modified files:
reports : reservereport.pl
Log message:
Shows reserves for a given branch
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/reports/reservereport.pl?cvsroot=koha&r1=1.6&r2=1.7
Patches:
Index: reservereport.pl
===================================================================
RCS file: /sources/koha/koha/reports/reservereport.pl,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- reservereport.pl 3 Sep 2005 18:33:15 -0000 1.6
+++ reservereport.pl 7 Jun 2006 03:18:55 -0000 1.7
@@ -20,6 +20,9 @@
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA 02111-1307 USA
+# script now takes a branchcode arg
+# eg: http://koha.rangitikei.katipo.co.nz/cgi-bin/koha/reports/reservereport.pl?branch=BL
+
use strict;
use C4::Stats;
use C4::Date;
@@ -28,9 +31,17 @@
use HTML::Template;
use C4::Auth;
use C4::Interface::CGI::Output;
+use C4::Koha;
+
my $input = new CGI;
my $time = $input->param('time');
+my $branch = $input->param('branch');
+if (!$branch) {
+ $branch = "ALL";
+}
+
+my $branches=getbranches();
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
{
@@ -43,7 +54,21 @@
}
);
-my ( $count, $data ) = unfilledreserves();
+# building up branches dropdown box
+
+my %branchall;
+my $branchcount=0;
+my @branchloop;
+
+foreach my $br (keys %$branches) {
+ $branchcount++;
+ my %branch1;
+ $branch1{name}=$branches->{$br}->{'branchname'};
+ $branch1{value}=$br;
+ push(@branchloop,\%branch1);
+ }
+
+my ( $count, $data ) = unfilledreserves($branch);
my @dataloop;
my $toggle;
@@ -59,6 +84,7 @@
$line{'classification'} = $data->[$i]->{'classification'};
$line{'dewey'} = $data->[$i]->{'dewey'};
$line{'status'} = $data->[$i]->{'found'};
+ $line{'branchcode'} = $data->[$i]->{'branchcode'};
$line{'toggle'} = $toggle;
push( @dataloop, \%line );
@@ -67,7 +93,10 @@
$template->param(
count => $count,
- dataloop => \@dataloop
+ dataloop => \@dataloop,
+ branchcode => $branch,
+ branchloop => \@branchloop
+
);
output_html_with_http_headers $input, $cookie, $template->output;
More information about the Koha-cvs
mailing list