- perltidy corrects broken indentation on 'if' block.
authorMason James <mason.loves.sushi@gmail.com>
Mon, 26 Jan 2009 00:05:30 +0000 (13:05 +1300)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Wed, 16 Sep 2009 21:19:04 +0000 (23:19 +0200)
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
opac/sco/sco-main.pl

index 62d8760..d212746 100755 (executable)
@@ -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}) {