From b6ad2f98a48eb330660c1bffd6015703b9930d00 Mon Sep 17 00:00:00 2001 From: Joe Atzberger Date: Tue, 1 Jun 2010 17:57:57 +0000 Subject: [PATCH] Whitespace and stylistic cleanup only. --- ILS.pm | 46 +++++++++++++++++----------------------------- Sip.pm | 5 ----- 2 files changed, 17 insertions(+), 34 deletions(-) diff --git a/ILS.pm b/ILS.pm index 81e3615..b8fe245 100644 --- a/ILS.pm +++ b/ILS.pm @@ -221,12 +221,9 @@ sub end_patron_session { sub pay_fee { my ($self, $patron_id, $patron_pwd, $fee_amt, $fee_type, $pay_type, $fee_id, $trans_id, $currency) = @_; - my $trans; - my $patron; - - $trans = new ILS::Transaction::FeePayment; - $patron = new ILS::Patron $patron_id; + my $trans = ILS::Transaction::FeePayment->new(); + my $patron = ILS::Patron->new($patron_id); $trans->transaction_id($trans_id); $trans->patron($patron); @@ -238,41 +235,32 @@ sub pay_fee { sub add_hold { my ($self, $patron_id, $patron_pwd, $item_id, $title_id, $expiry_date, $pickup_location, $hold_type, $fee_ack) = @_; - my ($patron, $item); my $hold; - my $trans; + my $trans = new ILS::Transaction::Hold; + my $patron = new ILS::Patron $patron_id; - $trans = new ILS::Transaction::Hold; - - # BEGIN TRANSACTION - $patron = new ILS::Patron $patron_id; if (!$patron - || (defined($patron_pwd) && !$patron->check_password($patron_pwd))) { - $trans->screen_msg("Invalid Patron."); - - return $trans; + || (defined($patron_pwd) && !$patron->check_password($patron_pwd))) { + $trans->screen_msg("Invalid Patron."); + return $trans; } - $item = new ILS::Item ($item_id || $title_id); + my $item = new ILS::Item ($item_id || $title_id); if (!$item) { - $trans->screen_msg("No such item."); - - # END TRANSACTION (conditionally) - return $trans; + $trans->screen_msg("No such item."); + return $trans; } elsif ($item->fee && ($fee_ack ne 'Y')) { - $trans->screen_msg = "Fee required to place hold."; - - # END TRANSACTION (conditionally) - return $trans; + $trans->screen_msg = "Fee required to place hold."; + return $trans; } $hold = { - item_id => $item->id, - patron_id => $patron->id, - expiration_date => $expiry_date, - pickup_location => $pickup_location, - hold_type => $hold_type, + item_id => $item->id, + patron_id => $patron->id, + expiration_date => $expiry_date, + pickup_location => $pickup_location, + hold_type => $hold_type, }; $trans->ok(1); diff --git a/Sip.pm b/Sip.pm index 4e2e09b..8c64a43 100644 --- a/Sip.pm +++ b/Sip.pm @@ -64,7 +64,6 @@ our $last_response = ''; sub timestamp { my $time = $_[0] || time(); - return strftime(SIP_DATETIME, localtime($time)); } @@ -99,7 +98,6 @@ sub add_field { # sub maybe_add { my ($fid, $value) = @_; - return (defined($value) && $value) ? add_field($fid, $value) : ''; } @@ -136,13 +134,11 @@ sub add_count { # sub denied { my $bool = shift; - return boolspace(!$bool); } sub sipbool { my $bool = shift; - return $bool ? 'Y' : 'N'; } @@ -151,7 +147,6 @@ sub sipbool { # sub boolspace { my $bool = shift; - return $bool ? 'Y' : ' '; } -- 2.11.0