From c965f345cdf33dccd42b22e3f9b7f71a7340ad8f Mon Sep 17 00:00:00 2001 From: acli Date: Wed, 5 Feb 2003 07:57:56 +0000 Subject: [PATCH] Fixed bug 200; a "last" was placed in the wrong place The file does not use 4-character tabs, nor 8-character tabs, it uses both (!); updated comments. Catch more $code's; is this (and the change to Circ2.pm) what was intended? --- circ/returns.pl | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/circ/returns.pl b/circ/returns.pl index 325e2fde2b..5b559f7e6f 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -1,5 +1,7 @@ #!/usr/bin/perl -# Please use 8-character tabs for this file (indents are 4 spaces) +# WARNING: This file contains mixed-sized tabs! (some 4-character, some 8) +# WARNING: Currently, 4-character tabs seem to be dominant +# WARNING: But there are still lots of 8-character tabs #written 11/3/2002 by Finlay #script to execute returns of books @@ -230,28 +232,32 @@ my @errmsgloop; foreach my $code (keys %$messages) { # warn $code; my %err; + my $exit_required_p = 0; if ($code eq 'BadBarcode'){ $err{badbarcode}=1; $err{msg}= $messages->{'BadBarcode'}; - } - if ($code eq 'NotIssued'){ + } elsif ($code eq 'NotIssued'){ $err{notissued}=1; $err{msg}= $branches->{$messages->{'IsPermanent'}}->{'branchname'}; - } - if ($code eq 'WasLost'){ + } elsif ($code eq 'WasLost'){ $err{waslost}=1; - } - if ($code eq 'wthdrawn'){ + } elsif ($code eq 'WasReturned'){ + ; # FIXME... anything to do here? + } elsif ($code eq 'WasTransfered'){ + ; # FIXME... anything to do here? + } elsif ($code eq 'wthdrawn'){ $err{withdrawn}=1; - last; - } - if (($code eq 'IsPermanent') && (not $messages->{'ResFound'})) { + $exit_required_p = 1; + } elsif (($code eq 'IsPermanent') && (not $messages->{'ResFound'})) { if ($messages->{'IsPermanent'} ne $branch) { $err{ispermanent}=1; $err{msg}=$branches->{$messages->{'IsPermanent'}}->{'branchname'} ; } + } else { + die "Unknown error code $code"; # XXX } push (@errmsgloop, \%err); +last if $exit_required_p; } $template->param(errmsgloop => \@errmsgloop); @@ -384,5 +390,5 @@ sub cuecatbarcodedecode { }} # Local Variables: -# tab-width: 8 +# tab-width: 4 # End: -- 2.39.5