#!/usr/bin/perl
-# $Id$
# Copyright 2000-2002 Katipo Communications
#
use CGI;
use C4::Branch; # GetBranches
use C4::Auth;
-use C4::Date;
+use C4::Dates qw/format_date/;
use C4::Circulation;
use C4::Reserves;
use C4::Members;
);
use C4::Koha;
use C4::Biblio;
+use C4::Items;
my $input = new CGI;
# set the userenv branch
my $default = C4::Context->userenv->{'branch'};
-my @datearr = localtime( time() );
-my $todaysdate =
- ( 1900 + $datearr[5] ) . '-'
- . sprintf( "%0.2d", ( $datearr[4] + 1 ) ) . '-'
- . sprintf( "%0.2d", $datearr[3] );
-
my $item = $input->param('itemnumber');
my $fbr = $input->param('fbr');
my $tbr = $input->param('tbr');
foreach my $br ( keys %$branches ) {
my @reservloop;
my %branchloop;
- $branchloop{'branchname'} = $branches->{$br}->{'branchname'};
- $branchloop{'branchcode'} = $branches->{$br}->{'branchcode'};
my @getreserves =
GetReservesToBranch( $branches->{$br}->{'branchcode'} );
if (@getreserves) {
+ $branchloop{'branchname'} = $branches->{$br}->{'branchname'};
+ $branchloop{'branchcode'} = $branches->{$br}->{'branchcode'};
foreach my $num (@getreserves) {
my %getreserv;
my $gettitle = GetBiblioFromItemNumber( $num->{'itemnumber'} );
if (@reservloop) {
$branchloop{'reserv'} = \@reservloop;
}
-
# else, we unset the value of the branchcode .
else {
$branchloop{'branchcode'} = 0;
}
}
- else {
-
-# if we don't have a retrun from reservestobranch we unset branchname and branchcode
- $branchloop{'branchname'} = 0;
- $branchloop{'branchcode'} = 0;
- }
- push( @branchesloop, \%branchloop );
+ push( @branchesloop, \%branchloop ) if %branchloop;
}
$template->param(
branchesloop => \@branchesloop,
- show_date => format_date($todaysdate)
+ show_date => format_date(C4::Dates->today('iso')),
);
-print "Content-Type: text/html\n\n", $template->output;
-
+output_html_with_http_headers $input, $cookie, $template->output;