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');
34 my $type=$query->param('type');
36 # change back when ive fixed request.pl
37 my @items = ItemInfo(undef, $biblionumber, $type);
38 foreach my $dat (@items){
41 my $dat=bibdata($biblionumber);
42 my ($authorcount, $addauthor)= &addauthor($biblionumber);
43 my ($webbiblioitemcount, @webbiblioitems) = &getwebbiblioitems($biblionumber);
44 my ($websitecount, @websites) = &getwebsites($biblionumber);
46 $dat->{'count'}=@items;
48 $dat->{'additional'}=$addauthor->[0]->{'author'};
49 for (my $i = 1; $i < $authorcount; $i++) {
50 $dat->{'additional'} .= "|" . $addauthor->[$i]->{'author'};
57 my $resultsarray=\@results;
58 my $itemsarray=\@items;
59 my $webarray=\@webbiblioitems;
60 my $sitearray=\@websites;
62 my $includes=$configfile{'includes'};
63 ($includes) || ($includes="/usr/local/www/hdl/htdocs/includes");
64 my $templatebase="catalogue/detail.tmpl";
65 my $startfrom=$query->param('startfrom');
66 ($startfrom) || ($startfrom=0);
67 my $theme=picktemplate($includes, $templatebase);
69 my $template = HTML::Template->new(filename => "$includes/templates/$theme/$templatebase", die_on_bad_params => 0, path => [$includes]);
73 # now to get the items into a hash we can use and whack that thru
76 $template->param(startfrom => $startfrom+1);
77 $template->param(endat => $startfrom+20);
78 $template->param(numrecords => $count);
79 my $nextstartfrom=($startfrom+20<$count-20) ? ($startfrom+20) : ($count-20);
80 my $prevstartfrom=($startfrom-20>0) ? ($startfrom-20) : (0);
81 $template->param(nextstartfrom => $nextstartfrom);
82 $template->param(prevstartfrom => $prevstartfrom);
83 # $template->param(template => $templatename);
84 # $template->param(search => $search);
85 $template->param(includesdir => $includes);
86 $template->param(BIBLIO_RESULTS => $resultsarray);
87 $template->param(ITEM_RESULTS => $itemsarray);
88 $template->param(WEB_RESULTS => $webarray);
89 $template->param(SITE_RESULTS => $sitearray);
90 print "Content-Type: text/html\n\n", $template->output;