#!/usr/bin/perl
+# WARNING: This file uses 4-character tabs!
# Copyright 2000-2002 Katipo Communications
use C4::Output;
use C4::Auth;
use C4::Print;
+use C4::Interface::CGI::Output;
use HTML::Template;
use DBI;
+use C4::Koha;
# this is a reorganisation of circulationold.pl
my $branchcount=0;
my $printercount=0;
my @branchloop;
-foreach (keys %$branches) {
- (next) unless ($_);
- (next) unless ($branches->{$_}->{'IS'});
+foreach my $br (keys %$branches) {
+ next unless $br =~ /\S/;
+ #(next) unless ($branches->{$_}->{'IS'}); # FIXME disabled to fix bug 202
$branchcount++;
my %branch;
- $branch{selected}=($_ eq $oldbranch);
- $branch{name}=$branches->{$_}->{'branchname'};
- $branch{value}=$_;
+ $branch{selected}=($br eq $oldbranch);
+ $branch{name}=$branches->{$br}->{'branchname'};
+ $branch{value}=$br;
push(@branchloop,\%branch);
}
my @printerloop;
}
# if there is only one....
+my $printername;
+my $branchname;
+
my $oneprinter=($printercount==1) ;
my $onebranch=($branchcount==1) ;
if ($printercount==1) {
my ($template, $borrowernumber, $cookie)
= get_template_and_user({template_name => "circ/selectbranchprinter.tmpl",
- query => $input,
+ query => $query,
type => "intranet",
authnotrequired => 0,
- flagsrequired => {parameters => 1},
+ flagsrequired => {circulate => 1},
});
$template->param(headerbackgroundcolor => $headerbackgroundcolor,
backgroundimage => $backgroundimage,
branchloop => \@branchloop
);
-print $query->header(), $template->output;
+my $branchcookie=$query->cookie(-name => 'branch', -value => "$branch", -expires => '+1y');
+my $printercookie=$query->cookie(-name => 'printer', -value => "$printer", -expires => '+1y');
+
+my $cookies=[$cookie,$branchcookie, $printercookie];
+output_html_with_http_headers $query, $cookies, $template->output;
+# Local Variables:
+# tab-width: 4
+# End: