From 34426697c52c265d92935d055dfc6cb0521d2c3c Mon Sep 17 00:00:00 2001 From: Nahuel ANGELINETTI Date: Wed, 24 Jun 2009 11:00:48 +0200 Subject: [PATCH] (bug #3355) add pagination in bib search for subscriptions This add the support of pagination, delete a javascript call, and use now a get method(why post was used?). Signed-off-by: Galen Charlton --- .../prog/en/modules/serials/result.tmpl | 18 +++++++++--------- .../serials/subscription-bib-search.tmpl | 2 +- serials/subscription-bib-search.pl | 17 +++++++++-------- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/result.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/result.tmpl index abef7057a2..acd48cfd36 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/result.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/result.tmpl @@ -21,7 +21,7 @@ function GetIt(bibno,title)
-

Search results

+

Search results from to of

@@ -54,15 +54,15 @@ function GetIt(bibno,title)

No results found for

-Search for another Biblio + +&q="><< + + +&q=">>> + +
+Search for another Biblio Close

- - diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-bib-search.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-bib-search.tmpl index 2a17a72afb..a8cf0cfd0e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-bib-search.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-bib-search.tmpl @@ -12,7 +12,7 @@
You must enter a term to search on
- + diff --git a/serials/subscription-bib-search.pl b/serials/subscription-bib-search.pl index 01c341db74..e486f0c5a4 100755 --- a/serials/subscription-bib-search.pl +++ b/serials/subscription-bib-search.pl @@ -79,9 +79,9 @@ if ($op eq "do_search" && $query) { } $resultsperpage= $input->param('resultsperpage'); - $resultsperpage = 19 if(!defined $resultsperpage); + $resultsperpage = 20 if(!defined $resultsperpage); - my ($error, $marcrecords, $total_hits) = SimpleSearch($query, $startfrom, $resultsperpage); + my ($error, $marcrecords, $total_hits) = SimpleSearch($query, $startfrom*$resultsperpage, $resultsperpage); my $total = scalar @$marcrecords; if (defined $error) { @@ -122,14 +122,14 @@ if ($op eq "do_search" && $query) { # multi page display gestion my $displaynext=0; my $displayprev=$startfrom; - if(($total - (($startfrom+1)*($resultsperpage))) > 0 ){ + if(($total_hits - (($startfrom+1)*($resultsperpage))) > 0 ){ $displaynext = 1; } my @numbers = (); - if ($total>$resultsperpage) + if ($total_hits>$resultsperpage) { for (my $i=1; $i<$total/$resultsperpage+1; $i++) { @@ -144,11 +144,12 @@ if ($op eq "do_search" && $query) { } } } - - my $from = $startfrom*$resultsperpage+1; + + my $from = 0; + $from = $startfrom*$resultsperpage+1 if($total_hits > 0); my $to; - if($total < (($startfrom+1)*$resultsperpage)) + if($total_hits < (($startfrom+1)*$resultsperpage)) { $to = $total; } else { @@ -163,7 +164,7 @@ if ($op eq "do_search" && $query) { resultsperpage => $resultsperpage, startfromnext => $startfrom+1, startfromprev => $startfrom-1, - total=>$total, + total=>$total_hits, from=>$from, to=>$to, numbers=>\@numbers, -- 2.39.2