From 993c57941b4858165057da4c577d146add289d91 Mon Sep 17 00:00:00 2001 From: acli Date: Wed, 5 Feb 2003 09:07:09 +0000 Subject: [PATCH] Fixed bug 202, the branch menu-building code has spurious checks for CU and IS fields, which does not exist, resulting in no branches being added For selectbranchprinter: Noted correct tab size Handle non-latin1 charsets For branchtransfers: Use getbranch and getprinter Removed spurious checkauth call and associated unused variables --- circ/branchtransfers.pl | 15 ++++----------- circ/selectbranchprinter.pl | 19 ++++++++++++------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/circ/branchtransfers.pl b/circ/branchtransfers.pl index 8c50fdcd2f..899e31eafe 100755 --- a/circ/branchtransfers.pl +++ b/circ/branchtransfers.pl @@ -50,17 +50,10 @@ my $printers = getprinters(\%env); # Getting state my $query=new CGI; -my ($loggedinuser, $sessioncookie, $sessionID) = checkauth($query); -my $branch = $query->param("branch"); -my $printer = $query->param("printer"); - -($branch) || ($branch=$query->cookie('branch')) ; -($printer) || ($printer=$query->cookie('printer')) ; - -($branches->{$branch}) || ($branch=(keys %$branches)[0]); -($printers->{$printer}) || ($printer=(keys %$printers)[0]); +my $branch = getbranch($query, $branches); +my $printer = getprinter($query, $printers); my $genbrname = $branches->{$branch}->{'branchname'} ; my $genprname = $printers->{$printer}->{'printername'}; @@ -110,7 +103,7 @@ if ($request eq 'KillReserved'){ # set up the branchselect options.... my @branchoptionloop; foreach my $br (keys %$branches) { - (next) unless $branches->{$br}->{'CU'}; + #(next) unless $branches->{$br}->{'CU'}; #FIXME disabled to fix bug 202 my %branch; $branch{selected}=($br eq $tobranchcd); $branch{code}=$br; @@ -284,7 +277,7 @@ $template->param( genbrname => $genbrname, branchoptionloop => \@branchoptionloop, errmsgloop => \@errmsgloop ); -output_html_with_http_headers $query, $sessioncookie, $template->output; +output_html_with_http_headers $query, $cookie, $template->output; sub name { diff --git a/circ/selectbranchprinter.pl b/circ/selectbranchprinter.pl index 1fe3dc067c..147bce5504 100644 --- a/circ/selectbranchprinter.pl +++ b/circ/selectbranchprinter.pl @@ -1,4 +1,5 @@ #!/usr/bin/perl +# WARNING: This file uses 4-character tabs! # Copyright 2000-2002 Katipo Communications @@ -24,6 +25,7 @@ use C4::Circulation::Circ2; use C4::Output; use C4::Auth; use C4::Print; +use C4::Interface::CGI::Output; use HTML::Template; use DBI; @@ -71,14 +73,14 @@ $env{'queue'}=$printer; 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; @@ -129,6 +131,9 @@ $template->param(headerbackgroundcolor => $headerbackgroundcolor, branchloop => \@branchloop ); -print $query->header(), $template->output; +output_html_with_http_headers $query, $cookie, $template->output; +# Local Variables: +# tab-width: 4 +# End: -- 2.20.1