- my $total = scalar @$marcresults;
- my @results;
-
- for(my $i=0;$i<$total;$i++) {
- my %resultsloop;
- my $marcrecord = MARC::File::USMARC::decode($marcresults->[$i]);
- my $biblio = TransformMarcToKoha(C4::Context->dbh,$marcrecord,'');
-
- #hilight the result
- $biblio->{'title'} =~ s/$query/<span class=term>$&<\/span>/gi;
- $biblio->{'subtitle'} =~ s/$query/<span class=term>$&<\/span>/gi;
- $biblio->{'biblionumber'} =~ s/$query/<span class=term>$&<\/span>/gi;
- $biblio->{'author'} =~ s/$query/<span class=term>$&<\/span>/gi;
- $biblio->{'publishercode'} =~ s/$query/<span class=term>$&<\/span>/gi;
- $biblio->{'publicationyear'} =~ s/$query/<span class=term>$&<\/span>/gi;
-
- #build the hash for the template.
- $resultsloop{highlight} = ($i % 2)?(1):(0);
- $resultsloop{title} = $biblio->{'title'};
- $resultsloop{subtitle} = $biblio->{'subtitle'};
- $resultsloop{biblionumber} = $biblio->{'biblionumber'};
- $resultsloop{author} = $biblio->{'author'};
- $resultsloop{publishercode} = $biblio->{'publishercode'};
- $resultsloop{publicationyear} = $biblio->{'publicationyear'};
-
- push @results, \%resultsloop;
+ # format output
+ # SimpleSearch() give the results per page we want, so 0 offet here
+ my $total = @{$marcresults};
+ my @newresults = searchResults( 'intranet', $query, $total, $results_per_page, 0, 0, $marcresults );
+ foreach my $line (@newresults) {
+ if ( not exists $line->{'size'} ) { $line->{'size'} = "" }