From 97b8acb06c9385ad90f1b402856af95c845eab5c Mon Sep 17 00:00:00 2001 From: Mason James Date: Mon, 26 Jan 2009 13:05:30 +1300 Subject: [PATCH] - perltidy corrects broken indentation on 'if' block. Signed-off-by: Galen Charlton --- opac/sco/sco-main.pl | 153 ++++++++++++++++++++++++------------------- 1 file changed, 85 insertions(+), 68 deletions(-) diff --git a/opac/sco/sco-main.pl b/opac/sco/sco-main.pl index 62d8760aa6..d212746c40 100755 --- a/opac/sco/sco-main.pl +++ b/opac/sco/sco-main.pl @@ -60,74 +60,91 @@ my $return_only = 0; if ($op eq "logout") { $query->param( patronid => undef ); } - if ($op eq "returnbook") { - my ($doreturn ) = AddReturn($barcode, $branch); - #warn "returnbook: " . $doreturn; - ($borrower) = GetMemberDetails(undef, $patronid); - } - - if ($op eq "checkout" ) { - my $impossible = {}; - my $needconfirm = {}; - if ( !$confirmed ) { - ($impossible,$needconfirm) = CanBookBeIssued($borrower,$barcode); - } - $confirm_required = scalar(keys(%$needconfirm)); - #warn "confirm_required: " . $confirm_required ; - if (scalar(keys(%$impossible))) { - # warn "impossible: numkeys: " . scalar (keys(%$impossible)); - my ($issue_error) = keys %$impossible ; - # FIXME we assume only one error. - $template->param( impossible => $issue_error, - title => $item->{title} , - hide_main => 1, - ); - #warn "issue_error: " . $issue_error ; - if ($issue_error eq "NO_MORE_RENEWALS") { - $return_only = 1; - $template->param ( returnitem => 1, - barcode => $barcode , - ); - } - } elsif ($needconfirm->{RENEW_ISSUE} ) { - if ( $confirmed ) { - #warn "renewing"; - AddRenewal($borrower,$item->{itemnumber}); - } else { - #warn "renew confirmation"; - $template->param( renew => 1, - barcode => $barcode, - confirm => 1, - confirm_renew_issue => 1, - hide_main => 1, - ); - } - } elsif ( $confirm_required && !$confirmed ) { - #warn "failed confirmation"; - my ($confirmation) = keys %$needconfirm ; - $template->param( impossible => $confirmation, - hide_main => 1, - ); - } else { - if ( $confirmed || $issuenoconfirm ) { # we'll want to call getpatroninfo again to get updated issues. - #warn "issuing book?"; - AddIssue($borrower,$barcode); - # ($borrower, $flags) = getpatroninformation(undef,undef, $patronid); - - # $template->param( patronid => $patronid, -# validuser => 1, -# ); - } else { - $confirm_required = 1; - #warn "issue confirmation"; - $template->param( confirm => "Issuing title: " . $item->{title} , - barcode => $barcode, - hide_main => 1, - inputfocus => 'confirm', - ); - } - } - } # op=checkout + + +if ( $op eq "returnbook" ) { + my ($doreturn) = AddReturn( $barcode, $branch ); + + #warn "returnbook: " . $doreturn; + ($borrower) = GetMemberDetails( undef, $patronid ); +} + +if ( $op eq "checkout" ) { + my $impossible = {}; + my $needconfirm = {}; + if ( !$confirmed ) { + ( $impossible, $needconfirm ) = CanBookBeIssued( $borrower, $barcode ); + } + $confirm_required = scalar( keys(%$needconfirm) ); + + #warn "confirm_required: " . $confirm_required ; + if ( scalar( keys(%$impossible) ) ) { + + # warn "impossible: numkeys: " . scalar (keys(%$impossible)); + my ($issue_error) = keys %$impossible; + + # FIXME we assume only one error. + $template->param( + impossible => $issue_error, + title => $item->{title}, + hide_main => 1, + ); + + #warn "issue_error: " . $issue_error ; + if ( $issue_error eq "NO_MORE_RENEWALS" ) { + $return_only = 1; + $template->param( + returnitem => 1, + barcode => $barcode, + ); + } + } elsif ( $needconfirm->{RENEW_ISSUE} ) { + if ($confirmed) { + + #warn "renewing"; + AddRenewal( $borrower, $item->{itemnumber} ); + } else { + + #warn "renew confirmation"; + $template->param( + renew => 1, + barcode => $barcode, + confirm => 1, + confirm_renew_issue => 1, + hide_main => 1, + ); + } + } elsif ( $confirm_required && !$confirmed ) { + + #warn "failed confirmation"; + my ($confirmation) = keys %$needconfirm; + $template->param( + impossible => $confirmation, + hide_main => 1, + ); + } else { + if ( $confirmed || $issuenoconfirm ) { # we'll want to call getpatroninfo again to get updated issues. + #warn "issuing book?"; + AddIssue( $borrower, $barcode ); + + # ($borrower, $flags) = getpatroninformation(undef,undef, $patronid); + + # $template->param( patronid => $patronid, + # validuser => 1, + # ); + } else { + $confirm_required = 1; + + #warn "issue confirmation"; + $template->param( + confirm => "Issuing title: " . $item->{title}, + barcode => $barcode, + hide_main => 1, + inputfocus => 'confirm', + ); + } + } +} # op=checkout if ($borrower->{cardnumber}) { -- 2.39.2