4 use C4::Output; # contains picktemplate
11 my ($loggedinuser, $cookie, $sessionID) = checkauth($query, 1);
13 my $template = gettemplate ("opac-detail.tmpl", "opac");
15 $template->param(loggedinuser => $loggedinuser);
17 my $biblionumber=$query->param('bib');
20 # change back when ive fixed request.pl
21 my @items = &ItemInfo(undef, $biblionumber, 'opac');
22 my $dat = &bibdata($biblionumber);
23 my ($authorcount, $addauthor) = &addauthor($biblionumber);
24 my ($webbiblioitemcount, @webbiblioitems) = &getwebbiblioitems($biblionumber);
25 my ($websitecount, @websites) = &getwebsites($biblionumber);
27 $dat->{'count'}=@items;
29 $dat->{'additional'}=$addauthor->[0]->{'author'};
30 for (my $i = 1; $i < $authorcount; $i++) {
31 $dat->{'additional'} .= "|" . $addauthor->[$i]->{'author'};
38 my $resultsarray=\@results;
39 my $itemsarray=\@items;
40 my $webarray=\@webbiblioitems;
41 my $sitearray=\@websites;
44 my $startfrom=$query->param('startfrom');
45 ($startfrom) || ($startfrom=0);
49 # now to get the items into a hash we can use and whack that thru
50 $template->param(startfrom => $startfrom+1);
51 $template->param(endat => $startfrom+20);
52 $template->param(numrecords => $count);
53 my $nextstartfrom=($startfrom+20<$count-20) ? ($startfrom+20) : ($count-20);
54 my $prevstartfrom=($startfrom-20>0) ? ($startfrom-20) : (0);
55 $template->param(nextstartfrom => $nextstartfrom);
56 $template->param(prevstartfrom => $prevstartfrom);
58 $template->param(BIBLIO_RESULTS => $resultsarray);
59 $template->param(ITEM_RESULTS => $itemsarray);
60 $template->param(WEB_RESULTS => $webarray);
61 $template->param(SITE_RESULTS => $sitearray);
63 print "Content-Type: text/html\n\n", $template->output;