Bugzilla – Attachment 1233 Details for
Bug 3355
Pagination in bib search for subscriptions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
bugfix
0001--bug-3355-add-pagination-in-bib-search-for-subscri.patch (text/plain), 5.20 KB, created by
Chris Cormack
on 2009-06-24 09:01:00 UTC
(
hide
)
Description:
bugfix
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2009-06-24 09:01:00 UTC
Size:
5.20 KB
patch
obsolete
>From 023482f61109bcb30cc327fda5dea43649fb598a Mon Sep 17 00:00:00 2001 >From: Nahuel ANGELINETTI <nahuel.angelinetti@biblibre.com> >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) > <div id="bd"> > > >-<h1>Search results</h1> >+<h1>Search results from <!-- TMPL_VAR NAME="from" --> to <!-- TMPL_VAR NAME="to" --> of <!-- TMPL_VAR NAME="total" --></h1> > <!-- TMPL_IF NAME="total"--> > <table> > <tr> >@@ -54,15 +54,15 @@ function GetIt(bibno,title) > <!-- TMPL_ELSE --> > <h2>No results found for <b><!-- TMPL_VAR NAME="query" --></b></h2> > <!-- /TMPL_IF--> >-<a onclick="Plugin(f)" href="">Search for another Biblio</a> >+<!-- TMPL_IF NAME="displayprev" --> >+<a href="/cgi-bin/koha/serials/subscription-bib-search.pl?op=do_search&type=intranet&startfrom=<!-- TMPL_VAR ESCAPE="URL" NAME="startfromprev" -->&q=<!-- TMPL_VAR ESCAPE="URL" NAME="query" -->"><<</a> >+<!-- /TMPL_IF --> >+<!-- TMPL_IF NAME="displaynext" --> >+<a href="/cgi-bin/koha/serials/subscription-bib-search.pl?op=do_search&type=intranet&startfrom=<!-- TMPL_VAR ESCAPE="URL" NAME="startfromnext" -->&q=<!-- TMPL_VAR ESCAPE="URL" NAME="query" -->">>></a> >+<!-- /TMPL_IF --> >+<br/> >+<a href="subscription-bib-search.pl">Search for another Biblio</a> > <a class="button" href="#" onclick="window.close()"> Close</a></p> > </div> > >-<script type="text/javascript"> >-function Plugin(f) >-{ >- window.open('subscription-bib-search.pl','FindABibIndex','width=800,height=400,toolbar=no,scrollbars=yes'); >-} >-</script> >- > <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" --> >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 @@ > <!-- TMPL_IF name="no_query" --> > <div class="warning">You must enter a term to search on </div> > <!-- /TMPL_IF --> >-<form name="f" action="/cgi-bin/koha/serials/subscription-bib-search.pl" method="post"> >+<form name="f" action="/cgi-bin/koha/serials/subscription-bib-search.pl" method="get"> > <input type="hidden" name="op" value="do_search" /> > <input type="hidden" name="type" value="intranet" /> > <label for="q">Keyword</label> >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 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 3355
: 1233