From 023482f61109bcb30cc327fda5dea43649fb598a Mon Sep 17 00:00:00 2001 From: Nahuel ANGELINETTI Date: Wed, 24 Jun 2009 10:59:44 +0200 Subject: [PATCH] (bug #3355) add pagination in bib search for subscriptions Content-Type: text/plain; charset="utf-8" This add the support of pagination, delete a javascript call, and use now a get method(why post was used?). --- .../prog/en/modules/serials/result.tmpl | 18 +++++++++--------- .../modules/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 38e3cb3..67a2060 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 2a17a72..a8cf0cf 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 21341db..0ad7476 100755 --- a/serials/subscription-bib-search.pl +++ b/serials/subscription-bib-search.pl @@ -76,9 +76,9 @@ if ($op eq "do_search" && $query) { $query .= " AND itype=$itemtypelimit" if $itemtypelimit; $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) { @@ -119,14 +119,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++) { @@ -141,11 +141,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 { @@ -160,7 +161,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, -- 1.6.0.4