use C4::Interface::CGI::Output;
use HTML::Template;
use DBI;
+use C4::Koha;
# this is a reorganisation of circulationold.pl
my $oldbranch = $branch;
my $oldprinter = $printer;
-$branch='';
-$printer='';
+#$branch='';
+#$printer='';
$env{'branchcode'}=$branch;
my $oneprinter=($printercount==1) ;
my $onebranch=($branchcount==1) ;
if ($printercount==1) {
- ($printer)=keys %$printers;
- $printername=$printers->{$printer}->{printername};
+ my ($tmpprinter)=keys %$printers;
+ $printername=$printers->{$tmpprinter}->{printername};
}
if ($branchcount==1) {
- ($branch)=keys %$branches;
- $branchname=$branches->{$branch}->{branchname};
+ my ($tmpbranch)=keys %$branches;
+ $branchname=$branches->{$tmpbranch}->{branchname};
}
branchloop => \@branchloop
);
-output_html_with_http_headers $query, $cookie, $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: