From eb8e666234fd8d55f2d2bc900a95ad025c046e22 Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Tue, 2 Oct 2007 22:29:59 +0200 Subject: [PATCH] Bug Fixing : page changes were broken for unimarcfield_4XX.pl Signed-off-by: Chris Cormack --- .../value_builder/unimarc_field_4XX.pl | 33 ++++++++++++------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/cataloguing/value_builder/unimarc_field_4XX.pl b/cataloguing/value_builder/unimarc_field_4XX.pl index fef3738048..deda256c9b 100755 --- a/cataloguing/value_builder/unimarc_field_4XX.pl +++ b/cataloguing/value_builder/unimarc_field_4XX.pl @@ -356,16 +356,15 @@ sub plugin { } my @arrayresults; my @field_data = ($search); - for ( - my $i = $startfrom ; - $i <= ( - ( $startfrom + $resultsperpage ) < scalar(@$results) - ? ( $startfrom + $resultsperpage ) - : scalar(@$results) - ) ; - $i++ - ) - { + for ( + my $i = $startfrom * $resultsperpage ; + $i < (( $startfrom * $resultsperpage + $resultsperpage < scalar(@$results)) + ? $startfrom * $resultsperpage + $resultsperpage + : scalar(@$results) + ) ; + $i++ + ) + { my $record = MARC::Record::new_from_usmarc( $results->[$i] ); my $rechash = TransformMarcToKoha( $dbh, $record ); my $pos; @@ -385,7 +384,7 @@ sub plugin { $CN =~ s/ \|$//; $rechash->{CN} = $CN; push @arrayresults, $rechash; - } + } # for(my $i = 0 ; $i <= $#marclist ; $i++) # { @@ -425,6 +424,18 @@ sub plugin { } my $defaultview = 'BiblioDefaultView' . C4::Context->preference('BiblioDefaultView'); +# my $link="/cgi-bin/koha/cataloguing/value_builder/unimarc4XX.pl?op=do_search&q=$search_desc&resultsperpage=$resultsperpage&startfrom=$startfrom&search=$search"; +# foreach my $sort (@sort_by){ +# $link.="&sort_by=".$sort."&"; +# } +# $template->param( +# pagination_bar => pagination_bar( +# $link, +# getnbpages($hits, $results_per_page), +# $page, +# 'page' +# ), +# ); $template->param( result => \@arrayresults, index => $query->param('index') . "", -- 2.39.5