6 use C4::Output; # contains picktemplate
13 my $language='french';
17 open (KC, "/etc/koha.conf");
21 if (/(.*)\s*=\s*(.*)/) {
24 # Clean up white space at beginning and end
29 $configfile{$variable}=$value;
33 my $biblionumber=$query->param('bib');
36 # change back when ive fixed request.pl
37 my @items = ItemInfo(undef, $biblionumber, $type);
38 my $dat=bibdata($biblionumber);
39 my ($authorcount, $addauthor)= &addauthor($biblionumber);
40 my ($webbiblioitemcount, @webbiblioitems) = &getwebbiblioitems($biblionumber);
41 my ($websitecount, @websites) = &getwebsites($biblionumber);
43 $dat->{'count'}=@items;
45 $dat->{'additional'}=$addauthor->[0]->{'author'};
46 for (my $i = 1; $i < $authorcount; $i++) {
47 $dat->{'additional'} .= "|" . $addauthor->[$i]->{'author'};
54 my $resultsarray=\@results;
55 my $itemsarray=\@items;
56 my $webarray=\@webbiblioitems;
57 my $sitearray=\@websites;
59 my $includes=$configfile{'includes'};
60 ($includes) || ($includes="/usr/local/www/hdl/htdocs/includes");
61 my $templatebase="catalogue/detail.tmpl";
62 my $startfrom=$query->param('startfrom');
63 ($startfrom) || ($startfrom=0);
64 my $theme=picktemplate($includes, $templatebase);
66 my $template = HTML::Template->new(filename => "$includes/templates/$theme/$templatebase", die_on_bad_params => 0, path => [$includes]);
70 # now to get the items into a hash we can use and whack that thru
73 $template->param(startfrom => $startfrom+1);
74 $template->param(endat => $startfrom+20);
75 $template->param(numrecords => $count);
76 my $nextstartfrom=($startfrom+20<$count-20) ? ($startfrom+20) : ($count-20);
77 my $prevstartfrom=($startfrom-20>0) ? ($startfrom-20) : (0);
78 $template->param(nextstartfrom => $nextstartfrom);
79 $template->param(prevstartfrom => $prevstartfrom);
80 # $template->param(template => $templatename);
81 # $template->param(search => $search);
82 $template->param(includesdir => $includes);
83 $template->param(BIBLIO_RESULTS => $resultsarray);
84 $template->param(ITEM_RESULTS => $itemsarray);
85 $template->param(WEB_RESULTS => $webarray);
86 $template->param(SITE_RESULTS => $sitearray);
87 print "Content-Type: text/html\n\n", $template->output;