Remove unused $toggle code
[koha.git] / cataloguing / addbooks.pl
index 27db416..2f43feb 100755 (executable)
@@ -1,6 +1,5 @@
 #!/usr/bin/perl
 
-# $Id$
 
 # Copyright 2000-2002 Katipo Communications
 #
@@ -69,7 +68,7 @@ foreach my $thisframeworkcode ( keys %$frameworks ) {
 if ($query) {
 
     # find results
-    my ( $error, $marcresults ) = SimpleSearch($query);
+    my ( $error, $marcresults, $total_hits ) = SimpleSearch($query, $results_per_page * ($page - 1), $results_per_page);
 
     if ( defined $error ) {
         $template->param( error => $error );
@@ -77,21 +76,15 @@ if ($query) {
         output_html_with_http_headers $input, $cookie, $template->output;
         exit;
     }
-
+    
     # format output
     my $total = scalar @$marcresults;
-    my @newresults = searchResults( $query, $total, $results_per_page, $page, @$marcresults );
-    
+    my @newresults = searchResults( $query, $total, $results_per_page, $page-1, 0, @$marcresults );
     $template->param(
-        total       => $total,
-        query       => $query,
-        resultsloop => \@newresults,
-        pagination_bar => pagination_bar(
-                               "/cgi-bin/koha/cataloguing/addbooks.pl?q=$query&",
-                                getnbpages( $total, $results_per_page ),
-               $page,
-                       'page'
-               ),
+        total          => $total_hits,
+        query          => $query,
+        resultsloop    => \@newresults,
+        pagination_bar => pagination_bar( "/cgi-bin/koha/cataloguing/addbooks.pl?q=$query&", getnbpages( $total_hits, $results_per_page ), $page, 'page' ),
     );
 }
 
@@ -128,6 +121,7 @@ for ( my $i = 0 ; $i <= $#resultsbr ; $i++ ) {
 
 $template->param(
     frameworkcodeloop => \@frameworkcodeloop,
+    breeding_count    => $countbr,
     breeding_loop     => \@breeding_loop,
 );