4 use C4::Output; # contains gettemplate
13 $flagsrequired->{borrow}=1;
15 my ($loggedinuser, $cookie, $sessionID) = checkauth($query, 1, $flagsrequired);
18 my $template = gettemplate ("opac-detail.tmpl", "opac");
20 $template->param(loggedinuser => $loggedinuser);
22 my $biblionumber=$query->param('bib');
23 $template->param(biblionumber => $biblionumber);
26 # change back when ive fixed request.pl
27 my @items = &ItemInfo(undef, $biblionumber, 'opac');
28 my $dat = &bibdata($biblionumber);
29 my ($authorcount, $addauthor) = &addauthor($biblionumber);
30 my ($webbiblioitemcount, @webbiblioitems) = &getwebbiblioitems($biblionumber);
31 my ($websitecount, @websites) = &getwebsites($biblionumber);
33 $dat->{'count'}=@items;
35 $dat->{'additional'}=$addauthor->[0]->{'author'};
36 for (my $i = 1; $i < $authorcount; $i++) {
37 $dat->{'additional'} .= "|" . $addauthor->[$i]->{'author'};
41 foreach my $itm (@items) {
42 $norequests = 0 unless $itm->{'notforloan'};
45 $template->param(norequests => $norequests);
53 my $resultsarray=\@results;
54 my $itemsarray=\@items;
55 my $webarray=\@webbiblioitems;
56 my $sitearray=\@websites;
59 my $startfrom=$query->param('startfrom');
60 ($startfrom) || ($startfrom=0);
64 # now to get the items into a hash we can use and whack that thru
65 $template->param(startfrom => $startfrom+1);
66 $template->param(endat => $startfrom+20);
67 $template->param(numrecords => $count);
68 my $nextstartfrom=($startfrom+20<$count-20) ? ($startfrom+20) : ($count-20);
69 my $prevstartfrom=($startfrom-20>0) ? ($startfrom-20) : (0);
70 $template->param(nextstartfrom => $nextstartfrom);
71 $template->param(prevstartfrom => $prevstartfrom);
73 $template->param(BIBLIO_RESULTS => $resultsarray);
74 $template->param(ITEM_RESULTS => $itemsarray);
75 $template->param(WEB_RESULTS => $webarray);
76 $template->param(SITE_RESULTS => $sitearray);
78 print "Content-Type: text/html\n\n", $template->output;