[Koha-patches] [PATCH] - perltidy corrects broken indentation on 'if' block.
Mason James
mason.loves.sushi at gmail.com
Mon Jan 26 01:05:30 CET 2009
---
opac/sco/sco-main.pl | 153 ++++++++++++++++++++++++++++----------------------
1 files changed, 85 insertions(+), 68 deletions(-)
diff --git a/opac/sco/sco-main.pl b/opac/sco/sco-main.pl
index 62d8760..d212746 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}) {
--
1.5.6.5
More information about the Koha-patches
mailing list