From aeffe53f90843c2447db4bc020ce320dbe7dd98b Mon Sep 17 00:00:00 2001 From: Nahuel ANGELINETTI Date: Thu, 12 Feb 2009 15:58:35 +0100 Subject: [PATCH] (bug #2956) fix another results calculation this patch fix more about 4XX plugin, for results display and calculation. Signed-off-by: Galen Charlton --- cataloguing/value_builder/unimarc_field_4XX.pl | 11 +++++------ .../cataloguing/value_builder/unimarc_field_4XX.tmpl | 2 ++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/cataloguing/value_builder/unimarc_field_4XX.pl b/cataloguing/value_builder/unimarc_field_4XX.pl index b97f27b206..314860173b 100755 --- a/cataloguing/value_builder/unimarc_field_4XX.pl +++ b/cataloguing/value_builder/unimarc_field_4XX.pl @@ -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; @@ -414,11 +414,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'); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_4XX.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_4XX.tmpl index 09258477a0..cbcb961d20 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_4XX.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_4XX.tmpl @@ -149,6 +149,7 @@   + class="hilighted"> @@ -177,6 +178,7 @@ + -- 2.39.5