Bug 31420: Managing funds: Labels of statistic fields overlap with pull downs
[koha-ffzg.git] / ill / ill-requests.pl
index fef5e55..fc7da41 100755 (executable)
@@ -97,6 +97,12 @@ if ( $backends_available ) {
                 ( tran_success => $params->{tran_success} ) : () ),
         );
 
+        my $backend_result = $request->backend_illview($params);
+        $template->param(
+            whole      => $backend_result,
+        ) if $backend_result;
+
+
     } elsif ( $op eq 'create' ) {
         # We're in the process of creating a request
         my $request = Koha::Illrequest->new->load_backend( $params->{backend} );
@@ -152,14 +158,12 @@ if ( $backends_available ) {
         my $request = Koha::Illrequests->find($params->{illrequest_id});
         my $backend_result;
         if ( $params->{backend} ) {
-            my $new_request = Koha::Illrequest->new->load_backend( $params->{backend} );
-            $backend_result = $new_request->backend_migrate($params);
+            $backend_result = $request->backend_migrate($params);
             if ($backend_result) {
                 $template->param(
                     whole   => $backend_result,
-                    request => $new_request
+                    request => $request
                 );
-                $request = $new_request;
             } else {
                 # Backend failure, redirect back to illview
                 print $cgi->redirect( '/cgi-bin/koha/ill/ill-requests.pl'
@@ -431,7 +435,7 @@ $template->param(
     backends   => $backends,
     types      => [ "Book", "Article", "Journal" ],
     query_type => $op,
-    branches   => scalar Koha::Libraries->search,
+    branches   => Koha::Libraries->search,
 );
 
 output_html_with_http_headers( $cgi, $cookie, $template->output );