(bug #2956) fix another results calculation
this patch fix more about 4XX plugin, for results display and calculation. Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
This commit is contained in:
parent
f185d69ad2
commit
6b4fed3b47
2 changed files with 7 additions and 6 deletions
|
@ -330,7 +330,7 @@ sub plugin {
|
|||
my $startfrom = $query->param('startfrom');
|
||||
my $resultsperpage = $query->param('resultsperpage') || 20;
|
||||
my $orderby;
|
||||
my ( $errors, $results, $total_hits ) = SimpleSearch($search, $startfrom, $resultsperpage );
|
||||
my ( $errors, $results, $total_hits ) = SimpleSearch($search, $startfrom * $resultsperpage, $resultsperpage );
|
||||
my $total = scalar(@$results);
|
||||
|
||||
# warn " biblio count : ".$total;
|
||||
|
@ -412,11 +412,10 @@ sub plugin {
|
|||
my $from = $startfrom * $resultsperpage + 1;
|
||||
my $to;
|
||||
|
||||
if ( $total < ( ( $startfrom + 1 ) * $resultsperpage ) ) {
|
||||
$to = $total;
|
||||
}
|
||||
else {
|
||||
$to = ( ( $startfrom + 1 ) * $resultsperpage );
|
||||
if ( $total_hits < $from + $resultsperpage ) {
|
||||
$to = $total_hits;
|
||||
}else{
|
||||
$to = $from + $resultsperpage ;
|
||||
}
|
||||
my $defaultview =
|
||||
'BiblioDefaultView' . C4::Context->preference('BiblioDefaultView');
|
||||
|
|
|
@ -149,6 +149,7 @@
|
|||
<th> </th>
|
||||
</tr>
|
||||
<!-- TMPL_LOOP NAME="result" -->
|
||||
<!-- TMPL_IF NAME="title" -->
|
||||
<tr>
|
||||
<td<!-- TMPL_IF NAME="even" --> class="hilighted"<!-- /TMPL_IF -->>
|
||||
<!-- TMPL_IF name="MARC_ON" -->
|
||||
|
@ -177,6 +178,7 @@
|
|||
<!--/TMPL_IF-->
|
||||
</td>
|
||||
</tr>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- /TMPL_LOOP -->
|
||||
</table>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue