- ($template, $loggedinuser, $cookie)
- = get_template_and_user({template_name => "serials/result.tmpl",
- query => $query,
- type => "intranet",
- authnotrequired => 0,
- flagsrequired => {borrowers => 1},
- flagsrequired => {catalogue => 1},
- debug => 1,
- });
+ if (defined $error) {
+ $template->param(query_error => $error);
+ warn "error: ".$error;
+ output_html_with_http_headers $input, $cookie, $template->output;
+ exit;
+ }
+ my @results;
+
+ for(my $i=0;$i<$total;$i++) {
+ my %resultsloop;
+ my $marcrecord = MARC::File::USMARC::decode($marcrecords->[$i]);
+ my $biblio = TransformMarcToKoha(C4::Context->dbh,$marcrecord,'');
+
+ #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'};
+ $resultsloop{issn} = $biblio->{'issn'};
+
+ push @results, \%resultsloop;
+ }